GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4AnalysisObjectManager.h
Go to the documentation of this file.
1 // $Id: TGo4AnalysisObjectManager.h 1566 2015-06-16 06:42:45Z 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 für 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 #include "Htypes.h"
19 
20 class TCanvas;
21 class TTree;
22 class TMutex;
23 class TFolder;
24 class TH1;
25 class TH2;
26 class TFile;
27 class TDirectory;
28 class TIterator;
29 
30 class TGo4EventElement;
31 class TGo4EventProcessor;
32 class TGo4EventSource;
33 class TGo4EventStore;
34 class TGo4ObjectStatus;
35 class TGo4TreeStructure;
36 class TGo4CompositeEvent;
37 class TObjArray;
38 class TGo4Condition;
39 class TGo4WinCond;
40 class TGo4PolyCond;
42 class TGo4DynamicEntry;
43 class TGo4MbsHist;
44 class TGo4Picture;
45 class TGo4Parameter;
47 
55 #ifdef __CINT__
56 class TGo4AnalysisObjectManager : public TNamed {
57 #else
58 #ifdef GO4_EXPORT
59 class __declspec(dllimport) TGo4AnalysisObjectManager : public TNamed {
60 #else
61 class TGo4AnalysisObjectManager : public TNamed {
62 #endif
63 #endif
64 
65  public:
66 
68 
69  TGo4AnalysisObjectManager(const char* name);
70 
72 
81  Bool_t AddObject(TNamed * anything, const char* subfolder=0, Bool_t replace=kTRUE);
82 
90  TNamed * GetObject(const char * name, const char* folder=0);
91 
99  TObject* GetAsTObject(const char * name, const char* folder=0);
100 
101 
107  Bool_t RemoveObject(const char * name, Bool_t del=kTRUE);
108 
109 
110 
117  Bool_t DeleteObjects(const char * name);
118 
127  TObject* NextMatchingObject(const char* expr,
128  const char* folder,
129  Bool_t reset);
130 
138  TFolder * CreateBranchFolder(TObjArray* branchlist,
139  const char* name,
140  const char* title,
141  Bool_t istopbranch=kFALSE);
142 
150  TFolder * CreateCompositeBranchFolder(TObjArray* branchlist,
151  TGo4CompositeEvent* compevent,
152  Int_t startindex, Int_t* skip,
153  const char* name, const char* title);
154 
159  TGo4TreeStructure * CreateTreeStructure(TTree * thetree);
160 
162  TGo4TreeStructure * CreateTreeStructure(const char* treename);
163 
165  TFolder* CreateMembersFolder(TObject* obj, const char* membrfoldername, TClass* cl);
166 
167 
172  Bool_t AddHistogram(TH1 * his, const char* subfolder=0, Bool_t replace=kTRUE);
173 
177  TH1* GetHistogram(const char * name);
178 
185  Bool_t RemoveHistogram(const char * name, Bool_t del=kTRUE);
186 
204  TH1* MakeTH1(const char* histotype,
205  const char* foldername,
206  const char* histoname,
207  Int_t nbinsx,
208  Axis_t xlow,
209  Axis_t xup,
210  const char* title = 0,
211  const char* xtitle = 0,
212  const char* ytitle = 0);
213 
234  TH2* MakeTH2(const char* histotype,
235  const char* foldername,
236  const char* histoname,
237  Int_t nbinsx,
238  Axis_t xlow,
239  Axis_t xup,
240  Int_t nbinsy,
241  Axis_t ylow,
242  Axis_t yup,
243  const char* title = 0,
244  const char* xtitle = 0,
245  const char* ytitle = 0);
246 
253  Bool_t AddTree(TTree* tree, const char* subfolder=0);
254 
258  TTree * GetTree(const char * name);
259 
266  Bool_t RemoveTree(TTree * tree, const char* stepname=0);
267 
273  Bool_t AddAnalysisCondition(TGo4Condition * con, const char* subfolder=0);
274 
282  Bool_t SetAnalysisCondition(const char * name, TGo4Condition* con,
283  Bool_t counter=kTRUE, TFolder* parent=0);
284 
289  TGo4Condition * GetAnalysisCondition(const char * name, const char* cond_cl = 0);
290 
295  Bool_t RemoveAnalysisCondition(const char * name);
296 
311  TGo4WinCond* MakeWindowCond(const char* foldername,
312  const char* conditionname,
313  Double_t xlow,
314  Double_t xup,
315  const char* bindhistogram = 0,
316  Bool_t invert = kFALSE);
317 
334  TGo4WinCond* MakeWindowCond(const char* foldername,
335  const char* conditionname,
336  Double_t xlow,
337  Double_t xup,
338  Double_t ylow,
339  Double_t yup,
340  const char* bindhistogram = 0,
341  Bool_t invert = kFALSE);
342 
366  TGo4PolyCond* MakePolyCond(const char* foldername,
367  const char* conditionname,
368  Int_t size,
369  Float_t (*points)[2],
370  const char* bindhistogram = 0,
371  Bool_t invert = kFALSE);
377  Bool_t AddParameter(TGo4Parameter * par, const char* subfolder=0);
378 
386  Bool_t SetParameter(const char * name, TGo4Parameter * par, TFolder* parent=0);
387 
395  Bool_t SetParameterStatus(const char* name, TGo4ParameterStatus* par, TFolder* parent=0);
396 
400  TGo4Parameter * GetParameter(const char* name, const char* parameter_class = 0);
401 
406  Bool_t RemoveParameter(const char * name);
407 
413  Bool_t AddPicture(TGo4Picture * pic, const char* subfolder=0);
414 
422  Bool_t SetPicture(const char* name, TGo4Picture * pic, TFolder* parent=0);
423 
428  TGo4Picture * GetPicture(const char * name);
429 
434  Bool_t RemovePicture(const char * name);
435 
436 
442  Bool_t AddCanvas(TCanvas * can, const char* subfolder=0);
443 
448  TCanvas * GetCanvas(const char * name);
449 
454  Bool_t RemoveCanvas(const char * name);
455 
460  TGo4ObjectStatus * CreateObjectStatus(const char * name, const char* folder=0);
461 
464  TGo4ObjectStatus * CreateObjectStatus(TObject* ob, Bool_t fullinfo=kTRUE);
465 
466 
472 
478  TFolder * CreateNamesFolder(TFolder * objectfolder);
479 
483  TFolder * GetObjectFolder();
484 
488  Bool_t AddEventStore(TGo4EventStore * store);
489 
493  Bool_t RemoveEventStore(TGo4EventStore * store);
494 
498  Bool_t AddEventSource(TGo4EventSource * source);
499 
503  Bool_t RemoveEventSource(TGo4EventSource* source);
504 
509 
514 
518  Bool_t AddEventStructure(TGo4EventElement * ev);
519 
524 
528  TGo4EventElement * GetEventStructure(const char * name);
529 
533  Bool_t ResetBackStores(Bool_t clearflag=kFALSE);
534 
538  void CloseAnalysis();
539 
541  void SaveObjects(TFile* file);
542 
547  Bool_t LoadObjects(TFile* statusfile);
548 
550  Bool_t AddDynamicEntry(TGo4DynamicEntry* entry);
551 
553  void ResetCurrentDynList();
554 
557  void ProcessDynamicList();
558 
559  void SetDynListInterval(Int_t val) { fiDynListInterval=val; }
560 
561  Int_t GetDynListInterval() const { return fiDynListInterval; }
562 
575  Bool_t AddDynamicHistogram(const char* name,
576  const char* histo,
577  const char* hevx, const char* hmemx,
578  const char* hevy=0, const char* hmemy=0,
579  const char* hevz=0, const char* hmemz=0,
580  const char* condition=0,
581  const char* cevx=0, const char* cmemx=0,
582  const char* cevy=0, const char* cmemy=0);
583 
584 
585 
593  Bool_t AddTreeHistogram(const char* hisname, const char* treename, const char* varexp, const char* cutexp);
594 
599  void PrintHistograms(const char* expression=0);
600 
605  void PrintConditions(const char* expression=0);
606 
611  void PrintParameters(const char* expression=0);
612 
616  void PrintDynamicList();
617 
624  Bool_t ClearObjects(const char* name);
625 
626 
635  Bool_t ProtectObjects(const char* name, const Option_t* flags);
636 
643  Bool_t RemoveDynamicEntry(const char* entryname);
644 
648  TFolder* FindSubFolder(TFolder* parent, const char* subfolder, Bool_t create=kTRUE);
649 
651  Bool_t FindObjectPathName(TObject* obj, TString& pathname, TFolder* fold = 0);
652 
653  Bool_t CreatedInMake() const { return fbCreatedinMake; }
654 
656  virtual void RecursiveRemove(TObject* obj);
657 
659  static const char* fgcTOPDYNAMICLIST;
660 
662  static const char* fgcTOPFOLDER;
663 
665  static const char* fgcHISTFOLDER;
666 
668  static const char* fgcDYNFOLDER;
669 
671  static const char* fgcCONDFOLDER;
672 
674  static const char* fgcPARAFOLDER;
675 
677  static const char* fgcTREEFOLDER;
678 
680  static const char* fgcPICTFOLDER;
681 
683  static const char* fgcCANVFOLDER;
684 
686  static const char* fgcANALYSISFOLDER;
687 
689  static const char* fgcEVENTFOLDER;
690 
692  static const char* fgcSRCFOLDER;
693 
695  static const char* fgcSTOREFOLDER;
696 
698  static const char* fgcPROCFOLDER;
699 
701  static const char* fgcUSRFOLDER;
702 
704  static const char* fgcTMPFOLDER;
705 
706  private:
707 
711  TFolder * fxGo4Dir;
712 
713 
718  TFolder * fxHistogramDir;
719 
724  TFolder * fxConditionDir;
725 
729  TFolder * fxParameterDir;
730 
735  TFolder * fxDynListDir;
736 
740  TFolder * fxUserDir;
741 
745  TFolder * fxTreeDir;
746 
750  TFolder * fxPictureDir;
751 
755  TFolder * fxCanvasDir;
756 
760  TFolder * fxStoreDir;
761 
765  TFolder * fxSourceDir;
766 
770  TFolder * fxProcessorDir;
771 
775  TFolder * fxEventDir;
776 
780  TFolder * fxAnalysisDir;
781 
785  TFolder * fxTempFolder;
786 
790  TMutex * fxDirMutex;
791 
792 
796  TList * fxMatchList;
797 
799  TIterator * fxMatchIterator;
800 
801 
808 
813 
819 
827 
836  Bool_t AddObjectToFolder(TObject * ob,
837  TFolder* fold,
838  const char* subfolder=0,
839  Bool_t replace=kTRUE,
840  Bool_t uniquename=kFALSE,
841  Bool_t resetbits=kTRUE);
842 
849  Bool_t RemoveObjectFromFolder(const char* fullname, TFolder* fold, Bool_t isDel);
850 
856  Bool_t LoadFolder(TFolder* source, TFolder* destination, Bool_t replace=kFALSE);
857 
863  Bool_t LoadFolder(TDirectory* source, TFolder* destination, Bool_t replace=kFALSE);
864 
870  Bool_t PutToFolder(TObject* ob, TFolder* destination, Bool_t replace=kFALSE);
871 
872 
878  Bool_t SaveFolder(TFolder* source);
879 
885  void RemoveFromDir(TFolder* fold, TDirectory* dir);
886 
891  void AppendToDir(TObject* ob, TDirectory* dir);
892 
893 
899  Int_t PrintFolder(TFolder* fold, Option_t* opt, const char* expression=0);
900 
905  Bool_t ClearFolder(TFolder* fold);
906 
911  Bool_t ClearObject(TObject* ob);
912 
913 
918  Bool_t DeleteFolder(TFolder* fold);
919 
924  Bool_t DeleteObject(TObject* ob);
925 
926 
935  Bool_t ProtectFolder(TFolder* fold, const Option_t* flags);
936 
937 
946  Bool_t ProtectObject(TObject* ob, const Option_t* flags);
947 
948 
952  void CleanupDynamicLists(TObject* oldobject);
953 
957  TList* CreateObjectList(const char* expr, const char* folder=0);
958 
960  TList* CreateObjectList(const char* expr, TFolder* fold);
961 
963  Bool_t IsMatching(const char* string, const char* expression);
964 
968  TObject* FindObjectInFolder(TFolder* folder, const char* fullname);
969 
976  TObject* TestObject(TFolder* folder,
977  const char* &pathname,
978  const char* objectname,
979  const TClass* cl);
980 
981 };
982 
983 #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)
void RemoveFromDir(TFolder *fold, TDirectory *dir)
Bool_t ClearObjects(const char *name)
Bool_t DeleteObjects(const char *name)
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)
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)