59{
62
64 JLimit_t& numberOfEvents = inputFile.getLimit();
69 size_t prescale;
70 double ratio;
72 size_t Nmin;
74
75
76 try {
77
79
81 zap[
'f'] =
make_field(inputFile,
"input file (output of JKatoomba[.sh])");
90 zap[
'N'] =
make_field(Nmin,
"minimum number of transmissions") = 0;
92
94 }
95 catch(const exception& error) {
97 }
98
101 }
102
105 }
106
109 }
110
112
113 try {
115 }
118 }
119
122
124
126
128 status[module->getID()] = module->getStatus();
129 }
130
131
132
134
137
139
140 gROOT->SetStyle(
"gplot");
142
143 const size_t NY = (size_t) (sqrt(geometry.size()) * 0.75 + 0.25);
144 const size_t NX = (size_t) (geometry.size() +
NY - 1) /
NY;
145
147
148 cv->SetFillStyle(4000);
150
153
154 p1->Divide(
NX,
NY, 0.01, 0.001);
155
157 p2->Draw();
158
159 double zmin = 0.0;
160 double zmax = 0.0;
161
163
164 if (i->second.getZ() < zmin) {
165 zmin = i->second.getZ();
166 }
167
168 if (i->second.rbegin()->getHeight() > zmax) {
169 zmax = i->second.rbegin()->getHeight();
170 }
171 }
172
173 zmin -= 2.0;
174 zmax += 10.0;
175
176 double xmin = -ratio * (zmax - zmin);
177 double xmax = +ratio * (zmax - zmin);
178
181
182 for (size_t i = 0; i != geometry.size(); ++i) {
183
185
187
188 H2[i].GetXaxis()->SetTitle(
"x/y [m]");
189 H2[i].GetYaxis()->SetTitle(
"z [m]");
190
191 H2[i].GetXaxis()->CenterTitle(
true);
192 H2[i].GetYaxis()->CenterTitle(
true);
193
195
197
198 T2[i].SetTextAlign(21);
199 T2[i].SetTextFont(42);
200 T2[i].SetTextSize(0.05);
201
203
206 }
207
209
211
212 JTreeScanner_t::iterator p = in.begin();
213
214 while (inputFile.hasNext()) {
215
216 cout <<
"\revent: " <<
setw(8) << inputFile.getCounter() << flush;
217
218 const JEvt* evt = inputFile.next();
220
221 if (
batch && inputFile.getCounter()%prescale != 0) {
222 continue;
223 }
224
225 if (Nmin != 0) {
226
227 for ( ; p != in.end() && p-> begin()->getToA() < evt->
UNIXTimeStart - 0.5; ++p) {}
228
229 JTreeScanner_t::iterator q = p;
230
231 for ( ; q != in.end() && q->rbegin()->getToA() <= evt->
UNIXTimeStop + 0.5; ++q) {}
232
233 if (p != q) {
234
236
237 for (JTreeScanner_t::iterator evt = p; evt != q; ++evt) {
238 for (JEvent::const_iterator i = evt->begin(); i != evt->end(); ++i) {
239 buffer[i->getID()] += 1;
240 }
241 }
242
244
245 module->setStatus(status[module->getID()]);
246
247 if (buffer[
module->getID()] < Nmin) {
248 module->set(module->getFloor() == 0 ? HYDROPHONE_DISABLE : PIEZO_DISABLE);
249 }
250 }
251 }
252 }
253
254
255
257
258 TText title(0.5, 0.5, utc.c_str());
259
260 title.SetTextAlign(22);
261 title.SetTextFont(42);
262 title.SetTextSize(0.3);
263
264 p2->cd();
265
266 title.Draw();
267
270
271 for (JEvt::const_iterator i = evt->begin(); i != evt->end(); ++i) {
272
273 if (geometry.has(i->id)) {
274
275 const int index = geometry.getIndex(i->id);
276
278 const JMODEL ::JString& parameters =
model.string[i->id];
279
282
283 for (size_t floor = 1; floor < string.size(); ++floor) {
284
287
288 if (router.hasLocation(location) && !router.getModule(location).has(
PIEZO_DISABLE)) {
291 }
292 }
293 }
294 }
295
296
297
299
301
304 }
305
306 cv->Update();
307
308
309
311
313
314 } else {
315
316 static int count = 0;
317
318 if (count++ == 0) {
319 cout <<
endl <<
"Type '?' for possible options." <<
endl;
320 }
321
323
324 cout <<
"\n> " << flush;
325
327
328 case '?':
330 cout <<
"possible options: " <<
endl;
331 cout <<
'q' <<
" -> " <<
"exit application" <<
endl;
332 cout <<
'u' <<
" -> " <<
"update canvas" <<
endl;
333 cout <<
's' <<
" -> " <<
"save graphics to file" <<
endl;
334 cout <<
'r' <<
" -> " <<
"rewind input file" <<
endl;
335 cout <<
'R' <<
" -> " <<
"switch to ROOT mode (quit ROOT to continue)" <<
endl;
336 cout <<
'p' <<
" -> " <<
"print event information" <<
endl;
337 cout <<
' ' <<
" -> " <<
"next event (as well as any other key)" <<
endl;
338 break;
339
340 case 'q':
342 return 0;
343
344 case 'u':
345 cv->Update();
346 break;
347
348 case 's':
350 break;
351
352 case 'R':
354 break;
355
356 case 'p':
358 break;
359
360 case 'r':
361 inputFile.rewind();
362
363 default:
365 break;
366 }
367 }
368 }
369 }
371}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define MAKE_CSTRING(A)
Make C-string.
#define MAKE_STRING(A)
Make string.
Router for direct addressing of location data in detector data structure.
Logical location of module.
Data structure for position in three dimensions.
const JPosition3D & getPosition() const
Get position.
double getY() const
Get y position.
double getZ() const
Get z position.
double getX() const
Get x position.
Template definition of a multi-dimensional oscillation probability interpolation table.
Data structure for size of TCanvas.
Wrapper class around ROOT TStyle.
Base class for JTreeScanner.
Enable unbuffered terminal input.
char get()
Get single character.
static const int PIEZO_DISABLE
Enable (disable) use of piezo if this status bit is 0 (1);.
static const JSoundVelocity getSoundVelocity(1541.0, -17.0e-3, -2000.0)
Function object for velocity of sound.
static JDetectorMechanics getMechanics
Function object to get string mechanics.
JModel getModel(const JEvt &evt)
Get model.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
void model(JModel_t &value)
Auxiliary function to constrain model during fit.
std::string replace(const std::string &input, const std::string &target, const std::string &replacement)
Replace tokens in string.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static const char WILDCARD
Auxiliary data structure for sequence of same character.
Auxiliary data structure for floating point format specification.
double UNIXTimeStop
stop time
double UNIXTimeStart
start time
Model for fit to acoustics data.
Implementation for depth dependend velocity of sound.
JSoundVelocity & set(const double z0)
Set depth.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.
Auxiliary class for date and time.