]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONCalibrationData.cxx
Updated list of MUON libraries
[u/mrichter/AliRoot.git] / MUON / AliMUONCalibrationData.cxx
index f5374ec948011befb053a464cfa9cd3efd3a92d1..0be3ad8d01bc4112e6394aca55b958de5b3cf9a7 100644 (file)
@@ -59,7 +59,9 @@ fLocalTriggerBoardMasks(0x0),
 fRegionalTriggerBoardMasks(0x0),
 fGlobalTriggerBoardMasks(0x0),
 fTriggerLut(0x0),
-fTriggerEfficiency(0x0)
+fTriggerEfficiency(0x0),
+fCapacitances(0x0),
+fNeighbours(0x0)
 {
 /// Default ctor.
 
@@ -79,24 +81,17 @@ fTriggerEfficiency(0x0)
     OnDemandGlobalTriggerBoardMasks();
     OnDemandTriggerLut();
     OnDemandTriggerEfficiency();
+    OnDemandCapacitances();
+    OnDemandNeighbours();
   }
 }
 
 //_____________________________________________________________________________
 AliMUONCalibrationData::~AliMUONCalibrationData()
 {
-/// Destructor. Note that we're the owner of our pointers.
-
-  delete fPedestals;
-  delete fGains;
-  delete fHV;
-  delete fLocalTriggerBoardMasks;
-  delete fRegionalTriggerBoardMasks;
-  delete fGlobalTriggerBoardMasks;
-  delete fTriggerLut;
-  delete fTriggerEfficiency;
+  /// Destructor. Note that we're the owner of our pointers.
+  Reset();
 }
-
 //_____________________________________________________________________________
 TMap*
 AliMUONCalibrationData::HV() const
@@ -158,6 +153,22 @@ AliMUONCalibrationData::Gains(Int_t detElemId, Int_t manuId) const
   return static_cast<AliMUONVCalibParam*>(gains->Get(detElemId,manuId));
 }
 
+//_____________________________________________________________________________
+AliMUONV1DStore*
+AliMUONCalibrationData::Capacitances() const
+{
+  /// Create (if needed) and return the internal store for capacitances.
+  return OnDemandCapacitances();
+}
+
+//_____________________________________________________________________________
+AliMUONV2DStore*
+AliMUONCalibrationData::Neighbours() const
+{
+  /// Create (if needed) and return the internal store for neighbours.
+  return OnDemandNeighbours();
+}
+
 //_____________________________________________________________________________
 AliMUONV2DStore*
 AliMUONCalibrationData::Gains() const
@@ -166,6 +177,56 @@ AliMUONCalibrationData::Gains() const
   return OnDemandGains();
 }
 
+//_____________________________________________________________________________
+AliMUONV2DStore*
+AliMUONCalibrationData::OnDemandNeighbours() const
+{
+  /// Create (if needed) and return the internal store for neighbours.
+  
+  if (!fNeighbours)
+  {
+    AliCDBEntry* entry = GetEntry("MUON/Calib/Neighbours");
+    if (entry)
+    {
+      fNeighbours = dynamic_cast<AliMUONV2DStore*>(entry->GetObject());
+      if (!fNeighbours)
+      {
+        AliError("Neighbours not of the expected type !!!");
+      }
+    }
+    else
+    {
+      AliError("Could not get neighbours !");
+    }
+  }
+  return fNeighbours;
+}
+
+//_____________________________________________________________________________
+AliMUONV1DStore*
+AliMUONCalibrationData::OnDemandCapacitances() const
+{
+  /// Create (if needed) and return the internal store for capacitances.
+  
+  if (!fCapacitances)
+  {
+    AliCDBEntry* entry = GetEntry("MUON/Calib/Capacitances");
+    if (entry)
+    {
+      fCapacitances = dynamic_cast<AliMUONV1DStore*>(entry->GetObject());
+      if (!fCapacitances)
+      {
+        AliError("Capacitances not of the expected type !!!");
+      }
+    }
+    else
+    {
+      AliError("Could not get capacitances !");
+    }
+  }
+  return fCapacitances;
+}
+
 //_____________________________________________________________________________
 AliMUONV2DStore*
 AliMUONCalibrationData::OnDemandGains() const
@@ -191,6 +252,7 @@ AliMUONCalibrationData::OnDemandGains() const
   return fGains;
 }
 
+
 //_____________________________________________________________________________
 AliMUONVCalibParam* 
 AliMUONCalibrationData::GlobalTriggerBoardMasks() const
@@ -455,5 +517,33 @@ AliMUONCalibrationData::OnDemandTriggerLut() const
   return fTriggerLut;
 }
 
+//_____________________________________________________________________________
+void
+AliMUONCalibrationData::Reset()
+{
+/// Reset all data
+
+  delete fPedestals;
+  fPedestals = 0x0;
+  delete fGains;
+  fGains = 0x0;
+  delete fHV;
+  fHV = 0x0;
+  delete fLocalTriggerBoardMasks;
+  fLocalTriggerBoardMasks = 0x0;
+  delete fRegionalTriggerBoardMasks;
+  fRegionalTriggerBoardMasks = 0x0;
+  delete fGlobalTriggerBoardMasks;
+  fGlobalTriggerBoardMasks = 0x0;
+  delete fTriggerLut;
+  fTriggerLut = 0x0;
+  delete fTriggerEfficiency;
+  fTriggerEfficiency = 0x0;
+  delete fCapacitances;
+  fCapacitances = 0x0;
+  delete fNeighbours;
+  fNeighbours = 0x0;
+}
+