HighLAND
antiNumuCCMultiPiSelection.hxx
1 #ifndef antiNumuCCMultiPiSelection_h
2 #define antiNumuCCMultiPiSelection_h
3 
4 #include "SelectionBase.hxx"
5 #include "antiNumuCCSelection.hxx"
6 
8 public:
9  antiNumuCCMultiPiSelection(bool forceBreak=true);
10  virtual ~antiNumuCCMultiPiSelection(){}
11 
12  //---- These are mandatory functions
13  void DefineSteps();
14  void DefineDetectorFV();
16  bool FillEventSummary(AnaEventC& event, Int_t allCutsPassed[]);
17  SampleId::SampleEnum GetSampleEnum(){return SampleId::kFGD1AntiNuMuCC1Track;}
18  bool IsRelevantRecObjectForSystematic(const AnaEventC& event, AnaRecObjectC* recObj, SystId_h systId, Int_t branch) const;
19  bool IsRelevantTrueObjectForSystematic(const AnaEventC& event, AnaTrueObjectC* trueObj, SystId_h systId, Int_t branch) const;
20  bool IsRelevantSystematic(const AnaEventC& event, const ToyBoxB& box, SystId_h systId, Int_t branch) const;
21  void InitializeEvent(AnaEventC& event);
22  bool CheckRedoSelection(const AnaEventC& event, const ToyBoxB& PreviousToyBox, Int_t& redoFromStep);
23 
24 protected:
25  antiNumuCCSelection _antiNumuCCSelection;
26 
27  Int_t _MuonPIDCutIndex;
28  Int_t _FindPionsStepIndex;
29 
30 };
31 
32 
34 
35 public:
37  nPositivePionTPCtracks = 0;
38  nNegativePionTPCtracks = 0;
39  nMichelElectrons = 0;
40  nIsoFGDPiontracks = 0;
41  nPosPi0TPCtracks = 0;
42  nElPi0TPCtracks = 0;
43  nIsoFGDElPi0tracks = 0;
44  nPosPions = 0;
45  nOtherPions = 0;
46 
47  // For ECal Pi0 veto
48  ISOEcal.clear();
49  HObject = NULL;
50  Pi0Ecaltrack = NULL;
51  nPi0Ecaltracks = 0;
52 
53  for( int i = 0; i < 100; i ++){
54  PositivePionTPCtracks[i] = NULL;
55  NegativePionTPCtracks[i] = NULL;
56  MichelElectrons[i] = NULL;
57  IsoFGDPiontracks[i] = NULL;
58  PosPi0TPCtracks[i] = NULL;
59  ElPi0TPCtracks[i] = NULL;
60  IsoFGDElPi0tracks[i] = NULL;
61  }
62  }
63 
64  virtual ~ToyBoxAntiCCMultiPi(){}
65 
66  void Reset(){
67  for( int i = 0; i <nPositivePionTPCtracks ; i ++)
68  PositivePionTPCtracks[i] = NULL;
69  for( int i = 0; i <nNegativePionTPCtracks ; i ++)
70  NegativePionTPCtracks[i] = NULL;
71  for( int i = 0; i <nMichelElectrons ; i ++)
72  MichelElectrons[i] = NULL;
73  for( int i = 0; i <nIsoFGDPiontracks ; i ++)
74  IsoFGDPiontracks[i] = NULL;
75  for( int i = 0; i <nPosPi0TPCtracks ; i ++)
76  PosPi0TPCtracks[i] = NULL;
77  for( int i = 0; i <nElPi0TPCtracks ; i ++)
78  ElPi0TPCtracks[i] = NULL;
79  for( int i = 0; i <nIsoFGDElPi0tracks ; i ++)
80  IsoFGDElPi0tracks[i] = NULL;
81 
82  nPositivePionTPCtracks = 0;
83  nNegativePionTPCtracks = 0;
84  nMichelElectrons = 0;
85  nIsoFGDPiontracks = 0;
86  nPosPi0TPCtracks = 0;
87  nElPi0TPCtracks = 0;
88  nIsoFGDElPi0tracks = 0;
89  nPosPions = 0;
90  nNegPions = 0;
91  nOtherPions = 0;
92 
93  ISOEcal.clear();
94  HObject = NULL;
95  Pi0Ecaltrack = NULL;
96  nPi0Ecaltracks = 0;
97  }
98 
99  // positive TPC pion candidates
100  AnaTrackB* PositivePionTPCtracks[100];
101  int nPositivePionTPCtracks;
102 
103  // negative TPC pion candidates
104  AnaTrackB* NegativePionTPCtracks[100];
105  int nNegativePionTPCtracks;
106 
107  // Michel Electron candidates
108  AnaFgdTimeBinB* MichelElectrons[100];
109  int nMichelElectrons;
110 
111  // IsoFGD Pion candidates
112  AnaTrackB* IsoFGDPiontracks[100];
113  int nIsoFGDPiontracks;
114 
115  // Electrons and positrons from Pio in the TPC
116  AnaTrackB* PosPi0TPCtracks[100];
117  AnaTrackB* ElPi0TPCtracks[100];
118  int nPosPi0TPCtracks;
119  int nElPi0TPCtracks;
120 
121  // IsoFGD electron and positron candidates
122  AnaTrackB* IsoFGDElPi0tracks[100];
123  int nIsoFGDElPi0tracks;
124 
125  int nPosPions;
126  int nNegPions;
127  int nOtherPions;
128 
129  // isoECal track
130  std::vector<AnaTrackB*> ISOEcal;
131  // Most energetic object in ECal
132  AnaTrackB* HObject;
133  // Candidate Pi0 from Ecal veto
134  AnaTrackB* Pi0Ecaltrack;
135 
136  int nPi0Ecaltracks;
137 };
138 
140 
141 namespace antinumuCCMultiPiUtils{
142  //From NumuCCBANFF Standard Actions.
143  void FindTPCPions(AnaEventC& event, ToyBoxB& box, SubDetId::SubDetEnum det, bool useOldSecondaryPID);
144  void FindIsoFGDPions(AnaEventC& event, ToyBoxB& box, SubDetId::SubDetEnum det);
145  void FindIsoFGDElPi0(AnaEventC& event, ToyBoxB& box, SubDetId::SubDetEnum det);
146  void FindMEPions(AnaEventC& event, SubDetId::SubDetEnum det, bool prod5Cut = 0);
147 
148  //From NumuCCBANFF Analysis Utils.
149  bool TPCpionSelection(AnaTrackB *track);
150  bool TPCElPi0Selection(AnaTrackB *track);
151  bool FGDpionSelection(AnaTrackB *track, SubDetId::SubDetEnum det);
152  bool FGDElPi0Selection(AnaEventC& event, ToyBoxB& box, AnaTrackB *track, SubDetId::SubDetEnum det);
153 
154  // For ECal Pi0 veto
155  bool ECALPi0Selection(AnaEventC& event, ToyBoxB& box, AnaTrackB *HO, int MostUpstreamLayerHitCut, SubDetId::SubDetEnum det);
156 }
157 
159 public:
160  using StepBase::Apply;
161  bool Apply(AnaEventC& event, ToyBoxB& box) const;
163 };
164 
166 public:
167  using StepBase::Apply;
168  bool Apply(AnaEventC& event, ToyBoxB& box) const;
170 };
171 
173 public:
174  using StepBase::Apply;
175  bool Apply(AnaEventC& event, ToyBoxB& box) const;
177 };
178 
180 public:
181  using StepBase::Apply;
182  bool Apply(AnaEventC& event, ToyBoxB& box) const;
184 };
185 
187 public:
188  using StepBase::Apply;
190  useTPCPions = (bool)ND::params().GetParameterI("psycheSelections.antinumuCCMultiPi.UseTPCPions");
191  useME = (bool)ND::params().GetParameterI("psycheSelections.antinumuCCMultiPi.UseME");
192  useFGDPions = (bool)ND::params().GetParameterI("psycheSelections.antinumuCCMultiPi.UseFGDPions");
193  useOldSecondaryPID = (bool) ND::params().GetParameterI("psycheSelections.antinumuCCMultiPi.OldSecondaryPID");
194  prod5Cut = (bool)ND::params().GetParameterI("psycheSelections.antinumuCCMultiPi.Prod5Cuts");
195  }
196  bool useTPCPions;
197  bool useME;
198  bool useFGDPions;
199  bool useOldSecondaryPID;
200  bool prod5Cut;
201 
202  bool Apply(AnaEventC& event, ToyBoxB& box) const;
204 };
205 
207 public:
208  using StepBase::Apply;
210  MostUpstreamLayerHitCut = (bool)ND::params().GetParameterI("psycheSelections.antinumuCCMultiPi.MostUpstreamLayerHitCut");
211  prod5Cut = (bool)ND::params().GetParameterI("psycheSelections.antinumuCCMultiPi.Prod5Cuts");
212  }
213  int MostUpstreamLayerHitCut;
214  bool prod5Cut;
215 
216  bool Apply(AnaEventC& event, ToyBoxB& box) const;
218 };
219 
221 public:
222  using StepBase::Apply;
223  bool Apply(AnaEventC& event, ToyBoxB& box) const;
225 };
226 
227 
228 
229 #endif
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
bool IsRelevantSystematic(const AnaEventC &event, const ToyBoxB &box, SystId_h systId, Int_t branch) const
Is this systematic relevant for this selection.
int GetParameterI(std::string)
Get parameter. Value is returned as integer.
Definition: Parameters.cxx:217
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
void InitializeEvent(AnaEventC &event)
Fill the EventBox with the objects needed by this selection.
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 !!!
void DefineSteps()
Define all steps in the selection.
bool CheckRedoSelection(const AnaEventC &event, const ToyBoxB &PreviousToyBox, Int_t &redoFromStep)
SubDetEnum
Enumeration of all detector systems and subdetectors.
Definition: SubDetId.hxx:25
virtual bool Apply(AnaEventC &event, ToyBoxB &box) const
Definition: StepBase.hxx:46
ToyBoxB * MakeToyBox()
Create the appropriate type of box.
Representation of a global track.
bool Apply(AnaEventC &event, bool &redo)
Apply all steps in the selection.
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
void DefineDetectorFV()
Define the detector Fiducial Volume in which this selection is applied.
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
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...
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...
ToyBoxB ** PreviousToyBox
Array of pointers to the PreviousToyBox (for each event)