11 float t_p1,
float t_p2,
12 float t_l1,
float t_l2,
13 float min_w,
float max_w,
27 float t_l1,
float t_l2,
28 float min_w,
float max_w,
29 const std::vector<float>& eV)
31 SetWavelengthRanges(min_w,max_w);
32 SetTimeRanges(t_p1,t_p2,t_l1,t_l2);
34 _photonVector_prompt=std::vector<float>(eV.size());
35 _photonVector_late=std::vector<float>(eV.size());
43 throw std::runtime_error(
"ERROR in SimPhotonCounter: bad wavelength range");
45 _min_wavelength = min_w;
46 _max_wavelength = max_w;
51 if(ph.
Energy < std::numeric_limits<float>::epsilon())
52 throw std::runtime_error(
"ERROR in SimPhotonCounter: photon energy is zero.");
54 return 0.00124 / ph.
Energy;
59 if(t_p2<t_p1 || t_l2<t_l1 || t_p2>t_l1 )
60 throw std::runtime_error(
"ERROR in SimPhotonCounter: bad time ranges");
62 _min_prompt_time = t_p1; _max_prompt_time = t_p2;
63 _min_late_time = t_l1; _max_late_time = t_l2;
68 if(i_opdet > GetVectorSize())
69 throw std::runtime_error(
"ERROR in SimPhotonCounter: Opdet requested out of range!");
71 if(Wavelength(photon) < _min_wavelength || Wavelength(photon) > _max_wavelength)
return;
73 if(photon.
Time > _min_prompt_time && photon.
Time <= _max_prompt_time)
74 _photonVector_prompt[i_opdet] += _qeVector[i_opdet];
75 else if(photon.
Time > _min_late_time && photon.
Time < _max_late_time)
76 _photonVector_late[i_opdet] += _qeVector[i_opdet];
82 for(
size_t i_ph=0; i_ph < photons.size(); i_ph++)
83 AddOnePhoton(photons.
OpChannel(),photons[i_ph]);
88 for(
size_t i=0; i<GetVectorSize(); i++){
89 _photonVector_prompt[i]=0.0;
90 _photonVector_late[i]=0.0;
96 std::vector<float> totalPhotonVector(GetVectorSize());
98 LatePhotonVector().
begin(),
99 totalPhotonVector.begin(),
101 return totalPhotonVector;
106 std::cout <<
"Vector size: " << GetVectorSize() << std::endl;
108 << MinPromptTime() <<
"," << MaxPromptTime() <<
") , ("
109 << MinLateTime() <<
"," << MaxLateTime() <<
")" << std::endl;
110 std::cout <<
"\t" <<
"i : QE / Prompt / Late / Total" << std::endl;
111 for(
size_t i=0; i<GetVectorSize(); i++)
112 std::cout <<
"\t" << i <<
": " << _qeVector[i] <<
" / " << _photonVector_prompt[i] <<
" / " << _photonVector_late[i] <<
" / " << TotalPhotonVector(i) << std::endl;
process_name can override from command line with o or output photon
int OpChannel() const
Returns the optical channel number this object is associated to.
void SetTimeRanges(float t_p1, float t_p2, float t_l1, float t_l2)
All information of a photon entering the sensitive optical detector volume.
std::vector< float > _photonVector_prompt
std::vector< float > TotalPhotonVector() const
Simulation objects for optical detectors.
auto end(FixedBins< T, C > const &) noexcept
float Wavelength(const sim::OnePhoton &ph)
auto begin(FixedBins< T, C > const &) noexcept
Collection of photons which recorded on one channel.
then echo File list $list not found else cat $list while read file do echo $file sed s
std::vector< float > _qeVector
std::vector< float > _photonVector_late
void AddOnePhoton(size_t i_opdet, const sim::OnePhoton &photon)
void SetWavelengthRanges(float min_w, float max_w)
float Energy
Scintillation photon energy [GeV].
void AddSimPhotons(const sim::SimPhotons &photons)
BEGIN_PROLOG could also be cout