LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
FlashHypothesisCalculator.cxx
Go to the documentation of this file.
2 
5 
6 #include "TVector3.h"
7 
8 std::vector<double> opdet::FlashHypothesisCalculator::SegmentMidpoint(TVector3 const& pt1,
9  TVector3 const& pt2,
10  float XOffset)
11 {
12  std::vector<double> xyz_segment(3);
13  xyz_segment[0] = 0.5 * (pt2.x() + pt1.x()) + XOffset;
14  xyz_segment[1] = 0.5 * (pt2.y() + pt1.y());
15  xyz_segment[2] = 0.5 * (pt2.z() + pt1.z());
16  return xyz_segment;
17 }
18 
20  const float& dEdx,
21  const TVector3& pt1,
22  const TVector3& pt2,
23  const std::vector<float>& qe_vector,
24  phot::MappedCounts_t const& vis_vector,
25  FlashHypothesis& hyp)
26 {
27 
28  if (qe_vector.size() != hyp.GetVectorSize() || !vis_vector)
29  throw std::runtime_error("ERROR in FlashHypothesisCalculator: vector sizes not equal!");
30 
31  const float total_yield = yield * dEdx * (pt2 - pt1).Mag();
32 
33  for (size_t i_chan = 0; i_chan < hyp.GetVectorSize(); i_chan++)
34  hyp.SetHypothesisAndError(i_chan, total_yield * vis_vector[i_chan] * qe_vector[i_chan]);
35 }
Provides MappedContainer class.
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)
size_t GetVectorSize() const
void SetHypothesisAndError(size_t i_opdet, float pe, float err=-999)
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
A container for photon visibility mapping data.
std::vector< double > SegmentMidpoint(const TVector3 &pt1, const TVector3 &pt2, float XOffset=0)
TText * pt1
Definition: plot.C:61