]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliMetaData.h
Initialization of all returned variables in GetRPHIintersections
[u/mrichter/AliRoot.git] / STEER / AliMetaData.h
1 #ifndef ALIMETADATA_H
2 #define ALIMETADATA_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 /// base class of the meta data of run dependent objects
10 /// Derived classes: AliObjectMetaData, AliSelectionMetaData
11 ///
12
13 #include <TObject.h>
14 #include <TString.h>
15
16
17 class AliMetaData: public TObject {
18 public:
19   AliMetaData();
20   AliMetaData(const char* name, 
21               Int_t firstRun = -1, Int_t lastRun = -1, Int_t version = -1);
22   virtual ~AliMetaData() {};
23
24   AliMetaData(const AliMetaData& entry);
25   AliMetaData& operator = (const AliMetaData& entry);
26
27   virtual void         SetName(const char* name) {fName = name; DecodeName();}
28   /*virtual*/ void         SetRunRange(Int_t firstRun = -1, Int_t lastRun = 1) 
29     {fFirstRun = firstRun; fLastRun = lastRun;}
30   /*virtual*/ void         SetVersion(Int_t version = -1) {fVersion = version;}
31   
32   void         SetDetector(const char* Detector) {fDetector = Detector; EncodeName();}
33   void         SetDBType(const char* DBType) {fDBType = DBType; EncodeName();}
34   void         SetDetSpecType(const char* DetSpecType) {fDetSpecType = DetSpecType; EncodeName();}
35
36   const char*  GetDetector() const;
37   const char*  GetDBType() const;
38   const char*  GetDetSpecType() const;
39   
40
41   /*virtual*/ const char*  GetName() const;
42   /*virtual*/ Int_t        GetFirstRun() const {return fFirstRun;}
43   /*virtual*/ Int_t        GetLastRun() const {return fLastRun;}
44   /*virtual*/ Int_t        GetVersion() const {return fVersion;}
45
46   /*virtual*/ Bool_t       IsValid(Int_t runNumber,     
47                                AliMetaData* metaData = NULL) const; 
48   /*virtual*/ Bool_t       IsStrictlyValid(Int_t runNumber, 
49                                AliMetaData* metaData = NULL) const;
50   /*virtual*/ Int_t        Compare(const TObject* object) const;
51   /*virtual*/ Bool_t       Matches(const char* name, Int_t runNumber) const;
52
53 protected:
54   TString              fName;           // name of the entry
55   TString              fDetector;       // name of the detector (ZDC, TPC, etc...)
56   TString              fDBType;         // name of the database type (Calib, Align)
57   TString              fDetSpecType;    // name of the detector's specific data type (pedestals, gain coeffs...)
58   Int_t                fFirstRun;       // index of first valid run
59   Int_t                fLastRun;        // index of last valid run
60   Int_t                fVersion;        // version of the entry
61
62   void                 EncodeName();
63   void                 DecodeName();
64
65
66   ClassDef(AliMetaData, 2)   // base class of the meta data of run dependent objects
67 };
68
69 extern Bool_t operator == (const AliMetaData& entry1, 
70                            const AliMetaData& entry2);
71
72 #endif