]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONReconstructor.cxx
move AliCaloRawAnalyzerPeakFinder from Utils to base due to OCDB access
[u/mrichter/AliRoot.git] / MUON / AliMUONReconstructor.cxx
index 10fba9c87c114746c704f1482e49bfc8ebf1f1ad..1acf4b07b96ded65589ed1788a94ee8b4269c807 100644 (file)
 #include "AliMUONVClusterFinder.h"
 #include "AliMUONVClusterServer.h"
 #include "AliMUONVTrackStore.h"
+#include "AliMUONTriggerElectronics.h"
 
 #include "AliMpArea.h"
 #include "AliMpCDB.h"
@@ -135,17 +136,25 @@ fDigitCalibrator(0x0),
 fClusterServer(0x0),
 fTriggerStore(0x0),
 fTrackStore(0x0),
-fClusterStore(0x0)
+fClusterStore(0x0),
+fTriggerProcessor(0x0)  
 {
   /// normal ctor
 
   AliDebug(1,"");
+  
+  // Unload mapping objects
+  // if they have been loaded from the obsolete OCDB mapping objects
+
+  if ( AliMpDDLStore::Instance(false) ) {
+    AliCDBManager::Instance()->UnloadFromCache("MUON/Calib/DDLStore");
+    delete AliMpDDLStore::Instance();
+  }  
 
-  // Unload and delete old mapping
-  AliCDBManager::Instance()->UnloadFromCache("MUON/Calib/Mapping");
-  AliCDBManager::Instance()->UnloadFromCache("MUON/Calib/DDLStore");
-  delete AliMpDDLStore::Instance();
-  delete AliMpSegmentation::Instance();
+  if ( AliMpSegmentation::Instance(false) ) { 
+    AliCDBManager::Instance()->UnloadFromCache("MUON/Calib/Mapping");
+    delete AliMpSegmentation::Instance();
+  }  
 
   // Load mapping
   if ( ! AliMpCDB::LoadDDLStore() ) {
@@ -174,6 +183,7 @@ AliMUONReconstructor::~AliMUONReconstructor()
   delete fTriggerStore;
   delete fTrackStore;
   delete fClusterStore;
+  delete fTriggerProcessor;
 
   delete AliMpSegmentation::Instance(false);
   delete AliMpDDLStore::Instance(false);
@@ -411,16 +421,14 @@ AliMUONReconstructor::CreateClusterServer() const
 
 //_____________________________________________________________________________
 void
-AliMUONReconstructor::CreateCalibrator() const
+AliMUONReconstructor::CreateCalibrationData() const
 {
   /// Create the calibrator
   
-  AliCodeTimerAuto("",0)
+  AliCodeTimerAuto("",0);
   
   Int_t runNumber = AliCDBManager::Instance()->GetRun();
 
-  AliInfo("Calibration will occur.");
-  
   fCalibrationData = new AliMUONCalibrationData(runNumber);
   if ( !fCalibrationData->IsValid() )
   {
@@ -476,7 +484,21 @@ AliMUONReconstructor::CreateCalibrator() const
       }
     } 
   }
-  
+}
+
+//_____________________________________________________________________________
+void
+AliMUONReconstructor::CreateCalibrator() const
+{
+  /// Create the calibrator
+
+  AliCodeTimerAuto("",0);
+
+  if ( ! fCalibrationData )
+    CreateCalibrationData();
+
+  AliInfo("Calibration will occur.");
+
   TString opt(GetOption());
   opt.ToUpper();
   
@@ -490,6 +512,23 @@ AliMUONReconstructor::CreateCalibrator() const
   fDigitCalibrator = new AliMUONDigitCalibrator(*fCalibrationData,GetRecoParam(),calibMode.Data());
 }
 
+//_____________________________________________________________________________
+void
+AliMUONReconstructor::ResponseRemovingChambers(AliMUONVTriggerStore* triggerStore) const
+{
+  /// Update trigger information with informatins obtained after
+  /// re-calculation of trigger response
+  AliCodeTimerAuto("",0);
+
+  if ( ! fCalibrationData )
+    CreateCalibrationData();
+
+  if ( ! fTriggerProcessor )
+    fTriggerProcessor = new AliMUONTriggerElectronics(fCalibrationData);
+
+  fTriggerProcessor->ResponseRemovingChambers(*triggerStore);
+}
+
 //_____________________________________________________________________________
 AliMUONVDigitStore*
 AliMUONReconstructor::DigitStore() const
@@ -543,6 +582,7 @@ AliMUONReconstructor::FillTreeR(AliMUONVTriggerStore* triggerStore,
   
   if ( triggerStore ) 
   {
+    ResponseRemovingChambers(triggerStore);
     ok = triggerStore->Connect(clustersTree,alone);
     if (!ok)
     {