Jpp  15.0.5
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Attributes | Protected Attributes | Friends | List of all members
JPHYSICS::JK40Rates Struct Reference

Auxiliary class for K40 rates. More...

#include <JK40Rates.hh>

Inheritance diagram for JPHYSICS::JK40Rates:
JDETECTOR::JK40DefaultSimulator JTRIGGER::JK40RunByRunSimulator

Public Member Functions

 JK40Rates ()
 Default constructor. More...
 
 JK40Rates (const JRateL0_t rateL0_Hz, const JRateL1_t &rateL1_Hz=JRateL1_t())
 Constructor. More...
 
double getSinglesRate () const
 Get singles rate. More...
 
double getMultiplesRate (const multiplicity_type M) const
 Get multiples rate. More...
 
multiplicity_type getLowerL1Multiplicity () const
 Get lower multiplicty. More...
 
multiplicity_type getUpperL1Multiplicity () const
 Get upper multiplicty. More...
 
void correct (const double QE)
 Correct rates for global efficiency,. More...
 

Static Public Attributes

static const multiplicity_type LOWER_L1_MULTIPLICITY = 2
 Lower L1 multiplicity. More...
 

Protected Attributes

JRateL0_t rateL0
 singles rate [Hz] More...
 
JRateL1_t rateL1
 multiples rates [Hz] More...
 

Friends

std::istream & operator>> (std::istream &in, JK40Rates &object)
 Read K40 rates from input. More...
 
std::ostream & operator<< (std::ostream &out, const JK40Rates &object)
 Write K40 rates to output. More...
 

Detailed Description

Auxiliary class for K40 rates.

The singles rate refers to the counting rate of a PMT and the multiples rate to the rate of genuine coincidences due to K40 decays.

Definition at line 41 of file JK40Rates.hh.

Constructor & Destructor Documentation

JPHYSICS::JK40Rates::JK40Rates ( )
inline

Default constructor.

Definition at line 45 of file JK40Rates.hh.

45  :
46  rateL0(0.0),
47  rateL1()
48  {}
JRateL1_t rateL1
multiples rates [Hz]
Definition: JK40Rates.hh:211
JRateL0_t rateL0
singles rate [Hz]
Definition: JK40Rates.hh:210
JPHYSICS::JK40Rates::JK40Rates ( const JRateL0_t  rateL0_Hz,
const JRateL1_t rateL1_Hz = JRateL1_t() 
)
inline

Constructor.

The multiples rates start counting at two-fold coincidences.

Parameters
rateL0_Hzsingles rate [Hz]
rateL1_Hzmultiples rates [Hz]

Definition at line 59 of file JK40Rates.hh.

60  :
61  rateL0(rateL0_Hz),
62  rateL1(rateL1_Hz)
63  {}
JRateL1_t rateL1
multiples rates [Hz]
Definition: JK40Rates.hh:211
JRateL0_t rateL0
singles rate [Hz]
Definition: JK40Rates.hh:210

Member Function Documentation

double JPHYSICS::JK40Rates::getSinglesRate ( ) const
inline

Get singles rate.

Returns
rate [Hz]

Definition at line 71 of file JK40Rates.hh.

72  {
73  return rateL0;
74  }
JRateL0_t rateL0
singles rate [Hz]
Definition: JK40Rates.hh:210
double JPHYSICS::JK40Rates::getMultiplesRate ( const multiplicity_type  M) const
inline

Get multiples rate.

Parameters
Mmultiplicity (M >= JK40Rates::LOWER_L1_MULTIPLICITY)
Returns
rate [Hz]

Definition at line 83 of file JK40Rates.hh.

84  {
86  return rateL1[M - LOWER_L1_MULTIPLICITY];
87  else
88  return 0.0;
89  }
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
static const multiplicity_type LOWER_L1_MULTIPLICITY
Lower L1 multiplicity.
Definition: JK40Rates.hh:206
JRateL1_t rateL1
multiples rates [Hz]
Definition: JK40Rates.hh:211
size_t multiplicity_type
Type definition of multiplicity.
Definition: JK40Rates.hh:33
multiplicity_type JPHYSICS::JK40Rates::getLowerL1Multiplicity ( ) const
inline

Get lower multiplicty.

Returns
lower multiplicity

Definition at line 97 of file JK40Rates.hh.

