Jpp  18.0.0-rc.4
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...
 
const JRateL1_tgetMultiplesRates () const
 Get multiples rate. More...
 
double getMultiplesRate (const multiplicity_type M) const
 Get multiples rate at given multiplicity. 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:222
JRateL0_t rateL0
singles rate [Hz]
Definition: JK40Rates.hh:221
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:222
JRateL0_t rateL0
singles rate [Hz]
Definition: JK40Rates.hh:221

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:221
const JRateL1_t& JPHYSICS::JK40Rates::getMultiplesRates ( ) const
inline

Get multiples rate.

Returns
rate [Hz]

Definition at line 82 of file JK40Rates.hh.

83  {
84  return rateL1;
85  }
JRateL1_t rateL1
multiples rates [Hz]
Definition: JK40Rates.hh:222
double JPHYSICS::JK40Rates::getMultiplesRate ( const multiplicity_type  M) const
inline

Get multiples rate at given multiplicity.

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

Definition at line 94 of file JK40Rates.hh.

95  {
97  return rateL1[M - LOWER_L1_MULTIPLICITY];
98  else
99  return 0.0;
100  }
static const multiplicity_type LOWER_L1_MULTIPLICITY
Lower L1 multiplicity.
Definition: JK40Rates.hh:217
JRateL1_t rateL1
multiples rates [Hz]
Definition: JK40Rates.hh:222
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 108 of file JK40Rates.hh.

109  {
110  return LOWER_L1_MULTIPLICITY;
111  }
static const multiplicity_type LOWER_L1_MULTIPLICITY
Lower L1 multiplicity.
Definition: JK40Rates.hh:217
multiplicity_type JPHYSICS::JK40Rates::getUpperL1Multiplicity ( ) const
inline

Get upper multiplicty.

Returns
upper multiplicity

Definition at line 119 of file JK40Rates.hh.

120  {
121  return rateL1.size() + 1;
122  }
JRateL1_t rateL1
multiples rates [Hz]
Definition: JK40Rates.hh:222
void JPHYSICS::JK40Rates::correct ( const double  QE)
inline

Correct rates for global efficiency,.

Parameters
QEglobal efficiency

Definition at line 130 of file JK40Rates.hh.

131  {
132  if (QE > 0.0) {
133 
134  rateL0 /= QE;
135 
136  JRateL1_t buffer = rateL1;
137 
139 
140  // determine contribution from higher multiplicities
141 
142  double R = 0.0;
143 
144  for (multiplicity_type i = M + 1; i <= getUpperL1Multiplicity(); ++i) {
145  R += buffer[i - LOWER_L1_MULTIPLICITY] * JMATH::binomial(i, M) * pow(QE, M) * pow(1.0 - QE, i - M);
146  }
147 
148  if (getMultiplesRate(M) > R)
149  buffer[M - LOWER_L1_MULTIPLICITY] = (getMultiplesRate(M) - R) / pow(QE, M);
150  else
151  buffer[M - LOWER_L1_MULTIPLICITY] = 0.0;
152  }
153 
154  rateL1 = buffer;
155 
156  } else {
157 
158  rateL0 = 0.0;
159 
160  for (JRateL1_t::iterator i = rateL1.begin(); i != rateL1.end(); ++i) {
161  *i = 0.0;
162  }
163  }
164  }
static const multiplicity_type LOWER_L1_MULTIPLICITY
Lower L1 multiplicity.
Definition: JK40Rates.hh:217
multiplicity_type getLowerL1Multiplicity() const
Get lower multiplicty.
Definition: JK40Rates.hh:108
JRateL1_t rateL1
multiples rates [Hz]
Definition: JK40Rates.hh:222
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:97
double getMultiplesRate(const multiplicity_type M) const
Get multiples rate at given multiplicity.
Definition: JK40Rates.hh:94
size_t multiplicity_type
Type definition of multiplicity.
Definition: JK40Rates.hh:33
then JCookie sh JDataQuality D $DETECTOR_ID R
Definition: JDataQuality.sh:41
multiplicity_type getUpperL1Multiplicity() const
Get upper multiplicty.
Definition: JK40Rates.hh:119
double binomial(const size_t n, const size_t k)
Binomial function.
JRateL0_t rateL0
singles rate [Hz]
Definition: JK40Rates.hh:221

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 174 of file JK40Rates.hh.

175  {
176  const double rateL0 = object.rateL0;
177 
178  if (in >> object.rateL0) {
179 
180  object.rateL1.clear();
181 
182  for (double x; in >> x; ) {
183  object.rateL1.push_back(x);
184  }
185 
186  } else {
187 
188  object.rateL0 = rateL0;
189  }
190 
191  return in;
192  }
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
JRateL0_t rateL0
singles rate [Hz]
Definition: JK40Rates.hh:221
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 202 of file JK40Rates.hh.

203  {
204  out << object.rateL0;
205 
206  for (JRateL1_t::const_iterator i = object.rateL1.begin(); i != object.rateL1.end(); ++i) {
207  out << ' ' << *i;
208  }
209 
210  return out;
211  }
JRateL1_t rateL1
multiples rates [Hz]
Definition: JK40Rates.hh:222

Member Data Documentation

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

Lower L1 multiplicity.

Definition at line 217 of file JK40Rates.hh.

JRateL0_t JPHYSICS::JK40Rates::rateL0
protected

singles rate [Hz]

Definition at line 221 of file JK40Rates.hh.

JRateL1_t JPHYSICS::JK40Rates::rateL1
protected

multiples rates [Hz]

Definition at line 222 of file JK40Rates.hh.


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