41 using namespace KM3NETDAQ;
51 JParser<> zap(
"Example program to analyse track fit results from Evt formatted data.");
54 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
61 catch(
const exception& error) {
62 FATAL(error.what() << endl);
65 const double rad_to_deg = 180/M_PI;
66 const double R_m = 700.0;
67 const int MAX_OVERLAYS = 200;
68 const double zenith_min = -1.0;
69 const double zenith_max = 1.0;
73 if (detectorFile !=
"") {
86 TH1D job(
"job", NULL, 100, 0.5, 100.5);
87 TH1D hz (
"hz",
"; cos(#theta)" , 21 , zenith_min, zenith_max);
88 TH1D ho (
"ho",
"; #overlays" , MAX_OVERLAYS , -0.5, MAX_OVERLAYS-0.5);
89 TH2D hzo (
"hzo",
"; cos(#theta) ; #overlays" , 21, zenith_min, zenith_max, MAX_OVERLAYS , -0.5, MAX_OVERLAYS-0.5);
90 TH2D hxy (
"hxy",
"; x position ; y position" , 201, -R_m, R_m, 201, -R_m, R_m);
91 TH1D hq (
"hq",
"; quality parameter" , 100, -200.0, 800);
92 TH1D hb0 (
"hb0",
"; log(beta0)" , 60, -2, 3.5);
93 TH1D he (
"he",
"; log(Ereco [GeV])" , 75, -2, 4);
94 TH2D heo (
"heo",
"; log(Ereco [GeV]) ; #overlays" , 75, -2, 4, MAX_OVERLAYS , -0.5, MAX_OVERLAYS-0.5);
95 TH2D hzq (
"hzq",
"; cos(#theta); quality" , 21, zenith_min, zenith_max, 50, -10.0, 500.0);
96 TH2D hze (
"hze",
"; cos(#theta); log(Ereco [GeV])", 21, zenith_min, zenith_max, 75, -2, 4);
97 TH2D hzb0(
"hzb0",
"; cos(#theta); log(beta0)" , 21, zenith_min, zenith_max, 60, -2, 3.5);
99 while (inputFile.hasNext()) {
101 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
103 const Evt * evt = inputFile.next();
109 Trk best_trk = get_best_reconstructed_track<JPP_RECONSTRUCTION_TYPE>(*evt );
113 const double Efit = tb.
getE();
115 ho .Fill(evt->overlays);
116 hz .Fill(tb.
getDZ());
117 hzo.Fill(tb.
getDZ(), evt->overlays) ;
119 hq .Fill(best_trk.
lik);
120 hzq.Fill(tb.
getDZ(), best_trk.
lik );
124 hzb0.Fill(tb.
getDZ(), log10(rad_to_deg* best_trk.
fitinf[JGANDALF_BETA0_RAD]) );
126 he .Fill(log10(Efit));
127 hze.Fill(tb.
getDZ(), log10(Efit) );
128 heo.Fill(log10(Efit), evt->overlays );
Utility class to parse command line options.
JTrack3E getTrack(const Trk &track)
Get track.
Router for direct addressing of module data in detector data structure.
std::string comment
use as you like
General purpose class for parallel reading of objects from a single file or multiple files...
Auxiliary class for defining the range of iterations of objects.
double getE() const
Get energy.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
std::vector< double > fitinf
place to store additional fit info, for jgandalf, see JFitParameters.hh
static const int JGANDALF_BETA0_RAD
KM3NeT Data Definitions v2.0.0-15-g59d2e2b https://git.km3net.de/common/km3net-dataformat.
double getY() const
Get y position.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
double lik
likelihood or lambda value (for aafit, lambda)
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
double getX() const
Get x position.
const JLimit & getLimit() const
Get limit.
do set_variable DETECTOR_TXT $WORKDIR detector
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
double getDZ() const
Get z direction.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.