]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliCDBManager.h
fix codding violation in AliTRDseedV1 class
[u/mrichter/AliRoot.git] / STEER / AliCDBManager.h
index 8767e69be662f38e5faa04d607a291ab788aacf9..22bd2b8e486b285ee485f3c498b527976f1ae550 100644 (file)
@@ -13,6 +13,7 @@
 #include <TObject.h>
 #include <TList.h>
 #include <TMap.h>
+#include <TSystem.h>
 
 class AliCDBEntry;
 class AliCDBId;
@@ -26,26 +27,35 @@ class AliCDBParam;
 class AliCDBManager: public TObject {
 
  public:
+       enum DataType {kCondition=0, kReference, kPrivate};
 
        void RegisterFactory(AliCDBStorageFactory* factory);
 
        Bool_t HasStorage(const char* dbString) const;
 
        AliCDBParam* CreateParameter(const char* dbString) const;
+       AliCDBParam* GetCondParam() const {return fCondParam;}
+       AliCDBParam* GetRefParam() const {return fRefParam;}
+       static const char* GetDataTypeName(DataType type);
 
        AliCDBStorage* GetStorage(const char* dbString);
        AliCDBStorage* GetStorage(const AliCDBParam* param);
-       
+
        TList* GetActiveStorages();
 
+       const TMap* GetStorageMap() const {return fStorageMap;}
+       const TList* GetRetrievedIds() const {return fIds;}
+
        void SetDefaultStorage(const char* dbString);
        void SetDefaultStorage(const AliCDBParam* param);
        void SetDefaultStorage(AliCDBStorage *storage);
-       
+       void SetDefaultStorage(const char* runType, const char* simType);
+       void SetDefaultStorageFromRun(Int_t run);
+
        Bool_t IsDefaultStorageSet() const {return fDefaultStorage != 0;}
        AliCDBStorage* GetDefaultStorage() const {return fDefaultStorage;}
-       void UnsetDefaultStorage() {fDefaultStorage = 0x0;}
-       
+       void UnsetDefaultStorage();
+
        void SetSpecificStorage(const char* calibType, const char* dbString);
        void SetSpecificStorage(const char* calibType, AliCDBParam* param);
 
@@ -67,22 +77,35 @@ class AliCDBManager: public TObject {
        AliCDBEntry* Get(const AliCDBPath& path, const AliCDBRunRange& runRange,
                                 Int_t version = -1, Int_t subVersion = -1);
 
+       const char* GetURI(const char* path);                            
+                                
+       AliCDBId* GetId(const AliCDBId& query);
+       AliCDBId* GetId(const AliCDBPath& path, Int_t runNumber=-1,
+                               Int_t version = -1, Int_t subVersion = -1);
+       AliCDBId* GetId(const AliCDBPath& path, const AliCDBRunRange& runRange,
+                                Int_t version = -1, Int_t subVersion = -1);
+
        TList* GetAll(const AliCDBId& query);
        TList* GetAll(const AliCDBPath& path, Int_t runNumber=-1,
                                Int_t version = -1, Int_t subVersion = -1);
        TList* GetAll(const AliCDBPath& path, const AliCDBRunRange& runRange,
                                 Int_t version = -1, Int_t subVersion = -1); 
 
-       Bool_t Put(TObject* object, AliCDBId& id,  AliCDBMetaData* metaData);
-       Bool_t Put(AliCDBEntry* entry);
-               
+       Bool_t Put(TObject* object, AliCDBId& id,
+                       AliCDBMetaData* metaData, const DataType type=kPrivate);
+       Bool_t Put(AliCDBEntry* entry, DataType type=kPrivate);
+
        void SetCacheFlag(Bool_t cacheFlag) {fCache=cacheFlag;}
        Bool_t GetCacheFlag() const {return fCache;}
+       
+       ULong_t SetLock(Bool_t lockFlag=kTRUE, ULong_t key=0);
+       Bool_t GetLock() const {return fLock;}
 
-       void SetRun(Long64_t run);
-       Long64_t GetRun() const {return fRun;}
+       void SetRaw(Bool_t rawFlag){fRaw=rawFlag;}
+       Bool_t GetRaw() const {return fRaw;}
 
-       // AliCDBEntry* Get(const char* path);
+       void SetRun(Int_t run);
+       Int_t GetRun() const {return fRun;}
 
        void DestroyActiveStorages();
        void DestroyActiveStorage(AliCDBStorage* storage);
@@ -94,35 +117,72 @@ class AliCDBManager: public TObject {
        static void Destroy();
        ~AliCDBManager();
 
-       static AliCDBManager* Instance(); 
+       void ClearCache();
+       void UnloadFromCache(const char* path);
+       const TMap* GetEntryCache() const {return &fEntryCache;}
+
+       Bool_t IsShortLived(const char* path);
+
+       static AliCDBManager* Instance(TMap *entryCache = NULL, Int_t run = -1);
+
+       void Init();
+       void InitFromCache(TMap *entryCache, Int_t run);
+  
+protected:
+
+       static TString fgkCondUri;      // URI of the Conditions data base folder
+       static TString fgkRefUri;       // URI of the Reference data base folder
+       static TString fgkMCIdealStorage;       // URI of the MC-Ideal Conditions data base folder form MC data
+       static TString fgkMCFullStorage;        // URI of the MC-Full Conditions data base folder form MC data
+       static TString fgkMCResidualStorage;    // URI of the MC-Residual Conditions data base folder form MC data
+       static TString fgkOCDBFolderXMLfile;    // alien path of the XML file for OCDB folder <--> Run range correspondance
+
+       AliCDBManager() ; 
+       AliCDBManager(const AliCDBManager & source);
+       AliCDBManager & operator=(const AliCDBManager & source);
 
- private:
-               
-       AliCDBManager();
        static AliCDBManager* fgInstance; // AliCDBManager instance
        
        AliCDBStorage* GetActiveStorage(const AliCDBParam* param);
        void PutActiveStorage(AliCDBParam* param, AliCDBStorage* storage);
 
-       void ClearCache();
        void CacheEntry(const char* path, AliCDBEntry* entry);
-       
+
        AliCDBParam* SelectSpecificStorage(const TString& path);
        
 
-       void Init();
-       
+//     void Init();
+       void InitShortLived();
+//     void InitFromCache(TMap *entryCache, Int_t run);
+
+
        TList fFactories;               //! list of registered storage factories
        TMap fActiveStorages;           //! list of active storages
        TMap fSpecificStorages;         //! list of detector-specific storages
+       TMap fEntryCache;               //! cache of the retrieved objects
+
+       TList* fIds;            //! List of the retrieved object Id's (to be streamed to file)
+       TMap* fStorageMap;      //! list of storages (to be streamed to file)
+       TList* fShortLived;     //! List of short lived objects
 
        AliCDBStorage *fDefaultStorage; //! pointer to default storage
        AliCDBStorage *fDrainStorage;   //! pointer to drain storage
 
-       TMap fEntryCache;       //! cache of the retrieved objects
+       AliCDBParam* fCondParam;        // Conditions data storage parameters
+       AliCDBParam* fRefParam;         // Reference data storage parameters
 
+       Int_t fRun;                     //! The run number
        Bool_t fCache;                  //! The cache flag
-       Long64_t fRun;                  //! The run number
+       Bool_t fLock;   //! Lock flag, if ON default storage and run number cannot be reset
+
+       Bool_t fRaw;   // flag to say whether we are in the raw case
+       Int_t fStartRunLHCPeriod; // 1st run of the LHC period set
+       Int_t fEndRunLHCPeriod;   // last run of the LHC period set
+       TString fLHCPeriod;       // LHC period alien folder
+
+private:
+   ULong_t fKey;  //! Key for locking/unlocking
+
 
        ClassDef(AliCDBManager, 0);
 };