HighLAND
numuCCBwdSelection.hxx
1 #ifndef numuCCBwdSelection_h
2 #define numuCCBwdSelection_h
3 
4 #include "SelectionBase.hxx"
5 #include "Parameters.hxx"
6 #include "CutUtils.hxx"
7 #include "ToyBoxTracker.hxx"
8 
10 
11 public:
12  numuCCBwdSelection(bool forceBreak=true, SubDetId::SubDetEnum aFV = SubDetId::kFGD1);
13  virtual ~numuCCBwdSelection(){}
14 
15  void DefineSteps();
16  void DefineDetectorFV();
17  void InitializeEvent(AnaEventC& event);
18  inline ToyBoxB* MakeToyBox() { return new ToyBoxTracker(); }
19  bool FillEventSummary(AnaEventC& event, Int_t allCutsPassed[]);
20 
21  SampleId::SampleEnum GetSampleEnum(){
22  if( _detectorFV[0] == SubDetId::kFGD1 ){
23  return SampleId::kFGD1NuMuCCBwd;
24  }else if( _detectorFV[0] == SubDetId::kFGD2 ){
25  return SampleId::kFGD2NuMuCCBwd;
26  }
27  return SampleId::kUnassigned;
28  }
29 
30  bool CheckRedoSelection(const AnaEventC& event, const ToyBoxB& PreviousToyBox, Int_t& redoFromStep);
31  bool IsRelevantRecObjectForSystematic(const AnaEventC& event, AnaRecObjectC* recObj, SystId_h systId, Int_t branch) const;
32  bool IsRelevantSystematic(const AnaEventC& event, const ToyBoxB& box, SystId_h systId, Int_t branch) const;
33 
34 protected:
35 
37 
38 };
39 
40 
41 namespace numuCCBwd{
42 
43  /// reduced FGD1 FV for Bwd
44  const Float_t FVdefminFGD1[3] = {57.66, 57.66, 0.0};
45  const Float_t FVdefmaxFGD1[3] = {57.66, 57.66, 0.0};
46 
47  /// reduced FGD2 FV for Bwd
48  const Float_t FVdefminFGD2[3] = {57.66, 57.66, 0.0};
49  const Float_t FVdefmaxFGD2[3] = {57.66, 57.66, 0.0};
50 
51  //Modified track quality cut
52  bool TrackQualityCut(const AnaTrackB& track, SubDetId::SubDetEnum tpc);
53 
54  // In FGD FV
55  SubDetId::SubDetEnum InFGDFV( const Float_t pos[4] );
56 
57  // Ends in FGD FV
58  SubDetId::SubDetEnum EndsInFGDFV(const AnaTrackB& track);
59 
60  /// Event failed FGD1 selection when running FGD2 selection in a FGD1 + FGD2 analysis
61  //********************************************************************
62  class Exclusive: public StepBase{
63  //********************************************************************
64  public:
65  using StepBase::Apply;
66  bool Apply(AnaEventC& event, ToyBoxB& box) const;
67  StepBase* MakeClone(){return new Exclusive();}
68  };
69 
70  /// Muon candidate has a positive time of flight
71  //********************************************************************
72  class ToF: public StepBase{
73  //********************************************************************
74  public:
75  ToF() {
76  _FGD1_FGD2 = (Float_t) ND::params().GetParameterD("numuCCBwdAnalysis.Cuts.ToF.FGD1_FGD2");
77  _P0D_FGD1 = (Float_t) ND::params().GetParameterD("numuCCBwdAnalysis.Cuts.ToF.P0D_FGD1");
78  _ECal_FGD1 = (Float_t) ND::params().GetParameterD("numuCCBwdAnalysis.Cuts.ToF.ECal_FGD1");
79  _ECal_FGD2 = (Float_t) ND::params().GetParameterD("numuCCBwdAnalysis.Cuts.ToF.ECal_FGD2");
80  }
81 
82 
83  using StepBase::Apply;
84  bool Apply(AnaEventC& event, ToyBoxB& box) const;
85  StepBase* MakeClone(){return new ToF();}
86 
87  private:
88  Float_t _FGD1_FGD2, _P0D_FGD1, _ECal_FGD1, _ECal_FGD2;
89  };
90 
91  /// Track has more than one node in ecal or p0d
92  //********************************************************************
93  class NoShower: public StepBase{
94  //********************************************************************
95  public:
96  using StepBase::Apply;
97  bool Apply(AnaEventC& event, ToyBoxB& box) const;
98  StepBase* MakeClone(){return new NoShower();}
99  };
100 
101  /// Timing available
102  //********************************************************************
103  class AvailableToF: public StepBase{
104  //********************************************************************
105  public:
106  using StepBase::Apply;
107  bool Apply(AnaEventC& event, ToyBoxB& box) const;
108  StepBase* MakeClone(){return new AvailableToF();}
109  };
110 
111  /// Muon PID cut
112  //********************************************************************
113  class MuonPIDCut: public StepBase{
114  //********************************************************************
115  public:
116  MuonPIDCut(){
117  _muon_pid = (Float_t)ND::params().GetParameterD("numuCCBwdAnalysis.Cuts.MuonPID");
118  }
119 
120  using StepBase::Apply;
121  bool Apply(AnaEventC& event, ToyBoxB& box) const;
122  StepBase* MakeClone(){return new MuonPIDCut();}
123 
124  private:
125  Float_t _muon_pid;
126  };
127 
128  /// Define vertex
129  //********************************************************************
130  class FindVertexAction: public StepBase{
131  //********************************************************************
132  public:
133  using StepBase::Apply;
134  bool Apply(AnaEventC& event, ToyBoxB& box) const;
136  };
137 
138  /// Switch back TPC tracks sense
139  //********************************************************************
140  class SwitchBackAction: public StepBase{
141  //********************************************************************
142  public:
143  using StepBase::Apply;
144  bool Apply(AnaEventC& event, ToyBoxB& box) const;
146  };
147 
148  /// Find Muon candidate
149  //********************************************************************
151  //********************************************************************
152  public:
153  using StepBase::Apply;
154  bool Apply(AnaEventC& event, ToyBoxB& box) const;
156 
157  };
158 
159 }
160 
161 #endif
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
void DefineSteps()
Define all steps in the selection.
bool CheckRedoSelection(const AnaEventC &event, const ToyBoxB &PreviousToyBox, Int_t &redoFromStep)
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
Event failed FGD1 selection when running FGD2 selection in a FGD1 + FGD2 analysis.
Track has more than one node in ecal or p0d.
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
ToyBoxB * MakeToyBox()
Create the appropriate type of box.
bool IsRelevantSystematic(const AnaEventC &event, const ToyBoxB &box, SystId_h systId, Int_t branch) const
Is this systematic relevant for this selection.
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
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...
SubDetEnum
Enumeration of all detector systems and subdetectors.
Definition: SubDetId.hxx:25
virtual bool Apply(AnaEventC &event, ToyBoxB &box) const
Definition: StepBase.hxx:46
Switch back TPC tracks sense.
void InitializeEvent(AnaEventC &event)
Fill the EventBox with the objects needed by this selection.
Representation of a global track.
bool Apply(AnaEventC &event, bool &redo)
Apply all steps in the selection.
double GetParameterD(std::string)
Get parameter. Value is returned as double.
Definition: Parameters.cxx:229
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
void DefineDetectorFV()
Define the detector Fiducial Volume in which this selection is applied.
Muon candidate has a positive time of flight.
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
ToyBoxB ** PreviousToyBox
Array of pointers to the PreviousToyBox (for each event)
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!
StepBase * MakeClone()
MANDATORY FUNCTIONS !!!