Jpp 19.3.0-rc.2
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
25
26 /**
27 * Default implementation of the simulation of K40 background.
28 * This class implements the JK40Simulator interface.
29 */
32 public JK40Rates
33 {
34 public:
35 /**
36 * Default constructor.
37 */
41
42
43 /**
44 * Constructor.
45 *
46 * \param rates K40 rates [Hz]
47 */
49 JK40Rates(rates)
50 {}
51
52
53 /**
54 * Get reference to unique instance of this class object.
55 *
56 * This method returns an object with default values.
57 * The singles and multiples rates are taken from %KM3NeT
58 * internal note "Detector simulations for KM3NeT".
59 *
60 * \return reference to this class object
61 */
63 {
64 static JK40DefaultSimulator k40Simulator(KM3NET::getK40Rates());
65
66 return k40Simulator;
67 }
68
69
70 /**
71 * Get singles rate as a function of PMT.
72 *
73 * \param pmt PMT identifier
74 * \return rate [Hz]
75 */
76 virtual double getSinglesRate(const JPMTIdentifier& pmt) const override
77 {
79 }
80
81
82 /**
83 * Get multiples rate as a function of optical module.
84 *
85 * \param module optical module identifier
86 * \param M multiplicity (M >= 2)
87 * \return rate [Hz]
88 */
89 virtual double getMultiplesRate(const JModuleIdentifier& module, const int M) const override
90 {
92 }
93
94
95 /**
96 * Get probability of coincidence.
97 *
98 * \param ct cosine space angle between PMT axes
99 * \return probability
100 */
101 virtual double getProbability(const double ct) const override
102 {
103 return exp(ct * (p1() + ct * (p2() + ct * (p3() + ct*p4()))));
104 }
105
106
107 /**
108 * Read K40 simulator from input.
109 *
110 * \param in input stream
111 * \param object K40 simulator
112 * \return input stream
113 */
114 friend inline std::istream& operator>>(std::istream& in, JK40DefaultSimulator& object)
115 {
116 const double rateL0 = object.rateL0;
117
118 if (in >> object.rateL0) {
119
120 object.rateL1.clear();
121
122 for (double x; in >> x; ) {
123 object.rateL1.push_back(x);
124 }
125
126 } else {
127
128 object.rateL0 = rateL0;
129 }
130
131 return in;
132 }
133
134
135 /**
136 * Write K40 simulator to output.
137 *
138 * \param out output stream
139 * \param object K40 simulator
140 * \return output stream
141 */
142 friend inline std::ostream& operator<<(std::ostream& out, const JK40DefaultSimulator& object)
143 {
144 out << object.rateL0;
145
146 for (JRateL1_t::const_iterator i = object.rateL1.begin(); i != object.rateL1.end(); ++i) {
147 out << ' ' << *i;
148 }
149
150 return out;
151 }
152
153
154 protected:
155 /**
156 * Parameters for probability of coincidence as a function of
157 * the cosine of space angle between PMT axes.
158 * Values are provided by V.Kulikovski.
159 */
160 static double p1() { return 3.0767; }
161 static double p2() { return -1.2078; }
162 static double p3() { return 0.9905; }
163 static double p4() { return 0.9379; }
164 };
165}
166
167#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.
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 getSinglesRate(const JPMTIdentifier &pmt) const override
Get singles rate as a function of PMT.
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