]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
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 738f0e99fcf5c06ae2e27ab253129ad983064185..e3065d1c56bb916a22c5af13a3a59cac164861bb 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;
 
@@ -963,6 +965,35 @@ const char* AliCDBManager::GetURI(const char* path) {
        return 0;
 }
 
+//_____________________________________________________________________________
+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) {
index 26906a6054c3b21c7c609d5d848d201468019333..c753791c8a156ee4eb685c5873c3c44174076d4a 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