Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static 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 Member Functions

static JK40RatesgetInstance ()
 Get reference to unique instance of this class object. 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:237
JRateL0_t rateL0
singles rate [Hz]
Definition: JK40Rates.hh:236
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:237
JRateL0_t rateL0
singles rate [Hz]
Definition: JK40Rates.hh:236

Member Function Documentation

static JK40Rates& JPHYSICS::JK40Rates::getInstance ( )
inlinestatic

Get reference to unique instance of this class object.

This method returns an object with default values.
The singles and multiples rates are taken from KM3NeT internal note

Returns
reference to this class object

Definition at line 75 of file JK40Rates.hh.

76  {
77  static JK40Rates rates_Hz;
78 
79  if (rates_Hz.rateL1.empty()) {
80 
81  rates_Hz.rateL0 = 5.0e3; // [Hz]
82 
83  rates_Hz.rateL1.push_back(500.0); // [Hz]
84  rates_Hz.rateL1.push_back( 50.0);
85  rates_Hz.rateL1.push_back( 5.0);
86  }
87 
88  return rates_Hz;
89  }
JRateL1_t rateL1
multiples rates [Hz]
Definition: JK40Rates.hh:237
JRateL0_t rateL0
singles rate [Hz]
Definition: JK40Rates.hh:236
Auxiliary class for K40 rates.
Definition: JK40Rates.hh:41
double JPHYSICS::JK40Rates::getSinglesRate ( ) const
inline

Get singles rate.

Returns
rate [Hz]

Definition at line 97 of file JK40Rates.hh.

98  {
99  return rateL0;
100  }
JRateL0_t rateL0
singles rate [Hz]
Definition: JK40Rates.hh:236
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 109 of file JK40Rates.hh.

110  {
112  return rateL1[M - LOWER_L1_MULTIPLICITY];
113  else
114  return 0.0;
115  }
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
static const multiplicity_type LOWER_L1_MULTIPLICITY
Lower L1 multiplicity.
Definition: JK40Rates.hh:232
JRateL1_t rateL1
multiples rates [Hz]
Definition: JK40Rates.hh:237
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 123 of file JK40Rates.hh.

124  {
125  return LOWER_L1_MULTIPLICITY;
126  }
static const multiplicity_type LOWER_L1_MULTIPLICITY
Lower L1 multiplicity.
Definition: JK40Rates.hh:232
multiplicity_type JPHYSICS::JK40Rates::getUpperL1Multiplicity ( ) const
inline

Get upper multiplicty.

Returns
upper multiplicity

Definition at line 134 of file JK40Rates.hh.

135  {
136  return rateL1.size() + 1;
137  }
JRateL1_t rateL1
multiples rates [Hz]
Definition: JK40Rates.hh:237
void JPHYSICS::JK40Rates::correct ( const double  QE)
inline

Correct rates for global efficiency,.

Parameters
QEglobal efficiency

Definition at line 145 of file JK40Rates.hh.

146  {
147  if (QE > 0.0) {
148 
149  rateL0 /= QE;
150 
151  JRateL1_t buffer = rateL1;
152 
154 
155  // determine contribution from higher multiplicities
156 
157  double R = 0.0;
158 
159  for (multiplicity_type i = M + 1; i <= getUpperL1Multiplicity(); ++i) {
160  R += buffer[i - LOWER_L1_MULTIPLICITY] * JMATH::binomial(i, M) * pow(QE, M) * pow(1.0 - QE, i - M);
161  }
162 
163  if (getMultiplesRate(M) > R)
164  buffer[M - LOWER_L1_MULTIPLICITY] = (getMultiplesRate(M) - R) / pow(QE, M);
165  else
166  buffer[M - LOWER_L1_MULTIPLICITY] = 0.0;
167  }
168 
169  rateL1 = buffer;
170 
171  } else {
172 
173  rateL0 = 0.0;
174 
175  for (JRateL1_t::iterator i = rateL1.begin(); i != rateL1.end(); ++i) {
176  *i = 0.0;
177  }
178  }
179  }
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:232
multiplicity_type getLowerL1Multiplicity() const
Get lower multiplicty.
Definition: JK40Rates.hh:123
JRateL1_t rateL1
multiples rates [Hz]
Definition: JK40Rates.hh:237
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:109
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:40
size_t multiplicity_type
Type definition of multiplicity.
Definition: JK40Rates.hh:33
multiplicity_type getUpperL1Multiplicity() const
Get upper multiplicty.
Definition: JK40Rates.hh:134
JRateL0_t rateL0
singles rate [Hz]
Definition: JK40Rates.hh:236

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

190  {
191  const double rateL0 = object.rateL0;
192 
193  if (in >> object.rateL0) {
194 
195  object.rateL1.clear();
196 
197  for (double x; in >> x; ) {
198  object.rateL1.push_back(x);
199  }
200 
201  } else {
202 
203  object.rateL0 = rateL0;
204  }
205 
206  return in;
207  }
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 typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:36
JRateL0_t rateL0
singles rate [Hz]
Definition: JK40Rates.hh:236
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 217 of file JK40Rates.hh.

218  {
219  out << object.rateL0;
220 
221  for (JRateL1_t::const_iterator i = object.rateL1.begin(); i != object.rateL1.end(); ++i) {
222  out << ' ' << *i;
223  }
224 
225  return out;
226  }
JRateL1_t rateL1
multiples rates [Hz]
Definition: JK40Rates.hh:237

Member Data Documentation

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

Lower L1 multiplicity.

Definition at line 232 of file JK40Rates.hh.

JRateL0_t JPHYSICS::JK40Rates::rateL0
protected

singles rate [Hz]

Definition at line 236 of file JK40Rates.hh.

JRateL1_t JPHYSICS::JK40Rates::rateL1
protected

multiples rates [Hz]

Definition at line 237 of file JK40Rates.hh.


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