HighLAND
p0dNumuCCQESelection.cxx
1 #include "baseSelection.hxx"
2 #include "p0dNumuCCQESelection.hxx"
3 #include "p0dNumuCCSelection.hxx"
4 #include "CutUtils.hxx"
5 #include "EventBoxUtils.hxx"
6 
7 //********************************************************************
8 p0dNumuCCQESelection::p0dNumuCCQESelection(bool forceBreak): SelectionBase(forceBreak, EventBoxId::kEventBoxTracker) {
9 //********************************************************************
10 
11 }
12 
13 //********************************************************************
15 //********************************************************************
16  p0dNumuCCSelection p0dnumucc;
17  CopySteps(p0dnumucc);
18 
19  //Add a split to the trunk with 2 branches. One for single p0d
20  //selection and the other for multiple. This is necessary to get the
21  //weight systs as ApplyWeightSystematic is only called if a branch
22  //passes.
23  AddSplit(2);
24 
25  // QE selection
26  AddStep(0, StepBase::kCut, "single p0d pid", new SingleP0DPIDCut());
27  // Other selection. Need this additional "cut" or else the selection crashes
28  AddStep(1, StepBase::kCut, "multiple p0d pid", new MultipleP0DPIDCut());
29 
30  SetBranchAlias(0,"Single-P0D", 0);
31  SetBranchAlias(1,"Multiple-P0D", 1);
32 }
33 
34 //********************************************************************
36 //********************************************************************
37 
38  SetDetectorFV(SubDetId::kP0D);
39 }
40 
41 //**************************************************
43 //**************************************************
44 
45  AnaEventB& event = *static_cast<AnaEventB*>(&eventC);
46 
47  // Create the appropriate EventBox if it does not exist yet
48  if (!event.EventBoxes[EventBoxId::kEventBoxTracker])
49  event.EventBoxes[EventBoxId::kEventBoxTracker] = new EventBoxTracker();
50 
51  boxUtils::FillTracksWithTPC(event, static_cast<SubDetId::SubDetEnum>(GetDetectorFV()));
52  boxUtils::FillTracksWithP0D(event);
53  boxUtils::FillTrajsChargedInTPC(event);
54  boxUtils::FillTrajsChargedInP0D(event);
55 
56 
57 }
58 
59 //**************************************************
61 //**************************************************
62 
63  (void)box;
64 
65  AnaEventB& event = *static_cast<AnaEventB*>(&eventC);
66 
67  AnaTrackB* p0dTracks[100];
68  if (anaUtils::GetAllTracksUsingP0D(event, p0dTracks) == 1)
69  return true;
70  else
71  return false;
72 }
73 
74 //**************************************************
76 //**************************************************
77 
78  (void)box;
79 
80  AnaEventB& event = *static_cast<AnaEventB*>(&eventC);
81 
82  AnaTrackB* p0dTracks[100];
83  if (anaUtils::GetAllTracksUsingP0D(event, p0dTracks) > 1)
84  return true;
85  else
86  return false;
87 }
bool Apply(AnaEventC &event, ToyBoxB &box) const
int GetAllTracksUsingP0D(const AnaEventB &event, AnaTrackB *selTracks[])
virtual const ToyBoxTracker & box(Int_t isel=-1) const
Returns the ToyBoxTracker.
void DefineSteps()
Define all steps in the selection.
Representation of a global track.
void DefineDetectorFV()
Define the detector Fiducial Volume in which this selection is applied.
virtual void InitializeEvent(AnaEventC &)
Fill the EventBox with the objects needed by this selection.
bool Apply(AnaEventC &event, ToyBoxB &box) const