Jpp 20.0.0-195-g190c9e876
the software that should make you happy
Loading...
Searching...
No Matches
JSummaryWriter.cc
Go to the documentation of this file.
1
2#include <string>
3#include <iostream>
4#include <iomanip>
5
8
10#include "JPhysics/JK40Rates.hh"
21#include "JSupport/JSupport.hh"
23#include "JSupport/JMeta.hh"
25
26#include "Jeep/JParser.hh"
27#include "Jeep/JMessage.hh"
28
29
30/**
31 * \file
32 *
33 * Auxiliary program to write summary data.
34 * \author mdejong
35 */
36int main(int argc, char **argv)
37{
38 using namespace std;
39 using namespace JPP;
40 using namespace KM3NETDAQ;
41
44 string detectorFile;
45 JTriggerParameters parameters;
46 JPMTParametersMap pmtParameters;
47 JK40Rates rates_Hz;
48 int run_number;
49 int debug;
50
51 try {
52
53 JParser<> zap("Auxiliary program to create summary data.");
54
55 zap['U'] = make_field(UTC);
56 zap['o'] = make_field(outputFile);
57 zap['a'] = make_field(detectorFile);
58 zap['@'] = make_field(parameters) = JPARSER::initialised();
59 zap['P'] = make_field(pmtParameters) = JPARSER::initialised();
60 zap['B'] = make_field(rates_Hz) = JPARSER::initialised();
61 zap['R'] = make_field(run_number) = 1;
62 zap['d'] = make_field(debug) = 0;
63
64 zap(argc, argv);
65 }
66 catch(const exception &error) {
67 FATAL(error.what() << endl);
68 }
69
70
72
73 try {
74 load(detectorFile, detector);
75 }
76 catch(const JException& error) {
77 FATAL(error);
78 }
79
81
83
84 simbad.reset(new JPMTDefaultSimulator(pmtParameters, detector));
85 simbad.reset(new JK40DefaultSimulator(rates_Hz));
86 simbad.reset(new JCLBDefaultSimulator());
87
88 outputFile.open();
89
90 outputFile.put(JMeta(argc, argv));
91 outputFile.put(parameters);
92
93 int frame_index = 1;
94
95 for (JDAQUTCExtended utc = UTC.getLowerLimit(); utc < UTC.getUpperLimit(); utc.addTimeNanoSecond(getFrameTime()), frame_index += 1) {
96
97 NOTICE("event: " << setw(10) << frame_index << '\r'); DEBUG(endl);
98
99 const JSummaryslice summary(JDAQChronometer(detector.getID(),
100 run_number,
101 frame_index,
102 utc),
103 simbad);
104
105 outputFile.put(summary);
106 }
107 NOTICE(endl);
108
109 outputFile.close();
110}
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 NOTICE(A)
Definition JMessage.hh:64
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:74
ROOT I/O of application specific meta data.
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)
Auxiliaries for creation of summary data.
Support methods.
ROOT TTree parameter settings of various packages.
void reset(JK40Simulator *k40Simulator)
Reset K40 simulator.
Detector data structure.
Definition JDetector.hh:96
Default implementation of the simulation of K40 background.
Auxiliary class for map of PMT parameters.
General exception.
Definition JException.hh:24
static void Throw(const bool option)
Enable/disable throw option.
Definition JThrow.hh:37
Utility class to parse command line options.
Definition JParser.hh:1698
Object writing to file.
Range of values.
Definition JRange.hh:42
T getLowerLimit() const
Get lower limit.
Definition JRange.hh:202
T getUpperLimit() const
Get upper limit.
Definition JRange.hh:213
Data structure for UTC time.
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
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition JParser.hh:68
Auxiliary class for K40 rates.
Definition JK40Rates.hh:41
Auxiliary class for ROOT I/O of application specific meta data.
Definition JMeta.hh:72
Auxiliary class to create summary data.