30{
33
34 string detectorFile;
35 string inputFile;
38 string extension;
40
41 try {
42
43 JParser<> zap(
"Auxiliary program to project single PMT data from 2D histogram.");
44
45 zap[
'a'] =
make_field(detectorFile,
"detector file.");
46 zap[
'f'] =
make_field(inputFile,
"input file.");
49 zap[
'e'] =
make_field(extension,
"histogram name extension") = _2R, _2S, _2F;
51
52 zap(argc, argv);
53 }
54 catch(const exception &error) {
55 FATAL(error.what() << endl);
56 }
57
58
59 gErrorIgnoreLevel = kError;
60
61
63
64 try {
66 }
69 }
70
72
74
76
78
80
81 if (
debug >= debug_t) {
82
84
86
87 cout << setw(3) << i <<
" -> (" <<
FILL(2,
'0') <<
pair.first <<
"," <<
FILL(2,
'0') <<
pair.second <<
FILL() <<
")" << endl;
88 }
89 }
90
91 TFile in(inputFile.c_str(), "read");
92
94
95 if (h2 == NULL) {
97 }
98
100 h2->GetYaxis()->GetNbins(), h2->GetYaxis()->GetXmin(), h2->GetYaxis()->GetXmax());
101
103 module.size(), -0.5, module.size() - 0.5,
104 h2->GetYaxis()->GetNbins(), h2->GetYaxis()->GetXmin(), h2->GetYaxis()->GetXmax());
105
106 for (int i = 0; i != (int) module.size(); ++i) {
107
109
111
112 for (Int_t iy = 1; iy <= h2->GetYaxis()->GetNbins(); ++iy) {
113
114 ha.SetBinContent(iy, ha.GetBinContent(iy) + h2->GetBinContent(ix,iy));
115 ha.SetBinError (iy, hypot(ha.GetBinError (iy), h2->GetBinError (ix,iy)));
116
117 hb.SetBinContent(i + 1, iy, h2->GetBinContent(ix,iy));
118 hb.SetBinError (i + 1, iy, h2->GetBinError (ix,iy));
119 }
120 }
121 }
122
124
125 out << ha << hb;
126
127 out.Write();
128 out.Close();
129}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define MAKE_CSTRING(A)
Make C-string.
Router for direct addressing of module data in detector data structure.
Data structure for a composite optical module.
int getModuleID() const
Get module identifier.
int getTDC() const
Get TDC.
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).
Auxiliary data structure for sequence of same character.
Auxiliary class to sort pairs of PMT addresses within optical module.