Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4Analysis/TGo4AnalysisObjectManager.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #ifndef TGO4ANALYSISOBJECTMANAGER_H
00017 #define TGO4ANALYSISOBJECTMANAGER_H
00018 
00019 #include "TNamed.h"
00020 #include "TH1.h"
00021 
00022 class TCut;
00023 class TCanvas;
00024 class TTree;
00025 class TMutex;
00026 class TFolder;
00027 class TH2;
00028 
00029 class TGo4EventElement;
00030 class TGo4EventProcessor;
00031 class TGo4EventSource;
00032 class TGo4EventStore;
00033 class TGo4ObjectStatus;
00034 class TGo4TreeStructure;
00035 class TGo4CompositeEvent;
00036 class TObjArray;
00037 class TGo4EventDataIndex;
00038 class TGo4Condition;
00039 class TGo4WinCond;
00040 class TGo4PolyCond;
00041 class TGo4AnalysisObjectNames;
00042 class TGo4DynamicList;
00043 class TGo4DynamicEntry;
00044 class TGo4MbsHist;
00045 class TGo4Picture;
00046 class TGo4Parameter;
00047 class TGo4CanvasStatus;
00048 class TGo4HistogramEntryStatus;
00049 class TGo4DynamicEntryStatus;
00050 
00057 class TGo4AnalysisObjectManager : public TNamed
00058    {
00059    public:
00060 
00061       TGo4AnalysisObjectManager();
00062 
00063       TGo4AnalysisObjectManager(const Text_t* name);
00064 
00065       ~TGo4AnalysisObjectManager();
00066 
00075       Bool_t AddObject(TNamed * anything, const Text_t* subfolder=0, Bool_t replace=kTRUE);
00076 
00084       TNamed * GetObject(const Text_t * name, const Text_t* folder=0);
00085 
00091       Bool_t RemoveObject(const Text_t * name, Bool_t del=kTRUE);
00092 
00093 
00094 
00101       Bool_t DeleteObjects(const Text_t * name);
00102 
00111     TObject* NextMatchingObject(const Text_t* expr,
00112                                 const Text_t* folder,
00113                                 Bool_t reset);
00114 
00122       TFolder * CreateBranchFolder(TObjArray* branchlist,
00123                                       const Text_t* name, const Text_t* Title,
00124                                       Bool_t istopbranch=kFALSE);
00125 
00133       TFolder * CreateCompositeBranchFolder(TObjArray* branchlist,
00134                                               TGo4CompositeEvent* compevent,
00135                                               Int_t startindex, Int_t* skip,
00136                                               const Text_t* name, const Text_t* Title);
00137 
00142       TGo4TreeStructure * CreateTreeStructure(TTree * thetree);
00143 
00147       TGo4TreeStructure * CreateTreeStructure(const Text_t* treename);
00148 
00153       Bool_t AddHistogram(TH1 * his, const Text_t* subfolder=0, Bool_t replace=kTRUE);
00154 
00158       TH1* GetHistogram(const Text_t * name);
00159 
00166       Bool_t RemoveHistogram(const Text_t * name, Bool_t del=kTRUE);
00167 
00185       TH1* MakeH1(const Text_t* histotype,
00186                   const Text_t* foldername,
00187                   const Text_t* histoname,
00188                   Int_t         nbinsx,
00189                   Axis_t        xlow,
00190                   Axis_t        xup,
00191                   const Text_t* title = 0,
00192                   const Text_t* xtitle = 0,
00193                   const Text_t* ytitle = 0);
00194 
00215       TH2* MakeH2(const Text_t* histotype,
00216                   const Text_t* foldername,
00217                   const Text_t* histoname,
00218                   Int_t         nbinsx,
00219                   Axis_t        xlow,
00220                   Axis_t        xup,
00221                   Int_t         nbinsy,
00222                   Axis_t        ylow,
00223                   Axis_t        yup,
00224                   const Text_t* title = 0,
00225                   const Text_t* xtitle = 0,
00226                   const Text_t* ytitle = 0);
00227 
00234       Bool_t AddTree(TTree* tree, const Text_t* subfolder=0);
00235 
00239       TTree * GetTree(const Text_t * name);
00240 
00247       Bool_t RemoveTree(TTree * tree, const Text_t* stepname=0);
00248 
00254       Bool_t AddAnalysisCondition(TGo4Condition * con, const Text_t* subfolder=0);
00255 
00263       Bool_t SetAnalysisCondition(const Text_t * name, TGo4Condition* con,
00264                                       Bool_t counter=kTRUE, TFolder* parent=0);
00265 
00270       TGo4Condition * GetAnalysisCondition(const Text_t * name);
00271 
00276       Bool_t RemoveAnalysisCondition(const Text_t * name);
00277 
00292       TGo4WinCond* MakeWindowCond(const Text_t* foldername,
00293                                   const Text_t* conditionname,
00294                                   Double_t      xlow,
00295                                   Double_t      xup,
00296                                   const Text_t* bindhistogram = 0,
00297                                   Bool_t        invert = kFALSE);
00298 
00315       TGo4WinCond* MakeWindowCond(const Text_t* foldername,
00316                                   const Text_t* conditionname,
00317                                   Double_t      xlow,
00318                                   Double_t      xup,
00319                                   Double_t      ylow,
00320                                   Double_t      yup,
00321                                   const Text_t* bindhistogram = 0,
00322                                   Bool_t        invert = kFALSE);
00323 
00347       TGo4PolyCond* MakePolyCond(const Text_t* foldername,
00348                                  const Text_t* conditionname,
00349                                  Int_t         size,
00350                                  Float_t       (*points)[2],
00351                                  const Text_t* bindhistogram = 0,
00352                                  Bool_t        invert = kFALSE);
00358       Bool_t AddParameter(TGo4Parameter * par, const Text_t* subfolder=0);
00359 
00367       Bool_t SetParameter(const Text_t * name, TGo4Parameter * par, TFolder* parent=0);
00368 
00373       TGo4Parameter * GetParameter(const Text_t * name);
00374 
00379       Bool_t RemoveParameter(const Text_t * name);
00380 
00386       Bool_t AddPicture(TGo4Picture * pic, const Text_t* subfolder=0);
00387 
00395       Bool_t SetPicture(const Text_t * name, TGo4Picture * pic, TFolder* parent=0);
00396 
00401       TGo4Picture * GetPicture(const Text_t * name);
00402 
00407       Bool_t RemovePicture(const Text_t * name);
00408 
00409 
00415       Bool_t AddCanvas(TCanvas * can, const Text_t* subfolder=0);
00416 
00423       Bool_t SetCanvas(const Text_t * name, TGo4CanvasStatus * stat, TFolder* parent=0);
00424 
00429       TCanvas * GetCanvas(const Text_t * name);
00430 
00435       Bool_t RemoveCanvas(const Text_t * name);
00436 
00441       TGo4ObjectStatus * CreateObjectStatus(const Text_t * name, const Text_t* folder=0);
00442 
00445       TGo4ObjectStatus * CreateObjectStatus(TObject* ob, Bool_t fullinfo=kTRUE);
00446 
00447 
00452       TGo4AnalysisObjectNames * CreateNamesList();
00453 
00459       TFolder * CreateNamesFolder(TFolder * objectfolder);
00460 
00464       TFolder * GetObjectFolder();
00465 
00469       Bool_t AddEventStore(TGo4EventStore * store);
00470 
00474       Bool_t RemoveEventStore(TGo4EventStore * store);
00475 
00479       Bool_t AddEventSource(TGo4EventSource * source);
00480 
00484       Bool_t RemoveEventSource(TGo4EventSource* source);
00485 
00489       Bool_t AddEventProcessor(TGo4EventProcessor * pro);
00490 
00494       Bool_t RemoveEventProcessor(TGo4EventProcessor * pro);
00495 
00499       Bool_t AddEventStructure(TGo4EventElement * ev);
00500 
00504       Bool_t RemoveEventStructure(TGo4EventElement * ev);
00505 
00509       TGo4EventElement * GetEventStructure(const Text_t * name);
00510 
00514       Bool_t ResetBackStores();
00515   
00519       void CloseAnalysis();
00520 
00524     void SaveObjects(TFile* file);
00525 
00530       Bool_t LoadObjects(TFile* statusfile);
00531 
00535       Bool_t AddDynamicList(TGo4DynamicList * list);
00536 
00540       TGo4DynamicList * GetDynamicList(const Text_t * name);
00541 
00545       Bool_t RemoveDynamicList(const Text_t * name);
00546 
00550     void RemoveDynamicList(TGo4DynamicList* list);
00551 
00556       void SetCurrentDynList(TGo4DynamicList* list)
00557           {
00558               fxDynamicList=list;
00559           }
00563       TGo4DynamicList* GetCurrentDynList()
00564           {
00565               return fxDynamicList;
00566           }
00567 
00569       void ResetCurrentDynList();
00570 
00575       Int_t ProcessDynamicList();
00576 
00577       void SetDynListInterval(Int_t val)
00578            {
00579               fiDynListInterval=val;
00580            }
00581 
00582       Int_t GetDynListInterval()
00583           {
00584              return fiDynListInterval;
00585           }
00586 
00587 //     /* Direct access to folder with registered histograms. For histogram server! */
00588 //      TFolder* GetHistogramFolder()
00589 //          {
00590 //             return fxHistogramDir;
00591 //          }
00592 
00593 
00594 /* True if number of events reaches dynlistinterval modulo */
00595   Bool_t CheckDynListInterval()
00596       {
00597          return ((fiDynListCount%fiDynListInterval)==0);
00598       }
00599 
00600 
00601 
00614       Bool_t AddDynamicHistogram(const Text_t* name,
00615                                   const Text_t* histo,
00616                                   const Text_t* hevx, const Text_t* hmemx,
00617                                   const Text_t* hevy=0, const Text_t* hmemy=0,
00618                                   const Text_t* hevz=0, const Text_t* hmemz=0,
00619                                   const Text_t* condition=0,
00620                                   const Text_t* cevx=0, const Text_t* cmemx=0,
00621                                   const Text_t* cevy=0, const Text_t* cmemy=0);
00622 
00623 
00624       /* Add new dynamic list entry according to settings */
00625       Bool_t AddDynamicHistogram(TGo4HistogramEntryStatus* settings);
00626 
00627 
00635    Bool_t AddTreeHistogram(const Text_t * hisname, const Text_t * treename, const Text_t* varexp, TCut selection);
00636 
00637 
00642    void PrintHistograms(const Text_t* expression=0);
00647    void PrintConditions(const Text_t* expression=0);
00651    void PrintDynamicList();
00652 
00653 
00660    Bool_t ClearObjects(const Text_t* name);
00661 
00662 
00671    Bool_t ProtectObjects(const Text_t* name, const Option_t* flags);
00672 
00680       Bool_t SetDynamicEntryStatus(const Text_t* name, TGo4DynamicEntryStatus* state, const Text_t* listname=0);
00681 
00682 
00689        Bool_t RemoveDynamicEntry(const Text_t * entryname, const Text_t* listname=0);
00690 
00691 
00695       TFolder* FindSubFolder(TFolder* parent, const Text_t* subfolder, Bool_t create=kTRUE);
00696 
00697 
00698       Bool_t CreatedInMake() const { return fbCreatedinMake; }
00699 
00701       static const Text_t fgcTOPDYNAMICLIST[];
00702 
00704       static const Text_t fgcTOPFOLDER[];
00705 
00707       static const Text_t fgcHISTFOLDER[];
00708 
00710       static const Text_t fgcDYNFOLDER[];
00711 
00713       static const Text_t fgcCONDFOLDER[];
00714 
00716       static const Text_t fgcPARAFOLDER[];
00717 
00719       static const Text_t fgcTREEFOLDER[];
00720 
00722       static const Text_t fgcPICTFOLDER[];
00723 
00725       static const Text_t fgcCANVFOLDER[];
00726 
00728       static const Text_t fgcANALYSISFOLDER[];
00729 
00731       static const Text_t fgcEVENTFOLDER[];
00732 
00734       static const Text_t fgcSRCFOLDER[];
00735 
00737       static const Text_t fgcSTOREFOLDER[];
00738 
00740       static const Text_t fgcPROCFOLDER[];
00741 
00743       static const Text_t fgcUSRFOLDER[];
00744 
00746       static const Text_t fgcTMPFOLDER[];
00747 
00749       static const UInt_t fguSUBFOLDERMAXLEN;
00750 
00751    private:
00752 
00756       TFolder * fxGo4Dir;
00757 
00758 
00763       TFolder * fxHistogramDir;
00764 
00769       TFolder * fxConditionDir;
00770 
00774       TFolder * fxParameterDir;
00775 
00780       TFolder * fxDynListDir;
00781 
00785       TFolder * fxUserDir;
00786 
00790       TFolder * fxTreeDir;
00791 
00795       TFolder * fxPictureDir;
00796 
00800       TFolder * fxCanvasDir;
00801 
00805       TFolder * fxStoreDir;
00806 
00810       TFolder * fxSourceDir;
00811 
00815       TFolder * fxProcessorDir;
00816 
00820       TFolder * fxEventDir;
00821 
00825       TFolder * fxAnalysisDir;
00826 
00830       TFolder * fxTempFolder;
00831 
00835       TMutex * fxDirMutex;
00836 
00837 
00841       TList * fxMatchList;
00842 
00846       TIterator * fxMatchIterator; 
00847 
00852       TGo4DynamicList * fxDynamicList; 
00853 
00854 
00860       Int_t fiDynListCount;
00861 
00865       Int_t fiDynListInterval;
00866 
00871       Bool_t fbCreatedinMake;    
00872 
00879       Bool_t fbSuppressLoadHistograms;    
00880 
00881 
00890       Bool_t AddObjectToFolder(TObject * ob, TFolder* fold, const Text_t* subfolder=0,
00891                                   Bool_t replace=kTRUE, Bool_t uniquename=kFALSE, Bool_t resetbits=kTRUE);
00892 
00899       Bool_t RemoveObjectFromFolder(const Text_t* fullname, TFolder* fold, Bool_t isDel);
00900 
00906       Bool_t LoadFolder(TFolder* source, TFolder* destination, Bool_t replace=kFALSE);
00907 
00913       Bool_t LoadFolder(TDirectory* source, TFolder* destination, Bool_t replace=kFALSE);
00914 
00920       Bool_t PutToFolder(TObject* ob, TFolder* destination, Bool_t replace=kFALSE);
00921 
00922 
00923 
00929       Bool_t SaveFolder(TFolder* source);
00930 
00936       void RemoveFromDir(TFolder* fold, TDirectory* dir);
00937 
00942     void AppendToDir(TObject* ob, TDirectory* dir);
00943 
00944 
00950    Int_t PrintFolder(TFolder* fold, Option_t* opt, const Text_t* expression=0);
00951 
00956    Bool_t ClearFolder(TFolder* fold);
00957 
00962    Bool_t ClearObject(TObject* ob);
00963 
00964 
00969    Bool_t DeleteFolder(TFolder* fold);
00970 
00975    Bool_t DeleteObject(TObject* ob);
00976 
00977 
00986     Bool_t ProtectFolder(TFolder* fold, const Option_t* flags);
00987 
00988 
00997    Bool_t ProtectObject(TObject* ob, const Option_t* flags);
00998 
00999 
01003      void CleanupDynamicLists(TObject* oldobject);
01004 
01008      void InitPictures(TFolder* fold=0);
01009 
01010 
01014     TList* CreateObjectList(const Text_t* expr, const Text_t* folder=0);
01015 
01017     TList* CreateObjectList(const Text_t* expr, TFolder* fold);
01018 
01020     Bool_t IsMatching(const Text_t* string, const Text_t* expression);
01021 
01025     TObject* FindObjectInFolder(TFolder* folder, const Text_t* fullname);
01026 
01033     TObject* TestObject(TFolder* folder,
01034                         const Text_t* &pathname,
01035                         const Text_t* objectname,
01036                         const TClass* cl);
01037 
01038 };
01039 
01040 #endif //TGO4ANALYSISOBJECTMANAGER_H
01041 
01042 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:55:49 2005 for Go4-v2.10-5 by doxygen1.2.15