28 int main(
int argc,
char **argv)
40 JParser<> zap(
"Auxiliary program to print quantiles from 1D histogram.");
49 catch(
const exception &error) {
50 FATAL(error.what() << endl);
55 FATAL(
"No quantiles." << endl);
61 DEBUG(
"Input: " << *input << endl);
66 ERROR(
"File: " << input->getFullFilename() <<
" not opened." << endl);
70 const TRegexp regexp(input->getObjectName());
72 TIter iter(dir->GetListOfKeys());
74 for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
76 const TString tag(key->GetName());
78 DEBUG(
"Key: " << tag <<
" match = " << tag.Contains(regexp) << endl);
82 if (tag.Contains(regexp) &&
isTObject(key)) {
84 TObject*
object = key->ReadObj();
88 TH1& h1 =
dynamic_cast<TH1&
>(*object);
92 for (Int_t i = 0; i <= h1.GetXaxis()->GetNbins() + 1; ++i) {
93 W += h1.GetBinContent(i);
102 for (
int i = 0,
k = 0; i <= h1.GetXaxis()->GetNbins() + 1; ++i) {
104 w += h1.GetBinContent(i);
106 for ( ;
k != (int)
Q.size() && w >=
Q[
k]*W; ++
k) {
107 cout << h1.GetName() <<
' ' <<
FIXED(4,2) <<
Q[
k] <<
' ' <<
FIXED(20,10) << h1.GetXaxis()->GetBinCenter(i) << endl;
114 for (
int i = h1.GetXaxis()->GetNbins() + 1,
k = 0; i >= 0; --i) {
116 w += h1.GetBinContent(i);
118 for ( ;
k != (int)
Q.size() && w >=
Q[
k]*W; ++
k) {
119 cout << h1.GetName() <<
' ' <<
FIXED(4,2) <<
Q[
k] <<
' ' <<
FIXED(20,10) << h1.GetXaxis()->GetBinCenter(i) << endl;
126 ERROR(
"Not available for other objects than 1D 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
int main(int argc, char *argv[])
Auxiliary data structure for floating point format specification.
I/O formatting auxiliaries.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose messaging.
Utility class to parse command line options.
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.