Fixes for bug #52499: Field polarities inconsistiency
[u/mrichter/AliRoot.git] / STEER / AliCDBId.h
CommitLineData
9e1ceb13 1#ifndef ALI_CDB_ID_H
2#define ALI_CDB_ID_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/////////////////////////////////////////////////////////////////////
8// //
9// class AliCDBId //
10// Identity of an object stored into a database: //
11// path, run validity range, version, subVersion //
12// //
13/////////////////////////////////////////////////////////////////////
14
15#include "AliCDBPath.h"
16#include "AliCDBRunRange.h"
17
18#include <TObject.h>
19
20class AliCDBId: public TObject {
21
22public:
23
24 AliCDBId();
25
26 AliCDBId(const AliCDBId& other);
27
28 AliCDBId(const AliCDBPath& path, const AliCDBRunRange& runRange,
29 Int_t version = -1, Int_t subVersion = -1);
30
31 AliCDBId(const AliCDBPath& path,
32 Int_t firstRun , Int_t lastRun , Int_t verison = -1,
33 Int_t subVersion = -1);
34
a4970db9 35 static AliCDBId* MakeFromString(const TString& idString);
36
9e1ceb13 37 virtual ~AliCDBId();
38
4667c116 39 const AliCDBPath& GetAliCDBPath() const {return fPath;}
40 const TString& GetPath() const {return fPath.GetPath();}
41 const TString GetPathLevel(Int_t i) const {return fPath.GetLevel(i);}
42 Bool_t IsWildcard() const {return fPath.IsWildcard();}
9e1ceb13 43
4667c116 44 void SetPath(const char* path) {fPath.SetPath(path);}
9e1ceb13 45
4667c116 46 const AliCDBRunRange& GetAliCDBRunRange() const {return fRunRange;}
47 AliCDBRunRange& GetAliCDBRunRange() {return fRunRange;}
48 Int_t GetFirstRun() const {return fRunRange.GetFirstRun();}
49 Int_t GetLastRun() const {return fRunRange.GetLastRun();}
50 void SetFirstRun(Int_t firstRun) {fRunRange.SetFirstRun(firstRun);}
51 void SetLastRun(Int_t lastRun) {fRunRange.SetLastRun(lastRun);}
52 void SetRunRange(Int_t firstRun, Int_t lastRun)
53 {fRunRange.SetRunRange(firstRun, lastRun);}
9e1ceb13 54
55
4667c116 56 Bool_t IsAnyRange() const {return fRunRange.IsAnyRange();}
9e1ceb13 57
58
4667c116 59 Int_t GetVersion() const {return fVersion;}
60 Int_t GetSubVersion() const {return fSubVersion;}
61 void SetVersion(Int_t version) {fVersion = version;}
62 void SetSubVersion(Int_t subVersion) {fSubVersion = subVersion;}
8e245d15 63
4667c116 64 const TString& GetLastStorage() const {return fLastStorage;}
65 void SetLastStorage(TString& lastStorage){fLastStorage = lastStorage;}
9e1ceb13 66
67 Bool_t IsValid() const;
4667c116 68 Bool_t IsSpecified() const {return !(IsWildcard() || IsAnyRange());}
9e1ceb13 69
4667c116 70 Bool_t HasVersion() const {return fVersion >= 0;}
71 Bool_t HasSubVersion() const {return fSubVersion >= 0;}
9e1ceb13 72
8e245d15 73 Bool_t Comprises(const AliCDBId& other) const
74 {return fPath.Comprises(other.fPath)
4667c116 75 && fRunRange.Comprises(other.fRunRange);}
8e245d15 76
77 virtual Bool_t IsEqual(const TObject *obj) const;
78
9e1ceb13 79 TString ToString() const;
b21e3194 80 void Print(Option_t* option="") const;
9e1ceb13 81
82private:
83
84 AliCDBPath fPath; // path
85 AliCDBRunRange fRunRange; // run range
86 Int_t fVersion; // version
87 Int_t fSubVersion; // subversion
88 TString fLastStorage; // previous storage place (new, grid, local, dump)
89
90 ClassDef(AliCDBId, 1);
91};
92
93#endif