Jpp 20.0.0-195-g190c9e876
the software that should make you happy
Loading...
Searching...
No Matches
JPerth.cc
Go to the documentation of this file.
1#include <string>
2#include <iostream>
3#include <iomanip>
4#include <type_traits>
5#include <functional>
6#include <future>
7#include <mutex>
8#include <thread>
9#include <vector>
10#include <set>
11#include <memory>
12#include <algorithm>
13
16#include "JDAQ/JDAQEventIO.hh"
17
23
25
26#include "JSupport/JMeta.hh"
27#include "JSupport/JSupport.hh"
31
36
37#include "JTrigger/JHitL0.hh"
38#include "JTrigger/JBuildL0.hh"
39
40#include "JFit/JFitToolkit.hh"
41#include "JFit/JLine1Z.hh"
42#include "JFit/JLine3Z.hh"
43#include "JFit/JModel.hh"
44#include "JFit/JGandalf.hh"
46#include "JFit/JGradient.hh"
47
49#include "JLang/JVectorize.hh"
50
52
53#include "JMath/JMath.hh"
54#include "JMath/JQuantile_t.hh"
55#include "JMath/JMatrix2S.hh"
56
57#include "JTools/JRange.hh"
58
59#include "Jeep/JProperties.hh"
60#include "Jeep/JParser.hh"
61#include "Jeep/JMessage.hh"
62
63
64namespace JRECONSTRUCTION {
65
68 using JFIT::JLine1Z;
69 using JFIT::JLine3Z;
71 using JTRIGGER::JHit;
73
75 typedef std::map<int, buffer_type> map_type; //!< identifier -> hits
76
77
78 /**
79 * Get list of time-over-threshold identifiers.
80 * The time-over-threshold identifier corresponds to the index of the tabulated time slewing correction.
81 *
82 * \return identifiers
83 */
85 {
86 std::set<int> buffer;
87
88 for (size_t i = 0; i != getTimeSlewing.size(); ++i) {
89 buffer.insert(i);
90 }
91
92 return buffer;
93 }
94
95
96 /**
97 * Auxiliary data structure to store data and fit in memory.
98 */
99 struct event_type {
102 bool status = true;
103 };
104
107
108
109 /**
110 * Auxiliary class for editing time offset.
111 */
112 struct JEditor :
113 public JParameter_t
114 {
115 /**
116 * Constructor.
117 *
118 * \param data data
119 * \param id identifier
120 */
121 JEditor(data_type& data, const int id) :
122 data(data),
123 id(id),
124 t0(0.0)
125 {}
126
127
128 /**
129 * Apply step.
130 *
131 * \param step step
132 */
133 virtual void apply(const double step) override
134 {
135 for (data_type::iterator evt = data.begin(); evt != data.end(); ++evt) {
136
137 map_type::iterator p = evt->data.find(id);
138
139 if ((evt->status = (p != evt->data.end()))) {
140 for (buffer_type::iterator hit = p->second.begin(); hit != p->second.end(); ++hit) {
141 static_cast<JHit&>(*hit) = JHit(hit->getT1() + step, hit->getToT());
142 }
143 }
144 }
145
146 this->t0 += step;
147 }
148
149 data_type& data; //!< data
150 int id; //!< identifier
151 double t0; //!< time offset [ns]
152 };
153
154
156 typedef JFIT::JRegressor <JFIT::JLine3Z, JFIT::JGandalf> JRegressor_t;
157
158
159 /**
160 * Thread pool for fits to data.
161 */
162 struct JPerth {
163 /**
164 * Constructor.
165 *
166 * \param storage storage for PDFs
167 * \param data data
168 * \param ns number of threads
169 * \param option option
170 */
172 const data_type& data,
173 const size_t ns,
174 const int option) :
175 input(data),
176 stop(false)
177 {
178 using namespace std;
179 using namespace JPP;
180
181 Q.reset();
182
183 for (size_t i = 0; i < ns; ++i) {
184
185 thread worker([this, storage, option]() {
186
187 JRegressor_t regressor(storage);
188
189 regressor.parameters.resize(5);
190
191 regressor.parameters[0] = JLine3Z::pX();
192 regressor.parameters[1] = JLine3Z::pY();
193 regressor.parameters[2] = JLine3Z::pT();
194 regressor.parameters[3] = JLine3Z::pDX();
195 regressor.parameters[4] = JLine3Z::pDY();
196
197 buffer_type data;
198 JLine3Z value;
199
200 for ( ; ; ) {
201
202 {
203 unique_lock<mutex> lock(in);
204
205 cv.wait(lock, [this]() { return stop || this->input.hasNext(); });
206
207 if (stop && !this->input.hasNext()) {
208 return;
209 }
210
211 const event_type* evt = this->input.next();
212
213 // re-organise data
214
215 data.clear();
216
217 // 2 => evaluation of the derivative of the chi2 to each fit parameter.
218
219 if (option != 2 || evt->status) {
220 for (map_type::const_iterator p = evt->data.begin(); p != evt->data.end(); ++p) {
221 copy(p->second.begin(), p->second.end(), back_inserter(data));
222 }
223 }
224
225 value = evt->value;
226 }
227
228 if (!data.empty()) {
229
230 const double chi2 = regressor(value, data.begin(), data.end());
231
232 {
233 unique_lock<mutex> lock(out);
234
235 Q.put(chi2);
236 }
237 }
238 }
239 });
240
241 workers.emplace_back(std::move(worker));
242 }
243 }
244
245
246 /**
247 * Destructor.
248 */
250 {
251 using namespace std;
252
253 {
254 unique_lock<mutex> lock(in);
255
256 stop = true;
257 }
258
259 cv.notify_all();
260
261 for (auto& worker : workers) {
262 worker.join();
263 }
264 }
265
267
268 private:
271 std::mutex in;
272 std::mutex out;
273 std::condition_variable cv;
274 bool stop;
275 };
276
277 /**
278 */
280
281
282 /**
283 * Auxiliary data structure for chi2 function object.
284 */
285 struct JPerth_t {
286 /**
287 * Get chi2.
288 *
289 * \param option option
290 * \return chi2/NDF
291 */
292 double operator()(const int option) const
293 {
294 JPerth(storage, data, ns, option);
295
296 return JPerth::Q.getMean(0.0);
297 }
298
301 const size_t ns;
302 };
303}
304
305
306/**
307 * \file
308 *
309 * Program to determine string or optical module time calibrations.
310 *
311 * \author mdejong
312 */
313int main(int argc, char **argv)
314{
315 using namespace std;
316 using namespace JPP;
317 using namespace KM3NETDAQ;
318
319 typedef JParallelFileScanner< JTypeList<JDAQEvent, JFIT::JEvt> > JParallelFileScanner_t;
320 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
321 typedef JMultipleFileScanner<calibration_types> JCalibration_t;
322
324
325
326 JMultipleFileScanner<> inputFile;
327 JLimit_t& numberOfEvents = inputFile.getLimit();
328 string detectorFile;
329 JCalibration_t calibrationFile;
330 double Tmax_s;
331 string pdfFile;
332 JMuonGandalfParameters_t parameters;
333 bool overwriteDetector;
334 set<int> strings; // string identifiers
335 set<int> modules; // module identifiers
336 set<int> indices; // time-over-threshold identifiers
337 range_type X; // time-over-threshold values
338 int number_of_iterations = 1000;
339 int number_of_extra_steps = 0;
340 double epsilon = 1.0e-4;
341 double T_ns = 2.5; // step size
342 JPMTParametersMap pmtParameters;
343 size_t threads; // number of threads
344 int debug;
345
346 parameters.ZMin_m = -1.0e4; // set range hit selection
347 parameters.ZMax_m = +1.0e4;
348
349 const int DEFAULT_ID = -1;
350
351 try {
352
353 JProperties properties;
354
355 properties.insert(gmake_property(number_of_iterations));
356 properties.insert(gmake_property(number_of_extra_steps));
357 properties.insert(gmake_property(epsilon));
358 properties.insert(gmake_property(T_ns));
359
360 JParser<> zap("Program to determine string or optical module time calibrations.");
361
362 zap['f'] = make_field(inputFile);
363 zap['a'] = make_field(detectorFile);
364 zap['+'] = make_field(calibrationFile) = JPARSER::initialised();
365 zap['T'] = make_field(Tmax_s) = 100.0;
366 zap['n'] = make_field(numberOfEvents) = JLimit::max();
367 zap['F'] = make_field(pdfFile);
368 zap['P'] = make_field(pmtParameters, "PMT simulation data (or corresponding file name)") = JPARSER::initialised();
369 zap['@'] = make_field(parameters) = JPARSER::initialised();
370 zap['A'] = make_field(overwriteDetector, "overwrite detector file provided through '-a' with fitted time offsets.");
371 zap['S'] = make_field(strings, "string identifiers (" << DEFAULT_ID << " => all)") = JPARSER::initialised();
372 zap['M'] = make_field(modules, "module identifiers (" << DEFAULT_ID << " => all)") = JPARSER::initialised();
373 zap['I'] = make_field(indices, "time-over-threshold indices (" << DEFAULT_ID << " => all)") = JPARSER::initialised();
374 zap['x'] = make_field(X, "fit range for time slewing correction") = range_type(4.0, 175.0);
375 zap['%'] = make_field(properties, "fit parameters") = JPARSER::initialised();
376 zap['N'] = make_field(threads, "number of threads") = 1;
377 zap['d'] = make_field(debug) = 1;
378
379 zap(argc, argv);
380 }
381 catch(const exception& error) {
382 FATAL(error.what() << endl);
383 }
384
385
386 if ((strings.empty() ? 0 : 1) +
387 (modules.empty() ? 0 : 1) +
388 (indices.empty() ? 0 : 1) != 1) {
389 FATAL("Set either strings (option -S) or modules (option -M) or indices (option -I)." << endl);
390 }
391
392
393 typedef JDAQHit::JTOT_t JTOT_t;
394
395 const JRange<double> range(0.0, numeric_limits<JTOT_t>::max());
396
398
399 try {
400 load(detectorFile, detector);
401 }
402 catch(const JException& error) {
403 FATAL(error);
404 }
405
406 unique_ptr<JDynamics> dynamics;
407
408 if (!calibrationFile.empty()) {
409
410 try {
411
412 dynamics.reset(new JDynamics(detector, Tmax_s));
413
414 dynamics->load(calibrationFile);
415 }
416 catch(const exception& error) {
417 FATAL(error.what());
418 }
419 }
420
421 const JModuleRouter router(dynamics ? dynamics->getDetector() : detector);
422
423 NOTICE("Reading PDFs... " << flush);
424
425 const JRegressorStorage_t storage(pdfFile, JTimeRange(parameters.TMin_ns, parameters.TMax_ns), parameters.TTS_ns);
426
427 NOTICE("OK" << endl);
428
429 JRegressor_t::debug = debug;
430 JRegressor_t::Vmax_npe = parameters.VMax_npe;
431 JRegressor_t::MAXIMUM_ITERATIONS = parameters.NMax;
432
433 // preprocess input data
434
435 NOTICE("Reading data" << endl);
436
437 const JBuildL0<JHitL0> buildL0;
438
439 data_type data;
440
441 counter_type skip = inputFile.getLowerLimit();
442 counter_type counter = inputFile.getLowerLimit();
443
444 for (JMultipleFileScanner<>::const_iterator i = inputFile.begin(); i != inputFile.end(); ++i) {
445
446 JSummaryFileRouter summary(*i);
447
448 for (JParallelFileScanner_t in(*i); (skip -= in.skip(skip)) == 0 && in.hasNext() && counter != numberOfEvents; ++counter) {
449
450 STATUS("event: " << setw(10) << counter << '\r'); DEBUG(endl);
451
452 multi_pointer_type ps = in.next();
453
454 const JDAQEvent* tev = ps;
455 JFIT::JEvt* evt = ps;
456
457 summary.update(*tev);
458
459 if (dynamics) {
460 dynamics->update(*tev);
461 }
462
463 JFIT::JEvt::iterator __end = partition(evt->begin(), evt->end(), JHistory::is_application(JMUONGANDALF));
464
465 if (evt->begin() != __end) {
466
467 sort(evt->begin(), __end, qualitySorter);
468
469 vector<JHitL0> dataL0;
470
471 buildL0(*tev, router, true, back_inserter(dataL0));
472
473 const JFIT::JFit& fit = (*evt)[0];
474
475 const JRotation3D R (getDirection(fit));
476 const JLine1Z tz(getPosition (fit).rotate(R), fit.getT());
477 JRange<double> Z_m;
478
479 if (fit.getW(JSTART_LENGTH_METRES, 0.0) > 0.0) {
480 Z_m = JZRange(fit.getW(JSTART_ZMIN_M) + parameters.ZMin_m,
481 fit.getW(JSTART_ZMAX_M) + parameters.ZMax_m);
482 }
483
484 const JFIT::JModel<JLine1Z> match(tz, parameters.roadWidth_m, JTimeRange(parameters.TMin_ns, parameters.TMax_ns), Z_m);
485
486 // hit selection based on start value
487
488 buffer_type buffer;
489
490 for (vector<JHitL0>::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
491
492 const JPMTIdentifier id(i->getModuleID(), i->getPMTAddress());
493
494 const JPMTParameters& wip = pmtParameters.getPMTParameters(id);
495
496 const int type = wip.getType();
497 const double QE = wip.QE;
498 const double R_Hz = summary.getRate(i->getPMTIdentifier(), parameters.R_Hz);
499
500 JHitW0 hit(*i, type, QE, R_Hz);
501
502 hit.rotate(R);
503
504 if (match(hit)) {
505 buffer.push_back(hit);
506 }
507 }
508
509 // select first hit
510
511 sort(buffer.begin(), buffer.end(), JHitL0::compare);
512
513 buffer_type::const_iterator __end = unique(buffer.begin(), buffer.end(), equal_to<JDAQPMTIdentifier>());
514
515 // re-organise data
516
517 map_type map;
518
519 for (buffer_type::const_iterator hit = buffer.begin(); hit != __end; ++hit) {
520
521 const JModule& module = router.getModule(hit->getModuleID());
522 const JTOT_t index = (JTOT_t) range.constrain(hit->getToT());
523
524 if (!strings.empty()) { map[module.getString()].push_back(*hit); }
525 if (!modules.empty()) { map[module.getID()] .push_back(*hit); }
526 if (!indices.empty()) { map[index] .push_back(*hit); }
527 }
528
529 data.push_back({map, tz, true});
530 }
531 }
532 }
533 STATUS(endl);
534 NOTICE("OK" << endl);
535
536
537 // fit
538
539 JGradient fit(number_of_iterations, number_of_extra_steps, epsilon, 3);
540
541 if (strings.count(DEFAULT_ID) != 0) { strings = getStringIDs(detector); }
542 if (modules.count(DEFAULT_ID) != 0) { modules = getModuleIDs(detector); }
543 if (indices.count(DEFAULT_ID) != 0) { indices = getTimeOverThresholdIDs(); }
544
545 for (int id : strings) { fit.push_back(JModifier_t(MAKE_STRING("string: " << FILL(4,'0') << id << FILL()), new JEditor(data, id), T_ns)); }
546 for (int id : modules) { fit.push_back(JModifier_t(MAKE_STRING("module: " << setw(8) << id), new JEditor(data, id), T_ns)); }
547 for (int id : indices) { fit.push_back(JModifier_t(MAKE_STRING("index: " << setw(3) << id), new JEditor(data, id), T_ns)); }
548
549 const JPerth_t perth = {storage, data, threads};
550
551 const double chi2 = fit(perth);
552
553 STATUS("result: " << FIXED(12,6) << chi2 << ' ' << setw(6) << fit.numberOfIterations << endl);
554
555 for (size_t i = 0; i != fit.size(); ++i) {
556 {
557 const JEditor* p = dynamic_cast<const JEditor*>(fit[i].get());
558
559 if (p != NULL) { STATUS(fit[i].name << ' ' << FIXED(9,3) << p->t0 << " [ns]" << endl); }
560 }
561 }
562
563
564 if (!indices.empty()) {
565
566 // solve y = ax + b
567
568 JMatrix2S V;
569 double Y[2] = { 0.0, 0.0 };
570
571 for (size_t i = 0; i != fit.size(); ++i) {
572
573 const JEditor* p = dynamic_cast<const JEditor*>(fit[i].get());
574
575 if (p != NULL) {
576
577 const double x = p->id;
578 const double y = p->t0;
579
580 if (X(x)) {
581
582 V.a00 += x*x; V.a01 += x;
583 V.a10 += x; V.a11 += 1;
584
585 Y[0] += x*y;
586 Y[1] += y;
587 }
588 }
589 }
590
591 try {
592
593 V.invert();
594
595 const double a = V.a00 * Y[0] + V.a01 * Y[1];
596 //const double b = V.a10 * Y[0] + V.a11 * Y[1];
597
598 cout << "// Produced by JPerth.cc; to be included in JTimeSlewing.hh" << endl;
599
600 for (size_t i = 0; i != getTimeSlewing.size(); ++i) {
601
602 const double x = i;
603 const double y = a * (X.constrain(x) - TIME_OVER_THRESHOLD_NS);
604
605 cout << "this->push_back(" << FIXED(6,2) << getTimeSlewing[i] - y << ");" << endl;
606 }
607 }
608 catch(const exception& error) {
609 FATAL(error.what());
610 }
611 }
612
613 if (overwriteDetector) {
614
615 detector.comment.add(JMeta(argc, argv));
616
618
619 for (size_t i = 0; i != fit.size(); ++i) {
620
621 const JEditor* p = dynamic_cast<const JEditor*>(fit[i].get());
622
623 if (p != NULL) {
624 calibration[p->id] = p->t0;
625 }
626 }
627
628 const double t0 = getAverage(get_values(calibration), 0.0);
629
630 for (JDetector::iterator module = detector.begin(); module != detector.end(); ++module) {
631
632 if (!module->empty()) {
633
634 map<int, double>::const_iterator p = (!strings.empty() ? calibration.find(module->getString()) :
635 !modules.empty() ? calibration.find(module->getID()) :
636 calibration.end());
637 if (p != calibration.end()) {
638 for (int pmt = 0; pmt != NUMBER_OF_PMTS; ++pmt) {
639 module->getPMT(pmt).addT0(p->second - t0);
640 }
641 }
642 }
643 }
644
645 NOTICE("Store calibration data on file " << detectorFile << endl);
646
647 store(detectorFile, detector);
648 }
649}
Time calibration (including definition of sign of time offset).
Data structure for detector geometry and calibration.
Dynamic detector calibration.
Auxiliary methods to evaluate Poisson probabilities and chi2.
Basic data structure for L0 hit.
Data regression method for JFIT::JLine3Z.
Base class for data structures with artithmetic capabilities.
General purpose messaging.
#define DEBUG(A)
Message macros.
Definition JMessage.hh:62
#define STATUS(A)
Definition JMessage.hh:63
#define NOTICE(A)
Definition JMessage.hh:64
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:74
ROOT I/O of application specific meta data.
Direct access to module in detector data structure.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Parallel scanning of objects from a single file or multiple files according a format that follows fro...
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
int main(int argc, char **argv)
Definition JPerth.cc:313
#define MAKE_STRING(A)
Make string.
Definition JPrint.hh:63
Utility class to parse parameter values.
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
Auxiliary class to define a range between two values.
ROOT TTree parameter settings of various packages.
Auxiliary methods to convert data members or return values of member methods of a set of objects to a...
Detector data structure.
Definition JDetector.hh:96
int getString() const
Get string number.
Definition JLocation.hh:135
Router for direct addressing of module data in detector data structure.
const JModule & getModule(const JObjectID &id) const
Get module parameters.
Data structure for a composite optical module.
Definition JModule.hh:76
Auxiliary class for map of PMT parameters.
const JPMTParameters & getPMTParameters(const JPMTIdentifier &id) const
Get PMT parameters.
Data structure for PMT parameters.
double QE
relative quantum efficiency
int getType() const
Get type for for time-slewing correction.
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.
Definition JLine1Z.hh:29
static parameter_type pY()
Definition JLine1Z.hh:181
static parameter_type pX()
Definition JLine1Z.hh:180
static parameter_type pT()
Definition JLine1Z.hh:182
Data structure for fit of straight line in positive z-direction.
Definition JLine3Z.hh:40
static parameter_type pDY()
Definition JLine3Z.hh:320
static parameter_type pDX()
Definition JLine3Z.hh:319
JAxis3D & rotate(const JRotation3D &R)
Rotate axis.
Definition JAxis3D.hh:225
General exception.
Definition JException.hh:24
int getID() const
Get identifier.
Definition JObjectID.hh:50
2 x 2 symmetric matrix
Definition JMatrix2S.hh:28
void invert()
Invert matrix.
Definition JMatrix2S.hh:66
Utility class to parse command line options.
Definition JParser.hh:1698
Auxiliary class for a hit with background rate value.
Definition JHitW0.hh:25
General purpose class for object reading from a list of file names.
General purpose class for parallel reading of objects from a single file or multiple files.
File router for fast addressing of summary data.
void update(const JDAQHeader &header)
Update router.
double getRate(const JDAQPMTIdentifier &id) const
Get rate.
Range of values.
Definition JRange.hh:42
T constrain(argument_type x) const
Constrain value to range.
Definition JRange.hh:350
Template L0 hit builder.
Definition JBuildL0.hh:38
Hit data structure.
unsigned char JTOT_t
time over threshold [ns]
Definition JDAQHit.hh:40
const char * map
Definition elog.cc:87
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.
const double TIME_OVER_THRESHOLD_NS
Specification for time-over-threshold corresponding to a one photo-electron pulse.
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.
Definition JMath.hh:494
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
std::vector< JHitW0 > buffer_type
hits
Definition JPerth.cc:74
void copy(const JFIT::JEvt::const_iterator __begin, const JFIT::JEvt::const_iterator __end, Evt &out)
Copy tracks.
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
JLANG::JSTDObjectReader< const event_type > input_type
Definition JPerth.cc:106
std::vector< event_type > data_type
Definition JPerth.cc:105
JFIT::JRegressor< JFIT::JLine3Z, JFIT::JGandalf > JRegressor_t
Definition JPerth.cc:156
std::set< int > getTimeOverThresholdIDs()
Get list of time-over-threshold identifiers.
Definition JPerth.cc:84
JFIT::JRegressorStorage< JFIT::JLine3Z, JFIT::JGandalf > JRegressorStorage_t
Definition JPerth.cc:155
std::map< int, buffer_type > map_type
identifier -> hits
Definition JPerth.cc:75
Long64_t counter_type
Type definition for counter.
JTRIGGER::JTimeSlewing_t getTimeSlewing
Function object to get time-slewing correction.
KM3NeT DAQ data structures and auxiliaries.
Definition DataQueue.cc:39
JRange< int > range_type
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
Definition JDAQ.hh:26
Auxiliary data structure for sequence of same character.
Definition JManip.hh:330
Auxiliary data structure for floating point format specification.
Definition JManip.hh:448
Calibration.
Definition JHead.hh:330
Detector file.
Definition JHead.hh:227
Data structure for measured coincidence rates of all pairs of PMTs in optical module.
Definition JFitK40.hh:103
Dynamic detector calibration.
Definition JDynamics.hh:81
Conjugate gradient fit.
Definition JGradient.hh:75
size_t numberOfIterations
Definition JGradient.hh:273
Auxiliary class to test history.
Definition JHistory.hh:188
Auxiliary class to match data points with given model.
Auxiliary data structure for editable parameter.
Definition JGradient.hh:49
Auxiliary data structure for fit parameter.
Definition JGradient.hh:28
Template data structure for storage of internal data.
Template definition of a data regressor of given model.
Definition JRegressor.hh:70
virtual const pointer_type & next() override
Get next element.
virtual bool hasNext() override
Check availability of next element.
Implementation of object iteration from STD container.
Auxiliary data structure for average.
void put(const double x)
Put value.
void reset()
Reset.
double getMean() const
Get mean value.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition JParser.hh:68
Auxiliary class for editing time offset.
Definition JPerth.cc:114
data_type & data
data
Definition JPerth.cc:149
double t0
time offset [ns]
Definition JPerth.cc:151
JEditor(data_type &data, const int id)
Constructor.
Definition JPerth.cc:121
virtual void apply(const double step) override
Apply step.
Definition JPerth.cc:133
double TMin_ns
minimal time w.r.t. Cherenkov hypothesis [ns]
double TMax_ns
maximal time w.r.t. Cherenkov hypothesis [ns]
double VMax_npe
maximum number of of photo-electrons
Auxiliary data structure for chi2 function object.
Definition JPerth.cc:285
const JRegressorStorage_t & storage
Definition JPerth.cc:299
double operator()(const int option) const
Get chi2.
Definition JPerth.cc:292
const data_type & data
Definition JPerth.cc:300
Thread pool for fits to data.
Definition JPerth.cc:162
std::vector< std::thread > workers
Definition JPerth.cc:269
std::condition_variable cv
Definition JPerth.cc:273
static JMATH::JQuantile_t Q
Definition JPerth.cc:266
~JPerth()
Destructor.
Definition JPerth.cc:249
JPerth(const JRegressorStorage_t &storage, const data_type &data, const size_t ns, const int option)
Constructor.
Definition JPerth.cc:171
Auxiliary data structure to store data and fit in memory.
Definition JPerth.cc:99
Auxiliary class for defining the range of iterations of objects.
Definition JLimit.hh:45
static counter_type max()
Get maximum counter value.
Definition JLimit.hh:128
Auxiliary class for ROOT I/O of application specific meta data.
Definition JMeta.hh:72
Auxiliary data structure for sorting of hits.
Definition JHitL0.hh:85