HighLAND
numuCC4piSelection.hxx
1 #ifndef numuCC4piSelection_h
2 #define numuCC4piSelection_h
3 
4 #include "SelectionBase.hxx"
5 #include "Parameters.hxx"
6 #include "ToyBoxTracker.hxx"
7 #include "EventBoxId.hxx"
8 #include "SystId.hxx"
9 #include "SubDetId.hxx"
10 
11 #include "ToFSenseCorrector.hxx"
12 
13 class numuCC4piSelection: public SelectionBase{
14 public:
15  numuCC4piSelection(bool forceBreak=true);
16  virtual ~numuCC4piSelection(){}
17 
18  //---- These are mandatory functions
19  void DefineSteps();
20  void DefineDetectorFV();
21  inline ToyBoxB* MakeToyBox();
22  bool FillEventSummary(AnaEventC& event, Int_t allCutsPassed[]);
23  SampleId::SampleEnum GetSampleEnum(){return SampleId::kFGD1NuMuCC;}
24  bool IsRelevantRecObjectForSystematic(const AnaEventC& event, AnaRecObjectC* recObj, SystId_h systId, Int_t branch) const;
25  bool IsRelevantRecObjectForSystematicInToy(const AnaEventC&, const ToyBoxB&, AnaRecObjectC*, SystId_h systId, Int_t branch=0) const;
26  bool IsRelevantTrueObjectForSystematic(const AnaEventC& event, AnaTrueObjectC* trueObj, SystId_h systId, Int_t branch) const;
27  bool IsRelevantTrueObjectForSystematicInToy(const AnaEventC&, const ToyBoxB&, AnaTrueObjectC*, SystId_h systId, Int_t branch=0) const;
28  bool IsRelevantSystematic(const AnaEventC& event, const ToyBoxB& box, SystId_h systId, Int_t branch) const;
29  void InitializeEvent(AnaEventC& event);
30  bool CheckRedoSelection(const AnaEventC& event, const ToyBoxB& PreviousToyBox, Int_t& redoFromStep);
31 
32 private:
33  ToFSenseCorrector _tofCorrector;
34 
35 };
36 
37 class ToyBoxCC4pi: public ToyBoxTracker{
38 
39 public:
40 
41  ToyBoxCC4pi() {
42  MainTrack = NULL;
43  LowAngle.clear(); HighAngle.clear();
44  FwdTracks.clear(); BwdTracks.clear(); HAFwdTracks.clear(); HABwdTracks.clear();
45  FwdTracks_Veto.clear(); BwdTracks_Veto.clear(); HAFwdTracks_Veto.clear(); HABwdTracks_Veto.clear();
46  FwdTracks_PID.clear(); BwdTracks_PID.clear(); HAFwdTracks_PID.clear(); HABwdTracks_PID.clear(); CSFD2Tracks_PID.clear(); CSECALTracks_PID.clear();
47  }
48 
49  virtual void Reset(){
50  ResetBase();
51  MainTrack = NULL;
52  LowAngle.clear(); HighAngle.clear();
53  FwdTracks.clear(); BwdTracks.clear(); HAFwdTracks.clear(); HABwdTracks.clear();
54  FwdTracks_Veto.clear(); BwdTracks_Veto.clear(); HAFwdTracks_Veto.clear(); HABwdTracks_Veto.clear();
55  FwdTracks_PID.clear(); BwdTracks_PID.clear(); HAFwdTracks_PID.clear(); HABwdTracks_PID.clear(); CSFD2Tracks_PID.clear(); CSECALTracks_PID.clear();
56  }
57 
58  virtual ~ToyBoxCC4pi(){}
59 
60  /// For storing tracks information in the bunch.
61  AnaTrackB* MainTrack;
62  std::vector<AnaTrackB*> LowAngle, HighAngle;
63  std::vector<AnaTrackB*> FwdTracks, BwdTracks, HAFwdTracks, HABwdTracks;
64  std::vector<AnaTrackB*> FwdTracks_Veto, BwdTracks_Veto, HAFwdTracks_Veto, HABwdTracks_Veto;
65  std::vector<AnaTrackB*> FwdTracks_PID, BwdTracks_PID, HAFwdTracks_PID, HABwdTracks_PID, CSFD2Tracks_PID, CSECALTracks_PID;
66 
67 };
68 
69 inline ToyBoxB* numuCC4piSelection::MakeToyBox() {return new ToyBoxCC4pi();}
70 
72 public:
73  using StepBase::Apply;
74  bool Apply(AnaEventC& event, ToyBoxB& box) const;
76 };
77 
78 namespace numuCC4pi{
80  public:
81  using StepBase::Apply;
82  bool Apply(AnaEventC& event, ToyBoxB& box) const;
84  };
85 
86  class SortTracksAction: public StepBase{
87  public:
88  using StepBase::Apply;
89  bool Apply(AnaEventC& event, ToyBoxB& box) const;
91  };
92 
93  class TrackGQandFVCut: public StepBase{
94  public:
95  using StepBase::Apply;
96  bool Apply(AnaEventC& event, ToyBoxB& box) const;
98  };
99 
100  class VetoAction: public StepBase{
101  public:
102  using StepBase::Apply;
103  bool Apply(AnaEventC& event, ToyBoxB& box) const;
104  StepBase* MakeClone(){return new VetoAction();}
105  };
106 
107  class PIDAction: public StepBase{
108  public:
109  using StepBase::Apply;
110  bool Apply(AnaEventC& event, ToyBoxB& box) const;
111  StepBase* MakeClone(){return new PIDAction();}
112  };
113 
114  class FindVertexAction: public StepBase{
115  public:
116  using StepBase::Apply;
117  bool Apply(AnaEventC& event, ToyBoxB& box) const;
119  };
120 
121  class Fwd_Quality: public StepBase{
122  public:
123  using StepBase::Apply;
124  bool Apply(AnaEventC& event, ToyBoxB& box) const;
125  StepBase* MakeClone(){return new Fwd_Quality();}
126  };
127  class Fwd_Veto: public StepBase{
128  public:
129  using StepBase::Apply;
130  bool Apply(AnaEventC& event, ToyBoxB& box) const;
131  StepBase* MakeClone(){return new Fwd_Veto();}
132  };
133  class Fwd_PID: public StepBase{
134  public:
135  using StepBase::Apply;
136  bool Apply(AnaEventC& event, ToyBoxB& box) const;
137  StepBase* MakeClone(){return new Fwd_PID();}
138  };
139  class Fwd: public StepBase{
140  public:
141  using StepBase::Apply;
142  bool Apply(AnaEventC& event, ToyBoxB& box) const;
143  StepBase* MakeClone(){return new Fwd();}
144  };
145 
146  class Bwd_Quality: public StepBase{
147  public:
148  using StepBase::Apply;
149  bool Apply(AnaEventC& event, ToyBoxB& box) const;
150  StepBase* MakeClone(){return new Bwd_Quality();}
151  };
152  class Bwd_Veto: public StepBase{
153  public:
154  using StepBase::Apply;
155  bool Apply(AnaEventC& event, ToyBoxB& box) const;
156  StepBase* MakeClone(){return new Bwd_Veto();}
157  };
158  class Bwd_PID: public StepBase{
159  public:
160  using StepBase::Apply;
161  bool Apply(AnaEventC& event, ToyBoxB& box) const;
162  StepBase* MakeClone(){return new Bwd_PID();}
163  };
164  class Bwd: public StepBase{
165  public:
166  using StepBase::Apply;
167  bool Apply(AnaEventC& event, ToyBoxB& box) const;
168  StepBase* MakeClone(){return new Bwd();}
169  };
170 
171  class HAFwd_Quality: public StepBase{
172  public:
173  using StepBase::Apply;
174  bool Apply(AnaEventC& event, ToyBoxB& box) const;
175  StepBase* MakeClone(){return new HAFwd_Quality();}
176  };
177  class HAFwd_Veto: public StepBase{
178  public:
179  using StepBase::Apply;
180  bool Apply(AnaEventC& event, ToyBoxB& box) const;
181  StepBase* MakeClone(){return new HAFwd_Veto();}
182  };
183  class HAFwd_PID: public StepBase{
184  public:
185  using StepBase::Apply;
186  bool Apply(AnaEventC& event, ToyBoxB& box) const;
187  StepBase* MakeClone(){return new HAFwd_PID();}
188  };
189  class HAFwd: public StepBase{
190  public:
191  using StepBase::Apply;
192  bool Apply(AnaEventC& event, ToyBoxB& box) const;
193  StepBase* MakeClone(){return new HAFwd();}
194  };
195 
196  class HABwd_Quality: public StepBase{
197  public:
198  using StepBase::Apply;
199  bool Apply(AnaEventC& event, ToyBoxB& box) const;
200  StepBase* MakeClone(){return new HABwd_Quality();}
201  };
202  class HABwd_Veto: public StepBase{
203  public:
204  using StepBase::Apply;
205  bool Apply(AnaEventC& event, ToyBoxB& box) const;
206  StepBase* MakeClone(){return new HABwd_Veto();}
207  };
208  class HABwd_PID: public StepBase{
209  public:
210  using StepBase::Apply;
211  bool Apply(AnaEventC& event, ToyBoxB& box) const;
212  StepBase* MakeClone(){return new HABwd_PID();}
213  };
214  class HABwd: public StepBase{
215  public:
216  using StepBase::Apply;
217  bool Apply(AnaEventC& event, ToyBoxB& box) const;
218  StepBase* MakeClone(){return new HABwd();}
219  };
220 }
221 namespace numuCC4pi_utils{
222 
223  const Float_t LAFVmin[3] = {57.66, 57.66, 10.125};
224  const Float_t LAFVmax[3] = {57.66, 57.66, 0.};
225  const Float_t HAFVmin[3] = {57.66, 57.66, 10.125};
226  const Float_t HAFVmax[3] = {57.66, 57.66, 10.125};
227 
228  const Float_t _FVdefminDsECal[3] = {40, 40, 25.}; // "z == 25." to reject peak near the DsECal beginning in both data and MC
229  const Float_t _FVdefmaxDsECal[3] = {40, 40, 18.17}; // reject last layer in both data and MC
230  const Float_t _FVdefminFGD2[3] = {76.88, 38.44, 0.}; //9.61*8, 9.61*4
231  const Float_t _FVdefmaxFGD2[3] = {76.88, 38.44, 10.125}; //9.61*8, 9.61*4
232 
233  int GetFgdLayer(Float_t* pos);
234  bool HGlobalMomFirst(AnaTrackB* a, AnaTrackB* b);
235  bool HRangeMomFirst(AnaTrackB* a, AnaTrackB* b);
236 
237  bool VetoCut(int topo, const AnaEventB& event, AnaTrackB& candidate);
238  bool ExternalCut(int topo, const AnaEventC& event, AnaTrackB& candidate);
239  int PIDCut(int topo, const AnaTrackB& candidate);
240 
241 }
242 
243 
244 #endif
bool IsRelevantSystematic(const AnaEventC &event, const ToyBoxB &box, SystId_h systId, Int_t branch) const
Is this systematic relevant for this selection.
bool IsRelevantRecObjectForSystematic(const AnaEventC &event, AnaRecObjectC *recObj, SystId_h systId, Int_t branch) const
Is this track relevant for a given systematic (prior to selection, call when initializing the event...
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
bool CheckRedoSelection(const AnaEventC &event, const ToyBoxB &PreviousToyBox, Int_t &redoFromStep)
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 !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
void DefineSteps()
Define all steps in the selection.
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
virtual bool Apply(AnaEventC &event, ToyBoxB &box) const
Definition: StepBase.hxx:46
bool IsRelevantTrueObjectForSystematicInToy(const AnaEventC &, const ToyBoxB &, AnaTrueObjectC *, SystId_h systId, Int_t branch=0) const
Is this true track relevant for a given systematic (after selection, called for each toy) ...
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
void InitializeEvent(AnaEventC &event)
Fill the EventBox with the objects needed by this selection.
Representation of a global track.
bool Apply(AnaEventC &event, bool &redo)
Apply all steps in the selection.
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
ToyBoxB * MakeToyBox()
Create the appropriate type of box.
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
void DefineDetectorFV()
Define the detector Fiducial Volume in which this selection is applied.
bool IsRelevantTrueObjectForSystematic(const AnaEventC &event, AnaTrueObjectC *trueObj, SystId_h systId, Int_t branch) const
Is this true track relevant for a given systematic (prior to selection, call when initializing the ev...
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
ToyBoxB ** PreviousToyBox
Array of pointers to the PreviousToyBox (for each event)
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
bool IsRelevantRecObjectForSystematicInToy(const AnaEventC &, const ToyBoxB &, AnaRecObjectC *, SystId_h systId, Int_t branch=0) const
Is this track relevant for a given systematic (after selection, called for each toy) ...
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!