Jpp 20.0.0-195-g190c9e876
the software that should make you happy
Loading...
Searching...
No Matches
JShowerBjorkenY.cc File Reference

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

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

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

The reconstruction is made at the PMT level.

Author
adomi

Definition in file JShowerBjorkenY.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 42 of file JShowerBjorkenY.cc.

42 {
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
#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
#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.
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 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