29int main(
int argc,
char **argv)
48 JParser<> zap(
"Auxiliary program to profile 2D histograms.");
50 zap[
'f'] =
make_field(inputFile,
"<input file>:<object name>");
56 zap[
'F'] =
make_field(format,
"format, e.g. \"%s %i\" or \"%s %f %f\"") =
"";
57 zap[
'O'] =
make_field(option,
"option, see TH2::Profile(X|Y)") =
"",
"s",
"i",
"g";
62 catch(
const exception &error) {
70 FATAL(
"Invalid operation: "
71 << (px ?
"" :
"no") <<
" X profiling " <<
" and "
72 << (
py ?
"" :
"no") <<
" Y profiling " <<
endl);
79 if (px) { format +=
"px"; }
80 if (
py) { format +=
"py"; }
82 if (X.empty() && Y.empty())
97 ERROR(
"File: " << input->getFullFilename() <<
" not opened." <<
endl);
107 const TString tag(key->GetName());
113 if (tag.Contains(
regexp) && isTObject(key)) {
115 TH2* h2 =
dynamic_cast<TH2*
>(key->ReadObj());
123 listOfObjects.push_back(h2->ProfileX(TString::Format(format.c_str(), h2->GetName()),
125 h2->GetYaxis()->GetNbins() + (overflow ? 1 : 0), option.c_str()));
129 for (
Int_t i = 0; i != (
Int_t) Y.size(); ++i) {
130 listOfObjects.push_back(h2->ProfileX(TString::Format(format.c_str(), h2->GetName(),
131 Y[i].getLowerLimit(),
132 Y[i].getUpperLimit()),
133 h2->GetYaxis()->FindBin(Y[i].getLowerLimit()),
134 h2->GetYaxis()->FindBin(Y[i].getUpperLimit()) - 1, option.c_str()));
143 listOfObjects.push_back(h2->ProfileY(TString::Format(format.c_str(), h2->GetName()),
145 h2->GetXaxis()->GetNbins() + (overflow ? 1 : 0), option.c_str()));
152 for (
Int_t i = 0; i != (
Int_t) Y.size(); ++i) {
154 listOfObjects.push_back(h2->ProfileY(TString::Format(format.c_str(), h2->GetName(),
155 X[i].getLowerLimit(),
156 X[i].getUpperLimit()),
157 h2->GetXaxis()->FindBin(X[i].getLowerLimit()),
158 h2->GetXaxis()->FindBin(X[i].getUpperLimit()) - 1, option.c_str()));