]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSMultReconstructor.cxx
AddTaskFemto for train update
[u/mrichter/AliRoot.git] / ITS / AliITSMultReconstructor.cxx
index 6c0c60225ea7598ff622c6c52488e0c7427971b5..899d404b02a0ce8e1f98ca8adce7f6313df7c171 100644 (file)
@@ -157,6 +157,7 @@ fhphiClustersLay1(0),
   fRecoDone(0),
   fSPDSeg()
 {
+  // default c-tor
   for (int i=0;i<2;i++) {
     fNFiredChips[i] = 0;
     fClArr[i] = 0;
@@ -442,7 +443,7 @@ void AliITSMultReconstructor::Reconstruct(TTree* clusterTree, Float_t* vtx, Floa
 
 
 //____________________________________________________________________
-void AliITSMultReconstructor::ReconstructMix(TTree* clusterTree, TTree* clusterTreeMix, Float_t* vtx, Float_t*) 
+void AliITSMultReconstructor::ReconstructMix(TTree* clusterTree, TTree* clusterTreeMix, const Float_t* vtx, Float_t*) 
 {
   //
   // RS NOTE - this is old reconstructor invocation, to be used from VertexFinder and in analysis mode
@@ -643,7 +644,7 @@ void AliITSMultReconstructor::LoadClusterArrays(TTree* itsClusterTree, int il)
   // count clusters
   // loop over the SPD subdetectors
   int nclLayer = 0;
-  int detMin = AliITSgeomTGeo::GetModuleIndex(il+1,1,1);
+  int detMin = TMath::Max(0,AliITSgeomTGeo::GetModuleIndex(il+1,1,1));
   int detMax = AliITSgeomTGeo::GetModuleIndex(il+2,1,1);
   for (int idt=detMin;idt<detMax;idt++) {
     if (!fCreateClustersCopy) itsClusters = rpcont->UncheckedGetClusters(idt);
@@ -656,7 +657,8 @@ void AliITSMultReconstructor::LoadClusterArrays(TTree* itsClusterTree, int il)
       if (!cluster) continue;
       if (fCreateClustersCopy)         cluster = new ((*fClArr[il])[nclLayer]) AliITSRecPoint(*cluster);
       clArr.AddAtAndExpand(cluster,nclLayer++);
-      nClustersInChip[ fSPDSeg.GetChipFromLocal(0,cluster->GetDetLocalZ()) ]++; 
+      Int_t chipNo = fSPDSeg.GetChipFromLocal(0,cluster->GetDetLocalZ());
+      if(chipNo>=0)nClustersInChip[ chipNo ]++; 
     }
     for(Int_t ifChip=5;ifChip--;) if (nClustersInChip[ifChip]) fNFiredChips[il]++;
   }
@@ -711,7 +713,8 @@ void AliITSMultReconstructor::LoadClusterFiredChips(TTree* itsClusterTree) {
   fNFiredChips[1] = 0;
   
   AliITSRecPointContainer* rpcont=AliITSRecPointContainer::Instance();
-  TClonesArray* itsClusters=rpcont->FetchClusters(0,itsClusterTree);
+  TClonesArray* itsClusters=NULL;
+  rpcont->FetchClusters(0,itsClusterTree);
   if(!rpcont->IsSPDActive()){
     AliWarning("No SPD rec points found, multiplicity not calculated");
     return;
@@ -726,14 +729,16 @@ void AliITSMultReconstructor::LoadClusterFiredChips(TTree* itsClusterTree) {
     // number of clusters in each chip of the current module
     Int_t nClustersInChip[5] = {0,0,0,0,0};
     Int_t layer = 0;
+    Int_t ladder=0;
+    Int_t det=0;
+    AliITSgeomTGeo::GetModuleId(iIts,layer,ladder,det);
+    --layer;  // layer is from 1 to 6 in AliITSgeomTGeo, but from 0 to 5 here
+    if(layer<0 || layer >1)continue;
     
     // loop over clusters
     while(nClusters--) {
       AliITSRecPoint* cluster = (AliITSRecPoint*)itsClusters->UncheckedAt(nClusters);
-      
-      layer = cluster->GetLayer();
-      if (layer>1) continue;            
-
+          
       // find the chip for the current cluster
       Float_t locz = cluster->GetDetLocalZ();
       Int_t iChip = fSPDSeg.GetChipFromLocal(0,locz);
@@ -775,8 +780,9 @@ AliITSMultReconstructor::SaveHists() {
 }
 
 //____________________________________________________________________
-void AliITSMultReconstructor::FlagClustersInOverlapRegions (Int_t iC1, Int_t iC2WithBestDist) {
-
+void AliITSMultReconstructor::FlagClustersInOverlapRegions (Int_t iC1, Int_t iC2WithBestDist) 
+{
+  // Flags clusters in the overlapping regions
   Float_t distClSameMod=0.;
   Float_t distClSameModMin=0.;
   Int_t   iClOverlap =0;