HighLAND
ToyBoxB.cxx
1 #include "ToyBoxB.hxx"
2 #include <typeinfo>
3 
4 //********************************************************************
5 ToyBoxB::ToyBoxB(){
6 //********************************************************************
7 
8  AccumLevel = NULL;
9  MaxAccumLevel=-1;
10  BranchPassed=NULL;
12  SuccessfulBranch = -1;
13  DetectorFV = UNASSIGNEDID;
14  nBranches=0;
15 
16  // The pressence of the Reset method in the derived class was not checked yet
17  _ResetCheckDone=false;
18 }
19 
20 //********************************************************************
21 ToyBoxB::~ToyBoxB(){
22 //********************************************************************
23 
24  if (AccumLevel) delete [] AccumLevel;
25  if (BranchPassed) delete [] BranchPassed;
26 }
27 
28 //********************************************************************
30 //********************************************************************
31 
32  if (!_ResetCheckDone){
33  if( typeid(*this) != typeid(ToyBoxB)){
34  std::cerr << "ERROR in ToyBoxB::Reset(). Either this mandatory method is not implemented "
35  << "by the derived class '" << typeid(*this).name() << "' "
36  << "or ToyBoxB::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  SoftReset();
51 }
52 
53 
54 //********************************************************************
56 //********************************************************************
57 
58  MaxAccumLevel=0;
59  for (UInt_t i=0;i<nBranches;i++){
60  AccumLevel[i]=0;
61  BranchPassed[i]=true;
62  }
63  SuccessfulBranch = -1;
64 }
Int_t MaxAccumLevel
Definition: ToyBoxB.hxx:39
Int_t SelectionEnabledIndex
The enabled index of this selection this ToyBox belongs to.
Definition: ToyBoxB.hxx:49
SubDetId_h DetectorFV
Indicate the FV we are interested in.
Definition: ToyBoxB.hxx:52
UInt_t nBranches
The number of branches in the selection this ToyBox belongs to.
Definition: ToyBoxB.hxx:32
Int_t SuccessfulBranch
The branch that is successful for this toy in the selection this ToyBox belongs to.
Definition: ToyBoxB.hxx:46
void SoftReset()
Reset the ToyBoxB.
Definition: ToyBoxB.cxx:55
Int_t * AccumLevel
Accum level for each branch in this toy in the selection this ToyBox belongs to.
Definition: ToyBoxB.hxx:35
virtual void Reset()=0
Mandatory method to be implemented by the derived class. Reset the top level derived box...
Definition: ToyBoxB.cxx:29
virtual void ResetBase()=0
Mandatory method to be implemented by the derived class. Reset the base class for the top level box...
Definition: ToyBoxB.cxx:47
bool * BranchPassed
Definition: ToyBoxB.hxx:43