Jpp 21.0.0-rc.1
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/online/JDAQHeader.hh"
#include "km3net-dataformat/tools/time_converter.hh"
#include "JROOT/JStyle.hh"
#include "JROOT/JCanvas.hh"
#include "JROOT/JRootToolkit.hh"
#include "JDAQ/JDAQSummarysliceIO.hh"
#include "JTrigger/JHitL0.hh"
#include "JSupport/JSupport.hh"
#include "JSupport/JSingleFileScanner.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/JMuonGandalfParameters_t.hh"
#include "JReconstruction/JEvtToolkit.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.

Classes

struct  JAANET::JEventSelector
 Event selector. More...
 

Namespaces

namespace  JAANET
 Extensions to Evt data format.
 

Functions

bool JAANET::hasW (const Trk &trk, const int i)
 Check availability of value.
 
double JAANET::getW (const Trk &trk, const int i)
 Get associated value.
 
double JAANET::getW (const Trk &trk, const int i, const double value)
 Get associated value.
 
void JAANET::setW (Trk &trk, const int i, const double value)
 Set associated value.
 
int main (int argc, char **argv)
 

Detailed Description

Program to display hit probabilities.

Author
mdejong

Definition in file JAAnet/JEvD.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 196 of file JAAnet/JEvD.cc.

