HighLAND
ToyBoxTracker.cxx
1 #include "ToyBoxTracker.hxx"
2 #include <typeinfo>
3 
4 //********************************************************************
5 ToyBoxTracker::ToyBoxTracker():ToyBoxND280(){
6 //********************************************************************
7 
8  Vertex=NULL;
9  MainTrack=HMtrack=SHMtrack=HMNtrack=SHMNtrack=HMPtrack=SHMPtrack=NULL;
10  VetoTrack=NULL;
11  OOFVtrack=NULL;
12  NegativeTPCtracks = NULL;
13  PositiveTPCtracks = NULL;
14  nNegativeTPCtracks = 0;
15  nPositiveTPCtracks = 0;
16  nLikeComputed = 0;
17  nLikelihood = 0;
18 }
19 
20 //********************************************************************
21 ToyBoxTracker::~ToyBoxTracker(){
22 //********************************************************************
23 
24  if (NegativeTPCtracks) delete [] NegativeTPCtracks;
25  if (PositiveTPCtracks) delete [] PositiveTPCtracks;
26 }
27 
28 //********************************************************************
30 //********************************************************************
31 
32  if (!_ResetCheckDone){
33  if( typeid(*this) != typeid(ToyBoxTracker)){
34  std::cerr << "ERROR in ToyBoxTracker::Reset(). Either this mandatory method is not implemented "
35  << "by the derived class '" << typeid(*this).name() << "' "
36  << "or ToyBoxTracker::Reset() is called from the Reset method of the derived class. "
37  << "Please correct any of these bugs. " << std::endl;
38 
39  exit(1);
40  }
41  _ResetCheckDone=true;
42  }
43 
44 }
45 
46 //********************************************************************
48 //********************************************************************
49 
50  /// Must delete these objects, which are created in the steps when applying the selection.
51  /// TODO: should avoid that in the next version since multithreading requires
52  /// no heap allocation of memory
53  if (Vertex) delete Vertex;
54  if (NegativeTPCtracks) delete [] NegativeTPCtracks;
55  if (PositiveTPCtracks) delete [] PositiveTPCtracks;
56 
57  Vertex=NULL;
58  MainTrack=HMtrack=SHMtrack=HMNtrack=SHMNtrack=HMPtrack=SHMPtrack=NULL;
59  VetoTrack=NULL;
60  OOFVtrack=NULL;
61  NegativeTPCtracks = NULL;
62  PositiveTPCtracks = NULL;
63  nNegativeTPCtracks = 0;
64  nPositiveTPCtracks = 0;
65  nLikeComputed = 0;
66  nLikelihood = 0;
67 
69 }
70 
virtual void ResetBase()
Reset this base class.
virtual void Reset()
This method should be implemented by the derived class. If so it does nothing here.
virtual void ResetBase()
Reset this base class.
Definition: ToyBoxND280.cxx:30