25{
28
29 string detectorFile;
32
33 try {
34
35 JParser<> zap(
"Auxiliary program to draw the z-positions of the modules in detector.");
36
40
41 zap(argc, argv);
42 }
43 catch(const exception &error) {
44 FATAL(error.what() << endl);
45 }
46
47
49
50 try {
52 }
55 }
56
57 const double V = 0.61 * C;
58
59 JManager<int, TH1D> H1(new TH1D("H[%].s", NULL, 500, -1.0e3, 1.0e+3));
61
64
65 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
66
67 if (module->getFloor() == 1) {
68 z0[module->getString()] = module->getZ() - getAverage(make_array(module->begin(), module->end(), &JPMT::getT0)) * V;
69 }
70
71 z1[module->getString()][module->getFloor()] = module->getZ();
72 }
73
74 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
75
76 if (module->getFloor() != 0) {
77
78 const double ds = module->getZ() - getAverage(make_array(module->begin(), module->end(), &JPMT::getT0)) * V - z0[module->getString()];
79
80 HA[module->getString()].put((Double_t) module->getFloor(), module->getZ());
81 H1[module->getString()]->Fill(ds);
82 }
83 }
84
86
87 out << H1;
88
91 }
92
93 for (auto& string : z1) {
94
96
97 for (auto& module : string.second) {
98 if (module.first > 0 && string.second.count(module.first - 1) != 0) {
99 g1.put((Double_t) module.first, module.second -
string.second[module.first - 1]);
100 }
101 }
102
104 }
105
106 out.Write();
107 out.Close();
108
109}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define MAKE_CSTRING(A)
Make C-string.
Double_t g1(const Double_t x)
Function.
Utility class to parse command line options.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary data structure to build TGraph.