Jpp 20.0.0-72-g597b30bc9
the software that should make you happy
Loading...
Searching...
No Matches
JK40DefaultSimulator.hh
Go to the documentation of this file.
1#ifndef __JDETECTOR__JK40DEFAULTSIMULATOR__
2#define __JDETECTOR__JK40DEFAULTSIMULATOR__
3
4#include <vector>
5#include <cmath>
6
7#include "JLang/JCC.hh"
9#include "JPhysics/KM3NeT.hh"
11
12
13/**
14 * \author mdejong
15 */
16
17namespace JDETECTOR {}
18namespace JPP { using namespace JDETECTOR; }
19
20namespace JDETECTOR {
21
26
27 /**
28 * Default implementation of the simulation of K40 background.
29 * This class implements the JK40Simulator interface.
30 */
33 public JK40Rates,
34 public JMixedK40Rates
35 {
36 public:
37 /**
38 * Default constructor.
39 */
44
45
46 /**
47 * Constructor.
48 *
49 * \param rates K40 rates [Hz]
50 */
52 JK40Rates(rates),
54 {}
55
56
57 /**
58 * Constructor.
59 *
60 * \param rates K40 rates [Hz]
61 * \param mixed mixed K40 rates [Hz]
62 */
63 JK40DefaultSimulator(const JK40Rates& rates, const JMixedK40Rates& mixed) :
64 JK40Rates(rates),
65 JMixedK40Rates(mixed)
66 {}
67
68
69 /**
70 * Get reference to unique instance of this class object.
71 *
72 * This method returns an object with default values.
73 * The singles and multiples rates are taken from %KM3NeT
74 * internal note "Detector simulations for KM3NeT".
75 *
76 * \return reference to this class object
77 */
79 {
80 static JK40DefaultSimulator k40Simulator(KM3NET::getK40Rates());
81
82 return k40Simulator;
83 }
84
85
86 /**
87 * Get singles rate as a function of PMT.
88 *
89 * \param pmt PMT identifier
90 * \return rate [Hz]
91 */
92 virtual double getSinglesRate(const JPMTIdentifier& pmt) const override
93 {
95 }
96
97
98 /**
99 * Get multiples rate as a function of optical module.
100 *
101 * \param module optical module identifier
102 * \param M multiplicity (M >= 2)
103 * \return rate [Hz]
104 */
105 virtual double getMultiplesRate(const JModuleIdentifier& module, const int M) const override
106 {
108 }
109
110
111 /**
112 * Get probability of coincidence.
113 *
114 * \param ct cosine space angle between PMT axes
115 * \return probability
116 */
117 virtual double getProbability(const double ct) const override
118 {
119 return exp(ct * (p1() + ct * (p2() + ct * (p3() + ct*p4()))));
120 }
121
122
123 /**
124 * Get mixed L0 (lower module) and L1 (upper module) rate [Hz]
125 *
126 * \return rate [Hz]
127 */
128 virtual double getL01Rate() const override
129 {
131 }
132
133
134 /**
135 * Get mixed L1 (lower module) and L0 (upper module) rate [Hz]
136 *
137 * \return rate [Hz]
138 */
139 virtual double getL10Rate() const override
140 {
142 }
143
144
145 /**
146 * Read K40 simulator from input.
147 *
148 * \param in input stream
149 * \param object K40 simulator
150 * \return input stream
151 */
152 friend inline std::istream& operator>>(std::istream& in, JK40DefaultSimulator& object)
153 {
154 const double rateL0 = object.rateL0;
155
156 if (in >> object.rateL0) {
157
158 object.rateL1.clear();
159
160 for (double x; in >> x; ) {
161 object.rateL1.push_back(x);
162 }
163
164 } else {
165
166 object.rateL0 = rateL0;
167 }
168
169 return in;
170 }
171
172
173 /**
174 * Write K40 simulator to output.
175 *
176 * \param out output stream
177 * \param object K40 simulator
178 * \return output stream
179 */
180 friend inline std::ostream& operator<<(std::ostream& out, const JK40DefaultSimulator& object)
181 {
182 out << object.rateL0;
183
184 for (JRateL1_t::const_iterator i = object.rateL1.begin(); i != object.rateL1.end(); ++i) {
185 out << ' ' << *i;
186 }
187
188 out << " X " << object.rateL01 << ' ' << object.rateL10;
189
190 return out;
191 }
192
193
194 protected:
195 /**
196 * Parameters for probability of coincidence as a function of
197 * the cosine of space angle between PMT axes.
198 * Values are provided by V.Kulikovski.
199 */
200 static double p1() { return 3.0767; }
201 static double p2() { return -1.2078; }
202 static double p3() { return 0.9905; }
203 static double p4() { return 0.9379; }
204 };
205}
206
207#endif
Compiler version dependent expressions, macros, etc.
Properties of KM3NeT PMT and deep-sea water.
Default implementation of the simulation of K40 background.
friend std::ostream & operator<<(std::ostream &out, const JK40DefaultSimulator &object)
Write K40 simulator to output.
virtual double getMultiplesRate(const JModuleIdentifier &module, const int M) const override
Get multiples rate as a function of optical module.
virtual double getProbability(const double ct) const override
Get probability of coincidence.
JK40DefaultSimulator()
Default constructor.
virtual double getL01Rate() const override
Get mixed L0 (lower module) and L1 (upper module) rate [Hz].
JK40DefaultSimulator(const JK40Rates &rates)
Constructor.
static JK40DefaultSimulator & getInstance()
Get reference to unique instance of this class object.
static double p1()
Parameters for probability of coincidence as a function of the cosine of space angle between PMT axes...
virtual double getL10Rate() const override
Get mixed L1 (lower module) and L0 (upper module) rate [Hz].
virtual double getSinglesRate(const JPMTIdentifier &pmt) const override
Get singles rate as a function of PMT.
JK40DefaultSimulator(const JK40Rates &rates, const JMixedK40Rates &mixed)
Constructor.
friend std::istream & operator>>(std::istream &in, JK40DefaultSimulator &object)
Read K40 simulator from input.
Auxiliary class for object identification.
Definition JObjectID.hh:25
file Auxiliary data structures and methods for detector calibration.
Definition JAnchor.hh:12
double JRateL0_t
Type definition of singles rate [Hz].
Definition JK40Rates.hh:21
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary class for K40 rates.
Definition JK40Rates.hh:41
JRateL1_t rateL1
multiples rates [Hz]
Definition JK40Rates.hh:222
double getSinglesRate() const
Get singles rate.
Definition JK40Rates.hh:71
double getMultiplesRate(const multiplicity_type M) const
Get multiples rate at given multiplicity.
Definition JK40Rates.hh:94
JRateL0_t rateL0
singles rate [Hz]
Definition JK40Rates.hh:221
Auxiliary class for mixed-L1/L0 K40 rates.
Definition JK40Rates.hh:229
double getL10Rate() const
Get mixed L1 (lower module) and L0 (upper module) rate [Hz].
Definition JK40Rates.hh:268
double getL01Rate() const
Get mixed L0 (lower module) and L1 (upper module) rate [Hz].
Definition JK40Rates.hh:257