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)
103 : AliEMCALRecoUtilsBase(reco),
177 if (
this == &reco)
return *
this;
178 ((
TNamed *)
this)->operator=(reco);
253 for (
Int_t j = 0; j < 5 ; j++)
311 for (
Int_t j = 0; j < 4 ; j++)
399 AliVCaloCells* cells)
401 AliEMCALGeometry* geom = AliEMCALGeometry::GetInstance();
405 AliError(
"No instance of the geometry is available");
409 if ( absID < 0 || absID >= 24*48*geom->GetNumberOfSuperModules() )
412 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1, status=0;
414 if (!geom->GetCellIndex(absID,imod,iTower,iIphi,iIeta))
421 geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
429 AliDebug(1,Form(
"Channel absId %d, status %d, set as bad %d",absID, status, bad));
431 if ( bad )
return kFALSE;
435 amp = cells->GetCellAmplitude(absID);
440 time = cells->GetCellTime(absID);
442 Bool_t isLowGain = !(cells->GetCellHighGain(absID));
463 const AliVCluster* cluster,
464 AliVCaloCells* cells)
468 AliInfo(
"Cluster pointer null!");
476 Int_t absIdMax = -1, iSM =-1, ieta = -1, iphi = -1;
480 AliDebug(2,Form(
"Cluster Max AbsId %d, Cell Energy %2.2f, Cluster Energy %2.2f, Ncells from border %d, EMCAL eta=0 %d\n",
483 if (absIdMax==-1)
return kFALSE;
489 if (iSM < 0 || iphi < 0 || ieta < 0 )
491 AliFatal(Form(
"Negative value for super module: %d, or cell ieta: %d, or cell iphi: %d, check EMCAL geometry name\n",
498 if ( geom->GetSMType(iSM) == AliEMCALGeometry::kEMCAL_Half ) iPhiLast /= 2;
499 else if ( geom->GetSMType(iSM) == AliEMCALGeometry::kEMCAL_3rd ) iPhiLast /= 3;
500 else if ( geom->GetSMType(iSM) == AliEMCALGeometry::kDCAL_Ext ) iPhiLast /= 3;
502 if(iphi >= fNCellsFromEMCALBorder && iphi < iPhiLast - fNCellsFromEMCALBorder) okrow = kTRUE;
509 if ( geom->IsDCALSM(iSM) ) iEtaLast = iEtaLast*2/3;
511 if ( ieta > fNCellsFromEMCALBorder && ieta < iEtaLast-fNCellsFromEMCALBorder ) okcol = kTRUE;
517 if (ieta >= fNCellsFromEMCALBorder) okcol = kTRUE;
521 if (ieta < iEtaLast-fNCellsFromEMCALBorder) okcol = kTRUE;
525 AliDebug(2,Form(
"EMCAL Cluster in %d cells fiducial volume: ieta %d, iphi %d, SM %d: column? %d, row? %d\nq",
526 fNCellsFromEMCALBorder, ieta, iphi, iSM, okcol, okrow));
534 AliDebug(2,Form(
"Reject cluster in border, max cell : ieta %d, iphi %d, SM %d\n",ieta, iphi, iSM));
561 for (
Int_t iCell = 0; iCell<nCells; iCell++)
564 Int_t iTower = -1, iIphi = -1, iIeta = -1;
565 geom->GetCellIndex(cellList[iCell],imod,iTower,iIphi,iIeta);
569 geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,irow,icol);
574 AliDebug(2,Form(
"Cluster with bad channel: SM %d, col %d, row %d, status %d\n",imod, icol, irow, status));
595 AliVCaloCells* cells,
Int_t bc)
597 AliEMCALGeometry * geom = AliEMCALGeometry::GetInstance();
601 AliError(
"No instance of the geometry is available");
605 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
606 geom->GetCellIndex(absID,imod,iTower,iIphi,iIeta);
607 geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
614 if ( iphi < AliEMCALGeoParams::fgkEMCALRows-1) absID1 = geom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta);
615 if ( iphi > 0 ) absID2 = geom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta);
622 if ( ieta == AliEMCALGeoParams::fgkEMCALCols-1 && !(imod%2) )
624 absID3 = geom-> GetAbsCellIdFromCellIndexes(imod+1, iphi, 0);
625 absID4 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
627 else if ( ieta == 0 && imod%2 )
629 absID3 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
630 absID4 = geom-> GetAbsCellIdFromCellIndexes(imod-1, iphi, AliEMCALGeoParams::fgkEMCALCols-1);
634 if ( ieta < AliEMCALGeoParams::fgkEMCALCols-1 )
635 absID3 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
637 absID4 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
642 Float_t ecell1 = 0, ecell2 = 0, ecell3 = 0, ecell4 = 0;
643 Double_t tcell1 = 0, tcell2 = 0, tcell3 = 0, tcell4 = 0;
655 return ecell1+ecell2+ecell3+ecell4;
677 if (!accept)
return kTRUE;
685 AliDebug(2,Form(
"AliEMCALRecoUtils::IsExoticCell() - EXOTIC CELL id %d, eCell %f, eCross %f, 1-eCross/eCell %f\n",
686 absID,ecell,eCross,1-eCross/ecell));
704 AliVCaloCells *cells,
709 AliInfo(
"Cluster pointer null!");
716 AliEMCALGeometry* geom = AliEMCALGeometry::GetInstance();
720 AliError(
"No instance of the geometry is available");
724 Int_t iSupMod = -1, absId = -1, ieta = -1, iphi = -1;
744 AliInfo(
"Cluster pointer null!");
756 AliDebug(2, Form(
"Energy: original %f, smeared %f\n", energy, rdmEnergy));
775 AliInfo(
"Cluster pointer null!");
783 AliInfo(Form(
"Too low cluster energy!, E = %f < 0.100 GeV",energy));
786 else if(energy > 300.)
788 AliInfo(Form(
"Too high cluster energy!, E = %f GeV, do not apply non linearity",energy));
1062 AliDebug(2,
"No correction on the energy\n");
1302 if ( status == AliCaloCalibPedestal::kAlive )
1315 status == AliCaloCalibPedestal::kDead )
1318 status == AliCaloCalibPedestal::kHot )
1321 status == AliCaloCalibPedestal::kWarning )
1326 AliWarning(Form(
"Careful, bad channel selection not properly done: ism %d, icol %d, irow %d, status %d,\n" 1327 " fBadAll %d, fBadHot %d, fBadWarm %d, fBadDead %d",
1328 iSM, iCol, iRow, status,
1350 AliVCaloCells* cells,
1351 const AliVCluster* clu,
1362 Int_t cellAbsId = -1 ;
1371 AliInfo(
"Cluster pointer null!");
1372 absId=-1; iSupMod0=-1, ieta = -1; iphi = -1; shared = -1;
1376 for (
Int_t iDig=0; iDig< clu->GetNCells(); iDig++)
1378 cellAbsId = clu->GetCellAbsId(iDig);
1379 fraction = clu->GetCellAmplitudeFraction(iDig);
1381 if (fraction < 1e-4) fraction = 1.;
1383 geom->GetCellIndex(cellAbsId,iSupMod,iTower,iIphi,iIeta);
1384 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
1389 }
else if (iSupMod0!=iSupMod)
1398 eCell = cells->GetCellAmplitude(cellAbsId)*fraction*recalFactor;
1409 geom->GetCellIndex(absId,iSupMod,iTower,iIphi,iIeta);
1411 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
1427 if (eCell > 0 && eCluster > 0)
1429 if (
fW0 > 0 )
return TMath::Max( 0.,
fW0 + TMath::Log( eCell / eCluster ) ) ;
1430 else return TMath::Log( eCluster / eCell ) ;
1490 for (
Int_t i = 0; i < 15 ; i++)
1521 AliDebug(2,
"AliCalorimeterUtils::InitEMCALRecalibrationFactors()");
1524 Bool_t oldStatus = TH1::AddDirectoryStatus();
1525 TH1::AddDirectory(kFALSE);
1528 for (
int i = 0; i < 22; i++)
1530 Form(
"EMCALRecalFactors_SM%d",i), 48, 0, 48, 24, 0, 24));
1532 for (
Int_t sm = 0; sm < 22; sm++)
1534 for (
Int_t i = 0; i < 48; i++)
1536 for (
Int_t j = 0; j < 24; j++)
1547 TH1::AddDirectory(oldStatus);
1556 AliDebug(2,
"AliCalorimeterUtils::InitEMCALRecalibrationFactors()");
1559 Bool_t oldStatus = TH1::AddDirectoryStatus();
1560 TH1::AddDirectory(kFALSE);
1565 for (
int i = 0; i < 4; i++)
1567 Form(
"hAllTimeAvBC%d",i),
1568 48*24*22,0.,48*24*22) );
1570 for (
Int_t iBC = 0; iBC < 4; iBC++)
1572 for (
Int_t iCh = 0; iCh < 48*24*22; iCh++)
1577 for (
int iBC = 0; iBC < 4; iBC++) {
1579 Form(
"hAllTimeAvLGBC%d",iBC),
1580 48*24*22,0.,48*24*22) );
1581 for (
Int_t iCh = 0; iCh < 48*24*22; iCh++)
1592 TH1::AddDirectory(oldStatus);
1601 AliDebug(2,
"AliEMCALRecoUtils::InitEMCALBadChannelStatusMap()");
1604 Bool_t oldStatus = TH1::AddDirectoryStatus();
1605 TH1::AddDirectory(kFALSE);
1610 for (
int i = 0; i < 22; i++)
1611 fEMCALBadChannelMap->Add(
new TH2I(Form(
"EMCALBadChannelMap_Mod%d",i),Form(
"EMCALBadChannelMap_Mod%d",i), 48, 0, 48, 24, 0, 24));
1617 TH1::AddDirectory(oldStatus);
1626 AliDebug(2,
"AliEMCALRecoUtils::InitEMCALL1PhaseInTimeRecalibrationFactors()");
1629 Bool_t oldStatus = TH1::AddDirectoryStatus();
1630 TH1::AddDirectory(kFALSE);
1636 for (
Int_t i = 0; i < 22; i++)
1643 TH1::AddDirectory(oldStatus);
1657 AliVCluster * cluster,
1658 AliVCaloCells * cells,
1663 AliInfo(
"Cluster pointer null!");
1668 UShort_t * index = cluster->GetCellsAbsId() ;
1669 Double_t * fraction = cluster->GetCellsAmplitudeFraction() ;
1670 Int_t ncells = cluster->GetNCells();
1675 Int_t icol =-1, irow =-1, imod=1;
1677 Int_t absIdMax = -1;
1681 for (
Int_t icell = 0; icell < ncells; icell++)
1683 absId = index[icell];
1684 frac = fraction[icell];
1685 if (frac < 1e-5) frac = 1;
1690 Int_t iTower = -1, iIphi = -1, iIeta = -1;
1691 geom->GetCellIndex(absId,imod,iTower,iIphi,iIeta);
1694 geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,irow,icol);
1697 AliDebug(2,Form(
"AliEMCALRecoUtils::RecalibrateClusterEnergy - recalibrate cell: module %d, col %d, row %d, cell fraction %f,recalibration factor %f, cell energy %f\n",
1698 imod,icol,irow,frac,factor,cells->GetCellAmplitude(absId)));
1702 energy += cells->GetCellAmplitude(absId)*factor*frac;
1704 if (emax < cells->GetCellAmplitude(absId)*factor*frac)
1706 emax = cells->GetCellAmplitude(absId)*factor*frac;
1711 AliDebug(2,Form(
"AliEMCALRecoUtils::RecalibrateClusterEnergy - Energy before %f, after %f \n",cluster->E(),
energy));
1713 cluster->SetE(energy);
1716 Double_t timeorg = cluster->GetTOF();
1717 Bool_t isLowGain = !(cells->GetCellHighGain(absIdMax));
1719 Double_t time = cells->GetCellTime(absIdMax);
1728 cluster->SetTOF(time);
1730 AliDebug(2,Form(
"AliEMCALRecoUtils::RecalibrateClusterEnergy - Time before %f, after %f \n",timeorg,cluster->GetTOF()));
1748 AliInfo(
"Cells pointer null!");
1761 Int_t nEMcell = cells->GetNumberOfCells() ;
1762 for (
Int_t iCell = 0; iCell < nEMcell; iCell++)
1764 cells->GetCell( iCell, absId, ecellin, tcellin, mclabel, efrac );
1774 cells->SetCell(iCell,absId,ecell, tcell, mclabel, efrac);
1815 Int_t l1Phase=l1PhaseShift & 3;
1818 offsetPerSM = (bc - l1Phase)*25;
1820 offsetPerSM = (bc - l1Phase + 4)*25;
1822 Int_t l1shiftOffset=l1PhaseShift>>2;
1825 celltime -= offsetPerSM*1.e-9;
1826 celltime -= l1shiftOffset*1.e-9;
1859 for(
Int_t icluscell = 0; icluscell < clus->GetNCells(); icluscell++ )
1861 if(absID == clus->GetCellAbsId(icluscell))
1863 clus->GetCellMCEdepFractionArray(icluscell,eDepFrac);
1873 AliWarning(Form(
"Cell abs ID %d NOT found in cluster",absID));
1885 for(
UInt_t imc = 0; imc < 4; imc++)
1887 if ( eDepFrac[imc] > 0 && clus->GetNLabels() > imc )
1889 mc->GetCocktailGenerator(clus->GetLabelAt(imc),genName);
1899 amp-=ampOrg*eDepFrac[imc];
1901 edepTotFrac-=eDepFrac[imc];
1915 for(
UInt_t imc = 0; imc < 4; imc++)
1917 if ( eDepFrac[imc] > 0 && clus->GetNLabels() > imc && edepTotFrac > 0 )
1921 labeArr.Set(nLabels);
1922 labeArr.AddAt(clus->GetLabelAt(imc), nLabels-1);
1924 eDepArr.Set(nLabels);
1925 eDepArr.AddAt( (eDepFrac[imc]/edepTotFrac) * amp, nLabels-1);
1936 if ( nLabels == 0 ) amp = 0;
1949 AliVCaloCells* cells,
1954 AliInfo(
"Cluster pointer null!");
1960 else AliDebug(2,
"Algorithm to recalculate position not selected, do nothing.");
1973 AliVCaloCells* cells,
1981 Int_t iTower = -1, iIphi = -1, iIeta = -1;
1982 Int_t iSupModMax = -1, iSM=-1, iphi = -1, ieta = -1;
1983 Float_t weight = 0., totalWeight=0.;
1984 Float_t newPos[3] = {-1.,-1.,-1.};
1989 if (clEnergy <= 0)
return;
1996 for (
Int_t iDig=0; iDig< clu->GetNCells(); iDig++)
1998 absId = clu->GetCellAbsId(iDig);
1999 fraction = clu->GetCellAmplitudeFraction(iDig);
2000 if (fraction < 1e-4) fraction = 1.;
2004 geom->GetCellIndex(absId,iSM,iTower,iIphi,iIeta);
2005 geom->GetCellPhiEtaIndexInSModule(iSM,iTower,iIphi, iIeta,iphi,ieta);
2011 eCell = cells->GetCellAmplitude(absId)*fraction*recalFactor;
2014 totalWeight += weight;
2016 geom->RelPosCellInSModule(absId,depth,pLocal[0],pLocal[1],pLocal[2]);
2018 geom->GetGlobal(pLocal,pGlobal,iSupModMax);
2021 for (
int i=0; i<3; i++ ) newPos[i] += (weight*pGlobal[i]);
2026 for (
int i=0; i<3; i++ ) newPos[i] /= totalWeight;
2034 if (iSupModMax > 1) {
2047 clu->SetPosition(newPos);
2060 AliVCaloCells* cells,
2069 Int_t iIphi = -1, iIeta = -1;
2070 Int_t iSupMod = -1, iSupModMax = -1;
2071 Int_t iphi = -1, ieta =-1;
2081 Float_t weight = 0., weightedCol = 0., weightedRow = 0., totalWeight=0.;
2082 Bool_t areInSameSM = kTRUE;
2083 Int_t startingSM = -1;
2085 for (
Int_t iDig=0; iDig< clu->GetNCells(); iDig++)
2087 absId = clu->GetCellAbsId(iDig);
2088 fraction = clu->GetCellAmplitudeFraction(iDig);
2089 if (fraction < 1e-4) fraction = 1.;
2091 if (iDig==0) startingSM = iSupMod;
2092 else if (iSupMod != startingSM) areInSameSM = kFALSE;
2094 eCell = cells->GetCellAmplitude(absId);
2096 geom->GetCellIndex(absId,iSupMod,iTower,iIphi,iIeta);
2097 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
2106 eCell = cells->GetCellAmplitude(absId)*fraction*recalFactor;
2109 if (weight < 0) weight = 0;
2110 totalWeight += weight;
2111 weightedCol += ieta*weight;
2112 weightedRow += iphi*weight;
2117 Float_t xyzNew[]={-1.,-1.,-1.};
2118 if (areInSameSM == kTRUE)
2121 weightedCol = weightedCol/totalWeight;
2122 weightedRow = weightedRow/totalWeight;
2131 clu->SetPosition(xyzNew);
2143 AliVCaloCells* cells,
2144 AliVCluster * cluster)
2150 AliInfo(
"Cluster pointer null!");
2155 Int_t absIdMax = -1, iSupMod =-1, icolM = -1, irowM = -1;
2157 GetMaxEnergyCell(geom, cells, cluster, absIdMax, iSupMod, icolM, irowM, shared);
2165 for (
Int_t irow = 0; irow < AliEMCALGeoParams::fgkEMCALRows; irow++)
2167 for (
Int_t icol = 0; icol < AliEMCALGeoParams::fgkEMCALCols; icol++)
2170 if (hMap->GetBinContent(icol,irow)==0)
continue;
2174 dRrow=TMath::Abs(irowM-irow);
2175 dRcol=TMath::Abs(icolM-icol);
2176 dist=TMath::Sqrt(dRrow*dRrow+dRcol*dRcol);
2189 Int_t iSupMod2 = -1;
2192 if (iSupMod%2) iSupMod2 = iSupMod-1;
2193 else iSupMod2 = iSupMod+1;
2197 for (
Int_t irow = 0; irow < AliEMCALGeoParams::fgkEMCALRows; irow++)
2199 for (
Int_t icol = 0; icol < AliEMCALGeoParams::fgkEMCALCols; icol++)
2202 if (hMap2->GetBinContent(icol,irow)==0)
continue;
2206 dRrow=TMath::Abs(irow-irowM);
2209 dRcol=TMath::Abs(icol-(AliEMCALGeoParams::fgkEMCALCols+icolM));
2211 dRcol=TMath::Abs(AliEMCALGeoParams::fgkEMCALCols+icol-icolM);
2213 dist=TMath::Sqrt(dRrow*dRrow+dRcol*dRcol);
2214 if (dist < minDist) minDist = dist;
2219 AliDebug(2,Form(
"Max cluster cell (SM,col,row)=(%d %d %d) - Distance to Bad Channel %2.2f",iSupMod, icolM, irowM, minDist));
2220 cluster->SetDistanceToBadChannel(minDist);
2234 AliInfo(
"Cluster pointer null!");
2238 if (cluster->GetM02() != 0)
2239 fPIDUtils->ComputePID(cluster->E(),cluster->GetM02());
2241 Float_t pidlist[AliPID::kSPECIESCN+1];
2242 for (
Int_t i = 0; i < AliPID::kSPECIESCN+1; i++) pidlist[i] =
fPIDUtils->GetPIDFinal(i);
2244 cluster->SetPID(pidlist);
2269 AliVCaloCells* cells, AliVCluster * cluster,
2277 AliInfo(
"Cluster pointer null!");
2285 Bool_t isLowGain = kFALSE;
2313 disp = 0; dEta = 0; dPhi = 0;
2314 sEta = 0; sPhi = 0; sEtaPhi = 0;
2316 for (
Int_t iDigit=0; iDigit < cluster->GetNCells(); iDigit++)
2320 Int_t absId = cluster->GetCellAbsId(iDigit);
2322 geom->GetCellIndex(absId,iSupMod,iTower,iIphi,iIeta);
2323 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi,iIeta, iphi,ieta);
2326 if (iDigit == 0 ) iSM0 = iSupMod;
2327 else if (iSupMod!= iSM0) shared = kTRUE;
2330 fraction = cluster->GetCellAmplitudeFraction(iDigit);
2331 if (fraction < 1e-4) fraction = 1.;
2336 eCell = cells->GetCellAmplitude(absId)*fraction*recalFactor;
2337 tCell = cells->GetCellTime (absId);
2338 isLowGain = !(cells->GetCellHighGain(absId));
2347 if(eCell > cellEcut && TMath::Abs(tCell) < cellTimeCut)
2348 enAfterCuts += eCell;
2353 for (
Int_t iDigit=0; iDigit < cluster->GetNCells(); iDigit++)
2356 Int_t absId = cluster->GetCellAbsId(iDigit);
2358 geom->GetCellIndex(absId,iSupMod,iTower,iIphi,iIeta);
2359 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi,iIeta, iphi,ieta);
2362 fraction = cluster->GetCellAmplitudeFraction(iDigit);
2363 if (fraction < 1e-4) fraction = 1.;
2368 eCell = cells->GetCellAmplitude(absId)*fraction*recalFactor;
2369 tCell = cells->GetCellTime (absId);
2370 isLowGain = !(cells->GetCellHighGain(absId));
2378 if (shared && iSupMod%2) ieta+=AliEMCALGeoParams::fgkEMCALCols;
2380 if ( energy > 0 && eCell > cellEcut && TMath::Abs(tCell) < cellTimeCut )
2393 geom->EtaPhiFromIndex(absId, etai, phii);
2394 etai *= TMath::RadToDeg();
2395 phii *= TMath::RadToDeg();
2399 geom->GetGlobal(absId,pGlobal);
2411 phii = TMath::Sqrt(pGlobal[0]*pGlobal[0]+pGlobal[1]*pGlobal[1]);
2421 sEta += w * etai * etai ;
2422 etaMean += w * etai ;
2423 sPhi += w * phii * phii ;
2424 phiMean += w * phii ;
2425 sEtaPhi += w * etai * phii ;
2428 else if(eCell > 0.05)
2429 AliDebug(2,Form(
"Wrong energy in cell %f and/or cluster %f\n", eCell, cluster->E()));
2441 AliDebug(2,Form(
"Wrong weight %f\n", wtot));
2444 for (
Int_t iDigit=0; iDigit < cluster->GetNCells(); iDigit++)
2447 Int_t absId = cluster->GetCellAbsId(iDigit);
2449 geom->GetCellIndex(absId,iSupMod,iTower,iIphi,iIeta);
2450 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi,iIeta, iphi,ieta);
2453 fraction = cluster->GetCellAmplitudeFraction(iDigit);
2454 if (fraction < 1e-4) fraction = 1.;
2458 eCell = cells->GetCellAmplitude(absId)*fraction*recalFactor;
2459 tCell = cells->GetCellTime (absId);
2460 isLowGain = !(cells->GetCellHighGain(absId));
2468 if (shared && iSupMod%2) ieta+=AliEMCALGeoParams::fgkEMCALCols;
2470 if ( energy > 0 && eCell > cellEcut && TMath::Abs(tCell) < cellTimeCut )
2483 geom->EtaPhiFromIndex(absId, etai, phii);
2484 etai *= TMath::RadToDeg();
2485 phii *= TMath::RadToDeg();
2489 geom->GetGlobal(absId,pGlobal);
2501 phii = TMath::Sqrt(pGlobal[0]*pGlobal[0]+pGlobal[1]*pGlobal[1]);
2507 disp += w *((etai-etaMean)*(etai-etaMean)+(phii-phiMean)*(phii-phiMean));
2508 dEta += w * (etai-etaMean)*(etai-etaMean) ;
2509 dPhi += w * (phii-phiMean)*(phii-phiMean) ;
2513 AliDebug(2,Form(
"Wrong energy in cell %f and/or cluster %f\n", eCell, cluster->E()));
2517 if (wtot > 0 && nstat > 1)
2526 sEta -= etaMean * etaMean ;
2527 sPhi -= phiMean * phiMean ;
2528 sEtaPhi -= etaMean * phiMean ;
2530 l0 = (0.5 * (sEta + sPhi) + TMath::Sqrt( 0.25 * (sEta - sPhi) * (sEta - sPhi) + sEtaPhi * sEtaPhi ));
2531 l1 = (0.5 * (sEta + sPhi) - TMath::Sqrt( 0.25 * (sEta - sPhi) * (sEta - sPhi) + sEtaPhi * sEtaPhi ));
2540 dEta = 0. ; dPhi = 0. ; disp = 0. ;
2541 sEta = 0. ; sPhi = 0. ; sEtaPhi = 0. ;
2565 AliVCaloCells* cells, AliVCluster * cluster,
2572 Float_t cellTimeWindow = 1000;
2575 cellEmin, cellTimeWindow, bc,
2576 newEnergy, l0, l1, disp,
2577 dEta, dPhi, sEta, sPhi, sEtaPhi);
2590 AliVCaloCells* cells,
2591 AliVCluster * cluster)
2594 Float_t disp = 0., dEta = 0., dPhi = 0.;
2595 Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
2598 dEta, dPhi, sEta, sPhi, sEtaPhi);
2600 cluster->SetM02(l0);
2601 cluster->SetM20(l1);
2602 if (disp > 0. ) cluster->SetDispersion(TMath::Sqrt(disp)) ;
2620 AliVCaloCells* cells, AliVCluster * cluster,
2625 Float_t disp = 0., dEta = 0., dPhi = 0.;
2626 Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
2629 cellEcut, cellTimeCut, bc,
2630 enAfterCuts, l0, l1, disp,
2631 dEta, dPhi, sEta, sPhi, sEtaPhi);
2633 cluster->SetM02(l0);
2634 cluster->SetM20(l1);
2635 if (disp > 0. ) cluster->SetDispersion(TMath::Sqrt(disp)) ;
2655 const AliEMCALGeometry *geom,
2672 if (!TGeoGlobalMagField::Instance()->GetField())
2674 if (!event->InitMagneticField())
2676 AliInfo(
"Mag Field not initialized, null esd/aod evetn pointers");
2682 UInt_t mask1 = esdevent->GetESDRun()->GetDetectorsInDAQ();
2683 UInt_t mask2 = esdevent->GetESDRun()->GetDetectorsInReco();
2684 Bool_t desc1 = (mask1 >> 3) & 0x1;
2685 Bool_t desc2 = (mask2 >> 3) & 0x1;
2686 if (desc1==0 || desc2==0) {
2697 clusterArray =
new TObjArray(event->GetNumberOfCaloClusters());
2698 for (
Int_t icl=0; icl<
event->GetNumberOfCaloClusters(); icl++)
2700 AliVCluster *cluster = (AliVCluster*) event->GetCaloCluster(icl);
2701 if (!
IsGoodCluster(cluster,geom,(AliVCaloCells*)event->GetEMCALCells()))
2703 clusterArray->AddAt(cluster,icl);
2710 for (
Int_t i=0; i<21;i++) cv[i]=0;
2711 for (
Int_t itr=0; itr<
event->GetNumberOfTracks(); itr++)
2713 AliExternalTrackParam *trackParam = 0;
2716 AliESDtrack *esdTrack = 0;
2717 AliAODTrack *aodTrack = 0;
2720 esdTrack = esdevent->GetTrack(itr);
2721 if (!esdTrack)
continue;
2725 if ( TMath::Abs(esdTrack->Eta()) > 0.9 )
continue;
2728 if( geom->GetNumberOfSuperModules() < 13 )
2730 Double_t phi = esdTrack->Phi()*TMath::RadToDeg();
2731 if ( phi <= 10 || phi >= 250 )
continue;
2735 trackParam =
const_cast<AliExternalTrackParam*
>(esdTrack->GetInnerParam());
2737 trackParam =
new AliExternalTrackParam(*esdTrack);
2739 mcLabel = TMath::Abs(esdTrack->GetLabel());
2746 aodTrack =
dynamic_cast<AliAODTrack*
>(aodevent->GetTrack(itr));
2748 if (!aodTrack) AliFatal(
"Not a standard AOD");
2750 if (!aodTrack)
continue;
2755 if (!aodTrack->IsTPCConstrained())
continue ;
2760 if (!aodTrack->IsHybridGlobalConstrainedGlobal())
continue ;
2769 if ( TMath::Abs(aodTrack->Eta()) > 0.9 )
continue;
2772 if( geom->GetNumberOfSuperModules() < 13 )
2774 Double_t phi = aodTrack->Phi()*TMath::RadToDeg();
2775 if ( phi <= 10 || phi >= 250 )
continue;
2779 aodTrack->GetXYZ(pos);
2780 aodTrack->GetPxPyPz(mom);
2781 AliDebug(5,Form(
"aod track: i=%d | pos=(%5.4f,%5.4f,%5.4f) | mom=(%5.4f,%5.4f,%5.4f) | charge=%d\n",
2782 itr,pos[0],pos[1],pos[2],mom[0],mom[1],mom[2],aodTrack->Charge()));
2784 trackParam=
new AliExternalTrackParam(pos,mom,cv,aodTrack->Charge());
2786 mcLabel = TMath::Abs(aodTrack->GetLabel());
2792 AliWarning(
"Wrong input data type! Should be \"AOD\" or \"ESD\" ");
2795 clusterArray->Clear();
2796 delete clusterArray;
2801 if (!trackParam)
continue;
2809 mc->GetCocktailGenerator(mcLabel,genName);
2817 if ( !generOK )
continue;
2821 AliExternalTrackParam emcalParam(*trackParam);
2825 if (aodevent && trackParam)
delete trackParam;
2830 if ( TMath::Abs(eta) > 0.75 )
2832 if ( trackParam && (aodevent ||
fITSTrackSA) )
delete trackParam;
2837 if ( geom->GetNumberOfSuperModules() < 13 &&
2838 ( phi < 70*TMath::DegToRad() || phi > 190*TMath::DegToRad()))
2840 if ( trackParam && (aodevent ||
fITSTrackSA) )
delete trackParam;
2846 Float_t dEta = -999, dPhi = -999;
2862 if (aodevent && trackParam)
delete trackParam;
2868 clusterArray->Clear();
2869 delete clusterArray;
2872 AliDebug(2,Form(
"Number of matched pairs = %d !\n",matched));
2893 const AliVEvent *event,
2894 const AliEMCALGeometry *geom,
2899 if ( TMath::Abs(track->Eta()) > 0.9 )
return index;
2902 if( geom->GetNumberOfSuperModules() < 13 )
2904 Double_t phiV = track->Phi()*TMath::RadToDeg();
2905 if ( phiV <= 10 || phiV >= 250 )
return index;
2908 AliExternalTrackParam *trackParam = 0;
2910 trackParam =
const_cast<AliExternalTrackParam*
>(track->GetInnerParam());
2912 trackParam =
new AliExternalTrackParam(*track);
2914 if (!trackParam)
return index;
2915 AliExternalTrackParam emcalParam(*trackParam);
2924 if ( TMath::Abs(eta) > 0.75 )
2931 if ( geom->GetNumberOfSuperModules() < 13 &&
2932 ( phi < 70*TMath::DegToRad() || phi > 190*TMath::DegToRad()))
2940 for (
Int_t icl=0; icl<
event->GetNumberOfCaloClusters(); icl++)
2942 AliVCluster *cluster = (AliVCluster*) event->GetCaloCluster(icl);
2943 if (!
IsGoodCluster(cluster,geom,(AliVCaloCells*)event->GetEMCALCells()))
continue;
2944 clusterArr->AddAt(cluster,icl);
2948 clusterArr->Clear();
2967 AliExternalTrackParam *trkParam,
2971 dEta=-999, dPhi=-999;
2974 Float_t tmpEta=-999, tmpPhi=-999;
2977 if (!emcalParam->GetXYZ(exPos))
return index;
2979 Float_t clsPos[3] = {0.,0.,0.};
2980 for (
Int_t icl=0; icl<clusterArr->GetEntriesFast(); icl++)
2982 AliVCluster *cluster =
dynamic_cast<AliVCluster*
> (clusterArr->At(icl)) ;
2984 if (!cluster || !cluster->IsEMCAL())
continue;
2986 cluster->GetPosition(clsPos);
2988 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));
2991 AliExternalTrackParam trkPamTmp (*trkParam);
2993 if (!AliEMCALRecoUtilsBase::ExtrapolateTrackToCluster(&trkPamTmp, cluster,
fMass,
fStepCluster, tmpEta, tmpPhi))
continue;
2997 Float_t tmpR=TMath::Sqrt(tmpEta*tmpEta + tmpPhi*tmpPhi);
3008 if (TMath::Abs(tmpEta)<TMath::Abs(dEtaMax) && TMath::Abs(tmpPhi)<TMath::Abs(dPhiMax))
3017 AliError(
"Please specify your cut criteria");
3018 AliError(
"To cut on sqrt(dEta^2+dPhi^2), use: SwitchOnCutEtaPhiSum()");
3019 AliError(
"To cut on dEta and dPhi separately, use: SwitchOnCutEtaPhiSeparate()");
3044 const AliVCluster *cluster,
3048 return AliEMCALRecoUtilsBase::ExtrapolateTrackToCluster(trkParam, cluster,
fMass,
fStepCluster, tmpEta, tmpPhi);
3066 AliDebug(2,
"No matched tracks found!\n");
3090 AliDebug(2,
"No matched cluster found!\n");
3184 AliDebug(3,Form(
"Matched cluster index: index: %d, dEta: %2.4f, dPhi: %2.4f.\n",
3214 AliDebug(3,Form(
"Matched track index: index: %d, dEta: %2.4f, dPhi: %2.4f.\n",
3238 const AliEMCALGeometry *geom,
3239 AliVCaloCells* cells,
Int_t bc)
3243 if (!cluster || !cluster->IsEMCAL())
return kFALSE;
3264 UInt_t status = esdTrack->GetStatus();
3266 Int_t nClustersITS = esdTrack->GetITSclusters(0);
3267 Int_t nClustersTPC = esdTrack->GetTPCclusters(0);
3269 Float_t chi2PerClusterITS = -1;
3270 Float_t chi2PerClusterTPC = -1;
3271 if (nClustersITS!=0)
3272 chi2PerClusterITS = esdTrack->GetITSchi2()/
Float_t(nClustersITS);
3273 if (nClustersTPC!=0)
3274 chi2PerClusterTPC = esdTrack->GetTPCchi2()/
Float_t(nClustersTPC);
3282 Float_t maxDCAToVertexXYPtDep = 0.0182 + 0.0350/TMath::Power(esdTrack->Pt(),1.01);
3291 Float_t maxDCAToVertexXYPtDep = 0.0105 + 0.0350/TMath::Power(esdTrack->Pt(),1.1);
3301 esdTrack->GetImpactParameters(b,bCov);
3302 if (bCov[0]<=0 || bCov[2]<=0)
3304 AliDebug(1,
"Estimated b resolution lower or equal zero!");
3305 bCov[0]=0; bCov[2]=0;
3316 dcaToVertex = TMath::Sqrt(dcaToVertexXY*dcaToVertexXY + dcaToVertexZ*dcaToVertexZ);
3348 if ( (esdTrack->HasPointOnITSLayer(0) || esdTrack->HasPointOnITSLayer(1)) == kFALSE)
3355 if ((status & AliESDtrack::kITSin) == 0 || (status & AliESDtrack::kTPCin))
3365 if (status & AliESDtrack::kITSpureSA) cuts[11] = kTRUE;
3369 if (!(status & AliESDtrack::kITSpureSA)) cuts[11] = kTRUE;
3376 if (cuts[i]) { cut = kTRUE ; }
3397 AliInfo(Form(
"Track cuts for matching: AliESDtrackCuts::GetStandardTPCOnlyTrackCuts()"));
3415 AliInfo(Form(
"Track cuts for matching: AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE)"));
3433 AliInfo(Form(
"Track cuts for matching: Loose cut w/o DCA cut"));
3442 AliInfo(Form(
"Track cuts for matching: ITS Stand Alone tracks cut w/o DCA cut"));
3451 AliInfo(Form(
"Track cuts for matching: AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kTRUE)"));
3469 AliInfo(Form(
"Track cuts for matching: Loose cut w/o DCA cut plus ITSrefit"));
3487 Int_t nTracks =
event->GetNumberOfTracks();
3488 for (
Int_t iTrack = 0; iTrack < nTracks; ++iTrack)
3490 AliVTrack* track =
dynamic_cast<AliVTrack*
>(
event->GetTrack(iTrack));
3493 AliWarning(Form(
"Could not receive track %d", iTrack));
3498 track->SetEMCALcluster(matchClusIndex);
3501 AliESDtrack* esdtrack =
dynamic_cast<AliESDtrack*
>(track);
3504 if (matchClusIndex != -1)
3505 esdtrack->SetStatus(AliESDtrack::kEMCALmatch);
3507 esdtrack->ResetStatus(AliESDtrack::kEMCALmatch);
3511 AliAODTrack* aodtrack =
dynamic_cast<AliAODTrack*
>(track);
3512 if (matchClusIndex != -1)
3513 aodtrack->SetStatus(AliESDtrack::kEMCALmatch);
3515 aodtrack->ResetStatus(AliESDtrack::kEMCALmatch);
3518 AliDebug(2,
"Track matched to closest cluster");
3530 for (
Int_t iClus=0; iClus <
event->GetNumberOfCaloClusters(); ++iClus)
3532 AliVCluster *cluster =
event->GetCaloCluster(iClus);
3533 if (!cluster->IsEMCAL())
3539 if(cluster->GetNTracksMatched() > 0)
3541 if(!strcmp(
"AliESDCaloCluster",Form(
"%s",cluster->ClassName())))
3544 ((AliESDCaloCluster*)cluster)->AddTracksMatched(arrayTrackMatched);
3548 for(
Int_t iTrack = 0; iTrack < cluster->GetNTracksMatched(); iTrack++)
3550 ((AliAODCaloCluster*)cluster)->RemoveTrackMatched((
TObject*)((AliAODCaloCluster*)cluster)->GetTrackMatched(iTrack));
3558 Int_t nTracks =
event->GetNumberOfTracks();
3559 TArrayI arrayTrackMatched(nTracks);
3564 if (matchTrackIndex != -1)
3566 arrayTrackMatched[nMatched] = matchTrackIndex;
3571 for (
Int_t iTrk=0; iTrk<nTracks; ++iTrk)
3573 AliVTrack* track =
dynamic_cast<AliVTrack*
>(
event->GetTrack(iTrk));
3575 if( !track )
continue;
3577 if ( iTrk == matchTrackIndex )
continue;
3579 if ( track->GetEMCALcluster() == iClus )
3581 arrayTrackMatched[nMatched] = iTrk;
3586 AliDebug(2,Form(
"cluster E %f, N matches %d, first match %d\n",cluster->E(),nMatched,arrayTrackMatched[0]));
3588 arrayTrackMatched.Set(nMatched);
3589 AliESDCaloCluster *esdcluster =
dynamic_cast<AliESDCaloCluster*
>(cluster);
3591 esdcluster->AddTracksMatched(arrayTrackMatched);
3592 else if ( nMatched > 0 )
3594 AliAODCaloCluster *aodcluster =
dynamic_cast<AliAODCaloCluster*
>(cluster);
3597 aodcluster->AddTrackMatched(event->GetTrack(arrayTrackMatched.At(0)));
3604 Float_t eta= -999, phi = -999;
3605 if (matchTrackIndex != -1)
3608 cluster->SetTrackDistance(phi, eta);
3611 AliDebug(2,
"Cluster matched to tracks");
3624 for(
int i = 0; i < map->GetEntries(); i++){
3625 TH2F *hist =
dynamic_cast<TH2F *
>(map->At(i));
3639 clone->SetDirectory(NULL);
3653 for(
int i = 0; i < map->GetEntries(); i++){
3654 TH2I *hist =
dynamic_cast<TH2I *
>(map->At(i));
3667 TH2I *clone =
new TH2I(*h);
3668 clone->SetDirectory(NULL);
3682 for(
int i = 0; i < map->GetEntries(); i++){
3683 TH1F *hist =
dynamic_cast<TH1F *
>(map->At(i));
3696 TH1F *clone =
new TH1F(*h);
3697 clone->SetDirectory(NULL);
3711 for(
int i = 0; i < map->GetEntries(); i++) {
3712 TH1C *hist =
dynamic_cast<TH1C *
>(map->At(i));
3724 TH1C *clone =
new TH1C(*h);
3725 clone->SetDirectory(NULL);
3735 printf(
"-------------------------------------------------------------------------------------------------------------------------------------- \n");
3736 printf(
"AliEMCALRecoUtils Settings: \n");
3737 printf(
"\tMisalignment shifts\n");
3738 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,
3747 printf(
"\tMatching criteria: ");
3749 printf(
"\t\tsqrt(dEta^2+dPhi^2)<%4.3f\n",
fCutR);
3753 printf(
"\t\tError\n");
3754 printf(
"\t\tplease specify your cut criteria\n");
3755 printf(
"\t\tTo cut on sqrt(dEta^2+dPhi^2), use: SwitchOnCutEtaPhiSum()\n");
3756 printf(
"\t\tTo cut on dEta and dPhi separately, use: SwitchOnCutEtaPhiSeparate()\n");
3759 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);
3760 printf(
"\tCluster selection window: dR < %2.0f\n",
fClusterWindow);
3762 printf(
"\tTrack cuts: \n");
3770 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)
Bool_t GetEMCALChannelStatus(Int_t iSM, Int_t iCol, Int_t iRow, Int_t &status) const
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.
void SetEMCALBadChannelStatusSelection(Bool_t all, Bool_t dead, Bool_t hot, Bool_t warm)
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.
Bool_t fBadStatusSelection[4]
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)