GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4AnalysisObjectManager.h
Go to the documentation of this file.
1 // $Id: TGo4AnalysisObjectManager.h 2857 2020-05-18 14:01:48Z linev $
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 TGO4ANALYSISOBJECTMANAGER_H
15 #define TGO4ANALYSISOBJECTMANAGER_H
16 
17 #include "TNamed.h"
18 
19 class TCanvas;
20 class TTree;
21 class TMutex;
22 class TFolder;
23 class TH1;
24 class TH2;
25 class TFile;
26 class TDirectory;
27 class TIterator;
28 
29 class TGo4EventElement;
30 class TGo4EventProcessor;
31 class TGo4EventSource;
32 class TGo4EventStore;
33 class TGo4ObjectStatus;
34 class TGo4TreeStructure;
35 class TGo4CompositeEvent;
36 class TObjArray;
37 class TGo4Condition;
38 class TGo4WinCond;
39 class TGo4PolyCond;
41 class TGo4DynamicEntry;
42 class TGo4MbsHist;
43 class TGo4Picture;
44 class TGo4Parameter;
46 
54 class TGo4AnalysisObjectManager : public TNamed {
55 
56  public:
57 
59 
60  TGo4AnalysisObjectManager(const char* name);
61 
63 
72  Bool_t AddObject(TNamed * anything, const char* subfolder=0, Bool_t replace=kTRUE);
73 
81  TNamed * GetObject(const char * name, const char* folder=0);
82 
90  TObject* GetAsTObject(const char * name, const char* folder=0);
91 
92 
98  Bool_t RemoveObject(const char * name, Bool_t del=kTRUE);
99 
100 
101 
108  Bool_t DeleteObjects(const char * name);
109 
118  TObject* NextMatchingObject(const char* expr,
119  const char* folder,
120  Bool_t reset);
121 
129  TFolder * CreateBranchFolder(TObjArray* branchlist,
130  const char* name,
131  const char* title,
132  Bool_t istopbranch=kFALSE);
133 
141  TFolder * CreateCompositeBranchFolder(TObjArray* branchlist,
142  TGo4CompositeEvent* compevent,
143  Int_t startindex, Int_t* skip,
144  const char* name, const char* title);
145 
150  TGo4TreeStructure * CreateTreeStructure(TTree * thetree);
151 
153  TGo4TreeStructure * CreateTreeStructure(const char* treename);
154 
156  TFolder* CreateMembersFolder(TObject* obj, const char* membrfoldername, TClass* cl);
157 
158 
163  Bool_t AddHistogram(TH1 * his, const char* subfolder=0, Bool_t replace=kTRUE);
164 
168  TH1* GetHistogram(const char * name);
169 
176  Bool_t RemoveHistogram(const char * name, Bool_t del=kTRUE);
177 
195  TH1* MakeTH1(const char* histotype,
196  const char* foldername,
197  const char* histoname,
198  Int_t nbinsx,
199  Axis_t xlow,
200  Axis_t xup,
201  const char* title = 0,
202  const char* xtitle = 0,
203  const char* ytitle = 0);
204 
225  TH2* MakeTH2(const char* histotype,
226  const char* foldername,
227  const char* histoname,
228  Int_t nbinsx,
229  Axis_t xlow,
230  Axis_t xup,
231  Int_t nbinsy,
232  Axis_t ylow,
233  Axis_t yup,
234  const char* title = 0,
235  const char* xtitle = 0,
236  const char* ytitle = 0);
237 
244  Bool_t AddTree(TTree* tree, const char* subfolder=0);
245 
249  TTree * GetTree(const char * name);
250 
257  Bool_t RemoveTree(TTree * tree, const char* stepname=0);
258 
264  Bool_t AddAnalysisCondition(TGo4Condition * con, const char* subfolder=0);
265 
273  Bool_t SetAnalysisCondition(const char * name, TGo4Condition* con,
274  Bool_t counter=kTRUE, TFolder* parent=0);
275 
280  TGo4Condition * GetAnalysisCondition(const char * name, const char* cond_cl = 0);
281 
286  Bool_t RemoveAnalysisCondition(const char * name);
287 
302  TGo4WinCond* MakeWindowCond(const char* foldername,
303  const char* conditionname,
304  Double_t xlow,
305  Double_t xup,
306  const char* bindhistogram = 0,
307  Bool_t invert = kFALSE);
308 
325  TGo4WinCond* MakeWindowCond(const char* foldername,
326  const char* conditionname,
327  Double_t xlow,
328  Double_t xup,
329  Double_t ylow,
330  Double_t yup,
331  const char* bindhistogram = 0,
332  Bool_t invert = kFALSE);
333 
357  TGo4PolyCond* MakePolyCond(const char* foldername,
358  const char* conditionname,
359  Int_t size,
360  Float_t (*points)[2],
361  const char* bindhistogram = 0,
362  Bool_t invert = kFALSE);
368  Bool_t AddParameter(TGo4Parameter * par, const char* subfolder=0);
369 
377  Bool_t SetParameter(const char * name, TGo4Parameter * par, TFolder* parent=0);
378 
386  Bool_t SetParameterStatus(const char* name, TGo4ParameterStatus* par, TFolder* parent=0);
387 
391  TGo4Parameter * GetParameter(const char* name, const char* parameter_class = 0);
392 
397  Bool_t RemoveParameter(const char * name);
398 
404  Bool_t AddPicture(TGo4Picture * pic, const char* subfolder=0);
405 
413  Bool_t SetPicture(const char* name, TGo4Picture * pic, TFolder* parent=0);
414 
419  TGo4Picture * GetPicture(const char * name);
420 
425  Bool_t RemovePicture(const char * name);
426 
427 
433  Bool_t AddCanvas(TCanvas * can, const char* subfolder=0);
434 
439  TCanvas * GetCanvas(const char * name);
440 
445  Bool_t RemoveCanvas(const char * name);
446 
451  TGo4ObjectStatus * CreateObjectStatus(const char * name, const char* folder=0);
452 
455  TGo4ObjectStatus * CreateObjectStatus(TObject* ob, Bool_t fullinfo=kTRUE);
456 
457 
463 
469  TFolder * CreateNamesFolder(TFolder * objectfolder);
470 
474  TFolder * GetObjectFolder();
475 
479  Bool_t AddEventStore(TGo4EventStore * store);
480 
484  Bool_t RemoveEventStore(TGo4EventStore * store);
485 
489  Bool_t AddEventSource(TGo4EventSource * source);
490 
494  Bool_t RemoveEventSource(TGo4EventSource* source);
495 
500 
505 
509  Bool_t AddEventStructure(TGo4EventElement * ev);
510 
515 
519  TGo4EventElement * GetEventStructure(const char * name);
520 
524  Bool_t ResetBackStores(Bool_t clearflag=kFALSE);
525 
529  void CloseAnalysis();
530 
532  void SaveObjects(TFile* file);
533 
538  Bool_t LoadObjects(TFile* statusfile);
539 
541  Bool_t AddDynamicEntry(TGo4DynamicEntry* entry);
542 
544  void ResetCurrentDynList();
545 
548  void ProcessDynamicList();
549 
550  void SetDynListInterval(Int_t val) { fiDynListInterval=val; }
551 
552  Int_t GetDynListInterval() const { return fiDynListInterval; }
553 
566  Bool_t AddDynamicHistogram(const char* name,
567  const char* histo,
568  const char* hevx, const char* hmemx,
569  const char* hevy=0, const char* hmemy=0,
570  const char* hevz=0, const char* hmemz=0,
571  const char* condition=0,
572  const char* cevx=0, const char* cmemx=0,
573  const char* cevy=0, const char* cmemy=0);
574 
582  Bool_t AddTreeHistogram(const char* hisname, const char* treename, const char* varexp, const char* cutexp);
583 
588  void PrintHistograms(const char* expression=0);
589 
594  void PrintConditions(const char* expression=0);
595 
600  void PrintParameters(const char* expression=0);
601 
605  void PrintDynamicList();
606 
613  Bool_t ClearObjects(const char* name);
614 
615 
624  Bool_t ProtectObjects(const char* name, const Option_t* flags);
625 
632  Bool_t RemoveDynamicEntry(const char* entryname);
633 
637  TFolder* FindSubFolder(TFolder* parent, const char* subfolder, Bool_t create=kTRUE);
638 
640  Bool_t FindObjectPathName(TObject* obj, TString& pathname, TFolder* fold = 0);
641 
642  Bool_t CreatedInMake() const { return fbCreatedinMake; }
643 
645  void SetSortedOrder(Bool_t on = kTRUE) { fbSortedOrder = on; }
646 
648  Bool_t IsSortedOrder() const { return fbSortedOrder; }
649 
651  virtual void RecursiveRemove(TObject* obj);
652 
654  static const char* fgcTOPDYNAMICLIST;
655 
657  static const char* fgcTOPFOLDER;
658 
660  static const char* fgcHISTFOLDER;
661 
663  static const char* fgcDYNFOLDER;
664 
666  static const char* fgcCONDFOLDER;
667 
669  static const char* fgcPARAFOLDER;
670 
672  static const char* fgcTREEFOLDER;
673 
675  static const char* fgcPICTFOLDER;
676 
678  static const char* fgcCANVFOLDER;
679 
681  static const char* fgcANALYSISFOLDER;
682 
684  static const char* fgcEVENTFOLDER;
685 
687  static const char* fgcSRCFOLDER;
688 
690  static const char* fgcSTOREFOLDER;
691 
693  static const char* fgcPROCFOLDER;
694 
696  static const char* fgcUSRFOLDER;
697 
699  static const char* fgcTMPFOLDER;
700 
701  static const char* GetTOPDYNAMICLIST();
702  static const char* GetTOPFOLDER();
703  static const char* GetHISTFOLDER();
704  static const char* GetDYNFOLDER();
705  static const char* GetCONDFOLDER();
706  static const char* GetPARAFOLDER();
707  static const char* GetTREEFOLDER();
708  static const char* GetPICTFOLDER();
709  static const char* GetCANVFOLDER();
710  static const char* GetANALYSISFOLDER();
711  static const char* GetEVENTFOLDER();
712  static const char* GetSRCFOLDER();
713  static const char* GetSTOREFOLDER();
714  static const char* GetPROCFOLDER();
715  static const char* GetUSRFOLDER();
716  static const char* GetTMPFOLDER();
717 
718  private:
719 
723  TFolder * fxGo4Dir;
724 
725 
730  TFolder * fxHistogramDir;
731 
736  TFolder * fxConditionDir;
737 
741  TFolder * fxParameterDir;
742 
747  TFolder * fxDynListDir;
748 
752  TFolder * fxUserDir;
753 
757  TFolder * fxTreeDir;
758 
762  TFolder * fxPictureDir;
763 
767  TFolder * fxCanvasDir;
768 
772  TFolder * fxStoreDir;
773 
777  TFolder * fxSourceDir;
778 
782  TFolder * fxProcessorDir;
783 
787  TFolder * fxEventDir;
788 
792  TFolder * fxAnalysisDir;
793 
797  TFolder * fxTempFolder;
798 
802  TMutex * fxDirMutex;
803 
804 
808  TList * fxMatchList;
809 
811  TIterator * fxMatchIterator;
812 
813 
820 
825 
831 
839 
843  Bool_t fbSortedOrder;
844 
853  Bool_t AddObjectToFolder(TObject * ob,
854  TFolder* fold,
855  const char* subfolder=0,
856  Bool_t replace=kTRUE,
857  Bool_t uniquename=kFALSE,
858  Bool_t resetbits=kTRUE);
859 
866  Bool_t RemoveObjectFromFolder(const char* fullname, TFolder* fold, Bool_t isDel);
867 
873  Bool_t LoadFolder(TFolder* source, TFolder* destination, Bool_t replace=kFALSE);
874 
880  Bool_t LoadFolder(TDirectory* source, TFolder* destination, Bool_t replace=kFALSE);
881 
887  Bool_t PutToFolder(TObject* ob, TFolder* destination, Bool_t replace=kFALSE);
888 
889 
895  Bool_t SaveFolder(TFolder* source);
896 
902  void RemoveFromDir(TFolder* fold, TDirectory* dir);
903 
908  void AppendToDir(TObject* ob, TDirectory* dir);
909 
910 
916  Int_t PrintFolder(TFolder* fold, Option_t* opt, const char* expression=0);
917 
922  Bool_t ClearFolder(TFolder* fold);
923 
928  Bool_t ClearObject(TObject* ob);
929 
930 
935  Bool_t DeleteFolder(TFolder* fold);
936 
941  Bool_t DeleteObject(TObject* ob);
942 
943 
952  Bool_t ProtectFolder(TFolder* fold, const Option_t* flags);
953 
954 
963  Bool_t ProtectObject(TObject* ob, const Option_t* flags);
964 
965 
969  void CleanupDynamicLists(TObject* oldobject);
970 
974  TList* CreateObjectList(const char* expr, const char* folder=0);
975 
977  TList* CreateObjectList(const char* expr, TFolder* fold);
978 
980  Bool_t IsMatching(const char* string, const char* expression);
981 
985  TObject* FindObjectInFolder(TFolder* folder, const char* fullname);
986 
993  TObject* TestObject(TFolder* folder,
994  const char* &pathname,
995  const char* objectname,
996  const TClass* cl);
997 
998 };
999 
1000 #endif //TGO4ANALYSISOBJECTMANAGER_H
Bool_t SetParameter(const char *name, TGo4Parameter *par, TFolder *parent=0)
TGo4PolyCond * MakePolyCond(const char *foldername, const char *conditionname, Int_t size, Float_t(*points)[2], const char *bindhistogram=0, Bool_t invert=kFALSE)
Bool_t SetAnalysisCondition(const char *name, TGo4Condition *con, Bool_t counter=kTRUE, TFolder *parent=0)
TFolder * CreateCompositeBranchFolder(TObjArray *branchlist, TGo4CompositeEvent *compevent, Int_t startindex, Int_t *skip, const char *name, const char *title)
Bool_t ProtectObject(TObject *ob, const Option_t *flags)
Bool_t RemoveObjectFromFolder(const char *fullname, TFolder *fold, Bool_t isDel)
Bool_t RemoveEventProcessor(TGo4EventProcessor *pro)
Bool_t RemoveEventStructure(TGo4EventElement *ev)
Bool_t AddObject(TNamed *anything, const char *subfolder=0, Bool_t replace=kTRUE)
Bool_t AddDynamicEntry(TGo4DynamicEntry *entry)
TFolder * CreateBranchFolder(TObjArray *branchlist, const char *name, const char *title, Bool_t istopbranch=kFALSE)
Bool_t IsMatching(const char *string, const char *expression)
Bool_t RemovePicture(const char *name)
static const char * GetTOPDYNAMICLIST()
void RemoveFromDir(TFolder *fold, TDirectory *dir)
Bool_t ClearObjects(const char *name)
Bool_t DeleteObjects(const char *name)
void SetSortedOrder(Bool_t on=kTRUE)
Bool_t RemoveObject(const char *name, Bool_t del=kTRUE)
TGo4Picture * GetPicture(const char *name)
Bool_t AddCanvas(TCanvas *can, const char *subfolder=0)
Bool_t AddPicture(TGo4Picture *pic, const char *subfolder=0)
Bool_t RemoveDynamicEntry(const char *entryname)
TH1 * GetHistogram(const char *name)
Bool_t FindObjectPathName(TObject *obj, TString &pathname, TFolder *fold=0)
TList * CreateObjectList(const char *expr, const char *folder=0)
void PrintConditions(const char *expression=0)
Bool_t ProtectFolder(TFolder *fold, const Option_t *flags)
TGo4EventElement * GetEventStructure(const char *name)
Bool_t AddHistogram(TH1 *his, const char *subfolder=0, Bool_t replace=kTRUE)
Bool_t RemoveEventStore(TGo4EventStore *store)
Bool_t AddEventProcessor(TGo4EventProcessor *pro)
Bool_t AddEventSource(TGo4EventSource *source)
TObject * FindObjectInFolder(TFolder *folder, const char *fullname)
Bool_t AddAnalysisCondition(TGo4Condition *con, const char *subfolder=0)
TObject * TestObject(TFolder *folder, const char *&pathname, const char *objectname, const TClass *cl)
Bool_t PutToFolder(TObject *ob, TFolder *destination, Bool_t replace=kFALSE)
void PrintHistograms(const char *expression=0)
TH1 * MakeTH1(const char *histotype, const char *foldername, const char *histoname, Int_t nbinsx, Axis_t xlow, Axis_t xup, const char *title=0, const char *xtitle=0, const char *ytitle=0)
TFolder * CreateNamesFolder(TFolder *objectfolder)
Bool_t RemoveEventSource(TGo4EventSource *source)
TObject * GetAsTObject(const char *name, const char *folder=0)
void AppendToDir(TObject *ob, TDirectory *dir)
Bool_t RemoveCanvas(const char *name)
Bool_t AddEventStore(TGo4EventStore *store)
Bool_t AddParameter(TGo4Parameter *par, const char *subfolder=0)
TFolder * FindSubFolder(TFolder *parent, const char *subfolder, Bool_t create=kTRUE)
Bool_t RemoveTree(TTree *tree, const char *stepname=0)
Bool_t ResetBackStores(Bool_t clearflag=kFALSE)
Bool_t AddTree(TTree *tree, const char *subfolder=0)
TGo4Parameter * GetParameter(const char *name, const char *parameter_class=0)
TGo4AnalysisObjectNames * CreateNamesList()
TObject * NextMatchingObject(const char *expr, const char *folder, Bool_t reset)
TGo4Condition * GetAnalysisCondition(const char *name, const char *cond_cl=0)
Bool_t RemoveAnalysisCondition(const char *name)
void CleanupDynamicLists(TObject *oldobject)
Int_t PrintFolder(TFolder *fold, Option_t *opt, const char *expression=0)
Bool_t RemoveHistogram(const char *name, Bool_t del=kTRUE)
void PrintParameters(const char *expression=0)
TFolder * CreateMembersFolder(TObject *obj, const char *membrfoldername, TClass *cl)
TGo4ObjectStatus * CreateObjectStatus(const char *name, const char *folder=0)
Bool_t ProtectObjects(const char *name, const Option_t *flags)
Bool_t AddTreeHistogram(const char *hisname, const char *treename, const char *varexp, const char *cutexp)
TGo4WinCond * MakeWindowCond(const char *foldername, const char *conditionname, Double_t xlow, Double_t xup, const char *bindhistogram=0, Bool_t invert=kFALSE)
Bool_t SetPicture(const char *name, TGo4Picture *pic, TFolder *parent=0)
TNamed * GetObject(const char *name, const char *folder=0)
Bool_t RemoveParameter(const char *name)
Bool_t SetParameterStatus(const char *name, TGo4ParameterStatus *par, TFolder *parent=0)
static const char * GetANALYSISFOLDER()
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)
TH2 * MakeTH2(const char *histotype, const char *foldername, const char *histoname, Int_t nbinsx, Axis_t xlow, Axis_t xup, Int_t nbinsy, Axis_t ylow, Axis_t yup, const char *title=0, const char *xtitle=0, const char *ytitle=0)
Bool_t AddEventStructure(TGo4EventElement *ev)
Bool_t LoadObjects(TFile *statusfile)
TTree * GetTree(const char *name)
TGo4TreeStructure * CreateTreeStructure(TTree *thetree)
Bool_t LoadFolder(TFolder *source, TFolder *destination, Bool_t replace=kFALSE)
Bool_t AddObjectToFolder(TObject *ob, TFolder *fold, const char *subfolder=0, Bool_t replace=kTRUE, Bool_t uniquename=kFALSE, Bool_t resetbits=kTRUE)
TCanvas * GetCanvas(const char *name)
virtual void RecursiveRemove(TObject *obj)