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

Program to perform reconstruction of shower for ORCA detector. More...

#include <string>
#include <iostream>
#include <iomanip>
#include <memory>
#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 "JDAQ/JDAQEvaluator.hh"
#include "JTrigger/JTriggerParameters.hh"
#include "JDetector/JDetector.hh"
#include "JDetector/JDetectorToolkit.hh"
#include "JDetector/JModuleRouter.hh"
#include "JDynamics/JDynamics.hh"
#include "JSupport/JSupport.hh"
#include "JSupport/JSingleFileScanner.hh"
#include "JSupport/JTreeScanner.hh"
#include "JSupport/JFileRecorder.hh"
#include "JSupport/JSummaryFileRouter.hh"
#include "JSupport/JMeta.hh"
#include "JReconstruction/JORCAShowerReconstruction.hh"
#include "JReconstruction/JMultiThreadedReconstruction.hh"
#include "JPhysics/JK40Rates.hh"
#include "JPhysics/KM3NeT.hh"
#include "Jeep/JProperties.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 perform reconstruction of shower for ORCA detector.

Author
mdejong

Definition in file JORCAShowerReconstruction.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 47 of file JORCAShowerReconstruction.cc.

48{
49 using namespace std;
50 using namespace JPP;
51 using namespace KM3NETDAQ;
52
57 typedef JMultipleFileScanner<calibration_types> JCalibration_t;
59 typedef JReconstruction_t::JParameters_t JParameters_t;
60 typedef JReconstruction_t::JStorage_t JStorage_t;
61
62 JSingleFileScanner_t inputFile;
64 JLimit_t& numberOfEvents = inputFile.getLimit();
65 string detectorFile;
66 JCalibration_t calibrationFile;
67 double Tmax_s;
69 JParameters_t parameters;
70 string pdfFile;
71 size_t threads; // number of parallel threads
72 int debug;
73
74 try {
75
76 JParser<> zap("Program to perform reconstruction of shower for ORCA detector.");
77
78 zap['f'] = make_field(inputFile);
79 zap['o'] = make_field(outputFile) = "jshower.root";
82 zap['T'] = make_field(Tmax_s) = 100.0;
83 zap['n'] = make_field(numberOfEvents) = JLimit::max();
84 zap['F'] = make_field(pdfFile);
85 zap['E'] = make_field(correct) = JShowerEnergyCorrection(); // off
86 zap['@'] = make_field(parameters.properties) = JPARSER::initialised();
87 zap['N'] = make_field(threads, "number of threads") = 0;
88 zap['d'] = make_field(debug) = 1;
89
90 zap(argc, argv);
91 }
92 catch(const exception& error) {
93 FATAL(error.what() << endl);
94 }
95
96
97 getTreeParameters<Evt>().setSplitLevel(0);
98
100
101 try {
103 }
104 catch(const JException& error) {
105 FATAL(error);
106 }
107
109
110 if (!calibrationFile.empty()) {
111
112 try {
113
114 dynamics.reset(new JDynamics(detector, Tmax_s));
115
117 }
118 catch(const exception& error) {
119 FATAL(error.what());
120 }
121 }
122
123 outputFile.open();
124 outputFile.put(JMeta(argc, argv));
125
126 JTreeScanner<JDAQEvent, JDAQEvaluator> in(inputFile, inputFile.getLimit());
127
128 {
129 const JModuleRouter router(dynamics ? dynamics->getDetector() : detector);
130
131 JSummaryFileRouter summary(inputFile);
132
133 const JStorage_t storage(pdfFile, parameters);
134
135 JReconstruction_t fit(parameters, storage, correct, debug);
136
137 JMultiThreadedReconstruction<JReconstruction_t> fits(fit, outputFile, threads, 2 * threads);
138
139 while (in.hasNext()) {
140
141 STATUS("event: " << setw(10) << in.getCounter() << '\r'); DEBUG(endl);
142
143 const JDAQEvent* tev = in.next();
144
145 summary.update(*tev);
146
147 if (dynamics) {
148 dynamics->update(*tev);
149 }
150
151 auto input = fit.getInput(router, summary, *tev, dynamics ? dynamics->getCoverage() : coverage_type());
152
153 if (threads > 0)
154 fits.enqueue(input);
155 else
156 outputFile.put(fit(input));
157
158 outputFile.put(*tev);
159 }
160 STATUS(endl);
161 }
162
164
165 io >> outputFile;
166
167 outputFile.close();
168}
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.
Auxiliary class for correction of energy determined by JShowerEnergy.cc.
General exception.
Definition JException.hh:24
Template definition of a multi-dimensional oscillation probability interpolation table.
void load()
Load oscillation probability table.
File router for fast addressing of summary data.
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
Auxiliary base class for file name.