HighLAND
tutorialBranchesSelection.hxx
1 #ifndef tutorialBranchesSelection_h
2 #define tutorialBranchesSelection_h
3 
4 #include "SelectionBase.hxx"
5 #include "SubDetId.hxx"
6 #include "ToyBoxTracker.hxx"
7 
8 /* In this file there is an example of selection with several branches. The CopySteps method is also used to copy steps from tutorialSelection
9  to this selection. Four new steps are added on top of the tutorialSelection, one for each of the three branches defined:
10  1. Only one TPC track
11  2. Two TPC tracks
12  3. More than two TPC tracks
13  3. More than two TPC tracks with more than 65 nodes in the closest TPC to the vertex
14 
15  Two define a selection you need in this file:
16  - If a specific box is needed (the ToyBoxB is not sufficient) define it first such that it known when the Selection is defined
17  - Declare the selection inheriting from SelectionBase or another existing selection
18  - Declare all steps needed by the selection
19 */
20 
21 //---- Define an specific box for this selection -------
23 
24 public:
26  nLongTPCTracks = 0;
27  }
28 
29  virtual void Reset(){
30  nLongTPCTracks = 0;
31  }
32 
33  virtual ~ToyBoxTutorial(){}
34 
35  // number of TPC tracks with more that 65 nodes
36  int nLongTPCTracks;
37 };
38 
39 //---- Define the class for the new selection, which should inherit from SelectionBase or from another existing selection -------
41 
42 public:
43  tutorialBranchesSelection(bool forceBreak=true);
44  virtual ~tutorialBranchesSelection(){}
45 
46  ///========= These are mandatory functions ==================
47 
48  /// In this method all steps are added to the selection
49  void DefineSteps();
50 
51  /// Set detector FV
52  void DefineDetectorFV();
53 
54  /// Create a proper instance of the box (ToyBoxB) to store all relevent information to be passed from one step to the next
55  ToyBoxB* MakeToyBox() {return new ToyBoxTutorial();}
56 
57  /// Fill the EventBox with the objects needed by this selection
58  void InitializeEvent(AnaEventC& event);
59 
60  //==========================================================
61 
62  //---- These are optional functions, needed by FITTERS but not by highland2 analyses --------------
63 
64  /// Fill the event summary information, which is needed by the fitters (BANFF, Mach3)
65  bool FillEventSummary(AnaEventC& event, Int_t allCutsPassed[]);
66 
67  /// Return the appropriate sample type (only needed by fitters)
68  SampleId::SampleEnum GetSampleEnum(){return SampleId::kFGD1NuMuCC0Pi;}
69 
70  /*
71  //---- These are optional functions, but recommended to customize systematics and increase speed --------------
72 
73  bool IsRelevantRecObjectForSystematic(const AnaEventC&, AnaTrackB*, Int_t syst_index, Int_t branch=0) const {(void)syst_index;(void)branch;return true;}
74  bool IsRelevantTrueObjectForSystematic(const AnaEventC&, AnaTrueParticleB*, Int_t syst_index, Int_t branch=0) const {(void)syst_index;(void)branch;return true;}
75  bool IsRelevantRecObjectForSystematicInToy(const AnaEventC&, const ToyBoxB&, AnaTrackB*, Int_t syst_index, Int_t branch=0) const {(void)syst_index;(void)branch;return true;}
76  bool IsRelevantTrueObjectForSystematicInToy(const AnaEventC&, const ToyBoxB&, AnaTrueParticleB*, Int_t syst_index, Int_t branch=0) const {(void)syst_index;(void)branch;return true;}
77  bool IsRelevantSystematic(const AnaEventC&, const ToyBoxB&, Int_t syst_index, Int_t branch=0) const {(void)syst_index;(void)branch;return true;}
78  bool CheckRedoSelection(const AnaEventB&, const ToyBoxB& PreviousToyBox, Int_t& redoFromStep){(void)PreviousToyBox;redoFromStep=0;return true;}
79 
80  */
81 
82 };
83 
84 //---- Define all steps -------
86  public:
87  using StepBase::Apply;
88  bool Apply(AnaEventC& event, ToyBoxB& box) const;
90 };
91 
92 class OneTPCTrackCut: public StepBase{
93  public:
94  using StepBase::Apply;
95  bool Apply(AnaEventC& event, ToyBoxB& box) const;
96  StepBase* MakeClone(){return new OneTPCTrackCut();}
97 };
98 
99 class TwoTPCTracksCut: public StepBase{
100  public:
101  using StepBase::Apply;
102  bool Apply(AnaEventC& event, ToyBoxB& box) const;
104 };
105 
107  public:
108  using StepBase::Apply;
109  bool Apply(AnaEventC& event, ToyBoxB& box) const;
111 };
112 
114  public:
115  using StepBase::Apply;
116  bool Apply(AnaEventC& event, ToyBoxB& box) const;
118 };
119 
121  public:
122  using StepBase::Apply;
123  bool Apply(AnaEventC& event, ToyBoxB& box) const;
125 };
126 
127 
128 #endif
ToyBoxB * MakeToyBox()
Create a proper instance of the box (ToyBoxB) to store all relevent information to be passed from one...
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
SampleId::SampleEnum GetSampleEnum()
Return the appropriate sample type (only needed by fitters)
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
virtual void Reset()
This method should be implemented by the derived class. If so it does nothing here.
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
virtual bool Apply(AnaEventC &event, ToyBoxB &box) const
Definition: StepBase.hxx:46