All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
virtual ~ScintTime ()=default
 
double GetScintTime () const
 

Private Member Functions

double single_exp (double t, double tau2) const
 
double bi_exp (double t, double tau1, double tau2) const
 

Private Attributes

int LogLevel
 
double SRTime
 
double SDTime
 
double FRTime
 
double FDTime
 

Additional Inherited Members

- Protected Attributes inherited from phot::ScintTime
double timing { 0.0 }
 

Detailed Description

Definition at line 20 of file ScintTimeLAr.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file ScintTimeLAr.cc.

20  : LogLevel{pset.get<int>("LogLevel")}
21  , SRTime{pset.get<double>("SlowRisingTime", 0.0)}
22  , SDTime{pset.get<double>("SlowDecayTime", 0.0)}
23  , FRTime{pset.get<double>("FastRisingTime", 0.0)}
24  , FDTime{pset.get<double>("FastDecayTime", 0.0)}
25  {
26  if ( LogLevel >= 1 ) {
27  std::cout << "ScintTimeLAr Tool configure:" << std::endl;
28  std::cout << "Fast rising time: " << FRTime
29  << ", Fast decay time: " << FDTime
30  << ", Slow rising time: " << SRTime
31  << ", Slow decay time: " << SDTime
32  << std::endl;
33  }
34  }
BEGIN_PROLOG could also be cout

Member Function Documentation

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

Definition at line 43 of file ScintTimeLAr.cc.

44  {
45  return (((std::exp((-1.0 * t) / tau2) * (1.0 - std::exp((-1.0 * t) / tau1))) / tau2) / tau2) * (tau1 + tau2);
46  }
void phot::ScintTimeLAr::GenScintTime ( bool  is_fast,
CLHEP::HepRandomEngine &  engine 
)
virtual

Implements phot::ScintTime.

Definition at line 54 of file ScintTimeLAr.cc.

55  {
56  double tau1;
57  double tau2;
58 
59  if(is_fast) {
60  tau1 = FRTime;
61  tau2 = FDTime;
62  }
63  else {
64  tau1 = SRTime;
65  tau2 = SDTime;
66  }
67 
68  CLHEP::RandFlat randflatscinttime{engine};
69 
70  if ((tau1 < 1e-8) || (tau1 == -1.0)) {
71  timing = -tau2 * std::log(randflatscinttime());
72  return;
73  }
74 
75  //ran1, ran2 = random numbers for the algorithm
76  while (1) {
77  auto ran1 = randflatscinttime();
78  auto ran2 = randflatscinttime();
79  auto d = (tau1 + tau2) / tau2;
80  auto t = -tau2 * std::log(1 - ran1);
81  auto g = d * single_exp(t, tau2);
82  if (ran2 <= bi_exp(t, tau1, tau2) / g) {
83  timing = t;
84  return;
85  }
86  }
87  }
double bi_exp(double t, double tau1, double tau2) const
Definition: ScintTimeLAr.cc:43
BEGIN_PROLOG g
double single_exp(double t, double tau2) const
Definition: ScintTimeLAr.cc:37
do i e
double timing
Definition: ScintTime.h:28
double phot::ScintTimeLAr::single_exp ( double  t,
double  tau2 
) const
private

Definition at line 37 of file ScintTimeLAr.cc.

38  {
39  return std::exp((-1.0 * t) / tau2) / tau2;
40  }

Member Data Documentation

double phot::ScintTimeLAr::FDTime
private

Definition at line 33 of file ScintTimeLAr.h.

double phot::ScintTimeLAr::FRTime
private

Definition at line 32 of file ScintTimeLAr.h.

int phot::ScintTimeLAr::LogLevel
private

Definition at line 27 of file ScintTimeLAr.h.

double phot::ScintTimeLAr::SDTime
private

Definition at line 31 of file ScintTimeLAr.h.

double phot::ScintTimeLAr::SRTime
private

Definition at line 30 of file ScintTimeLAr.h.


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