Line data Source code
1 : #ifndef AliOADBContainer_H
2 : #define AliOADBContainer_H
3 : /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4 : * See cxx source for full Copyright notice */
5 :
6 : /* $Id$ */
7 :
8 : //-------------------------------------------------------------------------
9 : // Offline Analysis Database Container and Service Class
10 : // Author: Andreas Morsch, CERN
11 : //-------------------------------------------------------------------------
12 :
13 : #include <TNamed.h>
14 : #include <TList.h>
15 : #include <TArrayI.h>
16 : #include <TObjArray.h>
17 :
18 : class TObjArray;
19 : class TArrayI;
20 :
21 : class AliOADBContainer : public TNamed {
22 :
23 : public :
24 : AliOADBContainer();
25 : AliOADBContainer(const char* name);
26 : virtual ~AliOADBContainer();
27 : AliOADBContainer(const AliOADBContainer& cont);
28 : AliOADBContainer& operator=(const AliOADBContainer& cont);
29 : // Object adding and removal
30 : void AppendObject(TObject* obj, Int_t lower, Int_t upper, TString passName="");
31 : void UpdateObject(Int_t index, TObject* obj, Int_t lower, Int_t upper, TString passName="");
32 : void RemoveObject(Int_t index);
33 : void AddDefaultObject(TObject* obj);
34 : void CleanDefaultList();
35 0 : TList* GetDefaultList() const {return fDefaultList;}
36 : // I/O
37 : void WriteToFile(const char* fname) const;
38 : Int_t InitFromFile(const char* fname, const char* key);
39 : // Getters
40 0 : Int_t GetNumberOfEntries() const {return fEntries;}
41 0 : Int_t LowerLimit(Int_t idx) const {return fLowerLimits[idx];}
42 0 : Int_t UpperLimit(Int_t idx) const {return fUpperLimits[idx];}
43 : TObject* GetObject(Int_t run, const char* def = "", TString passName="") const;
44 : TObject* GetObjectByIndex(Int_t run) const;
45 : TObject* GetPassNameByIndex(Int_t idx) const;
46 : TObject* GetDefaultObject(const char* key)
47 0 : {return(fDefaultList->FindObject(key));}
48 : // Debugging
49 : void List();
50 : // Browsable
51 0 : virtual Bool_t IsFolder() const { return kTRUE; }
52 : void Browse(TBrowser *b);
53 : Int_t GetIndexForRun(Int_t run, TString passName="") const;
54 : //
55 : static const char* GetOADBPath();
56 : private:
57 : Int_t HasOverlap(Int_t lower, Int_t upper, TString passName) const;
58 : private :
59 : TObjArray* fArray; // Array with objects corresponding to run ranges
60 : TList* fDefaultList; // List with default arrays
61 : TObjArray* fPassNames; // Pass names
62 : TArrayI fLowerLimits; // lower limit of run range
63 : TArrayI fUpperLimits; // upper limit of run range
64 : Int_t fEntries; // Number of entries
65 : // TString fRelPath; // Relative path to object
66 :
67 176 : ClassDef(AliOADBContainer, 2);
68 : };
69 :
70 : #endif
|