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

#include <ScintTimeLAr.h>

Inheritance diagram for phot::ScintTimeLAr:
phot::ScintTime

Public Member Functions

 ScintTimeLAr (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 single_exp (double t, double tau2)
 
double bi_exp (double t, double tau1, double tau2)
 

Private Attributes

int LogLevel
 
double SRTime
 
double SDTime
 
double FRTime
 
double FDTime
 

Additional Inherited Members

- Protected Attributes inherited from phot::ScintTime
double timing
 

Detailed Description

Definition at line 27 of file ScintTimeLAr.h.

Constructor & Destructor Documentation

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

Definition at line 14 of file ScintTimeLAr_tool.cc.

15  : LogLevel{pset.get<int>("LogLevel")}
16  , SRTime{pset.get<double>("SlowRisingTime", 0.0)}
17  , SDTime{pset.get<double>("SlowDecayTime", 0.0)}
18  , FRTime{pset.get<double>("FastRisingTime", 0.0)}
19  , FDTime{pset.get<double>("FastDecayTime", 0.0)}
20  {
21  if ( LogLevel >= 1 )
22  {
23  std::cout << "ScintTimeLAr Tool configure:" << std::endl;
24  std::cout << "Fast rising time: " << FRTime
25  << ", Fast decay time: " << FDTime
26  << ", Slow rising time: " << SRTime
27  << ", Slow decay time: " << SDTime
28  << std::endl;
29  }
30  }
QTextStream & endl(QTextStream &s)

Member Function Documentation

double phot::ScintTimeLAr::bi_exp ( double  t,
double  tau1,
double  tau2 
)
private

Definition at line 39 of file ScintTimeLAr_tool.cc.

40  {
41  return (((std::exp((-1.0 * t) / tau2) * (1.0 - std::exp((-1.0 * t) / tau1))) / tau2) / tau2) * (tau1 + tau2);
42  }
G4double tau1[100]
Definition: G4S2Light.cc:61
void phot::ScintTimeLAr::GenScintTime ( bool  is_fast,
CLHEP::HepRandomEngine &  engine 
)
virtual

Implements phot::ScintTime.

Definition at line 49 of file ScintTimeLAr_tool.cc.

50  {
51  double tau1;
52  double tau2;
53 
54  if(is_fast == 1) // fast scinitllation
55  {
56  tau1 = FRTime;
57  tau2 = FDTime;
58  }
59  else
60  {
61  tau1 = SRTime;
62  tau2 = SDTime;
63  }
64 
65  CLHEP::RandFlat randflatscinttime{engine};
66 
67  if ((tau1 == 0.0) || (tau1 == -1.0))
68  {
69  timing = -tau2 * std::log(randflatscinttime());
70  return;
71  }
72 
73  //ran1, ran2 = random numbers for the algorithm
74  while (1)
75  {
76  auto ran1 = randflatscinttime();
77  auto ran2 = randflatscinttime();
78  auto d = (tau1 + tau2) / tau2;
79  auto t = -tau2 * std::log(1 - ran1);
80  auto g = d * single_exp(t, tau2);
81  if (ran2 <= bi_exp(t, tau1, tau2) / g)
82  {
83  timing = t;
84  return;
85  }
86  }
87  }
static constexpr double g
Definition: Units.h:144
G4double tau1[100]
Definition: G4S2Light.cc:61
double single_exp(double t, double tau2)
double bi_exp(double t, double tau1, double tau2)
double timing
Definition: ScintTime.h:32
double phot::ScintTimeLAr::single_exp ( double  t,
double  tau2 
)
private

Definition at line 33 of file ScintTimeLAr_tool.cc.

34  {
35  return std::exp((-1.0 * t) / tau2) / tau2;
36  }

Member Data Documentation

double phot::ScintTimeLAr::FDTime
private

Definition at line 40 of file ScintTimeLAr.h.

double phot::ScintTimeLAr::FRTime
private

Definition at line 39 of file ScintTimeLAr.h.

int phot::ScintTimeLAr::LogLevel
private

Definition at line 34 of file ScintTimeLAr.h.

double phot::ScintTimeLAr::SDTime
private

Definition at line 38 of file ScintTimeLAr.h.

double phot::ScintTimeLAr::SRTime
private

Definition at line 37 of file ScintTimeLAr.h.


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