]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALClusterizerNxN.cxx
proper linking for libHLTrec.so
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALClusterizerNxN.cxx
index 3fae8d5e14c41c7c75f55f95c7955ab89cc74408..0e5ee37236fe223c2332135fee650d0e79cfc4ba 100644 (file)
@@ -233,13 +233,16 @@ void AliEMCALClusterizerNxN::MakeClusters()
   fNumberOfECAClusters = 0;
   fRecPoints->Delete();
   
-  // Set up TObjArray with pointers to digits to work on 
+  // Set up TObjArray with pointers to digits to work on, calibrate digits 
   TObjArray digitsC;
   TIter nextdigit(fDigitsArr);
   AliEMCALDigit *digit = 0;
   while ( (digit = static_cast<AliEMCALDigit*>(nextdigit())) ) {
-    Float_t dEnergyCalibrated = Calibrate(digit->GetAmplitude(), digit->GetTime(),digit->GetId());
+    Float_t dEnergyCalibrated = digit->GetAmplitude();
+    Float_t time              = digit->GetTime();
+    Calibrate(dEnergyCalibrated,time ,digit->GetId());
     digit->SetCalibAmp(dEnergyCalibrated);
+    digit->SetTime(time);    
     digitsC.AddLast(digit);
   }
   
@@ -259,9 +262,12 @@ void AliEMCALClusterizerNxN::MakeClusters()
     while ( (digit = static_cast<AliEMCALDigit *>(nextdigitC())) ) 
     { // scan over the list of digitsC
       Float_t dEnergyCalibrated = digit->GetCalibAmp();
-
-      if (fGeom->CheckAbsCellId(digit->GetId()) && dEnergyCalibrated > fMinECut) // no threshold by default!
-      {                                                                          // needs to be set in OCDB!
+      Float_t time              = digit->GetTime();
+      if (fGeom->CheckAbsCellId(digit->GetId()) &&
+          dEnergyCalibrated > fMinECut          &&
+          time              < fTimeMax          &&
+          time              > fTimeMin             ) // no threshold by default!
+      {                                              // needs to be set in OCDB!
         if (dEnergyCalibrated > dMaxEnergyDigit) 
         {
           dMaxEnergyDigit = dEnergyCalibrated;
@@ -313,9 +319,11 @@ void AliEMCALClusterizerNxN::MakeClusters()
       if (fNumberOfECAClusters >= fRecPoints->GetSize()) 
         fRecPoints->Expand(2*fNumberOfECAClusters+1);
       
-      AliEMCALRecPoint *recPoint = new  AliEMCALRecPoint(""); 
-      fRecPoints->AddAt(recPoint, fNumberOfECAClusters);
-      recPoint = static_cast<AliEMCALRecPoint *>(fRecPoints->At(fNumberOfECAClusters)); 
+      (*fRecPoints)[fNumberOfECAClusters] = new AliEMCALRecPoint("") ;
+      AliEMCALRecPoint *recPoint = dynamic_cast<AliEMCALRecPoint *>( fRecPoints->At(fNumberOfECAClusters) ) ;
+      // AliEMCALRecPoint *recPoint = new  AliEMCALRecPoint(""); 
+      // fRecPoints->AddAt(recPoint, fNumberOfECAClusters);
+      // recPoint = static_cast<AliEMCALRecPoint *>(fRecPoints->At(fNumberOfECAClusters)); 
       if (recPoint) {
         fNumberOfECAClusters++;       
         recPoint->SetClusterType(AliVCluster::kEMCALClusterv1);
@@ -324,10 +332,9 @@ void AliEMCALClusterizerNxN::MakeClusters()
         for (Int_t idig = 0; idig < clusterDigitList.GetEntries(); idig++)
         {
           digit = (AliEMCALDigit*)clusterDigitList.At(idig);
-          Float_t dEnergyCalibrated = digit->GetCalibAmp();
           AliDebug(5, Form(" Adding digit %d", digit->GetId()));
           // note: this way the sharing info is lost!
-          recPoint->AddDigit(*digit, dEnergyCalibrated, kFALSE); //Time or TimeR?
+          recPoint->AddDigit(*digit, digit->GetCalibAmp(), kFALSE); //Time or TimeR?
           digitsC.Remove(digit);                 
         }
       }// recpoint