Jpp 20.0.0-195-g190c9e876
the software that should make you happy
Loading...
Searching...
No Matches
JEvD.cc File Reference

Program to display hit probabilities. More...

#include <string>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <memory>
#include "TROOT.h"
#include "TApplication.h"
#include "TCanvas.h"
#include "TRootCanvas.h"
#include "TStyle.h"
#include "TH2D.h"
#include "TArrow.h"
#include "TLatex.h"
#include "TMarker.h"
#include "km3net-dataformat/offline/Head.hh"
#include "km3net-dataformat/offline/Evt.hh"
#include "km3net-dataformat/online/JDAQ.hh"
#include "km3net-dataformat/tools/time_converter.hh"
#include "JROOT/JStyle.hh"
#include "JROOT/JCanvas.hh"
#include "JROOT/JRootToolkit.hh"
#include "JDAQ/JDAQEventIO.hh"
#include "JDAQ/JDAQSummarysliceIO.hh"
#include "JDetector/JDetector.hh"
#include "JDetector/JDetectorToolkit.hh"
#include "JDetector/JModuleRouter.hh"
#include "JGeometry3D/JCylinder3D.hh"
#include "JDynamics/JDynamics.hh"
#include "JTrigger/JHitL0.hh"
#include "JTrigger/JBuildL0.hh"
#include "JSupport/JSupport.hh"
#include "JSupport/JParallelFileScanner.hh"
#include "JSupport/JSummaryFileRouter.hh"
#include "JSupport/JMonteCarloFileSupportkit.hh"
#include "JAAnet/JAAnetToolkit.hh"
#include "JPhysics/JPDF_t.hh"
#include "JFit/JLine1Z.hh"
#include "JFit/JModel.hh"
#include "JReconstruction/JHitW0.hh"
#include "JReconstruction/JEvt.hh"
#include "JReconstruction/JEvtToolkit.hh"
#include "JReconstruction/JMuonGandalfParameters_t.hh"
#include "JReconstruction/JEventSelector.hh"
#include "JLang/JPredicate.hh"
#include "JLang/JComparator.hh"
#include "JMath/JMathToolkit.hh"
#include "JSystem/JKeypress.hh"
#include "JSystem/JProcess.hh"
#include "Jeep/JFunctionAdaptor.hh"
#include "Jeep/JProperties.hh"
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Program to display hit probabilities.

Author
mdejong

Definition in file JReconstruction/JEvD.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 108 of file JReconstruction/JEvD.cc.

