1 #ifndef __JDETECTOR__JK40DEFAULTSIMULATORINTERFACE__
2 #define __JDETECTOR__JK40DEFAULTSIMULATORINTERFACE__
24 namespace JDETECTOR {}
25 namespace JPP {
using namespace JDETECTOR; }
65 const pair_type& operator()(
const double random)
const
67 double P = this->rbegin()->P;
76 int imax = this->size() - 1;
78 for (
int i = (imax + imin) / 2; imax - imin != 1;
i = (imax + imin) / 2) {
144 const size_t N = module.size();
145 const size_t M = (
N * (
N - 1)) / 2;
153 for (
size_t pmt = 0; pmt !=
N; ++pmt) {
157 if (rateL0_Hz > 0.0) {
159 const double t_ns = 1.0e9 / rateL0_Hz;
170 double totalRateL1_Hz = 0.0;
172 for (
size_t i = 0;
i !=
N; ++
i) {
176 if (totalRateL1_Hz > 0.0) {
178 const double t_ns = 1.0e9 / totalRateL1_Hz;
191 for (
size_t pmt1 = 0; pmt1 !=
N; ++pmt1) {
192 for (
size_t pmt2 = 0; pmt2 != pmt1; ++pmt2) {
204 for ( ; t1 < period.
getUpperLimit(); t1 += gRandom->Exp(t_ns)) {
219 for (
double R = totalRateL1_Hz * gRandom->Rndm(); M !=
N && (
R -=
rateL1_Hz[M]) > 0.0; ++M) {}
225 for ( ; M != 0; --M) {
231 for (
size_t i = 0; i !=
N; ++
i) {
233 if (buffer.count(i) == 0) {
242 P += probability1D[
i];
246 probability1D[
i] = 0.0;
254 for (P *= gRandom->Rndm(); pmt !=
N && (P -= probability1D[pmt]) > 0.0; ++pmt) {}
306 static double sigma = 0.5;
static double getSigma()
Get intrinsic time smearing of K40 coincidences.
JK40DefaultSimulatorInterface()
Default constructor.
Data structure for PMT analogue signal.
Interface for simulation of K40 background.
Default K40 simulator interface.
Data structure for a composite optical module.
Data structure for PMT data corresponding to a detector module.
double getDot(const JNeutrinoDirection &first, const JNeutrinoDirection &second)
Dot product.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Compiler version dependent expressions, macros, etc.
static double & get_sigma()
Get intrinsic time smearing of K40 coincidences.
JDirection3D getDirection(const Vec &dir)
Get direction.
virtual double getSinglesRate(const JPMTIdentifier &pmt) const =0
Get singles rate as a function of PMT.
int getID() const
Get identifier.
double P
probability of coincidence
virtual void generateHits(const JModule &module, const JTimeRange &period, JModuleData &output) const
Generate hits.
virtual double getMultiplesRate(const JModuleIdentifier &module, const int M) const =0
Get multiples rate as a function of optical module.
then JCookie sh JDataQuality D $DETECTOR_ID R
Exception for numerical precision error.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Auxiliary class for object identification.
static void setSigma(const double sigma)
Set intrinsic time smearing of K40 coincidences.
std::vector< double > rateL1_Hz
Multiples rate as a function of the multiplicity.
virtual double getProbability(const double ct) const =0
Get probability of coincidence.