HighLAND
numuCC4piFGD2Selection.cxx
1 
2 #include "numuCC4piFGD2Selection.hxx"
3 #include "baseSelection.hxx"
4 #include "SystematicTuning.hxx"
5 #include "CutUtils.hxx"
6 #include "EventBoxUtils.hxx"
7 #include "Parameters.hxx"
8 #include "SubDetId.hxx"
9 #include "SystId.hxx"
10 #include "SystematicUtils.hxx"
11 
12 
13 //********************************************************************
14 numuCC4piFGD2Selection::numuCC4piFGD2Selection(bool forceBreak): SelectionBase(forceBreak,EventBoxId::kEventBoxTracker) {
15  //********************************************************************
16 
17  // Initialize systematic tuning parameters
18  systTuning::Initialize();
19 }
20 
21 //********************************************************************
23  //********************************************************************
24 
25  AddStep(StepBase::kCut, "event quality", new EventQualityCut(), true); //if passed accum_level=1
26  AddStep(StepBase::kCut, "> 0 tracks ", new numuCC4piFGD2::TotalMultiplicityCut(), true); //if passed accum_level=2
27  AddStep(StepBase::kAction, "Sort TPC tracks", new numuCC4piFGD2::SortTracksAction());
28  AddStep(StepBase::kCut, "quality+fiducial", new numuCC4piFGD2::TrackGQandFVCut(), true); //if passed accum_level=3
29  AddStep(StepBase::kAction, "veto Action", new numuCC4piFGD2::VetoAction());
30  AddStep(StepBase::kAction, "muon PID Action", new numuCC4piFGD2::PIDAction());
31  AddStep(StepBase::kAction, "find vertex", new numuCC4pi::FindVertexAction());
32  AddStep(StepBase::kAction, "fill summary", new FillSummaryAction_numuCC4piFGD2());
33 
34  AddSplit(4);
35 
36  AddStep(0, StepBase::kCut, "Fwd Quality Cut", new numuCC4pi::Fwd_Quality()); //if passed accum_level=4
37  AddStep(0, StepBase::kCut, "Fwd Veto Cut", new numuCC4pi::Fwd_Veto()); //if passed accum_level=5
38  AddStep(0, StepBase::kCut, "Fwd PID Cut", new numuCC4pi::Fwd_PID()); //if passed accum_level=6
39  AddStep(0, StepBase::kCut, "Fwd 4pi Cut", new numuCC4pi::Fwd()); //if passed accum_level=7
40 
41  AddStep(1, StepBase::kCut, "Bwd Quality Cut", new numuCC4pi::Bwd_Quality());
42  AddStep(1, StepBase::kCut, "Bwd Veto Cut", new numuCC4pi::Bwd_Veto());
43  AddStep(1, StepBase::kCut, "Bwd PID Cut", new numuCC4pi::Bwd_PID());
44  AddStep(1, StepBase::kCut, "Bwd 4pi Cut", new numuCC4pi::Bwd());
45 
46  AddStep(2, StepBase::kCut, "HAFwd Quality Cut", new numuCC4pi::HAFwd_Quality());
47  AddStep(2, StepBase::kCut, "HAFwd Veto Cut", new numuCC4pi::HAFwd_Veto());
48  AddStep(2, StepBase::kCut, "HAFwd PID Cut", new numuCC4pi::HAFwd_PID());
49  AddStep(2, StepBase::kCut, "HAFwd 4pi Cut", new numuCC4pi::HAFwd());
50 
51  AddStep(3, StepBase::kCut, "HABwd Quality Cut", new numuCC4pi::HABwd_Quality());
52  AddStep(3, StepBase::kCut, "HABwd Veto Cut", new numuCC4pi::HABwd_Veto());
53  AddStep(3, StepBase::kCut, "HABwd PID Cut", new numuCC4pi::HABwd_PID());
54  AddStep(3, StepBase::kCut, "HABwd 4pi Cut", new numuCC4pi::HABwd());
55 
56  SetBranchAlias(0, "Fwd", 0);
57  SetBranchAlias(1, "Bwd", 1);
58  SetBranchAlias(2, "HAFwd", 2);
59  SetBranchAlias(3, "HABwd", 3);
60 
61  SetPreSelectionAccumLevel(2);
62 
63 }
64 
65 //********************************************************************
67  //********************************************************************
68 
69  // Change FV definition to take all thickness
70  // Note! this will affect all downstream stuff
71  FVDef::FVdefminFGD2[2] = 0;
72  FVDef::FVdefmaxFGD2[2] = 0;
73 
74  // The detector in which the selection is applied
75  SetDetectorFV(SubDetId::kFGD2);
76 
77 }
78 
79 //**************************************************
81  //**************************************************
82 
83  AnaEventB& event = *static_cast<AnaEventB*>(&eventBB);
84 
85  // Create the appropriate EventBox if it does not exist yet
86  if (!event.EventBoxes[EventBoxId::kEventBoxTracker]) event.EventBoxes[EventBoxId::kEventBoxTracker] = new EventBoxTracker();
87 
88  boxUtils::FillTracksWithTPC(event, static_cast<SubDetId::SubDetEnum>(GetDetectorFV()));
89  boxUtils::FillTracksWithFGD(event, static_cast<SubDetId::SubDetEnum>(GetDetectorFV()));
90  boxUtils::FillTracksWithECal(event);
91 
92  boxUtils::FillTrajsChargedInTPC(event);
93  boxUtils::FillTrajsChargedInFGDAndNoTPC(event, static_cast<SubDetId::SubDetEnum>(GetDetectorFV()));
94  boxUtils::FillTrajsChargedHATracker(event, static_cast<SubDetId::SubDetEnum>(GetDetectorFV()));
95 }
96 
97 //********************************************************************
98 bool numuCC4piFGD2Selection::FillEventSummary(AnaEventC& event, Int_t allCutsPassed[]){
99  //********************************************************************
100 
101  if(allCutsPassed[0]) static_cast<AnaEventSummaryB*>(event.Summary)->EventSample = SampleId::kFGD2NuMuCC;
102  if(allCutsPassed[1]) static_cast<AnaEventSummaryB*>(event.Summary)->EventSample = SampleId::kFGD2NuMuCC;
103  if(allCutsPassed[2]) static_cast<AnaEventSummaryB*>(event.Summary)->EventSample = SampleId::kFGD2NuMuCC;
104  if(allCutsPassed[3]) static_cast<AnaEventSummaryB*>(event.Summary)->EventSample = SampleId::kFGD2NuMuCC;
105 
106  return (static_cast<AnaEventSummaryB*>(event.Summary)->EventSample != SampleId::kFGD2NuMuCC);
107 }
108 
109 //**************************************************
111  //**************************************************
112 
113  (void)box;
114 
115  // Check we have at least one reconstructed track in the FGD
116  EventBoxB* EventBox = event.EventBoxes[EventBoxId::kEventBoxTracker];
117  return (EventBox->nRecObjectsInGroup[EventBoxTracker::kTracksWithFGD2]>0);
118 
119 }
120 
121 //**************************************************
123  //**************************************************
124 
125  ToyBoxCC4pi* cc4pibox = static_cast<ToyBoxCC4pi*>(&box);
126 
127  // Retrieve the EventBoxTracker
128  EventBoxB* EventBox = event.EventBoxes[EventBoxId::kEventBoxTracker];
129 
130  //Find TPCGoodQuality tracks in Fwd and Bwd
131  int nTPC=EventBox->nRecObjectsInGroup[EventBoxTracker::kTracksWithGoodQualityTPCInFGD2FV];
132  for (Int_t i=0;i<nTPC; ++i){
133  AnaTrackB* track = static_cast<AnaTrackB*>(EventBox->RecObjectsInGroup[EventBoxTracker::kTracksWithGoodQualityTPCInFGD2FV][i]);
134  if ( track->Charge!=-1 ) continue;
135  cc4pibox->LowAngle.push_back(track);
136  }
137  //Sort TPCGoodQuality using Momentum
138  std::sort(cc4pibox->LowAngle.begin(), cc4pibox->LowAngle.end(), numuCC4pi_utils::HGlobalMomFirst);
139 
140  int nECALTracks=EventBox->nRecObjectsInGroup[EventBoxTracker::kTracksWithECal];
141  for(int i=0;i<nECALTracks;i++){
142  AnaTrackB* track = static_cast<AnaTrackB*>(EventBox->RecObjectsInGroup[EventBoxTracker::kTracksWithECal][i]);
143  if ( anaUtils::InFiducialVolume(SubDetId::kFGD2, track->PositionStart) ) {
144  if (track->PositionStart[2]-track->PositionEnd[2] > 0) std::cout<<track->PositionStart[2]-track->PositionEnd[2]<<std::endl;
145  if ( cutUtils::TrackQualityCut(*track) ) continue;
146  if ( cutUtils::StoppingBrECALorSMRDCut(track->PositionEnd)==-1 ) continue;
147  cc4pibox->HighAngle.push_back(track);
148  }
149  }
150  //Sort HighAngle using RangeMomentum
151  std::sort(cc4pibox->HighAngle.begin(), cc4pibox->HighAngle.end(), numuCC4pi_utils::HRangeMomFirst);
152 
153  return true;
154 
155 }
156 
157 //**************************************************
159  //**************************************************
160 
161  (void)event;
162 
163  ToyBoxCC4pi* cc4pibox = static_cast<ToyBoxCC4pi*>(&box);
164 
165  for(UInt_t i=0;i<cc4pibox->LowAngle.size();i++ ){
166  if ( anaUtils::InFiducialVolume(SubDetId::kFGD2, cc4pibox->LowAngle[i]->PositionStart, numuCC4piFGD2_utils::LAFVmin, numuCC4piFGD2_utils::LAFVmax) ){
167  if ( ToFSenseCorrector::IsForward(*cc4pibox->LowAngle[i]) ) cc4pibox->FwdTracks.push_back(cc4pibox->LowAngle[i]);
168  else cc4pibox->BwdTracks.push_back(cc4pibox->LowAngle[i]);
169  break;
170  }
171  }
172 
173  for(UInt_t i=0;i<cc4pibox->HighAngle.size();i++){
174  if ( anaUtils::InFiducialVolume(SubDetId::kFGD2, cc4pibox->HighAngle[i]->PositionStart, numuCC4piFGD2_utils::HAFVmin, numuCC4piFGD2_utils::HAFVmax) ) {
175  if ( ToFSenseCorrector::IsForward(*cc4pibox->HighAngle[i]) ) cc4pibox->HAFwdTracks.push_back(cc4pibox->HighAngle[i]);
176  else cc4pibox->HABwdTracks.push_back(cc4pibox->HighAngle[i]);
177  }
178  }
179 
180  if ( cc4pibox->FwdTracks.size()>0 ) { cc4pibox->MainTrack = cc4pibox->FwdTracks[0]; return true; }
181  else if ( cc4pibox->BwdTracks.size()>0 ) { cc4pibox->MainTrack = cc4pibox->BwdTracks[0]; return true; }
182  else if ( cc4pibox->HAFwdTracks.size()>0 ) { cc4pibox->MainTrack = cc4pibox->HAFwdTracks[0]; return true; }
183  else if ( cc4pibox->HABwdTracks.size()>0 ) { cc4pibox->MainTrack = cc4pibox->HABwdTracks[0]; return true; }
184 
185  return false;
186 
187 }
188 
189 //**************************************************
191  //**************************************************
192 
193  AnaEventB& eventB = *static_cast<AnaEventB*>(&event);
194 
195  ToyBoxCC4pi* cc4pibox = static_cast<ToyBoxCC4pi*>(&box);
196 
197  for (UInt_t i=0;i<cc4pibox->FwdTracks.size();i++){
198  if ( numuCC4pi_utils::VetoCut(0,eventB,*(cc4pibox->FwdTracks[i])) ) {
199  if ( numuCC4piFGD2_utils::ExternalCut(0,event,*(cc4pibox->FwdTracks[i])) ) cc4pibox->FwdTracks_Veto.push_back(cc4pibox->FwdTracks[i]);
200  }
201  }
202 
203  for (UInt_t i=0;i<cc4pibox->BwdTracks.size();i++){
204  cc4pibox->BwdTracks_Veto.push_back(cc4pibox->BwdTracks[i]);
205  }
206 
207  for (UInt_t i=0;i<cc4pibox->HAFwdTracks.size();i++){
208  if ( numuCC4pi_utils::VetoCut(2,eventB,*(cc4pibox->HAFwdTracks[i])) ) cc4pibox->HAFwdTracks_Veto.push_back(cc4pibox->HAFwdTracks[i]);
209  }
210 
211  for (UInt_t i=0;i<cc4pibox->HABwdTracks.size();i++){
212  if ( numuCC4pi_utils::VetoCut(3,eventB,*(cc4pibox->HABwdTracks[i])) ) cc4pibox->HABwdTracks_Veto.push_back(cc4pibox->HABwdTracks[i]);
213  }
214 
215  if ( cc4pibox->FwdTracks_Veto.size()>0 ) cc4pibox->MainTrack = cc4pibox->FwdTracks_Veto[0];
216  else if ( cc4pibox->BwdTracks_Veto.size()>0 ) cc4pibox->MainTrack = cc4pibox->BwdTracks_Veto[0];
217  else if ( cc4pibox->HAFwdTracks_Veto.size()>0 ) cc4pibox->MainTrack = cc4pibox->HAFwdTracks_Veto[0];
218  else if ( cc4pibox->HABwdTracks_Veto.size()>0 ) cc4pibox->MainTrack = cc4pibox->HABwdTracks_Veto[0];
219 
220  return true;
221 
222 }
223 
224 //**************************************************
226  //**************************************************
227 
228  (void)event;
229 
230  ToyBoxCC4pi* cc4pibox = static_cast<ToyBoxCC4pi*>(&box);
231 
232  for (UInt_t i=0;i<cc4pibox->FwdTracks_Veto.size();i++){
233  if ( numuCC4piFGD2_utils::PIDCut(0,*(cc4pibox->FwdTracks_Veto[i]))==1 ) cc4pibox->FwdTracks_PID.push_back(cc4pibox->FwdTracks_Veto[i]);
234  }
235 
236  for (UInt_t i=0;i<cc4pibox->BwdTracks_Veto.size();i++){
237  if ( numuCC4piFGD2_utils::PIDCut(1,*(cc4pibox->BwdTracks_Veto[i]))==1 ) cc4pibox->BwdTracks_PID.push_back(cc4pibox->BwdTracks_Veto[i]);
238  }
239 
240  for (UInt_t i=0;i<cc4pibox->HAFwdTracks_Veto.size();i++){
241  if ( numuCC4piFGD2_utils::PIDCut(2,*(cc4pibox->HAFwdTracks_Veto[i]))==1 ) cc4pibox->HAFwdTracks_PID.push_back(cc4pibox->HAFwdTracks_Veto[i]);
242  }
243 
244  for (UInt_t i=0;i<cc4pibox->HABwdTracks_Veto.size();i++){
245  if ( numuCC4piFGD2_utils::PIDCut(2,*(cc4pibox->HABwdTracks_Veto[i]))==1 ) cc4pibox->HABwdTracks_PID.push_back(cc4pibox->HABwdTracks_Veto[i]);
246  }
247 
248  for (UInt_t i=0;i<cc4pibox->FwdTracks_Veto.size();i++){
249  if ( numuCC4piFGD2_utils::PIDCut(0,*(cc4pibox->FwdTracks_Veto[i]))==3 ) cc4pibox->CSECALTracks_PID.push_back(cc4pibox->FwdTracks_Veto[i]);
250  }
251 
252  if ( cc4pibox->FwdTracks_PID.size()>0 ) cc4pibox->MainTrack = cc4pibox->FwdTracks_PID[0];
253  else if ( cc4pibox->BwdTracks_PID.size()>0 ) cc4pibox->MainTrack = cc4pibox->BwdTracks_PID[0];
254  else if ( cc4pibox->HAFwdTracks_PID.size()>0 ) cc4pibox->MainTrack = cc4pibox->HAFwdTracks_PID[0];
255  else if ( cc4pibox->HABwdTracks_PID.size()>0 ) cc4pibox->MainTrack = cc4pibox->HABwdTracks_PID[0];
256 
257  return true;
258 
259 }
260 
261 //********************************************************************
263  //********************************************************************
264 
265  // Cast the ToyBox to the appropriate type
266  ToyBoxCC4pi* cc4pibox = static_cast<ToyBoxCC4pi*>(&boxB);
267 
268  if(!cc4pibox->MainTrack) return 1;
269 
270  static_cast<AnaEventSummaryB*>(event.Summary)->LeptonCandidate[SampleId::kFGD2NuMuCC] = cc4pibox->MainTrack;
271 
272  anaUtils::CopyArray( cc4pibox->MainTrack->PositionStart, static_cast<AnaEventSummaryB*>(event.Summary)->VertexPosition[SampleId::kFGD2NuMuCC], 4);
273 
274  if(cc4pibox->MainTrack->GetTrueParticle()) static_cast<AnaEventSummaryB*>(event.Summary)->TrueVertex[SampleId::kFGD2NuMuCC] = cc4pibox->MainTrack->GetTrueParticle()->TrueVertex;
275 
276  return true;
277 }
278 
279 //********************************************************************
280 bool numuCC4piFGD2_utils::ExternalCut(int topo, const AnaEventC& event, AnaTrackB& candidate){
281  //********************************************************************
282  if ( topo==0 ) {
283  if ( numuCC4pi_utils::GetFgdLayer(candidate.PositionStart) > 27 ) {
284  EventBoxB* EventBox = event.EventBoxes[EventBoxId::kEventBoxTracker];
285  int nFgdTracks=EventBox->nRecObjectsInGroup[EventBoxTracker::kTracksWithFGD2AndNoTPC];
286  for (Int_t i=0;i<nFgdTracks;i++){
287  AnaTrackB* track = static_cast<AnaTrackB*>(EventBox->RecObjectsInGroup[EventBoxTracker::kTracksWithFGD2AndNoTPC][i]);
288  AnaFGDParticleB *fgdTrack = track->FGDSegments[0];
289  if( !fgdTrack ) continue;
290  if( SubDetId::GetDetectorUsed(fgdTrack->Detector,SubDetId::kFGD2) ) return false;
291  }
292  }
293  return true;
294  }
295  return true;
296 
297 }
298 
299 //**************************************************
300 int numuCC4piFGD2_utils::PIDCut(int topo, const AnaTrackB& candidate) {
301  //**************************************************
302 
303  if ( topo==0 ) {
304  if (cutUtils::MuonPIDCut(candidate, false)){
305  if ( candidate.nECALSegments>0 ) {
306  if ( candidate.ECALSegments[0]->PIDMipEm>15 ) {
307  if ( anaUtils::TrackUsesDet(candidate,SubDetId::kTECAL) ) return 3;
308  if ( anaUtils::InFiducialVolume(SubDetId::kDSECAL, candidate.PositionEnd, numuCC4pi_utils::_FVdefminDsECal, numuCC4pi_utils::_FVdefmaxDsECal) ) return 3;
309  }
310  }
311  return 1;
312  }
313  return 0;
314  }
315  else if ( topo==1 ) {
316  if ( anaUtils::GetPIDLikelihood(candidate, 0, false) > 0.05 ) return 1;
317  return 0;
318  }
319  else if ( topo==2 ) {
320  if ( cutUtils::MuonECALPIDCut(candidate) ) return 1;
321  return 0;
322  }
323  return 1;
324 
325 }
326 
327 //**************************************************
328 bool numuCC4piFGD2Selection::IsRelevantSystematic(const AnaEventC& event, const ToyBoxB& box, SystId_h systId, Int_t branch) const{
329  //**************************************************
330 
331  (void)event;
332  (void)branch;
333  (void)box;
334  (void)systId;
335 
336  return true;
337 
338 }
339 
340 //**************************************************
341 bool numuCC4piFGD2Selection::IsRelevantRecObjectForSystematic(const AnaEventC& event, AnaRecObjectC* recObj, SystId_h systId, Int_t branch) const{
342  //**************************************************
343 
344  (void)event;
345  (void)branch;
346  (void)systId;
347 
348  AnaTrackB* track = static_cast<AnaTrackB*>(recObj);
349 
350  if (!track) return false;
351  if (!track->TrueObject) return false;
352 
353  return true;
354 
355 }
356 
357 //**************************************************
358 bool numuCC4piFGD2Selection::IsRelevantTrueObjectForSystematic(const AnaEventC& event, AnaTrueObjectC* trueObj, SystId_h systId, Int_t branch) const{
359  //**************************************************
360 
361  (void)event;
362  (void)branch;
363  (void)systId;
364 
365  AnaTrueParticleB* trueTrack = static_cast<AnaTrueParticleB*>(trueObj);
366 
367  if (!trueTrack) return false;
368 
369  return true;
370 
371 }
372 
373 //**************************************************
374 bool numuCC4piFGD2Selection::IsRelevantRecObjectForSystematicInToy(const AnaEventC& event, const ToyBoxB& boxB, AnaRecObjectC* recObj, SystId_h systId, Int_t branch) const{
375  //**************************************************
376 
377  (void)event;
378  (void)branch;
379 
380  const ToyBoxCC4pi& cc4pibox = *static_cast<const ToyBoxCC4pi*>(&boxB);
381 
382  AnaTrackB* track = static_cast<AnaTrackB*>(recObj);
383 
384  if(systId == SystId::kTpcClusterEff){
385  if (track->nTPCSegments == 0) return false;
387  if (!tpcTrack) return false;
388  if (tpcTrack->NNodes != 17 && tpcTrack->NNodes != 18) return false;
389  }
390  if(systId == SystId::kChargeIDEff){
391  if (track != cc4pibox.MainTrack) return false;
392  }
393  if(systId == SystId::kTpcFgdMatchEff){
394  if (track != cc4pibox.MainTrack) return false;
395  }
396  if(systId == SystId::kECalPID){
397  if (branch==1) return false;
398  else { if (track != cc4pibox.MainTrack) return false; }
399  }
400 
401  return true;
402 
403 }
404 
405 //**************************************************
406 bool numuCC4piFGD2Selection::IsRelevantTrueObjectForSystematicInToy(const AnaEventC& event, const ToyBoxB& boxB, AnaTrueObjectC* trueObj, SystId_h systId, Int_t branch) const{
407  //**************************************************
408 
409  (void)event;
410  (void)branch;
411 
412  const ToyBoxCC4pi& cc4pibox = *static_cast<const ToyBoxCC4pi*>(&boxB);
413 
414  AnaTrueParticleB* trueTrack = static_cast<AnaTrueParticleB*>(trueObj);
415 
416  if(systId == SystId::kTpcTrackEff){
417  if (cc4pibox.MainTrack->GetTrueParticle()){
418  if (trueTrack->PDG == 13 && cc4pibox.MainTrack->GetTrueParticle()->PDG!=13) return true;
419  if (branch>1 && branch<4) return false;
420  else { if (trueTrack->ID == cc4pibox.MainTrack->GetTrueParticle()->ID) return true; }
421  }
422  }
423  if(systId == SystId::kECalTrackEff){
424  if (cc4pibox.MainTrack->GetTrueParticle()){
425  if (trueTrack->PDG == 13 && cc4pibox.MainTrack->GetTrueParticle()->PDG!=13) return true;
426  if (branch==2 || branch==3) { if (trueTrack->ID == cc4pibox.MainTrack->GetTrueParticle()->ID) return true; }
427  else return false;
428  }
429  }
430  if(systId == SystId::kTpcP0dMatchEff){
431  if (cc4pibox.MainTrack->GetTrueParticle()){
432  if (branch==1) { if (trueTrack->ID == cc4pibox.MainTrack->GetTrueParticle()->ID) return true; }
433  else return false;
434  }
435  }
436  if(systId == SystId::kTpcECalMatchEff){
437  if (cc4pibox.MainTrack->GetTrueParticle()){
438  if (branch>-1 && branch<6) { if (trueTrack->ID == cc4pibox.MainTrack->GetTrueParticle()->ID) return true; }
439  return false;
440  }
441  }
442  if(systId == SystId::kFgdECalMatchEff){
443  if (cc4pibox.MainTrack->GetTrueParticle()){
444  if (branch==2 || branch==3) { if (trueTrack->ID == cc4pibox.MainTrack->GetTrueParticle()->ID) return true; }
445  else return false;
446  }
447  }
448 
449  return true;
450 
451 }
452 
453 //********************************************************************
454 bool numuCC4piFGD2Selection::CheckRedoSelection(const AnaEventC& eventC, const ToyBoxB& PreviousToyBoxB, Int_t& redoFromStep){
455  //********************************************************************
456 
457  (void)eventC;
458  (void)PreviousToyBoxB;
459  (void)redoFromStep;
460 
461  return true;
462 
463 }
464 
AnaTrueVertexB * TrueVertex
Pointer to the AnaTrueVertexB of the interaction that created this AnaTrueParticleB.
Float_t PositionStart[4]
The reconstructed start position of the particle.
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) ...
unsigned long Detector
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) ...
void DefineSteps()
Define all steps in the selection.
bool Apply(AnaEventC &event, ToyBoxB &box) const
AnaECALParticleB * ECALSegments[NMAXECALS]
The ECAL segments that contributed to this global track.
int nECALSegments
How many ECAL tracks are associated with this track.
static bool IsForward(const AnaTrackB &track)
Check whether a track is forward going.
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...
Int_t NNodes
The number of nodes in the reconstructed object.
bool IsRelevantSystematic(const AnaEventC &event, const ToyBoxB &box, SystId_h systId, Int_t branch) const
Is this systematic relevant for this selection.
void InitializeEvent(AnaEventC &event)
Fill the EventBox with the objects needed by this selection.
AnaTrueObjectC * TrueObject
The link to the true oject that most likely generated this reconstructed object.
static bool GetDetectorUsed(unsigned long BitField, SubDetId::SubDetEnum det)
Method to see if a certain subdetector or subdetector system is used.
Definition: SubDetId.cxx:40
bool Apply(AnaEventC &event, ToyBoxB &box) const
bool TrackUsesDet(const AnaTrackB &track, SubDetId::SubDetEnum det)
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...
Float_t GetPIDLikelihood(const AnaTrackB &track, Int_t hypo, bool prod5Cut=0)
Definition: PIDUtils.cxx:180
Int_t nRecObjectsInGroup[NMAXRECOBJECTGROUPS]
----—— RecObjects and TrueRecObjects used in the selection and systematics ------------—— ...
int nTPCSegments
How many TPC tracks are associated with this track.
Representation of a true Monte Carlo trajectory/particle.
bool CheckRedoSelection(const AnaEventC &event, const ToyBoxB &PreviousToyBox, Int_t &redoFromStep)
bool Apply(AnaEventC &event, ToyBoxB &box) const
bool Apply(AnaEventC &event, ToyBoxB &box) const
Int_t PDG
The PDG code of this particle.
Representation of a global track.
Representation of a TPC segment of a global track.
AnaTrackB * MainTrack
For storing tracks information in the bunch.
AnaEventSummaryC * Summary
A summary of the event with high level quantities.
Representation of a FGD segment of a global track.
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 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...
bool InFiducialVolume(SubDetId::SubDetEnum det, const Float_t *pos, const Float_t *FVdefmin, const Float_t *FVdefmax)
bool Apply(AnaEventC &event, ToyBoxB &box) const
void DefineDetectorFV()
Define the detector Fiducial Volume in which this selection is applied.
AnaFGDParticleB * FGDSegments[NMAXFGDS]
The FGD segments that contributed to this global track.
A cut on event quality. Requires good beam and ND280 data quality flags.
bool Apply(AnaEventC &event, ToyBoxB &box) const
Float_t PositionEnd[4]
The reconstructed end position of the particle.