23 #include "TInterpreter.h"
24 #include "TApplication.h"
36 #include "TStopwatch.h"
37 #include "TTimeStamp.h"
40 #include "TGo4LockGuard.h"
72 #if ROOT_VERSION_CODE > ROOT_VERSION(5,2,0)
73 #if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0)
81 TSignalHandler(kSigInterrupt, kFALSE)
98 void InstallGo4CtrlCHandler(
bool on);
122 GO4TRACE((14,
"TGo4Analysis::Instance()",__LINE__, __FILE__));
157 fbInitIsDone(kFALSE),
164 fiAutoSaveCompression(5),
166 fbAutoSaveOverwrite(kFALSE),
167 fbNewInputFile(kFALSE),
168 fxCurrentInputFileName(),
169 fbAutoSaveFileChange(kFALSE),
172 fxDoWorkingFlag(flagInit),
173 fxInterruptHandler(0),
178 fServerObserverPass(),
179 fbMakeWithAutosave(kTRUE),
181 fbPythonBound(kFALSE),
186 GO4TRACE((15,
"TGo4Analysis::TGo4Analysis(const char*)",__LINE__, __FILE__));
196 fbInitIsDone(kFALSE),
203 fiAutoSaveCompression(5),
205 fbAutoSaveOverwrite(kFALSE),
206 fbNewInputFile(kFALSE),
207 fxCurrentInputFileName(),
208 fbAutoSaveFileChange(kFALSE),
211 fxDoWorkingFlag(flagInit),
212 fxInterruptHandler(0),
217 fServerObserverPass(),
218 fbMakeWithAutosave(kTRUE),
220 fbPythonBound(kFALSE),
225 GO4TRACE((15,
"TGo4Analysis::TGo4Analysis(const char*)",__LINE__, __FILE__));
236 Message(-1,
"!!!! Analysis Base class:\n\t User Analysis was built with wrong \t\tGo4 Buildversion %d !!!!!",
239 Message(-1,
"\t >>make clean all<<");
240 Message(-1,
"Aborting in 20 s...");
241 gSystem->Sleep(20000);
245 Message(-1,
"Welcome to Go4 Analysis Framework Release %s (build %d) !",
250 gROOT->SetBatch(kTRUE);
272 InstallGo4CtrlCHandler(
true);
277 Message(2,
"Analysis BaseClass ctor -- analysis singleton already exists !!!");
280 #if ROOT_VERSION_CODE > ROOT_VERSION(6,12,0)
281 TInterpreter* theI = gROOT->GetInterpreter();
282 theI->SetProcessLineLock(kTRUE);
284 gROOT->ProcessLineSync(
"TGo4Analysis *go4 = TGo4Analysis::Instance();");
285 gROOT->ProcessLineSync(Form(
".x %s",
TGo4Log::subGO4SYS(
"macros/anamacroinit.C").Data()));
293 InstallGo4CtrlCHandler(
false);
301 GO4TRACE((15,
"TGo4Analysis::~TGo4Analysis()",__LINE__, __FILE__));
311 gROOT->ProcessLineSync(Form(
".x %s",
TGo4Log::subGO4SYS(
"macros/anamacroclose.C").Data()));
328 if (gApplication) gApplication->Terminate();
343 GO4TRACE((14,
"TGo4Analysis::InitEventClasses()",__LINE__, __FILE__));
352 TGo4Log::Info(
"Analysis -- Initializing EventClasses done.");
364 TGo4Log::Info(
"Analysis BaseClass -- EventClasses were already initialized.");
373 GO4TRACE((11,
"TGo4Analysis::MainCycle()",__LINE__, __FILE__));
415 GO4TRACE((11,
"TGo4Analysis::UserEventFunc()",__LINE__, __FILE__));
426 GO4TRACE((11,
"TGo4Analysis::Process()",__LINE__, __FILE__));
428 #if ROOT_VERSION_CODE > ROOT_VERSION(5,2,0)
429 #if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0)
430 Bool_t unlockedcint=kFALSE;
432 gCINTMutex->UnLock();
445 gSystem->ProcessEvents();
458 TDirectory* savdir = gDirectory;
477 Message(2,
"Analysis %s TIMEOUT for eventsource %s:%s.",
484 Message(2,
"End of event source %s: name:%s - msg:%s",
505 Message(3,
"Analysis %s ERROR: %s from event source %s:\n %s",
543 Message(3,
"Analysis %s ERROR: %s from dynamic list entry %s:%s",
559 Message(3,
"Analysis %s ERROR: %s in Analysis Step %s",
585 catch(std::exception& ex)
587 Message(3,
"Analysis %s got standard exception %s",
599 #if ROOT_VERSION_CODE > ROOT_VERSION(5,2,0)
600 #if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0)
601 if(gCINTMutex && unlockedcint) {
615 GO4TRACE((11,
"TGo4Analysis::RunImplicitLoop(Int_t)",__LINE__, __FILE__));
618 if (process_event_interval>1.) process_event_interval = 1.;
623 TString ratefmt = TString::Format(
"\rCnt = %s Rate = %s Ev/s",
TGo4Log::GetPrintfArg(kULong64_t),
"%5.*f");
625 Bool_t userate = showrate || (process_event_interval>0.);
626 Bool_t process_events = kFALSE;
631 TTimeStamp last_update;
636 Message(1,
"Analysis loop for %d cycles is starting...", times);
638 Message(1,
"Analysis loop is starting...");
642 if ((times>0) && (cnt>=times))
break;
646 process_events = kTRUE;
648 bool need_update =
false;
650 if ((now.AsDouble() - last_update.AsDouble()) >= 1.) {
651 last_update = now; need_update =
true;
680 if (process_events) {
682 process_events = kFALSE;
683 gSystem->ProcessEvents();
794 Message(1,
"!!! Unexpected exception in %d cycle !!!", cnt);
804 Message(1,
"Analysis implicit Loop has finished after %d cycles.", cnt);
812 Message(1,
"%s appeared in %d cycle.", ex.
What(), cnt);
815 catch(std::exception& ex) {
816 Message(1,
"standard exception %s appeared in %d cycle.", ex.what(), cnt);
819 Message(1,
"!!! Unexpected exception in %d cycle !!!", cnt);
823 printf(
"\n"); fflush(stdout);
837 GO4TRACE((11,
"TGo4Analysis::RemoveDynamicEntry(const char *, const char* )",__LINE__, __FILE__));
849 GO4TRACE((11,
"TGo4Analysis::UpdateStatus(TGo4AnalysisStatus*)",__LINE__, __FILE__));
863 GO4TRACE((11,
"TGo4Analysis::SetStatus(TGo4AnalysisStatus*)",__LINE__, __FILE__));
879 GO4TRACE((11,
"TGo4Analysis::LoadStatus(const char*)",__LINE__, __FILE__));
887 TFile* statusfile = TFile::Open(fname.Data(),
"READ");
888 if(statusfile && statusfile->IsOpen()) {
892 TIter iter(statusfile->GetListOfKeys());
894 while ((key = (TKey*)iter()) != 0) {
895 if (strcmp(key->GetClassName(),
"TGo4AnalysisStatus")==0)
break;
898 if (key!=0) state =
dynamic_cast<TGo4AnalysisStatus*
>( statusfile->Get( key->GetName() ) );
903 Message(1,
"Analysis %s: Found status object %s in file %s",
904 GetName(), state->GetName(), fname.Data());
907 Message(0,
"Analysis: New analysis state is set.");
910 Message(3,
"Analysis LoadStatus: Could not find status %s in file %s",
GetName(), fname.Data());
914 Message(3,
"Analysis LoadStatus: Failed to open file %s", fname.Data());
925 GO4TRACE((11,
"TGo4Analysis::SaveStatus(const char*)",__LINE__, __FILE__));
928 memset(buffer, 0,
sizeof(buffer));
930 strncpy(buffer, filename,
sizeof(buffer)-10);
935 TFile* statusfile = TFile::Open(buffer,
"RECREATE");
936 if(statusfile && statusfile->IsOpen()) {
945 Message(-1,
"Analysis SaveStatus: Saved Analysis settings to file %s", buffer);
947 Message(3,
"Analysis SaveStatus: FAILED to create status object !!!");
951 Message(3,
"Analysis SaveStatus: Failed to open file %s ",
960 GO4TRACE((11,
"TGo4Analysis::CreateStatus()",__LINE__, __FILE__));
961 TDirectory* filsav=gDirectory;
971 GO4TRACE((11,
"TGo4Analysis::CreateWebStatus()",__LINE__, __FILE__));
972 TDirectory* filsav=gDirectory;
993 GO4TRACE((11,
"TGo4Analysis::CreateSingleEventTree(TGo4EventElement*)",__LINE__, __FILE__));
1000 GO4TRACE((11,
"TGo4Analysis::CreateSingleEventTree(const char*, Bool_t)",__LINE__, __FILE__));
1012 GO4TRACE((14,
"TGo4Analysis::CloseAnalysis()",__LINE__, __FILE__));
1025 GO4TRACE((11,
"TGo4Analysis:PreLoop()",__LINE__, __FILE__));
1042 GO4TRACE((11,
"TGo4Analysis::PostLoop()",__LINE__, __FILE__));
1067 GO4TRACE((11,
"TGo4Analysis::UserPreLoop()",__LINE__, __FILE__));
1069 Message(0,
"Analysis BaseClass -- executing default User Preloop");
1075 GO4TRACE((11,
"TGo4Analysis::UserPostLoop()",__LINE__, __FILE__));
1077 Message(0,
"Analysis BaseClass -- executing default User Postloop");
1086 if(filename) buffer = filename;
1103 GO4TRACE((12,
"TGo4Analysis::LockAutoSave()",__LINE__, __FILE__));
1112 GO4TRACE((12,
"TGo4Analysis::UnLockAutoSave()",__LINE__, __FILE__));
1122 GO4TRACE((12,
"TGo4Analysis::AutoSave()",__LINE__, __FILE__));
1126 Message(0,
"Analysis -- AutoSaving....");
1132 Message(0,
"Analysis -- AutoSave done.");
1179 GO4TRACE((11,
"TGo4Analysis::UpdateNamesList()",__LINE__, __FILE__));
1185 Message(0,
"Analysis BaseClass -- Nameslist updated.");
1222 va_start(args, text);
1250 Message(2,
"Could not send object %s to GUI in batch mode.", ob->GetName());
1285 #if ROOT_VERSION_CODE > ROOT_VERSION(5,2,0)
1286 #if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0)
1287 Bool_t unlockedcint=kFALSE;
1290 gCINTMutex->UnLock();
1302 Bool_t sysret = gSystem->ProcessEvents();
1311 #if ROOT_VERSION_CODE > ROOT_VERSION(5,2,0)
1312 #if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0)
1313 if(gCINTMutex && unlockedcint)
1324 Message(1,
"Start object server not yet enabled.");
1327 Message(2,
"Could not start object server in batch mode.");
1335 Message(1,
"Stop object server not yet enabled.");
1337 Message(2,
"Could not stop object server in batch mode.");
1347 TGo4Log::Message(1,
"Analysis server is initiating shutdown after ctrl-c, please wait!!\n");
1360 Message(1,
"Showing Output Event %s of step %s",sevtree->GetName(),stepname);
1362 Message(1,
"Showing Input Event %s of step %s",sevtree->GetName(),stepname);
1364 std::cout << std::endl;
1374 const char* hevx,
const char* hmemx,
1375 const char* hevy,
const char* hmemy,
1376 const char* hevz,
const char* hmemz,
1377 const char* condition,
1378 const char* cevx,
const char* cmemx,
1379 const char* cevy,
const char* cmemy)
1382 histo, hevx, hmemx, hevy, hmemy, hevz, hmemz,
1383 condition, cevx, cmemx, cevy, cmemy);
1789 if ((fullname==0) || (strlen(fullname)==0))
return kFALSE;
1790 const char* separ = strrchr(fullname,
'/');
1792 objectname = separ + 1;
1793 foldername.Append(fullname, separ - fullname);
1795 objectname = fullname;
1803 Int_t nbinsx, Double_t xlow, Double_t xup,
1804 const char* xtitle,
const char* ytitle)
1807 TString foldername, histoname;
1809 TGo4Log::Error(
"Histogram name not specified, can be a hard error");
1820 const char* sclass =
"TH1I";
1822 case 'I':
case 'i': itype = 0; sclass =
"TH1I";
break;
1823 case 'F':
case 'f': itype = 1; sclass =
"TH1F";
break;
1824 case 'D':
case 'd': itype = 2; sclass =
"TH1D";
break;
1825 case 'S':
case 's': itype = 3; sclass =
"TH1S";
break;
1826 case 'C':
case 'c': itype = 4; sclass =
"TH1C";
break;
1827 default:
TGo4Log::Error(
"There is no histogram type: %c, use I instead", type);
break;
1834 if (title) oldh->SetTitle(title);
1835 if (xtitle) oldh->GetXaxis()->SetTitle(xtitle);
1836 if (ytitle) oldh->GetYaxis()->SetTitle(ytitle);
1841 TGo4Log::Info(
"There is histogram %s with type %s other than specified %s, create new and reuse content",
1842 fullname, oldh->ClassName(), sclass);
1848 oldh->SetName(
"___");
1854 case 0: newh =
new TH1I(histoname, title, nbinsx, xlow, xup);
break;
1855 case 1: newh =
new TH1F(histoname, title, nbinsx, xlow, xup);
break;
1856 case 2: newh =
new TH1D(histoname, title, nbinsx, xlow, xup);
break;
1857 case 3: newh =
new TH1S(histoname, title, nbinsx, xlow, xup);
break;
1858 case 4: newh =
new TH1C(histoname, title, nbinsx, xlow, xup);
break;
1861 newh->SetTitle(title);
1863 if (xtitle) newh->GetXaxis()->SetTitle(xtitle);
1864 if (ytitle) newh->GetYaxis()->SetTitle(ytitle);
1868 delete oldh; oldh = 0;
1871 if (foldername.Length() > 0)
1882 Int_t nbinsx, Double_t xlow, Double_t xup,
1883 Int_t nbinsy, Double_t ylow, Double_t yup,
1884 const char* xtitle,
const char* ytitle,
const char* ztitle)
1887 TString foldername, histoname;
1890 TGo4Log::Error(
"Histogram name not specified, can be a hard error");
1903 const char* sclass =
"TH2I";
1905 case 'I':
case 'i': itype = 0; sclass =
"TH2I";
break;
1906 case 'F':
case 'f': itype = 1; sclass =
"TH2F";
break;
1907 case 'D':
case 'd': itype = 2; sclass =
"TH2D";
break;
1908 case 'S':
case 's': itype = 3; sclass =
"TH2S";
break;
1909 case 'C':
case 'c': itype = 4; sclass =
"TH2C";
break;
1910 default:
TGo4Log::Error(
"There is no histogram type: %c, use I instead", type);
break;
1917 if (title) oldh->SetTitle(title);
1918 if (xtitle) oldh->GetXaxis()->SetTitle(xtitle);
1919 if (ytitle) oldh->GetYaxis()->SetTitle(ytitle);
1924 TGo4Log::Info(
"There is histogram %s with type %s other than specified %s, create new and reuse content",
1925 fullname, oldh->ClassName(), sclass);
1931 oldh->SetName(
"___");
1937 case 0: newh =
new TH2I(histoname, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
break;
1938 case 1: newh =
new TH2F(histoname, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
break;
1939 case 2: newh =
new TH2D(histoname, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
break;
1940 case 3: newh =
new TH2S(histoname, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
break;
1941 case 4: newh =
new TH2C(histoname, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
break;
1944 newh->SetTitle(title);
1946 if (xtitle) newh->GetXaxis()->SetTitle(xtitle);
1947 if (ytitle) newh->GetYaxis()->SetTitle(ytitle);
1948 if (ztitle) newh->GetZaxis()->SetTitle(ztitle);
1956 if (foldername.Length() > 0)
1967 Double_t xmin, Double_t xmax,
1968 const char* HistoName)
1971 TString foldername, condname;
1974 TGo4Log::Error(
"Condition name not specified, can be a hard error");
1992 if (foldername.Length() > 0)
2003 Double_t xmin, Double_t xmax,
2004 Double_t ymin, Double_t ymax,
2005 const char* HistoName)
2008 TString foldername, condname;
2011 TGo4Log::Error(
"Condition name not specified, can be a hard error");
2025 wcond->
SetValues(xmin, xmax, ymin, ymax);
2029 if (foldername.Length() > 0)
2041 Double_t (*points) [2],
2042 const char* HistoName,
2046 TString foldername, condname;
2049 TGo4Log::Error(
"Condition name not specified, can be a hard error");
2063 TArrayD fullx(npoints+1), fully(npoints+1);
2065 for (
int i=0;i<npoints;i++) {
2066 fullx[i] = points[i][0];
2067 fully[i] = points[i][1];
2071 if ((fullx[0]!=fullx[npoints-1]) || (fully[0]!=fully[npoints-1])) {
2072 fullx[npoints] = fullx[0];
2073 fully[npoints] = fully[0];
2077 TCutG mycat(
"initialcut", npoints, fullx.GetArray(), fully.GetArray());
2083 pcond->SetValues(&mycat);
2086 pcond->SetHistogram(HistoName);
2088 if (foldername.Length() > 0)
2101 Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta,
2102 const char* HistoName)
2105 TString foldername, condname;
2108 TGo4Log::Error(
"Condition name not specified, can be a hard error");
2123 econd->
SetEllipse(cx,cy,a1,a2,theta,npoints);
2126 if (foldername.Length() > 0)
2138 Int_t npoints, Double_t cx, Double_t cy, Double_t r,
2139 const char* HistoName)
2147 const char* HistoName)
2158 Double_t (*points) [2],
2159 const char* HistoName)
2169 TString foldername, condname;
2172 TGo4Log::Error(
"Condition name not specified, can be a hard error");
2190 if (foldername.Length() > 0)
2221 TString foldername, graphname;
2223 TGo4Log::Error(
"TGraph name not specified, can be a hard error");
2227 TGraph* graph =
dynamic_cast<TGraph*
> (
GetObject( fullname ) );
2228 if(graph)
return graph;
2230 graph =
new TGraph ();
2232 graph =
new TGraph (points, xvalues, yvalues);
2233 graph->SetName(graphname.Data());
2234 graph->SetTitle(title);
2236 if (foldername.Length() > 0)
2248 TString foldername, graphname;
2251 TGo4Log::Error(
"TGraph name not specified, can be a hard error");
2255 TGraph* graph =
dynamic_cast<TGraph*
>(
GetObject(fullname));
2258 graph =
new TGraph(
function);
2259 graph->SetName(graphname.Data());
2260 graph->SetTitle(title);
2261 if (foldername.Length() > 0)
2272 TString foldername, graphname;
2275 TGo4Log::Error(
"TGraph name not specified, can be a hard error");
2282 graph->SetName(graphname.Data());
2283 graph->SetTitle(title);
2284 if (foldername.Length() > 0)
2296 const char* classname,
2300 TString foldername, paramname;
2302 if ((fullname==0) || (strlen(fullname)==0)) {
2303 TGo4Log::Error(
"Parameter name not specified, can be a hard error");
2306 const char* separ = strrchr(fullname,
'/');
2308 paramname = separ + 1;
2309 foldername.Append(fullname, separ - fullname);
2311 paramname = fullname;
2316 if (!param->InheritsFrom(classname)) {
2317 TGo4Log::Info(
"There is parameter %s with type %s other than specified %s, rebuild",
2318 fullname, param->ClassName(), classname);
2325 paramname = TString(
"\"") + paramname + TString(
"\"");
2328 if ((newcmd!=0) && (strstr(newcmd,
"new ")==newcmd))
2329 cmd = TString::Format(newcmd, paramname.Data());
2331 cmd = TString::Format(
"new %s(%s)", classname, paramname.Data());
2333 Long_t res = gROOT->ProcessLineFast(cmd.Data());
2336 TGo4Log::Error(
"Cannot create parameter of class %s", classname);
2342 if (foldername.Length() > 0)
2350 if ((newcmd!=0) && (strstr(newcmd,
"set_")==newcmd)) {
2372 if ((macro_name==0) || (strlen(macro_name)==0))
return -1;
2375 TString file_name(macro_name);
2376 Ssiz_t pos = file_name.First(
'(');
2377 if (pos>0) file_name.Resize(pos);
2378 pos = file_name.First(
'+');
2379 if (pos>0) file_name.Resize(pos);
2380 while ((file_name.Length()>0) && (file_name[file_name.Length()-1] ==
' '))
2381 file_name.Resize(file_name.Length()-1);
2382 while ((file_name.Length()>0) && (file_name[0]==
' '))
2383 file_name.Remove(0, 1);
2385 if (gSystem->AccessPathName(file_name.Data())) {
2392 Long_t res = gROOT->ProcessLineSync(Form(
".x %s", macro_name), &error);
2393 if (error) res = -1;
2399 if ((macro_name==0) || (strlen(macro_name)==0))
return -1;
2400 TString comstring=macro_name;
2411 comstring = command;
2412 comstring = comstring.Strip(TString::kBoth);
2414 comstring = comstring.Strip(TString::kLeading);
2416 const TString PY_EXT =
".py";
2417 int imin = comstring.Index(PY_EXT +
" ");
2418 int imax = comstring.Length();
2422 imin += PY_EXT.Length();
2424 int ilen = imax - imin;
2425 TString scrstring = comstring(0, imin);
2426 TString argstring = comstring(imin, ilen);
2428 comstring =
"TPython::Exec(\"import sys; sys.argv = [\'" + scrstring +
"\'] + \'" + argstring +
"\'.split()\");";
2429 comstring +=
"TPython::LoadMacro(\"" + scrstring +
"\");";
2434 comstring.Prepend(
"TPython::LoadMacro(\"" + go4sys + pyinit +
"\");");
2435 comstring.Prepend(
"TPython::Bind(go4, \"go4\");" );
2440 const char* cursor = command;
2443 Ssiz_t len=strlen(cursor);
2444 at = strstr(cursor,
"@");
2447 len=(Ssiz_t) (at-cursor);
2448 comstring.Append(cursor,len);
2449 comstring.Append(
"TGo4Analysis::Instance()->");
2453 comstring.Append(cursor);
2470 Long_t rev=gROOT->ProcessLineSync(comstring, errcode);
2507 Message(2, TString::Format(
"Analysis %s was not initialized! Please SUBMIT settings first.",
GetName()));
2516 #include "windows.h"
2521 static BOOL Go4ConsoleSigHandler(DWORD sig)
2530 case CTRL_BREAK_EVENT:
2531 case CTRL_LOGOFF_EVENT:
2532 case CTRL_SHUTDOWN_EVENT:
2533 case CTRL_CLOSE_EVENT:
2535 printf(
" non CTRL-C signal - ignore\n");
2540 void InstallGo4CtrlCHandler(
bool on)
2542 ::SetConsoleCtrlHandler((PHANDLER_ROUTINE)Go4ConsoleSigHandler, on);
Bool_t AddTreeHistogram(const char *hisname, const char *treename, const char *varexp, const char *cutexp)
Bool_t SetParameter(const char *name, TGo4Parameter *par, TFolder *parent=0)
Int_t Store(const char *name, TGo4Parameter *obj)
void SetAutoFileName(const char *name)
void SetOutputEvent(TGo4EventElement *event)
void SetRunning(Bool_t on=kTRUE)
const char * GetErrMess() const
TH1 * MakeTH1(char type, const char *fullname, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, const char *xtitle=0, const char *ytitle=0)
Graphs that renew themselves iteratively to monitor a value.
Bool_t SetAnalysisCondition(const char *name, TGo4Condition *con, Bool_t counter=kTRUE, TFolder *parent=0)
void PrintParameters(const char *expression=0)
static const Int_t fgiMACROSTARTPOLL
TGo4ListCond * MakeListCond(const char *fullname, const Int_t num, const Int_t *values, const char *HistoName=0)
TGo4Analysis(const char *name=0)
static Bool_t IsServerMode()
static const char * fgcPYINIT
Bool_t NewStepProcessor(const char *name, TGo4EventProcessorParameter *par)
void SetEllipse(Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta=0, Int_t npoints=0)
Bool_t NewStepSource(const char *name, TGo4EventSourceParameter *par)
Bool_t RemoveEventProcessor(TGo4EventProcessor *pro)
Bool_t NewStepProcessor(const char *name, TGo4EventProcessorParameter *par)
virtual void StatusMessage(int level, Bool_t printout, const TString &)
void UpdateStatus(TGo4AnalysisStatus *state)
Bool_t RemoveEventStructure(TGo4EventElement *ev)
TGo4ShapedCond * MakeFreeShapeCond(const char *fullname, Int_t npoints, Double_t(*points)[2], const char *HistoName=0)
Bool_t SetStepStorage(const char *name, Bool_t on)
Bool_t LoadStatus(const char *filename=0)
Bool_t AddCanvas(TCanvas *can, const char *subfolder=0)
void SetDateTime(const char *str)
Int_t GetAutoSaveCompression() const
virtual void SendStatusMessage(Int_t level, Bool_t printout, const TString &text)
TGo4ShapedCond * MakeCircleCond(const char *fullname, Int_t npoints, Double_t cx, Double_t cy, Double_t r, const char *HistoName=0)
virtual Int_t UserPreLoop()
TGo4AnalysisClient * fxAnalysisSlave
void SetStatus(TGo4AnalysisStatus *state)
void SetStepChecking(Bool_t on=kTRUE)
void SetAnalysisName(const char *name)
Bool_t AddObject(TNamed *anything, const char *subfolder=0, Bool_t replace=kTRUE)
void SetOutputEvent(TGo4EventElement *event)
void DefineServerPasswords(const char *admin, const char *controller, const char *observer)
Bool_t RemoveParameter(const char *name)
Bool_t AddParameter(TGo4Parameter *par, const char *subfolder=0)
void UpdateStatus(TGo4AnalysisStatus *state)
const char * GetStatusMessage() const
Bool_t AddDynamicEntry(TGo4DynamicEntry *entry)
static void SetCommandList(TGo4CommandProtoList *list)
virtual void UserPreLoop()
Bool_t SetParameter(const char *name, TGo4Parameter *par)
static void UnRegister(TGo4CommandReceiver *p)
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=0)
static Bool_t CheckVersion(Int_t version)
virtual void CloseAnalysis()
Int_t StoreFolder(const char *stepname, TFolder *folder)
void SetCurrentSource(const char *str)
Bool_t LoadObjects(const char *filename=0)
const char * GetErrMess() const
TGo4TreeStructure * CreateTreeStructure(const char *treename)
void SetObserverPassword(const char *passwd)
Int_t StoreParameter(const char *name, TGo4Parameter *par)
TGo4InterruptHandler * fxInterruptHandler
Bool_t RemovePicture(const char *name)
virtual const char * What()
void SetAutoSaveOn(Bool_t on=kTRUE)
Bool_t AddDynamicHistogram(const char *name, const char *histo, const char *hevx, const char *hmemx, const char *hevy=0, const char *hmemy=0, const char *hevz=0, const char *hmemz=0, const char *condition=0, const char *cevx=0, const char *cmemx=0, const char *cevy=0, const char *cmemy=0)
Int_t ProcessAnalysisSteps()
virtual Int_t PrintStatus(Text_t *buffer=0, Int_t buflen=0)
virtual void SetValues(const Int_t num, const Int_t *values)
static void CloseLogfile()
void SetControllerPassword(const char *passwd)
void SetSortedOrder(Bool_t on=kTRUE)
static Bool_t IsOutputEnabled()
Bool_t ClearObjects(const char *name)
Bool_t EvaluateFolderpath(const char *fullname, TString &object, TString &folder)
Bool_t DeleteObjects(const char *name)
void SetSortedOrder(Bool_t on=kTRUE)
Bool_t RemoveObject(const char *name, Bool_t del=kTRUE)
static const char * fgcDEFAULTSTATUSFILENAME
TGo4Picture * GetPicture(const char *name)
Int_t IsErrorStopEnabled()
void SendMessageToGUI(Int_t level, Bool_t printout, const char *text)
void SetStepChecking(Bool_t on=kTRUE)
static Bool_t IsClientMode()
Bool_t AddCanvas(TCanvas *can, const char *subfolder=0)
TGo4AnalysisObjectNames * fxObjectNames
Int_t StoreFitter(const char *name, TGo4Fitter *fit)
static const char * GetPrintfArg(Int_t type_id)
Bool_t AddPicture(TGo4Picture *pic, const char *subfolder=0)
Bool_t RemoveEventSource(TGo4EventSource *source)
Bool_t RemoveDynamicEntry(const char *entryname)
TH1 * GetHistogram(const char *name)
void ShowEvent(const char *stepname, Bool_t isoutput=kTRUE)
friend class TGo4AnalysisWebStatus
void SetUpdateInterval(double v)
TString fxDefaultTestFileName
Bool_t SetParameterStatus(const char *name, TGo4ParameterStatus *par)
static void Register(const char *name, TGo4CommandReceiver *p)
virtual void RatemeterUpdate(TGo4Ratemeter *)
Bool_t RemoveAnalysisCondition(const char *name)
TGo4AnalysisObjectManager * fxObjectManager
virtual Int_t UserEventFunc()
Bool_t SetFirstStep(const char *name)
static void OutputEnable(Bool_t on=kTRUE)
Int_t GetPriority() const
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=0, const char *ytitle=0, const char *ztitle=0)
Bool_t FindObjectPathName(TObject *obj, TString &pathname, TFolder *fold=0)
TGo4AnalysisStepManager * fxStepManager
void PrintHistograms(const char *expression=0)
void SetDynListInterval(Int_t val)
void SetRunning(Bool_t on=kTRUE)
TGo4AnalysisObjectNames * CreateNamesList()
void PrintConditions(const char *expression=0)
virtual void ResetCounts()
TGo4EventElement * GetOutputEvent()
TTree * CreateSingleEventTree(const char *name, Bool_t isoutput=kTRUE)
Bool_t fbMakeWithAutosave
TGo4EventElement * GetEventStructure(const char *name)
const char * GetEntryClass() const
Bool_t RemoveEventStructure(TGo4EventElement *ev)
TGo4Condition * GetAnalysisCondition(const char *name, const char *cond_cl=0)
Bool_t AddHistogram(TH1 *his, const char *subfolder=0, Bool_t replace=kTRUE)
Bool_t RemoveEventStore(TGo4EventStore *store)
TGo4AnalysisStep * GetAnalysisStep(const char *name)
static const char * fgcTOPDYNAMICLIST
virtual void UserPostLoop()
void SetAdministratorPassword(const char *passwd)
Bool_t AddHistogram(TH1 *his, const char *subfolder=0, Bool_t replace=kTRUE)
Bool_t AddEventProcessor(TGo4EventProcessor *pro)
Long_t ExecutePython(const char *script_name, Int_t *errcode=0)
Bool_t AddEventSource(TGo4EventSource *source)
static const char fgcPYPROMPT
void SetNewInputFile(Bool_t on=kTRUE)
Bool_t IsSortedOrder() const
void ProcessCrtlCSignal()
Bool_t AddAnalysisCondition(TGo4Condition *con, const char *subfolder=0)
Bool_t SetAnalysisCondition(const char *name, TGo4Condition *con, Bool_t counter=kTRUE)
Bool_t ResetBackStores(Bool_t clearflag=kFALSE)
Bool_t SetStepStorage(const char *name, Bool_t on)
static const char * fgcDEFAULTFILENAME
const char * GetAutoFileName() const
TGo4Parameter * MakeParameter(const char *fullname, const char *classname, const char *cmd=0)
Int_t GetNumberOfAnalysisSteps()
void PrintHistograms(const char *expression=0)
const char * GetStepName()
TGo4EventElement * GetEventStructure(const char *name)
static const char * fgcDEFAULTFILESUF
Bool_t RemoveEventSource(TGo4EventSource *source)
TH1 * GetHistogram(const char *name)
Int_t RunImplicitLoop(Int_t times, Bool_t showrate=kFALSE, Double_t process_event_interval=-1., Bool_t iswebserver=kFALSE)
TGo4EventElement * GetInputEvent(const char *stepname)
Int_t IsAutoSaveOverwrite() const
TCanvas * GetCanvas(const char *name)
TStopwatch * fxAutoSaveClock
void SetAutoSave(Bool_t on=kTRUE)
Bool_t AddObject(TNamed *anything, const char *subfolder=0, Bool_t replace=kTRUE)
Bool_t RemoveEventStore(TGo4EventStore *store)
Int_t GetPriority() const
void SendObjectToGUI(TObject *ob)
TString fServerObserverPass
static TGo4CommandInvoker * Instance()
Bool_t RemoveCanvas(const char *name)
Bool_t AddEventStructure(TGo4EventElement *ev)
Bool_t AddEventStore(TGo4EventStore *store)
void Message(Int_t prio, const char *text,...)
Bool_t AddEventSource(TGo4EventSource *source)
const char * GetSourceName() const
Bool_t AddPicture(TGo4Picture *pic, const char *subfolder=0)
void OpenAutoSaveFile(bool for_writing=false)
Bool_t AddParameter(TGo4Parameter *par, const char *subfolder=0)
TFolder * FindSubFolder(TFolder *parent, const char *subfolder, Bool_t create=kTRUE)
Bool_t AddAnalysisCondition(TGo4Condition *con, const char *subfolder=0)
Int_t StoreCondition(const char *name, TGo4Condition *con)
Bool_t AddEventProcessor(TGo4EventProcessor *pro)
Bool_t RemoveTree(TTree *tree, const char *stepname=0)
TGo4Parameter * GetParameter(const char *name, const char *parameter_class=0)
void SetCircle(Double_t cx, Double_t cy, Double_t r, Int_t npoints=0)
Bool_t ResetBackStores(Bool_t clearflag=kFALSE)
Int_t IsAutoSaveOn() const
Long_t ExecuteScript(const char *script_name)
void SetHistogram(const char *name)
void SendObject(TObject *obj, const char *receiver=0)
TTree * GetTree(const char *name)
virtual Bool_t InitEventClasses()
Bool_t NewStepStore(const char *name, TGo4EventStoreParameter *par)
static Bool_t IsBatchMode()
Bool_t DeleteObjects(const char *name)
Bool_t RemoveCanvas(const char *name)
Bool_t AddTree(TTree *tree, const char *subfolder=0)
Bool_t RemoveEventProcessor(TGo4EventProcessor *pro)
Bool_t AddAnalysisStep(TGo4AnalysisStep *next)
static const char * Message(Int_t prio, const char *text,...)
TGo4EventElement * GetInputEvent(const char *stepname)
TGo4Parameter * GetParameter(const char *name, const char *parameter_class=0)
const char * GetEntryName() const
virtual Int_t UserPostLoop()
void StartObjectServer(const char *basename, const char *passwd)
TGo4AnalysisObjectNames * CreateNamesList()
TGo4EventElement * GetOutputEvent(const char *stepname)
TObject * NextMatchingObject(const char *expr, const char *folder, Bool_t reset)
Bool_t ClearObjects(const char *name)
TGo4Picture * GetPicture(const char *name)
#define __GO4BUILDVERSION__
Int_t fiAutoSaveCompression
virtual void SetValues(Double_t low1, Double_t up1)
virtual const char * GetName() const
TGo4Condition * GetAnalysisCondition(const char *name, const char *cond_cl=0)
const char * GetStatusMessage() const
static TGo4Version * Instance()
static TGo4Analysis * fxInstance
Bool_t AddTree(TTree *tree, const char *subfolder=0)
Int_t GetDynListInterval() const
TGo4AnalysisObjectManager * ObjectManager() const
Bool_t RemoveTree(TTree *tree, const char *stepname=0)
virtual void ProcessSnifferEvents()
TGo4ShapedCond * MakeBoxCond(const char *fullname, Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta, const char *HistoName=0)
Bool_t RemoveAnalysisCondition(const char *name)
TGo4AnalysisSniffer * fSniffer
TGo4ObjectStatus * CreateObjectStatus(const char *name, const char *folder=0)
static void Printf(Bool_t _stdout, const char *text)
Bool_t Update(Int_t increment=1)
TGo4RollingGraph * MakeRollingGraph(const char *fullname, const char *title, Int_t points=0, Int_t average=1)
virtual Bool_t InitEventClasses()
virtual void Print(Option_t *opt="") const
Bool_t NewStepStore(const char *name, TGo4EventStoreParameter *par)
TFolder * GetObjectFolder()
TObject * NextMatchingObject(const char *expr=0, const char *folder=0, Bool_t reset=kFALSE)
static Int_t fiRunningMode
TGo4AnalysisStep * GetAnalysisStep(const char *name)
Bool_t RemoveObject(const char *name, Bool_t del=kTRUE)
static Int_t GetIgnoreLevel()
Bool_t RemoveHistogram(const char *name, Bool_t del=kTRUE)
void PrintParameters(const char *expression=0)
Int_t IsErrorStopEnabled()
void SetAutoSaveOverwrite(Bool_t over=kTRUE)
Bool_t IsAutoSaveFileName() const
TGo4ObjectStatus * CreateObjectStatus(const char *name, const char *folder=0)
Bool_t IsSortedOrder() const
Long_t ExecuteLine(const char *command, Int_t *errcode=0)
void SetAutoSaveFile(const char *filename=0, Bool_t overwrite=kFALSE, Int_t compression=5)
TGo4AnalysisStep * GetAnalysisStepNum(Int_t number)
Bool_t AddAnalysisStep(TGo4AnalysisStep *next)
void ProcessDynamicList()
Bool_t ProtectObjects(const char *name, const Option_t *flags)
static TString subGO4SYS(const char *subdir)
Bool_t ProtectObjects(const char *name, const Option_t *flags)
Bool_t SetPicture(const char *name, TGo4Picture *pic)
Bool_t SaveStatus(const char *filename=0)
Bool_t AddTreeHistogram(const char *hisname, const char *treename, const char *varexp, const char *cutexp)
void SetConfigFileName(const char *name)
Bool_t SetPicture(const char *name, TGo4Picture *pic, TFolder *parent=0)
TGo4AnalysisStep * GetAnalysisStepNum(Int_t number)
TNamed * GetObject(const char *name, const char *folder=0)
Bool_t RemoveDynamicEntry(const char *entryname, const char *listname=0)
ULong64_t GetCurrentCount() const
Bool_t RemoveParameter(const char *name)
void UpdateStatusBuffer()
Bool_t SetParameterStatus(const char *name, TGo4ParameterStatus *par, TFolder *parent=0)
Bool_t fbAutoSaveOverwrite
Bool_t TestBufferUpdateConditions()
void SetAutoSaveInterval(Int_t i)
Bool_t AddDynamicHistogram(const char *name, const char *histo, const char *hevx, const char *hmemx, const char *hevy=0, const char *hmemy=0, const char *hevz=0, const char *hmemz=0, const char *condition=0, const char *cevx=0, const char *cmemx=0, const char *cevy=0, const char *cmemy=0)
TNamed * GetObject(const char *name, const char *folder=0)
Bool_t AddDynamicEntry(TGo4DynamicEntry *entry)
TGo4AnalysisStatus * CreateStatus()
void SetBox(Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta=0)
Bool_t AddEventStructure(TGo4EventElement *ev)
void UpdateRate(Int_t counts=1)
static const char * GO4SYS()
Bool_t RemoveHistogram(const char *name, Bool_t del=kTRUE)
Bool_t LoadObjects(TFile *statusfile)
Int_t ProcessAnalysisSteps()
void SaveObjects(TFile *file)
enum TGo4Analysis::@0 fxDoWorkingFlag
Bool_t AddEventStore(TGo4EventStore *store)
const char * GetSourceClass() const
void SetDynListInterval(Int_t val)
static const Int_t fgiDYNLISTINTERVAL
static void SetRunningMode(int mode)
static TGo4Analysis * Instance()
TGo4EventElement * fxSampleEvent
static const Int_t fgiAUTOSAVECOUNTS
TTree * GetTree(const char *name)
Bool_t SetFirstStep(const char *name)
const char * GetMessage() const
const char * GetEventSourceName()
Int_t GetDynListInterval()
TGo4EventProcessor * GetEventProcessor() const
TGo4AnalysisWebStatus * CreateWebStatus()
TGo4PolyCond * MakePolyCond(const char *fullname, Int_t npoints, Double_t(*points)[2], const char *HistoName=0, Bool_t shapedcond=kFALSE)
static void Error(const char *text,...)
Bool_t NewStepSource(const char *name, TGo4EventSourceParameter *par)
void PrintConditions(const char *expression=0)
void SetAutoSaveCompression(Int_t i=5)
TGo4TreeStructure * CreateTreeStructure(TTree *thetree)
TGraph * MakeGraph(const char *fullname, const char *title, Int_t points=0, Double_t *xvalues=0, Double_t *yvalues=0)
static void Info(const char *text,...)
TFolder * GetObjectFolder()
Bool_t SetLastStep(const char *name)
Int_t GetAutoSaveInterval() const
Bool_t RemovePicture(const char *name)
TCanvas * GetCanvas(const char *name)
Bool_t SetLastStep(const char *name)
void SetAutoSaveInterval(Int_t interval=0)
TGo4WinCond * MakeWinCond(const char *fullname, Double_t xmin, Double_t xmax, const char *HistoName=0)
static void Debug(const char *text,...)
void SetStatus(TGo4AnalysisStatus *state)