All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sbnana/sbnanalysis/ana/SBNOscReco/CosmicIDAlgs/CosmicIdAlg.h
Go to the documentation of this file.
1 #ifndef COSMICIDALG_H_SEEN
2 #define COSMICIDALG_H_SEEN
3 
4 
5 ///////////////////////////////////////////////
6 // CosmicIdAlg.h
7 //
8 // Functions for fiducial volume cosmic tagger
9 // T Brooks (tbrooks@fnal.gov), November 2018
10 ///////////////////////////////////////////////
11 
21 
22 // framework
23 #include "art/Framework/Principal/Event.h"
24 #include "fhiclcpp/ParameterSet.h"
25 #include "fhiclcpp/types/Table.h"
26 #include "fhiclcpp/types/Atom.h"
27 #include "art/Framework/Principal/Handle.h"
28 #include "canvas/Persistency/Common/Ptr.h"
29 
30 // LArSoft
36 
37 // c++
38 #include <vector>
39 #include <utility>
40 
41 
42 namespace ana{
43 
44  class CosmicIdAlg {
45  public:
46 
47  struct BeamTime {
48  using Name = fhicl::Name;
49  using Comment = fhicl::Comment;
50 
51  fhicl::Atom<double> BeamTimeMin {
52  Name("BeamTimeMin"),
53  Comment("")
54  };
55 
56  fhicl::Atom<double> BeamTimeMax {
57  Name("BeamTimeMax"),
58  Comment("")
59  };
60 
61  };
62 
63  struct Config {
64  using Name = fhicl::Name;
65  using Comment = fhicl::Comment;
66 
67  fhicl::Atom<art::InputTag> CrtHitModuleLabel {
68  Name("CrtHitModuleLabel"),
69  Comment("tag of CRT hit producer data product")
70  };
71 
72  fhicl::Atom<art::InputTag> CrtTrackModuleLabel {
73  Name("CrtTrackModuleLabel"),
74  Comment("tag of CRT track producer data product")
75  };
76 
77  fhicl::Atom<art::InputTag> TpcTrackModuleLabel {
78  Name("TpcTrackModuleLabel"),
79  Comment("tag of TPC track producer data product")
80  };
81 
82  fhicl::Atom<art::InputTag> CaloModuleLabel {
83  Name("CaloModuleLabel"),
84  Comment("tag of calorimetry producer data product")
85  };
86 
87  fhicl::Atom<art::InputTag> PandoraLabel {
88  Name("PandoraLabel"),
89  Comment("tag of pandora data product")
90  };
91 
92  fhicl::Atom<bool> ApplyFiducialCut {
93  Name("ApplyFiducialCut"),
94  Comment("")
95  };
96 
97  fhicl::Atom<bool> ApplyStoppingCut {
98  Name("ApplyStoppingCut"),
99  Comment("")
100  };
101 
102  fhicl::Atom<bool> ApplyGeometryCut {
103  Name("ApplyGeometryCut"),
104  Comment("")
105  };
106 
107  fhicl::Atom<bool> ApplyCpaCrossCut {
108  Name("ApplyCpaCrossCut"),
109  Comment("")
110  };
111 
112  fhicl::Atom<bool> ApplyApaCrossCut {
113  Name("ApplyApaCrossCut"),
114  Comment("")
115  };
116 
117  fhicl::Atom<bool> ApplyCrtTrackCut {
118  Name("ApplyCrtTrackCut"),
119  Comment("")
120  };
121 
122  fhicl::Atom<bool> ApplyCrtHitCut {
123  Name("ApplyCrtHitCut"),
124  Comment("")
125  };
126 
127  fhicl::Atom<bool> ApplyPandoraT0Cut {
128  Name("ApplyPandoraT0Cut"),
129  Comment("")
130  };
131 
132  fhicl::Atom<bool> UseTrackAngleVeto {
133  Name("UseTrackAngleVeto"),
134  Comment("")
135  };
136 
137  fhicl::Atom<double> MinSecondTrackLength {
138  Name("MinSecondTrackLength"),
139  Comment("")
140  };
141 
142  fhicl::Atom<double> MinVertexDistance {
143  Name("MinVertexDistance"),
144  Comment("")
145  };
146 
147  fhicl::Atom<double> MinMergeAngle {
148  Name("MinMergeAngle"),
149  Comment("")
150  };
151 
152  fhicl::Table<FiducialVolumeCosmicIdAlg::Config> FVTagAlg {
153  Name("FVTagAlg"),
154  };
155 
156  fhicl::Table<StoppingParticleCosmicIdAlg::Config> SPTagAlg {
157  Name("SPTagAlg"),
158  };
159 
160  fhicl::Table<CpaCrossCosmicIdAlg::Config> CCTagAlg {
161  Name("CCTagAlg"),
162  };
163 
164  fhicl::Table<ApaCrossCosmicIdAlg::Config> ACTagAlg {
165  Name("ACTagAlg"),
166  };
167 
168  fhicl::Table<CrtHitCosmicIdAlg::Config> CHTagAlg {
169  Name("CHTagAlg"),
170  };
171 
172  fhicl::Table<CrtTrackCosmicIdAlg::Config> CTTagAlg {
173  Name("CTTagAlg"),
174  };
175 
176  fhicl::Table<PandoraT0CosmicIdAlg::Config> PTTagAlg {
177  Name("PTTagAlg"),
178  };
179 
180  fhicl::Table<BeamTime> BeamTimeLimits {
181  Name("BeamTimeLimits"),
182  Comment("")
183  };
184 
185  };
186 
187  CosmicIdAlg(const Config& config);
188 
189  CosmicIdAlg(const fhicl::ParameterSet& pset) :
190  CosmicIdAlg(fhicl::Table<Config>(pset, {})()) {}
191 
192  CosmicIdAlg();
193 
194  ~CosmicIdAlg();
195 
196  void reconfigure(const Config& config);
197 
198  // Change which cuts are run
199  void SetCuts(bool FV, bool SP, bool Geo, bool CC, bool AC, bool CT, bool CH, bool PT);
200 
201  // Reset which cuts are run from fhicl parameters
202  void ResetCuts();
203 
204  // Run cuts to decide if track looks like a cosmic
205  bool CosmicId(recob::Track track, const art::Event& event, std::vector<double> t0Tpc0, std::vector<double> t0Tpc1);
206 
207  // Run cuts to decide if PFParticle looks like a cosmic
208  bool CosmicId(recob::PFParticle pfparticle, std::map< size_t, art::Ptr<recob::PFParticle> > pfParticleMap, const art::Event& event, std::vector<double> t0Tpc0, std::vector<double> t0Tpc1);
209 
210  // Getters for the underlying algorithms
214  ApaCrossCosmicIdAlg ApaAlg() const {return acTag;}
215 
216  private:
217 
218  double fBeamTimeMin;
219  double fBeamTimeMax;
220 
221  art::InputTag fTpcTrackModuleLabel;
222  art::InputTag fPandoraLabel;
223  art::InputTag fCrtHitModuleLabel;
224  art::InputTag fCrtTrackModuleLabel;
225  art::InputTag fCaloModuleLabel;
226 
235 
236  std::vector<bool> fOriginalSettings;
237 
242 
251 
252  };
253 
254 }
255 
256 #endif
Declaration of signal hit object.
process_name use argoneut_mc_hitfinder track
process_name opflashCryoW ana
bool CosmicId(recob::Track track, const art::Event &event, std::vector< double > t0Tpc0, std::vector< double > t0Tpc1)
fhicl::Table< StoppingParticleCosmicIdAlg::Config > SPTagAlg
fhicl::Table< FiducialVolumeCosmicIdAlg::Config > FVTagAlg
BEGIN_PROLOG vertical distance to the surface Name
Provides recob::Track data product.
process_name showerreco Particles Coinciding wih the Vertex services ScanOptions nu_mu CC
Hierarchical representation of particle flow.
Definition: PFParticle.h:44
void SetCuts(bool FV, bool SP, bool Geo, bool CC, bool AC, bool CT, bool CH, bool PT)
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a &quot;fitted&quot; track: