]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/CALO/AliHLTCaloClusterizer.cxx
- adding use of associated cluster for digits
[u/mrichter/AliRoot.git] / HLT / CALO / AliHLTCaloClusterizer.cxx
index 882aa3de19c295290bb4b9e240e3dee718837b70..0b142a4e703c67e35b6b2c6731c68fbdb2ad9705 100644 (file)
@@ -111,12 +111,21 @@ AliHLTCaloClusterizer::ClusterizeEvent(Int_t nDigits)
     {\r
         fDigitsInCluster = 0;\r
 \r
-        if (fDigitsPointerArray[i]->fEnergy < fEmcClusteringThreshold)\r
+        HLTDebug("Digit with energy: %f", fDigitsPointerArray[i]->fEnergy);\r
+       \r
+        if (fDigitsPointerArray[i]->fEnergy < fEmcClusteringThreshold && fSortedByEnergy)\r
         {\r
-            continue;\r
-        }\r
+          // Since we have sorted by energy the next digit will have even lower energy, so we return \r
+          return fNRecPoints;\r
+       }\r
+\r
+       if(fDigitsPointerArray[i]->fAssociatedCluster != -1)\r
+       {\r
+          // The digit is added to a previous cluster, continue\r
+          continue;\r
+       }\r
 \r
-        CheckArray();\r
+       CheckArray();\r
         CheckBuffer();\r
 \r
         // First digit is placed at the fDigits member variable in the recpoint\r
@@ -133,8 +142,13 @@ AliHLTCaloClusterizer::ClusterizeEvent(Int_t nDigits)
         fDigitIndexPtr++;\r
 \r
         fRecPointDataPtr->fAmp += fDigitsPointerArray[i]->fEnergy;\r
-        fDigitsPointerArray[i]->fEnergy = 0;\r
-        fDigitsInCluster++;\r
+    \r
+       \r
+       //fDigitsPointerArray[i]->fEnergy = 0;\r
+        fDigitsPointerArray[i]->fAssociatedCluster = fNRecPoints;\r
+       \r
+       \r
+       fDigitsInCluster++;\r
         nRecPoints++;\r
 \r
         // Scanning for the neighbours\r
@@ -172,7 +186,7 @@ AliHLTCaloClusterizer::ScanForNeighbourDigits(Int_t index, AliHLTCaloRecPointDat
 \r
     for (Int_t j = min; j < max; j++)\r
     {\r
-        if (fDigitsPointerArray[j]->fEnergy > fEmcMinEnergyThreshold)\r
+        if (fDigitsPointerArray[j]->fAssociatedCluster == -1 &&  fDigitsPointerArray[j]->fEnergy > fEmcMinEnergyThreshold)\r
         {\r
             if (j != index)\r
             {\r
@@ -192,9 +206,14 @@ AliHLTCaloClusterizer::ScanForNeighbourDigits(Int_t index, AliHLTCaloRecPointDat
                     // Adding the digit energy to the rec point\r
                     fRecPointDataPtr->fAmp += fDigitsPointerArray[j]->fEnergy;\r
 \r
-                    // Setting the digit energy to 0 (not included in clusterisation anymore)\r
-                    fDigitsPointerArray[j]->fEnergy = 0;\r
-\r
+                    // Setting energy to 0\r
+                   //fDigitsPointerArray[j]->fEnergy = 0;\r
+                   \r
+                   // Setting the associated cluster \r
+                   fDigitsPointerArray[j]->fAssociatedCluster = fNRecPoints;\r
+                   \r
+                   HLTDebug("Added digit with index: %d, energy: %f, to associated cluster: %d", fDigitsPointerArray[j]->fID, fDigitsPointerArray[j]->fEnergy, fDigitsPointerArray[j]->fAssociatedCluster);\r
+                   \r
                     fDigitsInCluster++;\r
 \r
                     // Scan for neighbours of this digit\r