LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
FlashHypothesisCalculator.cxx
Go to the documentation of this file.
1 #ifndef FLASHHYPOTHESISCALCULATOR_CXX
2 #define FLASHHYPOTHESISCALCULATOR_CXX
3 
5 
6 std::vector<double> opdet::FlashHypothesisCalculator::SegmentMidpoint(TVector3 const& pt1, TVector3 const& pt2, float XOffset)
7 {
8  std::vector<double> xyz_segment(3);
9  xyz_segment[0] = 0.5*(pt2.x()+pt1.x()) + XOffset;
10  xyz_segment[1] = 0.5*(pt2.y()+pt1.y());
11  xyz_segment[2] = 0.5*(pt2.z()+pt1.z());
12  return xyz_segment;
13 }
14 
16  const float& dEdx,
17  const TVector3& pt1,
18  const TVector3& pt2,
19  const std::vector<float>& qe_vector,
20  const float* vis_vector,
21  FlashHypothesis& hyp)
22 {
23 
24  if(qe_vector.size()!=hyp.GetVectorSize() || !vis_vector)
25  throw std::runtime_error("ERROR in FlashHypothesisCalculator: vector sizes not equal!");
26 
27  const float total_yield = yield*dEdx*(pt2-pt1).Mag();
28 
29  for(size_t i_chan=0; i_chan<hyp.GetVectorSize(); i_chan++)
30  hyp.SetHypothesisAndError(i_chan,total_yield*vis_vector[i_chan]*qe_vector[i_chan]);
31 
32 }
33 
34 #endif
size_t GetVectorSize() const
void FillFlashHypothesis(const float &yield, const float &dEdx, const TVector3 &pt1, const TVector3 &pt2, const std::vector< float > &qe_vector, const float *vis_vector, FlashHypothesis &hyp)
void SetHypothesisAndError(size_t i_opdet, float pe, float err=-999)
std::vector< double > SegmentMidpoint(const TVector3 &pt1, const TVector3 &pt2, float XOffset=0)