Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
JFIT::JK40 Struct Reference

Auxiliary class for converting various rates to expectation values of the number of hits within a given time interval. More...

#include <JK40.hh>

Inheritance diagram for JFIT::JK40:
JFIT::JK40Hit JFIT::JNPE JFIT::JNPEHit

Public Types

typedef std::vector< double > JL1_t
 Type definition of expectation values of number of multiple hits. More...
 

Public Member Functions

 JK40 ()
 Default constructor. More...
 
 JK40 (const JTimeRange &T_ns, const double R_Hz)
 Constructor for single PMT. More...
 
 JK40 (const JTimeRange &T_ns, const size_t numberOfPMTs, const JK40Rates &rates_Hz)
 Constructor for modules. More...
 
double getY0 () const
 Get expectation value for number of single hits. More...
 
double getY1 (const size_t M) const
 Get expectation value for number of multiple hits. More...
 
double getP (size_t M) const
 Get probability to observe a hit with given multiplicity. More...
 

Protected Attributes

double __y0
 expectation value of number of single hits More...
 
JL1_t __y1
 expectation values of number of multiple hits More...
 

Detailed Description

Auxiliary class for converting various rates to expectation values of the number of hits within a given time interval.

Definition at line 30 of file JK40.hh.

Member Typedef Documentation

typedef std::vector<double> JFIT::JK40::JL1_t

Type definition of expectation values of number of multiple hits.

Definition at line 34 of file JK40.hh.

Constructor & Destructor Documentation

JFIT::JK40::JK40 ( )
inline

Default constructor.

Definition at line 40 of file JK40.hh.

40  :
41  __y0(0.0),
42  __y1()
43  {}
JL1_t __y1
expectation values of number of multiple hits
Definition: JK40.hh:143
double __y0
expectation value of number of single hits
Definition: JK40.hh:142
JFIT::JK40::JK40 ( const JTimeRange &  T_ns,
const double  R_Hz 
)
inline

Constructor for single PMT.

Parameters
T_nstime range [ns]
R_HzK40 singles rate [Hz]

Definition at line 52 of file JK40.hh.

53  :
54  __y0(0.0),
55  __y1()
56  {
57  const double T_s = (T_ns.getUpperLimit() - T_ns.getLowerLimit()) * 1.0e-9; // period [s]
58 
59  __y0 = R_Hz * T_s;
60  }
JL1_t __y1
expectation values of number of multiple hits
Definition: JK40.hh:143
double __y0
expectation value of number of single hits
Definition: JK40.hh:142
JFIT::JK40::JK40 ( const JTimeRange &  T_ns,
const size_t  numberOfPMTs,
const JK40Rates rates_Hz 
)
inline

Constructor for modules.

Parameters
T_nstime range [ns]
numberOfPMTsnumber of PMTs in module
rates_HzK40 singles and multiples rates [Hz]

Definition at line 70 of file JK40.hh.

72  :
73  __y0(0.0),
74  __y1()
75  {
76  const double T_s = (T_ns.getUpperLimit() - T_ns.getLowerLimit())* 1.0e-9; // period [s]
77 
78  __y0 = numberOfPMTs * rates_Hz.getSinglesRate() * T_s;
79 
80  // genuine coincidences
81 
82  for (size_t M = rates_Hz.getLowerL1Multiplicity(); M <= rates_Hz.getUpperL1Multiplicity(); ++M) {
83  __y1.push_back(rates_Hz.getMultiplesRate(M) * T_s);
84  }
85 
86  // random coincidences
87 
88  if (__y1.empty()) {
89  __y1.push_back(0.0);
90  }
91 
92  __y1[0] += __y0 * (1.0 - exp(-__y0));
93  }
JL1_t __y1
expectation values of number of multiple hits
Definition: JK40.hh:143
double __y0
expectation value of number of single hits
Definition: JK40.hh:142

Member Function Documentation

double JFIT::JK40::getY0 ( ) const
inline

Get expectation value for number of single hits.

Returns
expectation value

Definition at line 101 of file JK40.hh.

102  {
103  return __y0;
104  }
double __y0
expectation value of number of single hits
Definition: JK40.hh:142
double JFIT::JK40::getY1 ( const size_t  M) const
inline

Get expectation value for number of multiple hits.

Parameters
Mmultiplicity (M >= 2)
Returns
expectation value

Definition at line 113 of file JK40.hh.

114  {
115  if (M >= 2 && M - 2 < __y1.size())
116  return __y1[M-2];
117  else
118  return 0.0;
119  }
JL1_t __y1
expectation values of number of multiple hits
Definition: JK40.hh:143
double JFIT::JK40::getP ( size_t  M) const
inline

Get probability to observe a hit with given multiplicity.

Note that if M = 0, the probability corresponds to observing no hits.

Parameters
Mmultiplicity (M >= 0)
Returns
probability

Definition at line 129 of file JK40.hh.

130  {
131  double expval = 0.0;
132 
133  if (M < 2)
134  expval = getY0();
135  else
136  expval = getY1(M);
137 
138  return JFIT::getP(expval, M != 0);
139  }
double getY0() const
Get expectation value for number of single hits.
Definition: JK40.hh:101
double getY1(const size_t M) const
Get expectation value for number of multiple hits.
Definition: JK40.hh:113
double getP(const double expval, bool hit)
Get Poisson probability to observe a hit or not for given expectation value for the number of hits...
Definition: JFitToolkit.hh:37

Member Data Documentation

double JFIT::JK40::__y0
protected

expectation value of number of single hits

Definition at line 142 of file JK40.hh.

JL1_t JFIT::JK40::__y1
protected

expectation values of number of multiple hits

Definition at line 143 of file JK40.hh.


The documentation for this struct was generated from the following file: