25 const char*
const default_t =
"default";
27 const char*
const modules_t =
"modules";
28 const char*
const pmts_t =
"pmts";
29 const char*
const geometry_t =
"geometry";
31 const char*
const comment_t =
"comment";
32 const char*
const header_t =
"header";
33 const char*
const identifier_t =
"identifier";
34 const char*
const version_t =
"version";
35 const char*
const can_t =
"can";
36 const char*
const center_t =
"center";
37 const char*
const summary_t =
"summary";
39 const char*
const HEADER_t =
"HEADER";
40 const char*
const IDENTIFIER_t =
"IDENTIFIER";
41 const char*
const VERSION_t =
"VERSION";
42 const char*
const CAN_t =
"CAN";
43 const char*
const CENTER_t =
"CENTER";
44 const char*
const SUMMARY_t =
"SUMMARY";
54 int main(
int argc,
char **argv)
64 JParser<> zap(
"Auxiliary program to print detector file in human friendly format.");
94 catch(
const exception &error) {
95 FATAL(error.what() << endl);
105 catch(
const JException& error) {
110 if (option == default_t) {
114 }
else if (option == modules_t) {
116 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
119 cout <<
' ' << noshowpos << setw(8) << right << module->getID();
120 cout <<
' ' << noshowpos << setw(3) << right << module->getString();
121 cout <<
' ' << noshowpos << setw(2) << right << module->getFloor();
122 cout <<
' ' <<
FIXED(7,2) << module->getX();
123 cout <<
' ' <<
FIXED(7,2) << module->getY();
124 cout <<
' ' <<
FIXED(7,2) << module->getZ();
125 cout <<
' ' <<
FIXED(8,2) << module->getT0();
129 }
else if (option == pmts_t) {
131 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
132 for (JModule::const_iterator pmt = module->begin(); pmt != module->end(); ++pmt) {
135 cout <<
' ' << noshowpos << setw(8) << right << pmt->getID();
136 cout <<
' ' <<
FIXED(7,2) << pmt->getX();
137 cout <<
' ' <<
FIXED(7,2) << pmt->getY();
138 cout <<
' ' <<
FIXED(7,2) << pmt->getZ();
139 cout <<
' ' <<
FIXED(6,3) << pmt->getDX();
140 cout <<
' ' <<
FIXED(6,3) << pmt->getDY();
141 cout <<
' ' <<
FIXED(6,3) << pmt->getDZ();
142 cout <<
' ' <<
FIXED(8,2) << pmt->getT0();
143 cout <<
' ' << noshowpos << setw(8) << right << pmt->getStatus();
148 }
else if (option == geometry_t) {
153 }
else if (option == comment_t) {
157 }
else if (option == header_t ||
158 option == HEADER_t) {
160 if (option == header_t) {
162 cout <<
detector.getProperties() << endl;
166 cout <<
"validity = "
167 << JDateAndTime(
detector.getLowerLimit(),
true).toString() <<
' '
168 << JDateAndTime(
detector.getUpperLimit(),
true).toString() << endl;
172 cout <<
"set_variable UTM_EAST " <<
FIXED(12,2) <<
detector.getUTMEast() <<
";" << endl;
173 cout <<
"set_variable UTM_NORTH " <<
FIXED(12,2) <<
detector.getUTMNorth() <<
";" << endl;
174 cout <<
"set_variable UTM_Z " <<
FIXED(12,2) <<
detector.getUTMZ() <<
";" << endl;
175 cout <<
"set_variable UTM_ZONE " <<
FIXED(12,2) <<
detector.getUTMZone() <<
";" << endl;
176 cout <<
"set_variable UTM_WGS " <<
FIXED(12,2) <<
detector.getWGS() <<
";" << endl;
179 }
else if (option == version_t ||
180 option == VERSION_t) {
182 if (option == version_t) {
184 cout <<
detector.getVersion() << endl;
188 cout <<
"set_variable DETECTOR_VERSION " <<
detector.getVersion() <<
";" << endl;
191 }
else if (option == identifier_t ||
192 option == IDENTIFIER_t) {
194 if (option == identifier_t) {
196 cout <<
"Detector " <<
detector.getID() << endl;
200 cout <<
"set_variable DETECTOR_ID " <<
detector.getID() <<
";" << endl;
203 }
else if (option == can_t ||
208 const double V = (cylinder.getZmax() - cylinder.getZmin()) *
PI * cylinder.getRadius() * cylinder.getRadius();
211 if (option == can_t) {
213 cout <<
"X = " <<
FIXED(7,1) << cylinder.getX() << endl;
214 cout <<
"Y = " <<
FIXED(7,1) << cylinder.getY() << endl;
215 cout <<
"Zmin = " <<
FIXED(7,1) << cylinder.getZmin() << endl;
216 cout <<
"Zmax = " <<
FIXED(7,1) << cylinder.getZmax() << endl;
217 cout <<
"Radius = " <<
FIXED(7,1) << cylinder.getRadius() << endl;
218 cout <<
"Depth = " <<
FIXED(7,1) <<
detector.getUTMZ() << endl;
219 cout <<
"Volume = " <<
SCIENTIFIC(12,3) << V << endl;
220 cout <<
"Distance = " <<
FIXED(9,3) << D << endl;
224 cout <<
"set_variable CAN_X_M " <<
FIXED(7,1) << cylinder.getX() <<
";" << endl;
225 cout <<
"set_variable CAN_Y_M " <<
FIXED(7,1) << cylinder.getY() <<
";" << endl;
226 cout <<
"set_variable CAN_ZMIN_M " <<
FIXED(7,1) << cylinder.getZmin() <<
";" << endl;
227 cout <<
"set_variable CAN_ZMAX_M " <<
FIXED(7,1) << cylinder.getZmax() <<
";" << endl;
228 cout <<
"set_variable CAN_RADIUS_M " <<
FIXED(7,1) << cylinder.getRadius() <<
";" << endl;
229 cout <<
"set_variable CAN_DEPTH_M " <<
FIXED(7,1) <<
detector.getUTMZ() <<
";" << endl;
230 cout <<
"set_variable CAN_VOLUME_M3 " <<
SCIENTIFIC(12,3) << V <<
";" << endl;
231 cout <<
"set_variable CAN_DISTANCE_M " <<
FIXED(9,3) << D <<
";" << endl;
234 }
else if (option == center_t ||
235 option == CENTER_t) {
239 if (option == center_t) {
242 cout << showpos <<
FIXED(8,3) << center.getX() <<
' ';
243 cout << showpos <<
FIXED(8,3) << center.getY() <<
' ';
244 cout << showpos <<
FIXED(8,3) << center.getZ() << endl;
248 cout <<
"set_variable CENTER_X_M " <<
FIXED(7,1) << center.getX() <<
";" << endl;
249 cout <<
"set_variable CENTER_Y_M " <<
FIXED(7,1) << center.getY() <<
";" << endl;
250 cout <<
"set_variable CENTER_Z_M " <<
FIXED(7,1) << center.getZ() <<
";" << endl;
253 }
else if (option == summary_t ||
254 option == SUMMARY_t) {
268 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
269 strings.insert(module->getString());
272 if (option == summary_t) {
274 cout <<
"Number of strings = " << setw(4) << numberOfStrings << endl;
275 cout <<
"Number of floors = " << setw(4) << numberOfFloors << endl;
276 cout <<
"Number of modules = " << setw(4) << numberOfModules << endl;
277 cout <<
"Number of PMTs = " << setw(4) << numberOfPMTs << endl;
278 cout <<
"First string = " << setw(4) <<
string.first << endl;
279 cout <<
"Last string = " << setw(4) <<
string.second << endl;
280 cout <<
"First floor = " << setw(4) << floor .first << endl;
281 cout <<
"Last floor = " << setw(4) << floor .second << endl;
285 cout <<
"set_variable NUMBER_OF_STRINGS " << setw(4) << numberOfStrings <<
";" << endl;
286 cout <<
"set_variable NUMBER_OF_FLOORS " << setw(4) << numberOfFloors <<
";" << endl;
287 cout <<
"set_variable NUMBER_OF_MODULES " << setw(4) << numberOfModules <<
";" << endl;
288 cout <<
"set_variable NUMBER_OF_PMTS " << setw(4) << numberOfPMTs <<
";" << endl;
289 cout <<
"set_variable FIRST_STRING " << setw(4) <<
string.first <<
";" << endl;
290 cout <<
"set_variable LAST_STRING " << setw(4) <<
string.second <<
";" << endl;
291 cout <<
"set_variable FIRST_FLOOR " << setw(4) << floor .first <<
";" << endl;
292 cout <<
"set_variable LAST_FLOOR " << setw(4) << floor .second <<
";" << endl;
293 cout <<
"set_array STRINGS ";
294 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.
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.
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.
I/O formatting auxiliaries.
#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.
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.
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.
do set_variable DETECTOR_TXT $WORKDIR detector
Auxiliary data structure for floating point format specification.
do echo Generating $dir eval D