LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
SimPhotonCounter.h
Go to the documentation of this file.
1 #ifndef SIMPHOTONCOUNTER_H
2 #define SIMPHOTONCOUNTER_H
3 
12 namespace sim {
13  struct OnePhoton;
14  class SimPhotons;
15 }
16 
17 #include <cstddef>
18 #include <numeric>
19 #include <vector>
20 
21 namespace opdet {
22 
24 
25  public:
27  SimPhotonCounter(size_t s,
28  float t_p1,
29  float t_p2,
30  float t_l1,
31  float t_l2,
32  float min_w = 0,
33  float max_w = 1e6,
34  float e = 1.0);
35 
36  SimPhotonCounter(float t_p1,
37  float t_p2,
38  float t_l1,
39  float t_l2,
40  float min_w,
41  float max_w,
42  const std::vector<float>& eV);
43 
44  void SetVectorSize(size_t s)
45  {
46  _photonVector_prompt.resize(s);
47  _photonVector_late.resize(s);
48  _qeVector.resize(s);
49  }
50  size_t GetVectorSize() const { return _photonVector_prompt.size(); }
51 
52  void SetWavelengthRanges(float min_w, float max_w);
53 
54  float MinWavelength() const { return _min_wavelength; }
55  float MaxWavelength() const { return _max_wavelength; }
56 
57  void SetTimeRanges(float t_p1, float t_p2, float t_l1, float t_l2);
58 
59  float MinPromptTime() const { return _min_prompt_time; }
60  float MaxPromptTime() const { return _max_prompt_time; }
61  float MinLateTime() const { return _min_late_time; }
62  float MaxLateTime() const { return _max_late_time; }
63 
64  void SetQE(size_t i, float e) { _qeVector.at(i) = e; }
65  float QE(size_t i) const { return _qeVector.at(i); }
66 
67  void SetQEVector(const std::vector<float>& eV)
68  {
69  SetVectorSize(eV.size());
70  _qeVector = eV;
71  }
72  std::vector<float> const& QEVector() const { return _qeVector; }
73 
74  void AddOnePhoton(size_t i_opdet, const sim::OnePhoton& photon);
75  void AddSimPhotons(const sim::SimPhotons& photons);
76 
77  void ClearVectors();
78  const std::vector<float>& PromptPhotonVector() const { return _photonVector_prompt; }
79  const std::vector<float>& LatePhotonVector() const { return _photonVector_late; }
80  float PromptPhotonVector(size_t i) const { return _photonVector_prompt.at(i); }
81  float LatePhotonVector(size_t i) const { return _photonVector_late.at(i); }
82 
83  std::vector<float> TotalPhotonVector() const;
84  float TotalPhotonVector(size_t i) const
85  {
86  return (PromptPhotonVector(i) + LatePhotonVector(i));
87  }
88 
89  float PromptPhotonTotal() const
90  {
91  return std::accumulate(_photonVector_prompt.begin(), _photonVector_prompt.end(), 0.0);
92  }
93  float LatePhotonTotal() const
94  {
95  return std::accumulate(_photonVector_late.begin(), _photonVector_late.end(), 0.0);
96  }
97  float PhotonTotal() const { return (PromptPhotonTotal() + LatePhotonTotal()); }
98 
99  void Print();
100 
101  private:
102  std::vector<float> _photonVector_prompt;
103  std::vector<float> _photonVector_late;
104 
105  float _min_prompt_time; //in ns
109  std::vector<float> _qeVector;
110 
111  float _min_wavelength; //in nm
113 
114  float Wavelength(const sim::OnePhoton& ph);
115  };
116 
117 }
118 
119 #endif
void SetQEVector(const std::vector< float > &eV)
float MinPromptTime() const
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:60
std::vector< float > _photonVector_prompt
const std::vector< float > & PromptPhotonVector() const
float MinWavelength() const
float MaxWavelength() const
float MaxPromptTime() const
void Print(G4Element &ele)
Definition: pyG4Element.cc:55
Monte Carlo Simulation.
float MaxLateTime() const
void SetQE(size_t i, float e)
Collection of photons which recorded on one channel.
Definition: SimPhotons.h:127
const std::vector< float > & LatePhotonVector() const
float TotalPhotonVector(size_t i) const
float LatePhotonVector(size_t i) const
float PhotonTotal() const
std::vector< float > _qeVector
float PromptPhotonTotal() const
std::vector< float > _photonVector_late
Float_t e
Definition: plot.C:35
std::vector< float > const & QEVector() const
size_t GetVectorSize() const
float LatePhotonTotal() const
float PromptPhotonVector(size_t i) const