26#include "TInterpreter.h"
27#include "TApplication.h"
39#include "TStopwatch.h"
40#include "TTimeStamp.h"
43#include "TGo4LockGuard.h"
91 void InstallGo4CtrlCHandler(
bool on);
114 GO4TRACE((14,
"TGo4Analysis::Instance()",__LINE__, __FILE__));
178 GO4TRACE((15,
"TGo4Analysis::TGo4Analysis(const char *)",__LINE__, __FILE__));
217 GO4TRACE((15,
"TGo4Analysis::TGo4Analysis(const char *)",__LINE__, __FILE__));
228 Message(-1,
"!!!! Analysis Base class:\n\t User Analysis was built with wrong \t\tGo4 Buildversion %d !!!!!",
231 Message(-1,
"\t >>make clean all<<");
232 Message(-1,
"Aborting in 20 s...");
233 gSystem->Sleep(20000);
241 gROOT->SetBatch(kTRUE);
263 InstallGo4CtrlCHandler(
true);
268 Message(2,
"Analysis BaseClass ctor -- analysis singleton already exists !!!");
271 TInterpreter* theI = gROOT->GetInterpreter();
272 theI->SetProcessLineLock(kTRUE);
274 gROOT->ProcessLineSync(
"TGo4Analysis *go4 = TGo4Analysis::Instance();");
275 gROOT->ProcessLineSync(TString::Format(
".x %s",
TGo4Log::subGO4SYS(
"macros/anamacroinit.C").Data()).Data());
283 InstallGo4CtrlCHandler(
false);
291 GO4TRACE((15,
"TGo4Analysis::~TGo4Analysis()",__LINE__, __FILE__));
301 gROOT->ProcessLineSync(TString::Format(
".x %s",
TGo4Log::subGO4SYS(
"macros/anamacroclose.C").Data()).Data());
317 if (gApplication) gApplication->Terminate();
332 GO4TRACE((14,
"TGo4Analysis::InitEventClasses()",__LINE__, __FILE__));
341 TGo4Log::Info(
"Analysis -- Initializing EventClasses done.");
355 TGo4Log::Info(
"Analysis BaseClass -- EventClasses were already initialized.");
364 GO4TRACE((11,
"TGo4Analysis::MainCycle()",__LINE__, __FILE__));
406 GO4TRACE((11,
"TGo4Analysis::UserEventFunc()",__LINE__, __FILE__));
417 GO4TRACE((11,
"TGo4Analysis::Process()",__LINE__, __FILE__));
426 gSystem->ProcessEvents();
439 TDirectory *savdir = gDirectory;
458 Message(2,
"Analysis %s TIMEOUT for eventsource %s:%s.",
465 Message(2,
"End of event source %s: name:%s - msg:%s",
477 Int_t prio=ex.GetPriority();
486 Message(3,
"Analysis %s ERROR: %s from event source %s:\n %s",
524 Message(3,
"Analysis %s ERROR: %s from dynamic list entry %s:%s",
525 GetName(),ex.GetStatusMessage(),
526 ex.GetEntryName(), ex.GetEntryClass());
540 Message(3,
"Analysis %s ERROR: %s in Analysis Step %s",
541 GetName(), ex.GetStatusMessage(), ex.GetStepName());
555 if(strlen(ex.GetMessage()) != 0)
556 Message(ex.GetPriority(),
"%s", ex.GetMessage());
566 catch(std::exception& ex)
568 Message(3,
"Analysis %s got standard exception %s",
GetName(), ex.what());
584 GO4TRACE((11,
"TGo4Analysis::RunImplicitLoop(Int_t)",__LINE__, __FILE__));
587 if (process_event_interval>1.) process_event_interval = 1.;
592 Bool_t userate = showrate || (process_event_interval > 0.);
593 Bool_t process_events = kFALSE;
595 fxRate->SetUpdateInterval(process_event_interval > 0. ? process_event_interval : 1.);
596 if (showrate)
fxRate->Reset();
598 TTimeStamp last_update;
603 Message(1,
"Analysis loop for %d cycles is starting...", times);
605 Message(1,
"Analysis loop is starting...");
609 if ((times > 0) && (cnt >= times)) {
618 if (userate &&
fxRate->Update(nextcnt)) {
620 process_events = kTRUE;
622 bool need_update =
false;
624 if ((now.AsDouble() - last_update.AsDouble()) >= 1.) {
625 last_update = now; need_update =
true;
632 fxRate->SetDateTime(dt.AsSQLString());
638 fxRate->SetCurrentSource(
"- No event source -");
652 if (process_events) {
654 process_events = kFALSE;
655 gSystem->ProcessEvents();
690 Message(1,
"End of event source %s: name:%s msg:%s",ex.GetSourceClass(), ex.GetSourceName(),ex.GetErrMess());
734 Message(3,
"%s", ex.GetErrMess());
747 Message(3,
"%s", ex.GetErrMess());
765 Message(1,
"!!! Unexpected exception in %d cycle !!!", cnt);
775 Message(1,
"Analysis implicit Loop has finished after %d cycles.", cnt);
783 Message(1,
"%s appeared in %d cycle.", ex.
What(), cnt);
786 catch(std::exception &ex) {
787 Message(1,
"standard exception %s appeared in %d cycle.", ex.what(), cnt);
790 Message(1,
"!!! Unexpected exception in %d cycle !!!", cnt);
794 printf(
"\n"); fflush(stdout);
807 GO4TRACE((11,
"TGo4Analysis::RemoveDynamicEntry(const char *, const char *)",__LINE__, __FILE__));
818 GO4TRACE((11,
"TGo4Analysis::UpdateStatus(TGo4AnalysisStatus*)",__LINE__, __FILE__));
832 GO4TRACE((11,
"TGo4Analysis::SetStatus(TGo4AnalysisStatus*)",__LINE__, __FILE__));
848 GO4TRACE((11,
"TGo4Analysis::LoadStatus(const char *)",__LINE__, __FILE__));
856 TFile *statusfile = TFile::Open(fname.Data(),
"READ");
857 if(statusfile && statusfile->IsOpen()) {
861 TIter iter(statusfile->GetListOfKeys());
863 while ((key = (TKey *)iter()) !=
nullptr) {
864 if (strcmp(key->GetClassName(),
"TGo4AnalysisStatus") == 0)
break;
872 Message(1,
"Analysis %s: Found status object %s in file %s",
873 GetName(), state->GetName(), fname.Data());
876 Message(0,
"Analysis: New analysis state is set.");
879 Message(3,
"Analysis LoadStatus: Could not find status %s in file %s",
GetName(), fname.Data());
883 Message(3,
"Analysis LoadStatus: Failed to open file %s", fname.Data());
894 GO4TRACE((11,
"TGo4Analysis::SaveStatus(const char *)",__LINE__, __FILE__));
897 memset(buffer, 0,
sizeof(buffer));
899 strncpy(buffer, filename,
sizeof(buffer)-10);
904 auto statusfile = TFile::Open(buffer,
"RECREATE");
905 if(statusfile && statusfile->IsOpen()) {
914 Message(-1,
"Analysis SaveStatus: Saved Analysis settings to file %s", buffer);
916 Message(3,
"Analysis SaveStatus: FAILED to create status object !!!");
920 Message(3,
"Analysis SaveStatus: Failed to open file %s ",
929 GO4TRACE((11,
"TGo4Analysis::CreateStatus()",__LINE__, __FILE__));
930 TDirectory *filsav = gDirectory;
940 GO4TRACE((11,
"TGo4Analysis::CreateWebStatus()",__LINE__, __FILE__));
941 TDirectory *filsav = gDirectory;
959 GO4TRACE((11,
"TGo4Analysis::CreateSingleEventTree(TGo4EventElement *)",__LINE__, __FILE__));
961 return event ?
event->CreateSampleTree(&
fxSampleEvent) :
nullptr;
966 GO4TRACE((11,
"TGo4Analysis::CreateSingleEventTree(const char *, Bool_t)",__LINE__, __FILE__));
978 GO4TRACE((14,
"TGo4Analysis::CloseAnalysis()",__LINE__, __FILE__));
991 GO4TRACE((11,
"TGo4Analysis:PreLoop()",__LINE__, __FILE__));
996 for (Int_t num = 0; num <
fxStepManager->GetNumberOfAnalysisSteps(); num++) {
1008 GO4TRACE((11,
"TGo4Analysis::PostLoop()",__LINE__, __FILE__));
1020 for (Int_t num = 0; num <
fxStepManager->GetNumberOfAnalysisSteps(); num++) {
1033 GO4TRACE((11,
"TGo4Analysis::UserPreLoop()",__LINE__, __FILE__));
1035 Message(0,
"Analysis BaseClass -- executing default User Preloop");
1041 GO4TRACE((11,
"TGo4Analysis::UserPostLoop()",__LINE__, __FILE__));
1043 Message(0,
"Analysis BaseClass -- executing default User Postloop");
1052 if(filename) buffer = filename;
1069 GO4TRACE((12,
"TGo4Analysis::LockAutoSave()",__LINE__, __FILE__));
1078 GO4TRACE((12,
"TGo4Analysis::UnLockAutoSave()",__LINE__, __FILE__));
1088 GO4TRACE((12,
"TGo4Analysis::AutoSave()",__LINE__, __FILE__));
1092 Message(0,
"Analysis -- AutoSaving....");
1098 Message(0,
"Analysis -- AutoSave done.");
1145 GO4TRACE((11,
"TGo4Analysis::UpdateNamesList()",__LINE__, __FILE__));
1149 Message(0,
"Analysis BaseClass -- Nameslist updated.");
1186 va_start(args, text);
1214 Message(2,
"Could not send object %s to GUI in batch mode.", ob->GetName());
1221 auto envelope =
new TGo4ObjEnvelope(ob, ob->GetName(), pathname.Data());
1253 Bool_t sysret = gSystem->ProcessEvents();
1268 Message(1,
"Start object server not yet enabled.");
1271 Message(2,
"Could not start object server in batch mode.");
1279 Message(1,
"Stop object server not yet enabled.");
1281 Message(2,
"Could not stop object server in batch mode.");
1289 TGo4Log::Message(1,
"Analysis server is initiating shutdown after ctrl-c, please wait!!\n");
1303 Message(1,
"Showing Output Event %s of step %s", sevtree->GetName(), stepname);
1305 Message(1,
"Showing Input Event %s of step %s", sevtree->GetName(), stepname);
1307 std::cout << std::endl;
1317 const char *hevx,
const char *hmemx,
1318 const char *hevy,
const char *hmemy,
1319 const char *hevz,
const char *hmemz,
1320 const char *condition,
1321 const char *cevx,
const char *cmemx,
1322 const char *cevy,
const char *cmemy)
1325 histo, hevx, hmemx, hevy, hmemy, hevz, hmemz,
1326 condition, cevx, cmemx, cevy, cmemy);
1331 Bool_t rev=
fxObjectManager->AddTreeHistogram(hisname,treename,varexp,cutexp);
1703 return myfolder ?
fxStepManager->Store(stepname, myfolder) : 2;
1730 if (!fullname || (strlen(fullname) == 0))
1732 const char *separ = strrchr(fullname,
'/');
1734 objectname = separ + 1;
1735 foldername.Append(fullname, separ - fullname);
1737 objectname = fullname;
1742 Int_t nbinsx, Double_t xlow, Double_t xup,
1743 const char *xtitle,
const char *ytitle)
1746 TString foldername, histoname;
1748 TGo4Log::Error(
"Histogram name not specified, can be a hard error");
1759 const char *sclass =
"TH1I";
1761 case 'I':
case 'i': itype = 0; sclass =
"TH1I";
break;
1762 case 'F':
case 'f': itype = 1; sclass =
"TH1F";
break;
1763 case 'D':
case 'd': itype = 2; sclass =
"TH1D";
break;
1764 case 'S':
case 's': itype = 3; sclass =
"TH1S";
break;
1765 case 'C':
case 'c': itype = 4; sclass =
"TH1C";
break;
1766 case 'L':
case 'l': itype = 5; sclass =
"TH1L";
break;
1767 default:
TGo4Log::Error(
"There is no histogram type: %c, use I instead", type);
break;
1774 if (title) oldh->SetTitle(title);
1775 if (xtitle) oldh->GetXaxis()->SetTitle(xtitle);
1776 if (ytitle) oldh->GetYaxis()->SetTitle(ytitle);
1781 TGo4Log::Info(
"There is histogram %s with type %s other than specified %s, create new and reuse content",
1782 fullname, oldh->ClassName(), sclass);
1788 oldh->SetName(
"___");
1791 TH1 *newh =
nullptr;
1794 case 0: newh =
new TH1I(histoname, title, nbinsx, xlow, xup);
break;
1795 case 1: newh =
new TH1F(histoname, title, nbinsx, xlow, xup);
break;
1796 case 2: newh =
new TH1D(histoname, title, nbinsx, xlow, xup);
break;
1797 case 3: newh =
new TH1S(histoname, title, nbinsx, xlow, xup);
break;
1798 case 4: newh =
new TH1C(histoname, title, nbinsx, xlow, xup);
break;
1799#if ROOT_VERSION_CODE > ROOT_VERSION(6,32,0)
1800 case 5: newh =
new TH1L(histoname, title, nbinsx, xlow, xup);
break;
1804 newh->SetTitle(title);
1806 if (xtitle) newh->GetXaxis()->SetTitle(xtitle);
1807 if (ytitle) newh->GetYaxis()->SetTitle(ytitle);
1815 if (foldername.Length() > 0)
1826 Int_t nbinsx, Double_t xlow, Double_t xup,
1827 Int_t nbinsy, Double_t ylow, Double_t yup,
1828 const char *xtitle,
const char *ytitle,
const char *ztitle)
1831 TString foldername, histoname;
1834 TGo4Log::Error(
"Histogram name not specified, can be a hard error");
1846 const char *sclass =
"TH2I";
1848 case 'I':
case 'i': itype = 0; sclass =
"TH2I";
break;
1849 case 'F':
case 'f': itype = 1; sclass =
"TH2F";
break;
1850 case 'D':
case 'd': itype = 2; sclass =
"TH2D";
break;
1851 case 'S':
case 's': itype = 3; sclass =
"TH2S";
break;
1852 case 'C':
case 'c': itype = 4; sclass =
"TH2C";
break;
1853 case 'L':
case 'l': itype = 5; sclass =
"TH2L";
break;
1854 default:
TGo4Log::Error(
"There is no histogram type: %c, use I instead", type);
break;
1861 if (title) oldh->SetTitle(title);
1862 if (xtitle) oldh->GetXaxis()->SetTitle(xtitle);
1863 if (ytitle) oldh->GetYaxis()->SetTitle(ytitle);
1864 return (TH2 *) oldh;
1868 TGo4Log::Info(
"There is histogram %s with type %s other than specified %s, create new and reuse content",
1869 fullname, oldh->ClassName(), sclass);
1875 oldh->SetName(
"___");
1878 TH2 *newh =
nullptr;
1881 case 0: newh =
new TH2I(histoname, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
break;
1882 case 1: newh =
new TH2F(histoname, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
break;
1883 case 2: newh =
new TH2D(histoname, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
break;
1884 case 3: newh =
new TH2S(histoname, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
break;
1885 case 4: newh =
new TH2C(histoname, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
break;
1886#if ROOT_VERSION_CODE > ROOT_VERSION(6,32,0)
1887 case 5: newh =
new TH2L(histoname, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
break;
1891 newh->SetTitle(title);
1893 if (xtitle) newh->GetXaxis()->SetTitle(xtitle);
1894 if (ytitle) newh->GetYaxis()->SetTitle(ytitle);
1895 if (ztitle) newh->GetZaxis()->SetTitle(ztitle);
1903 if (foldername.Length() > 0)
1914 Double_t xmin, Double_t xmax,
1915 const char *HistoName)
1918 TString foldername, condname;
1921 TGo4Log::Error(
"Condition name not specified, can be a hard error");
1935 wcond->SetValues(xmin, xmax);
1936 wcond->SetHistogram(HistoName);
1939 if (foldername.Length() > 0)
1950 Double_t xmin, Double_t xmax,
1951 Double_t ymin, Double_t ymax,
1952 const char *HistoName)
1955 TString foldername, condname;
1958 TGo4Log::Error(
"Condition name not specified, can be a hard error");
1972 wcond->SetValues(xmin, xmax, ymin, ymax);
1973 wcond->SetHistogram(HistoName);
1976 if (foldername.Length() > 0)
1988 Double_t (*points) [2],
1989 const char *HistoName,
1993 TString foldername, condname;
1996 TGo4Log::Error(
"Condition name not specified, can be a hard error");
2010 TArrayD fullx(npoints+1), fully(npoints+1);
2012 for (
int i = 0; i < npoints; i++) {
2013 fullx[i] = points[i][0];
2014 fully[i] = points[i][1];
2018 if ((fullx[0]!=fullx[npoints-1]) || (fully[0]!=fully[npoints-1])) {
2019 fullx[npoints] = fullx[0];
2020 fully[npoints] = fully[0];
2024 TCutG mycat(
"initialcut", npoints, fullx.GetArray(), fully.GetArray());
2035 if (foldername.Length() > 0)
2048 Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta,
2049 const char *HistoName)
2052 TString foldername, condname;
2055 TGo4Log::Error(
"Condition name not specified, can be a hard error");
2070 econd->SetEllipse(cx, cy, a1, a2, theta, npoints);
2072 econd->SetHistogram(HistoName);
2073 if (foldername.Length() > 0)
2084 Int_t npoints, Double_t cx, Double_t cy, Double_t r,
2085 const char *HistoName)
2093 const char *HistoName)
2102 Double_t (*points) [2],
2103 const char *HistoName)
2113 TString foldername, condname;
2116 TGo4Log::Error(
"Condition name not specified, can be a hard error");
2131 lcond->SetHistogram(HistoName);
2134 if (foldername.Length() > 0)
2163 TString foldername, graphname;
2165 TGo4Log::Error(
"TGraph name not specified, can be a hard error");
2169 auto graph =
dynamic_cast<TGraph *
>(
GetObject(fullname));
2173 graph =
new TGraph();
2175 graph =
new TGraph(points, xvalues, yvalues);
2176 graph->SetName(graphname.Data());
2177 graph->SetTitle(title);
2179 if (foldername.Length() > 0)
2191 TString foldername, graphname;
2193 TGo4Log::Error(
"TGraph name not specified, can be a hard error");
2197 TGraph *graph =
dynamic_cast<TGraph *
>(
GetObject(fullname));
2200 graph =
new TGraph(function);
2201 graph->SetName(graphname.Data());
2202 graph->SetTitle(title);
2203 if (foldername.Length() > 0)
2214 TString foldername, graphname;
2216 TGo4Log::Error(
"TGraph name not specified, can be a hard error");
2223 graph->SetName(graphname.Data());
2224 graph->SetTitle(title);
2225 if (foldername.Length() > 0)
2234 const char *classname,
2238 TString foldername, paramname;
2240 if (!fullname || (strlen(fullname) == 0)) {
2241 TGo4Log::Error(
"Parameter name not specified, can be a hard error");
2244 const char *separ = strrchr(fullname,
'/');
2246 paramname = separ + 1;
2247 foldername.Append(fullname, separ - fullname);
2249 paramname = fullname;
2254 if (!param->InheritsFrom(classname)) {
2255 TGo4Log::Info(
"There is parameter %s with type %s other than specified %s, rebuild", fullname,
2256 param->ClassName(), classname);
2263 paramname = TString(
"\"") + paramname + TString(
"\"");
2266 if (newcmd && (strstr(newcmd,
"new ") == newcmd))
2267 cmd = TString::Format(newcmd, paramname.Data());
2269 cmd = TString::Format(
"new %s(%s)", classname, paramname.Data());
2271 auto res = gROOT->ProcessLineFast(cmd.Data());
2274 TGo4Log::Error(
"Cannot create parameter of class %s", classname);
2280 if (foldername.Length() > 0)
2288 if (newcmd && (strstr(newcmd,
"set_") == newcmd)) {
2310 if (!macro_name || (strlen(macro_name) == 0))
return -1;
2313 TString file_name(macro_name);
2314 Ssiz_t pos = file_name.First(
'(');
2315 if (pos > 0) file_name.Resize(pos);
2316 bool has_plus =
false;
2317 pos = file_name.First(
'+');
2318 if (pos > 0) { file_name.Resize(pos); has_plus =
true; }
2319 while ((file_name.Length() > 0) && (file_name[file_name.Length()-1] ==
' '))
2320 file_name.Resize(file_name.Length()-1);
2321 while ((file_name.Length() > 0) && (file_name[0] ==
' '))
2322 file_name.Remove(0, 1);
2324 if (gSystem->AccessPathName(file_name.Data())) {
2331 TString exec =
".x ";
2332 exec.Append(macro_name);
2335 std::ifstream t(file_name.Data());
2336 std::string content = std::string(std::istreambuf_iterator<char>(t), {});
2337 if (content.empty()) {
2342 TString func_name = file_name;
2343 pos = func_name.Last(
'/');
2344 if (pos != kNPOS) func_name.Remove(0, pos+1);
2345 pos = func_name.Index(
".C");
2346 if (pos == kNPOS) pos = func_name.Index(
".cxx");
2347 if (pos != kNPOS) func_name.Resize(pos);
2349 bool fall_back =
false;
2350 if (has_plus) fall_back =
true;
2351 if (func_name.IsNull()) fall_back =
true;
2353 std::string search = func_name.Data(); search +=
"(";
2354 auto name_pos = content.find(search);
2355 if (name_pos == std::string::npos) fall_back =
true;
2358 auto res = gROOT->ProcessLineSync(exec.Data(), &error);
2359 return error ? -1 : res;
2362 static std::vector<std::string> script_names;
2363 static std::vector<std::string> script_contents;
2364 static std::vector<std::string> script_func;
2365 static int findx = 1;
2369 for (
unsigned n = 0; n < script_names.size(); n++)
2370 if (script_names[n] == file_name.Data()) {
2376 script_names.push_back(file_name.Data());
2377 script_contents.push_back(content);
2378 script_func.push_back(func_name.Data());
2379 indx = script_names.size() - 1;
2381 if (!gInterpreter->LoadText(content.c_str())) {
2382 TGo4Log::Error(
"Cannot parse code of %s script", file_name.Data());
2385 }
else if (script_contents[indx] != content) {
2387 std::string new_name = func_name.Data();
2388 new_name += std::to_string(findx++);
2389 script_contents[indx] = content;
2390 script_func[indx] = new_name;
2392 content.erase(name_pos, func_name.Length());
2393 content.insert(name_pos, new_name);
2395 if (!gInterpreter->LoadText(content.c_str())) {
2396 TGo4Log::Error(
"Cannot parse modified code of %s script", file_name.Data());
2400 func_name = new_name.c_str();
2404 func_name = script_func[indx].c_str();
2407 TGo4Log::Error(
"Execute function %s from script %s", func_name.Data(), file_name.Data());
2410 func_name.Append(
"()");
2411 auto res = gROOT->ProcessLineSync(func_name.Data(), &error);
2412 if (error) res = -1;
2419 if (!macro_name || (strlen(macro_name) == 0))
return -1;
2420 TString comstring=macro_name;
2431 comstring = command;
2432 comstring = comstring.Strip(TString::kBoth);
2434 comstring = comstring.Strip(TString::kLeading);
2436 const TString PY_EXT =
".py";
2437 int imin = comstring.Index(PY_EXT +
" ");
2438 int imax = comstring.Length();
2442 imin += PY_EXT.Length();
2444 int ilen = imax - imin;
2445 TString scrstring = comstring(0, imin);
2446 TString argstring = comstring(imin, ilen);
2448 comstring =
"TPython::Exec(\"import sys; sys.argv = [\'" + scrstring +
"\'] + \'" + argstring +
"\'.split()\");";
2449 comstring +=
"TPython::LoadMacro(\"" + scrstring +
"\");";
2454 comstring.Prepend(
"TPython::LoadMacro(\"" + go4sys + pyinit +
"\");");
2455 comstring.Prepend(
"TPython::Bind(go4, \"go4\");" );
2460 const char *cursor = command;
2461 const char *at =
nullptr;
2463 Ssiz_t len = strlen(cursor);
2464 at = strstr(cursor,
"@");
2466 len = (Ssiz_t)(at - cursor);
2467 comstring.Append(cursor, len);
2468 comstring.Append(
"TGo4Analysis::Instance()->");
2471 comstring.Append(cursor);
2485 return gROOT->ProcessLineSync(comstring, errcode);
2520 Message(2,
"Analysis %s was not initialized! Please SUBMIT settings first.",
GetName());
2533 BOOL WINAPI Go4ConsoleSigHandler(DWORD sig)
2542 case CTRL_BREAK_EVENT:
2543 case CTRL_LOGOFF_EVENT:
2544 case CTRL_SHUTDOWN_EVENT:
2545 case CTRL_CLOSE_EVENT:
2547 printf(
" non CTRL-C signal - ignore\n");
2552 void InstallGo4CtrlCHandler(
bool on)
2554 SetConsoleCtrlHandler(Go4ConsoleSigHandler, on);
#define __GO4BUILDVERSION__
list containing prototypes of all analysis command objects.
This object is responsible for the organization of analysis objects.
Contains the name (key) list of all objects in the analysis scope.
Status of the analysis instance.
void SetAutoSaveInterval(Int_t i)
void SetConfigFileName(const char *name)
void SetAutoSaveCompression(Int_t i=5)
const char * GetAutoFileName() const
void SetAutoSaveOverwrite(Bool_t over=kTRUE)
Int_t IsAutoSaveOverwrite() const
Int_t IsAutoSaveOn() const
void Print(Option_t *opt="") const override
basic method to printout status information on stdout; to be overridden by specific subclass
Int_t GetAutoSaveCompression() const
Int_t GetAutoSaveInterval() const
void SetAutoFileName(const char *name)
void SetAutoSaveOn(Bool_t on=kTRUE)
This object is responsible for the organisation of analysis steps.
TGo4EventProcessor * GetEventProcessor() const
Access to the event processor.
const char * GetEventSourceName() const
Access to name of currently active event source.
The mother of all go4 analysis.
TGo4ShapedCond * MakeFreeShapeCond(const char *fullname, Int_t npoints, Double_t(*points)[2], const char *HistoName=nullptr)
Create free shaped (polygon) condition.
TGo4EventElement * fxSampleEvent
this holds event sample for the SingleEventTree.
Bool_t RemoveDynamicEntry(const char *entryname, const char *listname=nullptr)
Remove entry of that name from dynamic list of listname.
Bool_t fbAutoSaveFileChange
True if autosave name shall be changed when input file of multiple file input has changed.
TObject * NextMatchingObject(const char *expr=nullptr, const char *folder=nullptr, Bool_t reset=kFALSE)
Delivers pointer to next object of the Go4 folder structure with a name matching the expression expr.
TGo4EventElement * GetInputEvent(const char *stepname) const
Returns the input event structure of analysis step.
TString fxDefaultTestFileName
default file name for distributed test lmd file
TGo4ListCond * MakeListCond(const char *fullname, const Int_t num, const Int_t *values, const char *HistoName=nullptr)
Create "whitlelist" condition with separate values to test against condition is true if any of the va...
void UpdateStatus(TGo4AnalysisStatus *state)
Create a copy of the analysis internal state.
static const char * fgcPYINIT
default name of go4 python init script
Bool_t fbAutoSaveOn
True if Autosaving is enabled (default).
TGo4AnalysisStep * GetAnalysisStepNum(Int_t number)
Access to certain analysis step by number.
virtual Int_t UserPreLoop()
User defined function called once before processing the main event loop.
static const char * fgcDEFAULTFILENAME
standard file name
Bool_t fbInitIsDone
True if analysis framework has been initialized and the event classes are created.
TGo4ShapedCond * MakeCircleCond(const char *fullname, Int_t npoints, Double_t cx, Double_t cy, Double_t r, const char *HistoName=nullptr)
Create circular shaped polygon condition.
TGo4Analysis(const char *name=nullptr)
Protected constructor for singleton instance.
TFolder * GetObjectFolder()
Access to top level go4 folder.
static TGo4Analysis * Instance()
return analysis instance
Int_t GetDynListInterval() const
Returns current dynamic list interval.
Bool_t fbPythonBound
If true, pyroot has already bound TGo4Analysis object.
TGo4AnalysisObjectManager * ObjectManager() const
Returns pointer on analysis object manager.
Long64_t ExecuteScript(const char *script_name)
Executes ROOT script.
virtual void CloseAnalysis()
Finish the analysis run and close all event sources/storages.
Bool_t RemoveObject(const char *name, Bool_t del=kTRUE)
Removes object from user object folder by name.
void Message(Int_t prio, const char *text,...)
Display a user message.
Int_t PostLoop()
Method executed once after the main analysis event loop.
TGo4EventElement * GetEventStructure(const char *name) const
Search reference to event structure in folder.
Bool_t SetAnalysisCondition(const char *name, TGo4Condition *con, Bool_t counter=kTRUE)
Set existing analysis condition of name to the values of external condition object con.
TGraph * MakeGraph(const char *fullname, const char *title, Int_t points=0, Double_t *xvalues=nullptr, Double_t *yvalues=nullptr)
Create a TGraph with initial values as specified by points, xvalues and yvalues.
TGo4Parameter * MakeParameter(const char *fullname, const char *classname, const char *cmd=nullptr)
Create parameter of specified class,.
friend class TGo4AnalysisWebStatus
TCanvas * GetCanvas(const char *name)
Retrieves a TCanvas by name from the Canvases folder.
TNamed * GetObject(const char *name, const char *folder=nullptr)
Searches for object by name in all directories.
void PrintHistograms(const char *expression=nullptr)
Printout of all histogram statistic counters on the terminal.
TH2 * MakeTH2(char type, const char *fullname, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy, Double_t ylow, Double_t yup, const char *xtitle=nullptr, const char *ytitle=nullptr, const char *ztitle=nullptr)
Create two dimensional histogram of specified type.
Bool_t SetParameter(const char *name, TGo4Parameter *par)
Set existing parameter of name to the values of external parameter object par.
static const Int_t fgiMACROSTARTPOLL
Time in ms to sleep in the polling loop of the WaitForStart.
TGo4WinCond * MakeWinCond(const char *fullname, Double_t xmin, Double_t xmax, const char *HistoName=nullptr)
Create 1D window condition.
static const char fgcPYPROMPT
leading character indicating python script execution
void SetNewInputFile(Bool_t on=kTRUE)
Set flag that input file has changed.
Bool_t IsSortedOrder() const
Returns true if sub-folders will be created in sorted order.
Bool_t RemoveHistogram(const char *name, Bool_t del=kTRUE)
Removes histogram from histogram dir by name.
void SetOutputEvent(TGo4EventElement *event)
Sets the current output event (detector) structure.
TGo4PolyCond * MakePolyCond(const char *fullname, Int_t npoints, Double_t(*points)[2], const char *HistoName=nullptr, Bool_t shapedcond=kFALSE)
Create polygon condition.
Bool_t AddAnalysisCondition(TGo4Condition *con, const char *subfolder=nullptr)
Puts a new analysis condition object in corresponding list.
virtual Bool_t InitEventClasses()
Initialization of the event class plugins which are delivered from the user defined event factory.
Bool_t SaveStatus(const char *filename=nullptr)
Save current analysis settings into file of given name.
TString fAnalysisName
name of analysis object
Bool_t AddDynamicEntry(TGo4DynamicEntry *entry)
Set dynamic entry of name "name" to the values specified by external dynamic entry status "state".
TGo4AnalysisWebStatus * CreateWebStatus()
Create a copy of the analysis internal state.
Int_t StoreFolder(const char *stepname, TFolder *folder)
Write folder into eventstore of the step specified by name.
void StartAnalysis()
(Re)Start analysis event loop, works in both batch and gui-controlled mode
TGo4AnalysisSniffer * fSniffer
Sniffer object.
Bool_t ClearObjects(const char *name)
Clear (reset) the specified objects.
Int_t fBatchLoopCount
exact number of loop counts in batch mode
TGo4AnalysisStepManager * fxStepManager
aggregationByValue 1
void SetAnalysisName(const char *name)
Set analysis name.
static const Int_t fgiAUTOSAVECOUNTS
Definition of default autosave interval.
Int_t IsErrorStopEnabled() const
True if current analysis step allows stop on error.
void StopAnalysis()
Stop analysis event loop, works in both batch and gui-controlled mode.
Int_t MainCycle()
The main analysis event cycle.
Bool_t NewStepStore(const char *name, TGo4EventStoreParameter *par)
Shuts down the old analysis step storage and creates a new one specified by parameter par.
void SetAutoSave(Bool_t on=kTRUE)
Enable/disable functionality of AutoSave method.
static Bool_t IsClientMode()
is client mode
TStopwatch * fxAutoSaveClock
Clock for autosave by time mechanism.
TString fxCurrentInputFileName
Contains current input file name.
Bool_t AddPicture(TGo4Picture *pic, const char *subfolder=nullptr)
Puts a new picture object in corresponding folder.
TGo4ObjectStatus * CreateObjectStatus(const char *name, const char *folder=nullptr)
Find Object of name in the folder structure and create a complete status object of it.
void DefineServerPasswords(const char *admin, const char *controller, const char *observer)
Define passwords, which should be used for analysis access when analysis runs in server mode.
TGo4AnalysisStep * GetAnalysisStep(const char *name)
Access to certain analysis step by name.
void OpenAutoSaveFile(bool for_writing=false)
Open the autosave file with the current settings.
void AutoSave()
Perform autosave of all active stores, save existing calibration objects, write known objects into us...
Int_t StoreFitter(const char *name, TGo4Fitter *fit)
Write fitter fit into eventstore of the step specified by name.
void ShowEvent(const char *stepname, Bool_t isoutput=kTRUE)
Printout event content of single current event to analysis terminal (using ROOT TTree::Show method).
TGo4EventElement * GetOutputEvent() const
Returns the output event (detector) structure of analysis step.
Bool_t AddObject(TNamed *anything, const char *subfolder=nullptr, Bool_t replace=kTRUE)
Add any external object to the user object folder.
friend class TGo4AnalysisStep
Bool_t AddParameter(TGo4Parameter *par, const char *subfolder=nullptr)
Puts a new parameter object in corresponding folder.
Bool_t RemoveCanvas(const char *name)
Removes TCanvas by name.
Int_t UnLockAutoSave()
UnLock the autosave mutex.
static const char * fgcDEFAULTFILESUF
filename suffix for object file
Int_t ProcessAnalysisSteps()
Process steps.
TH1 * GetHistogram(const char *name)
Search histogram in histogram list (directory).
void PrintParameters(const char *expression=nullptr)
Printout of all parameters on the terminal.
TFile * fxAutoFile
Optional file for autosave of the important objects.
Int_t Process()
This method is meant to be called from a go4 cintserver macro in an explicit event loop.
static void SetRunningMode(int mode)
Set analysis running mode.
void SetAutoSaveFile(const char *filename=nullptr, Bool_t overwrite=kFALSE, Int_t compression=5)
Set file for autosave action.
Bool_t RemovePicture(const char *name)
Removes picture by name.
static Bool_t IsBatchMode()
is batch mode
void SetControllerPassword(const char *passwd)
Specify password for controller account.
void PrintDynamicList()
Print entries of current dynamic list.
Bool_t SetLastStep(const char *name)
Sets analysis step name as last one to be processed in the chain of steps.
Bool_t fbObjMade
indicate if object was created by last Make... operation
void ProcessEvents()
Method should be called to process extra events in the analysis thread context.
Bool_t AddEventStructure(TGo4EventElement *ev)
Add reference to event structure object to Go4 Folder structure.
static Bool_t Exists()
check if analysis instance exists
TGo4AnalysisObjectManager * fxObjectManager
aggregationByValue 1
TString fServerAdminPass
pre-configured password for administrator access
Bool_t RemoveEventStore(TGo4EventStore *store)
Remove reference to event store from go4 folder structure.
void ShutdownServer()
for signal handler to shutdown analysis server, if existing
static const char * fgcDEFAULTSTATUSFILENAME
standard file name for analysis settings
Long64_t ExecuteLine(const char *command, Int_t *errcode=nullptr)
Process ROOT command line.
Int_t WaitForStart()
Poll on the IsRunning state with sleep delay, returns number of wait cycles.
virtual Int_t UserEventFunc()
User defined function which processes the actual analysis.
void StopWorking()
Called by interrupt routine for normal exit from program (in batch mode)
Int_t StoreParameter(const char *name, TGo4Parameter *par)
Write object obj into eventstore of the step specified by name.
Bool_t SetParameterStatus(const char *name, TGo4ParameterStatus *par)
Set existing parameter of name to the values of external parameter status object.
Bool_t AddEventSource(TGo4EventSource *source)
Add reference to event source object to Go4 Folder structure.
Bool_t AddAnalysisStep(TGo4AnalysisStep *next)
Method for user analysis constructor to setup the list of analysis steps.
void StartObjectServer(const char *basename, const char *passwd)
Start the object (histogram) server.
void CloseAutoSaveFile()
Close the autosave file if existing.
Bool_t RemoveEventStructure(TGo4EventElement *ev)
Remove reference to event structure from go4 folder structure.
void ProcessCrtlCSignal()
Method called from Ctrl-C handler.
TString fServerCtrlPass
pre-configured password for controller access
void SetObserverPassword(const char *passwd)
Specify password for observer account.
Long64_t ExecutePython(const char *script_name, Int_t *errcode=nullptr)
Executes Python script in ROOT interpreter.
static Bool_t fbExists
This is used to check from outside if an analysis is already there.
Bool_t SetPicture(const char *name, TGo4Picture *pic)
Set existing picture of name to the values of external picture object pic.
Bool_t SetStepStorage(const char *name, Bool_t on)
Enables analysis step of name to write its output event into its event store.
void StopObjectServer()
Stop the object (histogram) server.
Bool_t ProtectObjects(const char *name, const Option_t *flags)
Change protection properties of object name as specified.
Bool_t AddHistogram(TH1 *his, const char *subfolder=nullptr, Bool_t replace=kTRUE)
Add external histogram to go4 histogram directory.
Int_t LockAutoSave()
Lock the autosave mutex.
TGo4Ratemeter * fxRate
optional ratemeter object
const char * GetName() const override
Return analysis name.
Bool_t AddTreeHistogram(const char *hisname, const char *treename, const char *varexp, const char *cutexp)
Add Histogram into the dynamic list which is linked to a tree.
TGo4TreeStructure * CreateTreeStructure(const char *treename)
Create a tree structure for a certain tree by name.
TGo4RollingGraph * MakeRollingGraph(const char *fullname, const char *title, Int_t points=0, Int_t average=1)
Create a go4 rolling graph (generic trending plot) with properties points and average.
virtual Int_t UserPostLoop()
User defined function called once after processing the main event loop.
void PrintConditions(const char *expression=nullptr)
Print all condition counters to the terminal.
Bool_t NewStepSource(const char *name, TGo4EventSourceParameter *par)
Shuts down the old analysis step event source and creates a new one specified by parameter par.
TGo4AnalysisObjectNames * fxObjectNames
aggregation 1
void Constructor()
Method to create all necessary object in the real constructor.
Bool_t IsAutoSaveFileName() const
Return kTRUE, if autosave file name set.
void SetStepChecking(Bool_t on=kTRUE)
Enable or disable check of subsequent analysis step for io consistency.
Bool_t DeleteObjects(const char *name)
Delete object of name, or all objects in folder name, respectively.
TGo4Picture * GetPicture(const char *name)
Retrieves a picture object by name from the object folder.
Int_t PreLoop()
Method executed once before the main analysis event loop.
Int_t StoreCondition(const char *name, TGo4Condition *con)
Write condition con into eventstore of the step specified by name.
Bool_t fbNewInputFile
True if input file of multiple file input has changed.
TString fServerObserverPass
pre-configured password for observer access
Bool_t SetFirstStep(const char *name)
Sets analysis step name as first one to be processed in the chain of steps.
void SetStatus(TGo4AnalysisStatus *state)
Set all analysis parameters to that of given status object.
Bool_t AddTree(TTree *tree, const char *subfolder=nullptr)
Add reference to a tree in the go4 folder structure.
TTree * CreateSingleEventTree(const char *name, Bool_t isoutput=kTRUE)
Create a tree that is filled with one single event sample.
static Bool_t IsServerMode()
is server mode
static Int_t fiRunningMode
This is used to identify running mode of analysis: 0 - batch, 1 - client, 2 - server.
Bool_t AddCanvas(TCanvas *can, const char *subfolder=nullptr)
Puts a new TCanvas in corresponding folder.
static TGo4Analysis * fxInstance
Static Pointer to the analysis singleton instance.
Int_t fiAutoSaveInterval
Implicit Loop cycles in between two autosave actions.
Bool_t RemoveAnalysisCondition(const char *name)
Removes analysis condition from list by name.
TString fxAutoFileName
Name of the autosave file.
void SetDynListInterval(Int_t val)
Set current dynamic list interval.
TGo4ShapedCond * MakeBoxCond(const char *fullname, Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta, const char *HistoName=nullptr)
Create tilted rectangular box shaped polygon condition.
Bool_t AddEventStore(TGo4EventStore *store)
Add reference to event store object to Go4 Folder structure.
TGo4Condition * GetAnalysisCondition(const char *name, const char *cond_cl=nullptr)
Retrieves an analysis condition from list by name.
static const Int_t fgiDYNLISTINTERVAL
This value is the number of events in between subsequent dynamic list processing.
Bool_t fbMakeWithAutosave
If false, do not use data from autosave file in Make... methods.
Bool_t fbAutoSaveOverwrite
True if autosave file is in overwrite mode.
TH1 * MakeTH1(char type, const char *fullname, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, const char *xtitle=nullptr, const char *ytitle=nullptr)
Create one dimensional histogram of specified type.
Bool_t AddEventProcessor(TGo4EventProcessor *pro)
Add reference to event processor object to Go4 Folder structure.
TGo4Parameter * GetParameter(const char *name, const char *parameter_class=nullptr)
Retrieves a parameter object by name from the object folder.
TMutex * fxAutoSaveMutex
Mutex protecting the autosave file access.
enum TGo4Analysis::@272117116030306307120057025105261037267163363177 fxDoWorkingFlag
Indicates analysis runstate.
void SetSortedOrder(Bool_t on=kTRUE)
Configure sorting order for newly created sub-folders.
Int_t fNumCtrlC
number Ctrl-C handler called
TGo4AnalysisObjectNames * CreateNamesList()
Creates a list of names (keys) of all objects in analysis directories.
Bool_t NewStepProcessor(const char *name, TGo4EventProcessorParameter *par)
Shuts down the old analysis step processor and creates a new one specified by parameter par.
Bool_t LoadStatus(const char *filename=nullptr)
Load Analysis Status from file and set analysis to these settings.
TString fxConfigFilename
name of configuration file used for this setup
void SetRunning(Bool_t on=kTRUE)
Switch slave process into running state.
Bool_t AddDynamicHistogram(const char *name, const char *histo, const char *hevx, const char *hmemx, const char *hevy=nullptr, const char *hmemy=nullptr, const char *hevz=nullptr, const char *hmemz=nullptr, const char *condition=nullptr, const char *cevx=nullptr, const char *cmemx=nullptr, const char *cevy=nullptr, const char *cmemy=nullptr)
Add (create) new dynamic histogram entry which connects an existing histogram with existing condition...
Bool_t IsRunning() const
True if the analysis as controlled by slave process is running.
Bool_t RemoveEventProcessor(TGo4EventProcessor *pro)
Remove reference to event processor from go4 folder structure.
Bool_t RemoveTree(TTree *tree, const char *stepname=nullptr)
Remove reference to a tree in the go4 folder structure.
virtual ~TGo4Analysis()
destructor
Bool_t EvaluateFolderpath(const char *fullname, TString &object, TString &folder)
Helper function to figure out object name and folder path from full path.
void UpdateNamesList()
Update the internal list of object names.
TGo4AnalysisStatus * CreateStatus()
Create a copy of the analysis internal state.
TGo4ShapedCond * MakeEllipseCond(const char *fullname, Int_t npoints, Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta=0., const char *HistoName=nullptr)
Create ellipse shaped polygon condition.
void Print(Option_t *opt="") const override
Printout the analysis (step-) setup.
TGo4InterruptHandler * fxInterruptHandler
use to treat Ctrl-C interrupts
Bool_t ResetBackStores(Bool_t clearflag=kFALSE)
Clear previous events of backstore tree.
Bool_t RemoveParameter(const char *name)
Removes parameter by name.
Bool_t LoadObjects(const char *filename=nullptr)
Load analysis objects from file.
Int_t fiAutoSaveCount
Event counter for autosave mechanism.
void SetAdministratorPassword(const char *passwd)
Specify password for administrator account.
Int_t fiAutoSaveCompression
compression level for autosave file
void SendObjectToGUI(TObject *ob)
User May send any named object via data channel to the gui.
TTree * GetTree(const char *name)
Search tree in tree folder.
TGo4AnalysisClient * fxAnalysisSlave
Optional backpointer to analysis client if running in gui mode.
Bool_t RemoveEventSource(TGo4EventSource *source)
Remove reference to event source from go4 folder structure.
void SendMessageToGUI(Int_t level, Bool_t printout, const char *text)
Send message string in a status object to the gui.
Int_t RunImplicitLoop(Int_t times, Bool_t showrate=kFALSE, Double_t process_event_interval=-1., Bool_t iswebserver=kFALSE)
Processes the UserEventFunc in an implicit loop for "times" times.
void SetAutoSaveInterval(Int_t interval=0)
Set time interval (in s) for autosave action.
static TGo4CommandInvoker * Instance()
static void SetCommandList(TGo4CommandProtoList *list)
Application may exchange standard command list by own subclass with specialized commands,...
static void UnRegister(TGo4CommandReceiver *p)
static void Register(const char *name, TGo4CommandReceiver *p)
virtual void Enable()
Enable (unfreeze) Test execution.
void SetHistogram(const char *name)
Define the name of the associated histogram.
virtual void ResetCounts()
Clear counters.
ABC for all entries that can be kept in a dynamic list.
The abstract base class for the data elements of which the unpacked events (or detector structure dat...
Exception to throw on event source timeout.
Exception to be thrown on error of event source.
Int_t GetPriority() const
Basic type for all classes containing information to parametrize the event processor.
Abstract event processor.
virtual void UserPreLoop()
Method called when analysis is created.
virtual void UserPostLoop()
Method called when analysis is stopping.
Int_t Handle() override
This is a default handler function for the respective exception type.
const char * GetSourceClass() const
Name of the throwing event source.
const char * GetSourceName() const
Name of the throwing event source.
const char * GetErrMess() const
Status/ error message of the last event.
Basic type for all classes containing information to parameterize the event source.
Basic type for all classes containing information to parametrize the event store.
The abstract interface class for the raw event store.
Exception to throw on event source timeout.
virtual const char * What()
Returns string describing the kind of exception.
virtual Int_t Handle()
This is a default handler function for the respective exception type.
Central class of Go4Fit package.
Condition that checks a value against a list of "good" (or bad) values.
virtual void SetValues(const Int_t num, const Int_t *values)
static TString subGO4SYS(const char *subdir)
Return subdirectory in the GO4SYS.
static void Info(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 1.
static void PrintRate(ULong64_t cnt, double rate)
Printout rate and events count, handle redirection.
static const char * Message(Int_t prio, const char *text,...) GO4_PRINTF2_ARGS
Display a message.
static const char * GO4SYS()
Return GO4SYS environment variable or Go4 top directory during compile (if GO4SYS) not set.
static void Debug(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 0.
static void OutputEnable(Bool_t on=kTRUE)
switch output on or off
static void Error(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 3.
static Bool_t IsOutputEnabled()
get current output state
static Int_t GetIgnoreLevel()
Get threshold for output.
static void CloseLogfile()
Close logfile if existing.
One entry of the object names folder.
Status object for an analysis parameter.
Base class for all parameter aggregations, e.g.
Picture cconfiguration in Go4.
void SetValues(Double_t *x, Double_t *y, Int_t len) override
Delete old cut and create a new cut with X,Y values.
Class containing event counter and ratemeter services.
Graphs that renew themselves iteratively to monitor a value.
void SetBox(Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta=0)
void SetCircle(Double_t cx, Double_t cy, Double_t r, Int_t npoints=0)
Contains the branchelement structure of a certain TTree on the analysis side.
Exception to be thrown by analysis user.
Int_t Handle() override
This is a default handler function for the respective exception type.
Int_t GetPriority() const
Message priority.
static Bool_t CheckVersion(Int_t version)
Returns true if Version number matches the argument of the Method.
static TGo4Version * Instance()