Jpp test-rotations-old
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
13
15#include "JSupport/JSupport.hh"
17#include "JSupport/JMeta.hh"
20
21#include "Jeep/JParser.hh"
22#include "Jeep/JMessage.hh"
23
29
31
32/**
33 * \file
34 *
35 * Program to perform Shower Bjorken Y Fit for ORCA with I/O of JFIT::JEvt data.
36 * The reconstruction is made at the PMT level.
37 * \author adomi
38 */
39
40int main(int argc, char** argv){
41
42 using namespace std;
43 using namespace JPP;
44 using namespace KM3NETDAQ;
45
46 typedef JParallelFileScanner< JTypeList<JDAQEvent, JEvt> > JParallelFileScanner_t;
48 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
49
50 JParallelFileScanner_t inputFile;
53 JLimit_t& numberOfEvents = inputFile.getLimit();
54 string detectorFile;
55 string pdfFile;
57 int debug;
58
59 try {
60
61 JParser<> zap;
62
63 zap['f'] = make_field(inputFile) ;
64 zap['o'] = make_field(outputFile) = "JORCAShowerBjorkenY_Output.root";
65 zap['a'] = make_field(detectorFile) ;
66 zap['F'] = make_field(pdfFile) ;
67 zap['E'] = make_field(correct) = JShowerEnergyCorrection(); // off
68 zap['@'] = make_field(parameters) = JPARSER::initialised();
69 zap['n'] = make_field(numberOfEvents) = JLimit::max();
70 zap['d'] = make_field(debug) = 2;
71
72 zap(argc, argv);
73 }
74 catch(const exception& error) {
75 FATAL(error.what() << endl);
76 }
77
79
80 try {
81 load(detectorFile, detector);
82 }
83 catch(const JException& error) {
84 FATAL(error);
85 }
86
87 outputFile.open();
88 outputFile.put(JMeta(argc, argv));
89
90 const JModuleRouter router(detector);
91
92 JSummaryFileRouter summary(inputFile);
93
94 JShowerBjorkenY fit(parameters, router, summary, pdfFile, correct, debug);
95
96 while (inputFile.hasNext()) {
97
98 STATUS("event: " << setw(10) << inputFile.getCounter() << '\r'); DEBUG(endl);
99
100 multi_pointer_type ps = inputFile.next();
101
102 JDAQEvent* tev = ps;
103 JEvt* in = ps;
104
105 summary.update(*tev);
106
107 // select start values
108 JEvt cp = *in;
109
110 cp.select(parameters.numberOfPrefits, qualitySorter);
111
112 if (!cp.empty()) {
113 cp.select(JHistory::is_event(cp.begin()->getHistory()));
114 }
115
116 // fit
117 JEvt out = fit(*tev, cp);
118
119 // apply default sorter
120 sort(out.begin(), out.end(), qualitySorter);
121
122 copy(in->begin(), in->end(), back_inserter(out));
123
124 outputFile.put(out);
125
126 }
127 STATUS(endl);
128
130
131 io >> outputFile;
132
133 outputFile.close();
134}
string outputFile
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:72
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.
Auxiliary class for correction of energy determined by JShowerEnergy.cc.
General exception.
Definition JException.hh:24
Utility class to parse command line options.
Definition JParser.hh:1698
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:136
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