20 #include "Riostream.h"
22 #include "TInterpreter.h"
24 #include "TApplication.h"
36 #include "TStopwatch.h"
37 #include "TTimeStamp.h"
41 #include "TGo4LockGuard.h"
83 #if ROOT_VERSION_CODE > ROOT_VERSION(5,2,0)
84 #if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0)
93 TSignalHandler(kSigInterrupt, kFALSE)
110 void InstallGo4CtrlCHandler(
bool on);
135 GO4TRACE((14,
"TGo4Analysis::Instance()",__LINE__, __FILE__));
172 fbInitIsDone(kFALSE),
179 fiAutoSaveCompression(5),
181 fbAutoSaveOverwrite(kFALSE),
182 fbNewInputFile(kFALSE),
183 fxCurrentInputFileName(),
184 fbAutoSaveFileChange(kFALSE),
187 fxDoWorkingFlag(flagInit),
188 fxInterruptHandler(0),
193 fServerObserverPass(),
194 fbMakeWithAutosave(kTRUE),
196 fbPythonBound(kFALSE),
201 GO4TRACE((15,
"TGo4Analysis::TGo4Analysis(const char*)",__LINE__, __FILE__));
211 fbInitIsDone(kFALSE),
218 fiAutoSaveCompression(5),
220 fbAutoSaveOverwrite(kFALSE),
221 fbNewInputFile(kFALSE),
222 fxCurrentInputFileName(),
223 fbAutoSaveFileChange(kFALSE),
226 fxDoWorkingFlag(flagInit),
227 fxInterruptHandler(0),
232 fServerObserverPass(),
233 fbMakeWithAutosave(kTRUE),
235 fbPythonBound(kFALSE),
240 GO4TRACE((15,
"TGo4Analysis::TGo4Analysis(const char*)",__LINE__, __FILE__));
251 Message(-1,
"!!!! Analysis Base class:\n\t User Analysis was built with wrong \t\tGo4 Buildversion %d !!!!!",
254 Message(-1,
"\t >>make clean all<<");
255 Message(-1,
"Aborting in 20 s...");
256 gSystem->Sleep(20000);
260 Message(-1,
"Welcome to Go4 Analysis Framework Release %s (build %d) !",
265 gROOT->SetBatch(kTRUE);
287 InstallGo4CtrlCHandler(
true);
292 Message(2,
"Analysis BaseClass ctor -- analysis singleton already exists !!!");
295 #if ROOT_VERSION_CODE > ROOT_VERSION(6,12,0)
296 TInterpreter* theI = gROOT->GetInterpreter();
297 theI->SetProcessLineLock(kTRUE);
299 gROOT->ProcessLineSync(
"TGo4Analysis *go4 = TGo4Analysis::Instance();");
300 gROOT->ProcessLineSync(Form(
".x %s",
TGo4Log::subGO4SYS(
"macros/anamacroinit.C").Data()));
308 InstallGo4CtrlCHandler(
false);
316 GO4TRACE((15,
"TGo4Analysis::~TGo4Analysis()",__LINE__, __FILE__));
326 gROOT->ProcessLineSync(Form(
".x %s",
TGo4Log::subGO4SYS(
"macros/anamacroclose.C").Data()));
343 if (gApplication) gApplication->Terminate();
358 GO4TRACE((14,
"TGo4Analysis::InitEventClasses()",__LINE__, __FILE__));
367 TGo4Log::Info(
"Analysis -- Initializing EventClasses done.");
379 TGo4Log::Info(
"Analysis BaseClass -- EventClasses were already initialized.");
388 GO4TRACE((11,
"TGo4Analysis::MainCycle()",__LINE__, __FILE__));
430 GO4TRACE((11,
"TGo4Analysis::UserEventFunc()",__LINE__, __FILE__));
441 GO4TRACE((11,
"TGo4Analysis::Process()",__LINE__, __FILE__));
443 #if ROOT_VERSION_CODE > ROOT_VERSION(5,2,0)
444 #if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0)
445 Bool_t unlockedcint=kFALSE;
447 gCINTMutex->UnLock();
460 gSystem->ProcessEvents();
473 TDirectory* savdir = gDirectory;
492 Message(2,
"Analysis %s TIMEOUT for eventsource %s:%s.",
499 Message(2,
"End of event source %s: name:%s - msg:%s",
520 Message(3,
"Analysis %s ERROR: %s from event source %s:\n %s",
539 Message(3,
"Analysis %s ERROR: %s from dynamic list entry %s:%s",
555 Message(3,
"Analysis %s ERROR: %s in Analysis Step %s",
581 catch(std::exception& ex)
583 Message(3,
"Analysis %s got standard exception %s",
595 #if ROOT_VERSION_CODE > ROOT_VERSION(5,2,0)
596 #if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0)
597 if(gCINTMutex && unlockedcint) {
611 GO4TRACE((11,
"TGo4Analysis::RunImplicitLoop(Int_t)",__LINE__, __FILE__));
614 if (process_event_interval>1.) process_event_interval = 1.;
619 TString ratefmt = TString::Format(
"\rCnt = %s Rate = %s Ev/s",
TGo4Log::GetPrintfArg(kULong64_t),
"%5.*f");
621 Bool_t userate = showrate || (process_event_interval>0.);
622 Bool_t process_events = kFALSE;
627 TTimeStamp last_update;
632 Message(1,
"Analysis loop for %d cycles is starting...", times);
634 Message(1,
"Analysis loop is starting...");
638 if ((times>0) && (cnt>=times))
break;
642 process_events = kTRUE;
644 bool need_update =
false;
646 if ((now.AsDouble() - last_update.AsDouble()) >= 1.) {
647 last_update = now; need_update =
true;
676 if (process_events) {
678 process_events = kFALSE;
679 gSystem->ProcessEvents();
763 Message(1,
"!!! Unexpected exception in %d cycle !!!", cnt);
773 Message(1,
"Analysis implicit Loop has finished after %d cycles.", cnt);
781 Message(1,
"%s appeared in %d cycle.", ex.
What(), cnt);
784 catch(std::exception& ex) {
785 Message(1,
"standard exception %s appeared in %d cycle.", ex.what(), cnt);
788 Message(1,
"!!! Unexpected exception in %d cycle !!!", cnt);
792 printf(
"\n"); fflush(stdout);
806 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()) != 0) {
864 if (strcmp(key->GetClassName(),
"TGo4AnalysisStatus")==0)
break;
867 if (key!=0) state =
dynamic_cast<TGo4AnalysisStatus*
>( statusfile->Get( key->GetName() ) );
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__));
898 strncpy(buffer, filename,
sizeof(buffer)-100);
903 TFile* statusfile = TFile::Open(buffer,
"RECREATE");
904 if(statusfile && statusfile->IsOpen()) {
913 Message(-1,
"Analysis SaveStatus: Saved Analysis settings to file %s", buffer);
915 Message(3,
"Analysis SaveStatus: FAILED to create status object !!!");
919 Message(3,
"Analysis SaveStatus: Failed to open file %s ",
928 GO4TRACE((11,
"TGo4Analysis::CreateStatus()",__LINE__, __FILE__));
929 TDirectory* filsav=gDirectory;
939 GO4TRACE((11,
"TGo4Analysis::CreateWebStatus()",__LINE__, __FILE__));
940 TDirectory* filsav=gDirectory;
961 GO4TRACE((11,
"TGo4Analysis::CreateSingleEventTree(TGo4EventElement*)",__LINE__, __FILE__));
968 GO4TRACE((11,
"TGo4Analysis::CreateSingleEventTree(const char*, Bool_t)",__LINE__, __FILE__));
980 GO4TRACE((14,
"TGo4Analysis::CloseAnalysis()",__LINE__, __FILE__));
993 GO4TRACE((11,
"TGo4Analysis:PreLoop()",__LINE__, __FILE__));
1010 GO4TRACE((11,
"TGo4Analysis::PostLoop()",__LINE__, __FILE__));
1035 GO4TRACE((11,
"TGo4Analysis::UserPreLoop()",__LINE__, __FILE__));
1037 Message(0,
"Analysis BaseClass -- executing default User Preloop");
1043 GO4TRACE((11,
"TGo4Analysis::UserPostLoop()",__LINE__, __FILE__));
1045 Message(0,
"Analysis BaseClass -- executing default User Postloop");
1054 if(filename) buffer = filename;
1071 GO4TRACE((12,
"TGo4Analysis::LockAutoSave()",__LINE__, __FILE__));
1080 GO4TRACE((12,
"TGo4Analysis::UnLockAutoSave()",__LINE__, __FILE__));
1090 GO4TRACE((12,
"TGo4Analysis::AutoSave()",__LINE__, __FILE__));
1094 Message(0,
"Analysis -- AutoSaving....");
1100 Message(0,
"Analysis -- AutoSave done.");
1147 GO4TRACE((11,
"TGo4Analysis::UpdateNamesList()",__LINE__, __FILE__));
1153 Message(0,
"Analysis BaseClass -- Nameslist updated.");
1190 va_start(args, text);
1218 Message(2,
"Could not send object %s to GUI in batch mode.", ob->GetName());
1253 #if ROOT_VERSION_CODE > ROOT_VERSION(5,2,0)
1254 #if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0)
1255 Bool_t unlockedcint=kFALSE;
1258 gCINTMutex->UnLock();
1270 Bool_t sysret = gSystem->ProcessEvents();
1279 #if ROOT_VERSION_CODE > ROOT_VERSION(5,2,0)
1280 #if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0)
1281 if(gCINTMutex && unlockedcint)
1292 Message(1,
"Start object server not yet enabled.");
1295 Message(2,
"Could not start object server in batch mode.");
1303 Message(1,
"Stop object server not yet enabled.");
1305 Message(2,
"Could not stop object server in batch mode.");
1315 TGo4Log::Message(1,
"Analysis server is initiating shutdown after ctrl-c, please wait!!\n");
1328 Message(1,
"Showing Output Event %s of step %s",sevtree->GetName(),stepname);
1330 Message(1,
"Showing Input Event %s of step %s",sevtree->GetName(),stepname);
1332 std::cout << std::endl;
1342 const char* hevx,
const char* hmemx,
1343 const char* hevy,
const char* hmemy,
1344 const char* hevz,
const char* hmemz,
1345 const char* condition,
1346 const char* cevx,
const char* cmemx,
1347 const char* cevy,
const char* cmemy)
1350 histo, hevx, hmemx, hevy, hmemy, hevz, hmemz,
1351 condition, cevx, cmemx, cevy, cmemy);
1755 Int_t nbinsx, Double_t xlow, Double_t xup,
1756 const char* xtitle,
const char* ytitle)
1759 TString foldername, histoname;
1761 if ((fullname==0) || (strlen(fullname)==0)) {
1762 TGo4Log::Error(
"Histogram name not specified, can be a hard error");
1765 const char* separ = strrchr(fullname,
'/');
1767 histoname = separ + 1;
1768 foldername.Append(fullname, separ - fullname);
1770 histoname = fullname;
1773 const char* sclass =
"TH1I";
1775 case 'I':
case 'i': itype = 0; sclass =
"TH1I";
break;
1776 case 'F':
case 'f': itype = 1; sclass =
"TH1F";
break;
1777 case 'D':
case 'd': itype = 2; sclass =
"TH1D";
break;
1778 case 'S':
case 's': itype = 3; sclass =
"TH1S";
break;
1779 case 'C':
case 'c': itype = 4; sclass =
"TH1C";
break;
1780 default:
TGo4Log::Error(
"There is no histogram type: %c, use I instead", type);
break;
1787 if (title) oldh->SetTitle(title);
1788 if (xtitle) oldh->GetXaxis()->SetTitle(xtitle);
1789 if (ytitle) oldh->GetYaxis()->SetTitle(ytitle);
1794 TGo4Log::Info(
"There is histogram %s with type %s other than specified %s, create new and reuse content",
1795 fullname, oldh->ClassName(), sclass);
1801 oldh->SetName(
"___");
1807 case 0: newh =
new TH1I(histoname, title, nbinsx, xlow, xup);
break;
1808 case 1: newh =
new TH1F(histoname, title, nbinsx, xlow, xup);
break;
1809 case 2: newh =
new TH1D(histoname, title, nbinsx, xlow, xup);
break;
1810 case 3: newh =
new TH1S(histoname, title, nbinsx, xlow, xup);
break;
1811 case 4: newh =
new TH1C(histoname, title, nbinsx, xlow, xup);
break;
1814 newh->SetTitle(title);
1816 if (xtitle) newh->GetXaxis()->SetTitle(xtitle);
1817 if (ytitle) newh->GetYaxis()->SetTitle(ytitle);
1821 delete oldh; oldh = 0;
1824 if (foldername.Length() > 0)
1835 Int_t nbinsx, Double_t xlow, Double_t xup,
1836 Int_t nbinsy, Double_t ylow, Double_t yup,
1837 const char* xtitle,
const char* ytitle,
const char* ztitle)
1840 TString foldername, histoname;
1842 if ((fullname==0) || (strlen(fullname)==0)) {
1843 TGo4Log::Error(
"Histogram name not specified, can be a hard error");
1846 const char* separ = strrchr(fullname,
'/');
1848 histoname = separ + 1;
1849 foldername.Append(fullname, separ - fullname);
1851 histoname = fullname;
1854 const char* sclass =
"TH2I";
1856 case 'I':
case 'i': itype = 0; sclass =
"TH2I";
break;
1857 case 'F':
case 'f': itype = 1; sclass =
"TH2F";
break;
1858 case 'D':
case 'd': itype = 2; sclass =
"TH2D";
break;
1859 case 'S':
case 's': itype = 3; sclass =
"TH2S";
break;
1860 case 'C':
case 'c': itype = 4; sclass =
"TH2C";
break;
1861 default:
TGo4Log::Error(
"There is no histogram type: %c, use I instead", type);
break;
1868 if (title) oldh->SetTitle(title);
1869 if (xtitle) oldh->GetXaxis()->SetTitle(xtitle);
1870 if (ytitle) oldh->GetYaxis()->SetTitle(ytitle);
1875 TGo4Log::Info(
"There is histogram %s with type %s other than specified %s, create new and reuse content",
1876 fullname, oldh->ClassName(), sclass);
1882 oldh->SetName(
"___");
1888 case 0: newh =
new TH2I(histoname, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
break;
1889 case 1: newh =
new TH2F(histoname, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
break;
1890 case 2: newh =
new TH2D(histoname, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
break;
1891 case 3: newh =
new TH2S(histoname, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
break;
1892 case 4: newh =
new TH2C(histoname, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
break;
1895 newh->SetTitle(title);
1897 if (xtitle) newh->GetXaxis()->SetTitle(xtitle);
1898 if (ytitle) newh->GetYaxis()->SetTitle(ytitle);
1899 if (ztitle) newh->GetZaxis()->SetTitle(ztitle);
1907 if (foldername.Length() > 0)
1918 Double_t xmin, Double_t xmax,
1919 const char* HistoName)
1922 TString foldername, condname;
1924 if ((fullname==0) || (strlen(fullname)==0)) {
1925 TGo4Log::Error(
"Condition name not specified, can be a hard error");
1928 const char* separ = strrchr(fullname,
'/');
1930 condname = separ + 1;
1931 foldername.Append(fullname, separ - fullname);
1933 condname = fullname;
1950 if (foldername.Length() > 0)
1961 Double_t xmin, Double_t xmax,
1962 Double_t ymin, Double_t ymax,
1963 const char* HistoName)
1966 TString foldername, condname;
1968 if ((fullname==0) || (strlen(fullname)==0)) {
1969 TGo4Log::Error(
"Condition name not specified, can be a hard error");
1972 const char* separ = strrchr(fullname,
'/');
1974 condname = separ + 1;
1975 foldername.Append(fullname, separ - fullname);
1977 condname = fullname;
1990 wcond->
SetValues(xmin, xmax, ymin, ymax);
1994 if (foldername.Length() > 0)
2006 Double_t (*points) [2],
2007 const char* HistoName,
2011 TString foldername, condname;
2013 if ((fullname==0) || (strlen(fullname)==0)) {
2014 TGo4Log::Error(
"Condition name not specified, can be a hard error");
2017 const char* separ = strrchr(fullname,
'/');
2019 condname = separ + 1;
2020 foldername.Append(fullname, separ - fullname);
2022 condname = fullname;
2034 TArrayD fullx(npoints+1), fully(npoints+1);
2036 for (
int i=0;i<npoints;i++) {
2037 fullx[i] = points[i][0];
2038 fully[i] = points[i][1];
2042 if ((fullx[0]!=fullx[npoints-1]) || (fully[0]!=fully[npoints-1])) {
2043 fullx[npoints] = fullx[0];
2044 fully[npoints] = fully[0];
2048 TCutG mycat(
"initialcut", npoints, fullx.GetArray(), fully.GetArray());
2054 pcond->SetValues(&mycat);
2057 pcond->SetHistogram(HistoName);
2059 if (foldername.Length() > 0)
2072 Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta,
2073 const char* HistoName)
2076 TString foldername, condname;
2078 if ((fullname==0) || (strlen(fullname)==0)) {
2079 TGo4Log::Error(
"Condition name not specified, can be a hard error");
2082 const char* separ = strrchr(fullname,
'/');
2084 condname = separ + 1;
2085 foldername.Append(fullname, separ - fullname);
2087 condname = fullname;
2100 econd->
SetEllipse(cx,cy,a1,a2,theta,npoints);
2103 if (foldername.Length() > 0)
2115 Int_t npoints, Double_t cx, Double_t cy, Double_t r,
2116 const char* HistoName)
2124 const char* HistoName)
2135 Double_t (*points) [2],
2136 const char* HistoName)
2147 const char* classname,
2151 TString foldername, paramname;
2153 if ((fullname==0) || (strlen(fullname)==0)) {
2154 TGo4Log::Error(
"Parameter name not specified, can be a hard error");
2157 const char* separ = strrchr(fullname,
'/');
2159 paramname = separ + 1;
2160 foldername.Append(fullname, separ - fullname);
2162 paramname = fullname;
2167 if (!param->InheritsFrom(classname)) {
2168 TGo4Log::Info(
"There is parameter %s with type %s other than specified %s, rebuild",
2169 fullname, param->ClassName(), classname);
2176 paramname = TString(
"\"") + paramname + TString(
"\"");
2179 if ((newcmd!=0) && (strstr(newcmd,
"new ")==newcmd))
2180 cmd = TString::Format(newcmd, paramname.Data());
2182 cmd = TString::Format(
"new %s(%s)", classname, paramname.Data());
2184 Long_t res = gROOT->ProcessLineFast(cmd.Data());
2187 TGo4Log::Error(
"Cannot create parameter of class %s", classname);
2193 if (foldername.Length() > 0)
2201 if ((newcmd!=0) && (strstr(newcmd,
"set_")==newcmd)) {
2212 if ((macro_name==0) || (strlen(macro_name)==0))
return -1;
2215 TString file_name(macro_name);
2216 Ssiz_t pos = file_name.First(
'(');
2217 if (pos>0) file_name.Resize(pos);
2218 pos = file_name.First(
'+');
2219 if (pos>0) file_name.Resize(pos);
2220 while ((file_name.Length()>0) && (file_name[file_name.Length()-1] ==
' '))
2221 file_name.Resize(file_name.Length()-1);
2222 while ((file_name.Length()>0) && (file_name[0]==
' '))
2223 file_name.Remove(0, 1);
2225 if (gSystem->AccessPathName(file_name.Data())) {
2231 return gROOT->ProcessLineSync(Form(
".x %s", macro_name));
2236 if ((macro_name==0) || (strlen(macro_name)==0))
return -1;
2237 TString comstring=macro_name;
2248 comstring = command;
2249 comstring = comstring.Strip(TString::kBoth);
2251 comstring = comstring.Strip(TString::kLeading);
2253 const TString PY_EXT =
".py";
2254 int imin = comstring.Index(PY_EXT +
" ");
2255 int imax = comstring.Length();
2259 imin += PY_EXT.Length();
2261 int ilen = imax - imin;
2262 TString scrstring = comstring(0, imin);
2263 TString argstring = comstring(imin, ilen);
2265 comstring =
"TPython::Exec(\"import sys; sys.argv = [\'" + scrstring +
"\'] + \'" + argstring +
"\'.split()\");";
2266 comstring +=
"TPython::LoadMacro(\"" + scrstring +
"\");";
2271 comstring.Prepend(
"TPython::LoadMacro(\"" + go4sys + pyinit +
"\");");
2272 comstring.Prepend(
"TPython::Bind(go4, \"go4\");" );
2277 const char* cursor = command;
2280 Ssiz_t len=strlen(cursor);
2281 at = strstr(cursor,
"@");
2284 len=(Ssiz_t) (at-cursor);
2285 comstring.Append(cursor,len);
2286 comstring.Append(
"TGo4Analysis::Instance()->");
2290 comstring.Append(cursor);
2307 Long_t rev=gROOT->ProcessLineSync(comstring, errcode);
2344 Message(2, TString::Format(
"Analysis %s was not initialized! Please SUBMIT settings first.",
GetName()));
2353 #include "windows.h"
2358 static BOOL Go4ConsoleSigHandler(DWORD sig)
2367 case CTRL_BREAK_EVENT:
2368 case CTRL_LOGOFF_EVENT:
2369 case CTRL_SHUTDOWN_EVENT:
2370 case CTRL_CLOSE_EVENT:
2372 printf(
" non CTRL-C signal - ignore\n");
2377 void InstallGo4CtrlCHandler(
bool on)
2379 ::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)
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
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)
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)
static void CloseLogfile()
void SetControllerPassword(const char *passwd)
static Bool_t IsOutputEnabled()
Bool_t ClearObjects(const char *name)
Bool_t DeleteObjects(const char *name)
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)
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)
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)
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)
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)