Public Member Functions | Private Member Functions | Private Attributes | List of all members
phot::ScintTimeXeDoping Class Reference

#include <ScintTimeXeDoping.h>

Inheritance diagram for phot::ScintTimeXeDoping:
phot::ScintTime

Public Member Functions

 ScintTimeXeDoping (fhicl::ParameterSet const &pset)
 
void GenScintTime (bool is_fast, CLHEP::HepRandomEngine &engine)
 
- Public Member Functions inherited from phot::ScintTime
 ScintTime ()
 
virtual ~ScintTime ()=default
 
double GetScintTime () const
 

Private Member Functions

double exp_diff (double t, double tau1, double tau2) const
 
double singlet_distro (double t) const
 
double triplet_distro (double t) const
 

Private Attributes

double fXeConcentration
 
double fArSingletTime
 
double fArTripletTime
 
double fXe150nmTime
 
double fTauAX
 
double fTauXX
 
double fTauN2
 
double fTauTAs
 
double fTauTAt
 
double fTauTX
 
double fMaxProbs
 
double fMaxProbt
 
double fMaxTs
 
double fMaxTt
 

Additional Inherited Members

- Protected Attributes inherited from phot::ScintTime
double timing
 

Detailed Description

Definition at line 22 of file ScintTimeXeDoping.h.

Constructor & Destructor Documentation

phot::ScintTimeXeDoping::ScintTimeXeDoping ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 16 of file ScintTimeXeDoping_tool.cc.

17  : ScintTime()
18  , fXeConcentration{pset.get<double>("XeConcentration")}
19  , fArSingletTime {pset.get<double>("ArSingletTime")}
20  , fArTripletTime {pset.get<double>("ArTripletTime")}
21  , fXe150nmTime {pset.get<double>("Xe150nmTime")}
22  , fTauAX {pset.get<double>("TauAX")}
23  , fTauXX {pset.get<double>("TauXX")}
24  , fTauN2 {pset.get<double>("TauN2", 0)}
25  {
26  double invTauN2 = 0;
27  if (fTauN2 > 0) invTauN2 = 1./fTauN2;
28 
29  // Calculations from D. Totani, Feb. 2021
31  fTauTAt = 1./(1./fArTripletTime + fXeConcentration/fTauAX + invTauN2);
32  fTauTX = 1./(1./fXe150nmTime + fXeConcentration/fTauXX + invTauN2);
33 
34  double step = 0.1; //ns
35 
36  fMaxProbs = 0;
37  fMaxTs = 0;
38  double integral = 0;
39  while (integral < 0.999) {
40  double val = singlet_distro(fMaxTs);
41  if (val > fMaxProbs) fMaxProbs = val;
42  integral += val*step;
43  fMaxTs += step;
44  }
45 
46  fMaxProbt = 0;
47  fMaxTt = 0;
48  integral = 0;
49  while (integral < 0.999) {
50  double val = triplet_distro(fMaxTt);
51  if (val > fMaxProbt) fMaxProbt = val;
52  integral += val*step;
53  fMaxTt += step;
54  }
55 
56  mf::LogInfo("ScintTimeXeDoping")
57  << "Configured:" << "\n"
58  << " XeConcentration: " << fXeConcentration << " ppm\n"
59  << " ArTripletTime: " << fArTripletTime << " ns\n"
60  << " Xe150nmTime: " << fXe150nmTime << " ns\n"
61  << " TauAX: " << fTauAX << " ns\n"
62  << " TauXX: " << fTauXX << " ns\n"
63  << "Calculated:" << "\n"
64  << " TauTA singlet: " << fTauTAs << " ns\n"
65  << " TauTA triplet: " << fTauTAt << " ns\n"
66  << " TauTX: " << fTauTX << " ns\n"
67  << " MaxTime Singlet: " << fMaxTs << " ns\n"
68  << " MaxTime Triplet: " << fMaxTt << " ns\n";
69  }
double singlet_distro(double t) const
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
double triplet_distro(double t) const

Member Function Documentation

