]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSClusterFinder.cxx
Fix in ladder width assingment (Stefan)
[u/mrichter/AliRoot.git] / ITS / AliITSClusterFinder.cxx
index 7d53729cfc55e254443cb82432262ac2eaf69905..aa3f4cf7169c5595dbbcfd3558b45ab9d7d883e3 100644 (file)
 #include "AliITSMap.h"
 #include "AliITSgeomTGeo.h"
 #include <TParticle.h>
+#include <TArrayI.h>
 #include "AliMC.h"
 #include "AliLog.h"
 
+using std::endl;
+
 ClassImp(AliITSClusterFinder)
 
 extern AliRun *gAlice;
@@ -50,7 +53,10 @@ fEvent(0),
 fZmin(0),
 fZmax(0),
 fXmin(0),
-fXmax(0){
+fXmax(0),
+fNClusters(0),
+fRawID2ClusID(0)
+{
     // default cluster finder
     // Input:
     //   none.
@@ -58,6 +64,10 @@ fXmax(0){
     //   none.
     // Return:
     //   A default constructed AliITSCulsterFinder
+  for(Int_t i=0; i<2200; i++){
+    fNdet[i]=0;
+    fNlayer[i]=0;
+  }
 }
 //----------------------------------------------------------------------
 AliITSClusterFinder::AliITSClusterFinder(AliITSDetTypeRec* dettyp):
@@ -74,7 +84,10 @@ fEvent(0),
 fZmin(0),
 fZmax(0),
 fXmin(0),
-fXmax(0){
+fXmax(0),
+fNClusters(0),
+fRawID2ClusID(0)
+{
     // default cluster finder
     // Standard constructor for cluster finder
     // Input:
@@ -84,7 +97,10 @@ fXmax(0){
     //   none.
     // Return:
     //   A Standard constructed AliITSCulsterFinder
-
+  for(Int_t i=0; i<2200; i++){
+    fNdet[i]=0;
+    fNlayer[i]=0;
+  }
 }
 //----------------------------------------------------------------------
 AliITSClusterFinder::AliITSClusterFinder(AliITSDetTypeRec* dettyp,
@@ -102,7 +118,10 @@ fEvent(0),
 fZmin(0),
 fZmax(0),
 fXmin(0),
-fXmax(0){
+fXmax(0),
+fNClusters(0),
+fRawID2ClusID(0)
+{
     // default cluster finder
     // Standard + cluster finder constructor
     // Input:
@@ -114,7 +133,11 @@ fXmax(0){
     // Return:
     //   A Standard constructed AliITSCulsterFinder
 
-    fNdigits = fDigits->GetEntriesFast();
+  fNdigits = fDigits->GetEntriesFast();
+  for(Int_t i=0; i<2200; i++){
+    fNdet[i]=0;
+    fNlayer[i]=0;
+  }
 }
 
 //______________________________________________________________________
@@ -132,7 +155,9 @@ AliITSClusterFinder::AliITSClusterFinder(const AliITSClusterFinder &source) :
   fZmin(source.fZmin),
   fZmax(source.fZmax),
   fXmin(source.fXmin),
-  fXmax(source.fXmax) 
+  fXmax(source.fXmax),
+  fNClusters(source.fNClusters),
+  fRawID2ClusID(source.fRawID2ClusID) 
 {
   // Copy constructor
   // Copies are not allowed. The method is protected to avoid misuse.
@@ -462,7 +487,11 @@ MakeCluster(Int_t k,Int_t max,AliBin *bins,UInt_t m,AliITSRecPoint &c) {
   c.SetSigmaZ2(c.GetSigmaZ2()+j*j*q);
 
   bins[k].SetMask(0xFFFFFFFE);
-  
+  if (fRawID2ClusID) { // RS: Register cluster id in raw words list
+    int rwid = bins[k].GetRawID();
+    if (fRawID2ClusID->GetSize()<=rwid) fRawID2ClusID->Set( (rwid+10)<<1 );
+    (*fRawID2ClusID)[rwid] = fNClusters+1; // RS: store clID+1 as a reference to the cluster
+  }
   if (bins[k-max].GetMask() == m) MakeCluster(k-max,max,bins,m,c);
   if (bins[k-1  ].GetMask() == m) MakeCluster(k-1  ,max,bins,m,c);
   if (bins[k+max].GetMask() == m) MakeCluster(k+max,max,bins,m,c);