1 #ifndef ALIBASELOADER_H
2 #define ALIBASELOADER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
8 //__________________________________________
9 ////////////////////////////////////////////
11 // class AliBaseLoader //
13 // Loader responsible for one data type //
14 // i.e. Hits, Kine, etc. //
15 // many objects type can be assciated //
16 // with one data type: storing object //
17 // (usually tree), task producing it, //
18 // Quality Assurance(QA), QA Task, and //
22 ////////////////////////////////////////////
24 #include <TDirectory.h>
34 class AliObjectLoader;
39 class AliBaseLoader: public TNamed
43 AliBaseLoader(const TString& name, AliDataLoader* dl, Bool_t storeontop = kFALSE);
45 virtual ~AliBaseLoader(){};
47 virtual Int_t Load(Option_t* opt="");
48 virtual void Unload();
49 virtual Int_t Reload();
50 virtual Int_t WriteData(Option_t* opt="");
52 virtual Int_t Post();//Takes from file and sends to proper TFolder (Data Folder)
53 virtual Int_t Post(TObject* data);//Sends to proper TFolder (Data Folder)
54 virtual TObject* Get() const = 0;
55 Bool_t IsLoaded()const{return fIsLoaded;}
56 void SetDataLoader(AliDataLoader* dl){fDataLoader = dl;}
57 void SetEventFolder(TFolder* /*ef*/){;}
58 void SetDoNotReload(Bool_t flag){fDoNotReload = flag;}
59 Bool_t DoNotReload() const {return fDoNotReload;}
60 TDirectory* GetDirectory() const;//returns pointer to directory where data are stored.
61 TObject* GetFromDirectory(const char *name) const
62 {return (GetDirectory())?GetDirectory()->Get(name):0x0;}
65 virtual Int_t AddToBoard(TObject* obj) = 0;//add to white board - board can be TTask or TFolder
66 virtual void RemoveFromBoard(TObject* obj) = 0;
68 AliDataLoader* GetDataLoader() const;
70 Bool_t fIsLoaded; //! flag indicating if data are loaded
71 Bool_t fStoreInTopOfFile;// if true, data are stored in top of file ->Indicates fDoNotReload == kTRUE
75 AliBaseLoader(const AliBaseLoader&); //Not implemented
76 AliBaseLoader& operator=(const AliBaseLoader&); //Not implemented
78 Bool_t fDoNotReload; // if this flag is on object is not reloaded while GetEvent is called.
79 //Specially important for tasks. Task loops over events while producing data,
80 //and has a base loader which writes it to file every processed event.
81 //If this flag is not on, while taking next event, loader deletes task
82 // and tries to get new one from file
83 AliDataLoader* fDataLoader; //! pointer to Data Loader this Base Loader belongs to
85 ClassDef(AliBaseLoader,1)