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()));
}
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
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
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;