Example program to compare dynamic position calibrations.
55 JParser<> zap(
"Example program to compare dynamic position calibrations.");
58 zap[
'f'] =
make_field(calibrationFile1,
"output of JKatoomba[.sh]");
59 zap[
'F'] =
make_field(calibrationFile2,
"output of JKatoomba[.sh]");
66 catch(
const exception &error) {
67 FATAL(error.what() << endl);
85 STATUS(
"loading input from file " << calibrationFile1 <<
"... " << flush);
87 dynamics1.load(calibrationFile1);
91 Double_t xmin1 = numeric_limits<Double_t>::max();
92 Double_t xmax1 = numeric_limits<Double_t>::lowest();
96 if (!
string->second.empty()) {
97 xmin1 = min(xmin1,
string->second.getXmin());
98 xmax1 = max(xmax1,
string->second.getXmax());
104 STATUS(
"loading input from file " << calibrationFile1 <<
"... " << flush);
106 dynamics2.load(calibrationFile2);
110 Double_t xmin2 = numeric_limits<Double_t>::max();
111 Double_t xmax2 = numeric_limits<Double_t>::lowest();
115 if (!
string->second.empty()) {
116 xmin2 = min(xmin2,
string->second.getXmin());
117 xmax2 = max(xmax2,
string->second.getXmax());
121 Double_t
xmin = numeric_limits<Double_t>::max();
122 Double_t
xmax = numeric_limits<Double_t>::lowest();
125 xmin = max(xmin1, xmin2);
126 xmax = min(xmax1, xmax2);
128 const JFormat_t format(4, 0, std::ios_base::fmtflags(),
'0');
138 if (string1->first == string2->first) {
140 TH1D* hc = HC[string1->first];
141 TH1D* hd = HD[string1->first];
143 for (Double_t t =
xmin; t <=
xmax; t = t + Tstep_s) {
145 HO[string1->first].put(t, (string1->second(t).tx - string2->second(t).tx) * 1000);
146 HA[string1->first].put(t, (string1->second(t).ty - string2->second(t).ty) * 1000);
147 hc->Fill((string1->second(t).tx - string2->second(t).tx) * 1000);
148 hd->Fill((string1->second(t).ty - string2->second(t).ty) * 1000);
Utility class to parse command line options.
static JDetectorMechanics getMechanics
Function object to get string mechanics.
#define MAKE_CSTRING(A)
Make C-string.
Auxiliary data structure to build TGraph.
data_type::const_iterator const_iterator
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys...
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
void load(const std::string &file_name)
Load mechanical model parameters from file.
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.
do set_variable DETECTOR_TXT $WORKDIR detector