41int main(
int argc,
char **argv)
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);
82 STATUS(
"loading input from file " << calibrationFile1 <<
"... " << flush);
84 dynamics1.
load(calibrationFile1);
88 Double_t xmin1 = numeric_limits<Double_t>::max();
89 Double_t xmax1 = numeric_limits<Double_t>::lowest();
93 if (!string->second.empty()) {
94 xmin1 = min(xmin1, string->second.getXmin());
95 xmax1 = max(xmax1, string->second.getXmax());
101 STATUS(
"loading input from file " << calibrationFile1 <<
"... " << flush);
103 dynamics2.
load(calibrationFile2);
107 Double_t xmin2 = numeric_limits<Double_t>::max();
108 Double_t xmax2 = numeric_limits<Double_t>::lowest();
112 if (!string->second.empty()) {
113 xmin2 = min(xmin2, string->second.getXmin());
114 xmax2 = max(xmax2, string->second.getXmax());
118 Double_t xmin = numeric_limits<Double_t>::max();
119 Double_t xmax = numeric_limits<Double_t>::lowest();
122 xmin = max(xmin1, xmin2);
123 xmax = min(xmax1, xmax2);
125 const JFormat_t format(4, 0, std::ios_base::fmtflags(),
'0');
135 if (string1->first == string2->first) {
137 TH1D* hc = HC[string1->first];
138 TH1D* hd = HD[string1->first];
140 for (Double_t t = xmin; t <= xmax; t = t + Tstep_s) {
142 HO[string1->first].put(t, (string1->second(t).tx - string2->second(t).tx) * 1000);
143 HA[string1->first].put(t, (string1->second(t).ty - string2->second(t).ty) * 1000);
144 hc->Fill((string1->second(t).tx - string2->second(t).tx) * 1000);
145 hd->Fill((string1->second(t).ty - string2->second(t).ty) * 1000);