LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
opdet::FlashHypothesisCreator Class Reference

#include "FlashHypothesisCreator.h"

Public Types

using Providers_t = lar::ProviderPack< geo::GeometryCore, detinfo::LArProperties >
 Set of service providers used in the common(est) interface. More...
 

Public Member Functions

 FlashHypothesisCreator ()
 
FlashHypothesisCollection GetFlashHypothesisCollection (recob::Track const &track, std::vector< float > const &dEdxVector, Providers_t providers, phot::PhotonVisibilityService const &pvs, opdet::OpDigiProperties const &opdigip, float XOffset=0)
 
FlashHypothesisCollection GetFlashHypothesisCollection (sim::MCTrack const &mctrack, std::vector< float > const &dEdxVector, Providers_t providers, phot::PhotonVisibilityService const &pvs, opdet::OpDigiProperties const &opdigip, float XOffset=0)
 
FlashHypothesisCollection GetFlashHypothesisCollection (std::vector< TVector3 > const &trajVector, std::vector< float > const &dEdxVector, Providers_t providers, phot::PhotonVisibilityService const &pvs, opdet::OpDigiProperties const &opdigip, float XOffset=0)
 
FlashHypothesisCollection GetFlashHypothesisCollection (TVector3 const &pt1, TVector3 const &pt2, float const &dEdx, Providers_t providers, phot::PhotonVisibilityService const &pvs, opdet::OpDigiProperties const &opdigip, float XOffset=0)
 

Private Member Functions

FlashHypothesisCollection CreateFlashHypothesesFromSegment (TVector3 const &pt1, TVector3 const &pt2, float const &dEdx, Providers_t providers, phot::PhotonVisibilityService const &pvs, opdet::OpDigiProperties const &opdigip, float XOffset)
 

Private Attributes

FlashHypothesisCalculator _calc
 

Detailed Description

Definition at line 43 of file FlashHypothesisCreator.h.

Member Typedef Documentation

Set of service providers used in the common(est) interface.

Definition at line 47 of file FlashHypothesisCreator.h.

Constructor & Destructor Documentation

opdet::FlashHypothesisCreator::FlashHypothesisCreator ( )
inline

Definition at line 49 of file FlashHypothesisCreator.h.

References tca::dEdx(), pt1, pt2, and track.

49 {}

Member Function Documentation

opdet::FlashHypothesisCollection opdet::FlashHypothesisCreator::CreateFlashHypothesesFromSegment ( TVector3 const &  pt1,
TVector3 const &  pt2,
float const &  dEdx,
Providers_t  providers,
phot::PhotonVisibilityService const &  pvs,
opdet::OpDigiProperties const &  opdigip,
float  XOffset 
)
private

Definition at line 145 of file FlashHypothesisCreator.cxx.

References _calc, tca::dEdx(), opdet::FlashHypothesisCalculator::FillFlashHypothesis(), lar::ProviderPack< Providers >::get(), phot::PhotonVisibilityService::GetAllVisibilities(), pt1, pt2, opdet::OpDigiProperties::QE(), opdet::FlashHypothesisCalculator::SegmentMidpoint(), and opdet::FlashHypothesisCollection::SetPromptHypAndPromptFraction().

Referenced by GetFlashHypothesisCollection().

153 {
154  auto const* geom = providers.get<geo::GeometryCore>();
155  auto const* larp = providers.get<detinfo::LArProperties>();
156  auto const nOpDets = geom->NOpDets();
157  FlashHypothesisCollection fhc(nOpDets);
158 
159  FlashHypothesis prompt_hyp = FlashHypothesis(nOpDets);
160 
161  std::vector<double> xyz_segment(_calc.SegmentMidpoint(pt1, pt2, XOffset));
162 
163  //get the visibility vector
164  auto const& PointVisibility = pvs.GetAllVisibilities(&xyz_segment[0]);
165 
166  //check visibility pointer, as it may be null if given a y/z outside some range
167  if (!PointVisibility) return fhc;
168 
169  //klugey ... right now, set a qe_vector that gives constant qe across all opdets
170  std::vector<float> qe_vector(nOpDets, opdigip.QE());
171  _calc.FillFlashHypothesis(larp->ScintYield() * larp->ScintYieldRatio(),
172  dEdx,
173  pt1,
174  pt2,
175  qe_vector,
176  PointVisibility,
177  prompt_hyp);
178 
179  fhc.SetPromptHypAndPromptFraction(prompt_hyp, larp->ScintYieldRatio());
180  return fhc;
181 }
void FillFlashHypothesis(const float &yield, const float &dEdx, const TVector3 &pt1, const TVector3 &pt2, const std::vector< float > &qe_vector, phot::MappedCounts_t const &vis_vector, FlashHypothesis &hyp)
FlashHypothesisCalculator _calc
TText * pt2
Definition: plot.C:64
Description of geometry of one entire detector.
Definition: GeometryCore.h:119
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
Definition: PFPUtils.cxx:2675
std::vector< double > SegmentMidpoint(const TVector3 &pt1, const TVector3 &pt2, float XOffset=0)
TText * pt1
Definition: plot.C:61
opdet::FlashHypothesisCollection opdet::FlashHypothesisCreator::GetFlashHypothesisCollection ( recob::Track const &  track,
std::vector< float > const &  dEdxVector,
Providers_t  providers,
phot::PhotonVisibilityService const &  pvs,
opdet::OpDigiProperties const &  opdigip,
float  XOffset = 0 
)

