All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
12 namespace sim {
13  struct OnePhoton;
14  class SimPhotons;
15 }
16 
17 #include <numeric>
18 #include <vector>
19 
20 namespace opdet{
21 
23 
24  public:
26  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);
27 
28  SimPhotonCounter(float t_p1, float t_p2, float t_l1, float t_l2, float min_w, float max_w, const std::vector<float>& eV);
29 
30  void SetVectorSize(size_t s)
31  { _photonVector_prompt.resize(s); _photonVector_late.resize(s); _qeVector.resize(s); }
32  size_t GetVectorSize() const { return _photonVector_prompt.size(); }
33 
34  void SetWavelengthRanges(float min_w, float max_w);
35 
36  float MinWavelength() const { return _min_wavelength; }
37  float MaxWavelength() const { return _max_wavelength; }
38 
39  void SetTimeRanges(float t_p1, float t_p2, float t_l1, float t_l2);
40 
41  float MinPromptTime() const { return _min_prompt_time; }
42  float MaxPromptTime() const { return _max_prompt_time; }
43  float MinLateTime() const { return _min_late_time; }
44  float MaxLateTime() const { return _max_late_time; }
45 
46  void SetQE(size_t i, float e) { _qeVector.at(i) = e; }
47  float QE(size_t i) const { return _qeVector.at(i); }
48 
49  void SetQEVector(const std::vector<float>& eV)
50  { SetVectorSize(eV.size()); _qeVector = eV; }
51  std::vector<float> const& QEVector() const { return _qeVector; }
52 
53  void AddOnePhoton(size_t i_opdet,const sim::OnePhoton& photon);
54  void AddSimPhotons(const sim::SimPhotons& photons);
55 
56  void ClearVectors();
57  const std::vector<float>& PromptPhotonVector() const { return _photonVector_prompt; }
58  const std::vector<float>& LatePhotonVector() const { return _photonVector_late; }
59  float PromptPhotonVector(size_t i) const { return _photonVector_prompt.at(i); }
60  float LatePhotonVector(size_t i) const { return _photonVector_late.at(i); }
61 
62  std::vector<float> TotalPhotonVector() const;
63  float TotalPhotonVector(size_t i) const
64  { return (PromptPhotonVector(i)+LatePhotonVector(i)); }
65 
66  float PromptPhotonTotal() const
67  { return std::accumulate(_photonVector_prompt.begin(),_photonVector_prompt.end(),0.0); }
68  float LatePhotonTotal() const
69  { return std::accumulate(_photonVector_late.begin(),_photonVector_late.end(),0.0); }
70  float PhotonTotal() const { return (PromptPhotonTotal()+LatePhotonTotal()); }
71 
72  void Print();
73 
74  private:
75 
76  std::vector<float> _photonVector_prompt;
77  std::vector<float> _photonVector_late;
78 
79  float _min_prompt_time; //in ns
83  std::vector<float> _qeVector;
84 
85  float _min_wavelength; //in nm
87 
88  float Wavelength(const sim::OnePhoton& ph);
89 
90  };
91 
92 }
93 
94 #endif
void SetQEVector(const std::vector< float > &eV)
float MinPromptTime() const
process_name can override from command line with o or output photon
Definition: runPID.fcl:28
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
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
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
float LatePhotonVector(size_t i) const
float PhotonTotal() const
do i e
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
float LatePhotonTotal() const
float PromptPhotonVector(size_t i) const