HighLAND
p0dNumuCCSelection.cxx
1 #include "baseSelection.hxx"
2 #include "p0dNumuCCSelection.hxx"
3 #include "CutUtils.hxx"
4 #include "trackerSelectionUtils.hxx"
5 #include "EventBoxUtils.hxx"
6 
7 
8 //********************************************************************
9 p0dNumuCCSelection::p0dNumuCCSelection(bool forceBreak): SelectionBase(forceBreak, EventBoxId::kEventBoxTracker) {
10 //********************************************************************
11 
12 }
13 
14 //********************************************************************
16 //********************************************************************
17 
18  // Cuts must be added in the right order
19  // last "true" means the step sequence is broken if cut is not passed (default is "false")
20  AddStep(StepBase::kCut, "event quality", new EventQualityCut(), true);
21  AddStep(StepBase::kCut, "> 0 tracks ", new TotalMultiplicityCut(), true);
22  AddStep(StepBase::kAction, "find leading tracks",new FindP0DLeadingTracksAction());
23  AddStep(StepBase::kAction, "find vertex", new FindVertexAction());
24  AddStep(StepBase::kCut, "quality+fiducial", new TrackQualityFiducialCut(), true);
25  AddStep(StepBase::kAction, "find veto track", new FindP0DVetoAction());
26  AddStep(StepBase::kCut, "veto", new P0DSelectionVetoCut(),true);
27  SetBranchAlias(0,"trunk");
28 }
29 
30 //**************************************************
32 //**************************************************
33 
34  AnaEventB& event = *static_cast<AnaEventB*>(&eventC);
35 
36  // Create the appropriate EventBox if it does not exist yet
37  if (!event.EventBoxes[EventBoxId::kEventBoxTracker])
38  event.EventBoxes[EventBoxId::kEventBoxTracker] = new EventBoxTracker();
39 
40  boxUtils::FillTracksWithTPC(event, static_cast<SubDetId::SubDetEnum>(GetDetectorFV()));
41  boxUtils::FillTracksWithP0D(event);
42  boxUtils::FillTrajsChargedInTPC(event);
43  boxUtils::FillTrajsChargedInP0D(event);
44 
45 }
46 
47 //********************************************************************
49 //********************************************************************
50 
51  SetDetectorFV(SubDetId::kP0D);
52 }
53 
54 
55 //**************************************************
57 //**************************************************
58 
59  // Cast the ToyBox to the appropriate type
60  ToyBoxTracker& box = *static_cast<ToyBoxTracker*>(&boxB);
61 
62  trackerSelUtils::FindLeadingTracks(event, box);
63 
64  // For this selection the main track is the HMN track
65  box.MainTrack = box.HMNtrack;
66  return true;
67 }
68 
69 //**************************************************
70 bool FindP0DVetoAction::Apply(AnaEventC& event, ToyBoxB& boxB) const{
71 //**************************************************
72  ToyBoxTracker* box = static_cast<ToyBoxTracker*> (&boxB);
73  box->VetoTrack = cutUtils::FindP0DVetoTrack(event);
74 
75  return true;
76 }
77 
78 //**************************************************
79 bool P0DSelectionVetoCut::Apply(AnaEventC& event, ToyBoxB& boxB) const{
80 //**************************************************
81 
82  (void)event;
83 
84  ToyBoxTracker* box = static_cast<ToyBoxTracker*> (&boxB);
85  if (box->VetoTrack)
86  return false;
87 
88  return true;
89 
90 }
91 
bool Apply(AnaEventC &event, ToyBoxB &box) const
bool Apply(AnaEventC &event, ToyBoxB &box) const
AnaTrackB * MainTrack
For storing the Main Track (The lepton candidate in geranal: HMN or HMP track)
bool Apply(AnaEventC &event, ToyBoxB &box) const
AnaTrackB * VetoTrack
For storing the veto track.
void DefineSteps()
Define all steps in the selection.
AnaTrackB * HMNtrack
For storing the highest momentum negative track.
void DefineDetectorFV()
Define the detector Fiducial Volume in which this selection is applied.
Find the Vertex. For the moment it&#39;s just the Star position of the HM track.
A cut on event quality. Requires good beam and ND280 data quality flags.
virtual void InitializeEvent(AnaEventC &)
Fill the EventBox with the objects needed by this selection.