20 #include <TObjArray.h> 23 #include "AliVCluster.h" 24 #include "AliVCaloCells.h" 27 #include "AliESDEvent.h" 28 #include "AliAODEvent.h" 29 #include "AliESDtrack.h" 30 #include "AliAODTrack.h" 31 #include "AliExternalTrackParam.h" 32 #include "AliESDfriendTrack.h" 33 #include "AliTrackerBase.h" 34 #include "AliMCEvent.h" 38 #include "AliEMCALGeometry.h" 39 #include "AliTrackerBase.h" 40 #include "AliEMCALPIDUtils.h" 53 fParticleType(0), fPosAlgo(0),
54 fW0(0), fShowerShapeCellLocationType(0),
55 fNonLinearityFunction(0), fNonLinearThreshold(0),
56 fSmearClusterEnergy(kFALSE), fRandom(),
57 fCellsRecalibrated(kFALSE), fRecalibration(kFALSE), fEMCALRecalibrationFactors(),
58 fConstantTimeShift(0), fTimeRecalibration(kFALSE), fEMCALTimeRecalibrationFactors(), fLowGain(kFALSE),
59 fUseL1PhaseInTimeRecalibration(kFALSE), fEMCALL1PhaseInTimeRecalibration(),
60 fUseRunCorrectionFactors(kFALSE),
61 fRemoveBadChannels(kFALSE), fRecalDistToBadChannels(kFALSE), fEMCALBadChannelMap(),
62 fNCellsFromEMCALBorder(0), fNoEMCALBorderAtEta0(kTRUE),
63 fRejectExoticCluster(kFALSE), fRejectExoticCells(kFALSE),
64 fExoticCellFraction(0), fExoticCellDiffTime(0), fExoticCellMinAmplitude(0),
65 fPIDUtils(), fAODFilterMask(0),
66 fAODHybridTracks(0), fAODTPCOnlyTracks(0),
67 fMatchedTrackIndex(0x0), fMatchedClusterIndex(0x0),
68 fResidualEta(0x0), fResidualPhi(0x0), fCutEtaPhiSum(kFALSE), fCutEtaPhiSeparate(kFALSE),
69 fCutR(0), fCutEta(0), fCutPhi(0),
70 fClusterWindow(0), fMass(0),
71 fStepSurface(0), fStepCluster(0),
72 fITSTrackSA(kFALSE), fEMCalSurfaceDistance(440.),
73 fTrackCutsType(0), fCutMinTrackPt(0), fCutMinNClusterTPC(0),
74 fCutMinNClusterITS(0), fCutMaxChi2PerClusterTPC(0), fCutMaxChi2PerClusterITS(0),
75 fCutRequireTPCRefit(kFALSE), fCutRequireITSRefit(kFALSE), fCutAcceptKinkDaughters(kFALSE),
76 fCutMaxDCAToVertexXY(0), fCutMaxDCAToVertexZ(0), fCutDCAToVertex2D(kFALSE),
77 fCutRequireITSStandAlone(kFALSE), fCutRequireITSpureSA(kFALSE),
78 fNMCGenerToAccept(0), fMCGenerToAcceptForTrack(1)
98 : AliEMCALRecoUtilsBase(reco),
171 if (
this == &reco)
return *
this;
172 ((
TNamed *)
this)->operator=(reco);
247 for (
Int_t j = 0; j < 5 ; j++)
390 AliVCaloCells* cells)
392 AliEMCALGeometry* geom = AliEMCALGeometry::GetInstance();
396 AliError(
"No instance of the geometry is available");
400 if ( absID < 0 || absID >= 24*48*geom->GetNumberOfSuperModules() )
403 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
405 if (!geom->GetCellIndex(absID,imod,iTower,iIphi,iIeta))
412 geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
419 amp = cells->GetCellAmplitude(absID);
424 time = cells->GetCellTime(absID);
426 Bool_t isLowGain = !(cells->GetCellHighGain(absID));
447 const AliVCluster* cluster,
448 AliVCaloCells* cells)
452 AliInfo(
"Cluster pointer null!");
460 Int_t absIdMax = -1, iSM =-1, ieta = -1, iphi = -1;
464 AliDebug(2,Form(
"Cluster Max AbsId %d, Cell Energy %2.2f, Cluster Energy %2.2f, Ncells from border %d, EMCAL eta=0 %d\n",
467 if (absIdMax==-1)
return kFALSE;
473 if (iSM < 0 || iphi < 0 || ieta < 0 )
475 AliFatal(Form(
"Negative value for super module: %d, or cell ieta: %d, or cell iphi: %d, check EMCAL geometry name\n",
482 if ( geom->GetSMType(iSM) == AliEMCALGeometry::kEMCAL_Half ) iPhiLast /= 2;
483 else if ( geom->GetSMType(iSM) == AliEMCALGeometry::kEMCAL_3rd ) iPhiLast /= 3;
484 else if ( geom->GetSMType(iSM) == AliEMCALGeometry::kDCAL_Ext ) iPhiLast /= 3;
486 if(iphi >= fNCellsFromEMCALBorder && iphi < iPhiLast - fNCellsFromEMCALBorder) okrow = kTRUE;
493 if ( geom->IsDCALSM(iSM) ) iEtaLast = iEtaLast*2/3;
495 if ( ieta > fNCellsFromEMCALBorder && ieta < iEtaLast-fNCellsFromEMCALBorder ) okcol = kTRUE;
501 if (ieta >= fNCellsFromEMCALBorder) okcol = kTRUE;
505 if (ieta < iEtaLast-fNCellsFromEMCALBorder) okcol = kTRUE;
509 AliDebug(2,Form(
"EMCAL Cluster in %d cells fiducial volume: ieta %d, iphi %d, SM %d: column? %d, row? %d\nq",
510 fNCellsFromEMCALBorder, ieta, iphi, iSM, okcol, okrow));
518 AliDebug(2,Form(
"Reject cluster in border, max cell : ieta %d, iphi %d, SM %d\n",ieta, iphi, iSM));
545 for (
Int_t iCell = 0; iCell<nCells; iCell++)
548 Int_t iTower = -1, iIphi = -1, iIeta = -1;
549 geom->GetCellIndex(cellList[iCell],imod,iTower,iIphi,iIeta);
553 geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,irow,icol);
557 AliDebug(2,Form(
"Cluster with bad channel: SM %d, col %d, row %d\n",imod, icol, irow));
578 AliVCaloCells* cells,
Int_t bc)
580 AliEMCALGeometry * geom = AliEMCALGeometry::GetInstance();
584 AliError(
"No instance of the geometry is available");
588 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
589 geom->GetCellIndex(absID,imod,iTower,iIphi,iIeta);
590 geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
597 if ( iphi < AliEMCALGeoParams::fgkEMCALRows-1) absID1 = geom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta);
598 if ( iphi > 0 ) absID2 = geom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta);
605 if ( ieta == AliEMCALGeoParams::fgkEMCALCols-1 && !(imod%2) )
607 absID3 = geom-> GetAbsCellIdFromCellIndexes(imod+1, iphi, 0);
608 absID4 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
610 else if ( ieta == 0 && imod%2 )
612 absID3 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
613 absID4 = geom-> GetAbsCellIdFromCellIndexes(imod-1, iphi, AliEMCALGeoParams::fgkEMCALCols-1);
617 if ( ieta < AliEMCALGeoParams::fgkEMCALCols-1 )
618 absID3 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
620 absID4 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
625 Float_t ecell1 = 0, ecell2 = 0, ecell3 = 0, ecell4 = 0;
626 Double_t tcell1 = 0, tcell2 = 0, tcell3 = 0, tcell4 = 0;
638 return ecell1+ecell2+ecell3+ecell4;
660 if (!accept)
return kTRUE;
668 AliDebug(2,Form(
"AliEMCALRecoUtils::IsExoticCell() - EXOTIC CELL id %d, eCell %f, eCross %f, 1-eCross/eCell %f\n",
669 absID,ecell,eCross,1-eCross/ecell));
687 AliVCaloCells *cells,
692 AliInfo(
"Cluster pointer null!");
699 AliEMCALGeometry* geom = AliEMCALGeometry::GetInstance();
703 AliError(
"No instance of the geometry is available");
707 Int_t iSupMod = -1, absId = -1, ieta = -1, iphi = -1;
727 AliInfo(
"Cluster pointer null!");
739 AliDebug(2, Form(
"Energy: original %f, smeared %f\n", energy, rdmEnergy));
758 AliInfo(
"Cluster pointer null!");
766 AliInfo(Form(
"Too low cluster energy!, E = %f < 0.100 GeV",energy));
769 else if(energy > 300.)
771 AliInfo(Form(
"Too high cluster energy!, E = %f GeV, do not apply non linearity",energy));
1022 AliDebug(2,
"No correction on the energy\n");
1226 AliVCaloCells* cells,
1227 const AliVCluster* clu,
1238 Int_t cellAbsId = -1 ;
1247 AliInfo(
"Cluster pointer null!");
1248 absId=-1; iSupMod0=-1, ieta = -1; iphi = -1; shared = -1;
1252 for (
Int_t iDig=0; iDig< clu->GetNCells(); iDig++)
1254 cellAbsId = clu->GetCellAbsId(iDig);
1255 fraction = clu->GetCellAmplitudeFraction(iDig);
1257 if (fraction < 1e-4) fraction = 1.;
1259 geom->GetCellIndex(cellAbsId,iSupMod,iTower,iIphi,iIeta);
1260 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
1265 }
else if (iSupMod0!=iSupMod)
1274 eCell = cells->GetCellAmplitude(cellAbsId)*fraction*recalFactor;
1285 geom->GetCellIndex(absId,iSupMod,iTower,iIphi,iIeta);
1287 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
1303 if (eCell > 0 && eCluster > 0)
1305 if (
fW0 > 0 )
return TMath::Max( 0.,
fW0 + TMath::Log( eCell / eCluster ) ) ;
1306 else return TMath::Log( eCluster / eCell ) ;
1366 for (
Int_t i = 0; i < 15 ; i++)
1397 AliDebug(2,
"AliCalorimeterUtils::InitEMCALRecalibrationFactors()");
1400 Bool_t oldStatus = TH1::AddDirectoryStatus();
1401 TH1::AddDirectory(kFALSE);
1404 for (
int i = 0; i < 22; i++)
1406 Form(
"EMCALRecalFactors_SM%d",i), 48, 0, 48, 24, 0, 24));
1408 for (
Int_t sm = 0; sm < 22; sm++)
1410 for (
Int_t i = 0; i < 48; i++)
1412 for (
Int_t j = 0; j < 24; j++)
1423 TH1::AddDirectory(oldStatus);
1432 AliDebug(2,
"AliCalorimeterUtils::InitEMCALRecalibrationFactors()");
1435 Bool_t oldStatus = TH1::AddDirectoryStatus();
1436 TH1::AddDirectory(kFALSE);
1441 for (
int i = 0; i < 4; i++)
1443 Form(
"hAllTimeAvBC%d",i),
1444 48*24*22,0.,48*24*22) );
1446 for (
Int_t iBC = 0; iBC < 4; iBC++)
1448 for (
Int_t iCh = 0; iCh < 48*24*22; iCh++)
1453 for (
int iBC = 0; iBC < 4; iBC++) {
1455 Form(
"hAllTimeAvLGBC%d",iBC),
1456 48*24*22,0.,48*24*22) );
1457 for (
Int_t iCh = 0; iCh < 48*24*22; iCh++)
1468 TH1::AddDirectory(oldStatus);
1477 AliDebug(2,
"AliEMCALRecoUtils::InitEMCALBadChannelStatusMap()");
1480 Bool_t oldStatus = TH1::AddDirectoryStatus();
1481 TH1::AddDirectory(kFALSE);
1486 for (
int i = 0; i < 22; i++)
1487 fEMCALBadChannelMap->Add(
new TH2I(Form(
"EMCALBadChannelMap_Mod%d",i),Form(
"EMCALBadChannelMap_Mod%d",i), 48, 0, 48, 24, 0, 24));
1493 TH1::AddDirectory(oldStatus);
1502 AliDebug(2,
"AliEMCALRecoUtils::InitEMCALL1PhaseInTimeRecalibrationFactors()");
1505 Bool_t oldStatus = TH1::AddDirectoryStatus();
1506 TH1::AddDirectory(kFALSE);
1512 for (
Int_t i = 0; i < 22; i++)
1519 TH1::AddDirectory(oldStatus);
1533 AliVCluster * cluster,
1534 AliVCaloCells * cells,
1539 AliInfo(
"Cluster pointer null!");
1544 UShort_t * index = cluster->GetCellsAbsId() ;
1545 Double_t * fraction = cluster->GetCellsAmplitudeFraction() ;
1546 Int_t ncells = cluster->GetNCells();
1551 Int_t icol =-1, irow =-1, imod=1;
1553 Int_t absIdMax = -1;
1557 for (
Int_t icell = 0; icell < ncells; icell++)
1559 absId = index[icell];
1560 frac = fraction[icell];
1561 if (frac < 1e-5) frac = 1;
1566 Int_t iTower = -1, iIphi = -1, iIeta = -1;
1567 geom->GetCellIndex(absId,imod,iTower,iIphi,iIeta);
1570 geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,irow,icol);
1573 AliDebug(2,Form(
"AliEMCALRecoUtils::RecalibrateClusterEnergy - recalibrate cell: module %d, col %d, row %d, cell fraction %f,recalibration factor %f, cell energy %f\n",
1574 imod,icol,irow,frac,factor,cells->GetCellAmplitude(absId)));
1578 energy += cells->GetCellAmplitude(absId)*factor*frac;
1580 if (emax < cells->GetCellAmplitude(absId)*factor*frac)
1582 emax = cells->GetCellAmplitude(absId)*factor*frac;
1587 AliDebug(2,Form(
"AliEMCALRecoUtils::RecalibrateClusterEnergy - Energy before %f, after %f \n",cluster->E(),
energy));
1589 cluster->SetE(energy);
1592 Double_t timeorg = cluster->GetTOF();
1593 Bool_t isLowGain = !(cells->GetCellHighGain(absIdMax));
1595 Double_t time = cells->GetCellTime(absIdMax);
1604 cluster->SetTOF(time);
1606 AliDebug(2,Form(
"AliEMCALRecoUtils::RecalibrateClusterEnergy - Time before %f, after %f \n",timeorg,cluster->GetTOF()));
1624 AliInfo(
"Cells pointer null!");
1637 Int_t nEMcell = cells->GetNumberOfCells() ;
1638 for (
Int_t iCell = 0; iCell < nEMcell; iCell++)
1640 cells->GetCell( iCell, absId, ecellin, tcellin, mclabel, efrac );
1650 cells->SetCell(iCell,absId,ecell, tcell, mclabel, efrac);
1691 Int_t l1Phase=l1PhaseShift & 3;
1694 offsetPerSM = (bc - l1Phase)*25;
1696 offsetPerSM = (bc - l1Phase + 4)*25;
1698 Int_t l1shiftOffset=l1PhaseShift>>2;
1701 celltime -= offsetPerSM*1.e-9;
1702 celltime -= l1shiftOffset*1.e-9;
1735 for(
Int_t icluscell = 0; icluscell < clus->GetNCells(); icluscell++ )
1737 if(absID == clus->GetCellAbsId(icluscell))
1739 clus->GetCellMCEdepFractionArray(icluscell,eDepFrac);
1749 AliWarning(Form(
"Cell abs ID %d NOT found in cluster",absID));
1761 for(
UInt_t imc = 0; imc < 4; imc++)
1763 if ( eDepFrac[imc] > 0 && clus->GetNLabels() > imc )
1765 mc->GetCocktailGenerator(clus->GetLabelAt(imc),genName);
1775 amp-=ampOrg*eDepFrac[imc];
1777 edepTotFrac-=eDepFrac[imc];
1791 for(
UInt_t imc = 0; imc < 4; imc++)
1793 if ( eDepFrac[imc] > 0 && clus->GetNLabels() > imc && edepTotFrac > 0 )
1797 labeArr.Set(nLabels);
1798 labeArr.AddAt(clus->GetLabelAt(imc), nLabels-1);
1800 eDepArr.Set(nLabels);
1801 eDepArr.AddAt( (eDepFrac[imc]/edepTotFrac) * amp, nLabels-1);
1812 if ( nLabels == 0 ) amp = 0;
1825 AliVCaloCells* cells,
1830 AliInfo(
"Cluster pointer null!");
1836 else AliDebug(2,
"Algorithm to recalculate position not selected, do nothing.");
1849 AliVCaloCells* cells,
1857 Int_t iTower = -1, iIphi = -1, iIeta = -1;
1858 Int_t iSupModMax = -1, iSM=-1, iphi = -1, ieta = -1;
1859 Float_t weight = 0., totalWeight=0.;
1860 Float_t newPos[3] = {-1.,-1.,-1.};
1865 if (clEnergy <= 0)
return;
1872 for (
Int_t iDig=0; iDig< clu->GetNCells(); iDig++)
1874 absId = clu->GetCellAbsId(iDig);
1875 fraction = clu->GetCellAmplitudeFraction(iDig);
1876 if (fraction < 1e-4) fraction = 1.;
1880 geom->GetCellIndex(absId,iSM,iTower,iIphi,iIeta);
1881 geom->GetCellPhiEtaIndexInSModule(iSM,iTower,iIphi, iIeta,iphi,ieta);
1887 eCell = cells->GetCellAmplitude(absId)*fraction*recalFactor;
1890 totalWeight += weight;
1892 geom->RelPosCellInSModule(absId,depth,pLocal[0],pLocal[1],pLocal[2]);
1894 geom->GetGlobal(pLocal,pGlobal,iSupModMax);
1897 for (
int i=0; i<3; i++ ) newPos[i] += (weight*pGlobal[i]);
1902 for (
int i=0; i<3; i++ ) newPos[i] /= totalWeight;
1910 if (iSupModMax > 1) {
1923 clu->SetPosition(newPos);
1936 AliVCaloCells* cells,
1945 Int_t iIphi = -1, iIeta = -1;
1946 Int_t iSupMod = -1, iSupModMax = -1;
1947 Int_t iphi = -1, ieta =-1;
1957 Float_t weight = 0., weightedCol = 0., weightedRow = 0., totalWeight=0.;
1958 Bool_t areInSameSM = kTRUE;
1959 Int_t startingSM = -1;
1961 for (
Int_t iDig=0; iDig< clu->GetNCells(); iDig++)
1963 absId = clu->GetCellAbsId(iDig);
1964 fraction = clu->GetCellAmplitudeFraction(iDig);
1965 if (fraction < 1e-4) fraction = 1.;
1967 if (iDig==0) startingSM = iSupMod;
1968 else if (iSupMod != startingSM) areInSameSM = kFALSE;
1970 eCell = cells->GetCellAmplitude(absId);
1972 geom->GetCellIndex(absId,iSupMod,iTower,iIphi,iIeta);
1973 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
1982 eCell = cells->GetCellAmplitude(absId)*fraction*recalFactor;
1985 if (weight < 0) weight = 0;
1986 totalWeight += weight;
1987 weightedCol += ieta*weight;
1988 weightedRow += iphi*weight;
1993 Float_t xyzNew[]={-1.,-1.,-1.};
1994 if (areInSameSM == kTRUE)
1997 weightedCol = weightedCol/totalWeight;
1998 weightedRow = weightedRow/totalWeight;
2007 clu->SetPosition(xyzNew);
2019 AliVCaloCells* cells,
2020 AliVCluster * cluster)
2026 AliInfo(
"Cluster pointer null!");
2031 Int_t absIdMax = -1, iSupMod =-1, icolM = -1, irowM = -1;
2033 GetMaxEnergyCell(geom, cells, cluster, absIdMax, iSupMod, icolM, irowM, shared);
2041 for (
Int_t irow = 0; irow < AliEMCALGeoParams::fgkEMCALRows; irow++)
2043 for (
Int_t icol = 0; icol < AliEMCALGeoParams::fgkEMCALCols; icol++)
2046 if (hMap->GetBinContent(icol,irow)==0)
continue;
2050 dRrow=TMath::Abs(irowM-irow);
2051 dRcol=TMath::Abs(icolM-icol);
2052 dist=TMath::Sqrt(dRrow*dRrow+dRcol*dRcol);
2065 Int_t iSupMod2 = -1;
2068 if (iSupMod%2) iSupMod2 = iSupMod-1;
2069 else iSupMod2 = iSupMod+1;
2073 for (
Int_t irow = 0; irow < AliEMCALGeoParams::fgkEMCALRows; irow++)
2075 for (
Int_t icol = 0; icol < AliEMCALGeoParams::fgkEMCALCols; icol++)
2078 if (hMap2->GetBinContent(icol,irow)==0)
continue;
2082 dRrow=TMath::Abs(irow-irowM);
2085 dRcol=TMath::Abs(icol-(AliEMCALGeoParams::fgkEMCALCols+icolM));
2087 dRcol=TMath::Abs(AliEMCALGeoParams::fgkEMCALCols+icol-icolM);
2089 dist=TMath::Sqrt(dRrow*dRrow+dRcol*dRcol);
2090 if (dist < minDist) minDist = dist;
2095 AliDebug(2,Form(
"Max cluster cell (SM,col,row)=(%d %d %d) - Distance to Bad Channel %2.2f",iSupMod, icolM, irowM, minDist));
2096 cluster->SetDistanceToBadChannel(minDist);
2110 AliInfo(
"Cluster pointer null!");
2114 if (cluster->GetM02() != 0)
2115 fPIDUtils->ComputePID(cluster->E(),cluster->GetM02());
2117 Float_t pidlist[AliPID::kSPECIESCN+1];
2118 for (
Int_t i = 0; i < AliPID::kSPECIESCN+1; i++) pidlist[i] =
fPIDUtils->GetPIDFinal(i);
2120 cluster->SetPID(pidlist);
2145 AliVCaloCells* cells, AliVCluster * cluster,
2153 AliInfo(
"Cluster pointer null!");
2161 Bool_t isLowGain = kFALSE;
2189 disp = 0; dEta = 0; dPhi = 0;
2190 sEta = 0; sPhi = 0; sEtaPhi = 0;
2192 for (
Int_t iDigit=0; iDigit < cluster->GetNCells(); iDigit++)
2196 Int_t absId = cluster->GetCellAbsId(iDigit);
2198 geom->GetCellIndex(absId,iSupMod,iTower,iIphi,iIeta);
2199 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi,iIeta, iphi,ieta);
2202 if (iDigit == 0 ) iSM0 = iSupMod;
2203 else if (iSupMod!= iSM0) shared = kTRUE;
2206 fraction = cluster->GetCellAmplitudeFraction(iDigit);
2207 if (fraction < 1e-4) fraction = 1.;
2212 eCell = cells->GetCellAmplitude(absId)*fraction*recalFactor;
2213 tCell = cells->GetCellTime (absId);
2214 isLowGain = !(cells->GetCellHighGain(absId));
2223 if(eCell > cellEcut && TMath::Abs(tCell) < cellTimeCut)
2224 enAfterCuts += eCell;
2229 for (
Int_t iDigit=0; iDigit < cluster->GetNCells(); iDigit++)
2232 Int_t absId = cluster->GetCellAbsId(iDigit);
2234 geom->GetCellIndex(absId,iSupMod,iTower,iIphi,iIeta);
2235 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi,iIeta, iphi,ieta);
2238 fraction = cluster->GetCellAmplitudeFraction(iDigit);
2239 if (fraction < 1e-4) fraction = 1.;
2244 eCell = cells->GetCellAmplitude(absId)*fraction*recalFactor;
2245 tCell = cells->GetCellTime (absId);
2246 isLowGain = !(cells->GetCellHighGain(absId));
2254 if (shared && iSupMod%2) ieta+=AliEMCALGeoParams::fgkEMCALCols;
2256 if ( energy > 0 && eCell > cellEcut && TMath::Abs(tCell) < cellTimeCut )
2269 geom->EtaPhiFromIndex(absId, etai, phii);
2270 etai *= TMath::RadToDeg();
2271 phii *= TMath::RadToDeg();
2275 geom->GetGlobal(absId,pGlobal);
2287 phii = TMath::Sqrt(pGlobal[0]*pGlobal[0]+pGlobal[1]*pGlobal[1]);
2297 sEta += w * etai * etai ;
2298 etaMean += w * etai ;
2299 sPhi += w * phii * phii ;
2300 phiMean += w * phii ;
2301 sEtaPhi += w * etai * phii ;
2304 else if(eCell > 0.05)
2305 AliDebug(2,Form(
"Wrong energy in cell %f and/or cluster %f\n", eCell, cluster->E()));
2317 AliDebug(2,Form(
"Wrong weight %f\n", wtot));
2320 for (
Int_t iDigit=0; iDigit < cluster->GetNCells(); iDigit++)
2323 Int_t absId = cluster->GetCellAbsId(iDigit);
2325 geom->GetCellIndex(absId,iSupMod,iTower,iIphi,iIeta);
2326 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi,iIeta, iphi,ieta);
2329 fraction = cluster->GetCellAmplitudeFraction(iDigit);
2330 if (fraction < 1e-4) fraction = 1.;
2334 eCell = cells->GetCellAmplitude(absId)*fraction*recalFactor;
2335 tCell = cells->GetCellTime (absId);
2336 isLowGain = !(cells->GetCellHighGain(absId));
2344 if (shared && iSupMod%2) ieta+=AliEMCALGeoParams::fgkEMCALCols;
2346 if ( energy > 0 && eCell > cellEcut && TMath::Abs(tCell) < cellTimeCut )
2359 geom->EtaPhiFromIndex(absId, etai, phii);
2360 etai *= TMath::RadToDeg();
2361 phii *= TMath::RadToDeg();
2365 geom->GetGlobal(absId,pGlobal);
2377 phii = TMath::Sqrt(pGlobal[0]*pGlobal[0]+pGlobal[1]*pGlobal[1]);
2383 disp += w *((etai-etaMean)*(etai-etaMean)+(phii-phiMean)*(phii-phiMean));
2384 dEta += w * (etai-etaMean)*(etai-etaMean) ;
2385 dPhi += w * (phii-phiMean)*(phii-phiMean) ;
2389 AliDebug(2,Form(
"Wrong energy in cell %f and/or cluster %f\n", eCell, cluster->E()));
2393 if (wtot > 0 && nstat > 1)
2402 sEta -= etaMean * etaMean ;
2403 sPhi -= phiMean * phiMean ;
2404 sEtaPhi -= etaMean * phiMean ;
2406 l0 = (0.5 * (sEta + sPhi) + TMath::Sqrt( 0.25 * (sEta - sPhi) * (sEta - sPhi) + sEtaPhi * sEtaPhi ));
2407 l1 = (0.5 * (sEta + sPhi) - TMath::Sqrt( 0.25 * (sEta - sPhi) * (sEta - sPhi) + sEtaPhi * sEtaPhi ));
2416 dEta = 0. ; dPhi = 0. ; disp = 0. ;
2417 sEta = 0. ; sPhi = 0. ; sEtaPhi = 0. ;
2441 AliVCaloCells* cells, AliVCluster * cluster,
2448 Float_t cellTimeWindow = 1000;
2451 cellEmin, cellTimeWindow, bc,
2452 newEnergy, l0, l1, disp,
2453 dEta, dPhi, sEta, sPhi, sEtaPhi);
2466 AliVCaloCells* cells,
2467 AliVCluster * cluster)
2470 Float_t disp = 0., dEta = 0., dPhi = 0.;
2471 Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
2474 dEta, dPhi, sEta, sPhi, sEtaPhi);
2476 cluster->SetM02(l0);
2477 cluster->SetM20(l1);
2478 if (disp > 0. ) cluster->SetDispersion(TMath::Sqrt(disp)) ;
2496 AliVCaloCells* cells, AliVCluster * cluster,
2501 Float_t disp = 0., dEta = 0., dPhi = 0.;
2502 Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
2505 cellEcut, cellTimeCut, bc,
2506 enAfterCuts, l0, l1, disp,
2507 dEta, dPhi, sEta, sPhi, sEtaPhi);
2509 cluster->SetM02(l0);
2510 cluster->SetM20(l1);
2511 if (disp > 0. ) cluster->SetDispersion(TMath::Sqrt(disp)) ;
2531 const AliEMCALGeometry *geom,
2548 if (!TGeoGlobalMagField::Instance()->GetField())
2550 if (!event->InitMagneticField())
2552 AliInfo(
"Mag Field not initialized, null esd/aod evetn pointers");
2558 UInt_t mask1 = esdevent->GetESDRun()->GetDetectorsInDAQ();
2559 UInt_t mask2 = esdevent->GetESDRun()->GetDetectorsInReco();
2560 Bool_t desc1 = (mask1 >> 3) & 0x1;
2561 Bool_t desc2 = (mask2 >> 3) & 0x1;
2562 if (desc1==0 || desc2==0) {
2573 clusterArray =
new TObjArray(event->GetNumberOfCaloClusters());
2574 for (
Int_t icl=0; icl<
event->GetNumberOfCaloClusters(); icl++)
2576 AliVCluster *cluster = (AliVCluster*) event->GetCaloCluster(icl);
2577 if (!
IsGoodCluster(cluster,geom,(AliVCaloCells*)event->GetEMCALCells()))
2579 clusterArray->AddAt(cluster,icl);
2586 for (
Int_t i=0; i<21;i++) cv[i]=0;
2587 for (
Int_t itr=0; itr<
event->GetNumberOfTracks(); itr++)
2589 AliExternalTrackParam *trackParam = 0;
2592 AliESDtrack *esdTrack = 0;
2593 AliAODTrack *aodTrack = 0;
2596 esdTrack = esdevent->GetTrack(itr);
2597 if (!esdTrack)
continue;
2601 if ( TMath::Abs(esdTrack->Eta()) > 0.9 )
continue;
2604 if( geom->GetNumberOfSuperModules() < 13 )
2606 Double_t phi = esdTrack->Phi()*TMath::RadToDeg();
2607 if ( phi <= 10 || phi >= 250 )
continue;
2611 trackParam =
const_cast<AliExternalTrackParam*
>(esdTrack->GetInnerParam());
2613 trackParam =
new AliExternalTrackParam(*esdTrack);
2615 mcLabel = TMath::Abs(esdTrack->GetLabel());
2622 aodTrack =
dynamic_cast<AliAODTrack*
>(aodevent->GetTrack(itr));
2624 if (!aodTrack) AliFatal(
"Not a standard AOD");
2626 if (!aodTrack)
continue;
2631 if (!aodTrack->IsTPCConstrained())
continue ;
2636 if (!aodTrack->IsHybridGlobalConstrainedGlobal())
continue ;
2645 if ( TMath::Abs(aodTrack->Eta()) > 0.9 )
continue;
2648 if( geom->GetNumberOfSuperModules() < 13 )
2650 Double_t phi = aodTrack->Phi()*TMath::RadToDeg();
2651 if ( phi <= 10 || phi >= 250 )
continue;
2655 aodTrack->GetXYZ(pos);
2656 aodTrack->GetPxPyPz(mom);
2657 AliDebug(5,Form(
"aod track: i=%d | pos=(%5.4f,%5.4f,%5.4f) | mom=(%5.4f,%5.4f,%5.4f) | charge=%d\n",
2658 itr,pos[0],pos[1],pos[2],mom[0],mom[1],mom[2],aodTrack->Charge()));
2660 trackParam=
new AliExternalTrackParam(pos,mom,cv,aodTrack->Charge());
2662 mcLabel = TMath::Abs(aodTrack->GetLabel());
2668 AliWarning(
"Wrong input data type! Should be \"AOD\" or \"ESD\" ");
2671 clusterArray->Clear();
2672 delete clusterArray;
2677 if (!trackParam)
continue;
2685 mc->GetCocktailGenerator(mcLabel,genName);
2693 if ( !generOK )
continue;
2697 AliExternalTrackParam emcalParam(*trackParam);
2701 if (aodevent && trackParam)
delete trackParam;
2706 if ( TMath::Abs(eta) > 0.75 )
2708 if ( trackParam && (aodevent ||
fITSTrackSA) )
delete trackParam;
2713 if ( geom->GetNumberOfSuperModules() < 13 &&
2714 ( phi < 70*TMath::DegToRad() || phi > 190*TMath::DegToRad()))
2716 if ( trackParam && (aodevent ||
fITSTrackSA) )
delete trackParam;
2722 Float_t dEta = -999, dPhi = -999;
2738 if (aodevent && trackParam)
delete trackParam;
2744 clusterArray->Clear();
2745 delete clusterArray;
2748 AliDebug(2,Form(
"Number of matched pairs = %d !\n",matched));
2769 const AliVEvent *event,
2770 const AliEMCALGeometry *geom,
2775 if ( TMath::Abs(track->Eta()) > 0.9 )
return index;
2778 if( geom->GetNumberOfSuperModules() < 13 )
2780 Double_t phiV = track->Phi()*TMath::RadToDeg();
2781 if ( phiV <= 10 || phiV >= 250 )
return index;
2784 AliExternalTrackParam *trackParam = 0;
2786 trackParam =
const_cast<AliExternalTrackParam*
>(track->GetInnerParam());
2788 trackParam =
new AliExternalTrackParam(*track);
2790 if (!trackParam)
return index;
2791 AliExternalTrackParam emcalParam(*trackParam);
2800 if ( TMath::Abs(eta) > 0.75 )
2807 if ( geom->GetNumberOfSuperModules() < 13 &&
2808 ( phi < 70*TMath::DegToRad() || phi > 190*TMath::DegToRad()))
2816 for (
Int_t icl=0; icl<
event->GetNumberOfCaloClusters(); icl++)
2818 AliVCluster *cluster = (AliVCluster*) event->GetCaloCluster(icl);
2819 if (!
IsGoodCluster(cluster,geom,(AliVCaloCells*)event->GetEMCALCells()))
continue;
2820 clusterArr->AddAt(cluster,icl);
2824 clusterArr->Clear();
2843 AliExternalTrackParam *trkParam,
2847 dEta=-999, dPhi=-999;
2850 Float_t tmpEta=-999, tmpPhi=-999;
2853 if (!emcalParam->GetXYZ(exPos))
return index;
2855 Float_t clsPos[3] = {0.,0.,0.};
2856 for (
Int_t icl=0; icl<clusterArr->GetEntriesFast(); icl++)
2858 AliVCluster *cluster =
dynamic_cast<AliVCluster*
> (clusterArr->At(icl)) ;
2860 if (!cluster || !cluster->IsEMCAL())
continue;
2862 cluster->GetPosition(clsPos);
2864 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));
2867 AliExternalTrackParam trkPamTmp (*trkParam);
2869 if (!AliEMCALRecoUtilsBase::ExtrapolateTrackToCluster(&trkPamTmp, cluster,
fMass,
fStepCluster, tmpEta, tmpPhi))
continue;
2873 Float_t tmpR=TMath::Sqrt(tmpEta*tmpEta + tmpPhi*tmpPhi);
2884 if (TMath::Abs(tmpEta)<TMath::Abs(dEtaMax) && TMath::Abs(tmpPhi)<TMath::Abs(dPhiMax))
2893 AliError(
"Please specify your cut criteria");
2894 AliError(
"To cut on sqrt(dEta^2+dPhi^2), use: SwitchOnCutEtaPhiSum()");
2895 AliError(
"To cut on dEta and dPhi separately, use: SwitchOnCutEtaPhiSeparate()");
2920 const AliVCluster *cluster,
2924 return AliEMCALRecoUtilsBase::ExtrapolateTrackToCluster(trkParam, cluster,
fMass,
fStepCluster, tmpEta, tmpPhi);
2942 AliDebug(2,
"No matched tracks found!\n");
2966 AliDebug(2,
"No matched cluster found!\n");
3060 AliDebug(3,Form(
"Matched cluster index: index: %d, dEta: %2.4f, dPhi: %2.4f.\n",
3090 AliDebug(3,Form(
"Matched track index: index: %d, dEta: %2.4f, dPhi: %2.4f.\n",
3114 const AliEMCALGeometry *geom,
3115 AliVCaloCells* cells,
Int_t bc)
3119 if (!cluster || !cluster->IsEMCAL())
return kFALSE;
3140 UInt_t status = esdTrack->GetStatus();
3142 Int_t nClustersITS = esdTrack->GetITSclusters(0);
3143 Int_t nClustersTPC = esdTrack->GetTPCclusters(0);
3145 Float_t chi2PerClusterITS = -1;
3146 Float_t chi2PerClusterTPC = -1;
3147 if (nClustersITS!=0)
3148 chi2PerClusterITS = esdTrack->GetITSchi2()/
Float_t(nClustersITS);
3149 if (nClustersTPC!=0)
3150 chi2PerClusterTPC = esdTrack->GetTPCchi2()/
Float_t(nClustersTPC);
3158 Float_t maxDCAToVertexXYPtDep = 0.0182 + 0.0350/TMath::Power(esdTrack->Pt(),1.01);
3167 Float_t maxDCAToVertexXYPtDep = 0.0105 + 0.0350/TMath::Power(esdTrack->Pt(),1.1);
3177 esdTrack->GetImpactParameters(b,bCov);
3178 if (bCov[0]<=0 || bCov[2]<=0)
3180 AliDebug(1,
"Estimated b resolution lower or equal zero!");
3181 bCov[0]=0; bCov[2]=0;
3192 dcaToVertex = TMath::Sqrt(dcaToVertexXY*dcaToVertexXY + dcaToVertexZ*dcaToVertexZ);
3224 if ( (esdTrack->HasPointOnITSLayer(0) || esdTrack->HasPointOnITSLayer(1)) == kFALSE)
3231 if ((status & AliESDtrack::kITSin) == 0 || (status & AliESDtrack::kTPCin))
3241 if (status & AliESDtrack::kITSpureSA) cuts[11] = kTRUE;
3245 if (!(status & AliESDtrack::kITSpureSA)) cuts[11] = kTRUE;
3252 if (cuts[i]) { cut = kTRUE ; }
3273 AliInfo(Form(
"Track cuts for matching: AliESDtrackCuts::GetStandardTPCOnlyTrackCuts()"));
3291 AliInfo(Form(
"Track cuts for matching: AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE)"));
3309 AliInfo(Form(
"Track cuts for matching: Loose cut w/o DCA cut"));
3318 AliInfo(Form(
"Track cuts for matching: ITS Stand Alone tracks cut w/o DCA cut"));
3327 AliInfo(Form(
"Track cuts for matching: AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kTRUE)"));
3345 AliInfo(Form(
"Track cuts for matching: Loose cut w/o DCA cut plus ITSrefit"));
3363 Int_t nTracks =
event->GetNumberOfTracks();
3364 for (
Int_t iTrack = 0; iTrack < nTracks; ++iTrack)
3366 AliVTrack* track =
dynamic_cast<AliVTrack*
>(
event->GetTrack(iTrack));
3369 AliWarning(Form(
"Could not receive track %d", iTrack));
3374 track->SetEMCALcluster(matchClusIndex);
3377 AliESDtrack* esdtrack =
dynamic_cast<AliESDtrack*
>(track);
3380 if (matchClusIndex != -1)
3381 esdtrack->SetStatus(AliESDtrack::kEMCALmatch);
3383 esdtrack->ResetStatus(AliESDtrack::kEMCALmatch);
3387 AliAODTrack* aodtrack =
dynamic_cast<AliAODTrack*
>(track);
3388 if (matchClusIndex != -1)
3389 aodtrack->SetStatus(AliESDtrack::kEMCALmatch);
3391 aodtrack->ResetStatus(AliESDtrack::kEMCALmatch);
3394 AliDebug(2,
"Track matched to closest cluster");
3406 for (
Int_t iClus=0; iClus <
event->GetNumberOfCaloClusters(); ++iClus)
3408 AliVCluster *cluster =
event->GetCaloCluster(iClus);
3409 if (!cluster->IsEMCAL())
3415 if(cluster->GetNTracksMatched() > 0)
3417 if(!strcmp(
"AliESDCaloCluster",Form(
"%s",cluster->ClassName())))
3420 ((AliESDCaloCluster*)cluster)->AddTracksMatched(arrayTrackMatched);
3424 for(
Int_t iTrack = 0; iTrack < cluster->GetNTracksMatched(); iTrack++)
3426 ((AliAODCaloCluster*)cluster)->RemoveTrackMatched((
TObject*)((AliAODCaloCluster*)cluster)->GetTrackMatched(iTrack));
3434 Int_t nTracks =
event->GetNumberOfTracks();
3435 TArrayI arrayTrackMatched(nTracks);
3440 if (matchTrackIndex != -1)
3442 arrayTrackMatched[nMatched] = matchTrackIndex;
3447 for (
Int_t iTrk=0; iTrk<nTracks; ++iTrk)
3449 AliVTrack* track =
dynamic_cast<AliVTrack*
>(
event->GetTrack(iTrk));
3451 if( !track )
continue;
3453 if ( iTrk == matchTrackIndex )
continue;
3455 if ( track->GetEMCALcluster() == iClus )
3457 arrayTrackMatched[nMatched] = iTrk;
3462 AliDebug(2,Form(
"cluster E %f, N matches %d, first match %d\n",cluster->E(),nMatched,arrayTrackMatched[0]));
3464 arrayTrackMatched.Set(nMatched);
3465 AliESDCaloCluster *esdcluster =
dynamic_cast<AliESDCaloCluster*
>(cluster);
3467 esdcluster->AddTracksMatched(arrayTrackMatched);
3468 else if ( nMatched > 0 )
3470 AliAODCaloCluster *aodcluster =
dynamic_cast<AliAODCaloCluster*
>(cluster);
3473 aodcluster->AddTrackMatched(event->GetTrack(arrayTrackMatched.At(0)));
3480 Float_t eta= -999, phi = -999;
3481 if (matchTrackIndex != -1)
3484 cluster->SetTrackDistance(phi, eta);
3487 AliDebug(2,
"Cluster matched to tracks");
3500 for(
int i = 0; i < map->GetEntries(); i++){
3501 TH2F *hist =
dynamic_cast<TH2F *
>(map->At(i));
3515 clone->SetDirectory(NULL);
3529 for(
int i = 0; i < map->GetEntries(); i++){
3530 TH2I *hist =
dynamic_cast<TH2I *
>(map->At(i));
3543 TH2I *clone =
new TH2I(*h);
3544 clone->SetDirectory(NULL);
3558 for(
int i = 0; i < map->GetEntries(); i++){
3559 TH1F *hist =
dynamic_cast<TH1F *
>(map->At(i));
3572 TH1F *clone =
new TH1F(*h);
3573 clone->SetDirectory(NULL);
3587 for(
int i = 0; i < map->GetEntries(); i++) {
3588 TH1C *hist =
dynamic_cast<TH1C *
>(map->At(i));
3600 TH1C *clone =
new TH1C(*h);
3601 clone->SetDirectory(NULL);
3611 printf(
"-------------------------------------------------------------------------------------------------------------------------------------- \n");
3612 printf(
"AliEMCALRecoUtils Settings: \n");
3613 printf(
"\tMisalignment shifts\n");
3614 for (
Int_t i=0; i<5; i++) printf(
"\t\t sector %d, traslation (x,y,z)=(%f,%f,%f), rotation (x,y,z)=(%f,%f,%f)\n",i,
3623 printf(
"\tMatching criteria: ");
3625 printf(
"\t\tsqrt(dEta^2+dPhi^2)<%4.3f\n",
fCutR);
3629 printf(
"\t\tError\n");
3630 printf(
"\t\tplease specify your cut criteria\n");
3631 printf(
"\t\tTo cut on sqrt(dEta^2+dPhi^2), use: SwitchOnCutEtaPhiSum()\n");
3632 printf(
"\t\tTo cut on dEta and dPhi separately, use: SwitchOnCutEtaPhiSeparate()\n");
3635 printf(
"\tMass hypothesis = %2.3f [GeV/c^2], extrapolation step to surface = %2.2f[cm], step to cluster = %2.2f[cm]\n",
fMass,
fStepSurface,
fStepCluster);
3636 printf(
"\tCluster selection window: dR < %2.0f\n",
fClusterWindow);
3638 printf(
"\tTrack cuts: \n");
3646 printf(
"-------------------------------------------------------------------------------------------------------------------------------------- \n");
void RecalculateCellLabelsRemoveAddedGenerator(Int_t absID, AliVCluster *clus, AliMCEvent *mc, Float_t &, TArrayI &labeArr, TArrayF &eDepArr) const
Bool_t IsL1PhaseInTimeRecalibrationOn() const
Double_t fMass
Mass hypothesis of the track.
Bool_t fMCGenerToAcceptForTrack
Activate the removal of tracks entering the track matching that come from a particular generator...
Bool_t CheckCellFiducialRegion(const AliEMCALGeometry *geom, const AliVCluster *cluster, AliVCaloCells *cells)
Bool_t fAODTPCOnlyTracks
Match with TPC only tracks.
Bool_t fCutRequireTPCRefit
Require TPC refit.
void InitEMCALRecalibrationFactors()
void SetRequireITSStandAlone(Bool_t b=kFALSE)
Bool_t IsClusterMatched(Int_t clsIndex) const
Float_t GetEMCALChannelTimeRecalibrationFactor(Int_t bc, Int_t absID, Bool_t isLGon=kFALSE) const
TArrayI * fMatchedClusterIndex
Array that stores indexes of matched clusters.
TObjArray * fEMCALTimeRecalibrationFactors
Array of histograms with map of time recalibration factors, EMCAL.
void SetMaxDCAToVertexXY(Float_t dist=1e10)
TRandom3 fRandom
Random generator for cluster energy smearing.
Bool_t fTimeRecalibration
Switch on or off the time recalibration.
Bool_t fCutEtaPhiSum
Place cut on sqrt(dEta^2+dPhi^2)
Int_t FindMatchedClusterInClusterArr(const AliExternalTrackParam *emcalParam, AliExternalTrackParam *trkParam, const TObjArray *clusterArr, Float_t &dEta, Float_t &dPhi)
void InitEMCALL1PhaseInTimeRecalibration()
Int_t fCutMinNClusterTPC
Min number of tpc clusters.
Float_t fCutMaxDCAToVertexZ
Track-to-vertex cut in max absolute distance in z-plane.
void SetRequireITSRefit(Bool_t b=kFALSE)
Int_t fShowerShapeCellLocationType
void SetEMCALL1PhaseInTimeRecalibrationForSM(Int_t iSM, Int_t c=0)
void SetDCAToVertex2D(Bool_t b=kFALSE)
void SetEMCALChannelRecalibrationFactor(Int_t iSM, Int_t iCol, Int_t iRow, Double_t c=1)
Int_t fNonLinearThreshold
Non linearity threshold value for kBeamTest non linearity function.
Bool_t fITSTrackSA
If track matching is to be done with ITS tracks standing alone.
void SetITSTrackSA(Bool_t isITS)
Bool_t IsExoticCluster(const AliVCluster *cluster, AliVCaloCells *cells, Int_t bc=0)
Float_t fMisalRotShift[15]
Cluster position rotation shift parameters.
void SetMinNClustersTPC(Int_t min=-1)
virtual ~AliEMCALRecoUtils()
Bool_t fRecalDistToBadChannels
Calculate distance from highest energy tower of cluster to closes bad channel.
Bool_t fRecalibration
Switch on or off the recalibration.
TArrayI * fMatchedTrackIndex
Array that stores indexes of matched tracks.
void SetMaxDCAToVertexZ(Float_t dist=1e10)
Bool_t IsBadChannelsRemovalSwitchedOn() const
Bool_t IsExoticCell(Int_t absId, AliVCaloCells *cells, Int_t bc=-1)
void RecalculateClusterPositionFromTowerGlobal(const AliEMCALGeometry *geom, AliVCaloCells *cells, AliVCluster *clu)
Float_t fExoticCellDiffTime
If time of candidate to exotic and close cell is too different (in ns), it must be noisy...
TArrayF * fResidualPhi
Array that stores the residual phi.
void RecalibrateCells(AliVCaloCells *cells, Int_t bc)
Double_t fCutMinTrackPt
Cut on track pT.
Bool_t IsRecalibrationOn() const
Some utilities for cluster and cell treatment.
Float_t fCutMaxChi2PerClusterITS
Max its fit chi2 per its cluster.
void RecalculateClusterShowerShapeParametersWithCellCuts(const AliEMCALGeometry *geom, AliVCaloCells *cells, AliVCluster *cluster, Float_t cellEcut, Float_t cellTimeCut, Int_t bc, Float_t &enAfterCuts)
Bool_t fRemoveBadChannels
Check the channel status provided and remove clusters with bad channels.
Bool_t IsAccepted(AliESDtrack *track)
Float_t fMisalTransShift[15]
Cluster position translation shift parameters.
void SetAcceptKinkDaughters(Bool_t b=kTRUE)
void RecalculateClusterDistanceToBadChannel(const AliEMCALGeometry *geom, AliVCaloCells *cells, AliVCluster *cluster)
Double_t fClusterWindow
Select clusters in the window to be matched.
Bool_t fCutRequireITSRefit
Require ITS refit.
Float_t fNonLinearityParams[10]
Parameters for the non linearity function.
Float_t GetCellWeight(Float_t eCell, Float_t eCluster) const
Bool_t fUseL1PhaseInTimeRecalibration
Switch on or off the L1 phase in time recalibration.
Float_t GetEMCALChannelRecalibrationFactor(Int_t iSM, Int_t iCol, Int_t iRow) const
void SetClusterMatchedToTrack(const AliVEvent *event)
Bool_t fCutDCAToVertex2D
If true a 2D DCA cut is made.
Int_t GetMatchedTrackIndex(Int_t clsIndex)
void RecalculateClusterPositionFromTowerIndex(const AliEMCALGeometry *geom, AliVCaloCells *cells, AliVCluster *clu)
void Print(const Option_t *) const
UInt_t FindMatchedPosForCluster(Int_t clsIndex) const
Bool_t AcceptCalibrateCell(Int_t absId, Int_t bc, Float_t &, Double_t &time, AliVCaloCells *cells)
void RecalculateClusterShowerShapeParameters(const AliEMCALGeometry *geom, AliVCaloCells *cells, AliVCluster *cluster)
Float_t fCutR
sqrt(dEta^2+dPhi^2) cut on matching
Int_t fNCellsFromEMCALBorder
Number of cells from EMCAL border the cell with maximum amplitude has to be.
Bool_t fCellsRecalibrated
Internal bool to check if cells (time/energy) where recalibrated and not recalibrate them when recalc...
Bool_t fRejectExoticCluster
Switch on or off exotic cluster rejection.
Bool_t IsTimeRecalibrationOn() const
Int_t fParticleType
Particle type for depth calculation, see enum ParticleType.
Int_t GetEMCALChannelStatus(Int_t iSM, Int_t iCol, Int_t iRow) const
void SetMaxChi2PerClusterTPC(Float_t max=1e10)
Float_t fConstantTimeShift
Apply a 600 ns (+15.8) time shift in case of simulation, shift in ns.
Int_t GetMatchedClusterIndex(Int_t trkIndex)
Int_t fNonLinearityFunction
Non linearity function choice, see enum NonlinearityFunctions.
Bool_t fCutRequireITSStandAlone
Require ITSStandAlone.
TObjArray * fEMCALL1PhaseInTimeRecalibration
Histogram with map of L1 phase per SM, EMCAL.
TObjArray * fEMCALRecalibrationFactors
Array of histograms with map of recalibration factors, EMCAL.
Bool_t fUseRunCorrectionFactors
Use Run Dependent Correction.
void SetTracksMatchedToCluster(const AliVEvent *event)
Float_t fCutMaxChi2PerClusterTPC
Max tpc fit chi2 per tpc cluster.
Float_t fExoticCellMinAmplitude
Check for exotic only if amplitud is larger than this value.
void RecalibrateClusterEnergy(const AliEMCALGeometry *geom, AliVCluster *cluster, AliVCaloCells *cells, Int_t bc=-1)
Float_t fW0
Energy weight used in cluster position and shower shape calculations.
Bool_t fAODHybridTracks
Match with hybrid.
void GetMatchedResiduals(Int_t clsIndex, Float_t &dEta, Float_t &dPhi)
AliEMCALRecoUtils & operator=(const AliEMCALRecoUtils &)
void SetRequireTPCRefit(Bool_t b=kFALSE)
TArrayF * fResidualEta
Array that stores the residual eta.
TString fMCGenerToAccept[5]
List with name of generators that should not be included.
Bool_t fSmearClusterEnergy
Smear cluster energy, to be done only for simulated data to match real data.
Bool_t IsGoodCluster(AliVCluster *cluster, const AliEMCALGeometry *geom, AliVCaloCells *cells, Int_t bc=-1)
void GetMaxEnergyCell(const AliEMCALGeometry *geom, AliVCaloCells *cells, const AliVCluster *clu, Int_t &absId, Int_t &iSupMod, Int_t &ieta, Int_t &iphi, Bool_t &shared)
void InitEMCALTimeRecalibrationFactors()
Double_t fStepSurface
Length of step to extrapolate tracks to EMCal surface.
UInt_t fAODFilterMask
Filter mask to select AOD tracks. Refer to $ALICE_ROOT/ANALYSIS/macros/AddTaskESDFilter.C.
static Bool_t ExtrapolateTrackToCluster(AliExternalTrackParam *trkParam, const AliVCluster *cluster, Double_t mass, Double_t step, Float_t &tmpEta, Float_t &tmpPhi)
void GetMatchedClusterResiduals(Int_t trkIndex, Float_t &dEta, Float_t &dPhi)
Float_t fSmearClusterParam[3]
Energy smearing parameters.
Bool_t fCutAcceptKinkDaughters
Accepting kink daughters?
void RecalculateClusterPosition(const AliEMCALGeometry *geom, AliVCaloCells *cells, AliVCluster *clu)
Float_t fExoticCellFraction
Good cell if fraction < 1-ecross/ecell.
void RecalculateClusterPID(AliVCluster *cluster)
Int_t fPosAlgo
Position recalculation algorithm, see enum PositionAlgorithms.
void SetEMCALL1PhaseInTimeRecalibrationForAllSM(const TObjArray *map)
AliEMCALPIDUtils * fPIDUtils
Recalculate PID parameters.
Bool_t fRejectExoticCells
Remove exotic cells.
Int_t FindMatchedClusterInEvent(const AliESDtrack *track, const AliVEvent *event, const AliEMCALGeometry *geom, Float_t &dEta, Float_t &dPhi)
Bool_t IsTrackMatched(Int_t trkIndex) const
void RecalibrateCellTimeL1Phase(Int_t iSM, Int_t bc, Double_t &time) const
Float_t fCutMaxDCAToVertexXY
Track-to-vertex cut in max absolute distance in xy-plane.
void FindMatches(AliVEvent *event, TObjArray *clusterArr=0x0, const AliEMCALGeometry *geom=0x0, AliMCEvent *mc=0x0)
TObjArray * fEMCALBadChannelMap
Array of histograms with map of bad channels, EMCAL.
void SetEMCALChannelTimeRecalibrationFactors(const TObjArray *map)
Double_t fStepCluster
Length of step to extrapolate tracks to clusters.
Bool_t fNoEMCALBorderAtEta0
Do fiducial cut in EMCAL region eta = 0?
Int_t fNMCGenerToAccept
Number of MC generators that should not be included in analysis.
void SetEMCALChannelTimeRecalibrationFactor(Int_t bc, Int_t absID, Double_t c=0, Bool_t isLGon=kFALSE)
Bool_t fCutRequireITSpureSA
ITS pure standalone tracks.
void InitEMCALBadChannelStatusMap()
Int_t GetEMCALL1PhaseInTimeRecalibrationForSM(Int_t iSM) const
Int_t fCutMinNClusterITS
Min number of its clusters.
Float_t CorrectClusterEnergyLinearity(AliVCluster *clu)
UInt_t FindMatchedPosForTrack(Int_t trkIndex) const
Bool_t ClusterContainsBadChannel(const AliEMCALGeometry *geom, const UShort_t *cellList, Int_t nCells)
Double_t fEMCalSurfaceDistance
EMCal surface distance (= 430 by default, the last 10 cm are propagated on a cluster-track pair basis...
void SetEMCALChannelRecalibrationFactors(const TObjArray *map)
void InitNonLinearityParam()
Float_t GetECross(Int_t absID, Double_t tcell, AliVCaloCells *cells, Int_t bc)
Bool_t fLowGain
Switch on or off calibration with low gain channels.
void SetEMCALChannelStatusMap(const TObjArray *map)
Float_t fCutPhi
dPhi cut on matching
Int_t fTrackCutsType
ESD track cuts type for matching, see enum TrackCutsType.
void RecalibrateCellTime(Int_t absId, Int_t bc, Double_t &time, Bool_t isLGon=kFALSE) const
Bool_t fCutEtaPhiSeparate
Cut on dEta and dPhi separately.
Float_t fCutEta
dEta cut on matching
Float_t SmearClusterEnergy(const AliVCluster *clu)