Jpp 20.0.0-27-g39925593c-D
the software that should make you happy
Loading...
Searching...
No Matches
Functions
JShowerDirectionPrefit.cc File Reference

Program to perform EM Shower Fit for ORCA with I/O of JFIT::JEvt data. More...

#include <string>
#include <limits>
#include "km3net-dataformat/offline/Head.hh"
#include "km3net-dataformat/offline/MultiHead.hh"
#include "km3net-dataformat/offline/Evt.hh"
#include "JDAQ/JDAQEventIO.hh"
#include "JDAQ/JDAQTimesliceIO.hh"
#include "JDAQ/JDAQSummarysliceIO.hh"
#include "JDetector/JModuleRouter.hh"
#include "JDetector/JDetectorToolkit.hh"
#include "JDynamics/JDynamics.hh"
#include "JSupport/JParallelFileScanner.hh"
#include "JSupport/JSupport.hh"
#include "JSupport/JFileRecorder.hh"
#include "JSupport/JMeta.hh"
#include "JSupport/JTreeScanner.hh"
#include "JSupport/JSummaryFileRouter.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
#include "JReconstruction/JEvt.hh"
#include "JReconstruction/JShowerParameters.hh"
#include "JReconstruction/JShowerDirectionPrefitParameters_t.hh"
#include "JReconstruction/JShowerDirectionPrefit.hh"
#include "JReconstruction/JMultiThreadedReconstruction.hh"
#include "JLang/JSharedPointer.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Program to perform EM Shower Fit for ORCA with I/O of JFIT::JEvt data.

The reconstruction is made at the PMT level.

Author
adomi

Definition in file JShowerDirectionPrefit.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 44 of file JShowerDirectionPrefit.cc.

44 {
45
46 using namespace std;
47 using namespace JPP;
48 using namespace KM3NETDAQ;
49
52 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
55 typedef JMultipleFileScanner<calibration_types> JCalibration_t;
56
57 JParallelFileScanner_t inputFile;
60 JLimit_t& numberOfEvents = inputFile.getLimit();
61 string detectorFile;
62 JCalibration_t calibrationFile;
63 double Tmax_s;
64 string pdfFile;
65 size_t threads; // number of parallel threads
66 int debug;
67
68 try {
69
71
72 zap['f'] = make_field(inputFile) ;
73 zap['o'] = make_field(outputFile) = "JORCAShowerDirectionPrefit_Output.root";
76 zap['T'] = make_field(Tmax_s) = 100.0;
77 zap['F'] = make_field(pdfFile) ;
78 zap['@'] = make_field(parameters) = JPARSER::initialised();
79 zap['n'] = make_field(numberOfEvents) = JLimit::max();
80 zap['N'] = make_field(threads) = 0;
81 zap['d'] = make_field(debug) = 2;
82
83 zap(argc, argv);
84 }
85 catch(const exception& error) {
86 FATAL(error.what() << endl);
87 }
88
89
90 getTreeParameters<Evt>().setSplitLevel(0);
91
93
94 try {
96 }
97 catch(const JException& error) {
98 FATAL(error);
99 }
100
102
103 if (!calibrationFile.empty()) {
104
105 try {
106
107 dynamics.reset(new JDynamics(detector, Tmax_s));
108
110 }
111 catch(const exception& error) {
112 FATAL(error.what());
113 }
114 }
115
116 const JModuleRouter router(dynamics ? dynamics->getDetector() : detector);
117
118 JSummaryFileRouter summary(inputFile);
119
120
121 outputFile.open();
122 outputFile.put(JMeta(argc, argv));
123
124 {
125 const JShowerDirectionPrefit::storage_type storage(pdfFile, JTimeRange(parameters.TMin_ns, parameters.TMax_ns));
126 JShowerDirectionPrefit fit(parameters, storage, debug);
127
129
130 while (inputFile.hasNext()) {
131
132 STATUS("event: " << setw(10) << inputFile.getCounter() << '\r'); DEBUG(endl);
133
134 multi_pointer_type ps = inputFile.next();
135
136 JDAQEvent* tev = ps;
137 JFIT::JEvt* in = ps;
138
139 summary.update(*tev);
140
141 if (dynamics) {
142 dynamics->update(*tev);
143 }
144
145 auto input = fit.getInput(router, summary, *tev, *in, dynamics ? dynamics->getCoverage() : coverage_type());
146
147 if (threads > 0)
148 fits.enqueue(input);
149 else
150 outputFile.put(fit(input));
151 }
152 STATUS(endl);
153 }
154
156
157 io >> outputFile;
158
159 outputFile.close();
160}
string outputFile
#define DEBUG(A)
Message macros.
Definition JMessage.hh:62
#define STATUS(A)
Definition JMessage.hh:63
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Detector data structure.
Definition JDetector.hh:96
Router for direct addressing of module data in detector data structure.
Data structure for set of track fit results.
General exception.
Definition JException.hh:24
Template definition of a multi-dimensional oscillation probability interpolation table.
void load()
Load oscillation probability table.
class to handle the direction fit of the shower reconstruction, mainly dedicated for ORCA
File router for fast addressing of summary data.
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.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
KM3NeT DAQ data structures and auxiliaries.
Definition DataQueue.cc:39
Detector file.
Definition JHead.hh:227
Acoustic event fit.
Orientation of module.
Dynamic detector calibration.
Definition JDynamics.hh:86
Data structure for coverage of detector by dynamical calibrations.
Definition JCoverage.hh:19
Auxiliary class for recursive type list generation.
Definition JTypeList.hh:351
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition JParser.hh:68
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