* provided "as is" without express or implied warranty. *
**************************************************************************/
-/* $Id: AliEMCALRecoUtils.cxx 33808 2009-07-15 09:48:08Z gconesab $ */
+/* $Id: AliEMCALRecoUtils.cxx | Sun Dec 8 06:56:48 2013 +0100 | Constantin Loizides $ */
///////////////////////////////////////////////////////////////////////////////
//
#include "AliTrackerBase.h"
#include "AliEMCALPIDUtils.h"
-
ClassImp(AliEMCALRecoUtils)
//_____________________________________
fRejectExoticCluster(kFALSE), fRejectExoticCells(kFALSE),
fExoticCellFraction(0), fExoticCellDiffTime(0), fExoticCellMinAmplitude(0),
fPIDUtils(), fAODFilterMask(0),
+ fAODHybridTracks(0), fAODTPCOnlyTracks(0),
fMatchedTrackIndex(0x0), fMatchedClusterIndex(0x0),
fResidualEta(0x0), fResidualPhi(0x0), fCutEtaPhiSum(kFALSE), fCutEtaPhiSeparate(kFALSE),
fCutR(0), fCutEta(0), fCutPhi(0),
fClusterWindow(0), fMass(0),
fStepSurface(0), fStepCluster(0),
+ fITSTrackSA(kFALSE), fEMCalSurfaceDistance(430.),
fTrackCutsType(0), fCutMinTrackPt(0), fCutMinNClusterTPC(0),
fCutMinNClusterITS(0), fCutMaxChi2PerClusterTPC(0), fCutMaxChi2PerClusterITS(0),
fCutRequireTPCRefit(kFALSE), fCutRequireITSRefit(kFALSE), fCutAcceptKinkDaughters(kFALSE),
- fCutMaxDCAToVertexXY(0), fCutMaxDCAToVertexZ(0), fCutDCAToVertex2D(kFALSE)
+ fCutMaxDCAToVertexXY(0), fCutMaxDCAToVertexZ(0), fCutDCAToVertex2D(kFALSE),
+ fCutRequireITSStandAlone(kFALSE), fCutRequireITSpureSA(kFALSE)
{
//
// Constructor.
fResidualEta = new TArrayF();
fPIDUtils = new AliEMCALPIDUtils();
- InitTrackCuts();
}
//______________________________________________________________________
fExoticCellFraction(reco.fExoticCellFraction), fExoticCellDiffTime(reco.fExoticCellDiffTime),
fExoticCellMinAmplitude(reco.fExoticCellMinAmplitude),
fPIDUtils(reco.fPIDUtils), fAODFilterMask(reco.fAODFilterMask),
+ fAODHybridTracks(reco.fAODHybridTracks), fAODTPCOnlyTracks(reco.fAODTPCOnlyTracks),
fMatchedTrackIndex( reco.fMatchedTrackIndex? new TArrayI(*reco.fMatchedTrackIndex):0x0),
fMatchedClusterIndex(reco.fMatchedClusterIndex?new TArrayI(*reco.fMatchedClusterIndex):0x0),
fResidualEta( reco.fResidualEta? new TArrayF(*reco.fResidualEta):0x0),
fCutR(reco.fCutR), fCutEta(reco.fCutEta), fCutPhi(reco.fCutPhi),
fClusterWindow(reco.fClusterWindow),
fMass(reco.fMass), fStepSurface(reco.fStepSurface), fStepCluster(reco.fStepCluster),
+ fITSTrackSA(reco.fITSTrackSA), fEMCalSurfaceDistance(430.),
fTrackCutsType(reco.fTrackCutsType), fCutMinTrackPt(reco.fCutMinTrackPt),
fCutMinNClusterTPC(reco.fCutMinNClusterTPC), fCutMinNClusterITS(reco.fCutMinNClusterITS),
fCutMaxChi2PerClusterTPC(reco.fCutMaxChi2PerClusterTPC), fCutMaxChi2PerClusterITS(reco.fCutMaxChi2PerClusterITS),
fCutRequireTPCRefit(reco.fCutRequireTPCRefit), fCutRequireITSRefit(reco.fCutRequireITSRefit),
fCutAcceptKinkDaughters(reco.fCutAcceptKinkDaughters), fCutMaxDCAToVertexXY(reco.fCutMaxDCAToVertexXY),
- fCutMaxDCAToVertexZ(reco.fCutMaxDCAToVertexZ), fCutDCAToVertex2D(reco.fCutDCAToVertex2D)
+ fCutMaxDCAToVertexZ(reco.fCutMaxDCAToVertexZ), fCutDCAToVertex2D(reco.fCutDCAToVertex2D),
+ fCutRequireITSStandAlone(reco.fCutRequireITSStandAlone), fCutRequireITSpureSA(reco.fCutRequireITSpureSA)
{
//Copy ctor
for(Int_t i = 0; i < 15 ; i++) { fMisalRotShift[i] = reco.fMisalRotShift[i] ;
- fMisalTransShift[i] = reco.fMisalTransShift[i] ; }
+ fMisalTransShift[i] = reco.fMisalTransShift[i] ; }
for(Int_t i = 0; i < 7 ; i++) { fNonLinearityParams[i] = reco.fNonLinearityParams[i] ; }
for(Int_t i = 0; i < 3 ; i++) { fSmearClusterParam[i] = reco.fSmearClusterParam[i] ; }
fPIDUtils = reco.fPIDUtils;
fAODFilterMask = reco.fAODFilterMask;
+ fAODHybridTracks = reco.fAODHybridTracks;
+ fAODTPCOnlyTracks = reco.fAODTPCOnlyTracks;
fCutEtaPhiSum = reco.fCutEtaPhiSum;
fCutEtaPhiSeparate = reco.fCutEtaPhiSeparate;
fMass = reco.fMass;
fStepSurface = reco.fStepSurface;
fStepCluster = reco.fStepCluster;
-
+ fITSTrackSA = reco.fITSTrackSA;
+ fEMCalSurfaceDistance = reco.fEMCalSurfaceDistance;
+
fTrackCutsType = reco.fTrackCutsType;
fCutMinTrackPt = reco.fCutMinTrackPt;
fCutMinNClusterTPC = reco.fCutMinNClusterTPC;
fCutMaxDCAToVertexXY = reco.fCutMaxDCAToVertexXY;
fCutMaxDCAToVertexZ = reco.fCutMaxDCAToVertexZ;
fCutDCAToVertex2D = reco.fCutDCAToVertex2D;
-
+ fCutRequireITSStandAlone = reco.fCutRequireITSStandAlone;
+ fCutRequireITSpureSA = reco.fCutRequireITSpureSA;
if(reco.fResidualEta)
{
// assign or copy construct
}
//_______________________________________________________________________________
-Bool_t AliEMCALRecoUtils::AcceptCalibrateCell(const Int_t absID, const Int_t bc,
+Bool_t AliEMCALRecoUtils::AcceptCalibrateCell(Int_t absID, Int_t bc,
Float_t & amp, Double_t & time,
AliVCaloCells* cells)
{
//_______________________________________________________________________________
Bool_t AliEMCALRecoUtils::ClusterContainsBadChannel(const AliEMCALGeometry* geom,
const UShort_t* cellList,
- const Int_t nCells)
+ Int_t nCells)
{
// Check that in the cluster cells, there is no bad channel of those stored
// in fEMCALBadChannelMap or fPHOSBadChannelMap
//___________________________________________________________________________
-Float_t AliEMCALRecoUtils::GetECross(const Int_t absID, const Double_t tcell,
- AliVCaloCells* cells, const Int_t bc)
+Float_t AliEMCALRecoUtils::GetECross(Int_t absID, Double_t tcell,
+ AliVCaloCells* cells, Int_t bc)
{
//Calculate the energy in the cross around the energy given cell
}
//_____________________________________________________________________________________________
-Bool_t AliEMCALRecoUtils::IsExoticCell(const Int_t absID, AliVCaloCells* cells, const Int_t bc)
+Bool_t AliEMCALRecoUtils::IsExoticCell(Int_t absID, AliVCaloCells* cells, Int_t bc)
{
// Look to cell neighbourhood and reject if it seems exotic
// Do before recalibrating the cells
//___________________________________________________________________
Bool_t AliEMCALRecoUtils::IsExoticCluster(const AliVCluster *cluster,
AliVCaloCells *cells,
- const Int_t bc)
+ Int_t bc)
{
// Check if the cluster highest energy tower is exotic
Float_t energy = cluster->E();
+ if(energy < 0.05)
+ {
+ // Clusters with less than 50 MeV or negative are not possible
+ AliInfo(Form("Too Low Cluster energy!, E = %f < 0.05 GeV",energy));
+ return 0;
+ }
+
switch (fNonLinearityFunction)
{
break;
}
+
+ case kBeamTestCorrectedv2:
+ {
+ //From beam test, corrected for material between beam and EMCAL
+ //fNonLinearityParams[0] = 0.983504;
+ //fNonLinearityParams[1] = 0.210106;
+ //fNonLinearityParams[2] = 0.897274;
+ //fNonLinearityParams[3] = 0.0829064;
+ //fNonLinearityParams[4] = 152.299;
+ //fNonLinearityParams[5] = 31.5028;
+ //fNonLinearityParams[6] = 0.968;
+ energy *= fNonLinearityParams[6]/(fNonLinearityParams[0]*(1./(1.+fNonLinearityParams[1]*exp(-energy/fNonLinearityParams[2]))*1./(1.+fNonLinearityParams[3]*exp((energy-fNonLinearityParams[4])/fNonLinearityParams[5]))));
+
+ break;
+ }
case kNoCorrection:
AliDebug(2,"No correction on the energy\n");
fNonLinearityParams[5] = 23.6904;
fNonLinearityParams[6] = 0.978;
}
+
+ if(fNonLinearityFunction == kBeamTestCorrectedv2)
+ {
+ fNonLinearityParams[0] = 0.983504;
+ fNonLinearityParams[1] = 0.210106;
+ fNonLinearityParams[2] = 0.897274;
+ fNonLinearityParams[3] = 0.0829064;
+ fNonLinearityParams[4] = 152.299;
+ fNonLinearityParams[5] = 31.5028;
+ fNonLinearityParams[6] = 0.968;
+ }
}
//_________________________________________________________
-Float_t AliEMCALRecoUtils::GetDepth(const Float_t energy,
- const Int_t iParticle,
- const Int_t iSM) const
+Float_t AliEMCALRecoUtils::GetDepth(Float_t energy,
+ Int_t iParticle,
+ Int_t iSM) const
{
//Calculate shower depth for a given cluster energy and particle type
Float_t x0 = 1.31;
Float_t ecr = 8;
Float_t depth = 0;
+ Float_t arg = energy*1000/ ecr; //Multiply energy by 1000 to transform to MeV
switch ( iParticle )
{
case kPhoton:
- depth = x0 * (TMath::Log(energy*1000/ ecr) + 0.5); //Multiply energy by 1000 to transform to MeV
+ if (arg < 1)
+ depth = 0;
+ else
+ depth = x0 * (TMath::Log(arg) + 0.5);
break;
case kElectron:
- depth = x0 * (TMath::Log(energy*1000/ ecr) - 0.5); //Multiply energy by 1000 to transform to MeV
+ if (arg < 1)
+ depth = 0;
+ else
+ depth = x0 * (TMath::Log(arg) - 0.5);
break;
case kHadron:
}
else
{//electron
- depth = x0 * (TMath::Log(energy*1000 / ecr) - 0.5); //Multiply energy by 1000 to transform to MeV
+ if (arg < 1)
+ depth = 0;
+ else
+ depth = x0 * (TMath::Log(arg) - 0.5);
}
break;
default://photon
- depth = x0 * (TMath::Log(energy*1000 / ecr) + 0.5); //Multiply energy by 1000 to transform to MeV
+ if (arg < 1)
+ depth = 0;
+ else
+ depth = x0 * (TMath::Log(arg) + 0.5);
}
return depth;
fExoticCellDiffTime = 1e6;
fExoticCellMinAmplitude = 0.5;
- fAODFilterMask = 32;
+ fAODFilterMask = 128;
+ fAODHybridTracks = kFALSE;
+ fAODTPCOnlyTracks = kTRUE;
fCutEtaPhiSum = kTRUE;
fCutEtaPhiSeparate = kFALSE;
fCutMaxDCAToVertexZ = 1e10;
fCutDCAToVertex2D = kFALSE;
+ fCutRequireITSStandAlone = kFALSE; //MARCEL
+ fCutRequireITSpureSA = kFALSE; //Marcel
//Misalignment matrices
for(Int_t i = 0; i < 15 ; i++)
//Non linearity
for(Int_t i = 0; i < 7 ; i++) fNonLinearityParams[i] = 0.;
- //For kBeamTestCorrected case, but default is no correction
- fNonLinearityParams[0] = 0.99078;
- fNonLinearityParams[1] = 0.161499;
- fNonLinearityParams[2] = 0.655166;
- fNonLinearityParams[3] = 0.134101;
- fNonLinearityParams[4] = 163.282;
- fNonLinearityParams[5] = 23.6904;
- fNonLinearityParams[6] = 0.978;
-
- //For kPi0GammaGamma case
- //fNonLinearityParams[0] = 0.1457/0.1349766/1.038;
- //fNonLinearityParams[1] = -0.02024/0.1349766/1.038;
- //fNonLinearityParams[2] = 1.046;
+ //For kBeamTestCorrectedv2 case, but default is no correction
+ fNonLinearityParams[0] = 0.983504;
+ fNonLinearityParams[1] = 0.210106;
+ fNonLinearityParams[2] = 0.897274;
+ fNonLinearityParams[3] = 0.0829064;
+ fNonLinearityParams[4] = 152.299;
+ fNonLinearityParams[5] = 31.5028;
+ fNonLinearityParams[6] = 0.968;
//Cluster energy smearing
fSmearClusterEnergy = kFALSE;
void AliEMCALRecoUtils::RecalibrateClusterEnergy(const AliEMCALGeometry* geom,
AliVCluster * cluster,
AliVCaloCells * cells,
- const Int_t bc)
+ Int_t bc)
{
// Recalibrate the cluster energy and Time, considering the recalibration map
// and the energy of the cells and time that compose the cluster.
cluster->SetE(energy);
- // Recalculate time of cluster
+ // Recalculate time of cluster
Double_t timeorg = cluster->GetTOF();
+
+ Double_t time = cells->GetCellTime(absIdMax);
if(!fCellsRecalibrated && IsTimeRecalibrationOn())
- {
- Double_t time = timeorg;
RecalibrateCellTime(absIdMax,bc,time);
- cluster->SetTOF(time);
- }
- AliDebug(2,Form("AliEMCALRecoUtils::RecalibrateClusterEnergy - Time before %f, after %f \n",timeorg,cluster->GetTOF()));
+ cluster->SetTOF(time);
+ AliDebug(2,Form("AliEMCALRecoUtils::RecalibrateClusterEnergy - Time before %f, after %f \n",timeorg,cluster->GetTOF()));
}
//_____________________________________________________________
void AliEMCALRecoUtils::RecalibrateCells(AliVCaloCells * cells,
- const Int_t bc)
+ Int_t bc)
{
// Recalibrate the cells time and energy, considering the recalibration map and the energy
// of the cells that compose the cluster.
// bc= bunch crossing number returned by esdevent->GetBunchCrossNumber();
- if(!IsRecalibrationOn() && !IsTimeRecalibrationOn()) return;
+ if(!IsRecalibrationOn() && !IsTimeRecalibrationOn() && !IsBadChannelsRemovalSwitchedOn()) return;
if(!cells)
{
Double_t tcell = 0;
Double_t ecellin = 0;
Double_t tcellin = 0;
- Short_t mclabel = -1;
+ Int_t mclabel = -1;
Double_t efrac = 0;
Int_t nEMcell = cells->GetNumberOfCells() ;
}
//_______________________________________________________________________________________________________
-void AliEMCALRecoUtils::RecalibrateCellTime(const Int_t absId, const Int_t bc, Double_t & celltime) const
+void AliEMCALRecoUtils::RecalibrateCellTime(Int_t absId, Int_t bc, Double_t & celltime) const
{
// Recalibrate time of cell with absID considering the recalibration map
// bc= bunch crossing number returned by esdevent->GetBunchCrossNumber();
Bool_t shared = kFALSE;
Float_t clEnergy = clu->E(); //Energy already recalibrated previously
+ if (clEnergy <= 0)
+ return;
GetMaxEnergyCell(geom, cells, clu, absId, iSupModMax, ieta, iphi,shared);
Double_t depth = GetDepth(clEnergy,fParticleType,iSupModMax) ;
Bool_t shared = kFALSE;
Float_t clEnergy = clu->E(); //Energy already recalibrated previously.
+
+ if (clEnergy <= 0)
+ return;
GetMaxEnergyCell(geom, cells, clu, absId, iSupModMax, ieta, iphi,shared);
Float_t depth = GetDepth(clEnergy,fParticleType,iSupMod) ;
Double_t w = 0.;
Double_t etaMean = 0.;
Double_t phiMean = 0.;
+
+ //Loop on cells, calculate the cluster energy, in case a cut on cell energy is added
+ // and to check if the cluster is between 2 SM in eta
+ Int_t iSM0 = -1;
+ Bool_t shared = kFALSE;
+ Float_t energy = 0;
+
+ for(Int_t iDigit=0; iDigit < cluster->GetNCells(); iDigit++)
+ {
+ //Get from the absid the supermodule, tower and eta/phi numbers
+ geom->GetCellIndex(cluster->GetCellAbsId(iDigit),iSupMod,iTower,iIphi,iIeta);
+ geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi,iIeta, iphi,ieta);
+
+ //Check if there are cells of different SM
+ if (iDigit == 0 ) iSM0 = iSupMod;
+ else if(iSupMod!= iSM0) shared = kTRUE;
+
+ //Get the cell energy, if recalibration is on, apply factors
+ fraction = cluster->GetCellAmplitudeFraction(iDigit);
+ if(fraction < 1e-4) fraction = 1.; // in case unfolding is off
+
+ if(IsRecalibrationOn())
+ {
+ recalFactor = GetEMCALChannelRecalibrationFactor(iSupMod,ieta,iphi);
+ }
+ eCell = cells->GetCellAmplitude(cluster->GetCellAbsId(iDigit))*fraction*recalFactor;
+
+ energy += eCell;
+
+ }//cell loop
+
//Loop on cells
for(Int_t iDigit=0; iDigit < cluster->GetNCells(); iDigit++)
{
eCell = cells->GetCellAmplitude(cluster->GetCellAbsId(iDigit))*fraction*recalFactor;
+ // In case of a shared cluster, index of SM in C side, columns start at 48 and ends at 48*2
+ // C Side impair SM, nSupMod%2=1; A side pair SM, nSupMod%2=0
+ if(shared && iSupMod%2) ieta+=AliEMCALGeoParams::fgkEMCALCols;
+
if(cluster->E() > 0 && eCell > 0)
{
w = GetCellWeight(eCell,cluster->E());
}
eCell = cells->GetCellAmplitude(cluster->GetCellAbsId(iDigit))*fraction*recalFactor;
+ // In case of a shared cluster, index of SM in C side, columns start at 48 and ends at 48*2
+ // C Side impair SM, nSupMod%2=1; A side pair SM, nSupMod%2=0
+ if(shared && iSupMod%2) ieta+=AliEMCALGeoParams::fgkEMCALCols;
+
if(cluster->E() > 0 && eCell > 0)
{
w = GetCellWeight(eCell,cluster->E());
// init the magnetic field if not already on
if(!TGeoGlobalMagField::Instance()->GetField())
{
- AliInfo("Init the magnetic field\n");
- if (esdevent)
- {
- esdevent->InitMagneticField();
- }
- else if(aodevent)
- {
- Double_t curSol = 30000*aodevent->GetMagneticField()/5.00668;
- Double_t curDip = 6000 *aodevent->GetMuonMagFieldScale();
- AliMagF *field = AliMagF::CreateFieldMap(curSol,curDip);
- TGeoGlobalMagField::Instance()->SetField(field);
- }
- else
+ if (!event->InitMagneticField())
{
AliInfo("Mag Field not initialized, null esd/aod evetn pointers");
}
} // Init mag field
+ if (esdevent) {
+ UInt_t mask1 = esdevent->GetESDRun()->GetDetectorsInDAQ();
+ UInt_t mask2 = esdevent->GetESDRun()->GetDetectorsInReco();
+ Bool_t desc1 = (mask1 >> 3) & 0x1;
+ Bool_t desc2 = (mask2 >> 3) & 0x1;
+ if (desc1==0 || desc2==0) {
+// AliError(Form("TPC not in DAQ/RECO: %u (%u)/%u (%u)",
+// mask1, esdevent->GetESDRun()->GetDetectorsInReco(),
+// mask2, esdevent->GetESDRun()->GetDetectorsInDAQ()));
+ fITSTrackSA=kTRUE;
+ }
+ }
+
TObjArray *clusterArray = 0x0;
- if(!clusterArr)
- {
- clusterArray = new TObjArray(event->GetNumberOfCaloClusters());
- for(Int_t icl=0; icl<event->GetNumberOfCaloClusters(); icl++)
+ if(!clusterArr)
{
- AliVCluster *cluster = (AliVCluster*) event->GetCaloCluster(icl);
- if(geom && !IsGoodCluster(cluster,geom,(AliVCaloCells*)event->GetEMCALCells())) continue;
- clusterArray->AddAt(cluster,icl);
- }
+ clusterArray = new TObjArray(event->GetNumberOfCaloClusters());
+ for(Int_t icl=0; icl<event->GetNumberOfCaloClusters(); icl++)
+ {
+ AliVCluster *cluster = (AliVCluster*) event->GetCaloCluster(icl);
+ if(geom && !IsGoodCluster(cluster,geom,(AliVCaloCells*)event->GetEMCALCells())) continue;
+ clusterArray->AddAt(cluster,icl);
}
+ }
Int_t matched=0;
Double_t cv[21];
if(esdTrack->Pt()<fCutMinTrackPt) continue;
Double_t phi = esdTrack->Phi()*TMath::RadToDeg();
if(TMath::Abs(esdTrack->Eta())>0.8 || phi <= 20 || phi >= 240 ) continue;
- trackParam = const_cast<AliExternalTrackParam*>(esdTrack->GetInnerParam());
+ if(!fITSTrackSA)
+ trackParam = const_cast<AliExternalTrackParam*>(esdTrack->GetInnerParam()); // if TPC Available
+ else
+ trackParam = new AliExternalTrackParam(*esdTrack); // If ITS Track Standing alone
}
//If the input event is AOD, the starting point for extrapolation is at vertex
{
aodTrack = aodevent->GetTrack(itr);
if(!aodTrack) continue;
- if(!aodTrack->TestFilterMask(fAODFilterMask)) continue; //Select AOD tracks that fulfill GetStandardITSTPCTrackCuts2010()
+
+ if(fAODTPCOnlyTracks) // Match with TPC only tracks, default from May 2013, before filter bit 32
+ {
+ //printf("Match with TPC only tracks, accept? %d, test bit 128 <%d> \n", aodTrack->IsTPCOnly(), aodTrack->TestFilterMask(128));
+ if(!aodTrack->IsTPCOnly()) continue ;
+ }
+ else if(fAODHybridTracks) // Match with hybrid tracks
+ {
+ //printf("Match with Hybrid tracks, accept? %d \n", aodTrack->IsHybridGlobalConstrainedGlobal());
+ if(!aodTrack->IsHybridGlobalConstrainedGlobal()) continue ;
+ }
+ else // Match with tracks on a mask
+ {
+ //printf("Match with tracks having filter bit mask %d, accept? %d \n",fAODFilterMask,aodTrack->TestFilterMask(fAODFilterMask));
+ if(!aodTrack->TestFilterMask(fAODFilterMask) ) continue; //Select AOD tracks
+ }
+
if(aodTrack->Pt()<fCutMinTrackPt) continue;
+
Double_t phi = aodTrack->Phi()*TMath::RadToDeg();
if(TMath::Abs(aodTrack->Eta())>0.8 || phi <= 20 || phi >= 240 ) continue;
Double_t pos[3],mom[3];
aodTrack->GetXYZ(pos);
aodTrack->GetPxPyPz(mom);
AliDebug(5,Form("aod track: i=%d | pos=(%5.4f,%5.4f,%5.4f) | mom=(%5.4f,%5.4f,%5.4f) | charge=%d\n",itr,pos[0],pos[1],pos[2],mom[0],mom[1],mom[2],aodTrack->Charge()));
+
trackParam= new AliExternalTrackParam(pos,mom,cv,aodTrack->Charge());
}
{
printf("Wrong input data type! Should be \"AOD\" or \"ESD\"\n");
if(clusterArray)
- {
- clusterArray->Clear();
- delete clusterArray;
- }
+ {
+ clusterArray->Clear();
+ delete clusterArray;
+ }
return;
}
//Extrapolate the track to EMCal surface
AliExternalTrackParam emcalParam(*trackParam);
- Float_t eta, phi;
- if(!ExtrapolateTrackToEMCalSurface(&emcalParam, 430., fMass, fStepSurface, eta, phi))
- {
- if(aodevent && trackParam) delete trackParam;
- continue;
- }
-
-// if(esdevent)
-// {
-// esdTrack->SetOuterParam(&emcalParam,AliExternalTrackParam::kMultSec);
-// }
+ Float_t eta, phi, pt;
+ if(!ExtrapolateTrackToEMCalSurface(&emcalParam, fEMCalSurfaceDistance, fMass, fStepSurface, eta, phi, pt))
+ {
+ if(aodevent && trackParam) delete trackParam;
+ if(fITSTrackSA && trackParam) delete trackParam;
+ continue;
+ }
if(TMath::Abs(eta)>0.75 || (phi) < 70*TMath::DegToRad() || (phi) > 190*TMath::DegToRad())
- {
- if(aodevent && trackParam) delete trackParam;
- continue;
- }
-
+ {
+ if(aodevent && trackParam) delete trackParam;
+ if(fITSTrackSA && trackParam) delete trackParam;
+ continue;
+ }
//Find matched clusters
Int_t index = -1;
Float_t dEta = -999, dPhi = -999;
if(!clusterArr)
- {
- index = FindMatchedClusterInClusterArr(&emcalParam, &emcalParam, clusterArray, dEta, dPhi);
- }
+ {
+ index = FindMatchedClusterInClusterArr(&emcalParam, &emcalParam, clusterArray, dEta, dPhi);
+ }
else
- {
- index = FindMatchedClusterInClusterArr(&emcalParam, &emcalParam, clusterArr, dEta, dPhi);
- }
+ {
+ index = FindMatchedClusterInClusterArr(&emcalParam, &emcalParam, clusterArr, dEta, dPhi);
+ }
if(index>-1)
{
matched++;
}
if(aodevent && trackParam) delete trackParam;
+ if(fITSTrackSA && trackParam) delete trackParam;
}//track loop
if(clusterArray)
- {
- clusterArray->Clear();
- delete clusterArray;
- }
+ {
+ clusterArray->Clear();
+ delete clusterArray;
+ }
AliDebug(2,Form("Number of matched pairs = %d !\n",matched));
Int_t index = -1;
Double_t phiV = track->Phi()*TMath::RadToDeg();
if(TMath::Abs(track->Eta())>0.8 || phiV <= 20 || phiV >= 240 ) return index;
- AliExternalTrackParam *trackParam = const_cast<AliExternalTrackParam*>(track->GetInnerParam());
+ AliExternalTrackParam *trackParam = 0;
+ if(!fITSTrackSA)
+ trackParam = const_cast<AliExternalTrackParam*>(track->GetInnerParam()); // If TPC
+ else
+ trackParam = new AliExternalTrackParam(*track);
+
if(!trackParam) return index;
AliExternalTrackParam emcalParam(*trackParam);
- Float_t eta, phi;
- if(!ExtrapolateTrackToEMCalSurface(&emcalParam, 430., fMass, fStepSurface, eta, phi)) return index;
- if(TMath::Abs(eta)>0.75 || (phi) < 70*TMath::DegToRad() || (phi) > 190*TMath::DegToRad()) return index;
+ Float_t eta, phi, pt;
+ if(!ExtrapolateTrackToEMCalSurface(&emcalParam, fEMCalSurfaceDistance, fMass, fStepSurface, eta, phi, pt)) {
+ if(fITSTrackSA) delete trackParam;
+ return index;
+ }
+ if(TMath::Abs(eta)>0.75 || (phi) < 70*TMath::DegToRad() || (phi) > 190*TMath::DegToRad()){
+ if(fITSTrackSA) delete trackParam;
+ return index;
+ }
+
TObjArray *clusterArr = new TObjArray(event->GetNumberOfCaloClusters());
for(Int_t icl=0; icl<event->GetNumberOfCaloClusters(); icl++)
index = FindMatchedClusterInClusterArr(&emcalParam, &emcalParam, clusterArr, dEta, dPhi);
clusterArr->Clear();
delete clusterArr;
-
+ if(fITSTrackSA) delete trackParam;
+
return index;
}
Float_t clsPos[3] = {0.,0.,0.};
for(Int_t icl=0; icl<clusterArr->GetEntriesFast(); icl++)
+ {
+ AliVCluster *cluster = dynamic_cast<AliVCluster*> (clusterArr->At(icl)) ;
+ if(!cluster || !cluster->IsEMCAL()) continue;
+ cluster->GetPosition(clsPos);
+ Double_t dR = TMath::Sqrt(TMath::Power(exPos[0]-clsPos[0],2)+TMath::Power(exPos[1]-clsPos[1],2)+TMath::Power(exPos[2]-clsPos[2],2));
+ if(dR > fClusterWindow) continue;
+
+ AliExternalTrackParam trkPamTmp (*trkParam);//Retrieve the starting point every time before the extrapolation
+ if(!ExtrapolateTrackToCluster(&trkPamTmp, cluster, fMass, fStepCluster, tmpEta, tmpPhi)) continue;
+ if(fCutEtaPhiSum)
{
- AliVCluster *cluster = dynamic_cast<AliVCluster*> (clusterArr->At(icl)) ;
- if(!cluster || !cluster->IsEMCAL()) continue;
- cluster->GetPosition(clsPos);
- Double_t dR = TMath::Sqrt(TMath::Power(exPos[0]-clsPos[0],2)+TMath::Power(exPos[1]-clsPos[1],2)+TMath::Power(exPos[2]-clsPos[2],2));
- if(dR > fClusterWindow) continue;
-
- AliExternalTrackParam trkPamTmp (*trkParam);//Retrieve the starting point every time before the extrapolation
- if(!ExtrapolateTrackToCluster(&trkPamTmp, cluster, fMass, fStepCluster, tmpEta, tmpPhi)) continue;
- if(fCutEtaPhiSum)
- {
- Float_t tmpR=TMath::Sqrt(tmpEta*tmpEta + tmpPhi*tmpPhi);
- if(tmpR<dRMax)
+ Float_t tmpR=TMath::Sqrt(tmpEta*tmpEta + tmpPhi*tmpPhi);
+ if(tmpR<dRMax)
{
dRMax=tmpR;
dEtaMax=tmpEta;
dPhiMax=tmpPhi;
index=icl;
}
- }
- else if(fCutEtaPhiSeparate)
- {
- if(TMath::Abs(tmpEta)<TMath::Abs(dEtaMax) && TMath::Abs(tmpPhi)<TMath::Abs(dPhiMax))
+ }
+ else if(fCutEtaPhiSeparate)
+ {
+ if(TMath::Abs(tmpEta)<TMath::Abs(dEtaMax) && TMath::Abs(tmpPhi)<TMath::Abs(dPhiMax))
{
dEtaMax = tmpEta;
dPhiMax = tmpPhi;
index=icl;
}
- }
- else
- {
- printf("Error: please specify your cut criteria\n");
- printf("To cut on sqrt(dEta^2+dPhi^2), use: SwitchOnCutEtaPhiSum()\n");
- printf("To cut on dEta and dPhi separately, use: SwitchOnCutEtaPhiSeparate()\n");
- return index;
- }
}
+ else
+ {
+ printf("Error: please specify your cut criteria\n");
+ printf("To cut on sqrt(dEta^2+dPhi^2), use: SwitchOnCutEtaPhiSum()\n");
+ printf("To cut on dEta and dPhi separately, use: SwitchOnCutEtaPhiSeparate()\n");
+ return index;
+ }
+ }
dEta=dEtaMax;
dPhi=dPhiMax;
return index;
}
+//------------------------------------------------------------------------------------
+Bool_t AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(AliVTrack *track,
+ Double_t emcalR, Double_t mass, Double_t step)
+{
+ // Extrpolate track to EMCAL surface
+
+ track->SetTrackPhiEtaPtOnEMCal(-999, -999, -999);
+
+ if (track->Pt()<0.350)
+ return kFALSE;
+
+ Double_t phi = track->Phi()*TMath::RadToDeg();
+ if (TMath::Abs(track->Eta())>0.9 || phi <= 10 || phi >= 250)
+ return kFALSE;
+
+ AliESDtrack *esdt = dynamic_cast<AliESDtrack*>(track);
+ AliAODTrack *aodt = 0;
+ if (!esdt) {
+ aodt = dynamic_cast<AliAODTrack*>(track);
+ if (!aodt)
+ return kFALSE;
+ }
+
+ if (mass<0) {
+ Bool_t onlyTPC = kFALSE;
+ if (mass==-99)
+ onlyTPC=kTRUE;
+ if (esdt)
+ mass = esdt->GetMass(onlyTPC);
+ else
+ mass = aodt->M();
+ }
+
+ AliExternalTrackParam *trackParam = 0;
+ if (esdt) {
+ const AliExternalTrackParam *in = esdt->GetInnerParam();
+ if (!in)
+ return kFALSE;
+ trackParam = new AliExternalTrackParam(*in);
+ } else {
+ Double_t xyz[3] = {0}, pxpypz[3] = {0}, cv[21] = {0};
+ aodt->PxPyPz(pxpypz);
+ aodt->XvYvZv(xyz);
+ aodt->GetCovarianceXYZPxPyPz(cv);
+ trackParam = new AliExternalTrackParam(xyz,pxpypz,cv,aodt->Charge());
+ }
+ if (!trackParam)
+ return kFALSE;
+
+ Float_t etaout=-999, phiout=-999, ptout=-999;
+ Bool_t ret = ExtrapolateTrackToEMCalSurface(trackParam,
+ emcalR,
+ mass,
+ step,
+ etaout,
+ phiout,
+ ptout);
+ delete trackParam;
+ if (!ret)
+ return kFALSE;
+ if (TMath::Abs(etaout)>0.75 || (phiout<70*TMath::DegToRad()) || (phiout>190*TMath::DegToRad()))
+ return kFALSE;
+ track->SetTrackPhiEtaPtOnEMCal(phiout, etaout, ptout);
+ return kTRUE;
+}
+
+
//------------------------------------------------------------------------------------
Bool_t AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(AliExternalTrackParam *trkParam,
- const Double_t emcalR,
- const Double_t mass,
- const Double_t step,
+ Double_t emcalR,
+ Double_t mass,
+ Double_t step,
Float_t &eta,
- Float_t &phi)
+ Float_t &phi,
+ Float_t &pt)
{
//Extrapolate track to EMCAL surface
- eta = -999, phi = -999;
+ eta = -999, phi = -999, pt = -999;
if(!trkParam) return kFALSE;
if(!AliTrackerBase::PropagateTrackToBxByBz(trkParam, emcalR, mass, step, kTRUE, 0.8, -1)) return kFALSE;
Double_t trkPos[3] = {0.,0.,0.};
TVector3 trkPosVec(trkPos[0],trkPos[1],trkPos[2]);
eta = trkPosVec.Eta();
phi = trkPosVec.Phi();
+ pt = trkParam->Pt();
if(phi<0)
phi += 2*TMath::Pi();
//----------------------------------------------------------------------------------
Bool_t AliEMCALRecoUtils::ExtrapolateTrackToCluster(AliExternalTrackParam *trkParam,
const AliVCluster *cluster,
- const Double_t mass,
- const Double_t step,
+ Double_t mass,
+ Double_t step,
Float_t &tmpEta,
Float_t &tmpPhi)
{
}
//_______________________________________________________________________
-void AliEMCALRecoUtils::GetMatchedResiduals(const Int_t clsIndex,
+void AliEMCALRecoUtils::GetMatchedResiduals(Int_t clsIndex,
Float_t &dEta, Float_t &dPhi)
{
//Given a cluster index as in AliESDEvent::GetCaloCluster(clsIndex)
//__________________________________________________________________________
Bool_t AliEMCALRecoUtils::IsGoodCluster(AliVCluster *cluster,
const AliEMCALGeometry *geom,
- AliVCaloCells* cells,const Int_t bc)
+ AliVCaloCells* cells, Int_t bc)
{
// check if the cluster survives some quality cut
//
cuts[10] = kTRUE;
}
+ // ITS
+ if(fCutRequireITSStandAlone || fCutRequireITSpureSA){
+ if ((status & AliESDtrack::kITSin) == 0 || (status & AliESDtrack::kTPCin)){
+ // TPC tracks
+ cuts[11] = kTRUE;
+ }else{
+ // ITS standalone tracks
+ if(fCutRequireITSStandAlone && !fCutRequireITSpureSA){
+ if(status & AliESDtrack::kITSpureSA) cuts[11] = kTRUE;
+ }else if(fCutRequireITSpureSA){
+ if(!(status & AliESDtrack::kITSpureSA)) cuts[11] = kTRUE;
+ }
+ }
+ }
+
Bool_t cut=kFALSE;
for (Int_t i=0; i<kNCuts; i++)
if (cuts[i]) { cut = kTRUE ; }
break;
}
+
+ case kITSStandAlone:
+ {
+ AliInfo(Form("Track cuts for matching: ITS Stand Alone tracks cut w/o DCA cut"));
+ SetRequireITSRefit(kTRUE);
+ SetRequireITSStandAlone(kTRUE);
+ SetITSTrackSA(kTRUE);
+ break;
+ }
+
}
}
printf("Track cuts: \n");
printf("Minimum track pT: %1.2f\n",fCutMinTrackPt);
- printf("AOD track selection mask: %d\n",fAODFilterMask);
+ printf("AOD track selection: tpc only %d, or hybrid %d, or mask: %d\n",fAODTPCOnlyTracks,fAODHybridTracks, fAODFilterMask);
printf("TPCRefit = %d, ITSRefit = %d\n",fCutRequireTPCRefit,fCutRequireITSRefit);
printf("AcceptKinks = %d\n",fCutAcceptKinkDaughters);
printf("MinNCulsterTPC = %d, MinNClusterITS = %d\n",fCutMinNClusterTPC,fCutMinNClusterITS);