]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSReconstructor.cxx
Updated IFC material distribution
[u/mrichter/AliRoot.git] / PHOS / AliPHOSReconstructor.cxx
index 5bfb6fcc782dc3b49b3e2e566b16eaf406959573..32120efb00c57acd58c9c0dd46b479b2821e83c0 100644 (file)
@@ -76,6 +76,9 @@ AliPHOSReconstructor::AliPHOSReconstructor() :
   fgEMCRecPoints= new TObjArray(100) ;
   if (!fgCalibData)
     fgCalibData = new AliPHOSCalibData(-1); //use AliCDBManager's run number
+
+  AliInfo(Form("PHOS bad channel map contains %d bad channel(s).\n",
+               fgCalibData->GetNumOfEmcBadChannels()));
  
 }
 
@@ -137,9 +140,6 @@ void AliPHOSReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree,
   TClonesArray *recParticles  = fPID->GetRecParticles();
   Int_t nOfRecParticles = recParticles->GetEntriesFast();
   
-  esd->SetNumberOfPHOSClusters(nOfRecParticles) ; 
-  esd->SetFirstPHOSCluster(esd->GetNumberOfCaloClusters()) ;
-  
   AliDebug(2,Form("%d rec. particles, option %s",nOfRecParticles,GetOption()));
   
   // Read digits array
@@ -302,6 +302,7 @@ void AliPHOSReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree,
     ec->SetM20(emcRP->GetM2z()) ;               //second moment M2z
     ec->SetNExMax(emcRP->GetNExMax());          //number of local maxima
     ec->SetEmcCpvDistance(ts->GetCpvDistance("r")); //Only radius, what about separate x,z????
+    ec->SetTrackDistance(ts->GetCpvDistance("x"),ts->GetCpvDistance("z")); 
     ec->SetClusterChi2(-1);                     //not yet implemented
     ec->SetTOF(emcRP->GetTime());               //Time of flight - already calibrated in EMCRecPoint
 
@@ -322,7 +323,21 @@ void AliPHOSReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree,
     arrayTrackMatched[0]= ts->GetTrackIndex();
     ec->AddTracksMatched(arrayTrackMatched);
     
-    esd->AddCaloCluster(ec);
+    Int_t index = esd->AddCaloCluster(ec);
+
+    //Set pointer to this cluster in ESD track
+    Int_t nt=esd->GetNumberOfTracks();
+    for (Int_t itr=0; itr<nt; itr++) {
+      AliESDtrack *esdTrack=esd->GetTrack(itr);
+      if(!esdTrack->IsPHOS())
+        continue ;
+      if(esdTrack->GetPHOScluster()==-recpart){ //we store negative cluster number
+        esdTrack->SetPHOScluster(index) ;
+//no garatie that only one track matched this cluster
+//      break ;
+      }
+    }
     delete ec;   
     delete [] fracList;
     delete [] absIdList;