]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliRunLoader.h
Coding conventions.
[u/mrichter/AliRoot.git] / STEER / AliRunLoader.h
index ea1634a5e39a6e274cfb93f8b2713b1e4de8a7f0..55ea4da83323e67b636e491805be7fd2599fa1b6 100644 (file)
 /////////////////////////////////////////////////////////////////////
 
 #include <TNamed.h>
-#include <TFile.h>
+
 #include "AliConfig.h"
 #include "AliLoader.h"
 #include "AliDataLoader.h"
 
+class TFile;
 class TString;
 class TFolder;
 class TObjArray;
@@ -50,11 +51,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;}
@@ -111,13 +115,21 @@ class AliRunLoader: public TNamed
     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       LoadRecParticles(Option_t* detectors = "all",Option_t* opt = "RAED");
     
+    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);}
@@ -142,9 +154,48 @@ class AliRunLoader: public TNamed
     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);
+
+//    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();           //
 
-  protected:
+    static TString GetRunLoaderName () {return fgkRunLoaderName;}
+    static TString GetHeaderContainerName () {return fgkHeaderContainerName;}
+    static TString GetKineContainerName () {return fgkKineContainerName;}
+    static TString GetTrackRefsContainerName () {return fgkTrackRefsContainerName;}
+    static TString GetHeaderBranchName () {return fgkHeaderBranchName;}
+    static TString GetKineBranchName () {return fgkKineBranchName;}
+    static TString GetGAliceName () {return fgkGAliceName;}
+     
+protected:
     /**********************************************/
     /************    PROTECTED      ***************/
     /*********        D A T A          ************/
@@ -190,38 +241,18 @@ class AliRunLoader: public TNamed
     
     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   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   fgkKineBranchName;         //default name of the branch with kinematics
+    static const TString   fgkGAliceName;             //default name for gAlice file    
     
     ClassDef(AliRunLoader,1)
 };