31{
35
37
40 JLimit_t& numberOfEvents = inputFile.getLimit();
41 string detectorFile;
42 map_type selector;
44
45 try {
46
47 JParser<> zap(
"Example program to select events based on hits in strings.");
48
49 zap[
'f'] =
make_field(inputFile,
"input file.");
52 zap[
'a'] =
make_field(detectorFile,
"detector file.");
53 zap[
'S'] =
make_field(selector,
"selection: pairs of <string number> <minimum number of triggered hits>");
55
58
59 zap(argc, argv);
60 }
61 catch(const exception& error) {
62 FATAL(error.what() << endl);
63 }
64
65
67
68 if (detectorFile != "") {
69
70 try {
72 }
75 }
76
77 } else if (!selector.empty()) {
78
79 FATAL(
"Missing detector file.");
80 }
81
83
84
86
88
90
92
94
96
97 bool status = selector.empty();
98
99 if (!status) {
100
102
104
106
107 const JPMTChannel& channel = router.getPMTChannel(*hit);
108
110 }
111
112 for (map_type::const_iterator i = selector.begin(); i != selector.end() && !status; ++i) {
113 status =
response[i->first] >= i->second;
114 }
115 }
116
117 if (status) {
118
120
121 buffer[event->getRunNumber()].insert(event->getFrameIndex());
122 }
123 }
125
126
128
129 STATUS(
"event: " << setw(10) << in.getCounter() <<
'\r');
DEBUG(endl);
130
132
135 }
136 }
138
139
141
143
145}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Simple wrapper around JModuleRouter class for direct addressing of PMT data in detector data structur...
int getString() const
Get string number.
Auxiliary class to uniquely identify PMT readout channel.
Utility class to parse command line options.
General purpose class for object reading from a list of file names.
virtual bool hasNext() override
Check availability of next element.
counter_type getCounter() const
Get counter.
virtual const pointer_type & next() override
Get next element.
int getRunNumber() const
Get run number.
int getFrameIndex() const
Get frame index.
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.
std::map< int, range_type > map_type
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary class to set-up Hit.
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.