197{
198 using namespace std;
199 using namespace JPP;
200 using namespace KM3NETDAQ;
201
202 JSingleFileScanner<Evt> inputFile;
203 JLimit_t& numberOfEvents = inputFile.getLimit();
204 string pdfFile;
205 string outputFile;
206 JMuonGandalfParameters_t parameters;
207 int application;
208 JEventSelector event_selector;
209 JCanvas canvas;
210 bool batch;
211 struct : JStyle::JParameters {
212 double arrowSize = 0.003;
213 string arrowType = "|->";
214 double arrowScale = 250.0;
215 Width_t lineWidth = 2;
216 Style_t lineStyle = 1;
217 int nbinsX = 50;
218 int nbinsY = 250;
219 double T_ns = 0.0;
220 bool equalize = false;
221 } graphics;
222 vector<string> keys;
223 string option;
224 int debug;
225
226
227 try {
228
229 JProperties properties = graphics.getProperties();
230
231 properties.insert(gmake_property(graphics.arrowSize));
232 properties.insert(gmake_property(graphics.arrowType));
233 properties.insert(gmake_property(graphics.arrowScale));
234 properties.insert(gmake_property(graphics.lineWidth));
235 properties.insert(gmake_property(graphics.lineStyle));
236 properties.insert(gmake_property(graphics.T_ns));
237 properties.insert(gmake_property(graphics.equalize));
238
239 parameters.numberOfPrefits = 1;
240
241 JParser<> zap("Program to display hit probabilities.");
242
243 zap['w'] = make_field(canvas, "size of canvas <nx>x<ny> [pixels]") = JCanvas(1200, 600);
244 zap['f'] = make_field(inputFile, "input file (output of JXXXMuonReconstruction.sh)");
245 zap['n'] = make_field(numberOfEvents) = JLimit::max();
246 zap['F'] = make_field(pdfFile);
247 zap['o'] = make_field(outputFile, "graphics output file name") = MAKE_STRING("display_" << WILDCARD << ".gif");
248 zap['@'] = make_field(parameters) = JPARSER::initialised();
250 zap['L'] = make_field(event_selector) = JPARSER::initialised();
251 zap['%'] = make_field(properties) = JPARSER::initialised();
252 zap['k'] = make_field(keys, "display optional weights: " << get_keys(getWeight)) = JPARSER::initialised();
253 zap['O'] = make_field(option, "draw option") = arrow_t, histogram_t;
254 zap['B'] = make_field(batch, "batch processing");
255 zap['d'] = make_field(debug) = 1;
256
257 zap(argc, argv);
258 }
259 catch(const exception& error) {
260 FATAL(error.what() << endl);
261 }
262
263 if (batch && outputFile == "") {
264 FATAL("Missing output file name " << outputFile << " in batch mode." << endl);
265 }
266
267 if (!batch && outputFile == "") {
268 outputFile = MAKE_STRING(WILDCARD << ".gif");
269 }
270
271 if (outputFile.find(WILDCARD) == string::npos) {
272 FATAL("Output file name " << outputFile << " has no wild card '" << WILDCARD << "'" << endl);
273 }
274
275 JHit::setSlewing(false);
276
277 JSummaryFileRouter summary(inputFile);
278
279 const JMuonPDF_t pdf(pdfFile, parameters.TTS_ns);
280
281 const JTimeRange T_ns(parameters.TMin_ns, parameters.TMax_ns);
282
283 typedef vector<JHitL0> JDataL0_t;
284 typedef vector<JHitW0> JDataW0_t;
285
286
287 // ROOT
288
289 gROOT->SetBatch(batch);
290
291 TApplication* tp = new TApplication("user", NULL, NULL);
292 TCanvas* cv = new TCanvas("display", "", canvas.x, canvas.y);
293
294 if (!batch) {
295 ((TRootCanvas *) cv->GetCanvasImp())->Connect("CloseWindow()", "TApplication", tp, "Terminate()");
296 }
297
298 unique_ptr<TStyle> gStyle(new JStyle("gplot", cv->GetWw(), cv->GetWh(), graphics));
299
300 gROOT->SetStyle("gplot");
301 gROOT->ForceStyle();
302
303 const size_t NUMBER_OF_PADS = 3;
304
305 cv->SetFillStyle(4000);
306 cv->SetFillColor(kWhite);
307
308 TPad* p1 = new TPad("p1", NULL, 0.0, 0.00, 1.0, 0.95);
309 TPad* p2 = new TPad("p2", NULL, 0.0, 0.95, 1.0, 1.00);
310
311 p1->Divide(NUMBER_OF_PADS, 1);
312
313 p1->Draw();
314 p2->Draw();
315
316 const double Dmax = 1000.0;
317 const double Rmin = 0.0;
318 const double Rmax = min(parameters.roadWidth_m, 0.4 * Dmax);
319 const double Tmin = min(parameters.TMin_ns, -10.0);
320 const double Tmax = max(parameters.TMax_ns, +100.0);
321 const double Amin = 0.002 * (Tmax - Tmin); // minimal arrow length [ns]
322 const double Amax = 0.8 * (Tmax - Tmin); // maximal arrow length [ns]
323 const double ymin = Tmin - (option == arrow_t ? 0.2 * Amax : 0.0);
324 const double ymax = Tmax + (option == arrow_t ? 0.5 * Amax : 0.0);
325
326 const string Xlabel[NUMBER_OF_PADS] = { "R [m]", "#phi [rad]", "z [m]" };
327 const double Xmin [NUMBER_OF_PADS] = { Rmin, -PI, -0.4 * Dmax };
328 const double Xmax [NUMBER_OF_PADS] = { Rmax, +PI, +0.4 * Dmax };
329
330 double Xs[NUMBER_OF_PADS];
331
332 for (size_t i = 0; i != NUMBER_OF_PADS; ++i) {
333 Xs[i] = 0.003 * (Xmax[i] - Xmin[i]) * (0.5 * NUMBER_OF_PMTS); // x-offset arrow as function of PMT number
334 }
335
336 TH2D H2[NUMBER_OF_PADS];
337 TGraph G2[NUMBER_OF_PADS];
338
339 for (size_t i = 0; i != NUMBER_OF_PADS; ++i) {
340
341 H2[i] = TH2D(MAKE_CSTRING("h" << i), NULL, graphics.nbinsX, Xmin[i] - Xs[i], Xmax[i] + Xs[i], graphics.nbinsY, ymin, ymax);
342
343 H2[i].GetXaxis()->SetTitle(Xlabel[i].c_str());
344 H2[i].GetYaxis()->SetTitle("#Deltat [ns]");
345
346 H2[i].GetXaxis()->CenterTitle(true);
347 H2[i].GetYaxis()->CenterTitle(true);
348
349 H2[i].SetStats(kFALSE);
350
351 G2[i].Set(2);
352
353 G2[i].SetPoint(0, H2[i].GetXaxis()->GetXmin(), 0.0);
354 G2[i].SetPoint(1, H2[i].GetXaxis()->GetXmax(), 0.0);
355
356 p1->cd(i+1);
357
358 H2[i].Draw("AXIS");
359 G2[i].Draw("SAME");
360 }
361
362
363 while (inputFile.hasNext()) {
364
365 cout << "event: " << setw(8) << inputFile.getCounter() << '\r';
366
367 const Evt* evt = inputFile.next();
368
370
372
373 if (!event_selector(fit, *evt)) {
374 continue;
375 }
376
377 JDataL0_t dataL0;
378
379 for (const Hit& hit : evt->hits) {
380 dataL0.push_back(JHitL0(JDAQPMTIdentifier(hit.dom_id, hit.channel_id),
382 JHit(hit.t, hit.tot)));
383 }
384
385 summary.update(JDAQChronometer(evt->det_id,
386 evt->run_id,
387 evt->frame_index,
388 JDAQUTCExtended(evt->t.GetSec(), evt->t.GetNanoSec() / 16)));
389
390 const time_converter converter = time_converter(*evt);
391
392 Trk muon; // Monte Carlo true muon
393
394 if (has_muon(*evt)) {
395
396 for (const auto& trk : evt->mc_trks) {
397 if (is_muon(trk)) {
398 if (trk.E > muon.E) {
399
400 muon = trk;
401 muon.t += converter.putTime();
402
403 setW(muon, JSTART_LENGTH_METRES, fabs(muon.len));
404 }
405 }
406 }
407 }
408
409
410 bool monte_carlo = false; // show Monte Carlo true muon
411
412 for (bool next = false; !next; ) {
413
414 for (size_t i = 0; i != NUMBER_OF_PADS; ++i) {
415 H2[i].Reset();
416 }
417
418 Trk trk;
419
420 if (!monte_carlo)
421 trk = fit;
422 else
423 trk = muon;
424
425 JRotation3D R (getDirection(trk));
426 JLine1Z tz(getPosition (trk).rotate(R), trk.t);
427 JZRange Z_m;
428 /*
429 if (getW(fit,JSTART_LENGTH_METRES, 0.0) > 0.0) {
430 Z_m = JZRange(getW(fit,JSTART_ZMIN_M) + parameters.ZMin_m,
431 getW(fit,JSTART_ZMAX_M) + parameters.ZMax_m);
432 }
433 */
434 const JModel<JLine1Z> match(tz, parameters.roadWidth_m, T_ns, Z_m);
435
436 // hit selection based on fit result
437
438 JDataW0_t data;
439
440 for (JDataL0_t::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
441
442 const int type = 0;
443 const double QE = 1.0;
444 const double R_Hz = summary.getRate(i->getPMTIdentifier(), parameters.R_Hz);
445
446 JHitW0 hit(*i, type, QE, R_Hz);
447
448 hit.rotate(R);
449
450 if (match(hit)) {
451 data.push_back(hit);
452 }
453 }
454
455 // select first hit in PMT
456
457 sort(data.begin(), data.end(), JHitW0::compare);
458
459 JDataW0_t::iterator __end = unique(data.begin(), data.end(), equal_to<JDAQPMTIdentifier>());
460
461 double E_GeV = parameters.E_GeV;
462 /*
463 if (trk.E > 0.1) {
464 E_GeV = trk.E;
465 }
466 */
467
468 // move fit to geometrical center of hits
469
471
472 for (JDataW0_t::iterator hit = data.begin(); hit != __end; ++hit) {
473
474 const double x = hit->getX() - tz.getX();
475 const double y = hit->getY() - tz.getY();
476 const double z = hit->getZ();
477 const double R = sqrt(x*x + y*y);
478
479 zs.include(z - R/getTanThetaC());
480 }
481
482 const double z0 = tz.getZ();
483 const double z1 = 0.5 * (zs.getLowerLimit() + zs.getUpperLimit());
484
485 tz.setZ(z1, getSpeedOfLight());
486
487
488 // graphics
489
490 ostringstream os;
491 vector<TArrow> arrow [NUMBER_OF_PADS];
492 vector<TMarker> marker[NUMBER_OF_PADS];
493
494 if (hasW(trk, JSTART_LENGTH_METRES) && getW(trk, JSTART_LENGTH_METRES) > 0.0) {
495
496 marker[2].push_back(TMarker(z0 - tz.getZ(), 0.0, kFullCircle));
497 marker[2].push_back(TMarker(z0 - tz.getZ() + getW(trk, JSTART_LENGTH_METRES), 0.0, kFullCircle));
498
499 static_cast<TAttMarker&>(marker[2][0]) = TAttMarker(kRed, kFullCircle, 0.7);
500 static_cast<TAttMarker&>(marker[2][1]) = TAttMarker(kRed, kFullCircle, 0.7);
501 }
502
503 DEBUG("trk: "
504 << FIXED(7,2) << tz.getX() << ' '
505 << FIXED(7,2) << tz.getY() << ' '
506 << FIXED(7,2) << tz.getZ() << ' '
507 << FIXED(12,2) << tz.getT() << endl);
508
509 double chi2 = 0;
510
511 for (JDataW0_t::const_iterator hit = data.begin(); hit != __end; ++hit) {
512
513 const double x = hit->getX() - tz.getX();
514 const double y = hit->getY() - tz.getY();
515 const double z = hit->getZ() - tz.getZ();
516 const double R = sqrt(x*x + y*y);
517
518 const double t1 = tz.getT() + (z + R * getTanThetaC()) * getInverseSpeedOfLight();
519
520 JDirection3D dir(hit->getDX(), hit->getDY(), hit->getDZ()); // PMT orientation
521
522 dir.rotate(JRotation3Z(-atan2(y,x))); // rotate PMT axis to x-z plane
523
524 const double theta = dir.getTheta();
525 const double phi = fabs(dir.getPhi()); // rotational symmetry of Cherenkov cone
526
527 //const double E = gWater.getE(E_GeV, z); // correct for energy loss
528 const double E = E_GeV;
529 const double dt = T_ns.constrain(hit->getT() - t1);
530
531 JMuonPDF_t::result_type H1 = pdf.calculate(E, R, theta, phi, dt);
532 JMuonPDF_t::result_type H0(hit->getR() * 1e-9, 0.0, T_ns);
533
534 if (H1.V >= parameters.VMax_npe) {
535 H1 *= parameters.VMax_npe / H1.V;
536 }
537
538 H1 += H0; // signal + background
539
540 chi2 += H1.getChi2() - H0.getChi2();
541
542 DEBUG("hit: "
543 << setw(8) << hit->getModuleID() << '.' << FILL(2,'0') << (int) hit->getPMTAddress() << FILL() << ' '
544 << SCIENTIFIC(8,2) << E << ' '
545 << FIXED(7,2) << R << ' '
546 << FIXED(7,4) << theta << ' '
547 << FIXED(7,4) << phi << ' '
548 << FIXED(7,3) << dt << ' '
549 << FIXED(7,3) << H1.getChi2() << ' '
550 << FIXED(7,3) << H0.getChi2() << endl);
551
552 const double derivative = H1.getDerivativeOfChi2() - H0.getDerivativeOfChi2();
553
554 double size = derivative * graphics.arrowScale; // size of arrow
555
556 if (fabs(size) < Amin) {
557 size = (size > 0.0 ? +Amin : -Amin);
558 } else if (fabs(size) > Amax) {
559 size = (size > 0.0 ? +Amax : -Amax);
560 }
561
562 const double X[NUMBER_OF_PADS] = { R, atan2(y,x), z - R/getTanThetaC() };
563
564 const double xs = (double) (NUMBER_OF_PMTS - 2 * hit->getPMTAddress()) / (double) NUMBER_OF_PMTS;
565
566 for (size_t i = 0; i != NUMBER_OF_PADS; ++i) {
567
568 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());
569
570 a1.SetLineWidth(graphics.lineWidth);
571 a1.SetLineStyle(graphics.lineStyle);
572
573 arrow[i].push_back(a1);
574
575 H2[i].Fill(X[i], dt + graphics.T_ns);
576 }
577 }
578
579 if (graphics.equalize) {
580
581 double zmax = 0.0;
582
583 for (size_t i = 0; i != NUMBER_OF_PADS; ++i) {
584 if (H2[i].GetMaximum() > zmax) {
585 zmax = H2[i].GetMaximum();
586 }
587 }
588
589 zmax *= 1.2;
590
591 for (size_t i = 0; i != NUMBER_OF_PADS; ++i) {
592 H2[i].SetMaximum(zmax);
593 }
594 }
595
596 os << FILL(6,'0') << evt->run_id << ":" << evt->frame_index << "/" << evt->trigger_counter << FILL();
597 os << " Q = " << FIXED(4,0) << trk.lik
598 << '/' << FIXED(4,0) << -chi2;
599 os << " E = " << SCIENTIFIC(7,1) << trk.E << " [GeV]";
600 os << " cos(#theta) = " << FIXED(6,3) << trk.dir.z;
601 os << " L = " << FIXED(6,2) << getW(trk, JSTART_LENGTH_METRES, 0.0) << " [m]";
602
603 for (const auto& key : keys) {
604 os << ' ' << SCIENTIFIC(12,3) << getWeight(fit, key, 0.0);
605 }
606
607 if (monte_carlo)
608 os << " Monte Carlo";
609 else if (is_muon(muon))
610 os << " #Delta#alpha = " << FIXED(6,2) << getAngle(getDirection(muon), getDirection(trk)) << " [deg]";
611
612
613 // draw
614
615 TLatex title(0.05, 0.5, os.str().c_str());
616
617 title.SetTextAlign(12);
618 title.SetTextFont(42);
619 title.SetTextSize(0.6);
620
621 p2->cd();
622
623 title.Draw();
624
625 for (int i = 0; i != NUMBER_OF_PADS; ++i) {
626
627 p1->cd(i+1);
628
629 if (option == arrow_t) {
630
631 for (auto& a1 : arrow[i]) {
632 a1.Draw();
633 }
634
635 for (auto& m1 : marker[i]) {
636 m1.Draw();
637 }
638 }
639
640 if (option == histogram_t) {
641 H2[i].Draw("SAME");
642 }
643 }
644
645 cv->Update();
646
647
648 // action
649
650 if (batch) {
651
652 cv->SaveAs(replace(outputFile, WILDCARD, MAKE_STRING(inputFile.getCounter())).c_str());
653
654 next = true;
655
656 } else {
657
658 static int count = 0;
659
660 if (count++ == 0) {
661 cout << endl << "Type '?' for possible options." << endl;
662 }
663
664 for (bool user = true; user; ) {
665
666 cout << "\n> " << flush;
667
668 switch (JKeypress(true).get()) {
669
670 case '?':
671 cout << endl;
672 cout << "possible options: " << endl;
673 cout << 'q' << " -> " << "exit application" << endl;
674 cout << 'u' << " -> " << "update canvas" << endl;
675 cout << 's' << " -> " << "save graphics to file" << endl;
676 cout << 'M' << " -> " << "Monte Carlo true muon information" << endl;
677 cout << 'F' << " -> " << "fit information" << endl;
678 if (event_selector.is_valid()) {
679 cout << 'L' << " -> " << "reload event selector" << endl;
680 }
681 cout << 'r' << " -> " << "rewind input file" << endl;
682 cout << 'R' << " -> " << "switch to ROOT mode (quit ROOT to continue)" << endl;
683 cout << 'p' << " -> " << "print event information" << endl;
684 cout << ' ' << " -> " << "next event (as well as any other key)" << endl;
685 break;
686
687 case 'q':
688 cout << endl;
689 return 0;
690
691 case 'u':
692 cv->Update();
693 break;
694
695 case 's':
696 cv->SaveAs(replace(outputFile, WILDCARD, MAKE_STRING(inputFile.getCounter())).c_str());
697 break;
698
699 case 'M':
700 if (is_muon(muon))
701 monte_carlo = true;
702 else
703 ERROR(endl << "No Monte Carlo muon available." << endl);
704 user = false;
705 break;
706
707 case 'F':
708 monte_carlo = false;
709 user = false;
710 break;
711
712 case 'L':
713 if (event_selector.is_valid()) {
714 execute(MAKE_STRING("make -f " << getPath(argv[0]) << "/JMakeEventSelector libs"), 3);
715 event_selector.reload();
716 }
717 break;
718
719 case 'R':
720 tp->Run(kTRUE);
721 break;
722
723 case 'p':
724 cout << endl;
725 evt->print(cout);
726 if (debug >= debug_t) {
727 for (const auto& trk : evt->mc_trks) {
728 cout << "MC "; trk.print(cout); cout << endl;
729 }
730 for (const auto& trk : evt->trks) {
731 cout << "fit "; trk.print(cout); cout << endl;
732 }
733 for (const auto& hit : evt->hits) {
734 cout << "hit "; hit.print(cout); cout << endl;
735 }
736 }
737 break;
738
739 case 'r':
740 inputFile.rewind();
741
742 default:
743 next = true;
744 user = false;
745 break;
746 }
747 }
748 }
749 }
750 }
751 }
752 cout << endl;
753}
string outputFile
TPaveText * p1
#define DEBUG(A)
Message macros.
Definition JMessage.hh:62
#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:2140
#define MAKE_CSTRING(A)
Make C-string.
Definition JPrint.hh:57
#define MAKE_STRING(A)
Make string.
Definition JPrint.hh:48
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
Utility class to parse parameter values.
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.
Utility class to parse command line options.
Definition JParser.hh:1697
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
Object reading from a list of files.
virtual void rewind() override
Rewind.
virtual bool hasNext() override
Check availability of next element.
counter_type getCounter() const
Get counter.
virtual const pointer_type & next() override
Get next element.
File router for fast addressing of summary data.
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
Data structure for L0 hit.
Definition JHitL0.hh:31
static void setSlewing(const bool slewing)
Set slewing option.
Data structure for UTC time.
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 ...
JDirection3D getDirection(const Vec &dir)
Get direction.
bool hasW(const Trk &trk, const int i)
Check availability of value.
bool has_muon(const Evt &evt)
Test whether given event has a muon.
void setW(Trk &trk, const int i, const double value)
Set associated value.
double getW(const Trk &track, const size_t index, const double value)
Get track information.
JPosition3D getPosition(const Vec &pos)
Get position.
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
@ debug_t
debug
Definition JMessage.hh:29
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.
array_type< JKey_t > get_keys(const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &data)
Method to create array of keys of map.
std::string replace(const std::string &input, const std::string &target, const std::string &replacement)
Replace tokens in string.
static const double PI
Mathematical constants.
static const JX X
Definition JMathlib.hh:1551
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).
const JFit & get_best_reconstructed_track(const JEvt &evt, JTrackSelector_t selector, JQualitySorter_t comparator)
Get best reconstructed track.
JRECONSTRUCTION::JWeight getWeight
bool has_reconstructed_track(const JEvt &evt, JTrackSelector_t selector)
Test whether given event has a track according selection.
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
int frame_index
from the raw data
Definition Evt.hh:29
int run_id
DAQ run identifier.
Definition Evt.hh:26
std::vector< Hit > hits
list of hits
Definition Evt.hh:38
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition Evt.hh:49
int det_id
detector identifier from DAQ
Definition Evt.hh:23
ULong64_t trigger_counter
trigger counter
Definition Evt.hh:31
void print(std::ostream &out=std::cout) const
Print event.
Definition Evt.hh:74
std::vector< Trk > trks
list of reconstructed tracks (can be several because of prefits,showers, etc).
Definition Evt.hh:39
TTimeStamp t
UTC time of the timeslice, or the event_time for MC. (default: 01 Jan 1970 00:00:00)
Definition Evt.hh:33
Auxiliary data structure for sequence of same character.
Definition JManip.hh:330
Auxiliary data structure for floating point format specification.
Definition JManip.hh:448
Definition Hit.hh:10
int dom_id
module identifier from the data (unique in the detector).
Definition Hit.hh:14
Vec pos
hit position
Definition Hit.hh:25
void print(std::ostream &out=std::cout) const
Print hit.
Definition Hit.hh:60
Vec dir
hit direction; i.e. direction of the PMT
Definition Hit.hh:26
unsigned int channel_id
PMT channel id {0,1, .., 30} local to moduke.
Definition Hit.hh:15
unsigned int tot
tot value as stored in raw data (int for pyroot)
Definition Hit.hh:17
double t
hit time (from tdc+calibration or MC truth)
Definition Hit.hh:23
Acoustics hit.
Model for fit to acoustics data.
bool is_valid() const
Check validity of function.
void reload()
Reload function from shared library.
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:67
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
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 Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Definition Trk.hh:15
void print(std::ostream &out=std::cout) const
Print track.
Definition Trk.hh:182
Vec dir
track direction
Definition Trk.hh:18
double E
Energy [GeV] (either MC truth or reconstructed)
Definition Trk.hh:20
double t
track time [ns] (when the particle is at pos )
Definition Trk.hh:19
double len
length, if applicable [m]
Definition Trk.hh:22
double lik
likelihood or lambda value (for aafit, lambda)
Definition Trk.hh:23
double z
Definition Vec.hh:14
Range of reconstruction stages.