LArSoft  v10_04_05
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 
14 namespace detinfo {
15  class LArProperties;
16 }
17 namespace phot {
19 }
20 namespace opdet {
21  class OpDigiProperties;
22 }
23 
29 
31 
32 #include "fhiclcpp/fwd.h"
33 
34 class TVector3;
35 class TH1F;
36 class TTree;
37 
38 #include <iostream>
39 #include <string>
40 #include <vector>
41 
42 namespace cosmic {
43  class BeamFlashTrackMatchTaggerAlg;
44 }
45 
47 public:
50 
52 
53  //how to run the algorithm
54  void RunCompatibilityCheck(std::vector<recob::OpFlash> const&,
55  std::vector<recob::Track> const&,
56  std::vector<anab::CosmicTag>&,
57  std::vector<size_t>&,
61 
62  void SetHypothesisComparisonTree(TTree*, TH1F*, TH1F*);
63 
64  void RunHypothesisComparison(unsigned int const,
65  unsigned int const,
66  std::vector<recob::OpFlash> const&,
67  std::vector<recob::Track> const&,
71 
72  void RunHypothesisComparison(unsigned int const,
73  unsigned int const,
74  std::vector<recob::OpFlash> const&,
75  std::vector<simb::MCParticle> const&,
79 
80 private:
83  const bool DEBUG_FLAG;
84 
86  float fMinOpHitPE;
87  float fMIPdQdx;
91  unsigned int fCumulativeChannelCut;
92  float fIntegralCut;
93 
96 
97  TTree* cTree;
98 
99  typedef struct FlashComparisonProperties {
100  unsigned int run;
101  unsigned int event;
102 
103  unsigned int flash_index;
105  float flash_y;
107  float flash_z;
109  unsigned int flash_nOpDet;
110 
111  unsigned int hyp_index;
112  float hyp_totalPE;
113  float hyp_y;
114  float hyp_sigmay;
115  float hyp_z;
116  float hyp_sigmaz;
117 
118  float trk_startx;
119  float trk_starty;
120  float trk_startz;
121 
122  float trk_endx;
123  float trk_endy;
124  float trk_endz;
125 
126  float chi2;
127 
128  std::string leaf_structure;
130  : leaf_structure("run/i:event/i:flash_index/i:flash_totalPE/F:flash_y/F:flash_sigmay/"
131  "F:flash_z/F:flash_sigmaz/F:flash_nOpDet/i:hyp_index/i:hyp_totalPE/F:hyp_y/"
132  "F:hyp_sigmay/F:hyp_z/F:hyp_sigmaz/F:trk_startx/F:trk_starty/F:trk_startz/"
133  "F:trk_endx/F:trk_endy/F:trk_endz/F:chi2/F")
134  {}
135 
137 
139  std::vector<float> cOpDetVector_flash;
140  std::vector<float> cOpDetVector_hyp;
143 
144  typedef enum CompatibilityResultType {
145  kCompatible = 0,
148  kIntegralCut
150 
151  //core functions
152  std::vector<float> GetMIPHypotheses(recob::Track const& track,
153  Providers_t providers,
156  float XOffset = 0);
157 
158  std::vector<float> GetMIPHypotheses(simb::MCParticle const& particle,
159  size_t start_i,
160  size_t end_i,
161  Providers_t providers,
164  float XOffset = 0);
165 
166  void AddLightFromSegment(TVector3 const& pt1,
167  TVector3 const& pt2,
168  std::vector<float>& lightHypothesis,
169  float& totalHypothesisPE,
170  geo::GeometryCore const& geom,
172  float const& PromptMIPScintYield,
173  float XOffset);
174 
175  void NormalizeLightHypothesis(std::vector<float>& lightHypothesis,
176  float const& totalHypothesisPE,
177  geo::GeometryCore const& geom);
178 
179  CompatibilityResultType CheckCompatibility(std::vector<float> const& lightHypothesis,
180  const recob::OpFlash* flashPointer,
181  geo::GeometryCore const& geom,
182  geo::WireReadoutGeom const& wireReadoutGeom);
183 
184  bool InDetector(TVector3 const&, geo::GeometryCore const&);
185  bool InDriftWindow(double, double, geo::GeometryCore const&);
186 
187  void FillFlashProperties(std::vector<float> const& opdetVector,
188  float&,
189  float&,
190  float&,
191  float&,
192  float&,
193  geo::GeometryCore const& geom);
194 
195  float CalculateChi2(std::vector<float> const&, std::vector<float> const&);
196 
197  //debugging functions
198  void PrintTrackProperties(recob::Track const&, std::ostream* output = &std::cout);
199  void PrintFlashProperties(recob::OpFlash const&, std::ostream* output = &std::cout);
200  void PrintHypothesisFlashComparison(std::vector<float> const&,
201  const recob::OpFlash*,
202  geo::GeometryCore const& geom,
203  geo::WireReadoutGeom const& wireReadoutGeom,
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
Interface for a class providing readout channel mapping to geometry.
General LArSoft Utilities.
Description of the physical geometry of one entire detector.
Definition: GeometryCore.h:91
General LArSoft Utilities.
Provides recob::Track data product.
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
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