Default K40 simulator interface.
More...
#include <JK40DefaultSimulatorInterface.hh>
|
JBuffer2D_t | probability2D |
| This correlation matrix is a two-dimensional array in which element [i][j] corresponds to the probability of a genuine coincidence due to K40 decays, where i and j refer to the indices of the PMTs in the optical module. More...
|
|
JBuffer1D_t | probability1D |
| This probability vector is a one-dimensional array in which element [i] corresponds to the probability of a genuine coincidence due to K40 decays, where i refers to the index of the PMT in the optical module. More...
|
|
JBuffer1D_t | probabilityND |
| This probability vector is a one-dimensional array in which element [i] corresponds to the probability of an additional hit, where i refers to the index of the PMT in the optical module. More...
|
|
JBuffer1D_t | rateL1_Hz |
| Multiples rate as a function of the multiplicity. More...
|
|
Default K40 simulator interface.
This class provides for a default implementation of the JK40Simulator interface which is based on a set of virtual methods. These methods constitute a user interface to the K40 background simulation.
Definition at line 35 of file JK40DefaultSimulatorInterface.hh.
◆ JK40DefaultSimulatorInterface()
JDETECTOR::JK40DefaultSimulatorInterface::JK40DefaultSimulatorInterface |
( |
| ) |
|
|
inlineprotected |
◆ getSinglesRate()
virtual double JDETECTOR::JK40DefaultSimulatorInterface::getSinglesRate |
( |
const JPMTIdentifier & |
pmt | ) |
const |
|
pure virtual |
◆ getMultiplesRate()
virtual double JDETECTOR::JK40DefaultSimulatorInterface::getMultiplesRate |
( |
const JModuleIdentifier & |
module, |
|
|
const int |
M |
|
) |
| const |
|
pure virtual |
Get multiples rate as a function of optical module.
- Parameters
-
module | optical module identifier |
M | multiplicity (M >= 2) |
- Returns
- rate [Hz]
Implemented in JDETECTOR::JK40DefaultSimulator.
◆ getProbability()
virtual double JDETECTOR::JK40DefaultSimulatorInterface::getProbability |
( |
const double |
ct | ) |
const |
|
pure virtual |
◆ generateHits()
virtual void JDETECTOR::JK40DefaultSimulatorInterface::generateHits |
( |
const JModule & |
module, |
|
|
const JTimeRange & |
period, |
|
|
JModuleData & |
output |
|
) |
| const |
|
inlinevirtual |
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&) {}
◆ getRandomIndex()
static unsigned int JDETECTOR::JK40DefaultSimulatorInterface::getRandomIndex |
( |
const JBuffer1D_t & |
buffer, |
|
|
const double |
random |
|
) |
| |
|
inlinestatic |
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.");
◆ getSigma()
static double JDETECTOR::JK40DefaultSimulatorInterface::getSigma |
( |
| ) |
|
|
inlinestatic |
◆ probability2D
JBuffer2D_t JDETECTOR::JK40DefaultSimulatorInterface::probability2D |
|
mutableprivate |
This correlation matrix is a two-dimensional array in which element [i][j] corresponds to the probability of a genuine coincidence due to K40 decays, where i and j refer to the indices of the PMTs in the optical module.
Definition at line 289 of file JK40DefaultSimulatorInterface.hh.
◆ probability1D
JBuffer1D_t JDETECTOR::JK40DefaultSimulatorInterface::probability1D |
|
mutableprivate |
This probability vector is a one-dimensional array in which element [i] corresponds to the probability of a genuine coincidence due to K40 decays, where i refers to the index of the PMT in the optical module.
Definition at line 296 of file JK40DefaultSimulatorInterface.hh.
◆ probabilityND
JBuffer1D_t JDETECTOR::JK40DefaultSimulatorInterface::probabilityND |
|
mutableprivate |
This probability vector is a one-dimensional array in which element [i] corresponds to the probability of an additional hit, where i refers to the index of the PMT in the optical module.
Definition at line 303 of file JK40DefaultSimulatorInterface.hh.
◆ rateL1_Hz
JBuffer1D_t JDETECTOR::JK40DefaultSimulatorInterface::rateL1_Hz |
|
mutableprivate |
The documentation for this class was generated from the following file: