#include "AliPHOSRawFitterv0.h"
#include "AliPHOSRawFitterv1.h"
#include "AliPHOSRawFitterv2.h"
+#include "AliPHOSRawFitterv3.h"
#include "AliPHOSRawDigiProducer.h"
#include "AliPHOSPulseGenerator.h"
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
const AliPHOSDigit * dig = (const AliPHOSDigit*)fgDigitsArray->At(idig);
if(dig->GetId() <= knEMC &&
Calibrate(dig->GetEnergy(),dig->GetId()) > GetRecoParam()->GetEMCMinE() ){
- phsCells.SetCell(idignew,dig->GetId(), Calibrate(dig->GetEnergy(),dig->GetId()), dig->GetTime());
+ phsCells.SetCell(idignew,dig->GetId(), Calibrate(dig->GetEnergy(),dig->GetId()),
+ CalibrateT(dig->GetTime(),dig->GetId()));
idignew++;
}
}
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
+ ec->SetTOF(emcRP->GetTime()); //Time of flight - already calibrated in EMCRecPoint
//Cells contributing to clusters
ec->SetNCells(cellMult);
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;
const TObjArray* maps = AliPHOSRecoParam::GetMappings();
if(!maps) AliFatal("Cannot retrieve ALTRO mappings!!");
- AliAltroMapping *mapping[4];
- for(Int_t i = 0; i < 4; i++) {
+ AliAltroMapping *mapping[20];
+ for(Int_t i = 0; i < 20; i++) {
mapping[i] = (AliAltroMapping*)maps->At(i);
}
fitter=new AliPHOSRawFitterv1();
else if (strcmp(GetRecoParam()->EMCFitterVersion(),"v2")==0)
fitter=new AliPHOSRawFitterv2();
+ else if (strcmp(GetRecoParam()->EMCFitterVersion(),"v3")==0)
+ fitter=new AliPHOSRawFitterv3();
else
fitter=new AliPHOSRawFitterv0();
}
}
//==================================================================================
+Float_t AliPHOSReconstructor::CalibrateT(Float_t time, Int_t absId)const{
+ // Calibrate EMC digit, i.e. multiply its Amp by a factor read from CDB
+
+ const AliPHOSGeometry *geom = AliPHOSGeometry::GetInstance() ;
+
+ //Determine rel.position of the cell absolute ID
+ Int_t relId[4];
+ geom->AbsToRelNumbering(absId,relId);
+ Int_t module=relId[0];
+ Int_t row =relId[2];
+ Int_t column=relId[3];
+ if(relId[1]){ //CPV
+ return 0. ;
+ }
+ else{ //EMC
+ time += fgCalibData->GetTimeShiftEmc(module,column,row);
+ return time ;
+ }
+}
+//==================================================================================
void AliPHOSReconstructor::FillMisalMatrixes(AliESDEvent* esd)const{
//Store PHOS matrixes in ESD Header