29   const char* 
const default_t    =  
"default";      
 
   31   const char* 
const modules_t    =  
"modules";      
 
   32   const char* 
const pmts_t       =  
"pmts";         
 
   33   const char* 
const geometry_t   =  
"geometry";     
 
   35   const char* 
const comment_t    =  
"comment";      
 
   36   const char* 
const header_t     =  
"header";       
 
   37   const char* 
const identifier_t =  
"identifier";   
 
   38   const char* 
const version_t    =  
"version";      
 
   39   const char* 
const can_t        =  
"can";          
 
   40   const char* 
const center_t     =  
"center";       
 
   41   const char* 
const summary_t    =  
"summary";      
 
   43   const char* 
const HEADER_t     =  
"HEADER";       
 
   44   const char* 
const IDENTIFIER_t =  
"IDENTIFIER";   
 
   45   const char* 
const VERSION_t    =  
"VERSION";      
 
   46   const char* 
const CAN_t        =  
"CAN";          
 
   47   const char* 
const CENTER_t     =  
"CENTER";       
 
   48   const char* 
const SUMMARY_t    =  
"SUMMARY";      
 
   58 int main(
int argc, 
char **argv)
 
   69     JParser<> zap(
"Auxiliary program to print detector file in human friendly format.");
 
   99   catch(
const exception &error) {
 
  100     FATAL(error.what() << endl);
 
  109   catch(
const JException& error) {
 
  113   if        (option == default_t) {
 
  117   } 
else if (option == modules_t) {
 
  121     for (JDetector::const_iterator module = 
detector.begin(); module != 
detector.end(); ++module) {
 
  124       cout << 
' ' << noshowpos << setw(8) << right << module->getID();
 
  125       cout << 
' ' << noshowpos << setw(3) << right << module->getString();
 
  126       cout << 
' ' << noshowpos << setw(2) << right << module->getFloor();
 
  127       cout << 
' ' << 
FIXED(7,2) << module->getX();
 
  128       cout << 
' ' << 
FIXED(7,2) << module->getY();
 
  129       cout << 
' ' << 
FIXED(7,2) << module->getZ();
 
  130       cout << 
' ' << 
FIXED(8,2) << module->getT0();
 
  132       if (module->getFloor() != 0) {
 
  134           JModule buffer = demo.getModule(module->getID(), module->getLocation());
 
  141           cout << 
' ' << 
FIXED(7,2) << phi;
 
  144           const JQuaternion3D 
Q = module->getQuaternion();
 
  149           cout << 
' ' << 
FIXED(7,2) << phi;         
 
  156   } 
else if (option == pmts_t) {
 
  158     for (JDetector::const_iterator module = 
detector.begin(); module != 
detector.end(); ++module) {
 
  159       for (JModule::const_iterator pmt = module->begin(); pmt != module->end(); ++pmt) {
 
  161         cout << 
' ' << noshowpos << setw(8) << right << pmt->getID();
 
  162         cout << 
' ' << 
FIXED(7,2) << pmt->getX();
 
  163         cout << 
' ' << 
FIXED(7,2) << pmt->getY();
 
  164         cout << 
' ' << 
FIXED(7,2) << pmt->getZ();
 
  165         cout << 
' ' << 
FIXED(6,3) << pmt->getDX();
 
  166         cout << 
' ' << 
FIXED(6,3) << pmt->getDY();
 
  167         cout << 
' ' << 
FIXED(6,3) << pmt->getDZ();
 
  168         cout << 
' ' << 
FIXED(8,2) << pmt->getT0();
 
  169         cout << 
' ' << noshowpos << setw(8) << right << pmt->getStatus();
 
  174   } 
else if (option == geometry_t) {
 
  179   } 
else if (option == comment_t) {
 
  183   } 
else if (option == header_t ||
 
  184              option == HEADER_t) {
 
  186     if (option == header_t) {
 
  188       cout << 
detector.getProperties() << endl;
 
  192       cout << 
"validity = "  
  193            << JDateAndTime(
detector.getLowerLimit(), 
true).toString() << 
' ' 
  194            << JDateAndTime(
detector.getUpperLimit(), 
true).toString() << endl;
 
  198       cout << 
"set_variable UTM_EAST         " << 
FIXED(12,2) << 
detector.getUTMEast()  << 
";" << endl;
 
  199       cout << 
"set_variable UTM_NORTH        " << 
FIXED(12,2) << 
detector.getUTMNorth() << 
";" << endl;
 
  200       cout << 
"set_variable UTM_Z            " << 
FIXED(12,2) << 
detector.getUTMZ()     << 
";" << endl;
 
  201       cout << 
"set_variable UTM_ZONE         " << 
FIXED(12,2) << 
detector.getUTMZone()  << 
";" << endl;
 
  202       cout << 
"set_variable UTM_WGS          " << 
FIXED(12,2) << 
detector.getWGS()      << 
";" << endl;
 
  205   } 
else if (option == version_t || 
 
  206              option == VERSION_t) {
 
  208     if (option == version_t) {
 
  210       cout << 
detector.getVersion() << endl;
 
  214       cout << 
"set_variable DETECTOR_VERSION " << 
detector.getVersion() << 
";" << endl;
 
  217   } 
else if (option == identifier_t ||
 
  218              option == IDENTIFIER_t) {
 
  220     if (option == identifier_t) {
 
  222       cout << 
"Detector " << 
detector.getID() << endl;
 
  226       cout << 
"set_variable DETECTOR_ID      " << 
detector.getID() << 
";" << endl;
 
  229   } 
else if (option == can_t ||
 
  234     const double      V = (cylinder.getZmax() - cylinder.getZmin()) * 
PI * cylinder.getRadius() * cylinder.getRadius(); 
 
  237     if (option == can_t) {
 
  239       cout << 
"X        = " << 
FIXED(7,1)       << cylinder.getX()      << endl;
 
  240       cout << 
"Y        = " << 
FIXED(7,1)       << cylinder.getY()      << endl;
 
  241       cout << 
"Zmin     = " << 
FIXED(7,1)       << cylinder.getZmin()   << endl;
 
  242       cout << 
"Zmax     = " << 
FIXED(7,1)       << cylinder.getZmax()   << endl;
 
  243       cout << 
"Radius   = " << 
FIXED(7,1)       << cylinder.getRadius() << endl;
 
  244       cout << 
"Depth    = " << 
FIXED(7,1)       << 
detector.getUTMZ()   << endl;
 
  245       cout << 
"Volume   = " << 
SCIENTIFIC(12,3) << V                    << endl;
 
  246       cout << 
"Distance = " << 
FIXED(9,3)       << D                    << endl;
 
  250       cout << 
"set_variable CAN_X_M        " << 
FIXED(7,1)       << cylinder.getX()           << 
";" << endl;
 
  251       cout << 
"set_variable CAN_Y_M        " << 
FIXED(7,1)       << cylinder.getY()           << 
";" << endl;
 
  252       cout << 
"set_variable CAN_ZMIN_M     " << 
FIXED(7,1)       << cylinder.getZmin()        << 
";" << endl;
 
  253       cout << 
"set_variable CAN_ZMAX_M     " << 
FIXED(7,1)       << cylinder.getZmax()        << 
";" << endl;
 
  254       cout << 
"set_variable CAN_RADIUS_M   " << 
FIXED(7,1)       << cylinder.getRadius()      << 
";" << endl;
 
  255       cout << 
"set_variable CAN_DEPTH_M    " << 
FIXED(7,1)       << 
detector.getUTMZ()        << 
";" << endl;
 
  256       cout << 
"set_variable CAN_VOLUME_M3  " << 
SCIENTIFIC(12,3) << V                         << 
";" << endl;
 
  257       cout << 
"set_variable CAN_DISTANCE_M " << 
FIXED(9,3)       << D                         << 
";" << endl;
 
  260   } 
else if (option == center_t || 
 
  261              option == CENTER_t) {
 
  265     if (option == center_t) {
 
  268       cout << showpos << 
FIXED(8,3) << center.getX() << 
' ';
 
  269       cout << showpos << 
FIXED(8,3) << center.getY() << 
' ';
 
  270       cout << showpos << 
FIXED(8,3) << center.getZ() << endl;
 
  274       cout << 
"set_variable CENTER_X_M " << 
FIXED(7,1) << center.getX() << 
";" << endl;
 
  275       cout << 
"set_variable CENTER_Y_M " << 
FIXED(7,1) << center.getY() << 
";" << endl;
 
  276       cout << 
"set_variable CENTER_Z_M " << 
FIXED(7,1) << center.getZ() << 
";" << endl;
 
  279   } 
else if (option == summary_t ||
 
  280              option == SUMMARY_t) {
 
  294     for (JDetector::const_iterator module = 
detector.begin(); module != 
detector.end(); ++module) {
 
  295       strings.insert(module->getString());
 
  298     if (option == summary_t) {
 
  300       cout << 
"Number of strings = " << setw(4) << numberOfStrings << endl;
 
  301       cout << 
"Number of floors  = " << setw(4) << numberOfFloors  << endl;
 
  302       cout << 
"Number of modules = " << setw(4) << numberOfModules << endl;
 
  303       cout << 
"Number of PMTs    = " << setw(4) << numberOfPMTs    << endl;
 
  304       cout << 
"First string      = " << setw(4) << 
string.first    << endl;
 
  305       cout << 
"Last  string      = " << setw(4) << 
string.second   << endl;
 
  306       cout << 
"First floor       = " << setw(4) << floor .first    << endl;
 
  307       cout << 
"Last  floor       = " << setw(4) << floor .second   << endl;
 
  311       cout << 
"set_variable NUMBER_OF_STRINGS " << setw(4) << numberOfStrings << 
";" << endl;
 
  312       cout << 
"set_variable NUMBER_OF_FLOORS  " << setw(4) << numberOfFloors  << 
";" << endl;
 
  313       cout << 
"set_variable NUMBER_OF_MODULES " << setw(4) << numberOfModules << 
";" << endl;
 
  314       cout << 
"set_variable NUMBER_OF_PMTS    " << setw(4) << numberOfPMTs    << 
";" << endl;
 
  315       cout << 
"set_variable FIRST_STRING      " << setw(4) << 
string.first    << 
";" << endl;
 
  316       cout << 
"set_variable LAST_STRING       " << setw(4) << 
string.second   << 
";" << endl;
 
  317       cout << 
"set_variable FIRST_FLOOR       " << setw(4) << floor .first    << 
";" << endl;
 
  318       cout << 
"set_variable LAST_FLOOR        " << setw(4) << floor .second   << 
";" << endl;
 
  319       cout << 
"set_array    STRINGS           ";
 
  320       copy(strings.begin(), strings.end(), ostream_iterator<int>(cout, 
" "));
 
bool isORCADetector(const JDetectorHeader &header)
Check if given detector header is compatible with that of ORCA. 
 
Utility class to parse command line options. 
 
Q(UTCMax_s-UTCMin_s)-livetime_s
 
int main(int argc, char *argv[])
 
bool isARCADetector(const JDetectorHeader &header)
Check if given detector header is compatible with tat of ARCA. 
 
int getNumberOfPMTs(const JModule &module)
Get number of PMTs. 
 
static JRotation getRotation
Function object to get rotation matrix to go from first to second module. 
 
then usage $script< detector specific pre-calibration script >< option > nAuxiliary script to make scan of pre stretching of detector strings(see JEditDetector)." "\nPossible options
 
Auxiliary data structure for floating point format specification. 
 
static const JModuleCounter getNumberOfModules
Function object to count unique modules. 
 
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
 
Data structure for detector geometry and calibration. 
 
JMODEL::JString getString(const JFit &fit)
Get model parameters of string. 
 
I/O formatting auxiliaries. 
 
JQuaternion3D twist
rotation around parallel axis 
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object 
 
const array_type< JValue_t > & make_array(const JValue_t(&array)[N])
Method to create array of values. 
 
int getNumberOfFloors(const JDetector &detector)
Get number of floors. 
 
static const double PI
Mathematical constants. 
 
double getMaximalTime(const double R_Hz)
Get maximal time for given rate. 
 
General purpose messaging. 
 
static const JStringCounter getNumberOfStrings
Function object to count unique strings. 
 
double getAngle() const 
Get rotation angle. 
 
void load(const std::string &file_name, JDetector &detector)
Load detector from input file. 
 
Auxiliary class to define a range between two values. 
 
Utility class to parse command line options. 
 
static const JVector3D JVector3Z_t(0, 0, 1)
unit z-vector 
 
void copy(const Head &from, JHead &to)
Copy header from from to to. 
 
double getMaximalDistance(const JDetector &detector, const bool option=false)
Get maximal distance between modules in detector. 
 
double getDot(const JVector3D &vector) const 
Get dot product. 
 
do set_variable DETECTOR_TXT $WORKDIR detector
 
JDetectorBuilder & getDetectorBuilder()
Get detector builder. 
 
Auxiliary data structure for decomposition of quaternion in twist and swing quaternions. 
 
Auxiliary data structure for floating point format specification. 
 
do echo Generating $dir eval D
 
Data structure for optical module.