71{
74
77 double precision;
79
80 try {
81
82 JParser<> zap(
"Auxiliary program to print detector file in human friendly format.");
83
86
88
92
100
108
109 zap[
'p'] =
make_field(precision,
"precision for match with reference module") = 1.0e-5;
111
113 }
114 catch(const exception &error) {
116 }
117
118
120
121 try {
123 }
126 }
127
128 if (option.empty() || option.count(
default_t)) {
129
131
132 }
133
135
137
139
144 cout <<
' ' <<
FIXED(7,2) <<
module->getX();
145 cout <<
' ' <<
FIXED(7,2) <<
module->getY();
146 cout <<
' ' <<
FIXED(7,2) <<
module->getZ();
147 cout <<
' ' <<
FIXED(8,2) <<
module->getT0();
148
149 if (
module->getFloor() != 0) {
150 {
152
155
156 const double phi = (JVector3Z_t.getDot(
q1.twist) >= 0.0 ? +1.0 : -1.0) *
q1.twist.getAngle();
157
159 }
160 {
163
164 const double phi = (JVector3Z_t.getDot(
q1.twist) >= 0.0 ? +1.0 : -1.0) *
q1.twist.getAngle();
165
167 }
168 {
170
172
174
175 cout <<
' ' << (JModule::compare(buffer, *
module, precision) ?
"==" :
"!=")
176 <<
' ' << (
demo.get(
module->getID()) ==
demo.getDefaultModuleAddressMap() ?
"default" :
"custom");
177 }
178 }
179
181 }
182
183 }
184
185 if (option.count(
pmts_t)) {
186
188
190
192
193 for (size_t i = 0; i != module->size(); ++i) {
194
195 const JPMT& pmt =
module->getPMT(i);
197
199 cout <<
' ' << address;
210 }
211 }
212
213 }
214
217
219
223
224 } else {
225
228 }
229
230 }
231
233
235
236 }
237
240
242
247 cout <<
"validity = "
250
251 } else {
252
258 }
259
260 }
261
264
266
268
269 } else {
270
271 cout <<
"set_variable DETECTOR_VERSION " <<
detector.getVersion() <<
";" <<
endl;
272 }
273
274 }
275
278
280
282
283 } else {
284
286 }
287
288 }
289
290 if (option.count(
can_t) ||
291 option.count(
CAN_t)) {
292
294
297
298 if (option.count(
can_t)) {
299
308
309 } else {
310
318 cout <<
"set_variable CAN_DISTANCE_M " <<
FIXED(9,3) << D <<
";" <<
endl;
319 }
320
321 }
322
325
327
329
334
335 } else {
336
337 cout <<
"set_variable CENTER_X_M " <<
FIXED(7,1) << center.getX() <<
";" <<
endl;
338 cout <<
"set_variable CENTER_Y_M " <<
FIXED(7,1) << center.getY() <<
";" <<
endl;
339 cout <<
"set_variable CENTER_Z_M " <<
FIXED(7,1) << center.getZ() <<
";" <<
endl;
340 }
341
342 }
343
346
351
353
356
359
361 strings.insert(
module->getString());
362 modules.insert(
module->getID());
363 }
364
366
368 cout <<
"Number of floors = " <<
setw(4) << numberOfFloors <<
endl;
369 cout <<
"Number of modules = " <<
setw(4) << numberOfModules <<
endl;
375
376 } else {
377
379 cout <<
"let \"NUMBER_OF_FLOORS = " <<
setw(5) << numberOfFloors <<
"\";" <<
endl;
380 cout <<
"let \"NUMBER_OF_MODULES = " <<
setw(5) << numberOfModules <<
"\";" <<
endl;
392
393
394
395 for (const auto i : strings) {
397 }
399 cout <<
getString(i.getString()) <<
"[" << i.getFloor() <<
"]=" << i.getID() <<
";" <<
endl;
400 }
401 }
402 }
403}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
double getT0() const
Get time offset.
Lookup table for PMT addresses in detector.
Lookup table for PMT addresses in optical module.
Data structure for a composite optical module.
void rotate(const JRotation3D &R)
Rotate module.
Data structure for PMT physical address.
Data structure for PMT geometry, calibration and status.
Data structure for unit quaternion in three dimensions.
double getY() const
Get y position.
double getZ() const
Get z position.
double getX() const
Get x position.
double getDY() const
Get y direction.
double getDX() const
Get x direction.
double getDZ() const
Get z direction.
int getID() const
Get identifier.
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
void copy(const Head &from, JHead &to)
Copy header from from to to.
JMODEL::JString getString(const JFit &fit)
Get model parameters of string.
const char *const string_t
routing by string
int getNumberOfPMTs(const JModule &module)
Get number of PMTs.
int getNumberOfFloors(const JDetector &detector)
Get number of floors.
JDetectorBuilder & getDetectorBuilder()
Get detector builder.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
bool isORCADetector(const JDetectorHeader &header)
Check if given detector header is compatible with that of ORCA.
bool isARCADetector(const JDetectorHeader &header)
Check if given detector header is compatible with tat of ARCA.
JDetectorAddressMap & getDetectorAddressMap()
Get detector address map.
int getNumberOfModules(const JDetector &detector, const bool option=false)
Get number of modules.
double getMinimalDistance(const JDetector &detector)
Get minimal distance between modules in detector.
double getMaximalDistance(const JDetector &detector, const bool option=false)
Get maximal distance between modules in detector.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
double getMaximalTime(const double R_Hz)
Get maximal time for given rate.
Auxiliary data structure for sequence of same character.
Auxiliary data structure for floating point format specification.
Auxiliary interface for building detector.
Auxiliary data structure for decomposition of quaternion in twist and swing quaternions.
status_type getStatus(const JType< status_type > &type) const
Get status.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary class for date and time.
std::string toString() const
Get ASCII formatted date and time.
Auxiliary data structure for floating point format specification.