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));
1039 AliDebug(2,
"No correction on the energy\n");
1261 if ( status == AliCaloCalibPedestal::kAlive )
1274 status == AliCaloCalibPedestal::kDead )
1277 status == AliCaloCalibPedestal::kHot )
1280 status == AliCaloCalibPedestal::kWarning )
1285 AliWarning(Form(
"Careful, bad channel selection not properly done: ism %d, icol %d, irow %d, status %d,\n" 1286 " fBadAll %d, fBadHot %d, fBadWarm %d, fBadDead %d",
1287 iSM, iCol, iRow, status,
1309 AliVCaloCells* cells,
1310 const AliVCluster* clu,
1321 Int_t cellAbsId = -1 ;
1330 AliInfo(
"Cluster pointer null!");
1331 absId=-1; iSupMod0=-1, ieta = -1; iphi = -1; shared = -1;
1335 for (
Int_t iDig=0; iDig< clu->GetNCells(); iDig++)
1337 cellAbsId = clu->GetCellAbsId(iDig);
1338 fraction = clu->GetCellAmplitudeFraction(iDig);
1340 if (fraction < 1e-4) fraction = 1.;
1342 geom->GetCellIndex(cellAbsId,iSupMod,iTower,iIphi,iIeta);
1343 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
1348 }
else if (iSupMod0!=iSupMod)
1357 eCell = cells->GetCellAmplitude(cellAbsId)*fraction*recalFactor;
1368 geom->GetCellIndex(absId,iSupMod,iTower,iIphi,iIeta);
1370 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
1386 if (eCell > 0 && eCluster > 0)
1388 if (
fW0 > 0 )
return TMath::Max( 0.,
fW0 + TMath::Log( eCell / eCluster ) ) ;
1389 else return TMath::Log( eCluster / eCell ) ;
1449 for (
Int_t i = 0; i < 15 ; i++)
1480 AliDebug(2,
"AliCalorimeterUtils::InitEMCALRecalibrationFactors()");
1483 Bool_t oldStatus = TH1::AddDirectoryStatus();
1484 TH1::AddDirectory(kFALSE);
1487 for (
int i = 0; i < 22; i++)
1489 Form(
"EMCALRecalFactors_SM%d",i), 48, 0, 48, 24, 0, 24));
1491 for (
Int_t sm = 0; sm < 22; sm++)
1493 for (
Int_t i = 0; i < 48; i++)
1495 for (
Int_t j = 0; j < 24; j++)
1506 TH1::AddDirectory(oldStatus);
1515 AliDebug(2,
"AliCalorimeterUtils::InitEMCALRecalibrationFactors()");
1518 Bool_t oldStatus = TH1::AddDirectoryStatus();
1519 TH1::AddDirectory(kFALSE);
1524 for (
int i = 0; i < 4; i++)
1526 Form(
"hAllTimeAvBC%d",i),
1527 48*24*22,0.,48*24*22) );
1529 for (
Int_t iBC = 0; iBC < 4; iBC++)
1531 for (
Int_t iCh = 0; iCh < 48*24*22; iCh++)
1536 for (
int iBC = 0; iBC < 4; iBC++) {
1538 Form(
"hAllTimeAvLGBC%d",iBC),
1539 48*24*22,0.,48*24*22) );
1540 for (
Int_t iCh = 0; iCh < 48*24*22; iCh++)
1551 TH1::AddDirectory(oldStatus);
1560 AliDebug(2,
"AliEMCALRecoUtils::InitEMCALBadChannelStatusMap()");
1563 Bool_t oldStatus = TH1::AddDirectoryStatus();
1564 TH1::AddDirectory(kFALSE);
1569 for (
int i = 0; i < 22; i++)
1570 fEMCALBadChannelMap->Add(
new TH2I(Form(
"EMCALBadChannelMap_Mod%d",i),Form(
"EMCALBadChannelMap_Mod%d",i), 48, 0, 48, 24, 0, 24));
1576 TH1::AddDirectory(oldStatus);
1585 AliDebug(2,
"AliEMCALRecoUtils::InitEMCALL1PhaseInTimeRecalibrationFactors()");
1588 Bool_t oldStatus = TH1::AddDirectoryStatus();
1589 TH1::AddDirectory(kFALSE);
1595 for (
Int_t i = 0; i < 22; i++)
1602 TH1::AddDirectory(oldStatus);
1616 AliVCluster * cluster,
1617 AliVCaloCells * cells,
1622 AliInfo(
"Cluster pointer null!");
1627 UShort_t * index = cluster->GetCellsAbsId() ;
1628 Double_t * fraction = cluster->GetCellsAmplitudeFraction() ;
1629 Int_t ncells = cluster->GetNCells();
1634 Int_t icol =-1, irow =-1, imod=1;
1636 Int_t absIdMax = -1;
1640 for (
Int_t icell = 0; icell < ncells; icell++)
1642 absId = index[icell];
1643 frac = fraction[icell];
1644 if (frac < 1e-5) frac = 1;
1649 Int_t iTower = -1, iIphi = -1, iIeta = -1;
1650 geom->GetCellIndex(absId,imod,iTower,iIphi,iIeta);
1653 geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,irow,icol);
1656 AliDebug(2,Form(
"AliEMCALRecoUtils::RecalibrateClusterEnergy - recalibrate cell: module %d, col %d, row %d, cell fraction %f,recalibration factor %f, cell energy %f\n",
1657 imod,icol,irow,frac,factor,cells->GetCellAmplitude(absId)));
1661 energy += cells->GetCellAmplitude(absId)*factor*frac;
1663 if (emax < cells->GetCellAmplitude(absId)*factor*frac)
1665 emax = cells->GetCellAmplitude(absId)*factor*frac;
1670 AliDebug(2,Form(
"AliEMCALRecoUtils::RecalibrateClusterEnergy - Energy before %f, after %f \n",cluster->E(),
energy));
1672 cluster->SetE(energy);
1675 Double_t timeorg = cluster->GetTOF();
1676 Bool_t isLowGain = !(cells->GetCellHighGain(absIdMax));
1678 Double_t time = cells->GetCellTime(absIdMax);
1687 cluster->SetTOF(time);
1689 AliDebug(2,Form(
"AliEMCALRecoUtils::RecalibrateClusterEnergy - Time before %f, after %f \n",timeorg,cluster->GetTOF()));
1707 AliInfo(
"Cells pointer null!");
1720 Int_t nEMcell = cells->GetNumberOfCells() ;
1721 for (
Int_t iCell = 0; iCell < nEMcell; iCell++)
1723 cells->GetCell( iCell, absId, ecellin, tcellin, mclabel, efrac );
1733 cells->SetCell(iCell,absId,ecell, tcell, mclabel, efrac);
1774 Int_t l1Phase=l1PhaseShift & 3;
1777 offsetPerSM = (bc - l1Phase)*25;
1779 offsetPerSM = (bc - l1Phase + 4)*25;
1781 Int_t l1shiftOffset=l1PhaseShift>>2;
1784 celltime -= offsetPerSM*1.e-9;
1785 celltime -= l1shiftOffset*1.e-9;
1818 for(
Int_t icluscell = 0; icluscell < clus->GetNCells(); icluscell++ )
1820 if(absID == clus->GetCellAbsId(icluscell))
1822 clus->GetCellMCEdepFractionArray(icluscell,eDepFrac);
1832 AliWarning(Form(
"Cell abs ID %d NOT found in cluster",absID));
1844 for(
UInt_t imc = 0; imc < 4; imc++)
1846 if ( eDepFrac[imc] > 0 && clus->GetNLabels() > imc )
1848 mc->GetCocktailGenerator(clus->GetLabelAt(imc),genName);
1858 amp-=ampOrg*eDepFrac[imc];
1860 edepTotFrac-=eDepFrac[imc];
1874 for(
UInt_t imc = 0; imc < 4; imc++)
1876 if ( eDepFrac[imc] > 0 && clus->GetNLabels() > imc && edepTotFrac > 0 )
1880 labeArr.Set(nLabels);
1881 labeArr.AddAt(clus->GetLabelAt(imc), nLabels-1);
1883 eDepArr.Set(nLabels);
1884 eDepArr.AddAt( (eDepFrac[imc]/edepTotFrac) * amp, nLabels-1);
1895 if ( nLabels == 0 ) amp = 0;
1908 AliVCaloCells* cells,
1913 AliInfo(
"Cluster pointer null!");
1919 else AliDebug(2,
"Algorithm to recalculate position not selected, do nothing.");
1932 AliVCaloCells* cells,
1940 Int_t iTower = -1, iIphi = -1, iIeta = -1;
1941 Int_t iSupModMax = -1, iSM=-1, iphi = -1, ieta = -1;
1942 Float_t weight = 0., totalWeight=0.;
1943 Float_t newPos[3] = {-1.,-1.,-1.};
1948 if (clEnergy <= 0)
return;
1955 for (
Int_t iDig=0; iDig< clu->GetNCells(); iDig++)
1957 absId = clu->GetCellAbsId(iDig);
1958 fraction = clu->GetCellAmplitudeFraction(iDig);
1959 if (fraction < 1e-4) fraction = 1.;
1963 geom->GetCellIndex(absId,iSM,iTower,iIphi,iIeta);
1964 geom->GetCellPhiEtaIndexInSModule(iSM,iTower,iIphi, iIeta,iphi,ieta);
1970 eCell = cells->GetCellAmplitude(absId)*fraction*recalFactor;
1973 totalWeight += weight;
1975 geom->RelPosCellInSModule(absId,depth,pLocal[0],pLocal[1],pLocal[2]);
1977 geom->GetGlobal(pLocal,pGlobal,iSupModMax);
1980 for (
int i=0; i<3; i++ ) newPos[i] += (weight*pGlobal[i]);
1985 for (
int i=0; i<3; i++ ) newPos[i] /= totalWeight;
1993 if (iSupModMax > 1) {
2006 clu->SetPosition(newPos);
2019 AliVCaloCells* cells,
2028 Int_t iIphi = -1, iIeta = -1;
2029 Int_t iSupMod = -1, iSupModMax = -1;
2030 Int_t iphi = -1, ieta =-1;
2040 Float_t weight = 0., weightedCol = 0., weightedRow = 0., totalWeight=0.;
2041 Bool_t areInSameSM = kTRUE;
2042 Int_t startingSM = -1;
2044 for (
Int_t iDig=0; iDig< clu->GetNCells(); iDig++)
2046 absId = clu->GetCellAbsId(iDig);
2047 fraction = clu->GetCellAmplitudeFraction(iDig);
2048 if (fraction < 1e-4) fraction = 1.;
2050 if (iDig==0) startingSM = iSupMod;
2051 else if (iSupMod != startingSM) areInSameSM = kFALSE;
2053 eCell = cells->GetCellAmplitude(absId);
2055 geom->GetCellIndex(absId,iSupMod,iTower,iIphi,iIeta);
2056 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
2065 eCell = cells->GetCellAmplitude(absId)*fraction*recalFactor;
2068 if (weight < 0) weight = 0;
2069 totalWeight += weight;
2070 weightedCol += ieta*weight;
2071 weightedRow += iphi*weight;
2076 Float_t xyzNew[]={-1.,-1.,-1.};
2077 if (areInSameSM == kTRUE)
2080 weightedCol = weightedCol/totalWeight;
2081 weightedRow = weightedRow/totalWeight;
2090 clu->SetPosition(xyzNew);
2102 AliVCaloCells* cells,
2103 AliVCluster * cluster)
2109 AliInfo(
"Cluster pointer null!");
2114 Int_t absIdMax = -1, iSupMod =-1, icolM = -1, irowM = -1;
2116 GetMaxEnergyCell(geom, cells, cluster, absIdMax, iSupMod, icolM, irowM, shared);
2124 for (
Int_t irow = 0; irow < AliEMCALGeoParams::fgkEMCALRows; irow++)
2126 for (
Int_t icol = 0; icol < AliEMCALGeoParams::fgkEMCALCols; icol++)
2129 if (hMap->GetBinContent(icol,irow)==0)
continue;
2133 dRrow=TMath::Abs(irowM-irow);
2134 dRcol=TMath::Abs(icolM-icol);
2135 dist=TMath::Sqrt(dRrow*dRrow+dRcol*dRcol);
2148 Int_t iSupMod2 = -1;
2151 if (iSupMod%2) iSupMod2 = iSupMod-1;
2152 else iSupMod2 = iSupMod+1;
2156 for (
Int_t irow = 0; irow < AliEMCALGeoParams::fgkEMCALRows; irow++)
2158 for (
Int_t icol = 0; icol < AliEMCALGeoParams::fgkEMCALCols; icol++)
2161 if (hMap2->GetBinContent(icol,irow)==0)
continue;
2165 dRrow=TMath::Abs(irow-irowM);
2168 dRcol=TMath::Abs(icol-(AliEMCALGeoParams::fgkEMCALCols+icolM));
2170 dRcol=TMath::Abs(AliEMCALGeoParams::fgkEMCALCols+icol-icolM);
2172 dist=TMath::Sqrt(dRrow*dRrow+dRcol*dRcol);
2173 if (dist < minDist) minDist = dist;
2178 AliDebug(2,Form(
"Max cluster cell (SM,col,row)=(%d %d %d) - Distance to Bad Channel %2.2f",iSupMod, icolM, irowM, minDist));
2179 cluster->SetDistanceToBadChannel(minDist);
2193 AliInfo(
"Cluster pointer null!");
2197 if (cluster->GetM02() != 0)
2198 fPIDUtils->ComputePID(cluster->E(),cluster->GetM02());
2200 Float_t pidlist[AliPID::kSPECIESCN+1];
2201 for (
Int_t i = 0; i < AliPID::kSPECIESCN+1; i++) pidlist[i] =
fPIDUtils->GetPIDFinal(i);
2203 cluster->SetPID(pidlist);
2228 AliVCaloCells* cells, AliVCluster * cluster,
2236 AliInfo(
"Cluster pointer null!");
2244 Bool_t isLowGain = kFALSE;
2272 disp = 0; dEta = 0; dPhi = 0;
2273 sEta = 0; sPhi = 0; sEtaPhi = 0;
2275 for (
Int_t iDigit=0; iDigit < cluster->GetNCells(); iDigit++)
2279 Int_t absId = cluster->GetCellAbsId(iDigit);
2281 geom->GetCellIndex(absId,iSupMod,iTower,iIphi,iIeta);
2282 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi,iIeta, iphi,ieta);
2285 if (iDigit == 0 ) iSM0 = iSupMod;
2286 else if (iSupMod!= iSM0) shared = kTRUE;
2289 fraction = cluster->GetCellAmplitudeFraction(iDigit);
2290 if (fraction < 1e-4) fraction = 1.;
2295 eCell = cells->GetCellAmplitude(absId)*fraction*recalFactor;
2296 tCell = cells->GetCellTime (absId);
2297 isLowGain = !(cells->GetCellHighGain(absId));
2306 if(eCell > cellEcut && TMath::Abs(tCell) < cellTimeCut)
2307 enAfterCuts += eCell;
2312 for (
Int_t iDigit=0; iDigit < cluster->GetNCells(); iDigit++)
2315 Int_t absId = cluster->GetCellAbsId(iDigit);
2317 geom->GetCellIndex(absId,iSupMod,iTower,iIphi,iIeta);
2318 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi,iIeta, iphi,ieta);
2321 fraction = cluster->GetCellAmplitudeFraction(iDigit);
2322 if (fraction < 1e-4) fraction = 1.;
2327 eCell = cells->GetCellAmplitude(absId)*fraction*recalFactor;
2328 tCell = cells->GetCellTime (absId);
2329 isLowGain = !(cells->GetCellHighGain(absId));
2337 if (shared && iSupMod%2) ieta+=AliEMCALGeoParams::fgkEMCALCols;
2339 if ( energy > 0 && eCell > cellEcut && TMath::Abs(tCell) < cellTimeCut )
2352 geom->EtaPhiFromIndex(absId, etai, phii);
2353 etai *= TMath::RadToDeg();
2354 phii *= TMath::RadToDeg();
2358 geom->GetGlobal(absId,pGlobal);
2370 phii = TMath::Sqrt(pGlobal[0]*pGlobal[0]+pGlobal[1]*pGlobal[1]);
2380 sEta += w * etai * etai ;
2381 etaMean += w * etai ;
2382 sPhi += w * phii * phii ;
2383 phiMean += w * phii ;
2384 sEtaPhi += w * etai * phii ;
2387 else if(eCell > 0.05)
2388 AliDebug(2,Form(
"Wrong energy in cell %f and/or cluster %f\n", eCell, cluster->E()));
2400 AliDebug(2,Form(
"Wrong weight %f\n", wtot));
2403 for (
Int_t iDigit=0; iDigit < cluster->GetNCells(); iDigit++)
2406 Int_t absId = cluster->GetCellAbsId(iDigit);
2408 geom->GetCellIndex(absId,iSupMod,iTower,iIphi,iIeta);
2409 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi,iIeta, iphi,ieta);
2412 fraction = cluster->GetCellAmplitudeFraction(iDigit);
2413 if (fraction < 1e-4) fraction = 1.;
2417 eCell = cells->GetCellAmplitude(absId)*fraction*recalFactor;
2418 tCell = cells->GetCellTime (absId);
2419 isLowGain = !(cells->GetCellHighGain(absId));
2427 if (shared && iSupMod%2) ieta+=AliEMCALGeoParams::fgkEMCALCols;
2429 if ( energy > 0 && eCell > cellEcut && TMath::Abs(tCell) < cellTimeCut )
2442 geom->EtaPhiFromIndex(absId, etai, phii);
2443 etai *= TMath::RadToDeg();
2444 phii *= TMath::RadToDeg();
2448 geom->GetGlobal(absId,pGlobal);
2460 phii = TMath::Sqrt(pGlobal[0]*pGlobal[0]+pGlobal[1]*pGlobal[1]);
2466 disp += w *((etai-etaMean)*(etai-etaMean)+(phii-phiMean)*(phii-phiMean));
2467 dEta += w * (etai-etaMean)*(etai-etaMean) ;
2468 dPhi += w * (phii-phiMean)*(phii-phiMean) ;
2472 AliDebug(2,Form(
"Wrong energy in cell %f and/or cluster %f\n", eCell, cluster->E()));
2476 if (wtot > 0 && nstat > 1)
2485 sEta -= etaMean * etaMean ;
2486 sPhi -= phiMean * phiMean ;
2487 sEtaPhi -= etaMean * phiMean ;
2489 l0 = (0.5 * (sEta + sPhi) + TMath::Sqrt( 0.25 * (sEta - sPhi) * (sEta - sPhi) + sEtaPhi * sEtaPhi ));
2490 l1 = (0.5 * (sEta + sPhi) - TMath::Sqrt( 0.25 * (sEta - sPhi) * (sEta - sPhi) + sEtaPhi * sEtaPhi ));
2499 dEta = 0. ; dPhi = 0. ; disp = 0. ;
2500 sEta = 0. ; sPhi = 0. ; sEtaPhi = 0. ;
2524 AliVCaloCells* cells, AliVCluster * cluster,
2531 Float_t cellTimeWindow = 1000;
2534 cellEmin, cellTimeWindow, bc,
2535 newEnergy, l0, l1, disp,
2536 dEta, dPhi, sEta, sPhi, sEtaPhi);
2549 AliVCaloCells* cells,
2550 AliVCluster * cluster)
2553 Float_t disp = 0., dEta = 0., dPhi = 0.;
2554 Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
2557 dEta, dPhi, sEta, sPhi, sEtaPhi);
2559 cluster->SetM02(l0);
2560 cluster->SetM20(l1);
2561 if (disp > 0. ) cluster->SetDispersion(TMath::Sqrt(disp)) ;
2579 AliVCaloCells* cells, AliVCluster * cluster,
2584 Float_t disp = 0., dEta = 0., dPhi = 0.;
2585 Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
2588 cellEcut, cellTimeCut, bc,
2589 enAfterCuts, l0, l1, disp,
2590 dEta, dPhi, sEta, sPhi, sEtaPhi);
2592 cluster->SetM02(l0);
2593 cluster->SetM20(l1);
2594 if (disp > 0. ) cluster->SetDispersion(TMath::Sqrt(disp)) ;
2614 const AliEMCALGeometry *geom,
2631 if (!TGeoGlobalMagField::Instance()->GetField())
2633 if (!event->InitMagneticField())
2635 AliInfo(
"Mag Field not initialized, null esd/aod evetn pointers");
2641 UInt_t mask1 = esdevent->GetESDRun()->GetDetectorsInDAQ();
2642 UInt_t mask2 = esdevent->GetESDRun()->GetDetectorsInReco();
2643 Bool_t desc1 = (mask1 >> 3) & 0x1;
2644 Bool_t desc2 = (mask2 >> 3) & 0x1;
2645 if (desc1==0 || desc2==0) {
2656 clusterArray =
new TObjArray(event->GetNumberOfCaloClusters());
2657 for (
Int_t icl=0; icl<
event->GetNumberOfCaloClusters(); icl++)
2659 AliVCluster *cluster = (AliVCluster*) event->GetCaloCluster(icl);
2660 if (!
IsGoodCluster(cluster,geom,(AliVCaloCells*)event->GetEMCALCells()))
2662 clusterArray->AddAt(cluster,icl);
2669 for (
Int_t i=0; i<21;i++) cv[i]=0;
2670 for (
Int_t itr=0; itr<
event->GetNumberOfTracks(); itr++)
2672 AliExternalTrackParam *trackParam = 0;
2675 AliESDtrack *esdTrack = 0;
2676 AliAODTrack *aodTrack = 0;
2679 esdTrack = esdevent->GetTrack(itr);
2680 if (!esdTrack)
continue;
2684 if ( TMath::Abs(esdTrack->Eta()) > 0.9 )
continue;
2687 if( geom->GetNumberOfSuperModules() < 13 )
2689 Double_t phi = esdTrack->Phi()*TMath::RadToDeg();
2690 if ( phi <= 10 || phi >= 250 )
continue;
2694 trackParam =
const_cast<AliExternalTrackParam*
>(esdTrack->GetInnerParam());
2696 trackParam =
new AliExternalTrackParam(*esdTrack);
2698 mcLabel = TMath::Abs(esdTrack->GetLabel());
2705 aodTrack =
dynamic_cast<AliAODTrack*
>(aodevent->GetTrack(itr));
2707 if (!aodTrack) AliFatal(
"Not a standard AOD");
2709 if (!aodTrack)
continue;
2714 if (!aodTrack->IsTPCConstrained())
continue ;
2719 if (!aodTrack->IsHybridGlobalConstrainedGlobal())
continue ;
2728 if ( TMath::Abs(aodTrack->Eta()) > 0.9 )
continue;
2731 if( geom->GetNumberOfSuperModules() < 13 )
2733 Double_t phi = aodTrack->Phi()*TMath::RadToDeg();
2734 if ( phi <= 10 || phi >= 250 )
continue;
2738 aodTrack->GetXYZ(pos);
2739 aodTrack->GetPxPyPz(mom);
2740 AliDebug(5,Form(
"aod track: i=%d | pos=(%5.4f,%5.4f,%5.4f) | mom=(%5.4f,%5.4f,%5.4f) | charge=%d\n",
2741 itr,pos[0],pos[1],pos[2],mom[0],mom[1],mom[2],aodTrack->Charge()));
2743 trackParam=
new AliExternalTrackParam(pos,mom,cv,aodTrack->Charge());
2745 mcLabel = TMath::Abs(aodTrack->GetLabel());
2751 AliWarning(
"Wrong input data type! Should be \"AOD\" or \"ESD\" ");
2754 clusterArray->Clear();
2755 delete clusterArray;
2760 if (!trackParam)
continue;
2768 mc->GetCocktailGenerator(mcLabel,genName);
2776 if ( !generOK )
continue;
2780 AliExternalTrackParam emcalParam(*trackParam);
2784 if (aodevent && trackParam)
delete trackParam;
2789 if ( TMath::Abs(eta) > 0.75 )
2791 if ( trackParam && (aodevent ||
fITSTrackSA) )
delete trackParam;
2796 if ( geom->GetNumberOfSuperModules() < 13 &&
2797 ( phi < 70*TMath::DegToRad() || phi > 190*TMath::DegToRad()))
2799 if ( trackParam && (aodevent ||
fITSTrackSA) )
delete trackParam;
2805 Float_t dEta = -999, dPhi = -999;
2821 if (aodevent && trackParam)
delete trackParam;
2827 clusterArray->Clear();
2828 delete clusterArray;
2831 AliDebug(2,Form(
"Number of matched pairs = %d !\n",matched));
2852 const AliVEvent *event,
2853 const AliEMCALGeometry *geom,
2858 if ( TMath::Abs(track->Eta()) > 0.9 )
return index;
2861 if( geom->GetNumberOfSuperModules() < 13 )
2863 Double_t phiV = track->Phi()*TMath::RadToDeg();
2864 if ( phiV <= 10 || phiV >= 250 )
return index;
2867 AliExternalTrackParam *trackParam = 0;
2869 trackParam =
const_cast<AliExternalTrackParam*
>(track->GetInnerParam());
2871 trackParam =
new AliExternalTrackParam(*track);
2873 if (!trackParam)
return index;
2874 AliExternalTrackParam emcalParam(*trackParam);
2883 if ( TMath::Abs(eta) > 0.75 )
2890 if ( geom->GetNumberOfSuperModules() < 13 &&
2891 ( phi < 70*TMath::DegToRad() || phi > 190*TMath::DegToRad()))
2899 for (
Int_t icl=0; icl<
event->GetNumberOfCaloClusters(); icl++)
2901 AliVCluster *cluster = (AliVCluster*) event->GetCaloCluster(icl);
2902 if (!
IsGoodCluster(cluster,geom,(AliVCaloCells*)event->GetEMCALCells()))
continue;
2903 clusterArr->AddAt(cluster,icl);
2907 clusterArr->Clear();
2926 AliExternalTrackParam *trkParam,
2930 dEta=-999, dPhi=-999;
2933 Float_t tmpEta=-999, tmpPhi=-999;
2936 if (!emcalParam->GetXYZ(exPos))
return index;
2938 Float_t clsPos[3] = {0.,0.,0.};
2939 for (
Int_t icl=0; icl<clusterArr->GetEntriesFast(); icl++)
2941 AliVCluster *cluster =
dynamic_cast<AliVCluster*
> (clusterArr->At(icl)) ;
2943 if (!cluster || !cluster->IsEMCAL())
continue;
2945 cluster->GetPosition(clsPos);
2947 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));
2950 AliExternalTrackParam trkPamTmp (*trkParam);
2952 if (!AliEMCALRecoUtilsBase::ExtrapolateTrackToCluster(&trkPamTmp, cluster,
fMass,
fStepCluster, tmpEta, tmpPhi))
continue;
2956 Float_t tmpR=TMath::Sqrt(tmpEta*tmpEta + tmpPhi*tmpPhi);
2967 if (TMath::Abs(tmpEta)<TMath::Abs(dEtaMax) && TMath::Abs(tmpPhi)<TMath::Abs(dPhiMax))
2976 AliError(
"Please specify your cut criteria");
2977 AliError(
"To cut on sqrt(dEta^2+dPhi^2), use: SwitchOnCutEtaPhiSum()");
2978 AliError(
"To cut on dEta and dPhi separately, use: SwitchOnCutEtaPhiSeparate()");
3003 const AliVCluster *cluster,
3007 return AliEMCALRecoUtilsBase::ExtrapolateTrackToCluster(trkParam, cluster,
fMass,
fStepCluster, tmpEta, tmpPhi);
3025 AliDebug(2,
"No matched tracks found!\n");
3049 AliDebug(2,
"No matched cluster found!\n");
3143 AliDebug(3,Form(
"Matched cluster index: index: %d, dEta: %2.4f, dPhi: %2.4f.\n",
3173 AliDebug(3,Form(
"Matched track index: index: %d, dEta: %2.4f, dPhi: %2.4f.\n",
3197 const AliEMCALGeometry *geom,
3198 AliVCaloCells* cells,
Int_t bc)
3202 if (!cluster || !cluster->IsEMCAL())
return kFALSE;
3223 UInt_t status = esdTrack->GetStatus();
3225 Int_t nClustersITS = esdTrack->GetITSclusters(0);
3226 Int_t nClustersTPC = esdTrack->GetTPCclusters(0);
3228 Float_t chi2PerClusterITS = -1;
3229 Float_t chi2PerClusterTPC = -1;
3230 if (nClustersITS!=0)
3231 chi2PerClusterITS = esdTrack->GetITSchi2()/
Float_t(nClustersITS);
3232 if (nClustersTPC!=0)
3233 chi2PerClusterTPC = esdTrack->GetTPCchi2()/
Float_t(nClustersTPC);
3241 Float_t maxDCAToVertexXYPtDep = 0.0182 + 0.0350/TMath::Power(esdTrack->Pt(),1.01);
3250 Float_t maxDCAToVertexXYPtDep = 0.0105 + 0.0350/TMath::Power(esdTrack->Pt(),1.1);
3260 esdTrack->GetImpactParameters(b,bCov);
3261 if (bCov[0]<=0 || bCov[2]<=0)
3263 AliDebug(1,
"Estimated b resolution lower or equal zero!");
3264 bCov[0]=0; bCov[2]=0;
3275 dcaToVertex = TMath::Sqrt(dcaToVertexXY*dcaToVertexXY + dcaToVertexZ*dcaToVertexZ);
3307 if ( (esdTrack->HasPointOnITSLayer(0) || esdTrack->HasPointOnITSLayer(1)) == kFALSE)
3314 if ((status & AliESDtrack::kITSin) == 0 || (status & AliESDtrack::kTPCin))
3324 if (status & AliESDtrack::kITSpureSA) cuts[11] = kTRUE;
3328 if (!(status & AliESDtrack::kITSpureSA)) cuts[11] = kTRUE;
3335 if (cuts[i]) { cut = kTRUE ; }
3356 AliInfo(Form(
"Track cuts for matching: AliESDtrackCuts::GetStandardTPCOnlyTrackCuts()"));
3374 AliInfo(Form(
"Track cuts for matching: AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE)"));
3392 AliInfo(Form(
"Track cuts for matching: Loose cut w/o DCA cut"));
3401 AliInfo(Form(
"Track cuts for matching: ITS Stand Alone tracks cut w/o DCA cut"));
3410 AliInfo(Form(
"Track cuts for matching: AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kTRUE)"));
3428 AliInfo(Form(
"Track cuts for matching: Loose cut w/o DCA cut plus ITSrefit"));
3446 Int_t nTracks =
event->GetNumberOfTracks();
3447 for (
Int_t iTrack = 0; iTrack < nTracks; ++iTrack)
3449 AliVTrack* track =
dynamic_cast<AliVTrack*
>(
event->GetTrack(iTrack));
3452 AliWarning(Form(
"Could not receive track %d", iTrack));
3457 track->SetEMCALcluster(matchClusIndex);
3460 AliESDtrack* esdtrack =
dynamic_cast<AliESDtrack*
>(track);
3463 if (matchClusIndex != -1)
3464 esdtrack->SetStatus(AliESDtrack::kEMCALmatch);
3466 esdtrack->ResetStatus(AliESDtrack::kEMCALmatch);
3470 AliAODTrack* aodtrack =
dynamic_cast<AliAODTrack*
>(track);
3471 if (matchClusIndex != -1)
3472 aodtrack->SetStatus(AliESDtrack::kEMCALmatch);
3474 aodtrack->ResetStatus(AliESDtrack::kEMCALmatch);
3477 AliDebug(2,
"Track matched to closest cluster");
3489 for (
Int_t iClus=0; iClus <
event->GetNumberOfCaloClusters(); ++iClus)
3491 AliVCluster *cluster =
event->GetCaloCluster(iClus);
3492 if (!cluster->IsEMCAL())
3498 if(cluster->GetNTracksMatched() > 0)
3500 if(!strcmp(
"AliESDCaloCluster",Form(
"%s",cluster->ClassName())))
3503 ((AliESDCaloCluster*)cluster)->AddTracksMatched(arrayTrackMatched);
3507 for(
Int_t iTrack = 0; iTrack < cluster->GetNTracksMatched(); iTrack++)
3509 ((AliAODCaloCluster*)cluster)->RemoveTrackMatched((
TObject*)((AliAODCaloCluster*)cluster)->GetTrackMatched(iTrack));
3517 Int_t nTracks =
event->GetNumberOfTracks();
3518 TArrayI arrayTrackMatched(nTracks);
3523 if (matchTrackIndex != -1)
3525 arrayTrackMatched[nMatched] = matchTrackIndex;
3530 for (
Int_t iTrk=0; iTrk<nTracks; ++iTrk)
3532 AliVTrack* track =
dynamic_cast<AliVTrack*
>(
event->GetTrack(iTrk));
3534 if( !track )
continue;
3536 if ( iTrk == matchTrackIndex )
continue;
3538 if ( track->GetEMCALcluster() == iClus )
3540 arrayTrackMatched[nMatched] = iTrk;
3545 AliDebug(2,Form(
"cluster E %f, N matches %d, first match %d\n",cluster->E(),nMatched,arrayTrackMatched[0]));
3547 arrayTrackMatched.Set(nMatched);
3548 AliESDCaloCluster *esdcluster =
dynamic_cast<AliESDCaloCluster*
>(cluster);
3550 esdcluster->AddTracksMatched(arrayTrackMatched);
3551 else if ( nMatched > 0 )
3553 AliAODCaloCluster *aodcluster =
dynamic_cast<AliAODCaloCluster*
>(cluster);
3556 aodcluster->AddTrackMatched(event->GetTrack(arrayTrackMatched.At(0)));
3563 Float_t eta= -999, phi = -999;
3564 if (matchTrackIndex != -1)
3567 cluster->SetTrackDistance(phi, eta);
3570 AliDebug(2,
"Cluster matched to tracks");
3583 for(
int i = 0; i < map->GetEntries(); i++){
3584 TH2F *hist =
dynamic_cast<TH2F *
>(map->At(i));
3598 clone->SetDirectory(NULL);
3612 for(
int i = 0; i < map->GetEntries(); i++){
3613 TH2I *hist =
dynamic_cast<TH2I *
>(map->At(i));
3626 TH2I *clone =
new TH2I(*h);
3627 clone->SetDirectory(NULL);
3641 for(
int i = 0; i < map->GetEntries(); i++){
3642 TH1F *hist =
dynamic_cast<TH1F *
>(map->At(i));
3655 TH1F *clone =
new TH1F(*h);
3656 clone->SetDirectory(NULL);
3670 for(
int i = 0; i < map->GetEntries(); i++) {
3671 TH1C *hist =
dynamic_cast<TH1C *
>(map->At(i));
3683 TH1C *clone =
new TH1C(*h);
3684 clone->SetDirectory(NULL);
3694 printf(
"-------------------------------------------------------------------------------------------------------------------------------------- \n");
3695 printf(
"AliEMCALRecoUtils Settings: \n");
3696 printf(
"\tMisalignment shifts\n");
3697 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,
3706 printf(
"\tMatching criteria: ");
3708 printf(
"\t\tsqrt(dEta^2+dPhi^2)<%4.3f\n",
fCutR);
3712 printf(
"\t\tError\n");
3713 printf(
"\t\tplease specify your cut criteria\n");
3714 printf(
"\t\tTo cut on sqrt(dEta^2+dPhi^2), use: SwitchOnCutEtaPhiSum()\n");
3715 printf(
"\t\tTo cut on dEta and dPhi separately, use: SwitchOnCutEtaPhiSeparate()\n");
3718 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);
3719 printf(
"\tCluster selection window: dR < %2.0f\n",
fClusterWindow);
3721 printf(
"\tTrack cuts: \n");
3729 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)