HighLAND
p0dExampleSelection.hxx
1 #ifndef p0dExampleSelection_h
2 #define p0dExampleSelection_h
3 
4 #include "SelectionBase.hxx"
5 #include "Parameters.hxx"
6 #include "P0DDataClasses.hxx"
7 #include "ToyBoxND280.hxx"
8 
9 //---- Define an specific box for this selection -------
10 class ToyBoxP0D: public ToyBoxND280{
11 
12 public:
13  ToyBoxP0D(){
14  Reset();
15  }
16 
17  virtual void Reset(){
18 
19  if (!_ResetCheckDone){
20  if( typeid(*this) != typeid(ToyBoxP0D)){
21  std::cerr << "ERROR in ToyBoxP0D::Reset(). Either this mandatory method is not implemented "
22  << "by the derived class '" << typeid(*this).name() << "' "
23  << "or ToyBoxP0D::Reset() is called from the Reset method of the derived class. "
24  << "Please correct any of these bugs. " << std::endl;
25 
26  exit(1);
27  }
28  _ResetCheckDone=true;
29  }
30  }
31 
32  /// Reset this base class
33  virtual void ResetBase(){
34  nShowers = 0;
35  Shower1=Shower2=NULL;
36  nTracks = 0;
38  }
39 
40 
41 
42  virtual ~ToyBoxP0D(){}
43 
44  Short_t nShowers;
45  AnaP0DParticle* Shower1;
46  AnaP0DParticle* Shower2;
47 
48  Short_t nTracks;
49 };
50 
51 
52 
53 
54 
56 
57 public:
58  p0dExampleSelection(bool forcebreak=true);
59  virtual ~p0dExampleSelection(){}
60 
61  //************************Mandatory Functions ****************
62 
63  void DefineSteps();
64  void DefineDetectorFV();
65 
66  ToyBoxB* MakeToyBox() {return new ToyBoxP0D();}
67 
68  void InitializeEvent(AnaEventC& event);
69 
70  //************************************************************
71 
72 };
73 
75 public:
76  using StepBase::Apply;
77  bool Apply(AnaEventC& event, ToyBoxB& box) const;
79 };
80 
81 
82 class TwoShowersCut : public StepBase {
83 public:
84  using StepBase::Apply;
85  bool Apply(AnaEventC& event, ToyBoxB& box) const;
86  StepBase* MakeClone(){return new TwoShowersCut();}
87 };
88 
89 class NoTracksCut : public StepBase {
90 public:
91  using StepBase::Apply;
92  bool Apply(AnaEventC& event, ToyBoxB& box) const;
93  StepBase* MakeClone(){return new NoTracksCut();}
94 };
95 
97 public:
98  using StepBase::Apply;
99  bool Apply(AnaEventC& event, ToyBoxB& box) const;
101 };
102 
103 
105 public:
106  using StepBase::Apply;
107  bool Apply(AnaEventC& event, ToyBoxB& box) const;
109 };
110 
111 
112 #endif
ToyBoxB * MakeToyBox()
Create the appropriate type of box.
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
virtual bool Apply(AnaEventC &event, ToyBoxB &box) const
Definition: StepBase.hxx:46
virtual void ResetBase()
Reset this base class.
Definition: ToyBoxND280.cxx:30
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.
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!