SimPhotonCounter.h
Go to the documentation of this file.
1 #ifndef SIMPHOTONCOUNTER_H
2 #define SIMPHOTONCOUNTER_H
3 
4 /*!
5  * Title: SimPhotonCounter Class
6  * Author: Wes Ketchum (wketchum@lanl.gov)
7  *
8  * Description: Class that counts up sim photons, leading towards
9  * comparisons with flashes and flash hypotheses.
10 */
11 
13 #include <numeric>
14 
15 namespace opdet{
16 
18 
19  public:
21  SimPhotonCounter(size_t s, float t_p1, float t_p2, float t_l1, float t_l2, float min_w=0, float max_w=1e6, float e=1.0);
22 
23  SimPhotonCounter(float t_p1, float t_p2, float t_l1, float t_l2, float min_w, float max_w, const std::vector<float>& eV);
24 
25  void SetVectorSize(size_t s)
26  { _photonVector_prompt.resize(s); _photonVector_late.resize(s); _qeVector.resize(s); }
27  size_t GetVectorSize() const { return _photonVector_prompt.size(); }
28 
29  void SetWavelengthRanges(float min_w, float max_w);
30 
31  float MinWavelength() const { return _min_wavelength; }
32  float MaxWavelength() const { return _max_wavelength; }
33 
34  void SetTimeRanges(float t_p1, float t_p2, float t_l1, float t_l2);
35 
36  float MinPromptTime() const { return _min_prompt_time; }
37  float MaxPromptTime() const { return _max_prompt_time; }
38  float MinLateTime() const { return _min_late_time; }
39  float MaxLateTime() const { return _max_late_time; }
40 
41  void SetQE(size_t i, float e) { _qeVector.at(i) = e; }
42  float QE(size_t i) const { return _qeVector.at(i); }
43 
44  void SetQEVector(const std::vector<float>& eV)
45  { SetVectorSize(eV.size()); _qeVector = eV; }
46  std::vector<float> const& QEVector() const { return _qeVector; }
47 
48  void AddOnePhoton(size_t i_opdet,const sim::OnePhoton& photon);
49  void AddSimPhotons(const sim::SimPhotons& photons);
50 
51  void ClearVectors();
52  const std::vector<float>& PromptPhotonVector() const { return _photonVector_prompt; }
53  const std::vector<float>& LatePhotonVector() const { return _photonVector_late; }
54  float PromptPhotonVector(size_t i) const { return _photonVector_prompt.at(i); }
55  float LatePhotonVector(size_t i) const { return _photonVector_late.at(i); }
56 
57  std::vector<float> TotalPhotonVector() const;
58  float TotalPhotonVector(size_t i) const
59  { return (PromptPhotonVector(i)+LatePhotonVector(i)); }
60 
61  float PromptPhotonTotal() const
62  { return std::accumulate(_photonVector_prompt.begin(),_photonVector_prompt.end(),0.0); }
63  float LatePhotonTotal() const
64  { return std::accumulate(_photonVector_late.begin(),_photonVector_late.end(),0.0); }
65  float PhotonTotal() const { return (PromptPhotonTotal()+LatePhotonTotal()); }
66 
67  void Print();
68 
69  private:
70 
71  std::vector<float> _photonVector_prompt;
72  std::vector<float> _photonVector_late;
73 
74  float _min_prompt_time; //in ns
78  std::vector<float> _qeVector;
79 
80  float _min_wavelength; //in nm
82 
83  float Wavelength(const sim::OnePhoton& ph);
84 
85  };
86 
87 }
88 
89 #endif
void SetQEVector(const std::vector< float > &eV)
float MinPromptTime() const
void SetTimeRanges(float t_p1, float t_p2, float t_l1, float t_l2)
float MinLateTime() const
float QE(size_t i) const
void SetVectorSize(size_t s)
All information of a photon entering the sensitive optical detector volume.
Definition: SimPhotons.h:64
std::vector< float > _photonVector_prompt
const std::vector< float > & PromptPhotonVector() const
float MinWavelength() const
std::vector< float > TotalPhotonVector() const
Simulation objects for optical detectors.
const double e
static constexpr double eV
Definition: Units.h:127
float MaxWavelength() const
float MaxPromptTime() const
float Wavelength(const sim::OnePhoton &ph)
float MaxLateTime() const
void SetQE(size_t i, float e)
Collection of photons which recorded on one channel.
Definition: SimPhotons.h:136
const std::vector< float > & LatePhotonVector() const
float TotalPhotonVector(size_t i) const
float LatePhotonVector(size_t i) const
float PhotonTotal() const
float PromptPhotonTotal() const
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)
void AddSimPhotons(const sim::SimPhotons &photons)
std::vector< float > const & QEVector() const
size_t GetVectorSize() const
static QCString * s
Definition: config.cpp:1042
float LatePhotonTotal() const
float PromptPhotonVector(size_t i) const