43 JParser<> zap(
"Auxiliary program to extract quantiles from 2D histogram.");
53 catch(
const exception &error) {
54 FATAL(error.what() << endl);
59 FATAL(
"No quantiles." << endl);
67 DEBUG(
"Input: " << *input << endl);
72 ERROR(
"File: " << input->getFullFilename() <<
" not opened." << endl);
76 const TRegexp regexp(input->getObjectName());
78 TIter iter(dir->GetListOfKeys());
80 for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
82 const TString tag(key->GetName());
84 DEBUG(
"Key: " << tag <<
" match = " << tag.Contains(regexp) << endl);
88 if (tag.Contains(regexp) &&
isTObject(key)) {
90 TObject*
object = key->ReadObj();
94 TH2& h2 =
dynamic_cast<TH2&
>(*object);
98 for (
size_t i = 0;
i !=
Q.size(); ++
i) {
103 os <<
i <<
"[" << setw(3) << (int) (100.0 *
Q[
i]) <<
"%]";
105 DEBUG(
"Creating 1D histogram: " << os.str() << endl);
107 TAxis* axis = h2.GetXaxis();
109 if (axis->IsVariableBinSize())
110 h1[i] =
new TH1D(os.str().c_str(), NULL, axis->GetNbins(), axis->GetXbins()->GetArray());
112 h1[
i] =
new TH1D(os.str().c_str(), NULL, axis->GetNbins(), axis->GetXmin(), axis->GetXmax());
116 for (Int_t i = 1; i <= h2.GetXaxis()->GetNbins(); ++
i) {
120 for (Int_t
j = 0;
j <= h2.GetYaxis()->GetNbins() + 1; ++
j) {
121 W += h2.GetBinContent(i,
j);
130 for (
int j = 0,
k = 0;
j <= h2.GetYaxis()->GetNbins() + 1; ++
j) {
132 w += h2.GetBinContent(i,
j);
134 for ( ;
k != (int) h1.size() && w >=
Q[
k]*W; ++
k) {
135 h1[
k]->SetBinContent(i, h2.GetYaxis()->GetBinCenter(
j));
141 for (
int j = h2.GetYaxis()->GetNbins() + 1,
k = 0;
j >= 0; --
j) {
143 w += h2.GetBinContent(i,
j);
145 for ( ;
k != (int) h1.size() && w >=
Q[
k]*W; ++
k) {
146 h1[
k]->SetBinContent(i, h2.GetYaxis()->GetBinCenter(
j));
160 ERROR(
"Not available for other objects than 2D histograms." << endl);
Utility class to parse command line options.
then fatal No hydrophone data file $HYDROPHONE_TXT fi sort gr k
Q(UTCMax_s-UTCMin_s)-livetime_s
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
bool isTObject(const TKey *key)
Check if given key corresponds to a TObject.
TDirectory * getDirectory(const JRootObjectID &id)
Get TDirectory pointer.
#define DEBUG(A)
Message macros.