Jpp  pmt_effective_area_update
the software that should make you happy
 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::JShowerNPE JFIT::JNPEHit JFIT::JShowerNPEHit

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 29 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 33 of file JK40.hh.

Constructor & Destructor Documentation

JFIT::JK40::JK40 ( )
inline

Default constructor.

Definition at line 39 of file JK40.hh.

39  :
40  __y0(0.0),
41  __y1()
42  {}
JL1_t __y1
expectation values of number of multiple hits
Definition: JK40.hh:142
double __y0
expectation value of number of single hits
Definition: JK40.hh:141
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 51 of file JK40.hh.

52  :
53  __y0(0.0),
54  __y1()
55  {
56  const double T_s = (T_ns.getUpperLimit() - T_ns.getLowerLimit()) * 1.0e-9; // period [s]
57 
58  __y0 = R_Hz * T_s;
59  }
JL1_t __y1
expectation values of number of multiple hits
Definition: JK40.hh:142
double __y0
expectation value of number of single hits
Definition: JK40.hh:141
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 69 of file JK40.hh.

71  :
72  __y0(0.0),
73  __y1()
74  {
75  const double T_s = (T_ns.getUpperLimit() - T_ns.getLowerLimit())* 1.0e-9; // period [s]
76 
77  __y0 = numberOfPMTs * rates_Hz.getSinglesRate() * T_s;
78 
79  // genuine coincidences
80 
81  for (size_t M = rates_Hz.getLowerL1Multiplicity(); M <= rates_Hz.getUpperL1Multiplicity(); ++M) {
82  __y1.push_back(rates_Hz.getMultiplesRate(M) * T_s);
83  }
84 
85  // random coincidences
86 
87  if (__y1.empty()) {
88  __y1.push_back(0.0);
89  }
90 
91  __y1[0] += __y0 * (1.0 - exp(-__y0));
92  }
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` typeset -Z 4 STRING JOpera1D -f hydrophone.root
JL1_t __y1
expectation values of number of multiple hits
Definition: JK40.hh:142
double __y0
expectation value of number of single hits
Definition: JK40.hh:141

Member Function Documentation

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

Get expectation value for number of single hits.

Returns
expectation value

Definition at line 100 of file JK40.hh.

101  {
102  return __y0;
103  }
double __y0
expectation value of number of single hits
Definition: JK40.hh:141
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 112 of file JK40.hh.

113  {
114  if (M >= 2 && M - 2 < __y1.size())
115  return __y1[M-2];
116  else
117  return 0.0;
118  }
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
JL1_t __y1
expectation values of number of multiple hits
Definition: JK40.hh:142
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 128 of file JK40.hh.

129  {
130  double expval = 0.0;
131 
132  if (M < 2)
133  expval = getY0();
134  else
135  expval = getY1(M);
136 
137  return JFIT::getP(expval, M != 0);
138  }
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
double getY0() const
Get expectation value for number of single hits.
Definition: JK40.hh:100
double getY1(const size_t M) const
Get expectation value for number of multiple hits.
Definition: JK40.hh:112
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:34

Member Data Documentation

double JFIT::JK40::__y0
protected

expectation value of number of single hits

Definition at line 141 of file JK40.hh.

JL1_t JFIT::JK40::__y1
protected

expectation values of number of multiple hits

Definition at line 142 of file JK40.hh.


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