71{
75
77 JLimit_t& numberOfEvents = inputFile.getLimit();
79 double Tmax_ns;
81
82 try {
83
84 JParser<> zap(
"Example program to test conversion between Monte Carlo and DAQ times.");
85
91
93 }
94 catch(const exception &error) {
96 }
97
98
100
101 try {
103 }
106 }
107
109
110
111
113
114 while (inputFile.hasNext()) {
115
117
119
121 const Evt*
event = ps;
122
124
126
129
131
133
135
137 }
138 }
139
140 for (int test : {1, 2} ) {
141
143
145
147
148 if (test == 1) {
149
151
153
154 const JModule&
module = router.getModule(i->getModuleID());
155 const JPMT& pmt =
module.getPMT(i->getPMT());
156
157 data[pmt.getID()].insert(
converter.getTime(getTime(*i, pmt)));
158 }
159
160 } else if (test == 2) {
161
163
165
167
169
170 if (i->trig != 0) {
171
172 const JModule&
module = router.getModule(i->dom_id);
173 const JPMT& pmt =
module.getPMT(i->channel_id);
174
175 data[pmt.getID()].insert(
converter.getTime(getTime(i->tdc, pmt)));
176 }
177 }
178 }
179
180 for (map_type::const_iterator i =
data.begin(); i !=
data.end(); ++i) {
183 }
184 }
185
187
188 for (map_type::const_iterator p =
mc.begin(), q =
data.begin(); ; ++p, ++q) {
189
190 while (p !=
mc.end() && q !=
data.end() && p->first < q->first) { ++p; }
191 while (p !=
mc.end() && q !=
data.end() && q->first < p->first) { ++q; }
192
193 if (p ==
mc.end() || q ==
data.end()) {
194 break;
195 }
196
197 if (p->first == q->first) {
199 }
200 }
201
203
205 }
206 }
207
208 ASSERT(inputFile.getCounter() != 0);
209
210 return 0;
211}
#define DEBUG(A)
Message macros.
#define ASSERT(A,...)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Router for direct addressing of module data in detector data structure.
Data structure for a composite optical module.
Data structure for PMT geometry, calibration and status.
Template definition of a multi-dimensional oscillation probability interpolation table.
Auxiliary class to convert DAQ hit time to/from Monte Carlo hit time.
bool is_noise(const Hit &hit)
Verify hit origin.
std::istream & read(std::istream &in, JTestSummary &summary)
Read test summary.
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).
const char * getTime()
Get current local time conform ISO-8601 standard.
KM3NeT DAQ data structures and auxiliaries.
std::map< int, range_type > map_type
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
std::vector< Hit > hits
list of hits
Auxiliary data structure for floating point format specification.
General purpose class for multiple pointers.
Auxiliary class to set-up Hit.
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.