Jpp 20.0.0-195-g190c9e876
the software that should make you happy
Loading...
Searching...
No Matches
JShowerBjorkenY.cc
Go to the documentation of this file.
1#include <string>
2
6
7#include "JDAQ/JDAQEventIO.hh"
10
12
17
18#include "JSupport/JSupport.hh"
22#include "JSupport/JMeta.hh"
23
29
30#include "Jeep/JParser.hh"
31#include "Jeep/JMessage.hh"
32
33
34/**
35 * \file
36 *
37 * Program to perform Shower Bjorken Y Fit for ORCA with I/O of JFIT::JEvt data.
38 * The reconstruction is made at the PMT level.
39 * \author adomi
40 */
41
42int main(int argc, char** argv){
43
44 using namespace std;
45 using namespace JPP;
46 using namespace KM3NETDAQ;
47
48 typedef JParallelFileScanner< JTypeList<JDAQEvent, JEvt> > JParallelFileScanner_t;
50 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
51
52 JParallelFileScanner_t inputFile;
54 JLimit_t& numberOfEvents = inputFile.getLimit();
55 string detectorFile;
56 string pdfFile;
58 JEnergyCorrection correct;
59 int debug;
60
61 try {
62
63 JParser<> zap;
64
65 zap['f'] = make_field(inputFile);
66 zap['o'] = make_field(outputFile);
67 zap['n'] = make_field(numberOfEvents) = JLimit::max();
68 zap['a'] = make_field(detectorFile);
69 zap['F'] = make_field(pdfFile, "PDFs");
70 zap['@'] = make_field(parameters, "fit parameters") = JPARSER::initialised();
71 zap['E'] = make_field(correct, "energy correction") = JEnergyCorrection();
72 zap['d'] = make_field(debug) = 1;
73
74 zap(argc, argv);
75 }
76 catch(const exception& error) {
77 FATAL(error.what() << endl);
78 }
79
81
82 try {
83 load(detectorFile, detector);
84 }
85 catch(const JException& error) {
86 FATAL(error);
87 }
88
89 outputFile.open();
90 outputFile.put(JMeta(argc, argv));
91
92 const JModuleRouter router(detector);
93
94 JSummaryFileRouter summary(inputFile);
95
96 JShowerBjorkenY fit(parameters, router, summary, pdfFile, correct, debug);
97
98 while (inputFile.hasNext()) {
99
100 STATUS("event: " << setw(10) << inputFile.getCounter() << '\r'); DEBUG(endl);
101
102 multi_pointer_type ps = inputFile.next();
103
104 JDAQEvent* tev = ps;
105 JEvt* in = ps;
106
107 summary.update(*tev);
108
109 // select start values
110 JEvt cp = *in;
111
112 cp.select(parameters.numberOfPrefits, qualitySorter);
113
114 if (!cp.empty()) {
115 cp.select(JHistory::is_event(cp.begin()->getHistory()));
116 }
117
118 // fit
119 JEvt out = fit(*tev, cp);
120
121 // apply default sorter
122 sort(out.begin(), out.end(), qualitySorter);
123
124 copy(in->begin(), in->end(), back_inserter(out));
125
126 outputFile.put(out);
127
128 }
129 STATUS(endl);
130
132
133 io >> outputFile;
134
135 outputFile.close();
136}
string outputFile
Data structure for detector geometry and calibration.
Recording of objects on file according a format that follows from the file name extension.
General purpose messaging.
#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:74
ROOT I/O of application specific meta data.
Direct access to module in detector data structure.
Parallel scanning of objects from a single file or multiple files according a format that follows fro...
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
int main(int argc, char **argv)
ROOT TTree parameter settings of various packages.
Detector data structure.
Definition JDetector.hh:96
Router for direct addressing of module data in detector data structure.
General exception.
Definition JException.hh:24
Utility class to parse command line options.
Definition JParser.hh:1698
Auxiliary class for correction of energy determined by JEnergy.cc.
class to handle the direction fit of the shower reconstruction, mainly dedicated for ORCA
Object writing to file.
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.
void update(const JDAQHeader &header)
Update router.
void copy(const Head &from, JHead &to)
Copy header from from to to.
Definition JHead.cc:163
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).
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
KM3NeT DAQ data structures and auxiliaries.
Definition DataQueue.cc:39
Detector file.
Definition JHead.hh:227
Acoustic event fit.
Auxiliary class to test history.
Definition JHistory.hh:157
Type list.
Definition JTypeList.hh:23
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
const JLimit & getLimit() const
Get limit.
Definition JLimit.hh:84
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