#include "AliEMCALRecoUtils.h"
#include "AliEMCALGeometry.h"
#include "AliTrackerBase.h"
-#include "AliEMCALCalibTimeDepCorrection.h" // Run dependent
#include "AliEMCALPIDUtils.h"
-
ClassImp(AliEMCALRecoUtils)
//_____________________________________
fNonLinearityFunction(0), fNonLinearThreshold(0),
fSmearClusterEnergy(kFALSE), fRandom(),
fCellsRecalibrated(kFALSE), fRecalibration(kFALSE), fEMCALRecalibrationFactors(),
- fTimeRecalibration(kFALSE), fEMCALTimeRecalibrationFactors(),
- fUseRunCorrectionFactors(kFALSE), fRunCorrectionFactorsSet(kFALSE),
+ fTimeRecalibration(kFALSE), fEMCALTimeRecalibrationFactors(), fUseRunCorrectionFactors(kFALSE),
fRemoveBadChannels(kFALSE), fRecalDistToBadChannels(kFALSE), fEMCALBadChannelMap(),
fNCellsFromEMCALBorder(0), fNoEMCALBorderAtEta0(kTRUE),
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();
}
//______________________________________________________________________
fCellsRecalibrated(reco.fCellsRecalibrated),
fRecalibration(reco.fRecalibration), fEMCALRecalibrationFactors(reco.fEMCALRecalibrationFactors),
fTimeRecalibration(reco.fTimeRecalibration), fEMCALTimeRecalibrationFactors(reco.fEMCALTimeRecalibrationFactors),
- fUseRunCorrectionFactors(reco.fUseRunCorrectionFactors), fRunCorrectionFactorsSet(reco.fRunCorrectionFactorsSet),
+ fUseRunCorrectionFactors(reco.fUseRunCorrectionFactors),
fRemoveBadChannels(reco.fRemoveBadChannels), fRecalDistToBadChannels(reco.fRecalDistToBadChannels),
fEMCALBadChannelMap(reco.fEMCALBadChannelMap),
fNCellsFromEMCALBorder(reco.fNCellsFromEMCALBorder), fNoEMCALBorderAtEta0(reco.fNoEMCALBorderAtEta0),
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] ; }
fEMCALTimeRecalibrationFactors = reco.fEMCALTimeRecalibrationFactors;
fUseRunCorrectionFactors = reco.fUseRunCorrectionFactors;
- fRunCorrectionFactorsSet = reco.fRunCorrectionFactorsSet;
fRemoveBadChannels = reco.fRemoveBadChannels;
fRecalDistToBadChannels = reco.fRecalDistToBadChannels;
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
AliEMCALRecoUtils::~AliEMCALRecoUtils()
{
//Destructor.
-
+
if(fEMCALRecalibrationFactors)
{
fEMCALRecalibrationFactors->Clear();
delete fEMCALRecalibrationFactors;
- }
+ }
if(fEMCALTimeRecalibrationFactors)
{
fEMCALTimeRecalibrationFactors->Clear();
delete fEMCALTimeRecalibrationFactors;
- }
+ }
if(fEMCALBadChannelMap)
{
return kFALSE;
}
- geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
+ geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
// Do not include bad channels found in analysis,
if( IsBadChannelsRemovalSwitchedOn() && GetEMCALChannelStatus(imod, ieta, iphi))
const AliVCluster* cluster,
AliVCaloCells* cells)
{
- // Given the list of AbsId of the cluster, get the maximum cell and
- // check if there are fNCellsFromBorder from the calorimeter border
-
+ // Given the list of AbsId of the cluster, get the maximum cell and
+ // check if there are fNCellsFromBorder from the calorimeter border
+
if(!cluster)
{
AliInfo("Cluster pointer null!");
}
//If the distance to the border is 0 or negative just exit accept all clusters
- if(cells->GetType()==AliVCaloCells::kEMCALCell && fNCellsFromEMCALBorder <= 0 ) return kTRUE;
+ if(cells->GetType()==AliVCaloCells::kEMCALCell && fNCellsFromEMCALBorder <= 0 ) return kTRUE;
- Int_t absIdMax = -1, iSM =-1, ieta = -1, iphi = -1;
+ Int_t absIdMax = -1, iSM =-1, ieta = -1, iphi = -1;
Bool_t shared = kFALSE;
GetMaxEnergyCell(geom, cells, cluster, absIdMax, iSM, ieta, iphi, shared);
AliDebug(2,Form("Cluster Max AbsId %d, Cell Energy %2.2f, Cluster Energy %2.2f, Ncells from border %d, EMCAL eta=0 %d\n",
absIdMax, cells->GetCellAmplitude(absIdMax), cluster->E(), fNCellsFromEMCALBorder, fNoEMCALBorderAtEta0));
-
- if(absIdMax==-1) return kFALSE;
-
- //Check if the cell is close to the borders:
- Bool_t okrow = kFALSE;
- Bool_t okcol = kFALSE;
+
+ if(absIdMax==-1) return kFALSE;
+
+ //Check if the cell is close to the borders:
+ Bool_t okrow = kFALSE;
+ Bool_t okcol = kFALSE;
if(iSM < 0 || iphi < 0 || ieta < 0 )
{
{
if(iSM%2==0)
{
- if(ieta >= fNCellsFromEMCALBorder) okcol = kTRUE;
+ if(ieta >= fNCellsFromEMCALBorder) okcol = kTRUE;
}
else
{
- if(ieta < 48-fNCellsFromEMCALBorder) okcol = kTRUE;
+ if(ieta < 48-fNCellsFromEMCALBorder) okcol = kTRUE;
}
}//eta 0 not checked
AliDebug(2,Form("EMCAL Cluster in %d cells fiducial volume: ieta %d, iphi %d, SM %d: column? %d, row? %d\nq",
fNCellsFromEMCALBorder, ieta, iphi, iSM, okcol, okrow));
-
- if (okcol && okrow)
+
+ if (okcol && okrow)
{
//printf("Accept\n");
return kTRUE;
}
- else
+ else
{
//printf("Reject\n");
AliDebug(2,Form("Reject cluster in border, max cell : ieta %d, iphi %d, SM %d\n",ieta, iphi, iSM));
return kFALSE;
}
-
-}
+
+}
//_______________________________________________________________________________
{
// Check that in the cluster cells, there is no bad channel of those stored
// in fEMCALBadChannelMap or fPHOSBadChannelMap
-
+
if(!fRemoveBadChannels) return kFALSE;
if(!fEMCALBadChannelMap) return kFALSE;
-
+
Int_t icol = -1;
Int_t irow = -1;
Int_t imod = -1;
Int_t iTower = -1, iIphi = -1, iIeta = -1;
geom->GetCellIndex(cellList[iCell],imod,iTower,iIphi,iIeta);
if(fEMCALBadChannelMap->GetEntries() <= imod) continue;
- geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,irow,icol);
+ geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,irow,icol);
if(GetEMCALChannelStatus(imod, icol, irow))
{
AliDebug(2,Form("Cluster with bad channel: SM %d, col %d, row %d\n",imod, icol, irow));
return kTRUE;
}
-
+
}// cell cluster loop
-
+
return kFALSE;
}
-//_____________________________________________________________________________________________
-Bool_t AliEMCALRecoUtils::IsExoticCell(const Int_t absID, AliVCaloCells* cells, const Int_t bc)
-{
- // Look to cell neighbourhood and reject if it seems exotic
- // Do before recalibrating the cells
- if(!fRejectExoticCells) return kFALSE;
+//___________________________________________________________________________
+Float_t AliEMCALRecoUtils::GetECross(const Int_t absID, const Double_t tcell,
+ AliVCaloCells* cells, const Int_t bc)
+{
+ //Calculate the energy in the cross around the energy given cell
AliEMCALGeometry * geom = AliEMCALGeometry::GetInstance();
Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
geom->GetCellIndex(absID,imod,iTower,iIphi,iIeta);
- geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
+ geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
//Get close cells index, energy and time, not in corners
-
+
Int_t absID1 = -1;
Int_t absID2 = -1;
if( iphi > 0 ) absID2 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta);
// In case of cell in eta = 0 border, depending on SM shift the cross cell index
-
+
Int_t absID3 = -1;
Int_t absID4 = -1;
-
if ( ieta == AliEMCALGeoParams::fgkEMCALCols-1 && !(imod%2) )
{
absID3 = geom-> GetAbsCellIdFromCellIndexes(imod+1, iphi, 0);
if( ieta > 0 )
absID4 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
}
-
- //printf("IMOD %d, AbsId %d, a %d, b %d, c %d e %d \n",imod,absID,absID1,absID2,absID3,absID4);
-
- Float_t ecell = 0, ecell1 = 0, ecell2 = 0, ecell3 = 0, ecell4 = 0;
- Double_t tcell = 0, tcell1 = 0, tcell2 = 0, tcell3 = 0, tcell4 = 0;
- Bool_t accept = 0, accept1 = 0, accept2 = 0, accept3 = 0, accept4 = 0;
-
- accept = AcceptCalibrateCell(absID, bc, ecell ,tcell ,cells);
-
- if(!accept) return kTRUE; // reject this cell
+ //printf("IMOD %d, AbsId %d, a %d, b %d, c %d e %d \n",imod,absID,absID1,absID2,absID3,absID4);
- if(ecell < fExoticCellMinAmplitude) return kFALSE; // do not reject low energy cells
+ Float_t ecell1 = 0, ecell2 = 0, ecell3 = 0, ecell4 = 0;
+ Double_t tcell1 = 0, tcell2 = 0, tcell3 = 0, tcell4 = 0;
+ Bool_t accept1 = 0, accept2 = 0, accept3 = 0, accept4 = 0;
accept1 = AcceptCalibrateCell(absID1,bc, ecell1,tcell1,cells);
accept2 = AcceptCalibrateCell(absID2,bc, ecell2,tcell2,cells);
accept4 = AcceptCalibrateCell(absID4,bc, ecell4,tcell4,cells);
/*
- printf("Cell absID %d \n",absID);
- printf("\t accept1 %d, accept2 %d, accept3 %d, accept4 %d\n",
- accept1,accept2,accept3,accept4);
- printf("\t id %d: id1 %d, id2 %d, id3 %d, id4 %d\n",
- absID,absID1,absID2,absID3,absID4);
- printf("\t e %f: e1 %f, e2 %f, e3 %f, e4 %f\n",
- ecell,ecell1,ecell2,ecell3,ecell4);
- printf("\t t %f: t1 %f, t2 %f, t3 %f, t4 %f;\n dt1 %f, dt2 %f, dt3 %f, dt4 %f\n",
- tcell*1.e9,tcell1*1.e9,tcell2*1.e9,tcell3*1.e9,tcell4*1.e9,
- TMath::Abs(tcell-tcell1)*1.e9, TMath::Abs(tcell-tcell2)*1.e9, TMath::Abs(tcell-tcell3)*1.e9, TMath::Abs(tcell-tcell4)*1.e9);
- */
+ printf("Cell absID %d \n",absID);
+ printf("\t accept1 %d, accept2 %d, accept3 %d, accept4 %d\n",
+ accept1,accept2,accept3,accept4);
+ printf("\t id %d: id1 %d, id2 %d, id3 %d, id4 %d\n",
+ absID,absID1,absID2,absID3,absID4);
+ printf("\t e %f: e1 %f, e2 %f, e3 %f, e4 %f\n",
+ ecell,ecell1,ecell2,ecell3,ecell4);
+ printf("\t t %f: t1 %f, t2 %f, t3 %f, t4 %f;\n dt1 %f, dt2 %f, dt3 %f, dt4 %f\n",
+ tcell*1.e9,tcell1*1.e9,tcell2*1.e9,tcell3*1.e9,tcell4*1.e9,
+ TMath::Abs(tcell-tcell1)*1.e9, TMath::Abs(tcell-tcell2)*1.e9, TMath::Abs(tcell-tcell3)*1.e9, TMath::Abs(tcell-tcell4)*1.e9);
+ */
if(TMath::Abs(tcell-tcell1)*1.e9 > fExoticCellDiffTime) ecell1 = 0 ;
if(TMath::Abs(tcell-tcell2)*1.e9 > fExoticCellDiffTime) ecell2 = 0 ;
if(TMath::Abs(tcell-tcell3)*1.e9 > fExoticCellDiffTime) ecell3 = 0 ;
if(TMath::Abs(tcell-tcell4)*1.e9 > fExoticCellDiffTime) ecell4 = 0 ;
+
+ return ecell1+ecell2+ecell3+ecell4;
+
+}
+
+//_____________________________________________________________________________________________
+Bool_t AliEMCALRecoUtils::IsExoticCell(const Int_t absID, AliVCaloCells* cells, const Int_t bc)
+{
+ // Look to cell neighbourhood and reject if it seems exotic
+ // Do before recalibrating the cells
- Float_t eCross = ecell1+ecell2+ecell3+ecell4;
+ if(!fRejectExoticCells) return kFALSE;
+
+ Float_t ecell = 0;
+ Double_t tcell = 0;
+ Bool_t accept = AcceptCalibrateCell(absID, bc, ecell ,tcell ,cells);
+
+ if(!accept) return kTRUE; // reject this cell
+
+ if(ecell < fExoticCellMinAmplitude) return kFALSE; // do not reject low energy cells
- //printf("\t eCell %f, eCross %f, 1-eCross/eCell %f\n",ecell,eCross,1-eCross/ecell);
+ Float_t eCross = GetECross(absID,tcell,cells,bc);
if(1-eCross/ecell > fExoticCellFraction)
{
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)
{
case kPi0MC:
{
//Non-Linearity correction (from MC with function ([0]*exp(-[1]/E))+(([2]/([3]*2.*TMath::Pi())*exp(-(E-[4])^2/(2.*[3]^2)))))
- //Double_t fNonLinearityParams[0] = 1.014;
- //Double_t fNonLinearityParams[1] = -0.03329;
- //Double_t fNonLinearityParams[2] = -0.3853;
- //Double_t fNonLinearityParams[3] = 0.5423;
- //Double_t fNonLinearityParams[4] = -0.4335;
+ //fNonLinearityParams[0] = 1.014;
+ //fNonLinearityParams[1] =-0.03329;
+ //fNonLinearityParams[2] =-0.3853;
+ //fNonLinearityParams[3] = 0.5423;
+ //fNonLinearityParams[4] =-0.4335;
energy *= (fNonLinearityParams[0]*exp(-fNonLinearityParams[1]/energy))+
((fNonLinearityParams[2]/(fNonLinearityParams[3]*2.*TMath::Pi())*
exp(-(energy-fNonLinearityParams[4])*(energy-fNonLinearityParams[4])/(2.*fNonLinearityParams[3]*fNonLinearityParams[3]))));
break;
}
+ case kPi0MCv2:
+ {
+ //Non-Linearity correction (from MC with function [0]/((x+[1])^[2]))+1;
+ //fNonLinearityParams[0] = 3.11111e-02;
+ //fNonLinearityParams[1] =-5.71666e-02;
+ //fNonLinearityParams[2] = 5.67995e-01;
+
+ energy *= fNonLinearityParams[0]/TMath::Power(energy+fNonLinearityParams[1],fNonLinearityParams[2])+1;
+ break;
+ }
+
+ case kPi0MCv3:
+ {
+ //Same as beam test corrected, change parameters
+ //fNonLinearityParams[0] = 9.81039e-01
+ //fNonLinearityParams[1] = 1.13508e-01;
+ //fNonLinearityParams[2] = 1.00173e+00;
+ //fNonLinearityParams[3] = 9.67998e-02;
+ //fNonLinearityParams[4] = 2.19381e+02;
+ //fNonLinearityParams[5] = 6.31604e+01;
+ //fNonLinearityParams[6] = 1;
+ 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 kPi0GammaGamma:
{
//Non-Linearity correction (from Olga Data with function p0+p1*exp(-p2*E))
- //Double_t fNonLinearityParams[0] = 1.04;
- //Double_t fNonLinearityParams[1] = -0.1445;
- //Double_t fNonLinearityParams[2] = 1.046;
+ //fNonLinearityParams[0] = 1.04;
+ //fNonLinearityParams[1] = -0.1445;
+ //fNonLinearityParams[2] = 1.046;
energy /= (fNonLinearityParams[0]+fNonLinearityParams[1]*exp(-fNonLinearityParams[2]*energy)); //Olga function
break;
}
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");
void AliEMCALRecoUtils::InitNonLinearityParam()
{
//Initialising Non Linearity Parameters
-
+
if(fNonLinearityFunction == kPi0MC)
{
fNonLinearityParams[0] = 1.014;
fNonLinearityParams[4] = -0.4335;
}
+ if(fNonLinearityFunction == kPi0MCv2)
+ {
+ fNonLinearityParams[0] = 3.11111e-02;
+ fNonLinearityParams[1] =-5.71666e-02;
+ fNonLinearityParams[2] = 5.67995e-01;
+ }
+
+ if(fNonLinearityFunction == kPi0MCv3)
+ {
+ fNonLinearityParams[0] = 9.81039e-01;
+ fNonLinearityParams[1] = 1.13508e-01;
+ fNonLinearityParams[2] = 1.00173e+00;
+ fNonLinearityParams[3] = 9.67998e-02;
+ fNonLinearityParams[4] = 2.19381e+02;
+ fNonLinearityParams[5] = 6.31604e+01;
+ fNonLinearityParams[6] = 1;
+ }
+
if(fNonLinearityFunction == kPi0GammaGamma)
{
fNonLinearityParams[0] = 1.04;
fNonLinearityParams[1] = -0.1445;
fNonLinearityParams[2] = 1.046;
- }
+ }
if(fNonLinearityFunction == kPi0GammaConversion)
{
fNonLinearityParams[0] = 0.139393;
fNonLinearityParams[1] = 0.0566186;
fNonLinearityParams[2] = 0.982133;
- }
+ }
if(fNonLinearityFunction == kBeamTest)
{
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 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;
{
//Init EMCAL recalibration factors
AliDebug(2,"AliCalorimeterUtils::InitEMCALRecalibrationFactors()");
- //In order to avoid rewriting the same histograms
+ //In order to avoid rewriting the same histograms
Bool_t oldStatus = TH1::AddDirectoryStatus();
TH1::AddDirectory(kFALSE);
fEMCALRecalibrationFactors->SetOwner(kTRUE);
fEMCALRecalibrationFactors->Compress();
-
+
//In order to avoid rewriting the same histograms
- TH1::AddDirectory(oldStatus);
+ TH1::AddDirectory(oldStatus);
}
//_________________________________________________________
fEMCALTimeRecalibrationFactors->Compress();
//In order to avoid rewriting the same histograms
- TH1::AddDirectory(oldStatus);
+ TH1::AddDirectory(oldStatus);
}
//____________________________________________________
fEMCALBadChannelMap->Compress();
//In order to avoid rewriting the same histograms
- TH1::AddDirectory(oldStatus);
+ TH1::AddDirectory(oldStatus);
}
//____________________________________________________________________________
// Recalibrate the cluster energy and Time, considering the recalibration map
// and the energy of the cells and time that compose the cluster.
// bc= bunch crossing number returned by esdevent->GetBunchCrossNumber();
-
+
if(!cluster)
{
AliInfo("Cluster pointer null!");
UShort_t * index = cluster->GetCellsAbsId() ;
Double_t * fraction = cluster->GetCellsAmplitudeFraction() ;
Int_t ncells = cluster->GetNCells();
-
+
//Initialize some used variables
Float_t energy = 0;
Int_t absId =-1;
Int_t iTower = -1, iIphi = -1, iIeta = -1;
geom->GetCellIndex(absId,imod,iTower,iIphi,iIeta);
if(fEMCALRecalibrationFactors->GetEntries() <= imod) continue;
- geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,irow,icol);
+ geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,irow,icol);
factor = GetEMCALChannelRecalibrationFactor(imod,icol,irow);
AliDebug(2,Form("AliEMCALRecoUtils::RecalibrateClusterEnergy - recalibrate cell: module %d, col %d, row %d, cell fraction %f,recalibration factor %f, cell energy %f\n",
absIdMax = absId;
}
}
-
+
AliDebug(2,Form("AliEMCALRecoUtils::RecalibrateClusterEnergy - Energy before %f, after %f \n",cluster->E(),energy));
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()));
}
//_____________________________________________________________
// 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)
{
return;
}
- Int_t absId =-1;
+ Short_t absId =-1;
Bool_t accept = kFALSE;
Float_t ecell = 0;
Double_t tcell = 0;
+ Double_t ecellin = 0;
+ Double_t tcellin = 0;
+ Int_t mclabel = -1;
+ Double_t efrac = 0;
Int_t nEMcell = cells->GetNumberOfCells() ;
for (Int_t iCell = 0; iCell < nEMcell; iCell++)
{
- absId = cells->GetCellNumber(iCell);
+ cells->GetCell( iCell, absId, ecellin, tcellin, mclabel, efrac );
accept = AcceptCalibrateCell(absId, bc, ecell ,tcell ,cells);
if(!accept)
{
ecell = 0;
- tcell = 0;
+ tcell = -1;
}
//Set new values
- cells->SetCell(iCell,absId,ecell, tcell);
+ cells->SetCell(iCell,absId,ecell, tcell, mclabel, efrac);
}
fCellsRecalibrated = kTRUE;
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) ;
if (!fCellsRecalibrated)
{
geom->GetCellIndex(absId,iSM,iTower,iIphi,iIeta);
- geom->GetCellPhiEtaIndexInSModule(iSM,iTower,iIphi, iIeta,iphi,ieta);
+ geom->GetCellPhiEtaIndexInSModule(iSM,iTower,iIphi, iIeta,iphi,ieta);
if(IsRecalibrationOn())
{
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) ;
eCell = cells->GetCellAmplitude(absId);
geom->GetCellIndex(absId,iSupMod,iTower,iIphi,iIeta);
- geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
+ geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
if (!fCellsRecalibrated)
{
}
//Get channels map of the supermodule where the cluster is.
- Int_t absIdMax = -1, iSupMod =-1, icolM = -1, irowM = -1;
+ Int_t absIdMax = -1, iSupMod =-1, icolM = -1, irowM = -1;
Bool_t shared = kFALSE;
GetMaxEnergyCell(geom, cells, cluster, absIdMax, iSupMod, icolM, irowM, shared);
TH2D* hMap = (TH2D*)fEMCALBadChannelMap->At(iSupMod);
- Int_t dRrow, dRcol;
+ Int_t dRrow, dRcol;
Float_t minDist = 10000.;
Float_t dist = 0.;
if ( cluster->GetM02() != 0)
fPIDUtils->ComputePID(cluster->E(),cluster->GetM02());
- Float_t pidlist[AliPID::kSPECIESN+1];
- for(Int_t i = 0; i < AliPID::kSPECIESN+1; i++) pidlist[i] = fPIDUtils->GetPIDFinal(i);
+ Float_t pidlist[AliPID::kSPECIESCN+1];
+ for(Int_t i = 0; i < AliPID::kSPECIESCN+1; i++) pidlist[i] = fPIDUtils->GetPIDFinal(i);
cluster->SetPID(pidlist);
}
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());
etai=(Double_t)ieta;
- phii=(Double_t)iphi;
+ phii=(Double_t)iphi;
if(w > 0.0)
{
wtot += w ;
- nstat++;
+ nstat++;
//Shower shape
sEta += w * etai * etai ;
etaMean += w * etai ;
AliError(Form("Wrong energy %f and/or amplitude %f\n", eCell, cluster->E()));
}//cell loop
- //Normalize to the weight
+ //Normalize to the weight
if (wtot > 0)
{
etaMean /= wtot ;
else
AliError(Form("Wrong weight %f\n", wtot));
- //Calculate dispersion
+ //Calculate dispersion
for(Int_t iDigit=0; iDigit < cluster->GetNCells(); iDigit++)
{
//Get from the absid the supermodule, tower and eta/phi numbers
}
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());
etai=(Double_t)ieta;
- phii=(Double_t)iphi;
+ phii=(Double_t)iphi;
if(w > 0.0)
{
disp += w *((etai-etaMean)*(etai-etaMean)+(phii-phiMean)*(phii-phiMean));
l1 = 0. ;
dEta = 0. ; dPhi = 0. ; disp = 0. ;
sEta = 0. ; sPhi = 0. ; sEtaPhi = 0. ;
- }
+ }
}
} // 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++)
- {
- AliVCluster *cluster = (AliVCluster*) event->GetCaloCluster(icl);
- if(geom && !IsGoodCluster(cluster,geom,(AliVCaloCells*)event->GetEMCALCells())) continue;
- clusterArray->AddAt(cluster,icl);
- }
+ {
+ AliVCluster *cluster = (AliVCluster*) event->GetCaloCluster(icl);
+ if(geom && !IsGoodCluster(cluster,geom,(AliVCaloCells*)event->GetEMCALCells())) continue;
+ clusterArray->AddAt(cluster,icl);
+ }
}
Int_t matched=0;
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))
+ Float_t eta, phi, pt;
+ if(!ExtrapolateTrackToEMCalSurface(&emcalParam, fEMCalSurfaceDistance, fMass, fStepSurface, eta, phi, pt))
{
- if(aodevent && trackParam) delete trackParam;
- continue;
+ if(aodevent && trackParam) delete trackParam;
+ if(fITSTrackSA && trackParam) delete trackParam;
+ continue;
}
// if(esdevent)
// {
-// esdTrack->SetOuterParam(&emcalParam,AliExternalTrackParam::kMultSec);
+// esdTrack->SetOuterParam(&emcalParam,AliExternalTrackParam::kMultSec);
// }
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;
}
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)
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 tmpR=TMath::Sqrt(tmpEta*tmpEta + tmpPhi*tmpPhi);
if(tmpR<dRMax)
- {
- dRMax=tmpR;
- dEtaMax=tmpEta;
- dPhiMax=tmpPhi;
- index=icl;
- }
+ {
+ dRMax=tmpR;
+ dEtaMax=tmpEta;
+ dPhiMax=tmpPhi;
+ index=icl;
+ }
}
else if(fCutEtaPhiSeparate)
{
if(TMath::Abs(tmpEta)<TMath::Abs(dEtaMax) && TMath::Abs(tmpPhi)<TMath::Abs(dPhiMax))
- {
- dEtaMax = tmpEta;
- dPhiMax = tmpPhi;
- index=icl;
- }
+ {
+ dEtaMax = tmpEta;
+ dPhiMax = tmpPhi;
+ index=icl;
+ }
}
else
{
const Double_t mass,
const 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();
{
//Require at least one SPD point + anything else in ITS
if( (esdTrack->HasPointOnITSLayer(0) || esdTrack->HasPointOnITSLayer(1)) == kFALSE)
- cuts[10] = kTRUE;
+ 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;
+ }
+
}
}
continue;
}
- Int_t matchClusIndex = GetMatchedClusterIndex(iTrack);
+ Int_t matchClusIndex = GetMatchedClusterIndex(iTrack);
track->SetEMCALcluster(matchClusIndex); //sets -1 if track not matched within residual
/*the following can be done better if AliVTrack::SetStatus will be there. Patch pending with Andreas/Peter*/
AliESDtrack* esdtrack = dynamic_cast<AliESDtrack*>(track);
}
}
- AliDebug(2,"Track matched to closest cluster");
+ AliDebug(2,"Track matched to closest cluster");
}
//_________________________________________________________________________
cluster->SetTrackDistance(phi, eta);
}
- AliDebug(2,"Cluster matched to tracks");
+ AliDebug(2,"Cluster matched to tracks");
}
-
//___________________________________________________
void AliEMCALRecoUtils::Print(const Option_t *) const
{
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);
printf("DCSToVertex2D = %d, MaxDCAToVertexXY = %2.2f, MaxDCAToVertexZ = %2.2f\n",fCutDCAToVertex2D,fCutMaxDCAToVertexXY,fCutMaxDCAToVertexZ);
}
-//_________________________________________________________________
-void AliEMCALRecoUtils::SetRunDependentCorrections(Int_t runnumber)
-{
- //Get EMCAL time dependent corrections from file and put them in the recalibration histograms
- //Do it only once and only if it is requested
-
- if(!fUseRunCorrectionFactors) return;
- if(fRunCorrectionFactorsSet) return;
-
- AliInfo(Form("AliEMCALRecoUtils::GetRunDependentCorrections() - Get Correction Factors for Run number %d\n",runnumber));
-
- AliEMCALCalibTimeDepCorrection *corr = new AliEMCALCalibTimeDepCorrection();
- corr->ReadRootInfo(Form("CorrectionFiles/Run%d_Correction.root",runnumber));
-
- SwitchOnRecalibration();
-
- AliEMCALGeometry* geom = AliEMCALGeometry::GetInstance();
-
- for(Int_t ism = 0; ism < geom->GetNumberOfSuperModules(); ism++)
- {
- for(Int_t icol = 0; icol < 48; icol++)
- {
- for(Int_t irow = 0; irow < 24; irow++)
- {
- Float_t orgRecalFactor = GetEMCALChannelRecalibrationFactors(ism)->GetBinContent(icol,irow);
- Float_t newRecalFactor = orgRecalFactor*corr->GetCorrection(ism, icol,irow,0);
- GetEMCALChannelRecalibrationFactors(ism)->SetBinContent(icol,irow,newRecalFactor);
- //printf("ism %d, icol %d, irow %d, corrections : org %f, time dep %f, final %f (org*time %f)\n",ism, icol, irow,
- // orgRecalFactor, corr->GetCorrection(ism, icol,irow,0),
- // (GetEMCALChannelRecalibrationFactors(ism))->GetBinContent(icol,irow),newRecalFactor);
- }
- }
- }
-
- fRunCorrectionFactorsSet = kTRUE;
-
-}