LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
BeamFlashTrackMatchTaggerAlg.h
Go to the documentation of this file.
1 #ifndef BEAMFLASHTRACKMATCHTAGGERALG_H
2 #define BEAMFLASHTRACKMATCHTAGGERALG_H
3 
13 #include <iostream>
14 #include <string>
15 #include <vector>
16 
17 namespace fhicl {
18  class ParameterSet;
19 }
20 namespace geo {
21  class GeometryCore;
22 }
23 namespace detinfo {
24  class LArProperties;
25 }
26 namespace phot {
28 }
29 namespace opdet {
30  class OpDigiProperties;
31 }
32 
37 
39 
40 class TVector3;
41 class TH1F;
42 class TTree;
43 
44 namespace cosmic {
45  class BeamFlashTrackMatchTaggerAlg;
46 }
47 
49 public:
52 
54 
55  //how to run the algorithm
56  void RunCompatibilityCheck(std::vector<recob::OpFlash> const&,
57  std::vector<recob::Track> const&,
58  std::vector<anab::CosmicTag>&,
59  std::vector<size_t>&,
63 
64  void SetHypothesisComparisonTree(TTree*, TH1F*, TH1F*);
65 
66  void RunHypothesisComparison(unsigned int const,
67  unsigned int const,
68  std::vector<recob::OpFlash> const&,
69  std::vector<recob::Track> const&,
73 
74  void RunHypothesisComparison(unsigned int const,
75  unsigned int const,
76  std::vector<recob::OpFlash> const&,
77  std::vector<simb::MCParticle> const&,
81 
82 private:
85  const bool DEBUG_FLAG;
86 
88  float fMinOpHitPE;
89  float fMIPdQdx;
93  unsigned int fCumulativeChannelCut;
94  float fIntegralCut;
95 
98 
99  TTree* cTree;
100 
101  typedef struct FlashComparisonProperties {
102  unsigned int run;
103  unsigned int event;
104 
105  unsigned int flash_index;
107  float flash_y;
109  float flash_z;
111  unsigned int flash_nOpDet;
112 
113  unsigned int hyp_index;
114  float hyp_totalPE;
115  float hyp_y;
116  float hyp_sigmay;
117  float hyp_z;
118  float hyp_sigmaz;
119 
120  float trk_startx;
121  float trk_starty;
122  float trk_startz;
123 
124  float trk_endx;
125  float trk_endy;
126  float trk_endz;
127 
128  float chi2;
129 
130  std::string leaf_structure;
132  : leaf_structure("run/i:event/i:flash_index/i:flash_totalPE/F:flash_y/F:flash_sigmay/"
133  "F:flash_z/F:flash_sigmaz/F:flash_nOpDet/i:hyp_index/i:hyp_totalPE/F:hyp_y/"
134  "F:hyp_sigmay/F:hyp_z/F:hyp_sigmaz/F:trk_startx/F:trk_starty/F:trk_startz/"
135  "F:trk_endx/F:trk_endy/F:trk_endz/F:chi2/F")
136  {}
137 
139 
141  std::vector<float> cOpDetVector_flash;
142  std::vector<float> cOpDetVector_hyp;
145 
146  typedef enum CompatibilityResultType {
147  kCompatible = 0,
150  kIntegralCut
152 
153  //core functions
154  std::vector<float> GetMIPHypotheses(recob::Track const& track,
155  Providers_t providers,
158  float XOffset = 0);
159 
160  std::vector<float> GetMIPHypotheses(simb::MCParticle const& particle,
161  size_t start_i,
162  size_t end_i,
163  Providers_t providers,
166  float XOffset = 0);
167 
168  void AddLightFromSegment(TVector3 const& pt1,
169  TVector3 const& pt2,
170  std::vector<float>& lightHypothesis,
171  float& totalHypothesisPE,
172  geo::GeometryCore const& geom,
174  float const& PromptMIPScintYield,
175  float XOffset);
176 
177  void NormalizeLightHypothesis(std::vector<float>& lightHypothesis,
178  float const& totalHypothesisPE,
179  geo::GeometryCore const& geom);
180 
181  CompatibilityResultType CheckCompatibility(std::vector<float> const& lightHypothesis,
182  const recob::OpFlash* flashPointer,
183  geo::GeometryCore const& geom);
184 
185  bool InDetector(TVector3 const&, geo::GeometryCore const&);
186  bool InDriftWindow(double, double, geo::GeometryCore const&);
187 
188  void FillFlashProperties(std::vector<float> const& opdetVector,
189  float&,
190  float&,
191  float&,
192  float&,
193  float&,
194  geo::GeometryCore const& geom);
195 
196  float CalculateChi2(std::vector<float> const&, std::vector<float> const&);
197 
198  //debugging functions
199  void PrintTrackProperties(recob::Track const&, std::ostream* output = &std::cout);
200  void PrintFlashProperties(recob::OpFlash const&, std::ostream* output = &std::cout);
201  void PrintHypothesisFlashComparison(std::vector<float> const&,
202  const recob::OpFlash*,
203  geo::GeometryCore const& geom,
204  CompatibilityResultType,
205  std::ostream* output = &std::cout);
206 };
207 
208 #endif
enum anab::cosmic_tag_id CosmicTagID_t
Particle class.
TText * pt2
Definition: plot.C:64
parameter set interface
Provides recob::Track data product.
General LArSoft Utilities.
Description of geometry of one entire detector.
Definition: GeometryCore.h:119
General LArSoft Utilities.
Container for a list of pointers to providers.
Definition: ProviderPack.h:111
Data structure containing constant pointers to classes.
TText * pt1
Definition: plot.C:61
Namespace collecting geometry-related classes utilities.
Float_t track
Definition: plot.C:35
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
Definition: Track.h:49