29int main(
int argc,
char **argv)
43 JParser<> zap(
"Auxiliary program to project single PMT data from 2D histogram.");
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;
54 catch(
const exception &error) {
55 FATAL(error.what() << endl);
59 gErrorIgnoreLevel = kError;
81 if (
debug >= debug_t) {
87 cout << setw(3) << i <<
" -> (" <<
FILL(2,
'0') <<
pair.first <<
"," <<
FILL(2,
'0') <<
pair.second <<
FILL() <<
")" << endl;
91 TFile in(inputFile.c_str(),
"read");
100 h2->GetYaxis()->GetNbins(), h2->GetYaxis()->GetXmin(), h2->GetYaxis()->GetXmax());
103 module.size(), -0.5, module.size() - 0.5,
104 h2->GetYaxis()->GetNbins(), h2->GetYaxis()->GetXmin(), h2->GetYaxis()->GetXmax());
106 for (
int i = 0; i != (int)
module.size(); ++i) {
112 for (Int_t iy = 1; iy <= h2->GetYaxis()->GetNbins(); ++iy) {
114 ha.SetBinContent(iy, ha.GetBinContent(iy) + h2->GetBinContent(ix,iy));
115 ha.SetBinError (iy, hypot(ha.GetBinError (iy), h2->GetBinError (ix,iy)));
117 hb.SetBinContent(i + 1, iy, h2->GetBinContent(ix,iy));
118 hb.SetBinError (i + 1, iy, h2->GetBinError (ix,iy));