1 #ifndef __JGIZMOTOOLKIT__ 
    2 #define __JGIZMOTOOLKIT__ 
   10 #pragma GCC diagnostic push 
   11 #pragma GCC diagnostic ignored "-Wall" 
   21 #include "TGraphErrors.h" 
   23 #include "TGraph2DErrors.h" 
   24 #include "TMultiGraph.h" 
   32 #include "TIterator.h" 
   34 #include "TMethodCall.h" 
   37 #pragma GCC diagnostic pop 
   50 namespace JPP { 
using namespace JGIZMO; }
 
   76     static const char* 
const Add()        { 
return "Add"; }        
 
   77     static const char* 
const add()        { 
return "add"; }        
 
   78     static const char* 
const Subtract()   { 
return "Subtract"; }   
 
   79     static const char* 
const subtract()   { 
return "subtract"; }   
 
   80     static const char* 
const Multiply()   { 
return "Multiply"; }   
 
   81     static const char* 
const multiply()   { 
return "multiply"; }   
 
   82     static const char* 
const Divide()     { 
return "Divide"; }     
 
   83     static const char* 
const divide()     { 
return "divide"; }     
 
   84     static const char* 
const efficiency() { 
return "efficiency"; } 
 
   85     static const char* 
const stdev()      { 
return "stdev"; }      
 
   86     static const char* 
const sqrt()       { 
return "sqrt"; }       
 
   87     static const char* 
const Replace()    { 
return "Replace"; }    
 
   94   static const char* 
