HighLAND
tutorialSelection.hxx
1 #ifndef tutorialSelection_h
2 #define tutorialSelection_h
3 
4 #include "SelectionBase.hxx"
5 #include "Parameters.hxx"
6 #include "ToyBoxTracker.hxx"
7 
8 /* In this file there is an example of selection with a single branch. This is identical to the numuCCSelection (under psycheSelections)
9  used by the numuCCAnalysis in highland2.
10  Two define a selection you need in this file:
11  - If a specific box is needed (the ToyBoxB is not sufficient) define it first such that it is known when the Selection is defined
12  - Declare the selection inheriting from SelectionBase or another existing selection
13  - Declare all steps needed by the selection
14 */
15 
16 /* CHANGES IN NEW VERSION
17 
18 */
19 
20 
21 //---- Define the class for the new selection, which should inherit from SelectionBase or from another existing selection -------
23  public:
24  tutorialSelection(bool forceBreak=true);
25  virtual ~tutorialSelection(){}
26 
27 
28  ///========= These are mandatory functions ==================
29 
30  /// In this method all steps are added to the selection
31  void DefineSteps();
32 
33  /// Set detector FV
34  void DefineDetectorFV();
35 
36  /// Create a proper instance of the box (ToyBoxB) to store all relevant
37  /// information to be passed from one step to the next
38  ToyBoxB* MakeToyBox() {return new ToyBoxTracker();}
39 
40  /// Fill the EventBox with the objects needed by this selection
41  void InitializeEvent(AnaEventC& event);
42 
43  //==========================================================
44 
45 
46  //---- These are optional functions, needed by FITTERS but not by highland2 analyses --------------
47 
48  bool FillEventSummary(AnaEventC& event, Int_t allCutsPassed[]);
49  SampleId::SampleEnum GetSampleEnum(){return SampleId::kFGD1NuMuCC;}
50 
51  /*
52  //---- These are optional functions, but recommended to customize systematics and increase speed --------------
53 
54  bool IsRelevantRecObjectForSystematic(const AnaEventC&, AnaTrackB*, Int_t syst_index, Int_t branch=0) const {(void)syst_index;(void)branch;return true;}
55  bool IsRelevantTrueObjectForSystematic(const AnaEventC&, AnaTrueParticleB*, Int_t syst_index, Int_t branch=0) const {(void)syst_index;(void)branch;return true;}
56  bool IsRelevantRecObjectForSystematicInToy(const AnaEventC&, const ToyBoxB&, AnaTrackB*, Int_t syst_index, Int_t branch=0) const {(void)syst_index;(void)branch;return true;}
57  bool IsRelevantTrueObjectForSystematicInToy(const AnaEventC&, const ToyBoxB&, AnaTrueParticleB*, Int_t syst_index, Int_t branch=0) const {(void)syst_index;(void)branch;return true;}
58  bool IsRelevantSystematic(const AnaEventC&, const ToyBoxB&, Int_t syst_index, Int_t branch=0) const {(void)syst_index;(void)branch;return true;}
59  bool CheckRedoSelection(const AnaEventB&, const ToyBoxB& PreviousToyBox, Int_t& redoFromStep){(void)PreviousToyBox;redoFromStep=0;return true;}
60 
61  */
62 };
63 
64 ///---- Define all steps -------
66 public:
67  using StepBase::Apply;
68  bool Apply(AnaEventC& event, ToyBoxB& box) const;
70 };
71 
73  public:
74  using StepBase::Apply;
75  bool Apply(AnaEventC& event, ToyBoxB& box) const;
77 };
78 
79 class TotalMultiplicityCut: public StepBase{
80  public:
81  using StepBase::Apply;
82  bool Apply(AnaEventC& event, ToyBoxB& box) const;
84 };
85 
86 class MuonPIDCut: public StepBase{
87  public:
88  MuonPIDCut(){
89  _prod5Cut = false;
90  }
91  using StepBase::Apply;
92  bool Apply(AnaEventC& event, ToyBoxB& box) const;
93  StepBase* MakeClone(){return new MuonPIDCut();}
94  private:
95  bool _prod5Cut;
96 };
97 
98 class ExternalVetoCut: public StepBase{
99  public:
100  using StepBase::Apply;
101  bool Apply(AnaEventC& event, ToyBoxB& box) const;
103 };
104 
105 class DeltaZCut: public StepBase{
106  public:
107  using StepBase::Apply;
108  bool Apply(AnaEventC& event, ToyBoxB& box) const;
109  StepBase* MakeClone(){return new DeltaZCut();}
110 };
111 
113  public:
114  using StepBase::Apply;
115  bool Apply(AnaEventC& event, ToyBoxB& box) const;
117 };
118 
119 /// Leading tracks with good quality in FGD1
121  public:
122  using StepBase::Apply;
123  bool Apply(AnaEventC& event, ToyBoxB& box) const;
125 };
126 
127 /// Find the Vertex. For the moment it's just the Star position of the HM track
128 class FindVertexAction: public StepBase{
129  public:
130  using StepBase::Apply;
131  bool Apply(AnaEventC& event, ToyBoxB& box) const;
133 };
134 
135 
137  public:
138  using StepBase::Apply;
139  bool Apply(AnaEventC& event, ToyBoxB& box) const;
141 };
142 
144  public:
145  using StepBase::Apply;
146  bool Apply(AnaEventC& event, ToyBoxB& box) const;
148 };
149 
150 
151 #endif
-— Define all steps ----—
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
void DefineDetectorFV()
Set detector FV.
void DefineSteps()
========= These are mandatory functions ==================
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
Leading tracks with good quality in FGD1.
virtual bool Apply(AnaEventC &event, ToyBoxB &box) const
Definition: StepBase.hxx:46
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
bool Apply(AnaEventC &event, bool &redo)
Apply all steps in the selection.
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
Find the Vertex. For the moment it's just the Star position of the HM track.
void InitializeEvent(AnaEventC &event)
Fill the EventBox with the objects needed by this selection.
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!