Added methods for finding a given module in the DDL map (F. Prino)
[u/mrichter/AliRoot.git] / STEER / AliBaseLoader.h
CommitLineData
a9bbb414 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 */
5
6/* $Id$ */
7
8//__________________________________________
9////////////////////////////////////////////
10// //
11// class AliBaseLoader //
12// //
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 //
19// others. //
20// //
21// //
22////////////////////////////////////////////
23
24#include <TDirectory.h>
25#include <TNamed.h>
26#include <TString.h>
27#include <TTask.h>
28#include <TTree.h>
29class TFile;
30class TFolder;
31
32class AliLoader;
33class AliDataLoader;
34class AliObjectLoader;
35class AliRunLoader;
36class AliTaskLoader;
37class AliTreeLoader;
38
39class AliBaseLoader: public TNamed
40{
41 public:
42 AliBaseLoader();
43 AliBaseLoader(const TString& name, AliDataLoader* dl, Bool_t storeontop = kFALSE);
44 AliBaseLoader(const AliBaseLoader& source);
45 AliBaseLoader& operator=(const AliBaseLoader& source);
46
47 virtual ~AliBaseLoader(){};
48
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="");
53 virtual void Clean();
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;}
65 protected:
66
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;
69
70 AliDataLoader* GetDataLoader() const;
71
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
74
75 private:
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
82
83 ClassDef(AliBaseLoader,1)
84};
85
86
87#endif
88
89