20 #include "Riostream.h"
22 #include "TInterpreter.h"
24 #include "TApplication.h"
36 #include "TStopwatch.h"
37 #include "TTimeStamp.h"
41 #include "TGo4LockGuard.h"
84 #if ROOT_VERSION_CODE > ROOT_VERSION(5,2,0)
85 #if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0)
94 TSignalHandler(kSigInterrupt, kFALSE)
111 void InstallGo4CtrlCHandler(
bool on);
136 GO4TRACE((14,
"TGo4Analysis::Instance()",__LINE__, __FILE__));
173 fbInitIsDone(kFALSE),
180 fiAutoSaveCompression(5),
182 fbAutoSaveOverwrite(kFALSE),
183 fbNewInputFile(kFALSE),
184 fxCurrentInputFileName(),
185 fbAutoSaveFileChange(kFALSE),
188 fxDoWorkingFlag(flagInit),
189 fxInterruptHandler(0),
194 fServerObserverPass(),
195 fbMakeWithAutosave(kTRUE),
197 fbPythonBound(kFALSE),
202 GO4TRACE((15,
"TGo4Analysis::TGo4Analysis(const char*)",__LINE__, __FILE__));
212 fbInitIsDone(kFALSE),
219 fiAutoSaveCompression(5),
221 fbAutoSaveOverwrite(kFALSE),
222 fbNewInputFile(kFALSE),
223 fxCurrentInputFileName(),
224 fbAutoSaveFileChange(kFALSE),
227 fxDoWorkingFlag(flagInit),
228 fxInterruptHandler(0),
233 fServerObserverPass(),
234 fbMakeWithAutosave(kTRUE),
236 fbPythonBound(kFALSE),
241 GO4TRACE((15,
"TGo4Analysis::TGo4Analysis(const char*)",__LINE__, __FILE__));
252 Message(-1,
"!!!! Analysis Base class:\n\t User Analysis was built with wrong \t\tGo4 Buildversion %d !!!!!",
255 Message(-1,
"\t >>make clean all<<");
256 Message(-1,
"Aborting in 20 s...");
257 gSystem->Sleep(20000);
261 Message(-1,
"Welcome to Go4 Analysis Framework Release %s (build %d) !",
266 gROOT->SetBatch(kTRUE);
288 InstallGo4CtrlCHandler(
true);
293 Message(2,
"Analysis BaseClass ctor -- analysis singleton already exists !!!");
296 gROOT->ProcessLineSync(
"TGo4Analysis *go4 = TGo4Analysis::Instance();");
297 gROOT->ProcessLineSync(Form(
".x %s",
TGo4Log::subGO4SYS(
"macros/anamacroinit.C").Data()));
305 InstallGo4CtrlCHandler(
false);
313 GO4TRACE((15,
"TGo4Analysis::~TGo4Analysis()",__LINE__, __FILE__));
323 gROOT->ProcessLineSync(Form(
".x %s",
TGo4Log::subGO4SYS(
"macros/anamacroclose.C").Data()));
340 if (gApplication) gApplication->Terminate();
355 GO4TRACE((14,
"TGo4Analysis::InitEventClasses()",__LINE__, __FILE__));
364 TGo4Log::Info(
"Analysis -- Initializing EventClasses done.");
376 TGo4Log::Info(
"Analysis BaseClass -- EventClasses were already initialized.");
385 GO4TRACE((11,
"TGo4Analysis::MainCycle()",__LINE__, __FILE__));
427 GO4TRACE((11,
"TGo4Analysis::UserEventFunc()",__LINE__, __FILE__));
438 GO4TRACE((11,
"TGo4Analysis::Process()",__LINE__, __FILE__));
440 #if ROOT_VERSION_CODE > ROOT_VERSION(5,2,0)
441 #if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0)
442 Bool_t unlockedcint=kFALSE;
444 gCINTMutex->UnLock();
457 gSystem->ProcessEvents();
470 TDirectory* savdir = gDirectory;
489 Message(2,
"Analysis %s TIMEOUT for eventsource %s:%s.",
496 Message(2,
"End of event source %s: name:%s - msg:%s",
517 Message(3,
"Analysis %s ERROR: %s from event source %s:\n %s",
536 Message(3,
"Analysis %s ERROR: %s from dynamic list entry %s:%s",
552 Message(3,
"Analysis %s ERROR: %s in Analysis Step %s",
578 catch(std::exception& ex)
580 Message(3,
"Analysis %s got standard exception %s",
592 #if ROOT_VERSION_CODE > ROOT_VERSION(5,2,0)
593 #if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0)
594 if(gCINTMutex && unlockedcint) {
608 GO4TRACE((11,
"TGo4Analysis::RunImplicitLoop(Int_t)",__LINE__, __FILE__));
611 if (process_event_interval>1.) process_event_interval = 1.;
616 TString ratefmt = TString::Format(
"\rCnt = %s Rate = %s Ev/s",
TGo4Log::GetPrintfArg(kULong64_t),
"%5.*f");
618 Bool_t userate = showrate || (process_event_interval>0.);
619 Bool_t process_events = kFALSE;
624 TTimeStamp last_update;
629 Message(1,
"Analysis loop for %d cycles is starting...", times);
631 Message(1,
"Analysis loop is starting...");
635 if ((times>0) && (cnt>=times))
break;
639 process_events = kTRUE;
641 bool need_update =
false;
643 if ((now.AsDouble() - last_update.AsDouble()) >= 1.) {
644 last_update = now; need_update =
true;
673 if (process_events) {
675 process_events = kFALSE;
676 gSystem->ProcessEvents();
760 Message(1,
"!!! Unexpected exception in %d cycle !!!", cnt);
770 Message(1,
"Analysis implicit Loop has finished after %d cycles.", cnt);
778 Message(1,
"%s appeared in %d cycle.", ex.
What(), cnt);
781 catch(std::exception& ex) {
782 Message(1,
"standard exception %s appeared in %d cycle.", ex.what(), cnt);
785 Message(1,
"!!! Unexpected exception in %d cycle !!!", cnt);
789 printf(
"\n"); fflush(stdout);
803 GO4TRACE((11,
"TGo4Analysis::RemoveDynamicEntry(const char *, const char* )",__LINE__, __FILE__));
815 GO4TRACE((11,
"TGo4Analysis::UpdateStatus(TGo4AnalysisStatus*)",__LINE__, __FILE__));
829 GO4TRACE((11,
"TGo4Analysis::SetStatus(TGo4AnalysisStatus*)",__LINE__, __FILE__));
845 GO4TRACE((11,
"TGo4Analysis::LoadStatus(const char*)",__LINE__, __FILE__));
853 TFile* statusfile = TFile::Open(fname.Data(),
"READ");
854 if(statusfile && statusfile->IsOpen()) {
858 TIter iter(statusfile->GetListOfKeys());
860 while ((key = (TKey*)iter()) != 0) {
861 if (strcmp(key->GetClassName(),
"TGo4AnalysisStatus")==0)
break;
864 if (key!=0) state =
dynamic_cast<TGo4AnalysisStatus*
>( statusfile->Get( key->GetName() ) );
869 Message(1,
"Analysis %s: Found status object %s in file %s",
870 GetName(), state->GetName(), fname.Data());
873 Message(0,
"Analysis: New analysis state is set.");
876 Message(3,
"Analysis LoadStatus: Could not find status %s in file %s",
GetName(), fname.Data());
880 Message(3,
"Analysis LoadStatus: Failed to open file %s", fname.Data());
891 GO4TRACE((11,
"TGo4Analysis::SaveStatus(const char*)",__LINE__, __FILE__));
895 strncpy(buffer, filename,
sizeof(buffer)-100);
900 TFile* statusfile = TFile::Open(buffer,
"RECREATE");
901 if(statusfile && statusfile->IsOpen()) {
910 Message(-1,
"Analysis SaveStatus: Saved Analysis settings to file %s", buffer);
912 Message(3,
"Analysis SaveStatus: FAILED to create status object !!!");
916 Message(3,
"Analysis SaveStatus: Failed to open file %s ",
925 GO4TRACE((11,
"TGo4Analysis::CreateStatus()",__LINE__, __FILE__));
926 TDirectory* filsav=gDirectory;
936 GO4TRACE((11,
"TGo4Analysis::CreateWebStatus()",__LINE__, __FILE__));
937 TDirectory* filsav=gDirectory;
958 GO4TRACE((11,
"TGo4Analysis::CreateSingleEventTree(TGo4EventElement*)",__LINE__, __FILE__));
965 GO4TRACE((11,
"TGo4Analysis::CreateSingleEventTree(const char*, Bool_t)",__LINE__, __FILE__));
977 GO4TRACE((14,
"TGo4Analysis::CloseAnalysis()",__LINE__, __FILE__));
990 GO4TRACE((11,
"TGo4Analysis:PreLoop()",__LINE__, __FILE__));
1007 GO4TRACE((11,
"TGo4Analysis::PostLoop()",__LINE__, __FILE__));
1032 GO4TRACE((11,
"TGo4Analysis::UserPreLoop()",__LINE__, __FILE__));
1034 Message(0,
"Analysis BaseClass -- executing default User Preloop");
1040 GO4TRACE((11,
"TGo4Analysis::UserPostLoop()",__LINE__, __FILE__));
1042 Message(0,
"Analysis BaseClass -- executing default User Postloop");
1051 if(filename) buffer = filename;
1068 GO4TRACE((12,
"TGo4Analysis::LockAutoSave()",__LINE__, __FILE__));
1077 GO4TRACE((12,
"TGo4Analysis::UnLockAutoSave()",__LINE__, __FILE__));
1087 GO4TRACE((12,
"TGo4Analysis::AutoSave()",__LINE__, __FILE__));
1091 Message(0,
"Analysis -- AutoSaving....");
1097 Message(0,
"Analysis -- AutoSave done.");
1144 GO4TRACE((11,
"TGo4Analysis::UpdateNamesList()",__LINE__, __FILE__));
1150 Message(0,
"Analysis BaseClass -- Nameslist updated.");
1187 va_start(args, text);
1215 Message(2,
"Could not send object %s to GUI in batch mode.", ob->GetName());
1250 #if ROOT_VERSION_CODE > ROOT_VERSION(5,2,0)
1251 #if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0)
1252 Bool_t unlockedcint=kFALSE;
1255 gCINTMutex->UnLock();
1267 Bool_t sysret = gSystem->ProcessEvents();
1276 #if ROOT_VERSION_CODE > ROOT_VERSION(5,2,0)
1277 #if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0)
1278 if(gCINTMutex && unlockedcint)
1289 Message(1,
"Start object server not yet enabled.");
1292 Message(2,
"Could not start object server in batch mode.");
1300 Message(1,
"Stop object server not yet enabled.");
1302 Message(2,
"Could not stop object server in batch mode.");
1312 TGo4Log::Message(1,
"Analysis server is initiating shutdown after ctrl-c, please wait!!\n");
1325 Message(1,
"Showing Output Event %s of step %s",sevtree->GetName(),stepname);
1327 Message(1,
"Showing Input Event %s of step %s",sevtree->GetName(),stepname);
1329 std::cout << std::endl;
1339 const char* hevx,
const char* hmemx,
1340 const char* hevy,
const char* hmemy,
1341 const char* hevz,
const char* hmemz,
1342 const char* condition,
1343 const char* cevx,
const char* cmemx,
1344 const char* cevy,
const char* cmemy)
1347 histo, hevx, hmemx, hevy, hmemy, hevz, hmemz,
1348 condition, cevx, cmemx, cevy, cmemy);
1752 Int_t nbinsx, Double_t xlow, Double_t xup,
1753 const char* xtitle,
const char* ytitle)
1756 TString foldername, histoname;
1758 if ((fullname==0) || (strlen(fullname)==0)) {
1759 TGo4Log::Error(
"Histogram name not specified, can be a hard error");
1762 const char* separ = strrchr(fullname,
'/');
1764 histoname = separ + 1;
1765 foldername.Append(fullname, separ - fullname);
1767 histoname = fullname;
1770 const char* sclass =
"TH1I";
1772 case 'I':
case 'i': itype = 0; sclass =
"TH1I";
break;
1773 case 'F':
case 'f': itype = 1; sclass =
"TH1F";
break;
1774 case 'D':
case 'd': itype = 2; sclass =
"TH1D";
break;
1775 case 'S':
case 's': itype = 3; sclass =
"TH1S";
break;
1776 case 'C':
case 'c': itype = 4; sclass =
"TH1C";
break;
1777 default:
TGo4Log::Error(
"There is no histogram type: %c, use I instead", type);
break;
1784 if (title) oldh->SetTitle(title);
1785 if (xtitle) oldh->GetXaxis()->SetTitle(xtitle);
1786 if (ytitle) oldh->GetYaxis()->SetTitle(ytitle);
1791 TGo4Log::Info(
"There is histogram %s with type %s other than specified %s, create new and reuse content",
1792 fullname, oldh->ClassName(), sclass);
1798 oldh->SetName(
"___");
1804 case 0: newh =
new TH1I(histoname, title, nbinsx, xlow, xup);
break;
1805 case 1: newh =
new TH1F(histoname, title, nbinsx, xlow, xup);
break;
1806 case 2: newh =
new TH1D(histoname, title, nbinsx, xlow, xup);
break;
1807 case 3: newh =
new TH1S(histoname, title, nbinsx, xlow, xup);
break;
1808 case 4: newh =
new TH1C(histoname, title, nbinsx, xlow, xup);
break;
1811 newh->SetTitle(title);
1813 if (xtitle) newh->GetXaxis()->SetTitle(xtitle);
1814 if (ytitle) newh->GetYaxis()->SetTitle(ytitle);
1818 delete oldh; oldh = 0;
1821 if (foldername.Length() > 0)
1832 Int_t nbinsx, Double_t xlow, Double_t xup,
1833 Int_t nbinsy, Double_t ylow, Double_t yup,
1834 const char* xtitle,
const char* ytitle,
const char* ztitle)
1837 TString foldername, histoname;
1839 if ((fullname==0) || (strlen(fullname)==0)) {
1840 TGo4Log::Error(
"Histogram name not specified, can be a hard error");
1843 const char* separ = strrchr(fullname,
'/');
1845 histoname = separ + 1;
1846 foldername.Append(fullname, separ - fullname);
1848 histoname = fullname;
1851 const char* sclass =
"TH2I";
1853 case 'I':
case 'i': itype = 0; sclass =
"TH2I";
break;
1854 case 'F':
case 'f': itype = 1; sclass =
"TH2F";
break;
1855 case 'D':
case 'd': itype = 2; sclass =
"TH2D";
break;
1856 case 'S':
case 's': itype = 3; sclass =
"TH2S";
break;
1857 case 'C':
case 'c': itype = 4; sclass =
"TH2C";
break;
1858 default:
TGo4Log::Error(
"There is no histogram type: %c, use I instead", type);
break;
1865 if (title) oldh->SetTitle(title);
1866 if (xtitle) oldh->GetXaxis()->SetTitle(xtitle);
1867 if (ytitle) oldh->GetYaxis()->SetTitle(ytitle);
1872 TGo4Log::Info(
"There is histogram %s with type %s other than specified %s, create new and reuse content",
1873 fullname, oldh->ClassName(), sclass);
1879 oldh->SetName(
"___");
1885 case 0: newh =
new TH2I(histoname, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
break;
1886 case 1: newh =
new TH2F(histoname, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
break;
1887 case 2: newh =
new TH2D(histoname, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
break;
1888 case 3: newh =
new TH2S(histoname, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
break;
1889 case 4: newh =
new TH2C(histoname, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
break;
1892 newh->SetTitle(title);
1894 if (xtitle) newh->GetXaxis()->SetTitle(xtitle);
1895 if (ytitle) newh->GetYaxis()->SetTitle(ytitle);
1896 if (ztitle) newh->GetZaxis()->SetTitle(ztitle);
1904 if (foldername.Length() > 0)
1915 Double_t xmin, Double_t xmax,
1916 const char* HistoName)
1919 TString foldername, condname;
1921 if ((fullname==0) || (strlen(fullname)==0)) {
1922 TGo4Log::Error(
"Condition name not specified, can be a hard error");
1925 const char* separ = strrchr(fullname,
'/');
1927 condname = separ + 1;
1928 foldername.Append(fullname, separ - fullname);
1930 condname = fullname;
1947 if (foldername.Length() > 0)
1958 Double_t xmin, Double_t xmax,
1959 Double_t ymin, Double_t ymax,
1960 const char* HistoName)
1963 TString foldername, condname;
1965 if ((fullname==0) || (strlen(fullname)==0)) {
1966 TGo4Log::Error(
"Condition name not specified, can be a hard error");
1969 const char* separ = strrchr(fullname,
'/');
1971 condname = separ + 1;
1972 foldername.Append(fullname, separ - fullname);
1974 condname = fullname;
1987 wcond->
SetValues(xmin, xmax, ymin, ymax);
1991 if (foldername.Length() > 0)
2003 Double_t (*points) [2],
2004 const char* HistoName,
2008 TString foldername, condname;
2010 if ((fullname==0) || (strlen(fullname)==0)) {
2011 TGo4Log::Error(
"Condition name not specified, can be a hard error");
2014 const char* separ = strrchr(fullname,
'/');
2016 condname = separ + 1;
2017 foldername.Append(fullname, separ - fullname);
2019 condname = fullname;
2031 TArrayD fullx(npoints+1), fully(npoints+1);
2033 for (
int i=0;i<npoints;i++) {
2034 fullx[i] = points[i][0];
2035 fully[i] = points[i][1];
2039 if ((fullx[0]!=fullx[npoints-1]) || (fully[0]!=fully[npoints-1])) {
2040 fullx[npoints] = fullx[0];
2041 fully[npoints] = fully[0];
2045 TCutG mycat(
"initialcut", npoints, fullx.GetArray(), fully.GetArray());
2051 pcond->SetValues(&mycat);
2054 pcond->SetHistogram(HistoName);
2056 if (foldername.Length() > 0)
2069 Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta,
2070 const char* HistoName)
2073 TString foldername, condname;
2075 if ((fullname==0) || (strlen(fullname)==0)) {
2076 TGo4Log::Error(
"Condition name not specified, can be a hard error");
2079 const char* separ = strrchr(fullname,
'/');
2081 condname = separ + 1;
2082 foldername.Append(fullname, separ - fullname);
2084 condname = fullname;
2097 econd->
SetEllipse(cx,cy,a1,a2,theta,npoints);
2100 if (foldername.Length() > 0)
2112 Int_t npoints, Double_t cx, Double_t cy, Double_t r,
2113 const char* HistoName)
2121 const char* HistoName)
2132 Double_t (*points) [2],
2133 const char* HistoName)
2144 const char* classname,
2148 TString foldername, paramname;
2150 if ((fullname==0) || (strlen(fullname)==0)) {
2151 TGo4Log::Error(
"Parameter name not specified, can be a hard error");
2154 const char* separ = strrchr(fullname,
'/');
2156 paramname = separ + 1;
2157 foldername.Append(fullname, separ - fullname);
2159 paramname = fullname;
2164 if (!param->InheritsFrom(classname)) {
2165 TGo4Log::Info(
"There is parameter %s with type %s other than specified %s, rebuild",
2166 fullname, param->ClassName(), classname);
2173 paramname = TString(
"\"") + paramname + TString(
"\"");
2176 if ((newcmd!=0) && (strstr(newcmd,
"new ")==newcmd))
2177 cmd = TString::Format(newcmd, paramname.Data());
2179 cmd = TString::Format(
"new %s(%s)", classname, paramname.Data());
2181 Long_t res = gROOT->ProcessLineFast(cmd.Data());
2184 TGo4Log::Error(
"Cannot create parameter of class %s", classname);
2190 if (foldername.Length() > 0)
2198 if ((newcmd!=0) && (strstr(newcmd,
"set_")==newcmd)) {
2209 if ((macro_name==0) || (strlen(macro_name)==0))
return -1;
2212 TString file_name(macro_name);
2213 Ssiz_t pos = file_name.First(
'(');
2214 if (pos>0) file_name.Resize(pos);
2215 pos = file_name.First(
'+');
2216 if (pos>0) file_name.Resize(pos);
2217 while ((file_name.Length()>0) && (file_name[file_name.Length()-1] ==
' '))
2218 file_name.Resize(file_name.Length()-1);
2219 while ((file_name.Length()>0) && (file_name[0]==
' '))
2220 file_name.Remove(0, 1);
2222 if (gSystem->AccessPathName(file_name.Data())) {
2228 return gROOT->ProcessLineSync(Form(
".x %s", macro_name));
2233 if ((macro_name==0) || (strlen(macro_name)==0))
return -1;
2234 TString comstring=macro_name;
2245 comstring = command;
2246 comstring = comstring.Strip(TString::kBoth);
2248 comstring = comstring.Strip(TString::kLeading);
2250 comstring =
"TPython::LoadMacro(\"" + comstring +
"\")";
2255 comstring.Prepend(
"TPython::LoadMacro(\"" + go4sys + pyinit +
"\");");
2256 comstring.Prepend(
"TPython::Bind(go4, \"go4\");" );
2261 const char* cursor = command;
2265 Ssiz_t len=strlen(cursor);
2266 at = strstr(cursor,
"@");
2270 len=(Ssiz_t) (at-cursor);
2271 comstring.Append(cursor,len);
2272 comstring.Append(
"TGo4Analysis::Instance()->");
2278 comstring.Append(cursor);
2284 return gROOT->ProcessLineSync(comstring, errcode);
2319 Message(2, TString::Format(
"Analysis %s was not initialized! Please SUBMIT settings first.",
GetName()));
2328 #include "windows.h"
2333 static BOOL Go4ConsoleSigHandler(DWORD sig)
2342 case CTRL_BREAK_EVENT:
2343 case CTRL_LOGOFF_EVENT:
2344 case CTRL_SHUTDOWN_EVENT:
2345 case CTRL_CLOSE_EVENT:
2347 printf(
" non CTRL-C signal - ignore\n");
2352 void InstallGo4CtrlCHandler(
bool on)
2354 ::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)