Update master to aliroot
[u/mrichter/AliRoot.git] / STEER / STEERBase / AliOADBContainer.h
CommitLineData
cc336771 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>
58a28442 14#include <TList.h>
cc336771 15#include <TArrayI.h>
35f37af6 16#include <TObjArray.h>
cc336771 17
18class TObjArray;
19class TArrayI;
20
21class AliOADBContainer : public TNamed {
22
23 public :
24 AliOADBContainer();
0add5ddf 25 AliOADBContainer(const char* name);
cc336771 26 virtual ~AliOADBContainer();
27 AliOADBContainer(const AliOADBContainer& cont);
28 AliOADBContainer& operator=(const AliOADBContainer& cont);
35f37af6 29// Object adding and removal
10699bec 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="");
58a28442 32 void RemoveObject(Int_t index);
08b752d1 33 void AddDefaultObject(TObject* obj);
58a28442 34 void CleanDefaultList();
35 TList* GetDefaultList() const {return fDefaultList;}
35f37af6 36// I/O
0add5ddf 37 void WriteToFile(const char* fname) const;
38 Int_t InitFromFile(const char* fname, const char* key);
35f37af6 39// Getters
40 Int_t GetNumberOfEntries() const {return fEntries;}
41 Int_t LowerLimit(Int_t idx) const {return fLowerLimits[idx];}
42 Int_t UpperLimit(Int_t idx) const {return fUpperLimits[idx];}
10699bec 43 TObject* GetObject(Int_t run, const char* def = "", TString passName="") const;
bad1b400 44 TObject* GetObjectByIndex(Int_t run) const;
10699bec 45 TObject* GetPassNameByIndex(Int_t idx) const;
9939b6b6 46 TObject* GetDefaultObject(const char* key)
58a28442 47 {return(fDefaultList->FindObject(key));}
35f37af6 48// Debugging
cc336771 49 void List();
08b752d1 50// Browsable
51 virtual Bool_t IsFolder() const { return kTRUE; }
52 void Browse(TBrowser *b);
10699bec 53 Int_t GetIndexForRun(Int_t run, TString passName="") const;
60cfe266 54//
55 static const char* GetOADBPath();
58a28442 56 private:
10699bec 57 Int_t HasOverlap(Int_t lower, Int_t upper, TString passName) const;
cc336771 58 private :
bad1b400 59 TObjArray* fArray; // Array with objects corresponding to run ranges
60 TList* fDefaultList; // List with default arrays
10699bec 61 TObjArray* fPassNames; // Pass names
cc336771 62 TArrayI fLowerLimits; // lower limit of run range
63 TArrayI fUpperLimits; // upper limit of run range
64 Int_t fEntries; // Number of entries
08b752d1 65// TString fRelPath; // Relative path to object
66
10699bec 67 ClassDef(AliOADBContainer, 2);
cc336771 68};
69
70#endif