Modified classes for ODCB access in AliReconstruction, and the file
[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
35 virtual ~AliCDBId();
36
37 const AliCDBPath& GetAliCDBPath() const {return fPath;};
38 const TString& GetPath() const {return fPath.GetPath();};
39 const TString& GetLevel0() const {return fPath.GetLevel0();};
40 const TString& GetLevel1() const {return fPath.GetLevel1();};
41 const TString& GetLevel2() const {return fPath.GetLevel2();};
42 Bool_t IsWildcard() const {return fPath.IsWildcard();};
43
44 void SetPath(const char* path) {fPath.SetPath(path);};
45
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);};
54
55
56 Bool_t IsAnyRange() const {return fRunRange.IsAnyRange();};
57
58
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
9e1ceb13 64 const TString& GetLastStorage() const {return fLastStorage;};
65 void SetLastStorage(TString& lastStorage){fLastStorage = lastStorage;};
66
67 Bool_t IsValid() const;
68 Bool_t IsSpecified() const {return !(IsWildcard() || IsAnyRange());};
69
70 Bool_t HasVersion() const {return fVersion >= 0;};
71 Bool_t HasSubVersion() const {return fSubVersion >= 0;};
72
8e245d15 73 Bool_t Comprises(const AliCDBId& other) const
74 {return fPath.Comprises(other.fPath)
9e1ceb13 75 && fRunRange.Comprises(other.fRunRange);};
8e245d15 76
77 virtual Bool_t IsEqual(const TObject *obj) const;
78
9e1ceb13 79 TString ToString() const;
80
81private:
82
83 AliCDBPath fPath; // path
84 AliCDBRunRange fRunRange; // run range
85 Int_t fVersion; // version
86 Int_t fSubVersion; // subversion
87 TString fLastStorage; // previous storage place (new, grid, local, dump)
88
89 ClassDef(AliCDBId, 1);
90};
91
92#endif