adding getters for the LHC period (OCDB folder) and its first/last run
authorrgrosso <rgrosso@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 24 May 2012 12:49:27 +0000 (12:49 +0000)
committerrgrosso <rgrosso@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 24 May 2012 12:49:27 +0000 (12:49 +0000)
STEER/CDB/AliCDBManager.cxx
STEER/CDB/AliCDBManager.h

index 738f0e9..e3065d1 100644 (file)
@@ -623,7 +623,9 @@ void AliCDBManager::SetDefaultStorage(const char* mcString, const char* simType)
                }
 
                SetDefaultStorage(dbString.Data());
-               if(!fDefaultStorage) AliFatal(Form("%s storage not there! Please check!",fLHCPeriod.Data()));
+               fStartRunLHCPeriod=0;
+               fEndRunLHCPeriod=AliCDBRunRange::Infinity();
+               if(!fDefaultStorage) AliFatal(Form("%s storage not there! Please check!",dbString.Data()));
        }
 }
 //_____________________________________________________________________________
@@ -939,7 +941,7 @@ Bool_t AliCDBManager::SetSnapshotMode(const char* snapshotFileName) {
        return kFALSE;
     }
 
-    Printf("The CDB manager is set in snapshot mode: cache->snapshot->defaultstorage");
+    AliInfo("The CDB manager is set in snapshot mode!");
     fSnapshotMode = kTRUE;
     return kTRUE;
 
@@ -964,6 +966,35 @@ const char* AliCDBManager::GetURI(const char* path) {
 }
 
 //_____________________________________________________________________________
+Int_t AliCDBManager::GetStartRunLHCPeriod(){
+    // get the first run of validity
+    // for the current period
+    // if set
+    if(fStartRunLHCPeriod==-1)
+       AliWarning("Run-range not yet set for the current LHC period.");
+    return fStartRunLHCPeriod;
+}
+
+//_____________________________________________________________________________
+Int_t AliCDBManager::GetEndRunLHCPeriod(){
+    // get the last run of validity
+    // for the current period
+    // if set
+    if(fEndRunLHCPeriod==-1)
+       AliWarning("Run-range not yet set for the current LHC period.");
+    return fEndRunLHCPeriod;
+}
+
+//_____________________________________________________________________________
+TString AliCDBManager::GetLHCPeriod(){
+    // get the current LHC period string
+    //
+    if(fLHCPeriod.IsWhitespace() || fLHCPeriod.IsNull())
+       AliWarning("LHC period (OCDB folder) not yet set");
+    return fLHCPeriod;
+}
+
+//_____________________________________________________________________________
 AliCDBId* AliCDBManager::GetId(const AliCDBPath& path, Int_t runNumber,
        Int_t version, Int_t subVersion) {
 // get the AliCDBId of the valid object from the database (does not retrieve the object)
index 26906a6..c753791 100644 (file)
@@ -134,6 +134,10 @@ class AliCDBManager: public TObject {
        void UnsetSnapshotMode() {fSnapshotMode=kFALSE;}
        void DumpToSnapshotFile(const char* snapshotFileName, Bool_t singleKeys);
   
+       Int_t GetStartRunLHCPeriod();
+       Int_t GetEndRunLHCPeriod();
+       TString GetLHCPeriod();
+
 protected:
 
        static TString fgkCondUri;      // URI of the Conditions data base folder