LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
BeamFlashTrackMatchTaggerAlg.h
Go to the documentation of this file.
1 #ifndef BEAMFLASHTRACKMATCHTAGGERALG_H
2 #define BEAMFLASHTRACKMATCHTAGGERALG_H
3 
13 #include <iostream>
14 
15 #include "fhiclcpp/ParameterSet.h"
16 
20 
22 
28 
29 #include "TTree.h"
30 #include "TH1F.h"
31 #include "TVector3.h"
32 
33 
34 namespace cosmic{
35  class BeamFlashTrackMatchTaggerAlg;
36 }
37 
38 
40  public:
41 
44 
46  void reconfigure(fhicl::ParameterSet const& p);
47 
48  //how to run the algorithm
49  void RunCompatibilityCheck(std::vector<recob::OpFlash> const&,
50  std::vector<recob::Track> const&,
51  std::vector<anab::CosmicTag>&,
52  std::vector<size_t>&,
56 
57  void SetHypothesisComparisonTree(TTree*,TH1F*,TH1F*);
58 
59  void RunHypothesisComparison(unsigned int const,
60  unsigned int const,
61  std::vector<recob::OpFlash> const&,
62  std::vector<recob::Track> const&,
66 
67  void RunHypothesisComparison(unsigned int const,
68  unsigned int const,
69  std::vector<recob::OpFlash> const&,
70  std::vector<simb::MCParticle> const&,
74 
75  private:
76 
79  const bool DEBUG_FLAG;
80 
82  float fMinOpHitPE;
83  float fMIPdQdx;
87  unsigned int fCumulativeChannelCut;
88  float fIntegralCut;
89 
92 
93 
94  TTree* cTree;
95 
96  typedef struct FlashComparisonProperties{
97  unsigned int run;
98  unsigned int event;
99 
100  unsigned int flash_index;
102  float flash_y;
104  float flash_z;
106  unsigned int flash_nOpDet;
107 
108  unsigned int hyp_index;
109  float hyp_totalPE;
110  float hyp_y;
111  float hyp_sigmay;
112  float hyp_z;
113  float hyp_sigmaz;
114 
115  float trk_startx;
116  float trk_starty;
117  float trk_startz;
118 
119  float trk_endx;
120  float trk_endy;
121  float trk_endz;
122 
123  float chi2;
124 
125  std::string leaf_structure;
127  leaf_structure("run/i:event/i:flash_index/i:flash_totalPE/F:flash_y/F:flash_sigmay/F:flash_z/F:flash_sigmaz/F:flash_nOpDet/i:hyp_index/i:hyp_totalPE/F:hyp_y/F:hyp_sigmay/F:hyp_z/F:hyp_sigmaz/F:trk_startx/F:trk_starty/F:trk_startz/F:trk_endx/F:trk_endy/F:trk_endz/F:chi2/F"){}
128 
130 
132  std::vector<float> cOpDetVector_flash;
133  std::vector<float> cOpDetVector_hyp;
136 
137 
144 
145  //core functions
146  std::vector<float> GetMIPHypotheses(recob::Track const& track,
147  Providers_t providers,
150  float XOffset=0);
151 
152  std::vector<float> GetMIPHypotheses(simb::MCParticle const& particle,
153  size_t start_i,
154  size_t end_i,
155  Providers_t providers,
158  float XOffset=0);
159 
160  void AddLightFromSegment(TVector3 const& pt1,
161  TVector3 const& pt2,
162  std::vector<float> & lightHypothesis,
163  float & totalHypothesisPE,
164  geo::GeometryCore const& geom,
166  float const& PromptMIPScintYield,
167  float XOffset);
168 
169  void NormalizeLightHypothesis(std::vector<float> & lightHypothesis,
170  float const& totalHypothesisPE,
171  geo::GeometryCore const& geom);
172 
173  CompatibilityResultType CheckCompatibility(std::vector<float> const& lightHypothesis,
174  const recob::OpFlash* flashPointer,
175  geo::GeometryCore const& geom);
176 
177  bool InDetector(TVector3 const&, geo::GeometryCore const&);
178  bool InDriftWindow(double, double, geo::GeometryCore const&);
179 
180  void FillFlashProperties(std::vector<float> const& opdetVector,
181  float&,
182  float&, float&,
183  float&, float&,
184  geo::GeometryCore const& geom);
185 
186  float CalculateChi2(std::vector<float> const&,std::vector<float> const&);
187 
188  //debugging functions
189  void PrintTrackProperties(recob::Track const&, std::ostream* output=&std::cout);
190  void PrintFlashProperties(recob::OpFlash const&, std::ostream* output=&std::cout);
191  void PrintHypothesisFlashComparison(std::vector<float> const&,
192  const recob::OpFlash*,
193  geo::GeometryCore const& geom,
194  CompatibilityResultType,
195  std::ostream* output=&std::cout);
196 
197 };
198 
199 #endif
CompatibilityResultType CheckCompatibility(std::vector< float > const &lightHypothesis, const recob::OpFlash *flashPointer, geo::GeometryCore const &geom)
void reconfigure(fhicl::ParameterSet const &p)
BeamFlashTrackMatchTaggerAlg(fhicl::ParameterSet const &p)
enum anab::cosmic_tag_id CosmicTagID_t
void RunHypothesisComparison(unsigned int const, unsigned int const, std::vector< recob::OpFlash > const &, std::vector< recob::Track > const &, Providers_t, phot::PhotonVisibilityService const &, opdet::OpDigiProperties const &)
float CalculateChi2(std::vector< float > const &, std::vector< float > const &)
struct cosmic::BeamFlashTrackMatchTaggerAlg::FlashComparisonProperties FlashComparisonProperties_t
Particle class.
void RunCompatibilityCheck(std::vector< recob::OpFlash > const &, std::vector< recob::Track > const &, std::vector< anab::CosmicTag > &, std::vector< size_t > &, Providers_t, phot::PhotonVisibilityService const &, opdet::OpDigiProperties const &)
std::vector< float > GetMIPHypotheses(recob::Track const &track, Providers_t providers, phot::PhotonVisibilityService const &pvs, opdet::OpDigiProperties const &, float XOffset=0)
Provides recob::Track data product.
void NormalizeLightHypothesis(std::vector< float > &lightHypothesis, float const &totalHypothesisPE, geo::GeometryCore const &geom)
void AddLightFromSegment(TVector3 const &pt1, TVector3 const &pt2, std::vector< float > &lightHypothesis, float &totalHypothesisPE, geo::GeometryCore const &geom, phot::PhotonVisibilityService const &pvs, float const &PromptMIPScintYield, float XOffset)
void PrintTrackProperties(recob::Track const &, std::ostream *output=&std::cout)
Description of geometry of one entire detector.
void SetHypothesisComparisonTree(TTree *, TH1F *, TH1F *)
void PrintHypothesisFlashComparison(std::vector< float > const &, const recob::OpFlash *, geo::GeometryCore const &geom, CompatibilityResultType, std::ostream *output=&std::cout)
Container for a list of pointers to providers.
Definition: ProviderPack.h:114
bool InDriftWindow(double, double, geo::GeometryCore const &)
void FillFlashProperties(std::vector< float > const &opdetVector, float &, float &, float &, float &, float &, geo::GeometryCore const &geom)
Data structure containing constant pointers to classes.
bool InDetector(TVector3 const &, geo::GeometryCore const &)
Float_t track
Definition: plot.C:34
art framework interface to geometry description
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:52
void PrintFlashProperties(recob::OpFlash const &, std::ostream *output=&std::cout)