1 #ifndef ALIDATALOADER_H
2 #define ALIDATALOADER_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 AliDataLoader //
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 ////////////////////////////////////////////
31 class AliObjectLoader;
36 #include <TDirectory.h>
40 class AliDataLoader: public TNamed
44 AliDataLoader(const char* filename, const char* contname, const char* name, Option_t* opt = "t");
45 virtual ~AliDataLoader();
47 virtual Int_t SetEvent();
48 virtual Int_t GetEvent();
50 //shrtcuts method to basic data base loader 0
51 virtual Int_t Load(Option_t* opt="");
52 virtual void Unload();
53 virtual Int_t Reload();
54 virtual Int_t WriteData(Option_t* opt="");
55 virtual TTree* Tree() const;
57 virtual void MakeTree();
58 virtual Int_t OpenFile(Option_t* opt);
60 virtual void CloseFile();
63 const TString& GetFileName() const {return fFileName;}
64 TFile* GetFile() const {return fFile;}
65 TDirectory* GetDirectory() const {return fDirectory;}
66 const TString& GetFileOption() const {return fFileOption;}
67 const Int_t& GetCompressionLevel() const {return fCompressionLevel;}
69 Bool_t Cd(){return (fDirectory)?fDirectory->cd():kFALSE;}
71 virtual void SetFileName(const TString& filename){fFileName = filename;}
72 virtual void SetFileOption(const Option_t* fileopt);
73 virtual void SetCompressionLevel(Int_t cl);
75 Int_t SetEventFolder(TFolder* eventfolder);//sets the event folder
76 Int_t SetFolder(TFolder* folder);//sets the data folder ??????
77 TFolder* GetEventFolder();
78 TFolder* GetFolder() const {return fFolder;}
80 // TObject* GetFromDirectory(const char *name){return (fDirectory)?fDirectory->Get(name):0x0;}
81 void SetFileNameSuffix(const TString& suffix);//adds the suffix before ".root",
82 //e.g. TPC.Digits.root -> TPC.DigitsMerged.root
83 //made on Jiri Chudoba demand
84 void SetNumberOfEventsPerFile(Int_t nevpf)
85 {fNEventsPerFile = nevpf;}
86 const TString SetFileOffset(const TString& fname);//adds the proper number before .root extension suffix
87 void SetDirName(TString& dirname);
89 void AddBaseLoader(AliBaseLoader* bl);
90 enum EStdBasicLoaders {kData = 0,kTask,kQA,kQATask};//standard basic loaders identifiers
92 AliBaseLoader* GetBaseLoader(const TString& name) const;
93 AliBaseLoader* GetBaseLoader(Int_t n) const;
94 AliObjectLoader* GetBaseDataLoader();
95 AliTaskLoader* GetBaseTaskLoader();
96 AliBaseLoader* GetBaseQALoader();
97 AliTaskLoader* GetBaseQATaskLoader();
99 void SetBaseDataLoader(AliBaseLoader* bl);
100 void SetBaseTaskLoader(AliTaskLoader* bl);
101 void SetBaseQALoader(AliBaseLoader* bl);
102 void SetBaseQATaskLoader(AliTaskLoader* bl);
104 Bool_t CheckReload();//checks if we have to reload given file
105 Bool_t IsFileWritable() const;
106 Bool_t IsFileOpen() const;
107 Bool_t IsOptionContrary(const TString& option) const;
112 AliRunLoader* GetRunLoader();//gets the run-loader from event folder
115 AliDataLoader(const AliDataLoader&); //Not implemented
116 AliDataLoader& operator=(const AliDataLoader&); //Not implemented
118 TString fFileName; //name of the file
119 TFile* fFile; //! pointer to file
120 TDirectory* fDirectory; //!pointer to TDirectory
121 TString fFileOption; //!file option while opened
122 Int_t fCompressionLevel; //Compression Level of File
123 Int_t fNEventsPerFile; //defines number of events stored per one file
125 TObjArray* fBaseLoaders;//base loaders
126 Bool_t fHasTask;// flag if has a task
127 TString fTaskName;// name of the task
128 TTask* fParentalTask;//Parental task
130 TFolder* fEventFolder;//!event folder
131 TFolder* fFolder;//! folder with data
133 ClassDef(AliDataLoader,2)