K40 simulation based on run-by-run information.  
 More...
#include <JK40RunByRunSimulator.hh>
 | 
| static double  | p1 () | 
|   | Parameters for probability of coincidence as a function of the cosine of space angle between PMT axes.  More...
  | 
|   | 
| static double  | p2 () | 
|   | 
| static double  | p3 () | 
|   | 
| static double  | p4 () | 
|   | 
K40 simulation based on run-by-run information. 
This class overwrites the method JK40DefaultSimulator::getSinglesRate. The actual singles rate is obtained from summary data. 
Definition at line 33 of file JK40RunByRunSimulator.hh.
 
Constructor. 
- Parameters
 - 
  
    | router | summary router  | 
    | rates | K40 rates [Hz]  | 
  
   
Definition at line 43 of file JK40RunByRunSimulator.hh.
JK40DefaultSimulator()
Default constructor. 
 
const JSummaryRouter & summary_router
 
 
 
 
  
  
      
        
          | virtual double JTRIGGER::JK40RunByRunSimulator::getSinglesRate  | 
          ( | 
          const JPMTIdentifier &  | 
          pmt | ) | 
           const | 
         
       
   | 
  
inlineoverridevirtual   | 
  
 
Get singles rate as a function of PMT. 
- Parameters
 - 
  
  
 
- Returns
 - rate [Hz] 
 
Reimplemented from JDETECTOR::JK40DefaultSimulator.
Definition at line 56 of file JK40RunByRunSimulator.hh.
int getModuleID() const 
Get module identifier. 
 
double getRate(const JDAQSummaryFrame &frame, const int pmt, const double factor=1.0)
Get corrected rate of PMT. 
 
Data storage class for rate measurements of all PMTs in one module. 
 
int getPMTAddress() const 
Get PMT address (= TDC). 
 
const JDAQSummaryFrame & getSummaryFrame(const JDAQModuleIdentifier &module) const 
Get summary frame. 
 
const JSummaryRouter & summary_router
 
bool hasSummaryFrame(const JDAQModuleIdentifier &module) const 
Has summary frame. 
 
 
 
 
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 "Detector simulations for KM3NeT".
- Returns
 - reference to this class object 
 
Definition at line 62 of file JK40DefaultSimulator.hh.
Default implementation of the simulation of K40 background. 
 
const JK40Rates & getK40Rates()
Get K40 rates. 
 
 
 
 
  
  
      
        
          | double JPHYSICS::JK40Rates::getSinglesRate  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inlineinherited   | 
  
 
Get singles rate. 
- Returns
 - rate [Hz] 
 
Definition at line 71 of file JK40Rates.hh.
JRateL0_t rateL0
singles rate [Hz] 
 
 
 
 
  
  
      
        
          | virtual double JDETECTOR::JK40DefaultSimulator::getMultiplesRate  | 
          ( | 
          const JModuleIdentifier &  | 
          module,  | 
         
        
           | 
           | 
          const int  | 
          M  | 
         
        
           | 
          ) | 
           |  const | 
         
       
   | 
  
inlineoverridevirtualinherited   | 
  
 
 
Get multiples rate. 
- Parameters
 - 
  
  
 
- Returns
 - rate [Hz] 
 
Definition at line 83 of file JK40Rates.hh.
static const multiplicity_type LOWER_L1_MULTIPLICITY
Lower L1 multiplicity. 
 
JRateL1_t rateL1
multiples rates [Hz] 
 
size_t multiplicity_type
Type definition of multiplicity. 
 
 
 
 
  
  
      
        
          | virtual double JDETECTOR::JK40DefaultSimulator::getProbability  | 
          ( | 
          const double  | 
          ct | ) | 
           const | 
         
       
   | 
  
inlineoverridevirtualinherited   | 
  
 
Get probability of coincidence. 
- Parameters
 - 
  
    | ct | cosine space angle between PMT axes  | 
  
   
- Returns
 - probability 
 
Implements JDETECTOR::JK40DefaultSimulatorInterface.
Definition at line 101 of file JK40DefaultSimulator.hh.
  103       return exp(ct * (
p1() + ct * (
p2() + ct * (
p3() + ct*
p4()))));
 
static double p1()
Parameters for probability of coincidence as a function of the cosine of space angle between PMT axes...
 
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
 
 
 
 
  
  
      
        
          | static double JDETECTOR::JK40DefaultSimulator::p1  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlinestaticprotectedinherited   | 
  
 
Parameters for probability of coincidence as a function of the cosine of space angle between PMT axes. 
Values are provided by V.Kulikovski. 
Definition at line 160 of file JK40DefaultSimulator.hh.
 
 
  
  
      
        
          | static double JDETECTOR::JK40DefaultSimulator::p2  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlinestaticprotectedinherited   | 
  
 
 
  
  
      
        
          | static double JDETECTOR::JK40DefaultSimulator::p3  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlinestaticprotectedinherited   | 
  
 
 
  
  
      
        
          | static double JDETECTOR::JK40DefaultSimulator::p4  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlinestaticprotectedinherited   | 
  
 
 
  
  
      
        
          | virtual void JDETECTOR::JK40DefaultSimulatorInterface::generateHits  | 
          ( | 
          const JModule &  | 
          module,  | 
         
        
           | 
           | 
          const JTimeRange &  | 
          period,  | 
         
        
           | 
           | 
          JModuleData &  | 
          output  | 
         
        
           | 
          ) | 
           |  const | 
         
       
   | 
  
inlinevirtualinherited   | 
  
 
Generate hits. 
- Parameters
 - 
  
    | module | module  | 
    | period | time window [ns]  | 
    | output | background data  | 
  
   