Title: FlashHypothesis Creator Class Author: Wes Ketchum (wketc.nosp@m.hum@.nosp@m.lanl..nosp@m.gov)

Description: Class that produces a flash hypothesis for a trajectory. Input: Trajectory (std::vector<TVector3> objects) Output: FlashHypotheses

Definition at line 19 of file FlashHypothesisCreator.cxx.

References CreateFlashHypothesesFromSegment(), lar::ProviderPack< Providers >::get(), recob::Track::LocationAtPoint(), recob::Track::NumberTrajectoryPoints(), and pt.

Referenced by opdet::FlashHypothesisAnaAlg::RunComparison().

26 {
27  bool interpolate_dEdx = false;
28  if (track.NumberTrajectoryPoints() == dEdxVector.size())
29  interpolate_dEdx = true;
30  else if (track.NumberTrajectoryPoints() == dEdxVector.size() + 1)
31  interpolate_dEdx = false;
32  else
33  throw "ERROR in FlashHypothesisCreator: dEdx vector size not compatible with track size.";
34 
35  auto const* geom = providers.get<geo::GeometryCore>();
36  FlashHypothesisCollection fhc(geom->NOpDets());
37  for (size_t pt = 1; pt < track.NumberTrajectoryPoints(); pt++) {
38  if (interpolate_dEdx)
39  fhc = fhc + CreateFlashHypothesesFromSegment(track.LocationAtPoint<TVector3>(pt - 1),
40  track.LocationAtPoint<TVector3>(pt),
41  0.5 * (dEdxVector[pt] + dEdxVector[pt - 1]),
42  providers,
43  pvs,
44  opdigip,
45  XOffset);
46  else
47  fhc = fhc + CreateFlashHypothesesFromSegment(track.LocationAtPoint<TVector3>(pt - 1),
48  track.LocationAtPoint<TVector3>(pt),
49  dEdxVector[pt - 1],
50  providers,
51  pvs,
52  opdigip,
53  XOffset);
54  }
55  return fhc;
56 }
TMarker * pt
Definition: egs.C:25
Description of geometry of one entire detector.
Definition: GeometryCore.h:119
FlashHypothesisCollection CreateFlashHypothesesFromSegment(TVector3 const &pt1, TVector3 const &pt2, float const &dEdx, Providers_t providers, phot::PhotonVisibilityService const &pvs, opdet::OpDigiProperties const &opdigip, float XOffset)
Float_t track
Definition: plot.C:35
opdet::FlashHypothesisCollection opdet::FlashHypothesisCreator::GetFlashHypothesisCollection ( sim::MCTrack const &  mctrack,
std::vector< float > const &  dEdxVector,
Providers_t  providers,
phot::PhotonVisibilityService const &  pvs,
opdet::OpDigiProperties const &  opdigip,
float  XOffset = 0 
)

Definition at line 58 of file FlashHypothesisCreator.cxx.

References CreateFlashHypothesesFromSegment(), lar::ProviderPack< Providers >::get(), and pt.