double phot::ScintTimeXeDoping::exp_diff ( double  t,
double  tau1,
double  tau2 
) const
private

Definition at line 72 of file ScintTimeXeDoping_tool.cc.

73  {
74  using std::exp;
75  return ( exp(-t/tau1) - exp(-t/tau2) ) / (tau1 - tau2);
76  }
G4double tau1[100]
Definition: G4S2Light.cc:61
void phot::ScintTimeXeDoping::GenScintTime ( bool  is_fast,
CLHEP::HepRandomEngine &  engine 
)
virtual

Implements phot::ScintTime.

Definition at line 81 of file ScintTimeXeDoping_tool.cc.

82  {
83  CLHEP::RandFlat randflatscinttime{engine};
84 
85  //ran1, ran2 = random numbers for the algorithm
86  while (1)
87  {
88  double ran1 = randflatscinttime();
89  double ran2 = randflatscinttime();
90 
91  // Use ran1 to pick a proposal time
92  // uniformly within the allowed range
93  double t = ran1 * (is_fast ? fMaxTs
94  : fMaxTt);
95 
96  // Rejection prob for this point
97  auto p = (is_fast ? singlet_distro(t) / fMaxProbs
98  : triplet_distro(t) / fMaxProbt);
99 
100  // Keep the point if ran2 below p
101  // (larger value of scint_distro -> more likely to sample)
102  if (ran2 < p) {
103  timing = t;
104  return;
105  }
106  }
107  }
double singlet_distro(double t) const
double triplet_distro(double t) const
p
Definition: test.py:223
double timing
Definition: ScintTime.h:32
double phot::ScintTimeXeDoping::singlet_distro ( double  t) const
inlineprivate

Definition at line 51 of file ScintTimeXeDoping.h.

51 { return exp_diff(t, fTauTAs, fTauTX); };
double exp_diff(double t, double tau1, double tau2) const
double phot::ScintTimeXeDoping::triplet_distro ( double  t) const
inlineprivate

Definition at line 52 of file ScintTimeXeDoping.h.

52 { return exp_diff(t, fTauTAt, fTauTX); };
double exp_diff(double t, double tau1, double tau2) const

Member Data Documentation

double phot::ScintTimeXeDoping::fArSingletTime
private

Definition at line 33 of file ScintTimeXeDoping.h.

double phot::ScintTimeXeDoping::fArTripletTime
private

Definition at line 34 of file ScintTimeXeDoping.h.

double phot::ScintTimeXeDoping::fMaxProbs
private

Definition at line 44 of file ScintTimeXeDoping.h.

double phot::ScintTimeXeDoping::fMaxProbt
private

Definition at line 45 of file ScintTimeXeDoping.h.

double phot::ScintTimeXeDoping::fMaxTs
private

Definition at line 46 of file ScintTimeXeDoping.h.

double phot::ScintTimeXeDoping::fMaxTt
private

Definition at line 47 of file ScintTimeXeDoping.h.

double phot::ScintTimeXeDoping::fTauAX
private

Definition at line 36 of file ScintTimeXeDoping.h.

double phot::ScintTimeXeDoping::fTauN2
private

Definition at line 38 of file ScintTimeXeDoping.h.

double phot::ScintTimeXeDoping::fTauTAs
private

Definition at line 41 of file ScintTimeXeDoping.h.

double phot::ScintTimeXeDoping::fTauTAt
private

Definition at line 42 of file ScintTimeXeDoping.h.

double phot::ScintTimeXeDoping::fTauTX
private

Definition at line 43 of file ScintTimeXeDoping.h.

double phot::ScintTimeXeDoping::fTauXX
private

Definition at line 37 of file ScintTimeXeDoping.h.

double phot::ScintTimeXeDoping::fXe150nmTime
private

Definition at line 35 of file ScintTimeXeDoping.h.

double phot::ScintTimeXeDoping::fXeConcentration
private

Definition at line 32 of file ScintTimeXeDoping.h.


The documentation for this class was generated from the following files: