]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONCalibrationData.cxx
Moving of the QA checker from rec to base, as it is used also during simulation.
[u/mrichter/AliRoot.git] / MUON / AliMUONCalibrationData.cxx
index d3eb1ec0cb5bf7c77725e876552c89c685b35ab7..b803047137eb26dd56e4f720a1fd4dd96c7f57e3 100644 (file)
@@ -75,7 +75,8 @@ fTriggerEfficiency(0x0),
 fCapacitances(0x0),
 fNeighbours(0x0),
 fOccupancyMap(0x0),
-fRejectList(0x0)
+fRejectList(0x0),
+fConfig(0x0)
 {
 /// Default ctor.
 
@@ -100,6 +101,7 @@ fRejectList(0x0)
     TriggerEfficiency();
     Capacitances();
     Neighbours();
+    Config();
   }
 }
 
@@ -192,7 +194,7 @@ AliMUONCalibrationData::CreateObject(Int_t runNumber, const char* path, Int_t* s
   /// Access the CDB for a given path (e.g. MUON/Calib/Pedestals),
   /// and return the corresponding TObject.
   
-  AliCodeTimerAutoClass(Form("%d : %s",runNumber,path));
+  AliCodeTimerAutoClass(Form("%d : %s",runNumber,path),0);
   
   AliCDBManager* man = AliCDBManager::Instance();
   
@@ -214,7 +216,7 @@ AliMUONCalibrationData::CreateObject(Int_t runNumber, const char* path, Int_t* s
        
   {
     
-  AliCodeTimerAutoClass(Form("Failed to get %s for run %d",path,runNumber));
+    AliCodeTimerAutoClass(Form("Failed to get %s for run %d",path,runNumber),1);
 
   }
   
@@ -245,6 +247,14 @@ AliMUONCalibrationData::CreatePedestals(Int_t runNumber, Int_t* startOfValidity)
   return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Pedestals",startOfValidity));
 }
 
+//_____________________________________________________________________________
+AliMUONVStore*
+AliMUONCalibrationData::CreateConfig(Int_t runNumber, Int_t* startOfValidity)
+{
+  /// Create a new config store from the OCDB for a given run
+  return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Config",startOfValidity));
+}
+
 
 //_____________________________________________________________________________
 AliMUONRegionalTriggerConfig*
@@ -429,6 +439,19 @@ AliMUONCalibrationData::Pedestals() const
   return fPedestals;
 }
 
+//_____________________________________________________________________________
+AliMUONVStore*
+AliMUONCalibrationData::Config() const
+{
+  /// Return config
+  
+  if (!fConfig)
+  {
+    fConfig = CreateConfig(fRunNumber);
+  }
+  return fConfig;
+}
+
 //_____________________________________________________________________________
 AliMUONVCalibParam*
 AliMUONCalibrationData::Pedestals(Int_t detElemId, Int_t manuId) const
@@ -455,6 +478,7 @@ AliMUONCalibrationData::Print(Option_t*) const
   cout << "RunNumber " << RunNumber()
   << " fGains=" << fGains
   << " fPedestals=" << fPedestals
+  << " fConfig=" << fConfig
   << " fHV=" << fHV
   << " fTriggerDCS=" << fTriggerDCS
   << " fLocalTriggerBoardMasks=" << fLocalTriggerBoardMasks
@@ -512,6 +536,8 @@ AliMUONCalibrationData::Reset()
 {
 /// Reset all data
 
+  delete fConfig;
+  fConfig = 0x0;
   delete fPedestals;
   fPedestals = 0x0;
   delete fGains;
@@ -615,6 +641,15 @@ AliMUONCalibrationData::Check(Int_t runNumber)
   {
     AliInfoClass("Pedestals read OK");
   }
+
+  if ( ! CreateConfig(runNumber) )
+  {
+    AliErrorClass("Could not read config");
+  }
+  else
+  {
+    AliInfoClass("Config read OK");
+  }
   
   if ( ! CreateRegionalTriggerConfig(runNumber) )
   {