65 {
66  bool interpolate_dEdx = false;
67  if (mctrack.size() == dEdxVector.size())
68  interpolate_dEdx = true;
69  else if (mctrack.size() == dEdxVector.size() + 1)
70  interpolate_dEdx = false;
71  else
72  throw "ERROR in FlashHypothesisCreator: dEdx vector size not compatible with mctrack size.";
73 
74  auto const* geom = providers.get<geo::GeometryCore>();
75  FlashHypothesisCollection fhc(geom->NOpDets());
76  for (size_t pt = 1; pt < mctrack.size(); pt++) {
77  if (interpolate_dEdx)
78  fhc = fhc + CreateFlashHypothesesFromSegment(mctrack[pt - 1].Position().Vect(),
79  mctrack[pt].Position().Vect(),
80  0.5 * (dEdxVector[pt] + dEdxVector[pt - 1]),
81  providers,
82  pvs,
83  opdigip,
84  XOffset);
85  else
86  fhc = fhc + CreateFlashHypothesesFromSegment(mctrack[pt - 1].Position().Vect(),
87  mctrack[pt].Position().Vect(),
88  dEdxVector[pt - 1],
89  providers,
90  pvs,
91  opdigip,
92  XOffset);
93  }
94  return fhc;
95 }
TMarker * pt
Definition: egs.C:25
Description of geometry of one entire detector.
Definition: GeometryCore.h:119
FlashHypothesisCollection CreateFlashHypothesesFromSegment(TVector3 const &pt1, TVector3 const &pt2, float const &dEdx, Providers_t providers, phot::PhotonVisibilityService const &pvs, opdet::OpDigiProperties const &opdigip, float XOffset)
opdet::FlashHypothesisCollection opdet::FlashHypothesisCreator::GetFlashHypothesisCollection ( std::vector< TVector3 > const &  trajVector,
std::vector< float > const &  dEdxVector,
Providers_t  providers,
phot::PhotonVisibilityService const &  pvs,
opdet::OpDigiProperties const &  opdigip,
float  XOffset = 0 
)

Definition at line 97 of file FlashHypothesisCreator.cxx.

References CreateFlashHypothesesFromSegment(), lar::ProviderPack< Providers >::get(), and pt.

104 {
105  bool interpolate_dEdx = false;
106  if (trajVector.size() == dEdxVector.size())
107  interpolate_dEdx = true;
108  else if (trajVector.size() == dEdxVector.size() + 1)
109  interpolate_dEdx = false;
110  else
111  throw "ERROR in FlashHypothesisCreator: dEdx vector size not compatible with trajVector size.";
112 
113  auto const* geom = providers.get<geo::GeometryCore>();
114  FlashHypothesisCollection fhc(geom->NOpDets());
115  for (size_t pt = 1; pt < trajVector.size(); pt++) {
116  if (interpolate_dEdx)
117  fhc = fhc + CreateFlashHypothesesFromSegment(trajVector[pt - 1],
118  trajVector[pt],
119  0.5 * (dEdxVector[pt] + dEdxVector[pt - 1]),
120  providers,
121  pvs,
122  opdigip,
123  XOffset);
124  else
125  fhc =
126  fhc +
128  trajVector[pt - 1], trajVector[pt], dEdxVector[pt - 1], providers, pvs, opdigip, XOffset);
129  }
130  return fhc;
131 }
TMarker * pt
Definition: egs.C:25
Description of geometry of one entire detector.
Definition: GeometryCore.h:119
FlashHypothesisCollection CreateFlashHypothesesFromSegment(TVector3 const &pt1, TVector3 const &pt2, float const &dEdx, Providers_t providers, phot::PhotonVisibilityService const &pvs, opdet::OpDigiProperties const &opdigip, float XOffset)
opdet::FlashHypothesisCollection opdet::FlashHypothesisCreator::GetFlashHypothesisCollection ( TVector3 const &  pt1,
TVector3 const &  pt2,
float const &  dEdx,
Providers_t  providers,
phot::PhotonVisibilityService const &  pvs,
opdet::OpDigiProperties const &  opdigip,
float  XOffset = 0 
)

Definition at line 133 of file FlashHypothesisCreator.cxx.

References CreateFlashHypothesesFromSegment().

141 {
142  return CreateFlashHypothesesFromSegment(pt1, pt2, dEdx, providers, pvs, opdigip, XOffset);
143 }
TText * pt2
Definition: plot.C:64
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
Definition: PFPUtils.cxx:2675
TText * pt1
Definition: plot.C:61
FlashHypothesisCollection CreateFlashHypothesesFromSegment(TVector3 const &pt1, TVector3 const &pt2, float const &dEdx, Providers_t providers, phot::PhotonVisibilityService const &pvs, opdet::OpDigiProperties const &opdigip, float XOffset)

Member Data Documentation

FlashHypothesisCalculator opdet::FlashHypothesisCreator::_calc
private

Definition at line 90 of file FlashHypothesisCreator.h.

Referenced by CreateFlashHypothesesFromSegment().


The documentation for this class was generated from the following files: