]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliDataLoader.h
Updated task list
[u/mrichter/AliRoot.git] / STEER / AliDataLoader.h
index 423dc36910b768e5281ff85abd6c8370d7a1ecb8..35f2cc46482a944eac7e0fb6a2d7b2c1d7ba7d17 100644 (file)
@@ -1,5 +1,10 @@
 #ifndef ALIDATALOADER_H
 #define ALIDATALOADER_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
 //__________________________________________
 ////////////////////////////////////////////
 //                                        //
 //                                        //
 //                                        //
 ////////////////////////////////////////////
+
+#include <TDirectory.h>
 #include <TNamed.h>
 #include <TString.h>
-#include <TTree.h>
-#include <TTask.h>
-#include <TDirectory.h>
-
-class AliLoader;
+class TTask;
+class TTree;
 class TFile;
 class TFolder;
-class AliRunLoader;
+
 class AliBaseLoader;
+class AliLoader;
 class AliObjectLoader;
-class AliTreeLoader;
+class AliRunLoader;
 class AliTaskLoader;
+class AliTreeLoader;
 
 class AliDataLoader: public TNamed
  {
@@ -59,7 +65,7 @@ class AliDataLoader: public TNamed
    const TString&     GetFileOption() const {return fFileOption;}
    const Int_t&       GetCompressionLevel() const {return fCompressionLevel;}
    
-   Bool_t             cd(){return (fDirectory)?fDirectory->cd():kFALSE;}
+   Bool_t             Cd(){return (fDirectory)?fDirectory->cd():kFALSE;}
    
    virtual void       SetFileName(const TString& filename){fFileName = filename;}
    virtual void       SetFileOption(const Option_t* fileopt);
@@ -74,6 +80,8 @@ class AliDataLoader: public TNamed
    void               SetFileNameSuffix(const TString& suffix);//adds the suffix before ".root", 
                                                                //e.g. TPC.Digits.root -> TPC.DigitsMerged.root
                                                                //made on Jiri Chudoba demand
+   void               SetNumberOfEventsPerFile(Int_t nevpf) 
+     {fNEventsPerFile = nevpf;}
    const TString      SetFileOffset(const TString& fname);//adds the proper number before .root extension suffix
    void               SetDirName(TString& dirname);
 
@@ -100,16 +108,18 @@ class AliDataLoader: public TNamed
    void Synchronize();
 
   protected:
-   Int_t              GetDebug() const;
    AliRunLoader*      GetRunLoader();//gets the run-loader from event folder
 
   private:
+   AliDataLoader(const AliDataLoader&); //Not implemented
+   AliDataLoader& operator=(const AliDataLoader&); //Not implemented
       
    TString      fFileName; //name of the file 
    TFile*       fFile; //! pointer to file 
    TDirectory*  fDirectory; //!pointer to TDirectory
    TString      fFileOption; //!file option while opened 
    Int_t        fCompressionLevel; //Compression Level of File
+   Int_t        fNEventsPerFile;  //defines number of events stored per one file
    
    TObjArray*   fBaseLoaders;//base loaders
    Bool_t       fHasTask;// flag if has a task
@@ -119,139 +129,7 @@ class AliDataLoader: public TNamed
    TFolder*     fEventFolder;//!event folder
    TFolder*     fFolder;//! folder with data
    
-  public:
-   ClassDef(AliDataLoader,1)
- };
-
-
-//__________________________________________
-////////////////////////////////////////////
-//                                        //
-//  class AliBaseLoader                   //
-//                                        //
-//                                        //
-////////////////////////////////////////////
-
-
-class AliBaseLoader: public TNamed
-{
-  public:
-    AliBaseLoader();
-    AliBaseLoader(const TString& name, AliDataLoader* dl, Bool_t storeontop = kFALSE);
-    
-    virtual ~AliBaseLoader(){};
-     
-    virtual Int_t      Load(Option_t* opt="");
-    virtual void       Unload();
-    virtual Int_t      Reload();
-    virtual Int_t      WriteData(Option_t* opt="");
-    virtual void       Clean();
-    virtual Int_t      Post();
-    virtual Int_t      Post(TObject* data);
-    virtual TObject*   Get() const = 0; 
-    Bool_t             IsLoaded()const{return fIsLoaded;}
-    void               SetDataLoader(AliDataLoader* dl){fDataLoader = dl;}
-    void               SetEventFolder(TFolder* /*ef*/){;}
-    void               SetDoNotReload(Bool_t flag){fDoNotReload = flag;}
-    Bool_t             DoNotReload() const {return fDoNotReload;}
-    TDirectory*        GetDirectory();//returns pointer to directory where data are stored. 
-    TObject*           GetFromDirectory(const char *name){return (GetDirectory())?GetDirectory()->Get(name):0x0;}    
-   protected:
-    
-    virtual Int_t      AddToBoard(TObject* obj) = 0;//add to white board - board can be TTask or TFolder
-    virtual void       RemoveFromBoard(TObject* obj) = 0;
-    
-    AliDataLoader*     GetDataLoader() const;
-    Int_t              GetDebug() const;
-
-    Bool_t             fIsLoaded;    //!  flag indicating if data are loaded
-    Bool_t             fStoreInTopOfFile;// if true, data are stored in top of file ->Indicates fDoNotReload == kTRUE
-
-   private:
-    Bool_t             fDoNotReload; // if this flag is on object is not reloaded while GetEvent is called.
-                                     //Specially important for tasks. Task loops over events while producing data, 
-                        //and has a base loader which writes it to file every processed event.
-                        //If this flag is not on, while taking next event, loader deletes task
-                        // and tries to get new one from file
-    AliDataLoader*     fDataLoader;  //! pointer to Data Loader this Base Loader belongs to
-
- ClassDef(AliBaseLoader,1)    
-};
-
-//__________________________________________
-////////////////////////////////////////////
-//                                        //
-//  class AliObjectLoader                 //
-//                                        //
-//                                        //
-////////////////////////////////////////////
-
-class AliObjectLoader: public AliBaseLoader
- {
-   public:
-     AliObjectLoader(){};
-     AliObjectLoader(const TString& name, AliDataLoader* dl, Bool_t storeontop = kFALSE);
-     virtual          ~AliObjectLoader(){};
-     TObject*          Get() const;
-
-   protected:
-     TFolder*          GetFolder() const;
-     Int_t             AddToBoard(TObject* obj);
-     void              RemoveFromBoard(TObject* obj);
-
- ClassDef(AliObjectLoader,1)    
-  
- };
-
-//__________________________________________
-////////////////////////////////////////////
-//                                        //
-//  class AliTreeLoader                   //
-//                                        //
-//                                        //
-////////////////////////////////////////////
-
-class AliTreeLoader: public AliObjectLoader
- {
-   public:
-     AliTreeLoader(){};
-     AliTreeLoader(const TString& name, AliDataLoader* dl, Bool_t storeontop = kFALSE);
-     virtual ~AliTreeLoader(){};
-     
-     virtual TTree*     Tree() const {return dynamic_cast<TTree*>(Get());}
-     virtual void       MakeTree();
-     virtual Int_t      WriteData(Option_t* opt="");
-
-   ClassDef(AliTreeLoader,1)    
- };
-
-//__________________________________________
-////////////////////////////////////////////
-//                                        //
-//  class AliTaskLoader                   //
-//                                        //
-//                                        //
-////////////////////////////////////////////
-class AliTaskLoader: public AliBaseLoader
- {
-  public:
-    AliTaskLoader():fParentalTask(0x0){};
-    AliTaskLoader(const TString& name, AliDataLoader* dl, TTask* parentaltask, Bool_t storeontop = kFALSE);
-    virtual ~AliTaskLoader(){};
-    
-    TObject*           Get() const; 
-    virtual TTask*     Task() const {return dynamic_cast<TTask*>(Get());}
-
-  protected:
-    Int_t              AddToBoard(TObject* obj);
-    void               RemoveFromBoard(TObject* obj);
-    TTask*             GetParentalTask() const;
-
-  private:
-    TTask*             fParentalTask;
-
-  ClassDef(AliTaskLoader,1)    
+   ClassDef(AliDataLoader,2)
  };
 
 #endif