const TIMESTAMP = 
"#splitline{}{#splitline{%d:%m:%y}{  %H:%M}}%F1970-01-01 00:00:00";
 
  111     gErrorIgnoreLevel = kError;
 
  117     if (
i == zmap.end() || 
i->second == NULL || !
i->second->IsOpen()) {
 
  119       TFile* 
file = TFile::Open(file_name.c_str(), option.c_str());
 
  121       zmap[file_name] = 
file;
 
  144     if (in == NULL || !in->IsOpen()) {
 
  149       return in->GetDirectory(
id.getDirectory());
 
  167       const TRegexp regexp(
id.getObjectName());
 
  169       TIter iter(dir->GetListOfKeys());
 
  171       for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
 
  173         const TString tag(key->GetName());
 
  177         if (tag.Index(regexp) != -1) {
 
  178           return key->ReadObj();
 
  196       const TH1* h1 = 
dynamic_cast<const TH1*
>(object);
 
  200         if (h1->GetSumw2N()) {
 
  201           for (Int_t 
i = 1; 
i <= h1->GetNbinsX(); ++
i) {
 
  202             if (h1->GetBinError(
i) != 0.0) {
 
  210       const TGraphErrors* 
g1 = 
dynamic_cast<const TGraphErrors*
>(object);
 
  214         for (Int_t 
i = 0; 
i != g1->GetN(); ++
i) {
 
  215           if (g1->GetEY()[
i] != 0.0) {
 
  220         return g1->GetN() > 1;
 
  224       const TGraph* 
g1 = 
dynamic_cast<const TGraph*
>(object);
 
  227         return g1->GetN() > 1;
 
  251     TString buffer(text);
 
  253     if (
object != NULL) {
 
  255       TClass* p = TClass::GetClass(object->ClassName());
 
  261           TMethod* method = NULL;
 
  263           for (std::unique_ptr<TIterator> iter(p->GetListOfAllPublicMethods()->MakeIterator()); TMethod* p = (TMethod*) iter->Next(); ) {
 
  264             if (buffer.Index(p->GetName()) != -1) {
 
  265               if (method == NULL || strlen(p->GetName()) > strlen(method->GetName())) {
 
  271           if (method == NULL) {
 
  275           for (Ssiz_t index; (index = buffer.Index(method->GetName())) != -1; ) {
 
  277             const TRegexp fp(
" *([^)]*)");   
 
  280             Ssiz_t pos = buffer.Index(fp, &len, index);
 
  284             if (pos == -1 || pos != index + (Ssiz_t) strlen(method->GetName())) {
 
  286               TMethodCall(p, method->GetName(), NULL).Execute(
object, value);
 
  288               len  = strlen(method->GetName());
 
  292               TMethodCall(p, method->GetName(), NULL).Execute(
object, TString(buffer(pos + 1, len - 2)), value);
 
  294               len += strlen(method->GetName());
 
  297             buffer.Replace(index, len, TString::Format(
"%20.10e", value));
 
  303     return TFormula(
"/tmp", buffer.Data()).Eval(0.0);
 
  323     return getResult(TString(text.c_str()), 
object);
 
  337     const char* regexp(
"p[0-9]* *=");
 
  339     TString buffer(text.c_str());
 
  341     buffer = buffer(TRegexp(regexp));
 
  342     buffer = buffer(1, buffer.Length() - 2);
 
  344     if (!buffer.IsDigit()) {
 
  348     return buffer.Atoi();
 
  368     const char* regexp(
"=.*");
 
  370     TString buffer(text.c_str());
 
  372     buffer = buffer(TRegexp(regexp));
 
  373     buffer = buffer(1, buffer.Length() - 1);
 
  398     const char* regexp(
"=.*");
 
  400     TString buffer(text.c_str());
 
  402     buffer = buffer(TRegexp(regexp));
 
  403     buffer = buffer(1, buffer.Length() - 1);
 
  410     for (
int i = index; is >> value && 
i > 0; --
i) {}
 
  415       THROW(
JParseError, 
"Text does not contain a number at given position " << buffer << 
' ' << index);
 
  428       const Int_t    
first = axis->GetFirst();
 
  429       const Int_t    last  = axis->GetLast();
 
  431       const Double_t 
xmin  = axis->GetBinLowEdge(first);
 
  432       const Double_t 
xmax  = axis->GetBinLowEdge(last)  +  axis->GetBinWidth(last);
 
  434       const Int_t 
N = axis->GetNbins();
 
  435       Double_t    buffer[N+1];
 
  437       buffer[0] = TMath::Power(10.0, axis->GetBinLowEdge(1));
 
  439       for (Int_t 
i = 1; 
i <= 
N; ++
i) {
 
  440         buffer[
i] = TMath::Power(10.0, axis->GetBinLowEdge(
i) + axis->GetBinWidth(
i));
 
  443       axis->Set(N, buffer);
 
  445       if (axis->TestBit(TAxis::kAxisRange)) {
 
  446         axis->SetRangeUser(TMath::Power(10.0, xmin), TMath::Power(10.0, xmax));
 
  461     const TRegexp regexp[] = {
 
  462       TString(
"^")          + TString(parameter) + TString(
"[^a-zA-Z_]"),   
 
  463       TString(
"[^a-zA-Z_]") + TString(parameter) + TString(
"[^a-zA-Z_]"),   
 
  464       TString(
"[^a-zA-Z_]") + TString(parameter) + TString(
"$")             
 
  467     const TString replacement = TString(
"log10(") + TString(parameter) + TString(
")");
 
  469     TString buffer(formula);
 
  471     if (buffer.Length() == 1 && buffer[0] == parameter) {
 
  473       buffer = replacement;
 
  477       for (Ssiz_t pos = 0, 
i; pos < buffer.Length(); pos += replacement.Length()) {
 
  478         if      ((
i = buffer.Index(regexp[0], pos)) != -1) { buffer.Replace((pos = 
i + 0), 1, replacement); }
 
  479         else if ((
i = buffer.Index(regexp[1], pos)) != -1) { buffer.Replace((pos = 
i + 1), 1, replacement); }
 
  480         else if ((
i = buffer.Index(regexp[2], pos)) != -1) { buffer.Replace((pos = 
i + 1), 1, replacement); }
 
  495   inline void copy(
const TF1& from, TF1& to)
 
  497     static_cast<TAttLine&
>  (to) = static_cast<const TAttLine&>  (from);
 
  498     static_cast<TAttFill&
>  (to) = static_cast<const TAttFill&>  (from);
 
  499     static_cast<TAttMarker&
>(to) = static_cast<const TAttMarker&>(from);
 
  501     to.SetParameters(from.GetParameters());
 
  503     to.SetNpx(from.GetNpx());
 
  513   inline void copy(
const TF2& from, TF2& to)
 
  515     copy(static_cast<const TF1&>(from), static_cast<TF1&>(to));
 
  517     to.SetNpy(from.GetNpy());
 
  552       fn.SetRange(f1->GetXmin(),
 
  557       f1->SetRange(TMath::Power(10.0,f1->GetXmin()),
 
  558                    TMath::Power(10.0,f1->GetXmax()));
 
  572       TString buffer = f1->GetExpFormula();
 
  574       buffer = 
"pow(10.0, " + buffer + 
")";
 
  576       TF1 fn(f1->GetName(), buffer);
 
  598       fn.SetRange(f2->GetXmin(),
 
  605       f2->SetRange(TMath::Power(10.0,f2->GetXmin()),
 
  607                    TMath::Power(10.0,f2->GetXmax()),
 
  626       fn.SetRange(f2->GetXmin(),
 
  633       f2->SetRange(f2->GetXmin(),
 
  634                    TMath::Power(10.0,f2->GetYmin()),
 
  636                    TMath::Power(10.0,f2->GetYmax()));
 
  650       setLogarithmicX<TF1>(h1->GetListOfFunctions());
 
  668       setLogarithmicX<TF2>(h2->GetListOfFunctions());
 
  684       setLogarithmicY<TF2>(h2->GetListOfFunctions());
 
  700       setLogarithmicX<TF1>(g1->GetListOfFunctions());
 
  702       for (Int_t 
i = 0; 
i != g1->GetN(); ++
i) {
 
  703         g1->GetX()[
i] = 
pow(10.0, g1->GetX()[
i]);
 
  718       setLogarithmicY<TF1>(g1->GetListOfFunctions());
 
  720       for (Int_t 
i = 0; 
i != g1->GetN(); ++
i) {
 
  721         g1->GetY()[
i] = 
pow(10.0, g1->GetY()[
i]);
 
  736       setLogarithmicX<TF1>(g1->GetListOfFunctions());
 
  738       for (Int_t 
i = 0; 
i != g1->GetN(); ++
i) {
 
  739         g1->GetEX()[
i] = 
pow(10.0, g1->GetX()[
i] + g1->GetEX()[
i])  -  
pow(10.0, g1->GetX()[
i]);
 
  740         g1->GetX() [
i] = 
pow(10.0, g1->GetX()[
i]);
 
  755       setLogarithmicY<TF1>(g1->GetListOfFunctions());
 
  757       for (Int_t 
i = 0; 
i != g1->GetN(); ++
i) {
 
  758         g1->GetEY()[
i] = 
pow(10.0, g1->GetY()[
i] + g1->GetEY()[
i])  -  
pow(10.0, g1->GetY()[
i]);
 
  759         g1->GetY() [
i] = 
pow(10.0, g1->GetY()[
i]);
 
  774       setLogarithmicX<TF2>(g2->GetListOfFunctions());
 
  776       for (Int_t 
i = 0; 
i != g2->GetN(); ++
i) {
 
  777         g2->GetX()[
i] = 
pow(10.0, g2->GetX()[
i]);
 
  792       setLogarithmicY<TF2>(g2->GetListOfFunctions());
 
  794       for (Int_t 
i = 0; 
i != g2->GetN(); ++
i) {
 
  795         g2->GetY()[
i] = 
pow(10.0, g2->GetY()[
i]);
 
  810       setLogarithmicX<TF2>(g2->GetListOfFunctions());
 
  812       for (Int_t 
i = 0; 
i != g2->GetN(); ++
i) {
 
  813         g2->GetEX()[
i] = 
pow(10.0, g2->GetX()[
i] + g2->GetEX()[
i])  -  
pow(10.0, g2->GetX()[
i]);
 
  814         g2->GetX() [
i] = 
pow(10.0, g2->GetX()[
i]);
 
  829       setLogarithmicY<TF2>(g2->GetListOfFunctions());
 
  831       for (Int_t 
i = 0; 
i != g2->GetN(); ++
i) {
 
  832         g2->GetEY()[
i] = 
pow(10.0, g2->GetY()[
i] + g2->GetEY()[
i])  -  
pow(10.0, g2->GetY()[
i]);
 
  833         g2->GetY() [
i] = 
pow(10.0, g2->GetY()[
i]);
 
  847       setLogarithmicX<TGraph>(gn->GetListOfGraphs());
 
  860       setLogarithmicY<TGraph>(gn->GetListOfGraphs());
 
  873       line->SetX1(
pow(10.0, line->GetX1()));
 
  874       line->SetX2(
pow(10.0, line->GetX2()));
 
  887       line->SetY1(
pow(10.0, line->GetY1()));
 
  888       line->SetY2(
pow(10.0, line->GetY2()));
 
  923     for (TIter 
i(list); 
T* p = 
dynamic_cast<T*
>(
i.Next()); ) {
 
  937     for (TIter 
i(list); 
T* p = 
dynamic_cast<T*
>(
i.Next()); ) {
 
  959     const bool normalise = (option.find(
'N') != string::npos || option.find(
'n') != string::npos);
 
  960     const bool bin_width = (option.find(
'W') != string::npos || option.find(
'w') != string::npos);
 
  961     const bool use_error = (option.find(
'E') != string::npos || option.find(
'e') != string::npos);
 
  969       for (Int_t 
i = 1; 
i <= h1.GetXaxis()->GetNbins(); ++
i) {
 
  970         W += h1.GetBinContent(
i);
 
  976       for (Int_t 
i = 1; 
i <= h1.GetXaxis()->GetNbins(); ++
i) {
 
  978         const Double_t 
w = W * (bin_width ? h1.GetXaxis()->GetBinWidth(
i) : 1.0);
 
  980         h1.SetBinContent(
i, h1.GetBinContent(
i) * factor / 
w);
 
  983           h1.SetBinError(
i, h1.GetBinError(
i) * factor / 
w);
 
 1006     using namespace std;
 
 1008     const bool normalise = (option.find(
'N') != string::npos || option.find(
'n') != string::npos);
 
 1009     const bool X         = (option.find(
'X') != string::npos || option.find(
'x') != string::npos);
 
 1010     const bool Y         = (option.find(
'Y') != string::npos || option.find(
'y') != string::npos);
 
 1011     const bool bin_width = (option.find(
'W') != string::npos || option.find(
'w') != string::npos);
 
 1012     const bool use_error = (option.find(
'E') != string::npos || option.find(
'e') != string::npos);
 
 1022         for (Int_t ix = 1; ix <= h2.GetXaxis()->GetNbins(); ++ix) {
 
 1023           for (Int_t iy = 1; iy <= h2.GetYaxis()->GetNbins(); ++iy) {
 
 1024             W += h2.GetBinContent(ix,iy);
 
 1031         for (Int_t ix = 1; ix <= h2.GetXaxis()->GetNbins(); ++ix) {
 
 1032           for (Int_t iy = 1; iy <= h2.GetYaxis()->GetNbins(); ++iy) {
 
 1034             const Double_t 
w = W * (bin_width ? h2.GetXaxis()->GetBinWidth(ix) * h2.GetYaxis()->GetBinWidth(iy) : 1.0);
 
 1036             h2.SetBinContent(ix, iy, h2.GetBinContent(ix,iy) * factor / 
w);
 
 1039               h2.SetBinError(ix, iy, h2.GetBinError(ix,iy) * factor / 
w);
 
 1047       for (Int_t iy = 1; iy <= h2.GetYaxis()->GetNbins(); ++iy) {
 
 1053           for (Int_t ix = 1; ix <= h2.GetXaxis()->GetNbins(); ++ix) {
 
 1054             W += h2.GetBinContent(ix,iy);
 
 1060           for (Int_t ix = 1; ix <= h2.GetXaxis()->GetNbins(); ++ix) {
 
 1062             const Double_t 
w = W * (bin_width ? h2.GetXaxis()->GetBinWidth(ix) : 1.0);
 
 1064             h2.SetBinContent(ix, iy, h2.GetBinContent(ix,iy) * factor / 
w);
 
 1067               h2.SetBinError(ix, iy, h2.GetBinError(ix,iy) * factor / 
w);
 
 1075       for (Int_t ix = 1; ix <= h2.GetXaxis()->GetNbins(); ++ix) {
 
 1081           for (Int_t iy = 1; iy <= h2.GetYaxis()->GetNbins(); ++iy) {
 
 1082             W += h2.GetBinContent(ix,iy);
 
 1088           for (Int_t iy = 1; iy <= h2.GetYaxis()->GetNbins(); ++iy) {
 
 1090             const Double_t 
w = W * (bin_width ? h2.GetYaxis()->GetBinWidth(iy) : 1.0);
 
 1092             h2.SetBinContent(ix, iy, h2.GetBinContent(ix,iy) / 
w);
 
 1095               h2.SetBinError(ix, iy, h2.GetBinError(ix,iy) / 
w);
 
 1121     using namespace std;
 
 1123     const bool normalise = (option.find(
'N') != string::npos || option.find(
'n') != string::npos);
 
 1124     const bool X         = (option.find(
'X') != string::npos || option.find(
'x') != string::npos);
 
 1125     const bool Y         = (option.find(
'Y') != string::npos || option.find(
'y') != string::npos);
 
 1126     const bool Z         = (option.find(
'Z') != string::npos || option.find(
'z') != string::npos);    
 
 1127     const bool bin_width = (option.find(
'W') != string::npos || option.find(
'w') != string::npos);
 
 1128     const bool use_error = (option.find(
'E') != string::npos || option.find(
'e') != string::npos);
 
 1138         for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1139           for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
 
 1140             for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {     
 
 1141               W += h3.GetBinContent(ix,iy,iz);
 
 1149         for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1150           for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
 
 1151             for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {     
 
 1153               const Double_t 
w = W * (bin_width ? h3.GetXaxis()->GetBinWidth(ix) * h3.GetYaxis()->GetBinWidth(iy) * h3.GetZaxis()->GetBinWidth(iz) : 1.0);
 
 1155               h3.SetBinContent(ix, iy, iz, h3.GetBinContent(ix,iy,iz) * factor / 
w);
 
 1158                 h3.SetBinError(ix, iy, iz, h3.GetBinError(ix,iy,iz) * factor / 
w);
 
 1165     } 
else if (
X && 
Z) {
 
 1167       for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
 
 1173           for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1174             for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
 
 1175               W += h3.GetBinContent(ix,iy,iz);
 
 1182           for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1183             for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
 
 1185               const Double_t 
w = W * (bin_width ? h3.GetXaxis()->GetBinWidth(ix) * h3.GetZaxis()->GetBinWidth(iz) : 1.0);
 
 1187               h3.SetBinContent(ix, iy, iz, h3.GetBinContent(ix,iy,iz) * factor / 
w);
 
 1190                 h3.SetBinError(ix, iy, iz, h3.GetBinError(ix,iy,iz) * factor / 
w);
 
 1197     } 
else if (
Y && 
Z) {
 
 1199       for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1205           for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
 
 1206             for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
 
 1207               W += h3.GetBinContent(ix,iy,iz);
 
 1214           for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
 
 1215             for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
 
 1217               const Double_t 
w = W * (bin_width ? h3.GetYaxis()->GetBinWidth(iy) * h3.GetZaxis()->GetBinWidth(iz) : 1.0);
 
 1219               h3.SetBinContent(ix, iy, iz, h3.GetBinContent(ix,iy,iz) * factor / 
w);
 
 1222                 h3.SetBinError(ix, iy, iz, h3.GetBinError(ix,iy,iz) * factor / 
w);
 
 1229     } 
else if (
X && 
Y) {
 
 1231       for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {      
 
 1237           for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1238             for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
 
 1239               W += h3.GetBinContent(ix,iy,iz);
 
 1246           for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1247             for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
 
 1249               const Double_t 
w = W * (bin_width ? h3.GetXaxis()->GetBinWidth(ix) * h3.GetYaxis()->GetBinWidth(iy) : 1.0);
 
 1251               h3.SetBinContent(ix, iy, iz, h3.GetBinContent(ix,iy,iz) * factor / 
w);
 
 1254                 h3.SetBinError(ix, iy, iz, h3.GetBinError(ix,iy,iz) * factor / 
w);
 
 1263       for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
 
 1264         for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
 
 1270             for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1271               W += h3.GetBinContent(ix,iy,iz);
 
 1277             for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1279               const Double_t 
w = W * (bin_width ? h3.GetXaxis()->GetBinWidth(ix) : 1.0);
 
 1281               h3.SetBinContent(ix, iy, iz, h3.GetBinContent(ix,iy,iz) * factor / 
w);
 
 1284                 h3.SetBinError(ix, iy, iz, h3.GetBinError(ix,iy,iz) * factor / 
w);
 
 1293       for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1294         for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {     
 
 1300             for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
 
 1301               W += h3.GetBinContent(ix,iy,iz);
 
 1307             for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
 
 1309               const Double_t 
w = W * (bin_width ? h3.GetYaxis()->GetBinWidth(iy) : 1.0);
 
 1311               h3.SetBinContent(ix, iy, iz, h3.GetBinContent(ix,iy,iz) / 
w);
 
 1314                 h3.SetBinError(ix, iy, iz, h3.GetBinError(ix,iy,iz) / 
w);
 
 1323       for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1324         for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {     
 
 1330             for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
 
 1331               W += h3.GetBinContent(ix,iy,iz);
 
 1337             for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
 
 1339               const Double_t 
w = W * (bin_width ? h3.GetZaxis()->GetBinWidth(iz) : 1.0);
 
 1341               h3.SetBinContent(ix, iy, iz, h3.GetBinContent(ix,iy,iz) / 
w);
 
 1344                 h3.SetBinError(ix, iy, iz, h3.GetBinError(ix,iy,iz) / 
w);
 
 1361     using namespace std;
 
 1363     Double_t ymin = numeric_limits<Double_t>::max();
 
 1364     Double_t ymax = numeric_limits<Double_t>::lowest();
 
 1366     for (Int_t 
i = 0; 
i != g1.GetN(); ++
i) {
 
 1368       const Double_t 
y = g1.GetY()[
i];
 
 1370       if (y > ymax) { ymax = 
y; }
 
 1371       if (y < ymin) { ymin = 
y; }
 
 1374     g1.SetMinimum(ymin);
 
 1375     g1.SetMaximum(ymax);
 
 1386     using namespace std;
 
 1388     Double_t zmin = numeric_limits<Double_t>::max();
 
 1389     Double_t zmax = numeric_limits<Double_t>::lowest();
 
 1391     for (Int_t 
i = 0; 
i != g2.GetN(); ++
i) {
 
 1393       const Double_t z = g2.GetZ()[
i];
 
 1395       if (z > zmax) { zmax = z; }
 
 1396       if (z < zmin) { zmin = z; }
 
 1399     g2.SetMinimum(zmin);
 
 1400     g2.SetMaximum(zmax);
 
 1420     double dx = (xmax - 
xmin) * 0.1;
 
 1422     if (logx || xmin >= dx || xmin < 0.0)
 
 1452     using namespace JPP;
 
 1454     if (axis->GetNbins() == (int) memo.size()) {
 
 1456       for (
int i = 0; 
i != axis->GetNbins(); ++
i) {
 
 1458         const JPMTPhysicalAddress& address = memo[
i];
 
 1460         axis->SetBinLabel(
i + 1, address.toString().c_str());
 
 1483     using namespace JPP;
 
 1487     if      (axis == 
"x" || axis == 
"X") 
 
 1488       pax = h1.GetXaxis();
 
 1489     else if (axis == 
"y" || axis == 
"Y") 
 
 1490       pax = h1.GetYaxis();
 
 1491     else if (axis == 
"z" || axis == 
"Z") 
 
 1492       pax = h1.GetZaxis();
 
 1496     if (pax->GetNbins() == (int) memo.size()) {
 
 1498       for (
int i = 0; 
i != pax->GetNbins(); ++
i) {
 
 1502         pax->SetBinLabel(
i + 1, address.toString().c_str());
 
 1505       h1.LabelsOption(
"a", axis.c_str());       
 
 1522     return (key != NULL && TClass::GetClass(key->GetClassName())->IsTObject());
 
static const char *const sqrt()
Set contents to signed difference between squares. 
 
TObject * getObject(const JRootObjectID &id)
Get first TObject with given identifier. 
 
double getValue(const JScale_t scale)
Get numerical value corresponding to scale. 
 
int getParameter(const std::string &text)
Get parameter number from text string. 
 
static const char *const Divide()
ROOT TH1::Divide. 
 
static const char *const Subtract()
ROOT TH1::Subtract. 
 
Exception for a functional operation. 
 
static const char *const SAME_AS_INPUT()
Set name of output histogram to name of input histogram. 
 
then usage $script[< detector identifier >< run range >]< QA/QCfile > nExample script to produce data quality plots nWhen a detector identifier and run range are data are downloaded from the database nand subsequently stored in the given QA QC file
 
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message. 
 
static const char *const Replace()
Set contents to associated function. 
 
void setLimits(TGraph &g1)
Set limits of TGraph. 
 
static const char *const subtract()
Subtract contents with lookup bin in second histogram. 
 
Auxiliary class to handle file name, ROOT directory and object name. 
 
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
 
static const char *const stdev()
Set contents to standard deviation. 
 
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
 
void setLogarithmic(TAxis *axis)
Make histogram axis logarithmic (e.g. after using log10()). 
 
const JPolynome f1(1.0, 2.0, 3.0)
Function. 
 
bool isTAttLine(const TObject *object)
Get drawing option of TH1. 
 
static const char *const efficiency()
Divide contents and multiply errors with inefficiency. 
 
static const char *const Add()
ROOT TH1::Add. 
 
Lookup table for PMT addresses in optical module. 
 
static const char *const multiply()
Multiply contents with lookup bin in second histogram. 
 
TFile * getFile(const std::string &file_name, const std::string &option="exist")
Get TFile pointer corresponding to give file name. 
 
static const char *const add()
Add contents with lookup bin in second histogram. 
 
Auxiliary data structure for JOpera1D.cc and JOpera2D.cc applications. 
 
void setLogarithmicX(TList *list)
Make x-axis of objects in list logarithmic (e.g. after using log10()). 
 
Double_t getResult(const TString &text, TObject *object=NULL)
Get result of given textual formula. 
 
do set_variable OUTPUT_DIRECTORY $WORKDIR T
 
void convertToPDF(TH1 &h1, const std::string &option="NW", const double factor=1.0)
Convert 1D histogram to PDF. 
 
void setAxisLabels(TAxis *axis, const JModuleAddressMap &memo)
Set axis with PMT address labels. 
 
T pow(const T &x, const double y)
Power . 
 
static const char *const Multiply()
ROOT TH1::Multiply. 
 
static const char *const SAME_AS_OPERATION()
Set name of output histogram to name of operation. 
 
void setLogarithmicY(TList *list)
Make y-axis of objects in list logarithmic (e.g. after using log10()). 
 
then set_variable DIR else fatal Wrong number of arguments fi for INPUT_FILE in ls rt $DIR stage * log
 
void setRange(double &xmin, double &xmax, const bool logx)
Set axis range. 
 
const JPMTAddressTranslator & getAddressTranslator(const int tdc) const 
Get PMT address translator. 
 
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
 
static const char *const divide()
Divide contents with lookup bin in second histogram. 
 
void copy(const Head &from, JHead &to)
Copy header from from to to. 
 
Exception for parsing value. 
 
bool isTObject(const TKey *key)
Check if given key corresponds to a TObject. 
 
no fit printf nominal n $STRING awk v X
 
TDirectory * getDirectory(const JRootObjectID &id)
Get TDirectory pointer. 
 
std::string getFilename(const std::string &file_name)
Get file name part, i.e. part after last JEEP::PATHNAME_SEPARATOR if any. 
 
do set_variable MODULE getModule a $WORKDIR detector_a datx L $STRING JEditDetector a $WORKDIR detector_a datx M $MODULE setz o $WORKDIR detector_a datx JEditDetector a $WORKDIR detector_b datx M $MODULE setz o $WORKDIR detector_b datx done echo Output stored at $WORKDIR detector_a datx and $WORKDIR tripod_a txt JDrawDetector2D a $WORKDIR detector_a datx a $WORKDIR detector_b datx L BL o detector $FORMAT $BATCH JDrawDetector2D T $WORKDIR tripod_a txt T $WORKDIR tripod_b txt L BL o tripod $FORMAT $BATCH JCompareDetector a $WORKDIR detector_a datx b $WORKDIR detector_b datx o $WORKDIR abc root &dev null for KEY in X Y Z
 
Exception for accessing a value in a collection that is outside of its range. 
 
TString getLogarithmic(const TString &formula, const char parameter)
Make given parameter in formula logarithmic (e.g. after using log10()). 
 
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
 
static const char *const TIMESTAMP
Time stamp of earliest UTC time. 
 
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` source JAcousticsToolkit.sh typeset -A TRIPODS get_tripods $WORKDIR/tripod.txt TRIPODS XMEAN
 
Double_t g1(const Double_t x)
Function.