]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliRunLoader.h
Make use of new method AliRawReader::GetNumberOfEvents() - goinf to the last event...
[u/mrichter/AliRoot.git] / STEER / AliRunLoader.h
index ea1634a5e39a6e274cfb93f8b2713b1e4de8a7f0..a722f41c7e1c47035e8d386b23114cdce3c9b919 100644 (file)
 /////////////////////////////////////////////////////////////////////
 
 #include <TNamed.h>
-#include <TFile.h>
+
 #include "AliConfig.h"
 #include "AliLoader.h"
 #include "AliDataLoader.h"
+#include "AliLog.h"
 
+class TFile;
 class TString;
 class TFolder;
 class TObjArray;
@@ -41,7 +43,8 @@ class AliDetector;
 class AliHeader;
 class AliStack;
 class AliRunDigitizer;
-
+class AliCDBEntry;
+class AliCentralTrigger;
 
 class AliRunLoader: public TNamed
 {
@@ -50,11 +53,14 @@ class AliRunLoader: public TNamed
     AliRunLoader();
     AliRunLoader(const char* topfoldername);
     AliRunLoader(TFolder* topfolder);
+    AliRunLoader(const AliRunLoader &rl);
+    AliRunLoader & operator = (const AliRunLoader &rl) 
+      {rl.Copy(*this); return *this;}
     
     virtual ~AliRunLoader();
     
     static AliRunLoader* Open(const char* filename = "galice.root",
-                              const char* eventfoldername = AliConfig::fgkDefaultEventFolderName,
+                              const char* eventfoldername = AliConfig::GetDefaultEventFolderName(),
                  Option_t* option = "READ");
 
     Int_t       GetEventNumber() const {return fCurrentEvent;}
@@ -66,16 +72,21 @@ class AliRunLoader: public TNamed
     
     Int_t       GetNumberOfEvents();
     
+    AliCDBEntry* GetCDBEntry(const char* name) const;
+
     void        MakeTree(Option_t *option);
     void        MakeHeader();
+    void        MakeTrigger();
     void        MakeStack();
     
     Int_t       LoadgAlice();
     Int_t       LoadHeader();
     Int_t       LoadKinematics(Option_t* option = "READ");
+    Int_t       LoadTrigger(Option_t* option = "READ");
     Int_t       LoadTrackRefs(Option_t* option = "READ");
     
     void        UnloadHeader();
+    void        UnloadTrigger();
     void        UnloadKinematics();
     void        UnloadgAlice();
     void        UnloadTrackRefs();
@@ -84,7 +95,9 @@ class AliRunLoader: public TNamed
     void        SetTrackRefsFileName(const TString& fname){fTrackRefsDataLoader->SetFileName(fname);}
     
     TTree*      TreeE() const; //returns the tree from folder; shortcut method
+    TTree*      TreeCT() const; //returns the tree from folder; shortcut method
     AliHeader*  GetHeader() const;
+    AliCentralTrigger*  GetTrigger() const;
     
     AliStack*   Stack() const {return fStack;}
     
@@ -95,6 +108,7 @@ class AliRunLoader: public TNamed
         
     Int_t       WriteGeometry(Option_t* opt="");
     Int_t       WriteHeader(Option_t* opt="");
+    Int_t       WriteTrigger(Option_t* opt="");
     Int_t       WriteAliRun(Option_t* opt="");
     Int_t       WriteKinematics(Option_t* opt="");
     Int_t       WriteTrackRefs(Option_t* opt="");
@@ -106,18 +120,26 @@ class AliRunLoader: public TNamed
     Int_t       WriteRecPoints(Option_t* opt="");
     Int_t       WriteTracks(Option_t* opt="");
     
-    Int_t       LoadHits(Option_t* detectors = "all",Option_t* opt = "RAED");
-    Int_t       LoadSDigits(Option_t* detectors = "all",Option_t* opt = "RAED");
-    Int_t       LoadDigits(Option_t* detectors = "all",Option_t* opt = "RAED");
-    Int_t       LoadRecPoints(Option_t* detectors = "all",Option_t* opt = "RAED");
-    Int_t       LoadTracks(Option_t* detectors = "all",Option_t* opt = "RAED");
+    Int_t       LoadHits(Option_t* detectors = "all",Option_t* opt = "READ");
+    Int_t       LoadSDigits(Option_t* detectors = "all",Option_t* opt = "READ");
+    Int_t       LoadDigits(Option_t* detectors = "all",Option_t* opt = "READ");
+    Int_t       LoadRecPoints(Option_t* detectors = "all",Option_t* opt = "READ");
+    Int_t       LoadTracks(Option_t* detectors = "all",Option_t* opt = "READ");
+    Int_t       LoadRecParticles(Option_t* detectors = "all",Option_t* opt = "READ");
     
+    void        UnloadHits(Option_t* detectors = "all");
+    void        UnloadSDigits(Option_t* detectors = "all");
+    void        UnloadDigits(Option_t* detectors = "all");
+    void        UnloadRecPoints(Option_t* detectors = "all");
+    void        UnloadTracks(Option_t* detectors = "all");
+    void        UnloadRecParticles(Option_t* detectors = "all");
+    void        UnloadAll(Option_t* detectors = "all");    
     
     void        AddLoader(AliLoader* loader);
     void        AddLoader(AliDetector* det);
     AliLoader*  GetLoader(const char* detname) const;
     AliLoader*  GetLoader(AliDetector* det) const;
-    Int_t       SetEventFolderName(const TString& name = AliConfig::fgkDefaultEventFolderName);//sets top folder name for this run; of alread
+    Int_t       SetEventFolderName(const TString& name = AliConfig::GetDefaultEventFolderName());//sets top folder name for this run; of alread
     void        CleanFolders();//removes all abjects from folder structure
     void        CleanDetectors();
     void        CleanKinematics(){Clean(fgkKineContainerName);}
@@ -141,10 +163,51 @@ class AliRunLoader: public TNamed
                                                                //made on Jiri Chudoba demand
     TString     GetFileName() const;//returns name of galice file
     const TObjArray* GetArrayOfLoaders() const {return fLoaders;}
-    Int_t GetDebug() const {return AliLoader::GetDebug();}
-    void cd(){fgRunLoader = this;}
+    void Cd(){fgRunLoader = this;}
+    void Synchronize();
+    
+    AliLoader*    GetDetectorLoader(const char* detname);
+    TTree*        GetTreeH(const char* detname, Bool_t maketree);
+    TTree*        GetTreeS(const char* detname, Bool_t maketree);
+    TTree*        GetTreeD(const char* detname, Bool_t maketree);
+    TTree*        GetTreeR(const char* detname, Bool_t maketree);
+    TTree*        GetTreeT(const char* detname, Bool_t maketree);
+    TTree*        GetTreeP(const char* detname, Bool_t maketree);
+
+  /******************************************/
+  /*****   Public S T A T I C Stuff   *******/
+  /******************************************/
+    static AliRunLoader* GetRunLoader(const char* eventfoldername);
+    static AliRunLoader* GetRunLoader(){return fgRunLoader;}
+    static AliLoader*    GetDetectorLoader(const char* detname, const char* eventfoldername);
+    static TTree*        GetTreeH(const char* detname, Bool_t maketree, const char* eventfoldername);
+    static TTree*        GetTreeS(const char* detname, Bool_t maketree, const char* eventfoldername);
+    static TTree*        GetTreeD(const char* detname, Bool_t maketree, const char* eventfoldername);
+    static TTree*        GetTreeR(const char* detname, Bool_t maketree, const char* eventfoldername);
+    static TTree*        GetTreeT(const char* detname, Bool_t maketree, const char* eventfoldername);
+    static TTree*        GetTreeP(const char* detname, Bool_t maketree, const char* eventfoldername);
 
-  protected:
+//    static AliRunDigitizer* GetRunDigitizer();
+//  Tasks are supposed to be singletons, that is why following methods are static
+    static TTask*           GetRunDigitizer();        //
+    static TTask*           GetRunSDigitizer();       //
+    static TTask*           GetRunReconstructioner(); //
+    static TTask*           GetRunTracker();          //
+    static TTask*           GetRunPIDTask();          // 
+    static TTask*           GetRunQATask();           //
+
+    static TString GetRunLoaderName () {return fgkRunLoaderName;}
+    static TString GetHeaderContainerName () {return fgkHeaderContainerName;}
+    static TString GetTriggerContainerName () {return fgkTriggerContainerName;}
+    static TString GetKineContainerName () {return fgkKineContainerName;}
+    static TString GetTrackRefsContainerName () {return fgkTrackRefsContainerName;}
+    static TString GetHeaderBranchName () {return fgkHeaderBranchName;}
+    static TString GetTriggerBranchName () {return fgkTriggerBranchName;}
+    static TString GetKineBranchName () {return fgkKineBranchName;}
+    static TString GetTriggerFileName() { return fgkDefaultTriggerFileName; }
+    static TString GetGAliceName () {return fgkGAliceName;}
+     
+protected:
     /**********************************************/
     /************    PROTECTED      ***************/
     /*********        D A T A          ************/
@@ -155,9 +218,10 @@ class AliRunLoader: public TNamed
     
     Int_t          fCurrentEvent;//!Number of current event
     
-    TFile         *fGAFile;//!  pointer to main file with AliRun and Run Loader -> galice.root 
-    AliHeader     *fHeader;//!  pointer to header
-    AliStack      *fStack; //!  pointer to stack
+    TFile             *fGAFile;//!  pointer to main file with AliRun and Run Loader -> galice.root 
+    AliHeader         *fHeader;//!  pointer to header
+    AliStack          *fStack; //!  pointer to stack
+    AliCentralTrigger *fCTrigger; //! pointer to CEntral Trigger Processor
     
     AliDataLoader *fKineDataLoader;// kinematics data loader
     AliDataLoader *fTrackRefsDataLoader;//track reference data loader
@@ -166,6 +230,7 @@ class AliRunLoader: public TNamed
     TString        fUnixDirName;    //! name of unix path to directory that contains event
     static const TString   fgkDefaultKineFileName;//default file name with kinamatics
     static const TString   fgkDefaultTrackRefsFileName;//default file name with kinamatics
+    static const TString   fgkDefaultTriggerFileName;//default file name with trigger
 
 
     /*********************************************/
@@ -186,44 +251,27 @@ class AliRunLoader: public TNamed
     void  GetListOfDetectors(const char * namelist,TObjArray& pointerarray) const;
 
     void  CleanHeader(){Clean(fgkHeaderContainerName);}
+    void  CleanTrigger(){Clean(fgkTriggerContainerName);}
     void  Clean(const TString& name);
     
     Int_t SetEvent();
    
-    static AliRunLoader* fgRunLoader;
+    static AliRunLoader* fgRunLoader; //pointer to the AliRunLoader instance
 
-  public:
-  /******************************************/
-  /*****   Public S T A T I C Stuff   *******/
-  /******************************************/
-    static AliRunLoader* GetRunLoader(const char* eventfoldername);
-    static AliRunLoader* GetRunLoader(){return fgRunLoader;}
-    static AliLoader*    GetDetectorLoader(const char* detname);
-    static TTree*        GetTreeH(const char* detname, Bool_t maketree);
-    static TTree*        GetTreeS(const char* detname, Bool_t maketree);
-    static TTree*        GetTreeD(const char* detname, Bool_t maketree);
-    static TTree*        GetTreeR(const char* detname, Bool_t maketree);
-    static TTree*        GetTreeT(const char* detname, Bool_t maketree);
-    static TTree*        GetTreeP(const char* detname, Bool_t maketree);
+private:
+    void Copy(TObject &arun) const;
 
-//    static AliRunDigitizer* GetRunDigitizer();
-//  Tasks are supposed to be singletons, that is why following methods are static
-    static TTask*           GetRunDigitizer();        //
-    static TTask*           GetRunSDigitizer();       //
-    static TTask*           GetRunReconstructioner(); //
-    static TTask*           GetRunTracker();          //
-    static TTask*           GetRunPIDTask();          // 
-    static TTask*           GetRunQATask();           //
-     
-    static const TString   fgkRunLoaderName;
+    static const TString   fgkRunLoaderName;          //default name of the run loader
     static const TString   fgkHeaderContainerName;    //default name of the kinematics container (TREE) name - TreeE
+    static const TString   fgkTriggerContainerName;   //default name of the trigger container (TREE) name - TreeCT
     static const TString   fgkKineContainerName;      //default name of the kinematics container (TREE) name - TreeK
     static const TString   fgkTrackRefsContainerName; //default name of the track references container (TREE) name - TreeTR
-    static const TString   fgkHeaderBranchName;
-    static const TString   fgkKineBranchName;
-    static const TString   fgkGAliceName;
+    static const TString   fgkHeaderBranchName;       //default name of the branch containing the header
+    static const TString   fgkTriggerBranchName;      //default name of the branch containing the trigger
+    static const TString   fgkKineBranchName;         //default name of the branch with kinematics
+    static const TString   fgkGAliceName;             //default name for gAlice file    
     
-    ClassDef(AliRunLoader,1)
+    ClassDef(AliRunLoader,2)
 };
 
 #endif