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"
33 #include "TIterator.h"
35 #include "TMethodCall.h"
38 #pragma GCC diagnostic pop
51 namespace JPP {
using namespace JGIZMO; }
77 static const char*
const Add() {
return "Add"; }
78 static const char*
const add() {
return "add"; }
79 static const char*
const Subtract() {
return "Subtract"; }
80 static const char*
const subtract() {
return "subtract"; }
81 static const char*
const Multiply() {
return "Multiply"; }
82 static const char*
const multiply() {
return "multiply"; }
83 static const char*
const Divide() {
return "Divide"; }
84 static const char*
const divide() {
return "divide"; }
85 static const char*
const efficiency() {
return "efficiency"; }
86 static const char*
const stdev() {
return "stdev"; }
87 static const char*
const sqrt() {
return "sqrt"; }
88 static const char*
const Replace() {
return "Replace"; }
95 static const char*
const TIMESTAMP =
"#splitline{}{#splitline{%d:%m:%y}{ %H:%M}}%F1970-01-01 00:00:00";
108 inline TFile*
getFile(
const std::string& file_name,
const std::string& option =
"exist")
112 gErrorIgnoreLevel = kError;
118 if (
i == zmap.end() ||
i->second == NULL || !
i->second->IsOpen()) {
120 TFile*
file = TFile::Open(file_name.c_str(), option.c_str());
122 zmap[file_name] =
file;
145 if (in == NULL || !in->IsOpen()) {
150 return in->GetDirectory(
id.getDirectory());
168 const TRegexp regexp(
id.getObjectName());
170 TIter iter(dir->GetListOfKeys());
172 for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
174 const TString tag(key->GetName());
178 if (tag.Index(regexp) != -1) {
179 return key->ReadObj();
197 const TH1* h1 =
dynamic_cast<const TH1*
>(object);
201 if (h1->GetSumw2N()) {
202 for (Int_t
i = 1;
i <= h1->GetNbinsX(); ++
i) {
203 if (h1->GetBinError(
i) != 0.0) {
211 const TGraphErrors*
g1 =
dynamic_cast<const TGraphErrors*
>(object);
215 for (Int_t
i = 0;
i != g1->GetN(); ++
i) {
216 if (g1->GetEY()[
i] != 0.0) {
221 return g1->GetN() > 1;
225 const TGraph*
g1 =
dynamic_cast<const TGraph*
>(object);
228 return g1->GetN() > 1;
252 TString buffer(text);
254 if (
object != NULL) {
256 TClass* p = TClass::GetClass(object->ClassName());
262 TMethod* method = NULL;
264 for (std::unique_ptr<TIterator> iter(p->GetListOfAllPublicMethods()->MakeIterator()); TMethod* p = (TMethod*) iter->Next(); ) {
265 if (buffer.Index(p->GetName()) != -1) {
266 if (method == NULL || strlen(p->GetName()) > strlen(method->GetName())) {
272 if (method == NULL) {
276 for (Ssiz_t index; (index = buffer.Index(method->GetName())) != -1; ) {
278 const TRegexp fp(
" *([^)]*)");
281 Ssiz_t pos = buffer.Index(fp, &len, index);
285 if (pos == -1 || pos != index + (Ssiz_t) strlen(method->GetName())) {
287 TMethodCall(p, method->GetName(), NULL).Execute(
object, value);
289 len = strlen(method->GetName());
293 TMethodCall(p, method->GetName(), NULL).Execute(
object, TString(buffer(pos + 1, len - 2)), value);
295 len += strlen(method->GetName());
298 buffer.Replace(index, len, TString::Format(
"%20.10e", value));
304 return TFormula(
"/tmp", buffer.Data()).Eval(0.0);
324 return getResult(TString(text.c_str()),
object);
338 const char* regexp(
"p[0-9]* *=");
340 TString buffer(text.c_str());
342 buffer = buffer(TRegexp(regexp));
343 buffer = buffer(1, buffer.Length() - 2);
345 if (!buffer.IsDigit()) {
349 return buffer.Atoi();
369 const char* regexp(
"=.*");
371 TString buffer(text.c_str());
373 buffer = buffer(TRegexp(regexp));
374 buffer = buffer(1, buffer.Length() - 1);
376 return getResult(std::string(buffer),
object);
399 const char* regexp(
"=.*");
401 TString buffer(text.c_str());
403 buffer = buffer(TRegexp(regexp));
404 buffer = buffer(1, buffer.Length() - 1);
407 istringstream
is((std::string(buffer)));
411 for (
int i = index; is >> value &&
i > 0; --
i) {}
416 THROW(
JParseError,
"Text does not contain a number at given position " << buffer <<
' ' << index);
429 const Int_t
N = axis->GetNbins();
430 Double_t buffer[N+1];
432 buffer[0] = TMath::Power(10.0, axis->GetBinLowEdge(1));
434 for (Int_t
i = 1;
i <=
N; ++
i) {
435 buffer[
i] = TMath::Power(10.0, axis->GetBinLowEdge(
i) + axis->GetBinWidth(
i));
438 axis->Set(N, buffer);
467 const TRegexp regexp[] = {
468 TString(
"^") + TString(parameter) + TString(
"[^a-zA-Z_]"),
469 TString(
"[^a-zA-Z_]") + TString(parameter) + TString(
"[^a-zA-Z_]"),
470 TString(
"[^a-zA-Z_]") + TString(parameter) + TString(
"$")
473 const TString replacement = TString(
"log10(") + TString(parameter) + TString(
")");
475 TString buffer(formula);
477 if (buffer.Length() == 1 && buffer[0] == parameter) {
479 buffer = replacement;
483 for (Ssiz_t pos = 0,
i; pos < buffer.Length(); pos += replacement.Length()) {
484 if ((
i = buffer.Index(regexp[0], pos)) != -1) { buffer.Replace((pos =
i + 0), 1, replacement); }
485 else if ((
i = buffer.Index(regexp[1], pos)) != -1) { buffer.Replace((pos =
i + 1), 1, replacement); }
486 else if ((
i = buffer.Index(regexp[2], pos)) != -1) { buffer.Replace((pos =
i + 1), 1, replacement); }
501 inline void copy(
const TF1& from, TF1& to)
503 static_cast<TAttLine&
> (to) = static_cast<const TAttLine&> (from);
504 static_cast<TAttFill&
> (to) = static_cast<const TAttFill&> (from);
505 static_cast<TAttMarker&
>(to) = static_cast<const TAttMarker&>(from);
507 to.SetParameters(from.GetParameters());
509 to.SetNpx(from.GetNpx());
519 inline void copy(
const TF2& from, TF2& to)
521 copy(static_cast<const TF1&>(from), static_cast<TF1&>(to));
523 to.SetNpy(from.GetNpy());
558 fn.SetRange(f1->GetXmin(),
563 f1->SetRange(TMath::Power(10.0,f1->GetXmin()),
564 TMath::Power(10.0,f1->GetXmax()));
578 TString buffer = f1->GetExpFormula();
580 buffer =
"pow(10.0, " + buffer +
")";
582 TF1 fn(f1->GetName(), buffer);
604 fn.SetRange(f2->GetXmin(),
611 f2->SetRange(TMath::Power(10.0,f2->GetXmin()),
613 TMath::Power(10.0,f2->GetXmax()),
632 fn.SetRange(f2->GetXmin(),
639 f2->SetRange(f2->GetXmin(),
640 TMath::Power(10.0,f2->GetYmin()),
642 TMath::Power(10.0,f2->GetYmax()));
656 setLogarithmicX<TF1>(h1->GetListOfFunctions());
674 setLogarithmicX<TF2>(h2->GetListOfFunctions());
690 setLogarithmicY<TF2>(h2->GetListOfFunctions());
706 setLogarithmicX<TF1>(g1->GetListOfFunctions());
708 for (Int_t
i = 0;
i != g1->GetN(); ++
i) {
709 g1->GetX()[
i] =
pow(10.0, g1->GetX()[
i]);
724 setLogarithmicY<TF1>(g1->GetListOfFunctions());
726 for (Int_t
i = 0;
i != g1->GetN(); ++
i) {
727 g1->GetY()[
i] =
pow(10.0, g1->GetY()[
i]);
742 setLogarithmicX<TF1>(g1->GetListOfFunctions());
744 for (Int_t
i = 0;
i != g1->GetN(); ++
i) {
745 g1->GetEX()[
i] =
pow(10.0, g1->GetX()[
i] + g1->GetEX()[
i]) -
pow(10.0, g1->GetX()[
i]);
746 g1->GetX() [
i] =
pow(10.0, g1->GetX()[
i]);
761 setLogarithmicY<TF1>(g1->GetListOfFunctions());
763 for (Int_t
i = 0;
i != g1->GetN(); ++
i) {
764 g1->GetEY()[
i] =
pow(10.0, g1->GetY()[
i] + g1->GetEY()[
i]) -
pow(10.0, g1->GetY()[
i]);
765 g1->GetY() [
i] =
pow(10.0, g1->GetY()[
i]);
780 setLogarithmicX<TF2>(g2->GetListOfFunctions());
782 for (Int_t
i = 0;
i != g2->GetN(); ++
i) {
783 g2->GetX()[
i] =
pow(10.0, g2->GetX()[
i]);
798 setLogarithmicY<TF2>(g2->GetListOfFunctions());
800 for (Int_t
i = 0;
i != g2->GetN(); ++
i) {
801 g2->GetY()[
i] =
pow(10.0, g2->GetY()[
i]);
816 setLogarithmicX<TF2>(g2->GetListOfFunctions());
818 for (Int_t
i = 0;
i != g2->GetN(); ++
i) {
819 g2->GetEX()[
i] =
pow(10.0, g2->GetX()[
i] + g2->GetEX()[
i]) -
pow(10.0, g2->GetX()[
i]);
820 g2->GetX() [
i] =
pow(10.0, g2->GetX()[
i]);
835 setLogarithmicY<TF2>(g2->GetListOfFunctions());
837 for (Int_t
i = 0;
i != g2->GetN(); ++
i) {
838 g2->GetEY()[
i] =
pow(10.0, g2->GetY()[
i] + g2->GetEY()[
i]) -
pow(10.0, g2->GetY()[
i]);
839 g2->GetY() [
i] =
pow(10.0, g2->GetY()[
i]);
853 setLogarithmicX<TGraph>(gn->GetListOfGraphs());
866 setLogarithmicY<TGraph>(gn->GetListOfGraphs());
879 line->SetX1(
pow(10.0, line->GetX1()));
880 line->SetX2(
pow(10.0, line->GetX2()));
893 line->SetY1(
pow(10.0, line->GetY1()));
894 line->SetY2(
pow(10.0, line->GetY2()));
929 for (TIter
i(list);
T* p =
dynamic_cast<T*
>(
i.Next()); ) {
943 for (TIter
i(list);
T* p =
dynamic_cast<T*
>(
i.Next()); ) {
961 inline void convertToPDF(TH1& h1,
const std::string& option =
"NW",
const double factor = 1.0)
965 const bool normalise = (option.find(
'N') != string::npos || option.find(
'n') != string::npos);
966 const bool bin_width = (option.find(
'W') != string::npos || option.find(
'w') != string::npos);
967 const bool use_error = (option.find(
'E') != string::npos || option.find(
'e') != string::npos);
975 for (Int_t
i = 1;
i <= h1.GetXaxis()->GetNbins(); ++
i) {
976 W += h1.GetBinContent(
i);
982 for (Int_t
i = 1;
i <= h1.GetXaxis()->GetNbins(); ++
i) {
984 const Double_t
w = W * (bin_width ? h1.GetXaxis()->GetBinWidth(
i) : 1.0);
986 h1.SetBinContent(
i, h1.GetBinContent(
i) * factor /
w);
989 h1.SetBinError(
i, h1.GetBinError(
i) * factor /
w);
1010 inline void convertToPDF(TH2& h2,
const std::string& option =
"NXYW",
const double factor = 1.0)
1012 using namespace std;
1014 const bool normalise = (option.find(
'N') != string::npos || option.find(
'n') != string::npos);
1015 const bool X = (option.find(
'X') != string::npos || option.find(
'x') != string::npos);
1016 const bool Y = (option.find(
'Y') != string::npos || option.find(
'y') != string::npos);
1017 const bool bin_width = (option.find(
'W') != string::npos || option.find(
'w') != string::npos);
1018 const bool use_error = (option.find(
'E') != string::npos || option.find(
'e') != string::npos);
1028 for (Int_t ix = 1; ix <= h2.GetXaxis()->GetNbins(); ++ix) {
1029 for (Int_t iy = 1; iy <= h2.GetYaxis()->GetNbins(); ++iy) {
1030 W += h2.GetBinContent(ix,iy);
1037 for (Int_t ix = 1; ix <= h2.GetXaxis()->GetNbins(); ++ix) {
1038 for (Int_t iy = 1; iy <= h2.GetYaxis()->GetNbins(); ++iy) {
1040 const Double_t
w = W * (bin_width ? h2.GetXaxis()->GetBinWidth(ix) * h2.GetYaxis()->GetBinWidth(iy) : 1.0);
1042 h2.SetBinContent(ix, iy, h2.GetBinContent(ix,iy) * factor /
w);
1045 h2.SetBinError(ix, iy, h2.GetBinError(ix,iy) * factor /
w);
1053 for (Int_t iy = 1; iy <= h2.GetYaxis()->GetNbins(); ++iy) {
1059 for (Int_t ix = 1; ix <= h2.GetXaxis()->GetNbins(); ++ix) {
1060 W += h2.GetBinContent(ix,iy);
1066 for (Int_t ix = 1; ix <= h2.GetXaxis()->GetNbins(); ++ix) {
1068 const Double_t
w = W * (bin_width ? h2.GetXaxis()->GetBinWidth(ix) : 1.0);
1070 h2.SetBinContent(ix, iy, h2.GetBinContent(ix,iy) * factor /
w);
1073 h2.SetBinError(ix, iy, h2.GetBinError(ix,iy) * factor /
w);
1081 for (Int_t ix = 1; ix <= h2.GetXaxis()->GetNbins(); ++ix) {
1087 for (Int_t iy = 1; iy <= h2.GetYaxis()->GetNbins(); ++iy) {
1088 W += h2.GetBinContent(ix,iy);
1094 for (Int_t iy = 1; iy <= h2.GetYaxis()->GetNbins(); ++iy) {
1096 const Double_t
w = W * (bin_width ? h2.GetYaxis()->GetBinWidth(iy) : 1.0);
1098 h2.SetBinContent(ix, iy, h2.GetBinContent(ix,iy) /
w);
1101 h2.SetBinError(ix, iy, h2.GetBinError(ix,iy) /
w);
1125 inline void convertToPDF(TH3& h3,
const std::string& option =
"NXYW",
const double factor = 1.0)
1127 using namespace std;
1129 const bool normalise = (option.find(
'N') != string::npos || option.find(
'n') != string::npos);
1130 const bool X = (option.find(
'X') != string::npos || option.find(
'x') != string::npos);
1131 const bool Y = (option.find(
'Y') != string::npos || option.find(
'y') != string::npos);
1132 const bool Z = (option.find(
'Z') != string::npos || option.find(
'z') != string::npos);
1133 const bool bin_width = (option.find(
'W') != string::npos || option.find(
'w') != string::npos);
1134 const bool use_error = (option.find(
'E') != string::npos || option.find(
'e') != string::npos);
1144 for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
1145 for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
1146 for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
1147 W += h3.GetBinContent(ix,iy,iz);
1155 for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
1156 for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
1157 for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
1159 const Double_t
w = W * (bin_width ? h3.GetXaxis()->GetBinWidth(ix) * h3.GetYaxis()->GetBinWidth(iy) * h3.GetZaxis()->GetBinWidth(iz) : 1.0);
1161 h3.SetBinContent(ix, iy, iz, h3.GetBinContent(ix,iy,iz) * factor /
w);
1164 h3.SetBinError(ix, iy, iz, h3.GetBinError(ix,iy,iz) * factor /
w);
1171 }
else if (
X &&
Z) {
1173 for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
1179 for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
1180 for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
1181 W += h3.GetBinContent(ix,iy,iz);
1188 for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
1189 for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
1191 const Double_t
w = W * (bin_width ? h3.GetXaxis()->GetBinWidth(ix) * h3.GetZaxis()->GetBinWidth(iz) : 1.0);
1193 h3.SetBinContent(ix, iy, iz, h3.GetBinContent(ix,iy,iz) * factor /
w);
1196 h3.SetBinError(ix, iy, iz, h3.GetBinError(ix,iy,iz) * factor /
w);
1203 }
else if (
Y &&
Z) {
1205 for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
1211 for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
1212 for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
1213 W += h3.GetBinContent(ix,iy,iz);
1220 for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
1221 for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
1223 const Double_t
w = W * (bin_width ? h3.GetYaxis()->GetBinWidth(iy) * h3.GetZaxis()->GetBinWidth(iz) : 1.0);
1225 h3.SetBinContent(ix, iy, iz, h3.GetBinContent(ix,iy,iz) * factor /
w);
1228 h3.SetBinError(ix, iy, iz, h3.GetBinError(ix,iy,iz) * factor /
w);
1235 }
else if (
X &&
Y) {
1237 for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
1243 for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
1244 for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
1245 W += h3.GetBinContent(ix,iy,iz);
1252 for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
1253 for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
1255 const Double_t
w = W * (bin_width ? h3.GetXaxis()->GetBinWidth(ix) * h3.GetYaxis()->GetBinWidth(iy) : 1.0);
1257 h3.SetBinContent(ix, iy, iz, h3.GetBinContent(ix,iy,iz) * factor /
w);
1260 h3.SetBinError(ix, iy, iz, h3.GetBinError(ix,iy,iz) * factor /
w);
1269 for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
1270 for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
1276 for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
1277 W += h3.GetBinContent(ix,iy,iz);
1283 for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
1285 const Double_t
w = W * (bin_width ? h3.GetXaxis()->GetBinWidth(ix) : 1.0);
1287 h3.SetBinContent(ix, iy, iz, h3.GetBinContent(ix,iy,iz) * factor /
w);
1290 h3.SetBinError(ix, iy, iz, h3.GetBinError(ix,iy,iz) * factor /
w);
1299 for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
1300 for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
1306 for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
1307 W += h3.GetBinContent(ix,iy,iz);
1313 for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
1315 const Double_t
w = W * (bin_width ? h3.GetYaxis()->GetBinWidth(iy) : 1.0);
1317 h3.SetBinContent(ix, iy, iz, h3.GetBinContent(ix,iy,iz) /
w);
1320 h3.SetBinError(ix, iy, iz, h3.GetBinError(ix,iy,iz) /
w);
1329 for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
1330 for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
1336 for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
1337 W += h3.GetBinContent(ix,iy,iz);
1343 for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
1345 const Double_t
w = W * (bin_width ? h3.GetZaxis()->GetBinWidth(iz) : 1.0);
1347 h3.SetBinContent(ix, iy, iz, h3.GetBinContent(ix,iy,iz) /
w);
1350 h3.SetBinError(ix, iy, iz, h3.GetBinError(ix,iy,iz) /
w);
1367 using namespace std;
1369 Double_t ymin = numeric_limits<Double_t>::max();
1370 Double_t ymax = numeric_limits<Double_t>::lowest();
1372 for (Int_t
i = 0;
i != g1.GetN(); ++
i) {
1374 const Double_t
y = g1.GetY()[
i];
1376 if (y > ymax) { ymax =
y; }
1377 if (y < ymin) { ymin =
y; }
1380 g1.SetMinimum(ymin);
1381 g1.SetMaximum(ymax);
1392 using namespace std;
1394 Double_t zmin = numeric_limits<Double_t>::max();
1395 Double_t zmax = numeric_limits<Double_t>::lowest();
1397 for (Int_t
i = 0;
i != g2.GetN(); ++
i) {
1399 const Double_t
z = g2.GetZ()[
i];
1401 if (z > zmax) { zmax =
z; }
1402 if (z < zmin) { zmin =
z; }
1405 g2.SetMinimum(zmin);
1406 g2.SetMaximum(zmax);
1426 double dx = (xmax -
xmin) * 0.1;
1428 if (logx || xmin >= dx || xmin < 0.0)
1458 using namespace JPP;
1460 if (axis->GetNbins() == (int) memo.size()) {
1462 for (
int i = 0;
i != axis->GetNbins(); ++
i) {
1464 const JPMTPhysicalAddress& address = memo[
i];
1466 axis->SetBinLabel(
i + 1, address.toString().c_str());
1489 using namespace JPP;
1493 if (axis ==
"x" || axis ==
"X")
1494 pax = h1.GetXaxis();
1495 else if (axis ==
"y" || axis ==
"Y")
1496 pax = h1.GetYaxis();
1497 else if (axis ==
"z" || axis ==
"Z")
1498 pax = h1.GetZaxis();
1502 if (pax->GetNbins() == (int) memo.size()) {
1504 for (
int i = 0;
i != pax->GetNbins(); ++
i) {
1508 pax->SetBinLabel(
i + 1, address.toString().c_str());
1511 h1.LabelsOption(
"a", axis.c_str());
1528 return (key != NULL && TClass::GetClass(key->GetClassName())->IsTObject());
1541 const TRegexp regexp(name);
1547 const TString tag(
p1->GetName());
1549 if (tag.Contains(regexp)) {
1567 return (TF1*)
getObject(h1->GetListOfFunctions(), fcn);
1580 return (TF1*)
getObject(g1->GetListOfFunctions(), fcn);
1593 return (TF1*)
getObject(g2->GetListOfFunctions(), fcn);
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.
TF1 * getFunction(TH1 *h1, const char *const fcn)
Get function.
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.
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.
then fatal The output file must have the wildcard in the name
void setLogarithmicY(TList *list)
Make y-axis of objects in list logarithmic (e.g. after using log10()).
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[energy[distance[z of PMT]]] fi case set_variable z
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
then fatal The output file must have the wildcard in the e g root fi 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 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()).
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.