GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4AnalysisImp.h
Go to the documentation of this file.
1// $Id$
2//-----------------------------------------------------------------------
3// The GSI Online Offline Object Oriented (Go4) Project
4// Experiment Data Processing at EE department, GSI
5//-----------------------------------------------------------------------
6// Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7// Planckstr. 1, 64291 Darmstadt, Germany
8// Contact: http://go4.gsi.de
9//-----------------------------------------------------------------------
10// This software can be used under the license agreements as stated
11// in Go4License.txt file which is part of the distribution.
12//-----------------------------------------------------------------------
13
14#ifndef TGO4ANALYSISIMP_H
15#define TGO4ANALYSISIMP_H
16
17#include "TObject.h"
18#include "TGo4CommandReceiver.h"
19#include "TString.h"
20
21class TH1;
22class TH2;
23class TTree;
24class TGraph;
25class TF1;
26class TCanvas;
27class TFolder;
28class TNamed;
29class TMutex;
30class TStopwatch;
31class TFile;
32
43class TGo4Condition;
44class TGo4WinCond;
45class TGo4PolyCond;
46class TGo4ShapedCond;
47class TGo4ListCond;
49class TGo4Parameter;
51class TGo4Picture;
52class TGo4Fitter;
58class TGo4EventStore;
59class TGo4EventSource;
64class TGo4Sniffer;
65class TGo4Ratemeter;
66
78
79class TGo4Analysis : public TObject, public TGo4CommandReceiver {
80
81 friend class TGo4AnalysisStep;
82 friend class TGo4AnalysisClient;
84 friend class TGo4ComGetNamesList;
85 friend class TGo4ComGetEnvelope;
86 friend class TGo4ComSetObject;
88 friend class TGo4HistogramServer;
90 friend class TGo4Sniffer;
91
92public:
93
95 static const Int_t fgiAUTOSAVECOUNTS;
96
98 static const Int_t fgiDYNLISTINTERVAL;
99
101 static const Int_t fgiMACROSTARTPOLL;
102
104 static const char *fgcDEFAULTFILENAME;
105
107 static const char *fgcDEFAULTSTATUSFILENAME;
108
110 static const char *fgcDEFAULTFILESUF;
111
113 static const char fgcPYPROMPT;
114
116 static const char *fgcPYINIT;
117
119 static TGo4Analysis *Instance();
120
122 static Bool_t Exists();
123
126 static Bool_t IsBatchMode();
127
130 static Bool_t IsClientMode();
131
134 static Bool_t IsServerMode();
135
141 static void SetRunningMode(int mode);
142
144 virtual ~TGo4Analysis();
145
147 const char *GetName() const override { return fAnalysisName.Data(); }
148
150 void SetAnalysisName(const char *name) { fAnalysisName = name; }
151
156 Int_t MainCycle();
157
160 Int_t PreLoop();
161
165 Int_t PostLoop();
166
172 Int_t Process();
173
179 virtual Int_t UserEventFunc();
180
183 virtual Int_t UserPreLoop();
184
187 virtual Int_t UserPostLoop();
188
195 Int_t RunImplicitLoop(Int_t times, Bool_t showrate = kFALSE,
196 Double_t process_event_interval = -1., Bool_t iswebserver = kFALSE);
197
200 virtual void CloseAnalysis();
201
206 virtual Bool_t InitEventClasses();
207
210
220 Bool_t AddDynamicHistogram(const char *name,
221 const char *histo,
222 const char *hevx, const char *hmemx,
223 const char *hevy = nullptr, const char *hmemy = nullptr,
224 const char *hevz = nullptr, const char *hmemz = nullptr,
225 const char *condition = nullptr,
226 const char *cevx = nullptr, const char *cmemx = nullptr,
227 const char *cevy = nullptr, const char *cmemy = nullptr);
228
234 Bool_t AddDynamicEntry(TGo4DynamicEntry *entry);
235
239 Bool_t RemoveDynamicEntry(const char *entryname, const char *listname = nullptr);
240
247 Bool_t AddObject(TNamed *anything, const char *subfolder = nullptr, Bool_t replace = kTRUE);
248
253 TNamed *GetObject(const char *name, const char *folder = nullptr);
254
259 Bool_t RemoveObject(const char *name, Bool_t del = kTRUE);
260
265 Bool_t DeleteObjects(const char *name);
266
271 Bool_t ClearObjects(const char *name);
272
280 Bool_t ProtectObjects(const char *name, const Option_t *flags);
281
286 Bool_t ResetBackStores(Bool_t clearflag = kFALSE);
287
295 TObject *NextMatchingObject(const char *expr = nullptr,
296 const char *folder = nullptr,
297 Bool_t reset = kFALSE);
298
300 TGo4TreeStructure *CreateTreeStructure(const char *treename);
301
305 Bool_t AddHistogram(TH1 *his, const char *subfolder = nullptr, Bool_t replace = kTRUE);
306
312 Bool_t AddTree(TTree *tree, const char *subfolder = nullptr);
313
318 Bool_t RemoveTree(TTree *tree, const char *stepname = nullptr);
319
324 Bool_t AddTreeHistogram(const char *hisname, const char *treename, const char *varexp, const char *cutexp);
325
327 TH1 *GetHistogram(const char *name);
328
330 TTree *GetTree(const char *name);
331
336 Bool_t RemoveHistogram(const char *name, Bool_t del = kTRUE);
337
341 Bool_t AddAnalysisCondition(TGo4Condition *con, const char *subfolder = nullptr);
342
348 Bool_t SetAnalysisCondition(const char *name, TGo4Condition *con, Bool_t counter = kTRUE);
349
353 TGo4Condition *GetAnalysisCondition(const char *name, const char *cond_cl = nullptr);
354
357 Bool_t RemoveAnalysisCondition(const char *name);
358
362 Bool_t AddParameter(TGo4Parameter *par, const char *subfolder = nullptr);
363
369 Bool_t SetParameter(const char *name, TGo4Parameter *par);
370
376 Bool_t SetParameterStatus(const char *name, TGo4ParameterStatus *par);
377
381 TGo4Parameter *GetParameter(const char *name, const char *parameter_class = nullptr);
382
386 Bool_t RemoveParameter(const char *name);
387
391 Bool_t AddPicture(TGo4Picture *pic, const char *subfolder = nullptr);
392
398 Bool_t SetPicture(const char *name, TGo4Picture *pic);
399
402 TGo4Picture *GetPicture(const char *name);
403
406 Bool_t RemovePicture(const char *name);
407
411 Bool_t AddCanvas(TCanvas *can, const char *subfolder = nullptr);
412
415 TCanvas *GetCanvas(const char *name);
416
419 Bool_t RemoveCanvas(const char *name);
420
424
428
432 TGo4ObjectStatus *CreateObjectStatus(const char *name, const char *folder = nullptr);
433
436
439 TFolder *GetObjectFolder();
440
443 void UpdateStatus(TGo4AnalysisStatus *state);
444
454 void SetStatus(TGo4AnalysisStatus *state);
455
458 Bool_t LoadStatus(const char *filename = nullptr);
459
463 Bool_t LoadObjects(const char *filename = nullptr);
464
466 Bool_t SaveStatus(const char *filename = nullptr);
467
471 void SetStepChecking(Bool_t on = kTRUE);
472
477 Bool_t SetFirstStep(const char *name);
478
484 Bool_t SetLastStep(const char *name);
485
497 Bool_t SetStepStorage(const char *name, Bool_t on);
498
502 Bool_t NewStepStore(const char *name, TGo4EventStoreParameter *par);
503
507 Bool_t NewStepSource(const char *name, TGo4EventSourceParameter *par);
508
512 Bool_t NewStepProcessor(const char *name, TGo4EventProcessorParameter *par);
513
515 void SetAutoSaveInterval(Int_t interval = 0) { fiAutoSaveInterval = interval; }
516
518 void SetAutoSaveFile(const char *filename = nullptr,
519 Bool_t overwrite = kFALSE,
520 Int_t compression = 5);
521
523 Bool_t IsAutoSaveFileName() const;
524
526 Int_t LockAutoSave();
527
529 Int_t UnLockAutoSave();
530
532 void SetAutoSave(Bool_t on = kTRUE) { fbAutoSaveOn = on; }
533
535 Bool_t IsAutoSaveOn() const { return fbAutoSaveOn; }
536
538 void SetAutoSaveFileChange(Bool_t on = kTRUE) { fbAutoSaveFileChange = on; }
539
543
545 Bool_t IsInitDone() const { return fbInitIsDone; }
546
551 Bool_t IsRunning() const;
552
556 void SetRunning(Bool_t on = kTRUE);
557
562 Int_t WaitForStart();
563
565 Int_t IsErrorStopEnabled() const;
566
568 void SetNewInputFile(Bool_t on = kTRUE) { fbNewInputFile = on; }
569
571 Bool_t IsNewInputFile() const { return fbNewInputFile; }
572
574 void SetInputFileName(const char *fname) { fxCurrentInputFileName = fname; }
575
577 const char *GetInputFileName() const { return fxCurrentInputFileName.Data(); }
578
580 const char *GetDefaultTestFileName() const { return fxDefaultTestFileName.Data(); }
581
583 void SetDynListInterval(Int_t val);
584
586 Int_t GetDynListInterval() const;
587
592 TGo4EventElement *GetInputEvent(const char *stepname) const;
593
599 TGo4EventElement *GetInputEvent(Int_t stepindex) const;
600
605 TGo4EventElement *GetOutputEvent(const char *stepname) const;
606
614 TGo4EventElement *GetOutputEvent(Int_t stepindex) const;
615
621
623 TGo4EventElement *GetEventStructure(const char *name) const;
624
633 void Message(Int_t prio, const char *text, ...)
634 #if defined(__GNUC__) && !defined(__CLING__)
635 __attribute__((format(printf, 3, 4)))
636 #endif
637 ;
638
641 void SendObjectToGUI(TObject *ob);
642
646 void StartObjectServer(const char *basename, const char *passwd);
647
649 void StopObjectServer();
650
653 void SetAdministratorPassword(const char *passwd);
654
657 void SetControllerPassword(const char *passwd);
658
661 void SetObserverPassword(const char *passwd);
662
664 void Print(Option_t *opt = "") const override;
665
667 void PrintHistograms(const char *expression = nullptr);
668
670 void PrintConditions(const char *expression = nullptr);
671
673 void PrintParameters(const char *expression = nullptr);
674
676 void PrintDynamicList();
677
683 void ShowEvent(const char *stepname, Bool_t isoutput = kTRUE);
684
689 Int_t StoreParameter(const char *name, TGo4Parameter *par);
690
695 Int_t StoreCondition(const char *name, TGo4Condition *con);
696
701 Int_t StoreFitter(const char *name, TGo4Fitter *fit);
702
707 Int_t StoreFolder(const char *stepname, TFolder *folder);
708
712 Int_t StoreFolder(const char *stepname, const char *foldername);
713
716 void AutoSave();
717
726 Bool_t AddAnalysisStep(TGo4AnalysisStep *next);
727
730 TGo4AnalysisStep *GetAnalysisStep(const char *name);
731
734
736 void DefineServerPasswords(const char *admin, const char *controller, const char *observer);
737
739 void SetBatchLoopCount(Int_t cnt = -1) { fBatchLoopCount = cnt; }
740
742 void SetMakeWithAutosave(Bool_t on = kTRUE) { fbMakeWithAutosave = on; }
743
746 Bool_t IsObjMade() const { return fbObjMade; }
747
765 TH1 *MakeTH1(char type, const char *fullname, const char *title,
766 Int_t nbinsx, Double_t xlow, Double_t xup,
767 const char *xtitle = nullptr, const char *ytitle = nullptr);
768
790 TH2 *MakeTH2(char type, const char *fullname, const char *title,
791 Int_t nbinsx, Double_t xlow, Double_t xup,
792 Int_t nbinsy, Double_t ylow, Double_t yup,
793 const char *xtitle = nullptr, const char *ytitle = nullptr, const char *ztitle = nullptr);
794
800 TGo4WinCond *MakeWinCond(const char *fullname,
801 Double_t xmin, Double_t xmax,
802 const char *HistoName = nullptr);
803
811 TGo4WinCond *MakeWinCond(const char *fullname,
812 Double_t xmin, Double_t xmax,
813 Double_t ymin, Double_t ymax,
814 const char *HistoName = nullptr);
815
827 TGo4PolyCond *MakePolyCond(const char *fullname,
828 Int_t npoints,
829 Double_t (*points) [2],
830 const char *HistoName = nullptr,
831 Bool_t shapedcond = kFALSE);
832
842 TGo4ShapedCond *MakeEllipseCond(const char *fullname,
843 Int_t npoints,
844 Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta = 0.,
845 const char *HistoName = nullptr);
846
854 TGo4ShapedCond *MakeCircleCond(const char *fullname,
855 Int_t npoints, Double_t cx, Double_t cy, Double_t r,
856 const char *HistoName = nullptr);
857
866 TGo4ShapedCond *MakeBoxCond(const char *fullname, Double_t cx, Double_t cy,
867 Double_t a1, Double_t a2, Double_t theta,
868 const char *HistoName = nullptr);
869
882 TGo4ShapedCond *MakeFreeShapeCond(const char *fullname, Int_t npoints,
883 Double_t (*points)[2], const char *HistoName = nullptr);
884
891 TGo4ListCond *MakeListCond(const char *fullname, const Int_t num,
892 const Int_t *values, const char *HistoName = nullptr);
893
901 TGo4ListCond *MakeListCond(const char *fullname, const Int_t start,
902 const Int_t stop, const Int_t step = 1, const char *HistoName = nullptr);
903
908 TGo4ListCond *MakeListCond(const char *fullname, const char *title,
909 const char *HistoName = nullptr);
910
915 TGraph *MakeGraph(const char *fullname, const char *title, Int_t points = 0,
916 Double_t *xvalues = nullptr, Double_t *yvalues = nullptr);
917
921 TGraph *MakeGraph(const char *fullname, const char *title, TF1 *function);
922
927 TGo4RollingGraph *MakeRollingGraph(const char *fullname, const char *title, Int_t points = 0, Int_t average = 1);
928
940 TGo4Parameter *MakeParameter(const char *fullname,
941 const char *classname,
942 const char *cmd = nullptr);
943
945 void SetSortedOrder(Bool_t on = kTRUE);
946
948 Bool_t IsSortedOrder() const;
949
952 Long64_t ExecuteScript(const char *script_name);
953
957 Long64_t ExecutePython(const char *script_name, Int_t *errcode = nullptr);
958
964 Long64_t ExecuteLine(const char *command, Int_t *errcode = nullptr);
965
967 void ProcessCrtlCSignal();
968
970 void SetSniffer(TGo4AnalysisSniffer *sniff) { fSniffer = sniff; }
971
974
977
979 void StopAnalysis();
980
982 void StartAnalysis();
983
985 void ProcessEvents();
986
987protected:
988
991 Bool_t fbInitIsDone{kFALSE};
992
995 Bool_t fbAutoSaveOn{kFALSE};
996
998 TGo4Analysis(const char *name = nullptr);
999
1001 TGo4Analysis(int argc, char **argv);
1002
1004 void Constructor();
1005
1012 Int_t ProcessAnalysisSteps();
1013
1014private:
1015
1018 Bool_t EvaluateFolderpath(const char *fullname, TString &object, TString &folder);
1019
1026 TTree *CreateSingleEventTree(const char *name, Bool_t isoutput = kTRUE);
1027
1030
1032 void UpdateNamesList();
1033
1037
1041 void SetOutputEvent(TGo4EventElement *event);
1042
1045 Bool_t AddEventStore(TGo4EventStore *store);
1046
1048 Bool_t RemoveEventStore(TGo4EventStore *store);
1049
1052 Bool_t AddEventSource(TGo4EventSource *source);
1053
1055 Bool_t RemoveEventSource(TGo4EventSource *source);
1056
1060
1063
1067
1070
1073
1078 void SendMessageToGUI(Int_t level, Bool_t printout, const char *text);
1079
1081 void OpenAutoSaveFile(bool for_writing = false);
1082
1084 void CloseAutoSaveFile();
1085
1088
1090 Bool_t IsStopWorking() const { return fxDoWorkingFlag == flagStop; }
1091
1093 void ShutdownServer();
1094
1097
1101 static Bool_t fbExists;
1102
1105 static Int_t fiRunningMode;
1106
1109
1113
1117
1120
1122 TStopwatch *fxAutoSaveClock{nullptr};
1123
1128
1131
1135 TMutex *fxAutoSaveMutex{nullptr};
1136
1138 TFile *fxAutoFile{nullptr};
1139
1142
1144 Bool_t fbAutoSaveOverwrite{kFALSE};
1145
1148
1151 Bool_t fbNewInputFile{kFALSE};
1152
1155
1158 Bool_t fbAutoSaveFileChange{kFALSE};
1159
1163
1167
1170
1173
1176
1179
1182
1185
1188
1190 Bool_t fbMakeWithAutosave{kFALSE};
1191
1193 Bool_t fbObjMade{kFALSE};
1194
1196 Bool_t fbPythonBound{kFALSE};
1197
1199 Int_t fNumCtrlC{0};
1200
1203
1206
1209
1210 ClassDefOverride(TGo4Analysis,5)
1211};
1212
1213#endif
TGraph * MakeGraph()
Definition Example12.cxx:45
This object is responsible for the organization of analysis objects.
Contains the name (key) list of all objects in the analysis scope.
Object to sniff Go4 analysis It can obtain different events like log messages, ratemeter changes and ...
Status of the analysis instance.
This object is responsible for the organisation of analysis steps.
Contains a single step of the analysis.
Subclass of TGo4AnalysisStatus that has UpdateFromURL method the only reason for this subclass is to ...
TGo4ShapedCond * MakeFreeShapeCond(const char *fullname, Int_t npoints, Double_t(*points)[2], const char *HistoName=nullptr)
Create free shaped (polygon) condition.
TGo4EventElement * fxSampleEvent
this holds event sample for the SingleEventTree.
Bool_t RemoveDynamicEntry(const char *entryname, const char *listname=nullptr)
Remove entry of that name from dynamic list of listname.
Bool_t fbAutoSaveFileChange
True if autosave name shall be changed when input file of multiple file input has changed.
TObject * NextMatchingObject(const char *expr=nullptr, const char *folder=nullptr, Bool_t reset=kFALSE)
Delivers pointer to next object of the Go4 folder structure with a name matching the expression expr.
TGo4EventElement * GetInputEvent(const char *stepname) const
Returns the input event structure of analysis step.
TString fxDefaultTestFileName
default file name for distributed test lmd file
TGo4ListCond * MakeListCond(const char *fullname, const Int_t num, const Int_t *values, const char *HistoName=nullptr)
Create "whitlelist" condition with separate values to test against condition is true if any of the va...
void UpdateStatus(TGo4AnalysisStatus *state)
Create a copy of the analysis internal state.
void SetAutoSaveFileChange(Bool_t on=kTRUE)
Set analysis in mode where autosave file switches for each new input file.
static const char * fgcPYINIT
default name of go4 python init script
friend class TGo4ComGetEnvelope
Bool_t IsStopWorking() const
Returns true when event loop execution was stopped, only in batch mode.
Bool_t fbAutoSaveOn
True if Autosaving is enabled (default).
TGo4AnalysisStep * GetAnalysisStepNum(Int_t number)
Access to certain analysis step by number.
virtual Int_t UserPreLoop()
User defined function called once before processing the main event loop.
static const char * fgcDEFAULTFILENAME
standard file name
Bool_t fbInitIsDone
True if analysis framework has been initialized and the event classes are created.
TGo4ShapedCond * MakeCircleCond(const char *fullname, Int_t npoints, Double_t cx, Double_t cy, Double_t r, const char *HistoName=nullptr)
Create circular shaped polygon condition.
TGo4Analysis(const char *name=nullptr)
Protected constructor for singleton instance.
TFolder * GetObjectFolder()
Access to top level go4 folder.
static TGo4Analysis * Instance()
return analysis instance
Bool_t IsObjMade() const
Returns kTRUE if object in last Make... call was created, kFALSE when object was retrieved from autos...
Int_t GetDynListInterval() const
Returns current dynamic list interval.
Bool_t fbPythonBound
If true, pyroot has already bound TGo4Analysis object.
TGo4AnalysisObjectManager * ObjectManager() const
Returns pointer on analysis object manager.
Long64_t ExecuteScript(const char *script_name)
Executes ROOT script.
virtual void CloseAnalysis()
Finish the analysis run and close all event sources/storages.
Bool_t RemoveObject(const char *name, Bool_t del=kTRUE)
Removes object from user object folder by name.
void Message(Int_t prio, const char *text,...)
Display a user message.
Int_t PostLoop()
Method executed once after the main analysis event loop.
TGo4EventElement * GetEventStructure(const char *name) const
Search reference to event structure in folder.
Bool_t SetAnalysisCondition(const char *name, TGo4Condition *con, Bool_t counter=kTRUE)
Set existing analysis condition of name to the values of external condition object con.
TGo4Parameter * MakeParameter(const char *fullname, const char *classname, const char *cmd=nullptr)
Create parameter of specified class,.
friend class TGo4AnalysisWebStatus
TCanvas * GetCanvas(const char *name)
Retrieves a TCanvas by name from the Canvases folder.
friend class TGo4Sniffer
TNamed * GetObject(const char *name, const char *folder=nullptr)
Searches for object by name in all directories.
void PrintHistograms(const char *expression=nullptr)
Printout of all histogram statistic counters on the terminal.
TH2 * MakeTH2(char type, const char *fullname, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy, Double_t ylow, Double_t yup, const char *xtitle=nullptr, const char *ytitle=nullptr, const char *ztitle=nullptr)
Create two dimensional histogram of specified type.
Bool_t SetParameter(const char *name, TGo4Parameter *par)
Set existing parameter of name to the values of external parameter object par.
static const Int_t fgiMACROSTARTPOLL
Time in ms to sleep in the polling loop of the WaitForStart.
TGo4WinCond * MakeWinCond(const char *fullname, Double_t xmin, Double_t xmax, const char *HistoName=nullptr)
Create 1D window condition.
static const char fgcPYPROMPT
leading character indicating python script execution
void SetNewInputFile(Bool_t on=kTRUE)
Set flag that input file has changed.
Bool_t IsSortedOrder() const
Returns true if sub-folders will be created in sorted order.
Bool_t RemoveHistogram(const char *name, Bool_t del=kTRUE)
Removes histogram from histogram dir by name.
void SetOutputEvent(TGo4EventElement *event)
Sets the current output event (detector) structure.
TGo4PolyCond * MakePolyCond(const char *fullname, Int_t npoints, Double_t(*points)[2], const char *HistoName=nullptr, Bool_t shapedcond=kFALSE)
Create polygon condition.
Bool_t AddAnalysisCondition(TGo4Condition *con, const char *subfolder=nullptr)
Puts a new analysis condition object in corresponding list.
virtual Bool_t InitEventClasses()
Initialization of the event class plugins which are delivered from the user defined event factory.
friend class TGo4HistogramServer
Bool_t SaveStatus(const char *filename=nullptr)
Save current analysis settings into file of given name.
TString fAnalysisName
name of analysis object
Bool_t AddDynamicEntry(TGo4DynamicEntry *entry)
Set dynamic entry of name "name" to the values specified by external dynamic entry status "state".
TGo4AnalysisWebStatus * CreateWebStatus()
Create a copy of the analysis internal state.
Int_t StoreFolder(const char *stepname, TFolder *folder)
Write folder into eventstore of the step specified by name.
void StartAnalysis()
(Re)Start analysis event loop, works in both batch and gui-controlled mode
TGo4AnalysisSniffer * fSniffer
Sniffer object.
Bool_t ClearObjects(const char *name)
Clear (reset) the specified objects.
Int_t fBatchLoopCount
exact number of loop counts in batch mode
TGo4AnalysisStepManager * fxStepManager
aggregationByValue 1
void SetAnalysisName(const char *name)
Set analysis name.
static const Int_t fgiAUTOSAVECOUNTS
Definition of default autosave interval.
void SetAnalysisClient(TGo4AnalysisClient *cli)
Register analysis client if running in gui mode.
Int_t IsErrorStopEnabled() const
True if current analysis step allows stop on error.
void StopAnalysis()
Stop analysis event loop, works in both batch and gui-controlled mode.
Int_t MainCycle()
The main analysis event cycle.
void SetSniffer(TGo4AnalysisSniffer *sniff)
Set pointer on sniffer object.
Bool_t NewStepStore(const char *name, TGo4EventStoreParameter *par)
Shuts down the old analysis step storage and creates a new one specified by parameter par.
void SetAutoSave(Bool_t on=kTRUE)
Enable/disable functionality of AutoSave method.
Bool_t IsAutoSaveFileChange() const
True if autosave file is changed according to the current input file of lmd file list.
friend class TGo4HisConnectorRunnable
static Bool_t IsClientMode()
is client mode
TStopwatch * fxAutoSaveClock
Clock for autosave by time mechanism.
void SetMakeWithAutosave(Bool_t on=kTRUE)
Set flag to use data from autosave file in Make... methods (default true)
TString fxCurrentInputFileName
Contains current input file name.
Bool_t AddPicture(TGo4Picture *pic, const char *subfolder=nullptr)
Puts a new picture object in corresponding folder.
TGo4ObjectStatus * CreateObjectStatus(const char *name, const char *folder=nullptr)
Find Object of name in the folder structure and create a complete status object of it.
void DefineServerPasswords(const char *admin, const char *controller, const char *observer)
Define passwords, which should be used for analysis access when analysis runs in server mode.
TGo4AnalysisStep * GetAnalysisStep(const char *name)
Access to certain analysis step by name.
void OpenAutoSaveFile(bool for_writing=false)
Open the autosave file with the current settings.
friend class TGo4ComGetNamesList
void AutoSave()
Perform autosave of all active stores, save existing calibration objects, write known objects into us...
Int_t StoreFitter(const char *name, TGo4Fitter *fit)
Write fitter fit into eventstore of the step specified by name.
void ShowEvent(const char *stepname, Bool_t isoutput=kTRUE)
Printout event content of single current event to analysis terminal (using ROOT TTree::Show method).
TGo4EventElement * GetOutputEvent() const
Returns the output event (detector) structure of analysis step.
Bool_t AddObject(TNamed *anything, const char *subfolder=nullptr, Bool_t replace=kTRUE)
Add any external object to the user object folder.
friend class TGo4AnalysisStep
Bool_t AddParameter(TGo4Parameter *par, const char *subfolder=nullptr)
Puts a new parameter object in corresponding folder.
Bool_t RemoveCanvas(const char *name)
Removes TCanvas by name.
Int_t UnLockAutoSave()
UnLock the autosave mutex.
friend class TGo4AnalysisClient
static const char * fgcDEFAULTFILESUF
filename suffix for object file
Int_t ProcessAnalysisSteps()
Process steps.
TH1 * GetHistogram(const char *name)
Search histogram in histogram list (directory).
void PrintParameters(const char *expression=nullptr)
Printout of all parameters on the terminal.
TFile * fxAutoFile
Optional file for autosave of the important objects.
Int_t Process()
This method is meant to be called from a go4 cintserver macro in an explicit event loop.
static void SetRunningMode(int mode)
Set analysis running mode.
void SetAutoSaveFile(const char *filename=nullptr, Bool_t overwrite=kFALSE, Int_t compression=5)
Set file for autosave action.
Bool_t RemovePicture(const char *name)
Removes picture by name.
static Bool_t IsBatchMode()
is batch mode
void SetControllerPassword(const char *passwd)
Specify password for controller account.
void PrintDynamicList()
Print entries of current dynamic list.
Bool_t SetLastStep(const char *name)
Sets analysis step name as last one to be processed in the chain of steps.
Bool_t fbObjMade
indicate if object was created by last Make... operation
void ProcessEvents()
Method should be called to process extra events in the analysis thread context.
Bool_t AddEventStructure(TGo4EventElement *ev)
Add reference to event structure object to Go4 Folder structure.
static Bool_t Exists()
check if analysis instance exists
TGo4AnalysisObjectManager * fxObjectManager
aggregationByValue 1
TString fServerAdminPass
pre-configured password for administrator access
Bool_t RemoveEventStore(TGo4EventStore *store)
Remove reference to event store from go4 folder structure.
TGo4AnalysisSniffer * GetSniffer() const
Returns pointer on current sniffer.
void ShutdownServer()
for signal handler to shutdown analysis server, if existing
static const char * fgcDEFAULTSTATUSFILENAME
standard file name for analysis settings
Long64_t ExecuteLine(const char *command, Int_t *errcode=nullptr)
Process ROOT command line.
const char * GetInputFileName() const
Returns current input file name.
Int_t WaitForStart()
Poll on the IsRunning state with sleep delay, returns number of wait cycles.
const char * GetDefaultTestFileName() const
Returns default lmd test file name (in GO4SYS installation directory)
virtual Int_t UserEventFunc()
User defined function which processes the actual analysis.
void StopWorking()
Called by interrupt routine for normal exit from program (in batch mode)
Int_t StoreParameter(const char *name, TGo4Parameter *par)
Write object obj into eventstore of the step specified by name.
Bool_t SetParameterStatus(const char *name, TGo4ParameterStatus *par)
Set existing parameter of name to the values of external parameter status object.
Bool_t IsInitDone() const
True if the analysis steps are initialized.
Bool_t AddEventSource(TGo4EventSource *source)
Add reference to event source object to Go4 Folder structure.
Bool_t AddAnalysisStep(TGo4AnalysisStep *next)
Method for user analysis constructor to setup the list of analysis steps.
void StartObjectServer(const char *basename, const char *passwd)
Start the object (histogram) server.
void CloseAutoSaveFile()
Close the autosave file if existing.
Bool_t RemoveEventStructure(TGo4EventElement *ev)
Remove reference to event structure from go4 folder structure.
void ProcessCrtlCSignal()
Method called from Ctrl-C handler.
TString fServerCtrlPass
pre-configured password for controller access
void SetObserverPassword(const char *passwd)
Specify password for observer account.
Long64_t ExecutePython(const char *script_name, Int_t *errcode=nullptr)
Executes Python script in ROOT interpreter.
void SetBatchLoopCount(Int_t cnt=-1)
Set number of event loop count, executed in batch mode.
static Bool_t fbExists
This is used to check from outside if an analysis is already there.
Bool_t SetPicture(const char *name, TGo4Picture *pic)
Set existing picture of name to the values of external picture object pic.
Bool_t SetStepStorage(const char *name, Bool_t on)
Enables analysis step of name to write its output event into its event store.
void StopObjectServer()
Stop the object (histogram) server.
Bool_t ProtectObjects(const char *name, const Option_t *flags)
Change protection properties of object name as specified.
Bool_t AddHistogram(TH1 *his, const char *subfolder=nullptr, Bool_t replace=kTRUE)
Add external histogram to go4 histogram directory.
Int_t LockAutoSave()
Lock the autosave mutex.
TGo4Ratemeter * fxRate
optional ratemeter object
const char * GetName() const override
Return analysis name.
Bool_t AddTreeHistogram(const char *hisname, const char *treename, const char *varexp, const char *cutexp)
Add Histogram into the dynamic list which is linked to a tree.
TGo4TreeStructure * CreateTreeStructure(const char *treename)
Create a tree structure for a certain tree by name.
TGo4RollingGraph * MakeRollingGraph(const char *fullname, const char *title, Int_t points=0, Int_t average=1)
Create a go4 rolling graph (generic trending plot) with properties points and average.
virtual Int_t UserPostLoop()
User defined function called once after processing the main event loop.
void PrintConditions(const char *expression=nullptr)
Print all condition counters to the terminal.
Bool_t NewStepSource(const char *name, TGo4EventSourceParameter *par)
Shuts down the old analysis step event source and creates a new one specified by parameter par.
TGo4AnalysisObjectNames * fxObjectNames
aggregation 1
void Constructor()
Method to create all necessary object in the real constructor.
Bool_t IsAutoSaveFileName() const
Return kTRUE, if autosave file name set.
void SetStepChecking(Bool_t on=kTRUE)
Enable or disable check of subsequent analysis step for io consistency.
Bool_t DeleteObjects(const char *name)
Delete object of name, or all objects in folder name, respectively.
TGo4Picture * GetPicture(const char *name)
Retrieves a picture object by name from the object folder.
Int_t PreLoop()
Method executed once before the main analysis event loop.
Int_t StoreCondition(const char *name, TGo4Condition *con)
Write condition con into eventstore of the step specified by name.
Bool_t fbNewInputFile
True if input file of multiple file input has changed.
TString fServerObserverPass
pre-configured password for observer access
Bool_t SetFirstStep(const char *name)
Sets analysis step name as first one to be processed in the chain of steps.
void SetStatus(TGo4AnalysisStatus *state)
Set all analysis parameters to that of given status object.
Bool_t AddTree(TTree *tree, const char *subfolder=nullptr)
Add reference to a tree in the go4 folder structure.
TTree * CreateSingleEventTree(const char *name, Bool_t isoutput=kTRUE)
Create a tree that is filled with one single event sample.
Bool_t IsNewInputFile() const
True if input filelist has changed to a new lmd file.
static Bool_t IsServerMode()
is server mode
static Int_t fiRunningMode
This is used to identify running mode of analysis: 0 - batch, 1 - client, 2 - server.
friend class TGo4ComSetObject
Bool_t AddCanvas(TCanvas *can, const char *subfolder=nullptr)
Puts a new TCanvas in corresponding folder.
static TGo4Analysis * fxInstance
Static Pointer to the analysis singleton instance.
Int_t fiAutoSaveInterval
Implicit Loop cycles in between two autosave actions.
Bool_t RemoveAnalysisCondition(const char *name)
Removes analysis condition from list by name.
TString fxAutoFileName
Name of the autosave file.
void SetDynListInterval(Int_t val)
Set current dynamic list interval.
TGo4ShapedCond * MakeBoxCond(const char *fullname, Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta, const char *HistoName=nullptr)
Create tilted rectangular box shaped polygon condition.
Bool_t AddEventStore(TGo4EventStore *store)
Add reference to event store object to Go4 Folder structure.
TGo4Condition * GetAnalysisCondition(const char *name, const char *cond_cl=nullptr)
Retrieves an analysis condition from list by name.
TGo4AnalysisClient * GetAnalysisClient() const
Returns pointer on analysis client.
static const Int_t fgiDYNLISTINTERVAL
This value is the number of events in between subsequent dynamic list processing.
Bool_t fbMakeWithAutosave
If false, do not use data from autosave file in Make... methods.
Bool_t fbAutoSaveOverwrite
True if autosave file is in overwrite mode.
TH1 * MakeTH1(char type, const char *fullname, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, const char *xtitle=nullptr, const char *ytitle=nullptr)
Create one dimensional histogram of specified type.
Bool_t AddEventProcessor(TGo4EventProcessor *pro)
Add reference to event processor object to Go4 Folder structure.
TGo4Parameter * GetParameter(const char *name, const char *parameter_class=nullptr)
Retrieves a parameter object by name from the object folder.
TMutex * fxAutoSaveMutex
Mutex protecting the autosave file access.
enum TGo4Analysis::@272117116030306307120057025105261037267163363177 fxDoWorkingFlag
Indicates analysis runstate.
void SetSortedOrder(Bool_t on=kTRUE)
Configure sorting order for newly created sub-folders.
Int_t fNumCtrlC
number Ctrl-C handler called
TGo4AnalysisObjectNames * CreateNamesList()
Creates a list of names (keys) of all objects in analysis directories.
Bool_t NewStepProcessor(const char *name, TGo4EventProcessorParameter *par)
Shuts down the old analysis step processor and creates a new one specified by parameter par.
Bool_t LoadStatus(const char *filename=nullptr)
Load Analysis Status from file and set analysis to these settings.
Bool_t IsAutoSaveOn() const
True if autosaving is enabled.
TString fxConfigFilename
name of configuration file used for this setup
void SetRunning(Bool_t on=kTRUE)
Switch slave process into running state.
Bool_t AddDynamicHistogram(const char *name, const char *histo, const char *hevx, const char *hmemx, const char *hevy=nullptr, const char *hmemy=nullptr, const char *hevz=nullptr, const char *hmemz=nullptr, const char *condition=nullptr, const char *cevx=nullptr, const char *cmemx=nullptr, const char *cevy=nullptr, const char *cmemy=nullptr)
Add (create) new dynamic histogram entry which connects an existing histogram with existing condition...
friend class TGo4ComGetCurrentEvent
Bool_t IsRunning() const
True if the analysis as controlled by slave process is running.
Bool_t RemoveEventProcessor(TGo4EventProcessor *pro)
Remove reference to event processor from go4 folder structure.
Bool_t RemoveTree(TTree *tree, const char *stepname=nullptr)
Remove reference to a tree in the go4 folder structure.
virtual ~TGo4Analysis()
destructor
Bool_t EvaluateFolderpath(const char *fullname, TString &object, TString &folder)
Helper function to figure out object name and folder path from full path.
void UpdateNamesList()
Update the internal list of object names.
TGo4AnalysisStatus * CreateStatus()
Create a copy of the analysis internal state.
TGo4ShapedCond * MakeEllipseCond(const char *fullname, Int_t npoints, Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta=0., const char *HistoName=nullptr)
Create ellipse shaped polygon condition.
TGo4AnalysisObjectNames * GetNamesList() const
Returns the nameslist of the go4 object directory structure.
void SetInputFileName(const char *fname)
Set current input file name.
void Print(Option_t *opt="") const override
Printout the analysis (step-) setup.
TGo4InterruptHandler * fxInterruptHandler
use to treat Ctrl-C interrupts
Bool_t ResetBackStores(Bool_t clearflag=kFALSE)
Clear previous events of backstore tree.
Bool_t RemoveParameter(const char *name)
Removes parameter by name.
Bool_t LoadObjects(const char *filename=nullptr)
Load analysis objects from file.
Int_t fiAutoSaveCount
Event counter for autosave mechanism.
void SetAdministratorPassword(const char *passwd)
Specify password for administrator account.
Int_t fiAutoSaveCompression
compression level for autosave file
void SendObjectToGUI(TObject *ob)
User May send any named object via data channel to the gui.
TTree * GetTree(const char *name)
Search tree in tree folder.
TGo4AnalysisClient * fxAnalysisSlave
Optional backpointer to analysis client if running in gui mode.
Bool_t RemoveEventSource(TGo4EventSource *source)
Remove reference to event source from go4 folder structure.
void SendMessageToGUI(Int_t level, Bool_t printout, const char *text)
Send message string in a status object to the gui.
Int_t RunImplicitLoop(Int_t times, Bool_t showrate=kFALSE, Double_t process_event_interval=-1., Bool_t iswebserver=kFALSE)
Processes the UserEventFunc in an implicit loop for "times" times.
void SetAutoSaveInterval(Int_t interval=0)
Set time interval (in s) for autosave action.
Go4 condition class.
ABC for all entries that can be kept in a dynamic list.
The abstract base class for the data elements of which the unpacked events (or detector structure dat...
Basic type for all classes containing information to parametrize the event processor.
Abstract event processor.
Basic type for all classes containing information to parameterize the event source.
Basic type for all classes containing information to parametrize the event store.
The abstract interface class for the raw event store.
Central class of Go4Fit package.
Definition TGo4Fitter.h:38
Runtime status of a histogram object.
Condition that checks a value against a list of "good" (or bad) values.
One entry of the object names folder.
Status object for an analysis parameter.
Base class for all parameter aggregations, e.g.
Picture cconfiguration in Go4.
Definition TGo4Picture.h:40
Polygon condition.
Class containing event counter and ratemeter services.
Graphs that renew themselves iteratively to monitor a value.
Shaped condition.
Contains the branchelement structure of a certain TTree on the analysis side.
Window condition.
Definition TGo4WinCond.h:26