29 int main(
int argc,
char **argv)
34 const char*
const short_t =
"short";
35 const char*
const long_t =
"long";
36 const char*
const fft_t =
"fft";
47 JParser<> zap(
"Example program to print dynamic detector calibration.");
52 zap[
'F'] =
make_field(format) = short_t, long_t, fft_t;
58 catch(
const exception &error) {
59 FATAL(error.what() << endl);
78 dynamics.
load(calibrationFile);
86 ostream os(buffer.is_open() ? &buffer : cout.rdbuf());
90 comment.
add(
"documentation: https://common.pages.km3net.de/jpp/Position_calibration.PDF");
92 if (format == short_t)
93 comment.
add(
"format: string number; UTC [s]; Tx; Ty");
94 else if (format == long_t)
95 comment.
add(
"format: https://indico.cern.ch/event/1014814/contributions/4259426/attachments/2201529/3724129/KM3NeT_position_file_format.pdf");
96 else if (format == fft_t)
97 comment.
add(
"format: <T>");
101 comment.add(
JMeta(argc, argv));
108 if (format == short_t) {
115 os << setw(4) <<
string->first <<
';'
116 <<
FIXED(20,5) << i->getX() <<
';'
117 <<
FIXED( 9,6) << i->getY().tx <<
';'
118 <<
FIXED( 9,6) << i->getY().ty << endl;
123 if (format == long_t) {
130 const double t1 = i->getX();
134 os <<
FIXED(20,5) << t1 <<
' '
135 <<
FIXED(20,5) << t1 <<
' '
136 << setw(4) <<
detector.size() << endl;
138 for (JDetector::const_iterator module = dynamics.begin(); module != dynamics.end(); ++module) {
140 os << setw(4) << module->getString() <<
' '
141 << setw(2) << module->getFloor() <<
' '
142 << setw(10) << module->getID() << endl;
144 os <<
FIXED(9,2) << module->getX() <<
' '
145 <<
FIXED(9,2) << module->getY() <<
' '
146 <<
FIXED(9,2) << module->getZ() <<
' '
147 <<
FIXED(9,2) << -1.0 <<
' '
148 <<
FIXED(9,2) << -1.0 <<
' '
149 <<
FIXED(9,2) << -1.0 << endl;
154 if (format == fft_t) {
156 double xmin = numeric_limits<double>::max();
157 double xmax = numeric_limits<double>::lowest();
160 if (!
string->second.empty()) {
161 xmin = min(xmin,
string->second.getXmin());
162 xmax = max(xmax,
string->second.getXmax());
166 for (
double x = xmin;
x <=
xmax;
x += Tmax_s) {
171 if (!
string->second.empty()) {
Utility class to parse command line options.
Q(UTCMax_s-UTCMin_s)-livetime_s
int main(int argc, char *argv[])
static JDetectorMechanics getMechanics
Function object to get string mechanics.
ROOT TTree parameter settings.
JPosition position
position calibration
Auxiliary data structure for floating point format specification.
Data structure for detector geometry and calibration.
void load(JObjectIterator_t &input)
Load calibration data.
data_type::const_iterator const_iterator
const_iterator end() const
end of calibration data
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Dynamic detector calibration.
void load(const std::string &file_name)
Load mechanical model parameters from file.
General purpose messaging.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
bool update(const double t1_s)
Get detector calibrated at given time.
Dynamic detector calibration.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
General purpose class for object reading from a list of file names.
Utility class to parse command line options.
const_iterator begin() const
begin of calibration data
do set_variable DETECTOR_TXT $WORKDIR detector
#define DEBUG(A)
Message macros.