Implements JDETECTOR::JK40Simulator.
Definition at line 112 of file JK40DefaultSimulatorInterface.hh.
  119       const int N = module.size();
 
  130       for (
int pmt = 0; pmt != 
N; ++pmt) {
 
  134         if (rateL0_Hz > 0.0) {
 
  136           const double t_ns = 1.0e9 / rateL0_Hz;          
 
  138           for (
double t1 = period.getLowerLimit() + gRandom->Exp(t_ns); t1 < period.getUpperLimit(); t1 += gRandom->Exp(t_ns)) {
 
  147       double totalRateL1_Hz = 0.0;
 
  149       for (
int i = 0; i != 
N; ++i) {
 
  153       if (totalRateL1_Hz > 0.0) {
 
  155         const double t_ns = 1.0e9 / totalRateL1_Hz;       
 
  157         double t1 = period.getLowerLimit() + gRandom->Exp(t_ns);
 
  159         if (t1 < period.getUpperLimit()) {
 
  164           for (
int i = 0; i != 
N; ++i) {
 
  168             for (
int j = i + 1; 
j != 
N; ++
j) {
 
  181           for (
int i = 0; i != 
N; ++i) {
 
  185             for (
int j = 0; 
j != 
N; ++
j) {
 
  191           for ( ; t1 < period.getUpperLimit(); t1 += gRandom->Exp(t_ns)) {
 
  213                 for (
unsigned int pmtN = pmt2; M != 0; --
M) {
 
  215                   for (
int i = 0; i != 
N; ++i) {
 
  227             catch (
const JNumericalPrecision&) {}
 
static double getSigma()
Get intrinsic time smearing of K40 coincidences. 
 
Data structure for PMT analogue signal. 
 
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
 
JBuffer1D_t probabilityND
This probability vector is a one-dimensional array in which element [i] corresponds to the probabilit...
 
static unsigned int getRandomIndex(const JBuffer1D_t &buffer, const double random)
Get index based on random value. 
 
void resize(size_t size)
Resize. 
 
virtual double getSinglesRate(const JPMTIdentifier &pmt) const =0
Get singles rate as a function of PMT. 
 
int getID() const 
Get identifier. 
 
JBuffer2D_t probability2D
This correlation matrix is a two-dimensional array in which element [i][j] corresponds to the probabi...
 
JBuffer1D_t rateL1_Hz
Multiples rate as a function of the multiplicity. 
 
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects. 
 
virtual double getMultiplesRate(const JModuleIdentifier &module, const int M) const =0
Get multiples rate as a function of optical module. 
 
JBuffer1D_t probability1D
This probability vector is a one-dimensional array in which element [i] corresponds to the probabilit...
 
virtual double getProbability(const double ct) const =0
Get probability of coincidence. 
 
 
 
 
  
  
      
        
          | static unsigned int JDETECTOR::JK40DefaultSimulatorInterface::getRandomIndex  | 
          ( | 
          const JBuffer1D_t &  | 
          buffer,  | 
         
        
           | 
           | 
          const double  | 
          random  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inlinestaticinherited   | 
  
 
Get index based on random value. 
It is assumed that the values of the input buffer monotonously decrease or increase. This method throws an exception when the summed values in the input buffer is zero.
- Parameters
 - 
  
    | buffer | input values  | 
    | random | random value <0,1]  | 
  
   
- Returns
 - index 
 
Definition at line 244 of file JK40DefaultSimulatorInterface.hh.
  248       for (JBuffer1D_t::const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
 
  256         unsigned int index = 0;
 
  258         for (JBuffer1D_t::const_iterator i = buffer.begin(); i != buffer.end() && (x -= *i) > 0.0; ++i, ++index) {}
 
  260         if (index == buffer.size()) {
 
  268         THROW(JNumericalPrecision, 
"getRandomIndex(): zero or negative probability.");
 
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message. 
 
 
 
 
  
  
      
        
          | static double JDETECTOR::JK40DefaultSimulatorInterface::getSigma  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlinestaticinherited   | 
  
 
 
Get lower multiplicty. 
- Returns
 - lower multiplicity 
 
Definition at line 97 of file JK40Rates.hh.
static const multiplicity_type LOWER_L1_MULTIPLICITY
Lower L1 multiplicity. 
 
 
 
 
Get upper multiplicty. 
- Returns
 - upper multiplicity 
 
Definition at line 108 of file JK40Rates.hh.
JRateL1_t rateL1
multiples rates [Hz] 
 
 
 
 
  
  
      
        
          | void JPHYSICS::JK40Rates::correct  | 
          ( | 
          const double  | 
          QE | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Correct rates for global efficiency,. 
- Parameters
 - 
  
  
 
Definition at line 119 of file JK40Rates.hh.
  149         for (JRateL1_t::iterator i = 
rateL1.begin(); i != 
rateL1.end(); ++i) {
 
double binomial(const int n, const int k)
Binomial function. 
 
static const multiplicity_type LOWER_L1_MULTIPLICITY
Lower L1 multiplicity. 
 
multiplicity_type getLowerL1Multiplicity() const 
Get lower multiplicty. 
 
JRateL1_t rateL1
multiples rates [Hz] 
 
T pow(const T &x, const double y)
Power . 
 
double getMultiplesRate(const multiplicity_type M) const 
Get multiples rate. 
 
then usage $script[distance] fi case set_variable R
 
size_t multiplicity_type
Type definition of multiplicity. 
 
multiplicity_type getUpperL1Multiplicity() const 
Get upper multiplicty. 
 
JRateL0_t rateL0
singles rate [Hz] 
 
 
 
 
The documentation for this class was generated from the following file: