1 #ifndef __JGIZMOTOOLKIT__ 
    2 #define __JGIZMOTOOLKIT__ 
   10 #pragma GCC diagnostic push 
   11 #pragma GCC diagnostic ignored "-Wall" 
   23 #include "TGraphErrors.h" 
   24 #include "TGraphAsymmErrors.h" 
   26 #include "TGraph2DErrors.h" 
   27 #include "TMultiGraph.h" 
   36 #include "TIterator.h" 
   38 #include "TMethodCall.h" 
   41 #pragma GCC diagnostic pop 
   80     static const char* 
const Add()        { 
return "Add"; }        
 
   81     static const char* 
const add()        { 
return "add"; }        
 
   82     static const char* 
const Subtract()   { 
return "Subtract"; }   
 
   83     static const char* 
const subtract()   { 
return "subtract"; }   
 
   84     static const char* 
const Multiply()   { 
return "Multiply"; }   
 
   85     static const char* 
const multiply()   { 
return "multiply"; }   
 
   86     static const char* 
const Divide()     { 
return "Divide"; }     
 
   87     static const char* 
const divide()     { 
return "divide"; }     
 
   88     static const char* 
const efficiency() { 
return "efficiency"; } 
 
   89     static const char* 
const stdev()      { 
return "stdev"; }      
 
   90     static const char* 
const sqrt()       { 
return "sqrt"; }       
 
   91     static const char* 
const Replace()    { 
return "Replace"; }    
 
   98   static const char* 
const TIMESTAMP = 
"#splitline{}{#splitline{%d:%m:%y}{  %H:%M}}%F1970-01-01 00:00:00";
 
  111   inline TFile* 
getFile(
const std::string& file_name, 
const std::string& option = 
"exist")
 
  115     gErrorIgnoreLevel = kError;
 
  121     if (i == zmap.end() || i->second == NULL || !i->second->IsOpen()) {
 
  123       TFile* file = TFile::Open(file_name.c_str(), option.c_str());
 
  125       zmap[file_name] = file;
 
  148     if (in == NULL || !in->IsOpen()) {
 
  171       const TRegexp regexp(
id.getObjectName());
 
  173       TIter iter(dir->GetListOfKeys());
 
  175       for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
 
  177         const TString tag(key->GetName());
 
  181         if (tag.Index(regexp) != -1) {
 
  182           return key->ReadObj();
 
  200       if (
dynamic_cast<const TH3*
>(
object) != NULL) {
 
  205       if (
dynamic_cast<const TH2*
>(
object) != NULL) {
 
  210       const TH1* h1 = 
dynamic_cast<const TH1*
>(object);
 
  214         if (h1->GetSumw2N()) {
 
  215           for (Int_t i = 1; i <= h1->GetNbinsX(); ++i) {
 
  216             if (h1->GetBinError(i) != 0.0) {
 
  226       const TGraphErrors* 
g1 = 
dynamic_cast<const TGraphErrors*
>(object);
 
  230         for (Int_t i = 0; i != 
g1->GetN(); ++i) {
 
  231           if (
g1->GetEY()[i] != 0.0) {
 
  236         return g1->GetN() > 1;
 
  240       const TGraphAsymmErrors* 
g1 = 
dynamic_cast<const TGraphAsymmErrors*
>(object);
 
  244         for (Int_t i = 0; i != 
g1->GetN(); ++i) {
 
  245           if (
g1->GetEYhigh()[i] != 0.0 ||
 
  246               g1->GetEYlow() [i] != 0.0) {
 
  251         return g1->GetN() > 1;
 
  255       const TGraph* 
g1 = 
dynamic_cast<const TGraph*
>(object);
 
  258         return g1->GetN() > 1;
 
  275       const TAttFill* t1 = 
dynamic_cast<const TAttFill*
>(object);
 
  278         return t1->GetFillColor() != 1 && t1->GetFillStyle() != 0;
 
  302     TString buffer(
text);
 
  304     if (
object != NULL) {
 
  306       TClass* p = TClass::GetClass(object->ClassName());
 
  312           TMethod* method = NULL;
 
  314           for (std::unique_ptr<TIterator> iter(p->GetListOfAllPublicMethods()->MakeIterator()); TMethod* p = (TMethod*) iter->Next(); ) {
 
  315             if (buffer.Index(p->GetName()) != -1) {
 
  316               if (method == NULL || strlen(p->GetName()) > strlen(method->GetName())) {
 
  322           if (method == NULL) {
 
  326           for (Ssiz_t index; (index = buffer.Index(method->GetName())) != -1; ) {
 
  328             const TRegexp fp(
" *([^)]*)");   
 
  331             Ssiz_t pos = buffer.Index(fp, &len, index);
 
  335             if (pos == -1 || pos != index + (Ssiz_t) strlen(method->GetName())) {
 
  337               TMethodCall(p, method->GetName(), NULL).Execute(
object, value);
 
  339               len  = strlen(method->GetName());
 
  343               TMethodCall(p, method->GetName(), NULL).Execute(
object, TString(buffer(pos + 1, len - 2)), value);
 
  345               len += strlen(method->GetName());
 
  348             buffer.Replace(index, len, TString::Format(
"%20.10e", value));
 
  354     return TFormula(
"/tmp", buffer.Data()).Eval(0.0);
 
  388     const char* regexp(
"p[0-9]* *=");
 
  390     TString buffer(
text.c_str());
 
  392     buffer = buffer(TRegexp(regexp));
 
  393     buffer = buffer(1, buffer.Length() - 2);
 
  395     if (!buffer.IsDigit()) {
 
  399     return buffer.Atoi();
 
  419     const char* regexp(
"=.*");
 
  421     TString buffer(
text.c_str());
 
  423     buffer = buffer(TRegexp(regexp));
 
  424     buffer = buffer(1, buffer.Length() - 1);
 
  426     return getResult(std::string(buffer), 
object);
 
  449     const char* regexp(
"=.*");
 
  451     TString buffer(
text.c_str());
 
  453     buffer = buffer(TRegexp(regexp));
 
  454     buffer = buffer(1, buffer.Length() - 1);
 
  457     istringstream is((std::string(buffer)));
 
  461     for (
int i = index; is >> value && i > 0; --i) {}
 
  466       THROW(
JParseError, 
"Text does not contain a number at given position " << buffer << 
' ' << index);
 
  479       const Int_t N = axis->GetNbins();
 
  480       Double_t    buffer[N+1];
 
  482       buffer[0] = TMath::Power(10.0, axis->GetBinLowEdge(1));
 
  484       for (Int_t i = 1; i <= N; ++i) {
 
  485         buffer[i] = TMath::Power(10.0, axis->GetBinLowEdge(i) + axis->GetBinWidth(i));
 
  488       axis->Set(N, buffer);
 
  517     const TRegexp regexp[] = {
 
  518       TString(
"^")          + TString(parameter) + TString(
"[^a-zA-Z_]"),   
 
  519       TString(
"[^a-zA-Z_]") + TString(parameter) + TString(
"[^a-zA-Z_]"),   
 
  520       TString(
"[^a-zA-Z_]") + TString(parameter) + TString(
"$")             
 
  523     const TString replacement = TString(
"log10(") + TString(parameter) + TString(
")");
 
  525     TString buffer(formula);
 
  527     if (buffer.Length() == 1 && buffer[0] == parameter) {
 
  529       buffer = replacement;
 
  533       for (Ssiz_t pos = 0, i; pos < buffer.Length(); pos += replacement.Length()) {
 
  534         if      ((i = buffer.Index(regexp[0], pos)) != -1) { buffer.Replace((pos = i + 0), 1, replacement); }
 
  535         else if ((i = buffer.Index(regexp[1], pos)) != -1) { buffer.Replace((pos = i + 1), 1, replacement); }
 
  536         else if ((i = buffer.Index(regexp[2], pos)) != -1) { buffer.Replace((pos = i + 1), 1, replacement); }
 
  551   inline void copy(
const TF1& from, TF1& to)
 
  553     static_cast<TAttLine&
>  (to) = 
static_cast<const TAttLine&
>  (from);
 
  554     static_cast<TAttFill&
>  (to) = 
static_cast<const TAttFill&
>  (from);
 
  555     static_cast<TAttMarker&
>(to) = 
static_cast<const TAttMarker&
>(from);
 
  557     to.SetParameters(from.GetParameters());
 
  559     to.SetNpx(from.GetNpx());
 
  569   inline void copy(
const TF2& from, TF2& to)
 
  571     copy(
static_cast<const TF1&
>(from), 
static_cast<TF1&
>(to));
 
  573     to.SetNpy(from.GetNpy());
 
  608       fn.SetRange(
f1->GetXmin(),
 
  613       f1->SetRange(TMath::Power(10.0,
f1->GetXmin()),
 
  614                    TMath::Power(10.0,
f1->GetXmax()));
 
  628       TString buffer = 
f1->GetExpFormula();
 
  630       buffer = 
"pow(10.0, " + buffer + 
")";
 
  632       TF1 fn(
f1->GetName(), buffer);
 
  654       fn.SetRange(f2->GetXmin(),
 
  661       f2->SetRange(TMath::Power(10.0,f2->GetXmin()),
 
  663                    TMath::Power(10.0,f2->GetXmax()),
 
  682       fn.SetRange(f2->GetXmin(),
 
  689       f2->SetRange(f2->GetXmin(),
 
  690                    TMath::Power(10.0,f2->GetYmin()),
 
  692                    TMath::Power(10.0,f2->GetYmax()));
 
  706       setLogarithmicX<TF1>(h1->GetListOfFunctions());
 
  724       setLogarithmicX<TF2>(h2->GetListOfFunctions());
 
  740       setLogarithmicY<TF2>(h2->GetListOfFunctions());
 
  756       setLogarithmicX<TF1>(
g1->GetListOfFunctions());
 
  758       for (Int_t i = 0; i != 
g1->GetN(); ++i) {
 
  759         g1->GetX()[i] = 
pow(10.0, 
g1->GetX()[i]);
 
  774       setLogarithmicY<TF1>(
g1->GetListOfFunctions());
 
  776       for (Int_t i = 0; i != 
g1->GetN(); ++i) {
 
  777         g1->GetY()[i] = 
pow(10.0, 
g1->GetY()[i]);
 
  792       setLogarithmicX<TF1>(
g1->GetListOfFunctions());
 
  794       for (Int_t i = 0; i != 
g1->GetN(); ++i) {
 
  795         g1->GetEX()[i] = 
pow(10.0, 
g1->GetX()[i] + 
g1->GetEX()[i])  -  
pow(10.0, 
g1->GetX()[i]);
 
  796         g1->GetX() [i] = 
pow(10.0, 
g1->GetX()[i]);
 
  811       setLogarithmicY<TF1>(
g1->GetListOfFunctions());
 
  813       for (Int_t i = 0; i != 
g1->GetN(); ++i) {
 
  814         g1->GetEY()[i] = 
pow(10.0, 
g1->GetY()[i] + 
g1->GetEY()[i])  -  
pow(10.0, 
g1->GetY()[i]);
 
  815         g1->GetY() [i] = 
pow(10.0, 
g1->GetY()[i]);
 
  830       setLogarithmicX<TF2>(g2->GetListOfFunctions());
 
  832       for (Int_t i = 0; i != g2->GetN(); ++i) {
 
  833         g2->GetX()[i] = 
pow(10.0, g2->GetX()[i]);
 
  848       setLogarithmicY<TF2>(g2->GetListOfFunctions());
 
  850       for (Int_t i = 0; i != g2->GetN(); ++i) {
 
  851         g2->GetY()[i] = 
pow(10.0, g2->GetY()[i]);
 
  866       setLogarithmicX<TF2>(g2->GetListOfFunctions());
 
  868       for (Int_t i = 0; i != g2->GetN(); ++i) {
 
  869         g2->GetEX()[i] = 
pow(10.0, g2->GetX()[i] + g2->GetEX()[i])  -  
pow(10.0, g2->GetX()[i]);
 
  870         g2->GetX() [i] = 
pow(10.0, g2->GetX()[i]);
 
  885       setLogarithmicY<TF2>(g2->GetListOfFunctions());
 
  887       for (Int_t i = 0; i != g2->GetN(); ++i) {
 
  888         g2->GetEY()[i] = 
pow(10.0, g2->GetY()[i] + g2->GetEY()[i])  -  
pow(10.0, g2->GetY()[i]);
 
  889         g2->GetY() [i] = 
pow(10.0, g2->GetY()[i]);
 
  903       setLogarithmicX<TGraph>(gn->GetListOfGraphs());
 
  916       setLogarithmicY<TGraph>(gn->GetListOfGraphs());
 
  929       line->SetX1(
pow(10.0, line->GetX1()));
 
  930       line->SetX2(
pow(10.0, line->GetX2()));
 
  943       line->SetY1(
pow(10.0, line->GetY1()));
 
  944       line->SetY2(
pow(10.0, line->GetY2()));
 
  979     for (TIter i(
list); T* p = 
dynamic_cast<T*
>(i.Next()); ) {
 
  993     for (TIter i(
list); T* p = 
dynamic_cast<T*
>(i.Next()); ) {
 
 1011   inline void convertToPDF(TH1& h1, 
const std::string& option = 
"NW", 
const double factor = 1.0)
 
 1013     using namespace std;
 
 1015     const bool normalise = (option.find(
'N') != string::npos || option.find(
'n') != string::npos);
 
 1016     const bool bin_width = (option.find(
'W') != string::npos || option.find(
'w') != string::npos);
 
 1017     const bool use_error = (option.find(
'E') != string::npos || option.find(
'e') != string::npos);
 
 1025       for (Int_t i = 1; i <= h1.GetXaxis()->GetNbins(); ++i) {
 
 1026         W += h1.GetBinContent(i);
 
 1032       for (Int_t i = 1; i <= h1.GetXaxis()->GetNbins(); ++i) {
 
 1034         const Double_t 
w = W * (bin_width ? h1.GetXaxis()->GetBinWidth(i) : 1.0);
 
 1036         h1.SetBinContent(i, h1.GetBinContent(i) * factor / 
w);
 
 1039           h1.SetBinError(i, h1.GetBinError(i) * factor / 
w);
 
 1060   inline void convertToPDF(TH2& h2, 
const std::string& option = 
"NXYW", 
const double factor = 1.0)
 
 1062     using namespace std;
 
 1064     const bool normalise = (option.find(
'N') != string::npos || option.find(
'n') != string::npos);
 
 1065     const bool X         = (option.find(
'X') != string::npos || option.find(
'x') != string::npos);
 
 1066     const bool Y         = (option.find(
'Y') != string::npos || option.find(
'y') != string::npos);
 
 1067     const bool bin_width = (option.find(
'W') != string::npos || option.find(
'w') != string::npos);
 
 1068     const bool use_error = (option.find(
'E') != string::npos || option.find(
'e') != string::npos);
 
 1078         for (Int_t ix = 1; ix <= h2.GetXaxis()->GetNbins(); ++ix) {
 
 1079           for (Int_t iy = 1; iy <= h2.GetYaxis()->GetNbins(); ++iy) {
 
 1080             W += h2.GetBinContent(ix,iy);
 
 1087         for (Int_t ix = 1; ix <= h2.GetXaxis()->GetNbins(); ++ix) {
 
 1088           for (Int_t iy = 1; iy <= h2.GetYaxis()->GetNbins(); ++iy) {
 
 1090             const Double_t 
w = W * (bin_width ? h2.GetXaxis()->GetBinWidth(ix) * h2.GetYaxis()->GetBinWidth(iy) : 1.0);
 
 1092             h2.SetBinContent(ix, iy, h2.GetBinContent(ix,iy) * factor / 
w);
 
 1095               h2.SetBinError(ix, iy, h2.GetBinError(ix,iy) * factor / 
w);
 
 1103       for (Int_t iy = 1; iy <= h2.GetYaxis()->GetNbins(); ++iy) {
 
 1109           for (Int_t ix = 1; ix <= h2.GetXaxis()->GetNbins(); ++ix) {
 
 1110             W += h2.GetBinContent(ix,iy);
 
 1116           for (Int_t ix = 1; ix <= h2.GetXaxis()->GetNbins(); ++ix) {
 
 1118             const Double_t 
w = W * (bin_width ? h2.GetXaxis()->GetBinWidth(ix) : 1.0);
 
 1120             h2.SetBinContent(ix, iy, h2.GetBinContent(ix,iy) * factor / 
w);
 
 1123               h2.SetBinError(ix, iy, h2.GetBinError(ix,iy) * factor / 
w);
 
 1131       for (Int_t ix = 1; ix <= h2.GetXaxis()->GetNbins(); ++ix) {
 
 1137           for (Int_t iy = 1; iy <= h2.GetYaxis()->GetNbins(); ++iy) {
 
 1138             W += h2.GetBinContent(ix,iy);
 
 1144           for (Int_t iy = 1; iy <= h2.GetYaxis()->GetNbins(); ++iy) {
 
 1146             const Double_t 
w = W * (bin_width ? h2.GetYaxis()->GetBinWidth(iy) : 1.0);
 
 1148             h2.SetBinContent(ix, iy, h2.GetBinContent(ix,iy) / 
w);
 
 1151               h2.SetBinError(ix, iy, h2.GetBinError(ix,iy) / 
w);
 
 1175   inline void convertToPDF(TH3& h3, 
const std::string& option = 
"NXYW", 
const double factor = 1.0)
 
 1177     using namespace std;
 
 1179     const bool normalise = (option.find(
'N') != string::npos || option.find(
'n') != string::npos);
 
 1180     const bool X         = (option.find(
'X') != string::npos || option.find(
'x') != string::npos);
 
 1181     const bool Y         = (option.find(
'Y') != string::npos || option.find(
'y') != string::npos);
 
 1182     const bool Z         = (option.find(
'Z') != string::npos || option.find(
'z') != string::npos);    
 
 1183     const bool bin_width = (option.find(
'W') != string::npos || option.find(
'w') != string::npos);
 
 1184     const bool use_error = (option.find(
'E') != string::npos || option.find(
'e') != string::npos);
 
 1194         for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1195           for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
 
 1196             for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {     
 
 1197               W += h3.GetBinContent(ix,iy,iz);
 
 1205         for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1206           for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
 
 1207             for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {     
 
 1209               const Double_t 
w = W * (bin_width ? h3.GetXaxis()->GetBinWidth(ix) * h3.GetYaxis()->GetBinWidth(iy) * h3.GetZaxis()->GetBinWidth(iz) : 1.0);
 
 1211               h3.SetBinContent(ix, iy, iz, h3.GetBinContent(ix,iy,iz) * factor / 
w);
 
 1214                 h3.SetBinError(ix, iy, iz, h3.GetBinError(ix,iy,iz) * factor / 
w);
 
 1221     } 
else if (X && Z) {
 
 1223       for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
 
 1229           for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1230             for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
 
 1231               W += h3.GetBinContent(ix,iy,iz);
 
 1238           for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1239             for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
 
 1241               const Double_t 
w = W * (bin_width ? h3.GetXaxis()->GetBinWidth(ix) * h3.GetZaxis()->GetBinWidth(iz) : 1.0);
 
 1243               h3.SetBinContent(ix, iy, iz, h3.GetBinContent(ix,iy,iz) * factor / 
w);
 
 1246                 h3.SetBinError(ix, iy, iz, h3.GetBinError(ix,iy,iz) * factor / 
w);
 
 1253     } 
else if (Y && Z) {
 
 1255       for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1261           for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
 
 1262             for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
 
 1263               W += h3.GetBinContent(ix,iy,iz);
 
 1270           for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
 
 1271             for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
 
 1273               const Double_t 
w = W * (bin_width ? h3.GetYaxis()->GetBinWidth(iy) * h3.GetZaxis()->GetBinWidth(iz) : 1.0);
 
 1275               h3.SetBinContent(ix, iy, iz, h3.GetBinContent(ix,iy,iz) * factor / 
w);
 
 1278                 h3.SetBinError(ix, iy, iz, h3.GetBinError(ix,iy,iz) * factor / 
w);
 
 1285     } 
else if (X && Y) {
 
 1287       for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {      
 
 1293           for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1294             for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
 
 1295               W += h3.GetBinContent(ix,iy,iz);
 
 1302           for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1303             for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
 
 1305               const Double_t 
w = W * (bin_width ? h3.GetXaxis()->GetBinWidth(ix) * h3.GetYaxis()->GetBinWidth(iy) : 1.0);
 
 1307               h3.SetBinContent(ix, iy, iz, h3.GetBinContent(ix,iy,iz) * factor / 
w);
 
 1310                 h3.SetBinError(ix, iy, iz, h3.GetBinError(ix,iy,iz) * factor / 
w);
 
 1319       for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
 
 1320         for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
 
 1326             for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1327               W += h3.GetBinContent(ix,iy,iz);
 
 1333             for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1335               const Double_t 
w = W * (bin_width ? h3.GetXaxis()->GetBinWidth(ix) : 1.0);
 
 1337               h3.SetBinContent(ix, iy, iz, h3.GetBinContent(ix,iy,iz) * factor / 
w);
 
 1340                 h3.SetBinError(ix, iy, iz, h3.GetBinError(ix,iy,iz) * factor / 
w);
 
 1349       for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1350         for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {     
 
 1356             for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
 
 1357               W += h3.GetBinContent(ix,iy,iz);
 
 1363             for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
 
 1365               const Double_t 
w = W * (bin_width ? h3.GetYaxis()->GetBinWidth(iy) : 1.0);
 
 1367               h3.SetBinContent(ix, iy, iz, h3.GetBinContent(ix,iy,iz) / 
w);
 
 1370                 h3.SetBinError(ix, iy, iz, h3.GetBinError(ix,iy,iz) / 
w);
 
 1379       for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
 
 1380         for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {     
 
 1386             for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
 
 1387               W += h3.GetBinContent(ix,iy,iz);
 
 1393             for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
 
 1395               const Double_t 
w = W * (bin_width ? h3.GetZaxis()->GetBinWidth(iz) : 1.0);
 
 1397               h3.SetBinContent(ix, iy, iz, h3.GetBinContent(ix,iy,iz) / 
w);
 
 1400                 h3.SetBinError(ix, iy, iz, h3.GetBinError(ix,iy,iz) / 
w);
 
 1417     using namespace std;
 
 1419     Double_t ymin = numeric_limits<Double_t>::max();
 
 1420     Double_t ymax = numeric_limits<Double_t>::lowest();
 
 1422     for (Int_t i = 0; i != 
g1.GetN(); ++i) {
 
 1424       const Double_t 
y = 
g1.GetY()[i];
 
 1426       if (
y > ymax) { ymax = 
y; }
 
 1427       if (
y < ymin) { ymin = 
y; }
 
 1430     g1.SetMinimum(ymin);
 
 1431     g1.SetMaximum(ymax);
 
 1442     using namespace std;
 
 1444     Double_t zmin = numeric_limits<Double_t>::max();
 
 1445     Double_t zmax = numeric_limits<Double_t>::lowest();
 
 1447     for (Int_t i = 0; i != g2.GetN(); ++i) {
 
 1449       const Double_t z = g2.GetZ()[i];
 
 1451       if (z > zmax) { zmax = z; }
 
 1452       if (z < zmin) { zmin = z; }
 
 1455     g2.SetMinimum(zmin);
 
 1456     g2.SetMaximum(zmax);
 
 1478     if (logx || 
xmin >= dx || 
xmin < 0.0)
 
 1508     using namespace JPP;
 
 1510     if (axis->GetNbins() == (
int) memo.size()) {
 
 1512       for (
int i = 0; i != axis->GetNbins(); ++i) {
 
 1516         axis->SetBinLabel(i + 1, address.
toString().c_str());
 
 1539     using namespace JPP;
 
 1543     if      (axis == 
"x" || axis == 
"X") 
 
 1544       pax = h1.GetXaxis();
 
 1545     else if (axis == 
"y" || axis == 
"Y") 
 
 1546       pax = h1.GetYaxis();
 
 1547     else if (axis == 
"z" || axis == 
"Z") 
 
 1548       pax = h1.GetZaxis();
 
 1552     if (pax->GetNbins() == (
int) memo.size()) {
 
 1554       for (
int i = 0; i != pax->GetNbins(); ++i) {
 
 1558         pax->SetBinLabel(i + 1, address.
toString().c_str());
 
 1561       h1.LabelsOption(
"a", axis.c_str());       
 
 1578     return (key != NULL && TClass::GetClass(key->GetClassName())->IsTObject());
 
 1591     const TRegexp regexp(name);
 
 1597       const TString tag(
p1->GetName());
 
 1599       if (tag.Contains(regexp)) {
 
 1617     return (TF1*) 
getObject(h1->GetListOfFunctions(), fcn);
 
 1630     return (TF1*) 
getObject(
g1->GetListOfFunctions(), fcn);
 
 1643     return (TF1*) 
getObject(g2->GetListOfFunctions(), fcn);
 
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
 
Double_t g1(const Double_t x)
Function.
 
Lookup table for PMT addresses in optical module.
 
const JPMTAddressTranslator & getAddressTranslator(const int tdc) const
Get PMT address translator.
 
Data structure for PMT physical address.
 
std::string toString() const
Convert PMT physical address to string.
 
Auxiliary class to handle file name, ROOT directory and object name.
 
Exception for a functional operation.
 
Exception for parsing value.
 
Exception for accessing a value in a collection that is outside of its range.
 
const JPolynome f1(1.0, 2.0, 3.0)
Function.
 
std::string getFilename(const std::string &file_name)
Get file name part, i.e. part after last JEEP::PATHNAME_SEPARATOR if any.
 
Auxiliary applications for use of ROOT and more.
 
void setRange(double &xmin, double &xmax, const bool logx)
Set axis range.
 
bool isTAttFill(const TObject *object)
Get drawing option of object.
 
void copy(const TF2 &from, TF2 &to)
Copy function parameters.
 
int getParameter(const std::string &text)
Get parameter number from text string.
 
void setLogarithmicY(TEllipse *ellipse)
Make y-axis of given ellipse logarithmic (e.g. after using log10()).
 
TF1 * getFunction(TGraph2D *g2, const char *const fcn)
Get function.
 
Double_t getValue(const std::string &text, const int index)
Get parameter value from text string.
 
void convertToPDF(TH3 &h3, const std::string &option="NXYW", const double factor=1.0)
Convert 3D histogram to PDF.
 
void setLogarithmic(TAxis *axis)
Make histogram axis logarithmic (e.g. after using log10()).
 
Double_t getResult(const std::string &text, TObject *object=NULL)
Get result of given textual formula.
 
TObject * getObject(TList *ls, const char *const name)
Get first object of which name matches given reguar expression.
 
void setLimits(TGraph2D &g2)
Set limits of TGraph2D.
 
TFile * getFile(const std::string &file_name, const std::string &option="exist")
Get TFile pointer corresponding to give file name.
 
void setLogarithmicX(TEllipse *ellipse)
Make x-axis of given ellipse logarithmic (e.g. after using log10()).
 
TDirectory * getDirectory(const JRootObjectID &id)
Get TDirectory pointer.
 
static const char *const TIMESTAMP
Time stamp of earliest UTC time.
 
bool isTObject(const TKey *key)
Check if given key corresponds to a TObject.
 
bool isTAttLine(const TObject *object)
Get drawing option of object.
 
TString getLogarithmic(const TString &formula, const char parameter)
Make given parameter in formula logarithmic (e.g. after using log10()).
 
void setAxisLabels(TH1 &h1, const std::string axis, const JModuleAddressMap &memo)
Set axis labels with PMT addresses.
 
T pow(const T &x, const double y)
Power .
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 
Auxiliary data structure for JOpera1D.cc and JOpera2D.cc applications.
 
static const char *const SAME_AS_INPUT()
Set name of output histogram to name of input histogram.
 
static const char *const Multiply()
ROOT TH1::Multiply.
 
static const char *const Replace()
Set contents to associated function.
 
static const char *const sqrt()
Set contents to signed difference between squares.
 
static const char *const Add()
ROOT TH1::Add.
 
static const char *const add()
Add contents with lookup bin in second histogram.
 
static const char *const Divide()
ROOT TH1::Divide.
 
static const char *const multiply()
Multiply contents with lookup bin in second histogram.
 
static const char *const SAME_AS_OPERATION()
Set name of output histogram to name of operation.
 
static const char *const stdev()
Set contents to standard deviation.
 
static const char *const Subtract()
ROOT TH1::Subtract.
 
static const char *const divide()
Divide contents with lookup bin in second histogram.
 
static const char *const efficiency()
Divide contents and multiply errors with inefficiency.
 
static const char *const subtract()
Subtract contents with lookup bin in second histogram.
 
Auxiliary data structure to list files in directory.