HighLAND
numuCCSelection.cxx
1 #include "numuCCSelection.hxx"
2 #include "baseSelection.hxx"
3 #include "SystematicTuning.hxx"
4 #include "CutUtils.hxx"
5 #include "EventBoxUtils.hxx"
6 #include "VersioningUtils.hxx"
7 #include "SystematicUtils.hxx"
8 #include "trackerSelectionUtils.hxx"
9 
10 
11 /*
12  \\! [numuCCSelection_info]
13 
14  <table>
15  <tr><th> #cut <th> cut class <th> defined in file <th> Cut description
16  <tr><td> 1 <td> EventQualityCut::Apply <td> baseSelection.cxx <td> Event quality: good detector and beam quality flags
17  <tr><td> 2 <td> TotalMultiplicityCut::Apply <td> numuCCSelection.cxx <td> Total multiplicity cut: at least one track with TPC segments
18  <tr><td> 3 <td> FindLeadingTracksAction::Apply,
19  FindVertexAction::Apply,
20  TrackQualityFiducialCut::Apply <td> numuCCSelection.cxx <td> Select muon candidate as the highest momentum negative (HMN)
21  track with more than 18 clusters in the TPC and initial position in the FGD FV
22  <tr><td> 4 <td> ExternalVetoCut::Apply <td> numuCCSelection.cxx <td> External veto cut
23  <tr><td> 5 <td> ExternalFGD1lastlayersCut::Apply <td> numuCCSelection.cxx <td> External FGD1 last layers cut
24  <tr><td> 6 <td> MuonPIDCut::Apply <td> numuCCSelection.cxx <td> Muon PID cut
25  </table>
26 
27  \\! [numuCCSelection_info]
28 */
29 
30 
31 
32 //********************************************************************
33 numuCCSelection::numuCCSelection(bool forceBreak): SelectionBase(forceBreak,EventBoxId::kEventBoxTracker) {
34 //********************************************************************
35 
36  // Initialize systematic tuning parameters
37  systTuning::Initialize();
38 }
39 
40 ///
41 /// This is the method where the actual steps are added to the selection
42 ///
43 //********************************************************************
45 //********************************************************************
46 
47  // Cuts must be added in the right order
48  // last "true" means the step sequence is broken if cut is not passed (default is "false")
49  AddStep(StepBase::kCut, "event quality", new EventQualityCut(), true);
50  AddStep(StepBase::kCut, "> 0 tracks ", new TotalMultiplicityCut(), true);
51  AddStep(StepBase::kAction, "find leading tracks",new FindLeadingTracksAction());
52  AddStep(StepBase::kAction, "find vertex", new FindVertexAction());
53  AddStep(StepBase::kAction, "fill_summary", new FillSummaryAction_numuCC());
54  AddStep(StepBase::kCut, "quality+fiducial", new TrackQualityFiducialCut(), true);
55  AddStep(StepBase::kAction, "find veto track", new FindVetoTrackAction());
56  AddStep(StepBase::kCut, "veto", new ExternalVetoCut());
57  AddStep(StepBase::kAction, "find oofv track", new FindOOFVTrackAction());
58  AddStep(StepBase::kCut, "External FGD1", new ExternalFGD1lastlayersCut());
59  AddStep(StepBase::kCut, "muon PID", new MuonPIDCut());
60 
61  SetBranchAlias(0,"trunk");
62 
63  // By default the preselection correspond to cuts 0-2.
64  // It means that if any of the three first cuts (0,1,2) is not passed
65  // the loop over toys will be broken ===> A single toy will be run
66  SetPreSelectionAccumLevel(2);
67 
68  // Step and Cut numbers needed by CheckRedoSelection
69  _MuonPIDCutIndex = GetCutNumber("muon PID");
70  _MuonPIDStepIndex = GetStepNumber("muon PID");
71  _FindLeadingTracksStepIndex = GetStepNumber("find leading tracks");
72  _TotalMultiplicityCutIndex = GetCutNumber("> 0 tracks ");
73 }
74 
75 //********************************************************************
77 //********************************************************************
78 
79  /// The detector in which the selection is applied
80  SetDetectorFV(SubDetId::kFGD1);
81 }
82 
83 //********************************************************************
84 bool numuCCSelection::FillEventSummary(AnaEventC& event, Int_t allCutsPassed[]){
85 //********************************************************************
86 
87  if(allCutsPassed[0]){
88  static_cast<AnaEventSummaryB*>(event.Summary)->EventSample = SampleId::kFGD1NuMuCC;
89  }
90  return (static_cast<AnaEventSummaryB*>(event.Summary)->EventSample != SampleId::kUnassigned);
91 }
92 
93 ///
94 /// Total multiplicity cut
95 ///
96 //**************************************************
97 bool TotalMultiplicityCut::Apply(AnaEventC& event, ToyBoxB& box) const{
98 //**************************************************
99 
100  (void)box;
101  // Check we have at least one reconstructed track in the TPC
102  EventBoxB* EventBox = event.EventBoxes[EventBoxId::kEventBoxTracker];
103  return (EventBox->nRecObjectsInGroup[EventBoxTracker::kTracksWithTPC]>0);
104 }
105 
106 //**************************************************
107 bool TrackQualityFiducialCut::Apply(AnaEventC& event, ToyBoxB& boxB) const{
108 //**************************************************
109 
110  (void)event;
111 
112  // Cast the ToyBox to the appropriate type
113  ToyBoxTracker& box = *static_cast<ToyBoxTracker*>(&boxB);
114 
115  return (box.Vertex);
116 }
117 
118 //**************************************************
119 bool MuonPIDCut::Apply(AnaEventC& event, ToyBoxB& boxB) const{
120 //**************************************************
121 
122  (void)event;
123 
124  // Cast the ToyBox to the appropriate type
125  ToyBoxTracker& box = *static_cast<ToyBoxTracker*>(&boxB);
126 
127  if (!box.MainTrack) return false;
128  if (box.MainTrack->Momentum < 0.) return false;
129  return cutUtils::MuonPIDCut(*(box.MainTrack), _prod5Cut);
130 }
131 
132 //********************************************************************
133 bool ExternalVetoCut::Apply(AnaEventC& event, ToyBoxB& boxB) const{
134 //********************************************************************
135 
136  (void)event;
137  // Cast the ToyBox to the appropriate type
138  ToyBoxTracker& box = *static_cast<ToyBoxTracker*>(&boxB);
139 
140  if (!box.MainTrack) return false;
141  return cutUtils::ExternalVetoCut(*(box.MainTrack),box.VetoTrack);
142 }
143 
144 //********************************************************************
145 bool ExternalFGD1lastlayersCut::Apply(AnaEventC& event, ToyBoxB& boxB) const{
146 //********************************************************************
147 
148  (void)event;
149  // Cast the ToyBox to the appropriate type
150  ToyBoxTracker& box = *static_cast<ToyBoxTracker*>(&boxB);
151 
152  /// Reject external background from the last 2 layers of FGD1
153  if (!box.MainTrack) return false;
154  if (!box.OOFVtrack) return true;
155  return (box.MainTrack->PositionStart[2]<425.);
156 }
157 
158 //**************************************************
159 bool FindVertexAction::Apply(AnaEventC& event, ToyBoxB& boxB) const{
160 //**************************************************
161 
162  (void)event;
163 
164  // Cast the ToyBox to the appropriate type
165  ToyBoxTracker& box = *static_cast<ToyBoxTracker*>(&boxB);
166 
167  // reset the vertex
168  if (box.Vertex) delete box.Vertex;
169  box.Vertex = NULL;
170 
171  // also the true vertex
172  box.TrueVertex = NULL;
173 
174  if (!box.MainTrack) return false;
175 
176  box.Vertex = new AnaVertexB();
177  anaUtils::CreateArray(box.Vertex->Particles, 1);
178 
179  box.Vertex->nParticles = 0;
180  box.Vertex->Particles[box.Vertex->nParticles++] = box.MainTrack;
181 
182  for(int i = 0; i < 4; ++i){
183  box.Vertex->Position[i] = box.MainTrack->PositionStart[i];
184  }
185  if( box.MainTrack->GetTrueParticle() ){
187  }
188  return true;
189 }
190 
191 //********************************************************************
193 //********************************************************************
194 
195  // Cast the ToyBox to the appropriate type
196  ToyBoxTracker& box = *static_cast<ToyBoxTracker*>(&boxB);
197 
198  if(!box.HMNtrack) return 1;
199 
200  static_cast<AnaEventSummaryB*>(event.Summary)->LeptonCandidate[SampleId::kFGD1NuMuCC] = box.HMNtrack;
201  for(int i = 0; i < 4; ++i){
202  static_cast<AnaEventSummaryB*>(event.Summary)->VertexPosition[SampleId::kFGD1NuMuCC][i] = box.HMNtrack->PositionStart[i];
203  }
204  if(box.HMNtrack->GetTrueParticle()) static_cast<AnaEventSummaryB*>(event.Summary)->TrueVertex[SampleId::kFGD1NuMuCC] = box.HMNtrack->GetTrueParticle()->TrueVertex;
205 
206  return true;
207 }
208 
209 //**************************************************
210 bool FindLeadingTracksAction::Apply(AnaEventC& event, ToyBoxB& boxB) const{
211 //**************************************************
212 
213  // Cast the ToyBox to the appropriate type
214  ToyBoxTracker& box = *static_cast<ToyBoxTracker*>(&boxB);
215 
216 
217  // Find leading tracks with good quality and only in FGD FV
218  trackerSelUtils::FindLeadingTracks(event,box);
219 
220  // For this selection the main track is the HMN track
221  box.MainTrack = box.HMNtrack;
222  return true;
223 }
224 
225 //**************************************************
226 bool FindVetoTrackAction::Apply(AnaEventC& eventBB, ToyBoxB& boxB) const{
227 //**************************************************
228 
229  AnaEventB& event = *static_cast<AnaEventB*>(&eventBB);
230 
231  // Cast the ToyBox to the appropriate type
232  ToyBoxTracker& box = *static_cast<ToyBoxTracker*>(&boxB);
233 
234  box.VetoTrack = cutUtils::FindVetoTrack(event, *(box.MainTrack));
235  return true;
236 }
237 
238 //**************************************************
239 bool FindOOFVTrackAction::Apply(AnaEventC& eventBB, ToyBoxB& boxB) const{
240 //**************************************************
241 
242  AnaEventB& event = *static_cast<AnaEventB*>(&eventBB);
243 
244  // Cast the ToyBox to the appropriate type
245  ToyBoxTracker& box = *static_cast<ToyBoxTracker*>(&boxB);
246 
247  box.OOFVtrack = cutUtils::FindFGDOOFVtrack(event, *(box.MainTrack), static_cast<SubDetId::SubDetEnum>(box.DetectorFV));
248  return true;
249 }
250 
251 //**************************************************
252 bool numuCCSelection::IsRelevantRecObjectForSystematic(const AnaEventC& event, AnaRecObjectC* recObj, SystId_h systId, Int_t branch) const{
253 //**************************************************
254  (void)event;
255  (void)branch;
256 
257  AnaTrackB* track = static_cast<AnaTrackB*>(recObj);
258 
259  // True track should always exist
260  if (!track->TrueObject) return false;
261 
262  if (systId == SystId::kFgdPid){
263  if (!anaUtils::TrackUsesOnlyDet(*track,static_cast<SubDetId::SubDetEnum>(GetDetectorFV()))) return false;
264  }
265  else if(systId == SystId::kTpcClusterEff){
266  if (track->nTPCSegments == 0) return false;
267  // AnaTPCParticleB* tpcTrack = static_cast<AnaTPCParticleB*>(track->TPCSegments[0]);
269  if (!tpcTrack) return false;
270  // use 17 and 18 for numu analysis, 35 and 36 for nue analyses
271  if (tpcTrack->NNodes == 17 || tpcTrack->NNodes == 18)
272  return true;
273  return false;
274  }
275  return true;
276 }
277 
278 //**************************************************
279 bool numuCCSelection::IsRelevantTrueObjectForSystematic(const AnaEventC& event, AnaTrueObjectC* trueObj, SystId_h systId, Int_t branch) const{
280 //**************************************************
281 
282  (void)event;
283  (void)branch;
284 
285  AnaTrueParticleB* trueTrack = static_cast<AnaTrueParticleB*>(trueObj);
286 
287  // TPC track eff
288  if (systId == SystId::kTpcTrackEff){
289  if (!anaUtils::InFiducialVolume(static_cast<SubDetId::SubDetEnum>(GetDetectorFV()), trueTrack->Position)) return false;
290  }
291  else if (systId == SystId::kFgdTrackEff){
292  if (!anaUtils::InFiducialVolume(static_cast<SubDetId::SubDetEnum>(GetDetectorFV()), trueTrack->Position)) return false;
293  }
294  else if (systId == SystId::kFgdHybridTrackEff){
295  if (!anaUtils::InFiducialVolume(static_cast<SubDetId::SubDetEnum>(GetDetectorFV()), trueTrack->Position)) return false;
296  }
297 
298  return true;
299 }
300 
301 //**************************************************
302 bool numuCCSelection::IsRelevantRecObjectForSystematicInToy(const AnaEventC& event, const ToyBoxB& boxB, AnaRecObjectC* track, SystId_h systId, Int_t branch) const{
303 //**************************************************
304 
305  (void)event;
306  (void)branch;
307 
308 
309  // Cast the ToyBox to the appropriate type
310  const ToyBoxTracker& box = *static_cast<const ToyBoxTracker*>(&boxB);
311  AnaTrackB* trackb = static_cast<AnaTrackB*>(track);
312 
313  // All are relevant if no main track concept applied
314  if (!systTuning::APPLY_SYST_FINE_TUNING) return true;
315 
316  if (!box.MainTrack) return false;
317 
318  switch (systId){
319  // Fall through the relevant ones
320  // TPC reco
321  case SystId::kChargeIDEff:
322  // TPC matching
323  case SystId::kTpcFgdMatchEff:
324  if (track == box.MainTrack) return true;
325  return false;
326  break;
327  // TPC cluster, consider a potential HMN track, can affect the selection
328  case SystId::kTpcClusterEff:
329  // This cannot happen, so for consistency
330  if (track == box.MainTrack) return true;
331  if (trackb->Charge == box.MainTrack->Charge &&
332  cutUtils::FiducialCut(trackb->PositionStart, static_cast<SubDetId::SubDetEnum>(GetDetectorFV())) &&
333  trackb->Momentum > box.MainTrack->Momentum)
334  return true;
335  return false;
336  break;
337 
338  // So to use for other selection when e.g. the systematic is not "known" for numu CC
339  default:
340  return true;
341  break;
342  }
343 
344  return true;
345 }
346 
347 //**************************************************
348 bool numuCCSelection::IsRelevantTrueObjectForSystematicInToy(const AnaEventC& event, const ToyBoxB& boxB, AnaTrueObjectC* trueObj, SystId_h systId, Int_t branch) const{
349 //**************************************************
350 
351  (void)event;
352  (void)branch;
353 
354  // Cast the ToyBox to the appropriate type
355  const ToyBoxTracker& box = *static_cast<const ToyBoxTracker*>(&boxB);
356 
357 
358  AnaTrueParticleB* trueTrack = static_cast<AnaTrueParticleB*>(trueObj);
359 
360 
361  // Apply to all objects, not fine-tuning
362  if (!systTuning::APPLY_SYST_FINE_TUNING) return true;
363 
364  // Main track "mode", will only consider certain true tracks of interest
365 
366  if(systId == SystId::kTpcTrackEff){
367  if (box.MainTrack->GetTrueParticle()){
368  // At first order the inclusive selection only depends on the tracking efficiency of the muon candidate.
369  if (trueTrack->ID == box.MainTrack->GetTrueParticle()->ID) return true;
370 
371  // Consider also the case in which the muon candidate is not a true muon but this track it is
372  if (trueTrack->PDG == 13 && box.MainTrack->GetTrueParticle()->PDG!=13) return true;
373 
374  return false;
375 
376  }
377  // Apply for muon
378  else if (trueTrack->PDG == 13)
379  return true;
380 
381  return false;
382  }
383  else if(systId == SystId::kSIPion){
384  // If this trueTrack is associated to the MainTrack
385  if (box.MainTrack->GetTrueParticle() && trueTrack->ID == box.MainTrack->GetTrueParticle()->ID){
386  if (abs(box.MainTrack->GetTrueParticle()->PDG) == 211) return true;
387  if (abs(box.MainTrack->GetTrueParticle()->ParentPDG) == 211) return true;
388  if (abs(box.MainTrack->GetTrueParticle()->GParentPDG) == 211) return true;
389 
390  return false;
391  }
392  // If this trueTrack is NOT associated to the MainTrack, consider the posibility of this trueTrack to become the MainTrack and be identified as muon
393  // For the moment assume a negative pion may become the MainTrack if its momentum its above 90% of the current MainTrack momentum.
394  // Ideally we should check that this true pion is not associated to any reconstructed track, but this is not possible now without looping.
395  // Multiply by the charge of the MainTrack such that it can be use for antiNumu selection
396  if (trueTrack->PDG == 211*((Int_t)box.MainTrack->Charge) && trueTrack->Momentum > 0.9*box.MainTrack->Momentum) return true;
397  }
398  else if(systId == SystId::kSIProton){
399  // If this trueTrack is associated to the MainTrack
400  if (box.MainTrack->GetTrueParticle() && trueTrack->ID == box.MainTrack->GetTrueParticle()->ID){
401  if (box.MainTrack->GetTrueParticle()->PDG == 2212) return true;
402  if (box.MainTrack->GetTrueParticle()->ParentPDG == 2212) return true;
403  if (box.MainTrack->GetTrueParticle()->GParentPDG == 2212) return true;
404 
405  return false;
406  }
407  // If this trueTrack is NOT associated to the MainTrack, consider the posibility of this trueTrack to become the MainTrack
408 
409  // May be relevant for anti-neutrino case but much less here
410  // if (trueTrack->PDG == 2212 && trueTrack->Momentum > 0.9*box.MainTrack->Momentum) return true;
411  return false;
412  }
413 
414  return true;
415 }
416 
417 //**************************************************
418 bool numuCCSelection::IsRelevantSystematic(const AnaEventC& event, const ToyBoxB& box, SystId_h systId, Int_t branch) const{
419 //**************************************************
420 
421  (void)event;
422  (void)branch;
423  (void)box;
424 
425 
426  // Direct list of (Efficiency/Weight-like) systematics that a relevant instead of tagging the ones which are not,
427  // the latter may require updating the file with more systematics added which is not desirable
428  // (although indeed the list of systematics can be controlled externally when adding to manager,
429  // it is better to have a consistent treatment already here)
430  // the selection is mature and the list of systematics is "well-defined"
431  switch (systId){
432  // Fall through the relevant ones
433  // TPC reco
434  case SystId::kChargeIDEff:
435  case SystId::kTpcClusterEff:
436  case SystId::kTpcTrackEff:
437  // TPC matching
438  case SystId::kTpcFgdMatchEff:
439  // Normalization
440  case SystId::kPileUp:
441  case SystId::kFgdMass:
442  case SystId::kOOFV:
443  case SystId::kSandMu:
444  // Flux
445  case SystId::kFluxWeightNu:
446  // SI
447  case SystId::kSIPion:
448  case SystId::kSIProton:
449  return true;
450  break;
451  default:
452  return false;
453  break;
454  }
455 
456  return false;
457 }
458 
459 //**************************************************
461 //**************************************************
462 
463  AnaEventB& event = *static_cast<AnaEventB*>(&eventBB);
464 
465  // Create the appropriate EventBox if it does not exist yet
466  if (!event.EventBoxes[EventBoxId::kEventBoxTracker])
467  event.EventBoxes[EventBoxId::kEventBoxTracker] = new EventBoxTracker();
468 
469  boxUtils::FillTracksWithTPC(event, static_cast<SubDetId::SubDetEnum>(GetDetectorFV()));
470  boxUtils::FillTracksWithFGD(event, static_cast<SubDetId::SubDetEnum>(GetDetectorFV()));
471  boxUtils::FillTrajsChargedInTPC(event);
472  boxUtils::FillTrajsChargedInFGDAndNoTPC(event, static_cast<SubDetId::SubDetEnum>(GetDetectorFV()));
473 }
474 
475 //********************************************************************
476 bool numuCCSelection::CheckRedoSelection(const AnaEventC& eventBB, const ToyBoxB& PreviousToyBoxB, Int_t& redoFromStep){
477 //********************************************************************
478 
479  const AnaEventB& event = *static_cast<const AnaEventB*>(&eventBB);
480 
481  // Cast the ToyBox to the appropriate type
482  const ToyBoxTracker& PreviousToyBox = *static_cast<const ToyBoxTracker*>(&PreviousToyBoxB);
483 
484  // allways return true by now. TODO
485  // redoFromStep =0;
486  // return true;
487  // Relevant properties of the previous toy are saved in the PreviousToyBox that is passed as parameter
488  // - i.e PreviousToyBox->HMNtrack is the HMNtrack of the previous toy
489  // - i.e PreviousToyBox->AccumLevel[i] is the accum level of the previous toy
490  // for branch i in this selection
491 
492  // Only redo the selection when the HMN track changes identity or the PID cut has a different effect:
493 
494  // nothing to do if there is no HMN track
495  if (!PreviousToyBox.HMNtrack) return false;
496 
497  /* TODO: This is not enough since the third HM track could become the HM track. Substituted by the code below
498  // The momentum of SHMN track is larger than the one of HMN track
499  // We have not yet called FindLeadingTracks, so HMN and SHMN are from previous toy, however we have already modified the
500  // momentum of those tracks because this method is called after the variation systematics
501  if (PreviousToyBox.MaxAccumLevel > _TotalMultiplicityCutIndex){
502  if (PreviousToyBox.SHMNtrack){
503  if (PreviousToyBox.SHMNtrack->Momentum > PreviousToyBox.HMNtrack->Momentum){
504  // We should redo the selection starting from the FindLeadingTracks step
505  redoFromStep = _FindLeadingTracksStepIndex;
506  return true;
507  }
508  }
509  }
510  */
511 
512  // TODO: The code below implies calling cutUtils::FindLeadingTracks(event, box) twice. Can we avoid that ?
513  if (PreviousToyBox.MaxAccumLevel > _TotalMultiplicityCutIndex){
514  ToyBoxTracker box;
515  trackerSelUtils::FindLeadingTracks(event, box);
516 
517  // Redo the selection if any of the leading tracks changes identity
518  if (PreviousToyBox.SHMNtrack!=box.SHMNtrack ||
519  PreviousToyBox.SHMPtrack!=box.SHMPtrack ||
520  PreviousToyBox.HMNtrack !=box.HMNtrack ||
521  PreviousToyBox.HMPtrack !=box.HMPtrack ||
522  PreviousToyBox.SHMtrack !=box.SHMtrack ||
523  PreviousToyBox.HMtrack !=box.HMtrack){
524 
525  redoFromStep = _FindLeadingTracksStepIndex;
526  return true;
527  }
528  }
529 
530  // When the HMN track does not change identity, Redo the selection if the effect of the PID cut is different.
531  // We have previously saved in the EventBox the AccumLevel of the previous toy for each branch.
532  // PreviousToyBox->AccumLevel[0]>_MuonPIDCutIndex means that the PID cut was passed, so we check whether the cut
533  // was passed in the previous toy and not in the current one, or the opposit, it was not passed before
534  // and it is passed now.
535 
536  if (PreviousToyBox.MaxAccumLevel >= _MuonPIDCutIndex){
537  bool pidCut = cutUtils::MuonPIDCut(*(PreviousToyBox.HMNtrack), !versionUtils::prod6_systematics);
538  if (( pidCut && (PreviousToyBox.AccumLevel[0] == _MuonPIDCutIndex)) ||
539  (!pidCut && (PreviousToyBox.AccumLevel[0] > _MuonPIDCutIndex))){
540  // We should redo the selection starting from the MuonPIDCut step
541  redoFromStep = _MuonPIDStepIndex;
542  return true;
543  }
544  }
545 
546  return false;
547 }
548 
AnaTrackB * SHMtrack
For storing the second highest momentum track.
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...
AnaTrueVertexB * TrueVertex
Pointer to the AnaTrueVertexB of the interaction that created this AnaTrueParticleB.
Float_t PositionStart[4]
The reconstructed start position of the particle.
AnaTrueVertexB * TrueVertex
bool Apply(AnaEventC &event, ToyBoxB &box) const
void DefineDetectorFV()
Define the detector Fiducial Volume in which this selection is applied.
Int_t MaxAccumLevel
Definition: ToyBoxB.hxx:39
bool Apply(AnaEventC &event, ToyBoxB &box) const
Float_t Position[4]
The identified position of the global vertex.
bool Apply(AnaEventC &event, ToyBoxB &box) const
Int_t NNodes
The number of nodes in the reconstructed object.
SubDetId_h DetectorFV
Indicate the FV we are interested in.
Definition: ToyBoxB.hxx:52
Int_t GParentPDG
The PDG code of this particle&#39;s grandparent, or 0 if there is no grandparent.
AnaTrackB * MainTrack
For storing the Main Track (The lepton candidate in geranal: HMN or HMP track)
bool Apply(AnaEventC &event, ToyBoxB &box) const
AnaTrueObjectC * TrueObject
The link to the true oject that most likely generated this reconstructed object.
Float_t Momentum
The initial momentum of the true particle.
AnaTrueVertexB * TrueVertex
For storing the true vertex, for analyses with no reconstructed primary vertex.
Definition: ToyBoxND280.hxx:22
AnaTrackB * HMPtrack
For storing the highest momentum positive track.
Float_t Charge
The reconstructed charge of the particle.
Int_t ID
The ID of the trueObj, which corresponds to the ID of the TTruthParticle that created it...
bool Apply(AnaEventC &event, ToyBoxB &box) const
Int_t nRecObjectsInGroup[NMAXRECOBJECTGROUPS]
----—— RecObjects and TrueRecObjects used in the selection and systematics ------------—— ...
Float_t Momentum
The reconstructed momentum of the particle, at the start position.
AnaVertexB * Vertex
For storing the reconstructed vertex.
int nTPCSegments
How many TPC tracks are associated with this track.
Representation of a true Monte Carlo trajectory/particle.
void InitializeEvent(AnaEventC &event)
Fill the EventBox with the objects needed by this selection.
bool Apply(AnaEventC &event, ToyBoxB &box) const
Leading tracks with good quality in FGD1.
bool Apply(AnaEventC &event, ToyBoxB &box) const
AnaTrackB * VetoTrack
For storing the veto track.
Int_t PDG
The PDG code of this particle.
AnaTrackB * HMNtrack
For storing the highest momentum negative track.
Int_t ParentPDG
The PDG code of this particle&#39;s immediate parent, or 0 if there is no parent.
AnaTrackB * SHMPtrack
For storing the second highest momentum positive track.
Representation of a global track.
AnaTrackB * HMtrack
For storing the highest momentum track.
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) ...
Representation of a TPC segment of a global track.
AnaParticleB ** Particles
Representation of a global vertex.
bool APPLY_SYST_FINE_TUNING
General tuning, the concept of apply the systematic for only the "relevant" objects.
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...
AnaEventSummaryC * Summary
A summary of the event with high level quantities.
AnaTrackB * SHMNtrack
For storing the second highest momentum negative track.
Int_t * AccumLevel
Accum level for each branch in this toy in the selection this ToyBox belongs to.
Definition: ToyBoxB.hxx:35
Float_t Position[4]
The initial position of the true particle.
Find the Vertex. For the moment it&#39;s just the Star position of the HM track.
bool Apply(AnaEventC &event, ToyBoxB &box) const
bool Apply(AnaEventC &event, ToyBoxB &box) const
AnaParticleB * GetSegmentWithMostNodesInClosestTpc(const AnaTrackB &track)
Combined function to address NuMu selection needs as efficiently as possible - gets the TPC segment w...
AnaTrueParticleB * GetTrueParticle() const
Return a casted version of the AnaTrueObject associated.
bool InFiducialVolume(SubDetId::SubDetEnum det, const Float_t *pos, const Float_t *FVdefmin, const Float_t *FVdefmax)
bool IsRelevantSystematic(const AnaEventC &event, const ToyBoxB &box, SystId_h systId, Int_t branch) const
Is this systematic relevant for this selection.
bool TrackUsesOnlyDet(const AnaTrackB &track, SubDetId::SubDetEnum det)
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) ...
A cut on event quality. Requires good beam and ND280 data quality flags.
AnaTrackB * OOFVtrack
For storing the oofv fgd tracks.
bool Apply(AnaEventC &event, ToyBoxB &box) const
bool CheckRedoSelection(const AnaEventC &event, const ToyBoxB &PreviousToyBox, Int_t &redoFromStep)