98  {
99  return LOWER_L1_MULTIPLICITY;
100  }
static const multiplicity_type LOWER_L1_MULTIPLICITY
Lower L1 multiplicity.
Definition: JK40Rates.hh:206
multiplicity_type JPHYSICS::JK40Rates::getUpperL1Multiplicity ( ) const
inline

Get upper multiplicty.

Returns
upper multiplicity

Definition at line 108 of file JK40Rates.hh.

109  {
110  return rateL1.size() + 1;
111  }
JRateL1_t rateL1
multiples rates [Hz]
Definition: JK40Rates.hh:211
void JPHYSICS::JK40Rates::correct ( const double  QE)
inline

Correct rates for global efficiency,.

Parameters
QEglobal efficiency

Definition at line 119 of file JK40Rates.hh.

120  {
121  if (QE > 0.0) {
122 
123  rateL0 /= QE;
124 
125  JRateL1_t buffer = rateL1;
126 
128 
129  // determine contribution from higher multiplicities
130 
131  double R = 0.0;
132 
133  for (multiplicity_type i = M + 1; i <= getUpperL1Multiplicity(); ++i) {
134  R += buffer[i - LOWER_L1_MULTIPLICITY] * JMATH::binomial(i, M) * pow(QE, M) * pow(1.0 - QE, i - M);
135  }
136 
137  if (getMultiplesRate(M) > R)
138  buffer[M - LOWER_L1_MULTIPLICITY] = (getMultiplesRate(M) - R) / pow(QE, M);
139  else
140  buffer[M - LOWER_L1_MULTIPLICITY] = 0.0;
141  }
142 
143  rateL1 = buffer;
144 
145  } else {
146 
147  rateL0 = 0.0;
148 
149  for (JRateL1_t::iterator i = rateL1.begin(); i != rateL1.end(); ++i) {
150  *i = 0.0;
151  }
152  }
153  }
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
double binomial(const int n, const int k)
Binomial function.
static const multiplicity_type LOWER_L1_MULTIPLICITY
Lower L1 multiplicity.
Definition: JK40Rates.hh:206
multiplicity_type getLowerL1Multiplicity() const
Get lower multiplicty.
Definition: JK40Rates.hh:97
JRateL1_t rateL1
multiples rates [Hz]
Definition: JK40Rates.hh:211
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
double getMultiplesRate(const multiplicity_type M) const
Get multiples rate.
Definition: JK40Rates.hh:83
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:43
size_t multiplicity_type
Type definition of multiplicity.
Definition: JK40Rates.hh:33
multiplicity_type getUpperL1Multiplicity() const
Get upper multiplicty.
Definition: JK40Rates.hh:108
JRateL0_t rateL0
singles rate [Hz]
Definition: JK40Rates.hh:210

Friends And Related Function Documentation

std::istream& operator>> ( std::istream &  in,
JK40Rates object 
)
friend

Read K40 rates from input.

Parameters
ininput stream
objectK40 rates
Returns
input stream

Definition at line 163 of file JK40Rates.hh.

164  {
165  const double rateL0 = object.rateL0;
166 
167  if (in >> object.rateL0) {
168 
169  object.rateL1.clear();
170 
171  for (double x; in >> x; ) {
172  object.rateL1.push_back(x);
173  }
174 
175  } else {
176 
177  object.rateL0 = rateL0;
178  }
179 
180  return in;
181  }
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:41
JRateL0_t rateL0
singles rate [Hz]
Definition: JK40Rates.hh:210
std::ostream& operator<< ( std::ostream &  out,
const JK40Rates object 
)
friend

Write K40 rates to output.

Parameters
outoutput stream
objectK40 rates
Returns
output stream

Definition at line 191 of file JK40Rates.hh.

192  {
193  out << object.rateL0;
194 
195  for (JRateL1_t::const_iterator i = object.rateL1.begin(); i != object.rateL1.end(); ++i) {
196  out << ' ' << *i;
197  }
198 
199  return out;
200  }
JRateL1_t rateL1
multiples rates [Hz]
Definition: JK40Rates.hh:211

Member Data Documentation

const multiplicity_type JPHYSICS::JK40Rates::LOWER_L1_MULTIPLICITY = 2
static

Lower L1 multiplicity.

Definition at line 206 of file JK40Rates.hh.

JRateL0_t JPHYSICS::JK40Rates::rateL0
protected

singles rate [Hz]

Definition at line 210 of file JK40Rates.hh.

JRateL1_t JPHYSICS::JK40Rates::rateL1
protected

multiples rates [Hz]

Definition at line 211 of file JK40Rates.hh.


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