]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliCDBGrid.h
Parameters of miscalibration in the head of the file (Marian)
[u/mrichter/AliRoot.git] / STEER / AliCDBGrid.h
1 #ifndef ALICDBGRID_H
2 #define ALICDBGRID_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 AliCDBGrid                                               //
10 //  access class to a DataBase in an AliEn storage                 //
11 //                                                                 //
12 /////////////////////////////////////////////////////////////////////
13
14 #include "AliCDBStorage.h"
15 #include "AliCDBManager.h"
16 #include "AliCDBMetaData.h"
17
18 class AliCDBGrid: public AliCDBStorage {
19         friend class AliCDBGridFactory;
20
21 public:
22                   
23         virtual Bool_t IsReadOnly() const {return kFALSE;}
24         virtual Bool_t HasSubVersion() const {return kFALSE;}
25         virtual Bool_t Contains(const char* path) const;
26         virtual Int_t  GetLatestVersion(const char* path, Int_t run);
27         virtual Int_t  GetLatestSubVersion(const char* path, Int_t run, Int_t version);
28         virtual Bool_t IdToFilename(const AliCDBId& id, TString& filename) const;
29
30 protected:
31
32         virtual AliCDBEntry*    GetEntry(const AliCDBId& queryId);
33         virtual TList*          GetEntries(const AliCDBId& queryId);
34         virtual Bool_t          PutEntry(AliCDBEntry* entry);
35         virtual TList*          GetIdListFromFile(const char* fileName);
36
37 private:
38  
39         AliCDBGrid(const char *gridUrl, const char *user, const char* dbFolder, const char *se);
40
41         virtual ~AliCDBGrid();
42
43         AliCDBGrid(const AliCDBGrid& db);
44         AliCDBGrid& operator = (const AliCDBGrid& db);
45
46         Bool_t FilenameToId(TString& filename, AliCDBId& id);
47
48         Bool_t PrepareId(AliCDBId& id);
49         AliCDBId* GetId(const TList& validFileIds, const AliCDBId& query);
50         AliCDBEntry* GetEntryFromFile(TString& filename, const AliCDBId* dataId);
51
52         Bool_t AddTag(TString& foldername, const char* tagname);
53         Bool_t TagFileId(TString& filename, const AliCDBId* id);
54         Bool_t TagFileMetaData(TString& filename, const AliCDBMetaData* md);
55
56 //      Bool_t CheckVersion(const AliCDBId& query, AliCDBId* idToCheck, AliCDBId* result);
57
58         void MakeQueryFilter(Int_t firstRun, Int_t lastRun, const AliCDBPath& pathFilter, Int_t version,
59                                 const AliCDBMetaData* md, TString& result) const;
60
61         virtual void QueryValidFiles();
62
63         TString    fGridUrl;    // Grid Url ("alien://aliendb4.cern.ch:9000")
64         TString    fUser;       // User
65         TString    fDBFolder;   // path of the DB folder
66         TString    fSE;         // Storage Element
67
68 ClassDef(AliCDBGrid, 0)      // access class to a DataBase in an AliEn storage 
69 };
70
71 /////////////////////////////////////////////////////////////////////
72 //                                                                 //
73 //  class AliCDBGridFactory                                        //
74 //                                                                 //
75 /////////////////////////////////////////////////////////////////////
76
77 class AliCDBGridFactory: public AliCDBStorageFactory {
78
79 public:
80
81         virtual Bool_t Validate(const char* gridString);
82         virtual AliCDBParam* CreateParameter(const char* gridString);
83
84 protected:
85         virtual AliCDBStorage* Create(const AliCDBParam* param);
86
87         ClassDef(AliCDBGridFactory, 0);
88 };
89
90 /////////////////////////////////////////////////////////////////////
91 //                                                                 //
92 //  class AliCDBGridParam                                          //
93 //                                                                 //
94 /////////////////////////////////////////////////////////////////////
95
96 class AliCDBGridParam: public AliCDBParam {
97         
98 public:
99         AliCDBGridParam();
100         AliCDBGridParam(const char* gridUrl, const char* user,
101                         const char* dbFolder, const char* se);
102         
103         virtual ~AliCDBGridParam();
104
105         const TString& GridUrl() const {return fGridUrl;};
106         const TString& GetUser() const {return fUser;};
107         const TString& GetDBFolder() const {return fDBFolder;};
108         const TString& GetSE()   const {return fSE;};
109
110         virtual AliCDBParam* CloneParam() const;
111
112         virtual ULong_t Hash() const;
113         virtual Bool_t IsEqual(const TObject* obj) const;
114
115 private:
116         TString fGridUrl;    // Grid url "Host:port"
117         TString fUser;       // User
118         TString fDBFolder;   // path of the DB folder
119         TString fSE;         // Storage Element 
120
121         ClassDef(AliCDBGridParam, 0);
122 };
123
124
125 #endif