291{
295
297 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
301
303 JLimit_t& numberOfEvents = inputFile.getLimit();
306 double Tmax_s;
314 double epsilon = 1.0e-4;
315 double T_ns = 2.5;
316 size_t threads;
318
319 parameters.
ZMin_m = -1.0e4;
320 parameters.
ZMax_m = +1.0e4;
321
323
324 try {
325
327
332
333 JParser<> zap(
"Program to determine string or optical module time calibrations.");
334
348
350 }
351 catch(const exception& error) {
353 }
354
355
356 if (strings.empty() == modules.empty()) {
357 FATAL(
"Set either strings (option -S) or modules (option -M)." <<
endl);
358 }
359
361
362 try {
364 }
367 }
368
370
371 try {
372
374
376 }
377 catch(const exception& error) {
380 }
381 }
382
384
385 NOTICE(
"Reading PDFs... " << flush);
386
388
390
391 JRegressor_t::debug =
debug;
392 JRegressor_t::Vmax_npe = parameters.
VMax_npe;
393 JRegressor_t::MAXIMUM_ITERATIONS = parameters.
NMax;
394
395
396
398
400
402
405
407
409
410 for (
JParallelFileScanner_t in(*i); (skip -= in.skip(skip)) == 0 && in.hasNext() && counter != numberOfEvents; ++counter) {
411
413
414 multi_pointer_type ps = in.next();
415
418
419 summary.update(*
tev);
420
423 }
424
426
427 if (evt->begin() != __end) {
428
430
432
434
436
440
444 }
445
447
448
449
451
453
454 JHitW0 hit(*i, summary.getRate(i->getPMTIdentifier(), parameters.
R_Hz));
455
457
459 buffer.push_back(
hit);
460 }
461 }
462
463
464
466
468
469
470
472
473 for (buffer_type::const_iterator
hit = buffer.begin();
hit != __end; ++
hit) {
474
475 const JModule&
module = router.getModule(hit->getModuleID());
476
477 if (!strings.empty()) {
map[
module.getString()].push_back(*hit); }
478 if (!modules.empty()) {
map[
module.getID()] .push_back(*hit); }
479 }
480
481 data.push_back({
map, tz,
true});
482 }
483 }
484 }
487
488
489
490
492
495
498
500
501 const double chi2 = fit(
perth);
502
503 STATUS(
"result: " <<
FIXED(12,6) << chi2 <<
' ' <<
setw(6) << fit.numberOfIterations <<
endl);
504
505 for (size_t i = 0; i != fit.size(); ++i) {
506 {
508
510 }
511 }
512
513
515
517
519
520 for (size_t i = 0; i != fit.size(); ++i) {
521
523
526 }
527 }
528
530
532
534
540 module->getPMT(pmt).addT0(p->second - t0);
541 }
542 }
543 }
544 }
545
547
549 }
550}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define MAKE_STRING(A)
Make string.
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
Router for direct addressing of module data in detector data structure.
Data structure for a composite optical module.
Utility class to parse parameter values.
Data structure for set of track fit results.
Data structure for track fit results with history and optional associated values.
const std::vector< double > & getW() const
Get associated values.
double getT() const
Get time.
Data structure for fit of straight line paralel to z-axis.
Template definition of a multi-dimensional oscillation probability interpolation table.
void load()
Load oscillation probability table.
Auxiliary class for a hit with background rate value.
File router for fast addressing of summary data.
static const int JSTART_ZMAX_M
end position of track see JRECONSTRUCTION::JMuonStart
static const int JSTART_LENGTH_METRES
distance between projected positions on the track of optical modules for which the response does not ...
static const int JSTART_ZMIN_M
start position of track see JRECONSTRUCTION::JMuonStart
JDirection3D getDirection(const Vec &dir)
Get direction.
JPosition3D getPosition(const Vec &pos)
Get position.
JTOOLS::JRange< double > JTimeRange
Type definition for time range (unit [s]).
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
void store(const std::string &file_name, const JDetector &detector)
Store detector to output file.
std::set< int > getStringIDs(const JDetector &detector)
Get list of strings identifiers.
std::set< int > getModuleIDs(const JDetector &detector, const bool option=false)
Get list of modules identifiers.
JTOOLS::JRange< double > JZRange
const array_type< JValue_t > & get_values(const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &data)
Method to create array of values of map.
std::iterator_traits< T >::value_type getAverage(T __begin, T __end)
Get average.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
KM3NeT DAQ data structures and auxiliaries.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
Auxiliary data structure for sequence of same character.
Auxiliary data structure for floating point format specification.
Data structure for measured coincidence rates of all pairs of PMTs in optical module.
Dynamic detector calibration.
Auxiliary class to test history.
Auxiliary class to match data points with given model.
Auxiliary data structure for editable parameter.
Template data structure for storage of internal data.
Auxiliary class for recursive type list generation.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary class for editing time offset.
double t0
time offset [ns]
Data structure for fit parameters.
double TTS_ns
transition-time spread [ns]
double TMin_ns
minimal time w.r.t. Cherenkov hypothesis [ns]
double roadWidth_m
road width [m]
double TMax_ns
maximal time w.r.t. Cherenkov hypothesis [ns]
double VMax_npe
maximum number of of photo-electrons
double ZMax_m
maximal z-positon [m]
double ZMin_m
minimal z-positon [m]
int NMax
maximum number of iterations
double R_Hz
default rate [Hz]
Auxiliary data structure for chi2 function object.
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.
Auxiliary data structure for sorting of hits.