61{
64
70
73 int numberOfEvents;
84 double background;
87
90
91 try {
92
93 JParser<> zap(
"Example application to test fit of model to simulated acoustic data.");
94
108 zap[
'B'] =
make_field(background,
"background probability") = 0.0;
111
113 }
114 catch(const exception &error) {
116 }
117
118
120
121 if (numberOfEvents <= 0) {
FATAL(
"Invalid number of events " << numberOfEvents <<
endl); }
122
124
125 try {
127 }
130 }
131
133
134 for (tripods_container::const_iterator i = tripods.begin(); i != tripods.end(); ++i) {
136 i->getUTMPosition() -
detector.getUTMPosition()));
137 }
138
139 for (transmitters_container::const_iterator i = transmitters.begin(); i != transmitters.end(); ++i) {
140 try {
142 i->getPosition() +
detector.getModule(i->getLocation()).getPosition()));
143 }
144 catch(const exception&) {
145 continue;
146 }
147 }
148
151
152
154
156
159
162
164
166
167
168 TH1D h0(
"cpu",
NULL, 100, 0.0, 1.0e3);
169 TH1D h1(
"chi2/NDF",
NULL, 100, 0.0, 5.0);
170
173
174
176
178
180
182
184
185 model.string[
module->getString()] = JMODEL::JString(gRandom->Uniform(-2.0e-2, +2.0e-2),
186 gRandom->Uniform(-2.0e-2, +2.0e-2));
187 }
188 }
189
191
192
193
195 if (
module->getFloor() != 0 && geometry.hasLocation(
module->getLocation())) {
196 module->set(geometry[module->getString()].getPosition(model.string[module->getString()], module->getFloor()));
197 }
198 }
199
200
201
202
204
207 }
208
210
212
214
216
218
219 ++count;
220
222
223 model.emission[emitter->getID()][count] =
toe_s;
224
226
228
229 if (geometry.hasLocation(
module->getLocation())) {
230
232
236
237 if (Q >= parameters.
Qmin) {
238
240
241 if (
gRandom->Rndm() >= background)
243 else
246
248 count,
252 weight);
253
255
257 }
258 }
259 }
260 }
261 }
262 }
263
264 const chrono::steady_clock::time_point t0 = chrono::steady_clock::now();
265
267
268 const chrono::steady_clock::time_point t1 = chrono::steady_clock::now();
269
271
272 cout <<
"result:" <<
' '
275
278 }
279 }
280
281 h0.Fill(chrono::duration_cast<chrono::milliseconds>(t1 - t0).count());
283
285
286 const double tx = (i->second.tx -
result.value.string [i->first].tx) * 1.0e3;
287 const double ty = (i->second.ty -
result.value.string [i->first].ty) * 1.0e3;
288
290 H2[i->first]->Fill(tx, ty);
291 }
292
294
295 const double t1 = i->second.t1 -
result.value.emission[i->first].t1;
296
298 H1[i->first.getID()]->Fill(t1);
299 }
300 }
302
303
305
306 out << h0
307 << h1
310
311 out.Write();
312 out.Close();
313}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Template definition of a multi-dimensional oscillation probability interpolation table.
JContainer< std::vector< JTripod > > tripods_container
JContainer< std::vector< JTransmitter > > transmitters_container
JContainer< std::vector< JHydrophone > > hydrophones_container
static const JSoundVelocity getSoundVelocity(1541.0, -17.0e-3, -2000.0)
Function object for velocity of sound.
static JDetectorMechanics getMechanics
Function object to get string mechanics.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
double getValue(const JScale_t scale)
Get numerical value corresponding to scale.
void model(JModel_t &value)
Auxiliary function to constrain model during fit.
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
std::vector< event_type > data_type
static const char WILDCARD
Auxiliary data structure for floating point format specification.
double Qmin
minimal quality transmission
double sigma_s
time-of-arrival resolution [s]
Global fit of prameterised detector geometry to acoustics data.
Template definition of fit function of acoustic model.
Model for fit to acoustics data.
Implementation for depth dependend velocity of sound.
virtual double getTime(const double D_m, const double z1, const double z2) const override
Get propagation time of sound.
JSoundVelocity & set(const double z0)
Set depth.
Acoustic transmission identifier.
Data structure for measured coincidence rates of all pairs of PMTs in optical module.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...