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);
44 AliBaseLoader(const AliBaseLoader& source);
45 AliBaseLoader& operator=(const AliBaseLoader& source);
47 virtual ~AliBaseLoader(){};
49 virtual Int_t Load(Option_t* opt="");
50 virtual void Unload();
51 virtual Int_t Reload();
52 virtual Int_t WriteData(Option_t* opt="");
54 virtual Int_t Post();//Takes from file and sends to proper TFolder (Data Folder)
55 virtual Int_t Post(TObject* data);//Sends to proper TFolder (Data Folder)
56 virtual TObject* Get() const = 0;
57 Bool_t IsLoaded()const{return fIsLoaded;}
58 void SetDataLoader(AliDataLoader* dl){fDataLoader = dl;}
59 void SetEventFolder(TFolder* /*ef*/){;}
60 void SetDoNotReload(Bool_t flag){fDoNotReload = flag;}
61 Bool_t DoNotReload() const {return fDoNotReload;}
62 TDirectory* GetDirectory() const;//returns pointer to directory where data are stored.
63 TObject* GetFromDirectory(const char *name) const
64 {return (GetDirectory())?GetDirectory()->Get(name):0x0;}
67 virtual Int_t AddToBoard(TObject* obj) = 0;//add to white board - board can be TTask or TFolder
68 virtual void RemoveFromBoard(TObject* obj) = 0;
70 AliDataLoader* GetDataLoader() const;
72 Bool_t fIsLoaded; //! flag indicating if data are loaded
73 Bool_t fStoreInTopOfFile;// if true, data are stored in top of file ->Indicates fDoNotReload == kTRUE
76 Bool_t fDoNotReload; // if this flag is on object is not reloaded while GetEvent is called.
77 //Specially important for tasks. Task loops over events while producing data,
78 //and has a base loader which writes it to file every processed event.
79 //If this flag is not on, while taking next event, loader deletes task
80 // and tries to get new one from file
81 AliDataLoader* fDataLoader; //! pointer to Data Loader this Base Loader belongs to
83 ClassDef(AliBaseLoader,1)