109{
110 using namespace std;
111 using namespace JPP;
112 using namespace KM3NETDAQ;
113
115 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
116 typedef JMultipleFileScanner<calibration_types> JCalibration_t;
117
118 JParallelFileScanner_t inputFile;
119 JLimit_t& numberOfEvents = inputFile.getLimit();
120 string detectorFile;
121 JCalibration_t calibrationFile;
122 double Tmax_s;
123 string pdfFile;
124 string outputFile;
125 JMuonGandalfParameters_t parameters;
126 int application;
127 JEventSelector event_selector;
128 JCanvas canvas;
129 bool batch;
130 struct : JStyle::JParameters {
131 double arrowSize = 0.003;
132 string arrowType = "|->";
133 double arrowScale = 250.0;
134 Width_t lineWidth = 2;
135 Style_t lineStyle = 1;
136 int nbinsX = 50;
137 int nbinsY = 250;
138 double T_ns = 0.0;
139 bool equalize = false;
140 } graphics;
141 string option;
142 int debug;
143
144
145 try {
146
147 JProperties properties = graphics.getProperties();
148
149 properties.insert(gmake_property(graphics.arrowSize));
150 properties.insert(gmake_property(graphics.arrowType));
151 properties.insert(gmake_property(graphics.arrowScale));
152 properties.insert(gmake_property(graphics.lineWidth));
153 properties.insert(gmake_property(graphics.lineStyle));
154 properties.insert(gmake_property(graphics.T_ns));
155 properties.insert(gmake_property(graphics.equalize));
156
157 parameters.numberOfPrefits = 1;
158
159 JParser<> zap("Program to display hit probabilities.");
160
161 zap['w'] = make_field(canvas, "size of canvas <nx>x<ny> [pixels]") = JCanvas(1200, 600);
162 zap['f'] = make_field(inputFile, "input file (output of JXXXMuonReconstruction.sh)");
163 zap['a'] = make_field(detectorFile);
164 zap['+'] = make_field(calibrationFile) = JPARSER::initialised();
165 zap['T'] = make_field(Tmax_s) = 100.0;
166 zap['n'] = make_field(numberOfEvents) = JLimit::max();
167 zap['F'] = make_field(pdfFile);
168 zap['o'] = make_field(outputFile, "graphics output file name") = MAKE_STRING("display_" << WILDCARD << ".gif");
169 zap['@'] = make_field(parameters) = JPARSER::initialised();
170 zap['A'] = make_field(application) = JMUONGANDALF, JMUONENERGY, JMUONSTART;
171 zap['L'] = make_field(event_selector) = JPARSER::initialised();
172 zap['%'] = make_field(properties) = JPARSER::initialised();
173 zap['O'] = make_field(option, "draw option") = arrow_t, histogram_t;
174 zap['B'] = make_field(batch, "batch processing");
175 zap['d'] = make_field(debug) = 1;
176
177 zap(argc, argv);
178 }
179 catch(const exception& error) {
180 FATAL(error.what() << endl);
181 }
182
183 if (batch && outputFile == "") {
184 FATAL("Missing output file name " << outputFile << " in batch mode." << endl);
185 }
186
187 if (!batch && outputFile == "") {
188 outputFile = MAKE_STRING(WILDCARD << ".gif");
189 }
190
191 if (outputFile.find(WILDCARD) == string::npos) {
192 FATAL("Output file name " << outputFile << " has no wild card '" << WILDCARD << "'" << endl);
193 }
194
195
197
198 try {
199 load(detectorFile, detector);
200 }
201 catch(const JException& error) {
202 FATAL(error);
203 }
204 unique_ptr<JDynamics> dynamics;
205
206 try {
207
208 dynamics.reset(new JDynamics(detector, Tmax_s));
209
210 dynamics->load(calibrationFile);
211 }
212 catch(const exception& error) {
213 if (!calibrationFile.empty()) {
214 FATAL(error.what());
215 }
216 }
217
218 const double Zbed = 0.0;
219
220 JCylinder3D cylinder(detector.begin(), detector.end());
221
222 cylinder.addMargin(parameters.roadWidth_m);
223
224 if (cylinder.getZmin() < Zbed) {
225 cylinder.setZmin(Zbed);
226 }
227
228 const JModuleRouter router(dynamics ? dynamics->getDetector() : detector);
229
230 JSummaryFileRouter summary(inputFile);
231
232 const JMuonPDF_t pdf(pdfFile, parameters.TTS_ns);
233
234 const JTimeRange T_ns(parameters.TMin_ns, parameters.TMax_ns);
235
236 typedef vector<JHitL0> JDataL0_t;
237 typedef vector<JHitW0> JDataW0_t;
238
239 const JBuildL0<JHitL0> buildL0;
240
241
242 Vec offset(0.0, 0.0, 0.0);
243
244 try {
245 offset = getOffset(getHeader(inputFile));
246 } catch(const exception& error) {}
247
248 NOTICE("Offset applied to true tracks is: " << offset << endl);
249
250
251 // ROOT
252
253 gROOT->SetBatch(batch);
254
255 TApplication* tp = new TApplication("user", NULL, NULL);
256 TCanvas* cv = new TCanvas("display", "", canvas.x, canvas.y);
257
258 if (!batch) {
259 ((TRootCanvas *) cv->GetCanvasImp())->Connect("CloseWindow()", "TApplication", tp, "Terminate()");
260 }
261
262 unique_ptr<TStyle> gStyle(new JStyle("gplot", cv->GetWw(), cv->GetWh(), graphics));
263
264 gROOT->SetStyle("gplot");
265 gROOT->ForceStyle();
266
267 const size_t NUMBER_OF_PADS = 3;
268
269 cv->SetFillStyle(4000);
270 cv->SetFillColor(kWhite);
271
272 TPad* p1 = new TPad("p1", NULL, 0.0, 0.00, 1.0, 0.95);
273 TPad* p2 = new TPad("p2", NULL, 0.0, 0.95, 1.0, 1.00);
274
275 p1->Divide(NUMBER_OF_PADS, 1);
276
277 p1->Draw();
278 p2->Draw();
279
280 const double Dmax = getMaximalDistance(detector);
281 const double Rmin = 0.0;
282 const double Rmax = min(parameters.roadWidth_m, 0.4 * Dmax);
283 const double Tmin = min(parameters.TMin_ns, -10.0);
284 const double Tmax = max(parameters.TMax_ns, +100.0);
285 const double Amin = 0.002 * (Tmax - Tmin); // minimal arrow length [ns]
286 const double Amax = 0.8 * (Tmax - Tmin); // maximal arrow length [ns]
287 const double ymin = Tmin - (option == arrow_t ? 0.2 * Amax : 0.0);
288 const double ymax = Tmax + (option == arrow_t ? 0.5 * Amax : 0.0);
289
290 const string Xlabel[NUMBER_OF_PADS] = { "R [m]", "#phi [rad]", "z [m]" };
291 const double Xmin [NUMBER_OF_PADS] = { Rmin, -PI, -0.4 * Dmax };
292 const double Xmax [NUMBER_OF_PADS] = { Rmax, +PI, +0.4 * Dmax };
293
294 double Xs[NUMBER_OF_PADS];
295
296 for (size_t i = 0; i != NUMBER_OF_PADS; ++i) {
297 Xs[i] = 0.003 * (Xmax[i] - Xmin[i]) * (0.5 * NUMBER_OF_PMTS); // x-offset arrow as function of PMT number
298 }
299
300 TH2D H2[NUMBER_OF_PADS];
301 TGraph G2[NUMBER_OF_PADS];
302
303 for (size_t i = 0; i != NUMBER_OF_PADS; ++i) {
304
305 H2[i] = TH2D(MAKE_CSTRING("h" << i), NULL, graphics.nbinsX, Xmin[i] - Xs[i], Xmax[i] + Xs[i], graphics.nbinsY, ymin, ymax);
306
307 H2[i].GetXaxis()->SetTitle(Xlabel[i].c_str());
308 H2[i].GetYaxis()->SetTitle("#Deltat [ns]");
309
310 H2[i].GetXaxis()->CenterTitle(true);
311 H2[i].GetYaxis()->CenterTitle(true);
312
313 H2[i].SetStats(kFALSE);
314
315 G2[i].Set(2);
316
317 G2[i].SetPoint(0, H2[i].GetXaxis()->GetXmin(), 0.0);
318 G2[i].SetPoint(1, H2[i].GetXaxis()->GetXmax(), 0.0);
319
320 p1->cd(i+1);
321
322 H2[i].Draw("AXIS");
323 G2[i].Draw("SAME");
324 }
325
326
327 for (JTreeScanner<Evt> mc(inputFile); inputFile.hasNext(); ) {
328
329 cout << "event: " << setw(8) << inputFile.getCounter() << endl;
330
331 multi_pointer_type ps = inputFile.next();
332
333 JDAQEvent* tev = ps;
334 JFIT::JEvt* in = ps;
335 Evt* event = NULL;
336
337 if (dynamics) {
338 dynamics->update(*tev);
339 }
340
341 if (mc.getEntries() != 0) {
342 event = mc.getEntry(tev->getCounter()); // Monte Carlo true information
343 }
344
345 in->select(JHistory::is_application(application));
346
347 if (!in->empty()) {
348
349 sort(in->begin(), in->end(), qualitySorter);
350
351 if (!event_selector(*tev, *in, event)) {
352 continue;
353 }
354
355
356 JDataL0_t dataL0;
357
358 buildL0(*tev, router, true, back_inserter(dataL0));
359
360 summary.update(*tev);
361
362 JFIT::JFit muon; // Monte Carlo true muon
363
364 if (event != NULL) {
365
366 const time_converter converter = time_converter(*event, *tev);
367
368 for (const auto& t1 : event->mc_trks) {
369 if (is_muon(t1)) {
370 if (t1.E > muon.getE()) {
371
372 JTrack3E ta = getTrack(t1);
373
374 ta.add(getPosition(offset));
375 ta.add(converter.putTime());
376
377 muon = getFit(0, ta, 0.0, 0, t1.E, 1);
378
379 muon.setW(JSTART_LENGTH_METRES, fabs(t1.len));
380 }
381 }
382 }
383 }
384
385 bool monte_carlo = false; // show Monte Carlo true muon
386 size_t index = 0; // index of fit
387
388 for (bool next = false; !next; ) {
389
390 for (size_t i = 0; i != NUMBER_OF_PADS; ++i) {
391 H2[i].Reset();
392 }
393
394 JFIT::JFit fit;
395
396 if (!monte_carlo)
397 fit = (*in)[index];
398 else
399 fit = muon;
400
401 JRotation3D R (getDirection(fit));
402 JLine1Z tz(getPosition (fit).rotate(R), fit.getT());
403 JRange<double> Z_m;
404 /*
405 if (fit.hasW(JSTART_LENGTH_METRES)) {
406 Z_m = JRange<double>(0.0, fit.getW(JSTART_LENGTH_METRES)) + JRange<double>(parameters.ZMin_m, parameters.ZMax_m);
407 }
408 */
409 const JFIT::JModel<JLine1Z> match(tz, parameters.roadWidth_m, T_ns, Z_m);
410
411 // hit selection based on fit result
412
413 JDataW0_t data;
414
415 for (JDataL0_t::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
416
417 const int type = 0;
418 const double QE = 1.0;
419 const double R_Hz = summary.getRate(i->getPMTIdentifier(), parameters.R_Hz);
420
421 JHitW0 hit(*i, type, QE, R_Hz);
422
423 hit.rotate(R);
424
425 if (match(hit)) {
426 data.push_back(hit);
427 }
428 }
429
430 // select first hit in PMT
431
432 sort(data.begin(), data.end(), JHitW0::compare);
433
434 JDataW0_t::iterator __end = unique(data.begin(), data.end(), equal_to<JDAQPMTIdentifier>());
435
436 double E_GeV = parameters.E_GeV;
437 /*
438 if (fit.getE() > 0.1) {
439 E_GeV = fit.getE();
440 }
441 */
442
443 // move fit to geometrical center of hits
444
446
447 for (JDataW0_t::iterator hit = data.begin(); hit != __end; ++hit) {
448
449 const double x = hit->getX() - tz.getX();
450 const double y = hit->getY() - tz.getY();
451 const double z = hit->getZ();
452 const double R = sqrt(x*x + y*y);
453
454 zs.include(z - R/getTanThetaC());
455 }
456
457 const double z0 = tz.getZ();
458 const double z1 = 0.5 * (zs.getLowerLimit() + zs.getUpperLimit());
459
460 tz.setZ(z1, getSpeedOfLight());
461
462 // graphics
463
464 ostringstream os;
465 vector<TArrow> arrow [NUMBER_OF_PADS];
466 vector<TMarker> marker[NUMBER_OF_PADS];
467
468 if (fit.hasW(JSTART_LENGTH_METRES) && fit.getW(JSTART_LENGTH_METRES) > 0.0) {
469
470 marker[2].push_back(TMarker(z0 - tz.getZ(), 0.0, kFullCircle));
471 marker[2].push_back(TMarker(z0 - tz.getZ() + fit.getW(JSTART_LENGTH_METRES), 0.0, kFullCircle));
472
473 static_cast<TAttMarker&>(marker[2][0]) = TAttMarker(kRed, kFullCircle, 0.7);
474 static_cast<TAttMarker&>(marker[2][1]) = TAttMarker(kRed, kFullCircle, 0.7);
475 }
476
477 DEBUG("trk: "
478 << FIXED(7,2) << tz.getX() << ' '
479 << FIXED(7,2) << tz.getY() << ' '
480 << FIXED(7,2) << tz.getZ() << ' '
481 << FIXED(12,2) << tz.getT() << endl);
482
483 double chi2 = 0;
484
485 for (JDataW0_t::const_iterator hit = data.begin(); hit != __end; ++hit) {
486
487 const double x = hit->getX() - tz.getX();
488 const double y = hit->getY() - tz.getY();
489 const double z = hit->getZ() - tz.getZ();
490 const double R = sqrt(x*x + y*y);
491
492 const double t1 = tz.getT() + (z + R * getTanThetaC()) * getInverseSpeedOfLight();
493
494 JDirection3D dir(hit->getDX(), hit->getDY(), hit->getDZ()); // PMT orientation
495
496 dir.rotate(JRotation3Z(-atan2(y,x))); // rotate PMT axis to x-z plane
497
498 const double theta = dir.getTheta();
499 const double phi = fabs(dir.getPhi()); // rotational symmetry of Cherenkov cone
500
501 //const double E = gWater.getE(E_GeV, z); // correct for energy loss
502 const double E = E_GeV;
503 const double dt = T_ns.constrain(hit->getT() - t1);
504
505 JMuonPDF_t::result_type H1 = pdf.calculate(E, R, theta, phi, dt);
506 JMuonPDF_t::result_type H0(hit->getR() * 1e-9, 0.0, T_ns);
507
508 if (H1.V >= parameters.VMax_npe) {
509 H1 *= parameters.VMax_npe / H1.V;
510 }
511
512 H1 += H0; // signal + background
513
514 chi2 += H1.getChi2() - H0.getChi2();
515
516 DEBUG("hit: "
517 << setw(8) << hit->getModuleID() << '.' << FILL(2,'0') << (int) hit->getPMTAddress() << FILL() << ' '
518 << SCIENTIFIC(8,2) << E << ' '
519 << FIXED(7,2) << R << ' '
520 << FIXED(7,4) << theta << ' '
521 << FIXED(7,4) << phi << ' '
522 << FIXED(7,3) << dt << ' '
523 << FIXED(7,3) << H1.getChi2() << ' '
524 << FIXED(7,3) << H0.getChi2() << endl);
525
526 const double derivative = H1.getDerivativeOfChi2() - H0.getDerivativeOfChi2();
527
528 double size = derivative * graphics.arrowScale; // size of arrow
529
530 if (fabs(size) < Amin) {
531 size = (size > 0.0 ? +Amin : -Amin);
532 } else if (fabs(size) > Amax) {
533 size = (size > 0.0 ? +Amax : -Amax);
534 }
535
536 const double X[NUMBER_OF_PADS] = { R, atan2(y,x), z - R/getTanThetaC() };
537
538 const double xs = (double) (NUMBER_OF_PMTS - 2 * hit->getPMTAddress()) / (double) NUMBER_OF_PMTS;
539
540 for (size_t i = 0; i != NUMBER_OF_PADS; ++i) {
541
542 TArrow a1(X[i] + xs*Xs[i], dt + graphics.T_ns, X[i] + xs*Xs[i], dt + graphics.T_ns + size, graphics.arrowSize, graphics.arrowType.c_str());
543
544 a1.SetLineWidth(graphics.lineWidth);
545 a1.SetLineStyle(graphics.lineStyle);
546
547 arrow[i].push_back(a1);
548
549 H2[i].Fill(X[i], dt + graphics.T_ns);
550 }
551 }
552
553 if (graphics.equalize) {
554
555 double zmax = 0.0;
556
557 for (size_t i = 0; i != NUMBER_OF_PADS; ++i) {
558 if (H2[i].GetMaximum() > zmax) {
559 zmax = H2[i].GetMaximum();
560 }
561 }
562
563 zmax *= 1.2;
564
565 for (size_t i = 0; i != NUMBER_OF_PADS; ++i) {
566 H2[i].SetMaximum(zmax);
567 }
568 }
569
570 os << FILL(6,'0') << tev->getRunNumber() << ":" << tev->getFrameIndex() << "/" << tev->getCounter() << FILL();
571 os << " Q = " << FIXED(4,0) << fit.getQ()
572 << '/' << FIXED(4,0) << -chi2;
573 os << " E = " << SCIENTIFIC(7,1) << fit.getE() << " [GeV]";
574 os << " cos(#theta) = " << FIXED(6,3) << fit.getDZ();
575 os << " L = " << FIXED(6,2) << fit.getW(JSTART_LENGTH_METRES, 0.0) << " [m]";
576
577 if (monte_carlo)
578 os << " Monte Carlo";
579 else if (muon.getStatus() >= 0)
580 os << " #Delta#alpha = " << FIXED(6,2) << getAngle(getDirection(muon), getDirection(fit)) << " [deg]";
581
582
583 // draw
584
585 TLatex title(0.05, 0.5, os.str().c_str());
586
587 title.SetTextAlign(12);
588 title.SetTextFont(42);
589 title.SetTextSize(0.6);
590
591 p2->cd();
592
593 title.Draw();
594
595 for (int i = 0; i != NUMBER_OF_PADS; ++i) {
596
597 p1->cd(i+1);
598
599 if (option == arrow_t) {
600
601 for (auto& a1 : arrow[i]) {
602 a1.Draw();
603 }
604
605 for (auto& m1 : marker[i]) {
606 m1.Draw();
607 }
608 }
609
610 if (option == histogram_t) {
611 H2[i].Draw("SAME");
612 }
613 }
614
615 cv->Update();
616
617
618 // action
619
620 if (batch) {
621
622 cv->SaveAs(replace(outputFile, WILDCARD, MAKE_STRING(inputFile.getCounter())).c_str());
623
624 next = true;
625
626 } else {
627
628 static int count = 0;
629
630 if (count++ == 0) {
631 cout << endl << "Type '?' for possible options." << endl;
632 }
633
634 for (bool user = true; user; ) {
635
636 JAxis3D ts(getAxis(fit));
637
638 const JCylinder3D::intersection_type intersection = cylinder.getIntersection(ts);
639
640 ts.move(intersection.first);
641
642 cout << "\n> " << flush;
643
644 switch (JKeypress(true).get()) {
645
646 case '?':
647 cout << endl;
648 cout << "possible options: " << endl;
649 cout << 'p' << " -> " << "print information" << endl;
650 cout << 'q' << " -> " << "exit application" << endl;
651 cout << 'u' << " -> " << "update canvas" << endl;
652 cout << 's' << " -> " << "save graphics to file" << endl;
653 cout << '+' << " -> " << "next fit" << endl;
654 cout << '-' << " -> " << "previous fit" << endl;
655 cout << 'M' << " -> " << "Monte Carlo true muon information" << endl;
656 cout << 'F' << " -> " << "fit information" << endl;
657 if (event_selector.is_valid()) {
658 cout << 'L' << " -> " << "reload event selector" << endl;
659 }
660 cout << 'r' << " -> " << "rewind input file" << endl;
661 cout << 'R' << " -> " << "switch to ROOT mode (quit ROOT to continue)" << endl;
662 cout << ' ' << " -> " << "next event (as well as any other key)" << endl;
663 break;
664
665 case 'p':
666
667 cout << endl;
668 cout << "intersection: " << FIXED(6,1) << intersection.first << ' '<< FIXED(6,1) << intersection.second << endl;
669 cout << "entry point: "
670 << FIXED(6,1) << ts.getX() - cylinder.getX() << ' '
671 << FIXED(6,1) << ts.getY() - cylinder.getY() << ' '
672 << FIXED(6,1) << ts.getZ() << endl;
673 for (const auto& i : getWeight) {
674 cout << LEFT(32) << i.first << RIGHT(1) << ' ' << FIXED(12,5) << getWeight(fit, i.first, 0.0) << endl;
675 }
676 break;
677
678 case 'q':
679 cout << endl;
680 return 0;
681
682 case 'u':
683 cv->Update();
684 break;
685
686 case 's':
687 cv->SaveAs(replace(outputFile, WILDCARD, MAKE_STRING(inputFile.getCounter())).c_str());
688 break;
689
690 case '+':
691 monte_carlo = false;
692 index = (index != in->size() - 1 ? index + 1 : 0);
693 user = false;
694 break;
695
696 case '-':
697 monte_carlo = false;
698 index = (index != 0 ? index - 1 : in->size() - 1);
699 user = false;
700 break;
701
702 case 'M':
703 if (muon.getStatus() >= 0)
704 monte_carlo = true;
705 else
706 ERROR(endl << "No Monte Carlo muon available." << endl);
707 user = false;
708 break;
709
710 case 'F':
711 monte_carlo = false;
712 user = false;
713 break;
714
715 case 'L':
716 if (event_selector.is_valid()) {
717 execute(MAKE_STRING("make -f " << getPath(argv[0]) << "/JMakeEventSelector libs"), 3);
718 event_selector.reload();
719 }
720 break;
721
722 case 'R':
723 tp->Run(kTRUE);
724 break;
725
726 case 'r':
727 inputFile.rewind();
728
729 default:
730 next = true;
731 user = false;
732 break;
733 }
734 }
735 }
736 }
737 }
738 }
739 cout << endl;
740}
string outputFile
TPaveText * p1
#define DEBUG(A)
Message macros.
Definition JMessage.hh:62
#define NOTICE(A)
Definition JMessage.hh:64
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:74
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
#define MAKE_CSTRING(A)
Make C-string.
Definition JPrint.hh:72
#define MAKE_STRING(A)
Make string.
Definition JPrint.hh:63
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
Detector data structure.
Definition JDetector.hh:96
Router for direct addressing of module data in detector data structure.
Utility class to parse parameter values.
Data structure for set of track fit results.
void select(const JSelector_t &selector)
Select fits.
Data structure for track fit results with history and optional associated values.
void setW(const std::vector< double > &W)
Set associated values.
double getDZ() const
Get Z-slope.
double getE() const
Get energy.
int getStatus() const
Get status of the fit; negative values should refer to a bad fit.
double getQ() const
Get quality.
const std::vector< double > & getW() const
Get associated values.
double getT() const
Get time.
bool hasW(const int i) const
Check availability of value.
Data structure for fit of straight line paralel to z-axis.
Definition JLine1Z.hh:29
Axis object.
Definition JAxis3D.hh:41
Data structure for direction in three dimensions.
Rotation around Z-axis.
JTime & add(const JTime &value)
Addition operator.
3D track with energy.
Definition JTrack3E.hh:34
General exception.
Definition JException.hh:24
Utility class to parse command line options.
Definition JParser.hh:1698
Auxiliary class for a hit with background rate value.
Definition JHitW0.hh:25
Data structure for size of TCanvas.
Definition JCanvas.hh:26
int y
number of pixels in Y
Definition JCanvas.hh:99
int x
number of pixels in X
Definition JCanvas.hh:98
Wrapper class around ROOT TStyle.
Definition JStyle.hh:24
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.
Object reading from a list of files.
File router for fast addressing of summary data.
Template definition for direct access of elements in ROOT TChain.
Enable unbuffered terminal input.
Definition JKeypress.hh:32
static JRange< T, JComparator_t > DEFAULT_RANGE()
Default range.
Definition JRange.hh:555
range_type & include(argument_type x)
Include given value to range.
Definition JRange.hh:397
T getLowerLimit() const
Get lower limit.
Definition JRange.hh:202
T getUpperLimit() const
Get upper limit.
Definition JRange.hh:213
Template L0 hit builder.
Definition JBuildL0.hh:38
int getRunNumber() const
Get run number.
int getFrameIndex() const
Get frame index.
JTriggerCounter_t getCounter() const
Get trigger counter.
Auxiliary class to convert DAQ hit time to/from Monte Carlo hit time.
double putTime() const
Get Monte Carlo time minus DAQ/trigger time.
static const int JSTART_LENGTH_METRES
distance between projected positions on the track of optical modules for which the response does not ...
JAxis3D getAxis(const Trk &track)
Get axis.
JDirection3D getDirection(const Vec &dir)
Get direction.
JTrack3E getTrack(const Trk &track)
Get track.
JPosition3D getPosition(const Vec &pos)
Get position.
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
Vec getOffset(const JHead &header)
Get offset.
JFit getFit(const int id, const JMODEL::JString &string)
Get fit parameters of string.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
double getMaximalDistance(const JDetector &detector, const bool option=false)
Get maximal distance between modules in detector.
std::string getPath(const std::string &file_name)
Get path, i.e. part before last JEEP::PATHNAME_SEPARATOR if any.
double getAngle(const JQuaternion3D &first, const JQuaternion3D &second)
Get space angle between quanternions.
std::string replace(const std::string &input, const std::string &target, const std::string &replacement)
Replace tokens in string.
@ LEFT
Definition JTwosome.hh:18
@ RIGHT
Definition JTwosome.hh:18
static const double PI
Mathematical constants.
const double getInverseSpeedOfLight()
Get inverse speed of light.
double getTanThetaC()
Get average tangent of Cherenkov angle of water corresponding to group velocity.
const double getSpeedOfLight()
Get speed of light.
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.
JRECONSTRUCTION::JWeight getWeight
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
KM3NeT DAQ data structures and auxiliaries.
Definition DataQueue.cc:39
static const char WILDCARD
Definition JDAQTags.hh:56
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition Evt.hh:21
Auxiliary data structure for sequence of same character.
Definition JManip.hh:330
Auxiliary data structure for floating point format specification.
Definition JManip.hh:448
Detector file.
Definition JHead.hh:227
Dynamic detector calibration.
Definition JDynamics.hh:81
bool is_valid() const
Check validity of function.
void reload()
Reload function from shared library.
Auxiliary class to test history.
Definition JHistory.hh:188
Auxiliary class to match data points with given model.
Auxiliary data structure for muon PDF.
Definition JPDF_t.hh:135
JFunction1D_t::result_type result_type
Definition JPDF_t.hh:145
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition JParser.hh:68
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 class for defining the range of iterations of objects.
Definition JLimit.hh:45
const JLimit & getLimit() const
Get limit.
Definition JLimit.hh:84
static counter_type max()
Get maximum counter value.
Definition JLimit.hh:128
Auxiliary data structure for floating point format specification.
Definition JManip.hh:488
The Vec class is a straightforward 3-d vector, which also works in pyroot.
Definition Vec.hh:13