]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTrackerDataMaker.cxx
parameter set for crude clustering and refined clustering
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackerDataMaker.cxx
index ebb16f0963aee266c71e77810922b4e0bd6cac09..239d7c0d6c7e196e69d2d06cfc930c5aaf8e9627 100644 (file)
@@ -33,6 +33,7 @@
 #include "AliMUONCalibParamND.h"
 #include "AliMUONCalibrationData.h"
 #include "AliMUONDigitCalibrator.h"
+#include "AliMUONLogger.h"
 #include "AliMUONRawStreamTrackerHP.h"
 #include "AliMUONTrackerData.h"
 #include "AliMpDDLStore.h"
@@ -61,8 +62,10 @@ fNumberOfEvents(0),
 fRunNumber(0),
 fIsRunning(kFALSE),
 fIsOwnerOfRawReader(kFALSE),
-fIsEventByEvent(kFALSE)
+fIsEventByEvent(kFALSE),
+fLogger(0x0)
 {
+/// Root IO ctor
 }
 
 //_____________________________________________________________________________
@@ -87,7 +90,8 @@ fNumberOfEvents(0),
 fRunNumber(runNumber),
 fIsRunning(kFALSE),
 fIsOwnerOfRawReader(kFALSE),
-fIsEventByEvent(kFALSE)
+fIsEventByEvent(kFALSE),
+fLogger(0x0)
 {
   /// Ctor in which this object will NOT be the owner of the reader
   /// and can NOT apply rewind to it, nor use Next on it. 
@@ -116,7 +120,8 @@ fNumberOfEvents(0),
 fRunNumber(0),
 fIsRunning(kFALSE),
 fIsOwnerOfRawReader(kTRUE),
-fIsEventByEvent(kFALSE)
+fIsEventByEvent(kFALSE),
+fLogger(0x0)
 {
   /// Ctor in which we take the ownership of the rawReader, so we can rewind
   /// and advance it as we wish
@@ -146,8 +151,10 @@ fNumberOfEvents(0),
 fRunNumber(0),
 fIsRunning(kFALSE),
 fIsOwnerOfRawReader(kTRUE),
-fIsEventByEvent(kFALSE)
+fIsEventByEvent(kFALSE),
+fLogger(0x0)
 {
+  /// Ctor from raw data reader
   if (fRawReader) 
   {
     fRawReader->NextEvent(); // to be sure to get run number available
@@ -168,7 +175,8 @@ AliMUONTrackerDataMaker::Ctor(const AliMUONRecoParam* recoParam,
                               Double_t xmin, Double_t xmax)
 {
   /// "designated constructor"
-  Bool_t calibrate = ( fOCDBPath.Length() > 0 );
+
+  Bool_t calibrate = ( strlen(calibMode) > 0 );
   
   TString name;
   TString type("RAW");
@@ -180,6 +188,7 @@ AliMUONTrackerDataMaker::Ctor(const AliMUONRecoParam* recoParam,
     if ( scalib == "GAIN" ) type = "CALC";
     if ( scalib == "NOGAIN" ) type = "CALZ";
     if ( scalib == "GAINCONSTANTCAPA") type = "CALG";
+    if ( scalib == "INJECTIONGAIN" ) type = "CALE";
   }
   
   if ( !fRunNumber ) 
@@ -209,12 +218,17 @@ AliMUONTrackerDataMaker::Ctor(const AliMUONRecoParam* recoParam,
     // out of sync)
     // But with the current CDBManager implementation, I don't know how to solve
     // this better (e.g. to avoid clearing cache messages and so on).
+
+    AliCDBStorage* storage(0x0);
     
-    AliCDBStorage* storage = AliCDBManager::Instance()->GetDefaultStorage();
-    
-    if ( storage->GetURI() != fOCDBPath.Data() ) 
+    if ( fOCDBPath.Length() > 0 )
     {
-      AliCDBManager::Instance()->SetDefaultStorage(fOCDBPath.Data());
+      storage = AliCDBManager::Instance()->GetDefaultStorage();
+
+      if ( storage && ( storage->GetURI() != fOCDBPath.Data() ) )
+      {
+        AliCDBManager::Instance()->SetDefaultStorage(fOCDBPath.Data());
+      }
     }
     
     fCalibrationData->Pedestals();
@@ -223,7 +237,7 @@ AliMUONTrackerDataMaker::Ctor(const AliMUONRecoParam* recoParam,
     fCalibrationData->HV();
     fCalibrationData->Capacitances();
     
-    if ( storage->GetURI() != fOCDBPath.Data() ) 
+    if ( storage && ( storage->GetURI() != fOCDBPath.Data() ) )
     {
       AliCDBManager::Instance()->SetDefaultStorage(storage);
     }
@@ -236,6 +250,8 @@ AliMUONTrackerDataMaker::Ctor(const AliMUONRecoParam* recoParam,
 //_____________________________________________________________________________
 AliMUONTrackerDataMaker::~AliMUONTrackerDataMaker()
 {
+/// dtor
+
   delete fOneEventData;
   delete fAccumulatedData;
   if ( fIsOwnerOfRawReader ) delete fRawReader;
@@ -284,7 +300,7 @@ AliMUONTrackerDataMaker::NextEvent()
     return kFALSE;
   }
   
-  AliCodeTimerAuto("");
+  AliCodeTimerAuto("",0);
   
   static Int_t nphysics(0);
   static Int_t ngood(0);
@@ -331,12 +347,20 @@ Bool_t AliMUONTrackerDataMaker::ProcessEvent()
   /// duplicate this critical piece of calibration code !
   ///
   
-  AliCodeTimerAuto("");
+  AliCodeTimerAuto("",0);
   
   AliMUONRawStreamTrackerHP stream(fRawReader);
-  
+
   stream.DisableWarnings();
-//  stream.EnabbleErrorLogger();
+  stream.DisableRawReaderErrorLogger();
+  stream.DisableMUONErrorLogger();
+  
+  if (fLogger)
+  {
+    stream.EnableMUONErrorLogger();  
+    stream.SetMUONErrorLogger(fLogger);    
+    stream.SetLoggingDetailLevel(AliMUONRawStreamTrackerHP::kMediumErrorDetail);
+  }
   
   const Int_t nddls = AliDAQ::NumberOfDdls("MUONTRK");
   TArrayI nevents(nddls);
@@ -377,7 +401,11 @@ Bool_t AliMUONTrackerDataMaker::ProcessEvent()
     {
       if ( fDigitCalibrator->IsValidDigit(detElemId, manuId, manuChannel) )
       {
-        charge = fDigitCalibrator->CalibrateDigit(detElemId, manuId, manuChannel,adc,3.0);
+        charge = fDigitCalibrator->CalibrateDigit(detElemId, manuId, manuChannel,adc);
+      }
+      else
+      {
+        charge = 0.0;
       }
     }
     
@@ -393,7 +421,7 @@ Bool_t AliMUONTrackerDataMaker::ProcessEvent()
   {
     fAccumulatedData->Add(*fOneEventData,&nevents);    
   }
-  
+    
   return !badEvent;
 }