24 const char*
const default_t =
"default";
26 const char*
const modules_t =
"modules";
27 const char*
const pmts_t =
"pmts";
28 const char*
const geometry_t =
"geometry";
30 const char*
const comment_t =
"comment";
31 const char*
const header_t =
"header";
32 const char*
const identifier_t =
"identifier";
33 const char*
const version_t =
"version";
34 const char*
const can_t =
"can";
35 const char*
const center_t =
"center";
36 const char*
const summary_t =
"summary";
38 const char*
const HEADER_t =
"HEADER";
39 const char*
const IDENTIFIER_t =
"IDENTIFIER";
40 const char*
const VERSION_t =
"VERSION";
41 const char*
const CAN_t =
"CAN";
42 const char*
const CENTER_t =
"CENTER";
43 const char*
const SUMMARY_t =
"SUMMARY";
53 int main(
int argc,
char **argv)
63 JParser<> zap(
"Auxiliary program to print detector file in human friendly format.");
93 catch(
const exception &error) {
94 FATAL(error.what() << endl);
109 if (option == default_t) {
113 }
else if (option == modules_t) {
115 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
118 cout <<
' ' << noshowpos << setw(8) << right << module->getID();
119 cout <<
' ' << noshowpos << setw(3) << right << module->getString();
120 cout <<
' ' << noshowpos << setw(2) << right << module->getFloor();
121 cout <<
' ' <<
FIXED(7,2) << module->getX();
122 cout <<
' ' <<
FIXED(7,2) << module->getY();
123 cout <<
' ' <<
FIXED(7,2) << module->getZ();
124 cout <<
' ' <<
FIXED(8,2) << module->getT0();
128 }
else if (option == pmts_t) {
130 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
131 for (JModule::const_iterator pmt = module->begin(); pmt != module->end(); ++pmt) {
134 cout <<
' ' << noshowpos << setw(8) << right << pmt->getID();
135 cout <<
' ' <<
FIXED(7,2) << pmt->getX();
136 cout <<
' ' <<
FIXED(7,2) << pmt->getY();
137 cout <<
' ' <<
FIXED(7,2) << pmt->getZ();
138 cout <<
' ' <<
FIXED(6,3) << pmt->getDX();
139 cout <<
' ' <<
FIXED(6,3) << pmt->getDY();
140 cout <<
' ' <<
FIXED(6,3) << pmt->getDZ();
141 cout <<
' ' <<
FIXED(8,2) << pmt->getT0();
142 cout <<
' ' << noshowpos << setw(8) << right << pmt->getStatus();
147 }
else if (option == geometry_t) {
152 }
else if (option == comment_t) {
156 }
else if (option == header_t ||
157 option == HEADER_t) {
159 if (option == header_t) {
161 cout <<
detector.getProperties() << endl;
168 cout <<
"set_variable UTM_EAST " <<
FIXED(12,2) <<
detector.getUTMEast() <<
";" << endl;
169 cout <<
"set_variable UTM_NORTH " <<
FIXED(12,2) <<
detector.getUTMNorth() <<
";" << endl;
170 cout <<
"set_variable UTM_Z " <<
FIXED(12,2) <<
detector.getUTMZ() <<
";" << endl;
171 cout <<
"set_variable UTM_ZONE " <<
FIXED(12,2) <<
detector.getUTMZone() <<
";" << endl;
172 cout <<
"set_variable UTM_WGS " <<
FIXED(12,2) <<
detector.getWGS() <<
";" << endl;
175 }
else if (option == version_t ||
176 option == VERSION_t) {
178 if (option == version_t) {
180 cout <<
detector.getVersion() << endl;
184 cout <<
"set_variable DETECTOR_VERSION " <<
detector.getVersion() <<
";" << endl;
187 }
else if (option == identifier_t ||
188 option == IDENTIFIER_t) {
190 if (option == identifier_t) {
192 cout <<
"Detector " <<
detector.getID() << endl;
196 cout <<
"set_variable DETECTOR_ID " <<
detector.getID() <<
";" << endl;
199 }
else if (option == can_t ||
204 const double V = (cylinder.getZmax() - cylinder.getZmin()) *
PI * cylinder.getRadius() * cylinder.getRadius();
207 if (option == can_t) {
209 cout <<
"X = " <<
FIXED(7,1) << cylinder.getX() << endl;
210 cout <<
"Y = " <<
FIXED(7,1) << cylinder.getY() << endl;
211 cout <<
"Zmin = " <<
FIXED(7,1) << cylinder.getZmin() << endl;
212 cout <<
"Zmax = " <<
FIXED(7,1) << cylinder.getZmax() << endl;
213 cout <<
"Radius = " <<
FIXED(7,1) << cylinder.getRadius() << endl;
214 cout <<
"Depth = " <<
FIXED(7,1) <<
detector.getUTMZ() << endl;
215 cout <<
"Volume = " <<
SCIENTIFIC(12,3) << V << endl;
216 cout <<
"Distance = " <<
FIXED(9,3) << D << endl;
220 cout <<
"set_variable CAN_X_M " <<
FIXED(7,1) << cylinder.getX() <<
";" << endl;
221 cout <<
"set_variable CAN_Y_M " <<
FIXED(7,1) << cylinder.getY() <<
";" << endl;
222 cout <<
"set_variable CAN_ZMIN_M " <<
FIXED(7,1) << cylinder.getZmin() <<
";" << endl;
223 cout <<
"set_variable CAN_ZMAX_M " <<
FIXED(7,1) << cylinder.getZmax() <<
";" << endl;
224 cout <<
"set_variable CAN_RADIUS_M " <<
FIXED(7,1) << cylinder.getRadius() <<
";" << endl;
225 cout <<
"set_variable CAN_DEPTH_M " <<
FIXED(7,1) <<
detector.getUTMZ() <<
";" << endl;
226 cout <<
"set_variable CAN_VOLUME_M3 " <<
SCIENTIFIC(12,3) << V <<
";" << endl;
227 cout <<
"set_variable CAN_DISTANCE_M " <<
FIXED(9,3) << D <<
";" << endl;
230 }
else if (option == center_t ||
231 option == CENTER_t) {
235 if (option == center_t) {
238 cout << showpos <<
FIXED(8,3) << center.getX() <<
' ';
239 cout << showpos <<
FIXED(8,3) << center.getY() <<
' ';
240 cout << showpos <<
FIXED(8,3) << center.getZ() << endl;
244 cout <<
"set_variable CENTER_X_M " <<
FIXED(7,1) << center.getX() <<
";" << endl;
245 cout <<
"set_variable CENTER_Y_M " <<
FIXED(7,1) << center.getY() <<
";" << endl;
246 cout <<
"set_variable CENTER_Z_M " <<
FIXED(7,1) << center.getZ() <<
";" << endl;
249 }
else if (option == summary_t ||
250 option == SUMMARY_t) {
264 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
265 strings.insert(module->getString());
268 if (option == summary_t) {
270 cout <<
"Number of strings = " << setw(4) << numberOfStrings << endl;
271 cout <<
"Number of floors = " << setw(4) << numberOfFloors << endl;
272 cout <<
"Number of modules = " << setw(4) << numberOfModules << endl;
273 cout <<
"Number of PMTs = " << setw(4) << numberOfPMTs << endl;
274 cout <<
"First string = " << setw(4) <<
string.first << endl;
275 cout <<
"Last string = " << setw(4) <<
string.second << endl;
276 cout <<
"First floor = " << setw(4) << floor .
first << endl;
277 cout <<
"Last floor = " << setw(4) << floor .
second << endl;
281 cout <<
"set_variable NUMBER_OF_STRINGS " << setw(4) << numberOfStrings <<
";" << endl;
282 cout <<
"set_variable NUMBER_OF_FLOORS " << setw(4) << numberOfFloors <<
";" << endl;
283 cout <<
"set_variable NUMBER_OF_MODULES " << setw(4) << numberOfModules <<
";" << endl;
284 cout <<
"set_variable NUMBER_OF_PMTS " << setw(4) << numberOfPMTs <<
";" << endl;
285 cout <<
"set_variable FIRST_STRING " << setw(4) <<
string.first <<
";" << endl;
286 cout <<
"set_variable LAST_STRING " << setw(4) <<
string.second <<
";" << endl;
287 cout <<
"set_variable FIRST_FLOOR " << setw(4) << floor .
first <<
";" << endl;
288 cout <<
"set_variable LAST_FLOOR " << setw(4) << floor .
second <<
";" << endl;
289 cout <<
"set_array STRINGS ";
290 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.
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.
Type definition of range.
double getMaximalDistance(const JDetector &detector)
Get maximal distance between modules in detector.
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.
then usage $script< detector specific acoustics-fit script >< option > nAuxiliary script to make scan of pre stretching of detector strings(see JEditDetector)." "\nPossible options
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.
do set_variable DETECTOR_TXT $WORKDIR detector
Auxiliary data structure for floating point format specification.
do echo Generating $dir eval D