Jpp test-rotations-new
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
17#include "JSupport/JSupport.hh"
18#include "JSupport/JMeta.hh"
20
21#include "Jeep/JParser.hh"
22#include "Jeep/JMessage.hh"
23
24
25/**
26 * \file
27 *
28 * Auxiliary program to write summary data.
29 * \author mdejong
30 */
31int main(int argc, char **argv)
32{
33 using namespace std;
34 using namespace JPP;
35 using namespace KM3NETDAQ;
36
38 int numberOfEvents;
39 string detectorFile;
40 JTriggerParameters parameters;
41 JPMTParametersMap pmtParameters;
42 JK40Rates rates_Hz;
43 int run_number;
44 int debug;
45
46 try {
47
48 JParser<> zap("Auxiliary program to create summary data.");
49
50 zap['n'] = make_field(numberOfEvents);
51 zap['o'] = make_field(outputFile);
52 zap['a'] = make_field(detectorFile);
53 zap['@'] = make_field(parameters) = JPARSER::initialised();
54 zap['P'] = make_field(pmtParameters) = JPARSER::initialised();
55 zap['B'] = make_field(rates_Hz) = JPARSER::initialised();
56 zap['R'] = make_field(run_number) = 1;
57 zap['d'] = make_field(debug) = 0;
58
59 zap(argc, argv);
60 }
61 catch(const exception &error) {
62 FATAL(error.what() << endl);
63 }
64
65
67
68 try {
69 load(detectorFile, detector);
70 }
71 catch(const JException& error) {
72 FATAL(error);
73 }
74
76
78
79 simbad.reset(new JPMTDefaultSimulator(pmtParameters, detector));
80 simbad.reset(new JK40DefaultSimulator(rates_Hz));
81 simbad.reset(new JCLBDefaultSimulator());
82
83 outputFile.open();
84
85 outputFile.put(JMeta(argc, argv));
86 outputFile.put(parameters);
87
88 for (int frame_index = 1; frame_index <= numberOfEvents; ++frame_index) {
89
90 NOTICE("event: " << setw(10) << frame_index << '\r'); DEBUG(endl);
91
93 run_number,
94 frame_index,
95 getTimeOfFrame(frame_index)),
96 simbad);
97
98 outputFile.put(summary);
99 }
100 NOTICE(endl);
101
102 outputFile.close();
103}
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:72
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.
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.
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.