70int main(
int argc,
char **argv)
82 JParser<> zap(
"Auxiliary program to print detector file in human friendly format.");
109 zap[
'p'] =
make_field(precision,
"precision for match with reference module") = 1.0e-5;
114 catch(
const exception &error) {
128 if (option.empty() || option.count(
default_t)) {
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();
149 if (
module->getFloor() != 0) {
156 const double phi = (JVector3Z_t.getDot(
q1.twist) >= 0.0 ? +1.0 : -1.0) *
q1.twist.getAngle();
164 const double phi = (JVector3Z_t.getDot(
q1.twist) >= 0.0 ? +1.0 : -1.0) *
q1.twist.getAngle();
175 cout <<
' ' << (JModule::compare(buffer, *
module, precision) ?
"==" :
"!=")
176 <<
' ' << (
demo.get(
module->getID()) ==
demo.getDefaultModuleAddressMap() ?
"default" :
"custom");
185 if (option.count(
pmts_t)) {
193 for (
size_t i = 0; i !=
module->size(); ++i) {
195 const JPMT& pmt =
module->getPMT(i);
199 cout <<
' ' << address;
226 cout <<
"set_variable MAXIMAL_DISTANCE_M " <<
FIXED(6,1) << getMaximalDistance(
detector) <<
";" <<
endl;
227 cout <<
"set_variable MINIMAL_DISTANCE_M " <<
FIXED(6,1) << getMinimalDistance(
detector) <<
";" <<
endl;
244 cout <<
"name = " << (isARCADetector(
detector) ?
"ARCA" :
247 cout <<
"validity = "
271 cout <<
"set_variable DETECTOR_VERSION " <<
detector.getVersion() <<
";" <<
endl;
290 if (option.count(
can_t) ||
291 option.count(
CAN_t)) {
296 const double D = getMaximalDistance(
detector);
298 if (option.count(
can_t)) {
318 cout <<
"set_variable CAN_DISTANCE_M " <<
FIXED(9,3) << D <<
";" <<
endl;
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;
348 const int numberOfFloors = getNumberOfFloors (
detector);
349 const int numberOfModules = getNumberOfModules(
detector);
354 const JRange_t string_t(make_array(
detector.begin(),
detector.end(), &JModule::getString));
361 strings.insert(
module->getString());
362 modules.insert(
module->getID());
368 cout <<
"Number of floors = " <<
setw(4) << numberOfFloors <<
endl;
369 cout <<
"Number of modules = " <<
setw(4) << numberOfModules <<
endl;
371 cout <<
"First string = " <<
setw(4) << string_t.first <<
endl;
372 cout <<
"Last string = " <<
setw(4) << string_t.second <<
endl;
379 cout <<
"let \"NUMBER_OF_FLOORS = " <<
setw(5) << numberOfFloors <<
"\";" <<
endl;
380 cout <<
"let \"NUMBER_OF_MODULES = " <<
setw(5) << numberOfModules <<
"\";" <<
endl;
382 cout <<
"let \"FIRST_STRING = " <<
setw(5) << string_t.first <<
"\";" <<
endl;
383 cout <<
"let \"LAST_STRING = " <<
setw(5) << string_t.second <<
"\";" <<
endl;
395 for (
const auto i : strings) {
396 cout <<
"typeset -A " << getString(i) <<
";" <<
endl;
399 cout << getString(i.getString()) <<
"[" << i.getFloor() <<
"]=" << i.getID() <<
";" <<
endl;