]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALClusterizer.cxx
Added method for filling TProfile
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALClusterizer.cxx
index ad7a237941ef4221e4d27900096b3882f7273c60..69519eb5243b4e32b7d47051675b865993dad946 100644 (file)
@@ -56,10 +56,12 @@ class TSystem;
 #include "AliEMCALCalibData.h"
 class AliCDBStorage;
 #include "AliCDBEntry.h"
-#include "AliEMCALUnfolding.h"
 
 ClassImp(AliEMCALClusterizer)
 
+Bool_t AliEMCALClusterizer::fgkIsInputCalibrated = kFALSE;
+
+
 //____________________________________________________________________________
 AliEMCALClusterizer::AliEMCALClusterizer():
   fDigitsArr(NULL),
@@ -193,8 +195,10 @@ Float_t  AliEMCALClusterizer::Calibrate(const Float_t amp, const Float_t time, c
     Bool_t bCell = fGeom->GetCellIndex(absId, iSupMod, nModule, nIphi, nIeta) ;
     if(!bCell) {
       fGeom->PrintGeometry();
-      Error("Calibrate()"," Wrong cell id number : %i", absId);
-      assert(0);
+      AliError(Form("Wrong cell id number : %i", absId));
+      //assert(0); // GCB: This aborts reconstruction of raw simulations where simulation had more SM than default geometry, 
+      //change to return 0, to avoid aborting good generations.
+      return 0;
     }
     
     fGeom->GetCellPhiEtaIndexInSModule(iSupMod,nModule,nIphi, nIeta,iphi,ieta);
@@ -210,15 +214,30 @@ Float_t  AliEMCALClusterizer::Calibrate(const Float_t amp, const Float_t time, c
     }
     //Check if time is too large or too small, indication of a noisy channel, remove in this case
     if(time > fTimeMax || time < fTimeMin) return 0;
+    
+    if (AliEMCALClusterizer::fgkIsInputCalibrated == kTRUE)
+    {
+      AliDebug(10, Form("Input already calibrated!"));
+      return amp;
+    }
          
     fADCchannelECA  = fCalibData->GetADCchannel (iSupMod,ieta,iphi);
     fADCpedestalECA = fCalibData->GetADCpedestal(iSupMod,ieta,iphi);
     
+    
     return -fADCpedestalECA + amp * fADCchannelECA ;        
     
   }
-  else //Return energy with default parameters if calibration is not available
+  else{ //Return energy with default parameters if calibration is not available
+    
+    if (AliEMCALClusterizer::fgkIsInputCalibrated == kTRUE)
+    {
+      AliDebug(10, Form("Input already calibrated!"));
+      return amp;
+    }    
+    
     return -fADCpedestalECA + amp * fADCchannelECA ; 
+  }
   
 }
 
@@ -338,7 +357,7 @@ void AliEMCALClusterizer::InitParameters()
         fPar6[i] = recParam->GetPar6(i);
       }//end of loop over parameters
       
-      fClusterUnfolding=new AliEMCALUnfolding(fGeom,fECALocMaxCut,fSSPars,fPar5,fPar6);
+      InitClusterUnfolding();
       
       for (i = 0; i < 8; i++) {
         AliDebug(1,Form("unfolding shower shape parameters: fSSPars=%f \n",fSSPars[i]));
@@ -480,5 +499,14 @@ void AliEMCALClusterizer::SetOutput(TTree *clustersTree)
   fTreeR->Branch("EMCALECARP", "TObjArray", &fRecPoints, bufsize, split);
 }
 
+//___________________________________________________________________
+void   AliEMCALClusterizer::SetInputCalibrated(Bool_t val)
+{
+  //
+  // input is calibrated - the case when we run already on ESD
+  //
+  AliEMCALClusterizer::fgkIsInputCalibrated = val;
+}
+