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), fUseTrackDCA(kTRUE),
73 fUseOuterTrackParam(kFALSE), fEMCalSurfaceDistance(440.),
74 fTrackCutsType(0), fCutMinTrackPt(0), fCutMinNClusterTPC(0),
75 fCutMinNClusterITS(0), fCutMaxChi2PerClusterTPC(0), fCutMaxChi2PerClusterITS(0),
76 fCutRequireTPCRefit(kFALSE), fCutRequireITSRefit(kFALSE), fCutAcceptKinkDaughters(kFALSE),
77 fCutMaxDCAToVertexXY(0), fCutMaxDCAToVertexZ(0), fCutDCAToVertex2D(kFALSE),
78 fCutRequireITSStandAlone(kFALSE), fCutRequireITSpureSA(kFALSE),
79 fNMCGenerToAccept(0), fMCGenerToAcceptForTrack(1)
104 : AliEMCALRecoUtilsBase(reco),
179 if (
this == &reco)
return *
this;
180 ((
TNamed *)
this)->operator=(reco);
257 for (
Int_t j = 0; j < 5 ; j++)
315 for (
Int_t j = 0; j < 4 ; j++)
403 AliVCaloCells* cells)
405 AliEMCALGeometry* geom = AliEMCALGeometry::GetInstance();
409 AliError(
"No instance of the geometry is available");
413 if ( absID < 0 || absID >= 24*48*geom->GetNumberOfSuperModules() )
416 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1, status=0;
418 if (!geom->GetCellIndex(absID,imod,iTower,iIphi,iIeta))
425 geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
433 AliDebug(1,Form(
"Channel absId %d, status %d, set as bad %d",absID, status, bad));
435 if ( bad )
return kFALSE;
439 amp = cells->GetCellAmplitude(absID);
444 time = cells->GetCellTime(absID);
446 Bool_t isLowGain = !(cells->GetCellHighGain(absID));
467 const AliVCluster* cluster,
468 AliVCaloCells* cells)
472 AliInfo(
"Cluster pointer null!");
480 Int_t absIdMax = -1, iSM =-1, ieta = -1, iphi = -1;
484 AliDebug(2,Form(
"Cluster Max AbsId %d, Cell Energy %2.2f, Cluster Energy %2.2f, Ncells from border %d, EMCAL eta=0 %d\n",
487 if (absIdMax==-1)
return kFALSE;
493 if (iSM < 0 || iphi < 0 || ieta < 0 )
495 AliFatal(Form(
"Negative value for super module: %d, or cell ieta: %d, or cell iphi: %d, check EMCAL geometry name\n",
502 if ( geom->GetSMType(iSM) == AliEMCALGeometry::kEMCAL_Half ) iPhiLast /= 2;
503 else if ( geom->GetSMType(iSM) == AliEMCALGeometry::kEMCAL_3rd ) iPhiLast /= 3;
504 else if ( geom->GetSMType(iSM) == AliEMCALGeometry::kDCAL_Ext ) iPhiLast /= 3;
506 if(iphi >= fNCellsFromEMCALBorder && iphi < iPhiLast - fNCellsFromEMCALBorder) okrow = kTRUE;
513 if ( geom->IsDCALSM(iSM) ) iEtaLast = iEtaLast*2/3;
515 if ( ieta > fNCellsFromEMCALBorder && ieta < iEtaLast-fNCellsFromEMCALBorder ) okcol = kTRUE;
521 if (ieta >= fNCellsFromEMCALBorder) okcol = kTRUE;
525 if (ieta < iEtaLast-fNCellsFromEMCALBorder) okcol = kTRUE;
529 AliDebug(2,Form(
"EMCAL Cluster in %d cells fiducial volume: ieta %d, iphi %d, SM %d: column? %d, row? %d\nq",
530 fNCellsFromEMCALBorder, ieta, iphi, iSM, okcol, okrow));
538 AliDebug(2,Form(
"Reject cluster in border, max cell : ieta %d, iphi %d, SM %d\n",ieta, iphi, iSM));
565 for (
Int_t iCell = 0; iCell<nCells; iCell++)
568 Int_t iTower = -1, iIphi = -1, iIeta = -1;
569 geom->GetCellIndex(cellList[iCell],imod,iTower,iIphi,iIeta);
573 geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,irow,icol);
578 AliDebug(2,Form(
"Cluster with bad channel: SM %d, col %d, row %d, status %d\n",imod, icol, irow, status));
599 AliVCaloCells* cells,
Int_t bc)
601 AliEMCALGeometry * geom = AliEMCALGeometry::GetInstance();
605 AliError(
"No instance of the geometry is available");
609 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
610 geom->GetCellIndex(absID,imod,iTower,iIphi,iIeta);
611 geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
618 if ( iphi < AliEMCALGeoParams::fgkEMCALRows-1) absID1 = geom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta);
619 if ( iphi > 0 ) absID2 = geom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta);
626 if ( ieta == AliEMCALGeoParams::fgkEMCALCols-1 && !(imod%2) )
628 absID3 = geom-> GetAbsCellIdFromCellIndexes(imod+1, iphi, 0);
629 absID4 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
631 else if ( ieta == 0 && imod%2 )
633 absID3 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
634 absID4 = geom-> GetAbsCellIdFromCellIndexes(imod-1, iphi, AliEMCALGeoParams::fgkEMCALCols-1);
638 if ( ieta < AliEMCALGeoParams::fgkEMCALCols-1 )
639 absID3 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
641 absID4 = geom-> GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
646 Float_t ecell1 = 0, ecell2 = 0, ecell3 = 0, ecell4 = 0;
647 Double_t tcell1 = 0, tcell2 = 0, tcell3 = 0, tcell4 = 0;
659 return ecell1+ecell2+ecell3+ecell4;
681 if (!accept)
return kTRUE;
689 AliDebug(2,Form(
"AliEMCALRecoUtils::IsExoticCell() - EXOTIC CELL id %d, eCell %f, eCross %f, 1-eCross/eCell %f\n",
690 absID,ecell,eCross,1-eCross/ecell));
708 AliVCaloCells *cells,
713 AliInfo(
"Cluster pointer null!");
720 AliEMCALGeometry* geom = AliEMCALGeometry::GetInstance();
724 AliError(
"No instance of the geometry is available");
728 Int_t iSupMod = -1, absId = -1, ieta = -1, iphi = -1;
748 AliInfo(
"Cluster pointer null!");
760 AliDebug(2, Form(
"Energy: original %f, smeared %f\n", energy, rdmEnergy));
779 AliInfo(
"Cluster pointer null!");
787 AliInfo(Form(
"Too low cluster energy!, E = %f < 0.100 GeV",energy));
790 else if(energy > 300.)
792 AliInfo(Form(
"Too high cluster energy!, E = %f GeV, do not apply non linearity",energy));
1066 AliDebug(2,
"No correction on the energy\n");
1306 if ( status == AliCaloCalibPedestal::kAlive )
1319 status == AliCaloCalibPedestal::kDead )
1322 status == AliCaloCalibPedestal::kHot )
1325 status == AliCaloCalibPedestal::kWarning )
1330 AliWarning(Form(
"Careful, bad channel selection not properly done: ism %d, icol %d, irow %d, status %d,\n" 1331 " fBadAll %d, fBadHot %d, fBadWarm %d, fBadDead %d",
1332 iSM, iCol, iRow, status,
1354 AliVCaloCells* cells,
1355 const AliVCluster* clu,
1366 Int_t cellAbsId = -1 ;
1375 AliInfo(
"Cluster pointer null!");
1376 absId=-1; iSupMod0=-1, ieta = -1; iphi = -1; shared = -1;
1380 for (
Int_t iDig=0; iDig< clu->GetNCells(); iDig++)
1382 cellAbsId = clu->GetCellAbsId(iDig);
1383 fraction = clu->GetCellAmplitudeFraction(iDig);
1385 if (fraction < 1e-4) fraction = 1.;
1387 geom->GetCellIndex(cellAbsId,iSupMod,iTower,iIphi,iIeta);
1388 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
1393 }
else if (iSupMod0!=iSupMod)
1402 eCell = cells->GetCellAmplitude(cellAbsId)*fraction*recalFactor;
1413 geom->GetCellIndex(absId,iSupMod,iTower,iIphi,iIeta);
1415 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
1431 if (eCell > 0 && eCluster > 0)
1433 if (
fW0 > 0 )
return TMath::Max( 0.,
fW0 + TMath::Log( eCell / eCluster ) ) ;
1434 else return TMath::Log( eCluster / eCell ) ;
1494 for (
Int_t i = 0; i < 15 ; i++)
1525 AliDebug(2,
"AliCalorimeterUtils::InitEMCALRecalibrationFactors()");
1528 Bool_t oldStatus = TH1::AddDirectoryStatus();
1529 TH1::AddDirectory(kFALSE);
1532 for (
int i = 0; i < 22; i++)
1534 Form(
"EMCALRecalFactors_SM%d",i), 48, 0, 48, 24, 0, 24));
1536 for (
Int_t sm = 0; sm < 22; sm++)
1538 for (
Int_t i = 0; i < 48; i++)
1540 for (
Int_t j = 0; j < 24; j++)
1551 TH1::AddDirectory(oldStatus);
1560 AliDebug(2,
"AliCalorimeterUtils::InitEMCALRecalibrationFactors()");
1563 Bool_t oldStatus = TH1::AddDirectoryStatus();
1564 TH1::AddDirectory(kFALSE);
1569 for (
int i = 0; i < 4; i++)
1571 Form(
"hAllTimeAvBC%d",i),
1572 48*24*22,0.,48*24*22) );
1574 for (
Int_t iBC = 0; iBC < 4; iBC++)
1576 for (
Int_t iCh = 0; iCh < 48*24*22; iCh++)
1581 for (
int iBC = 0; iBC < 4; iBC++) {
1583 Form(
"hAllTimeAvLGBC%d",iBC),
1584 48*24*22,0.,48*24*22) );
1585 for (
Int_t iCh = 0; iCh < 48*24*22; iCh++)
1596 TH1::AddDirectory(oldStatus);
1605 AliDebug(2,
"AliEMCALRecoUtils::InitEMCALBadChannelStatusMap()");
1608 Bool_t oldStatus = TH1::AddDirectoryStatus();
1609 TH1::AddDirectory(kFALSE);
1614 for (
int i = 0; i < 22; i++)
1615 fEMCALBadChannelMap->Add(
new TH2I(Form(
"EMCALBadChannelMap_Mod%d",i),Form(
"EMCALBadChannelMap_Mod%d",i), 48, 0, 48, 24, 0, 24));
1621 TH1::AddDirectory(oldStatus);
1630 AliDebug(2,
"AliEMCALRecoUtils::InitEMCALL1PhaseInTimeRecalibrationFactors()");
1633 Bool_t oldStatus = TH1::AddDirectoryStatus();
1634 TH1::AddDirectory(kFALSE);
1640 for (
Int_t i = 0; i < 22; i++)
1647 TH1::AddDirectory(oldStatus);
1661 AliVCluster * cluster,
1662 AliVCaloCells * cells,
1667 AliInfo(
"Cluster pointer null!");
1672 UShort_t * index = cluster->GetCellsAbsId() ;
1673 Double_t * fraction = cluster->GetCellsAmplitudeFraction() ;
1674 Int_t ncells = cluster->GetNCells();
1679 Int_t icol =-1, irow =-1, imod=1;
1681 Int_t absIdMax = -1;
1685 for (
Int_t icell = 0; icell < ncells; icell++)
1687 absId = index[icell];
1688 frac = fraction[icell];
1689 if (frac < 1e-5) frac = 1;
1694 Int_t iTower = -1, iIphi = -1, iIeta = -1;
1695 geom->GetCellIndex(absId,imod,iTower,iIphi,iIeta);
1698 geom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,irow,icol);
1701 AliDebug(2,Form(
"AliEMCALRecoUtils::RecalibrateClusterEnergy - recalibrate cell: module %d, col %d, row %d, cell fraction %f,recalibration factor %f, cell energy %f\n",
1702 imod,icol,irow,frac,factor,cells->GetCellAmplitude(absId)));
1706 energy += cells->GetCellAmplitude(absId)*factor*frac;
1708 if (emax < cells->GetCellAmplitude(absId)*factor*frac)
1710 emax = cells->GetCellAmplitude(absId)*factor*frac;
1715 AliDebug(2,Form(
"AliEMCALRecoUtils::RecalibrateClusterEnergy - Energy before %f, after %f \n",cluster->E(),
energy));
1717 cluster->SetE(energy);
1720 Double_t timeorg = cluster->GetTOF();
1721 Bool_t isLowGain = !(cells->GetCellHighGain(absIdMax));
1723 Double_t time = cells->GetCellTime(absIdMax);
1732 cluster->SetTOF(time);
1734 AliDebug(2,Form(
"AliEMCALRecoUtils::RecalibrateClusterEnergy - Time before %f, after %f \n",timeorg,cluster->GetTOF()));
1752 AliInfo(
"Cells pointer null!");
1765 Int_t nEMcell = cells->GetNumberOfCells() ;
1766 for (
Int_t iCell = 0; iCell < nEMcell; iCell++)
1768 cells->GetCell( iCell, absId, ecellin, tcellin, mclabel, efrac );
1778 cells->SetCell(iCell,absId,ecell, tcell, mclabel, efrac);
1819 Int_t l1Phase=l1PhaseShift & 3;
1822 offsetPerSM = (bc - l1Phase)*25;
1824 offsetPerSM = (bc - l1Phase + 4)*25;
1826 Int_t l1shiftOffset=l1PhaseShift>>2;
1829 celltime -= offsetPerSM*1.e-9;
1830 celltime -= l1shiftOffset*1.e-9;
1863 for(
Int_t icluscell = 0; icluscell < clus->GetNCells(); icluscell++ )
1865 if(absID == clus->GetCellAbsId(icluscell))
1867 clus->GetCellMCEdepFractionArray(icluscell,eDepFrac);
1877 AliWarning(Form(
"Cell abs ID %d NOT found in cluster",absID));
1889 for(
UInt_t imc = 0; imc < 4; imc++)
1891 if ( eDepFrac[imc] > 0 && clus->GetNLabels() > imc )
1893 mc->GetCocktailGenerator(clus->GetLabelAt(imc),genName);
1903 amp-=ampOrg*eDepFrac[imc];
1905 edepTotFrac-=eDepFrac[imc];
1919 for(
UInt_t imc = 0; imc < 4; imc++)
1921 if ( eDepFrac[imc] > 0 && clus->GetNLabels() > imc && edepTotFrac > 0 )
1925 labeArr.Set(nLabels);
1926 labeArr.AddAt(clus->GetLabelAt(imc), nLabels-1);
1928 eDepArr.Set(nLabels);
1929 eDepArr.AddAt( (eDepFrac[imc]/edepTotFrac) * amp, nLabels-1);
1940 if ( nLabels == 0 ) amp = 0;
1953 AliVCaloCells* cells,
1958 AliInfo(
"Cluster pointer null!");
1964 else AliDebug(2,
"Algorithm to recalculate position not selected, do nothing.");
1977 AliVCaloCells* cells,
1985 Int_t iTower = -1, iIphi = -1, iIeta = -1;
1986 Int_t iSupModMax = -1, iSM=-1, iphi = -1, ieta = -1;
1987 Float_t weight = 0., totalWeight=0.;
1988 Float_t newPos[3] = {-1.,-1.,-1.};
1993 if (clEnergy <= 0)
return;
2000 for (
Int_t iDig=0; iDig< clu->GetNCells(); iDig++)
2002 absId = clu->GetCellAbsId(iDig);
2003 fraction = clu->GetCellAmplitudeFraction(iDig);
2004 if (fraction < 1e-4) fraction = 1.;
2008 geom->GetCellIndex(absId,iSM,iTower,iIphi,iIeta);
2009 geom->GetCellPhiEtaIndexInSModule(iSM,iTower,iIphi, iIeta,iphi,ieta);
2015 eCell = cells->GetCellAmplitude(absId)*fraction*recalFactor;
2018 totalWeight += weight;
2020 geom->RelPosCellInSModule(absId,depth,pLocal[0],pLocal[1],pLocal[2]);
2022 geom->GetGlobal(pLocal,pGlobal,iSupModMax);
2025 for (
int i=0; i<3; i++ ) newPos[i] += (weight*pGlobal[i]);
2030 for (
int i=0; i<3; i++ ) newPos[i] /= totalWeight;
2038 if (iSupModMax > 1) {
2051 clu->SetPosition(newPos);
2064 AliVCaloCells* cells,
2073 Int_t iIphi = -1, iIeta = -1;
2074 Int_t iSupMod = -1, iSupModMax = -1;
2075 Int_t iphi = -1, ieta =-1;
2085 Float_t weight = 0., weightedCol = 0., weightedRow = 0., totalWeight=0.;
2086 Bool_t areInSameSM = kTRUE;
2087 Int_t startingSM = -1;
2089 for (
Int_t iDig=0; iDig< clu->GetNCells(); iDig++)
2091 absId = clu->GetCellAbsId(iDig);
2092 fraction = clu->GetCellAmplitudeFraction(iDig);
2093 if (fraction < 1e-4) fraction = 1.;
2095 if (iDig==0) startingSM = iSupMod;
2096 else if (iSupMod != startingSM) areInSameSM = kFALSE;
2098 eCell = cells->GetCellAmplitude(absId);
2100 geom->GetCellIndex(absId,iSupMod,iTower,iIphi,iIeta);
2101 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi, iIeta,iphi,ieta);
2110 eCell = cells->GetCellAmplitude(absId)*fraction*recalFactor;
2113 if (weight < 0) weight = 0;
2114 totalWeight += weight;
2115 weightedCol += ieta*weight;
2116 weightedRow += iphi*weight;
2121 Float_t xyzNew[]={-1.,-1.,-1.};
2122 if (areInSameSM == kTRUE)
2125 weightedCol = weightedCol/totalWeight;
2126 weightedRow = weightedRow/totalWeight;
2135 clu->SetPosition(xyzNew);
2147 AliVCaloCells* cells,
2148 AliVCluster * cluster)
2154 AliInfo(
"Cluster pointer null!");
2159 Int_t absIdMax = -1, iSupMod =-1, icolM = -1, irowM = -1;
2161 GetMaxEnergyCell(geom, cells, cluster, absIdMax, iSupMod, icolM, irowM, shared);
2169 for (
Int_t irow = 0; irow < AliEMCALGeoParams::fgkEMCALRows; irow++)
2171 for (
Int_t icol = 0; icol < AliEMCALGeoParams::fgkEMCALCols; icol++)
2174 if (hMap->GetBinContent(icol,irow)==0)
continue;
2178 dRrow=TMath::Abs(irowM-irow);
2179 dRcol=TMath::Abs(icolM-icol);
2180 dist=TMath::Sqrt(dRrow*dRrow+dRcol*dRcol);
2193 Int_t iSupMod2 = -1;
2196 if (iSupMod%2) iSupMod2 = iSupMod-1;
2197 else iSupMod2 = iSupMod+1;
2201 for (
Int_t irow = 0; irow < AliEMCALGeoParams::fgkEMCALRows; irow++)
2203 for (
Int_t icol = 0; icol < AliEMCALGeoParams::fgkEMCALCols; icol++)
2206 if (hMap2->GetBinContent(icol,irow)==0)
continue;
2210 dRrow=TMath::Abs(irow-irowM);
2213 dRcol=TMath::Abs(icol-(AliEMCALGeoParams::fgkEMCALCols+icolM));
2215 dRcol=TMath::Abs(AliEMCALGeoParams::fgkEMCALCols+icol-icolM);
2217 dist=TMath::Sqrt(dRrow*dRrow+dRcol*dRcol);
2218 if (dist < minDist) minDist = dist;
2223 AliDebug(2,Form(
"Max cluster cell (SM,col,row)=(%d %d %d) - Distance to Bad Channel %2.2f",iSupMod, icolM, irowM, minDist));
2224 cluster->SetDistanceToBadChannel(minDist);
2238 AliInfo(
"Cluster pointer null!");
2242 if (cluster->GetM02() != 0)
2243 fPIDUtils->ComputePID(cluster->E(),cluster->GetM02());
2245 Float_t pidlist[AliPID::kSPECIESCN+1];
2246 for (
Int_t i = 0; i < AliPID::kSPECIESCN+1; i++) pidlist[i] =
fPIDUtils->GetPIDFinal(i);
2248 cluster->SetPID(pidlist);
2273 AliVCaloCells* cells, AliVCluster * cluster,
2281 AliInfo(
"Cluster pointer null!");
2289 Bool_t isLowGain = kFALSE;
2317 disp = 0; dEta = 0; dPhi = 0;
2318 sEta = 0; sPhi = 0; sEtaPhi = 0;
2320 for (
Int_t iDigit=0; iDigit < cluster->GetNCells(); iDigit++)
2324 Int_t absId = cluster->GetCellAbsId(iDigit);
2326 geom->GetCellIndex(absId,iSupMod,iTower,iIphi,iIeta);
2327 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi,iIeta, iphi,ieta);
2330 if (iDigit == 0 ) iSM0 = iSupMod;
2331 else if (iSupMod!= iSM0) shared = kTRUE;
2334 fraction = cluster->GetCellAmplitudeFraction(iDigit);
2335 if (fraction < 1e-4) fraction = 1.;
2340 eCell = cells->GetCellAmplitude(absId)*fraction*recalFactor;
2341 tCell = cells->GetCellTime (absId);
2342 isLowGain = !(cells->GetCellHighGain(absId));
2351 if(eCell > cellEcut && TMath::Abs(tCell) < cellTimeCut)
2352 enAfterCuts += eCell;
2357 for (
Int_t iDigit=0; iDigit < cluster->GetNCells(); iDigit++)
2360 Int_t absId = cluster->GetCellAbsId(iDigit);
2362 geom->GetCellIndex(absId,iSupMod,iTower,iIphi,iIeta);
2363 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi,iIeta, iphi,ieta);
2366 fraction = cluster->GetCellAmplitudeFraction(iDigit);
2367 if (fraction < 1e-4) fraction = 1.;
2372 eCell = cells->GetCellAmplitude(absId)*fraction*recalFactor;
2373 tCell = cells->GetCellTime (absId);
2374 isLowGain = !(cells->GetCellHighGain(absId));
2382 if (shared && iSupMod%2) ieta+=AliEMCALGeoParams::fgkEMCALCols;
2384 if ( energy > 0 && eCell > cellEcut && TMath::Abs(tCell) < cellTimeCut )
2397 geom->EtaPhiFromIndex(absId, etai, phii);
2398 etai *= TMath::RadToDeg();
2399 phii *= TMath::RadToDeg();
2403 geom->GetGlobal(absId,pGlobal);
2415 phii = TMath::Sqrt(pGlobal[0]*pGlobal[0]+pGlobal[1]*pGlobal[1]);
2425 sEta += w * etai * etai ;
2426 etaMean += w * etai ;
2427 sPhi += w * phii * phii ;
2428 phiMean += w * phii ;
2429 sEtaPhi += w * etai * phii ;
2432 else if(eCell > 0.05)
2433 AliDebug(2,Form(
"Wrong energy in cell %f and/or cluster %f\n", eCell, cluster->E()));
2445 AliDebug(2,Form(
"Wrong weight %f\n", wtot));
2448 for (
Int_t iDigit=0; iDigit < cluster->GetNCells(); iDigit++)
2451 Int_t absId = cluster->GetCellAbsId(iDigit);
2453 geom->GetCellIndex(absId,iSupMod,iTower,iIphi,iIeta);
2454 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi,iIeta, iphi,ieta);
2457 fraction = cluster->GetCellAmplitudeFraction(iDigit);
2458 if (fraction < 1e-4) fraction = 1.;
2462 eCell = cells->GetCellAmplitude(absId)*fraction*recalFactor;
2463 tCell = cells->GetCellTime (absId);
2464 isLowGain = !(cells->GetCellHighGain(absId));
2472 if (shared && iSupMod%2) ieta+=AliEMCALGeoParams::fgkEMCALCols;
2474 if ( energy > 0 && eCell > cellEcut && TMath::Abs(tCell) < cellTimeCut )
2487 geom->EtaPhiFromIndex(absId, etai, phii);
2488 etai *= TMath::RadToDeg();
2489 phii *= TMath::RadToDeg();
2493 geom->GetGlobal(absId,pGlobal);
2505 phii = TMath::Sqrt(pGlobal[0]*pGlobal[0]+pGlobal[1]*pGlobal[1]);
2511 disp += w *((etai-etaMean)*(etai-etaMean)+(phii-phiMean)*(phii-phiMean));
2512 dEta += w * (etai-etaMean)*(etai-etaMean) ;
2513 dPhi += w * (phii-phiMean)*(phii-phiMean) ;
2517 AliDebug(2,Form(
"Wrong energy in cell %f and/or cluster %f\n", eCell, cluster->E()));
2521 if (wtot > 0 && nstat > 1)
2530 sEta -= etaMean * etaMean ;
2531 sPhi -= phiMean * phiMean ;
2532 sEtaPhi -= etaMean * phiMean ;
2534 l0 = (0.5 * (sEta + sPhi) + TMath::Sqrt( 0.25 * (sEta - sPhi) * (sEta - sPhi) + sEtaPhi * sEtaPhi ));
2535 l1 = (0.5 * (sEta + sPhi) - TMath::Sqrt( 0.25 * (sEta - sPhi) * (sEta - sPhi) + sEtaPhi * sEtaPhi ));
2544 dEta = 0. ; dPhi = 0. ; disp = 0. ;
2545 sEta = 0. ; sPhi = 0. ; sEtaPhi = 0. ;
2569 AliVCaloCells* cells, AliVCluster * cluster,
2576 Float_t cellTimeWindow = 1000;
2579 cellEmin, cellTimeWindow, bc,
2580 newEnergy, l0, l1, disp,
2581 dEta, dPhi, sEta, sPhi, sEtaPhi);
2594 AliVCaloCells* cells,
2595 AliVCluster * cluster)
2598 Float_t disp = 0., dEta = 0., dPhi = 0.;
2599 Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
2602 dEta, dPhi, sEta, sPhi, sEtaPhi);
2604 cluster->SetM02(l0);
2605 cluster->SetM20(l1);
2606 if (disp > 0. ) cluster->SetDispersion(TMath::Sqrt(disp)) ;
2624 AliVCaloCells* cells, AliVCluster * cluster,
2629 Float_t disp = 0., dEta = 0., dPhi = 0.;
2630 Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
2633 cellEcut, cellTimeCut, bc,
2634 enAfterCuts, l0, l1, disp,
2635 dEta, dPhi, sEta, sPhi, sEtaPhi);
2637 cluster->SetM02(l0);
2638 cluster->SetM20(l1);
2639 if (disp > 0. ) cluster->SetDispersion(TMath::Sqrt(disp)) ;
2659 const AliEMCALGeometry *geom,
2676 if (!TGeoGlobalMagField::Instance()->GetField())
2678 if (!event->InitMagneticField())
2680 AliInfo(
"Mag Field not initialized, null esd/aod evetn pointers");
2686 UInt_t mask1 = esdevent->GetESDRun()->GetDetectorsInDAQ();
2687 UInt_t mask2 = esdevent->GetESDRun()->GetDetectorsInReco();
2688 Bool_t desc1 = (mask1 >> 3) & 0x1;
2689 Bool_t desc2 = (mask2 >> 3) & 0x1;
2690 if (desc1==0 || desc2==0) {
2701 clusterArray =
new TObjArray(event->GetNumberOfCaloClusters());
2702 for (
Int_t icl=0; icl<
event->GetNumberOfCaloClusters(); icl++)
2704 AliVCluster *cluster = (AliVCluster*) event->GetCaloCluster(icl);
2705 if (!
IsGoodCluster(cluster,geom,(AliVCaloCells*)event->GetEMCALCells()))
2707 clusterArray->AddAt(cluster,icl);
2714 for (
Int_t i=0; i<21;i++) cv[i]=0;
2715 for (
Int_t itr=0; itr<
event->GetNumberOfTracks(); itr++)
2717 AliExternalTrackParam *trackParam = 0;
2720 AliESDtrack *esdTrack = 0;
2721 AliAODTrack *aodTrack = 0;
2724 esdTrack = esdevent->GetTrack(itr);
2725 if (!esdTrack)
continue;
2729 if ( TMath::Abs(esdTrack->Eta()) > 0.9 )
continue;
2732 if( geom->GetNumberOfSuperModules() < 13 )
2734 Double_t phi = esdTrack->Phi()*TMath::RadToDeg();
2735 if ( phi <= 10 || phi >= 250 )
continue;
2741 trackParam =
const_cast<AliExternalTrackParam*
>(esdTrack->GetOuterParam());
2743 trackParam =
const_cast<AliExternalTrackParam*
>(esdTrack->GetInnerParam());
2746 trackParam =
new AliExternalTrackParam(*esdTrack);
2748 mcLabel = TMath::Abs(esdTrack->GetLabel());
2755 aodTrack =
dynamic_cast<AliAODTrack*
>(aodevent->GetTrack(itr));
2757 if (!aodTrack) AliFatal(
"Not a standard AOD");
2759 if (!aodTrack)
continue;
2764 if (!aodTrack->IsTPCConstrained())
continue ;
2769 if (!aodTrack->IsHybridGlobalConstrainedGlobal())
continue ;
2778 if ( TMath::Abs(aodTrack->Eta()) > 0.9 )
continue;
2781 if( geom->GetNumberOfSuperModules() < 13 )
2783 Double_t phi = aodTrack->Phi()*TMath::RadToDeg();
2784 if ( phi <= 10 || phi >= 250 )
continue;
2790 aodTrack->GetXYZ(pos);
2792 aodTrack->XvYvZv(pos);
2794 aodTrack->GetPxPyPz(mom);
2795 AliDebug(5,Form(
"aod track: i=%d | pos=(%5.4f,%5.4f,%5.4f) | mom=(%5.4f,%5.4f,%5.4f) | charge=%d\n",
2796 itr,pos[0],pos[1],pos[2],mom[0],mom[1],mom[2],aodTrack->Charge()));
2798 trackParam=
new AliExternalTrackParam(pos,mom,cv,aodTrack->Charge());
2800 mcLabel = TMath::Abs(aodTrack->GetLabel());
2806 AliWarning(
"Wrong input data type! Should be \"AOD\" or \"ESD\" ");
2809 clusterArray->Clear();
2810 delete clusterArray;
2815 if (!trackParam)
continue;
2823 mc->GetCocktailGenerator(mcLabel,genName);
2831 if ( !generOK )
continue;
2835 AliExternalTrackParam emcalParam(*trackParam);
2839 if (aodevent && trackParam)
delete trackParam;
2844 if ( TMath::Abs(eta) > 0.75 )
2846 if ( trackParam && (aodevent ||
fITSTrackSA) )
delete trackParam;
2851 if ( geom->GetNumberOfSuperModules() < 13 &&
2852 ( phi < 70*TMath::DegToRad() || phi > 190*TMath::DegToRad()))
2854 if ( trackParam && (aodevent ||
fITSTrackSA) )
delete trackParam;
2860 Float_t dEta = -999, dPhi = -999;
2876 if (aodevent && trackParam)
delete trackParam;
2882 clusterArray->Clear();
2883 delete clusterArray;
2886 AliDebug(2,Form(
"Number of matched pairs = %d !\n",matched));
2907 const AliVEvent *event,
2908 const AliEMCALGeometry *geom,
2913 if ( TMath::Abs(track->Eta()) > 0.9 )
return index;
2916 if( geom->GetNumberOfSuperModules() < 13 )
2918 Double_t phiV = track->Phi()*TMath::RadToDeg();
2919 if ( phiV <= 10 || phiV >= 250 )
return index;
2922 AliExternalTrackParam *trackParam = 0;
2926 trackParam =
const_cast<AliExternalTrackParam*
>(track->GetOuterParam());
2928 trackParam =
const_cast<AliExternalTrackParam*
>(track->GetInnerParam());
2931 trackParam =
new AliExternalTrackParam(*track);
2933 if (!trackParam)
return index;
2934 AliExternalTrackParam emcalParam(*trackParam);
2943 if ( TMath::Abs(eta) > 0.75 )
2950 if ( geom->GetNumberOfSuperModules() < 13 &&
2951 ( phi < 70*TMath::DegToRad() || phi > 190*TMath::DegToRad()))
2959 for (
Int_t icl=0; icl<
event->GetNumberOfCaloClusters(); icl++)
2961 AliVCluster *cluster = (AliVCluster*) event->GetCaloCluster(icl);
2962 if (!
IsGoodCluster(cluster,geom,(AliVCaloCells*)event->GetEMCALCells()))
continue;
2963 clusterArr->AddAt(cluster,icl);
2967 clusterArr->Clear();
2986 AliExternalTrackParam *trkParam,
2990 dEta=-999, dPhi=-999;
2993 Float_t tmpEta=-999, tmpPhi=-999;
2996 if (!emcalParam->GetXYZ(exPos))
return index;
2998 Float_t clsPos[3] = {0.,0.,0.};
2999 for (
Int_t icl=0; icl<clusterArr->GetEntriesFast(); icl++)
3001 AliVCluster *cluster =
dynamic_cast<AliVCluster*
> (clusterArr->At(icl)) ;
3003 if (!cluster || !cluster->IsEMCAL())
continue;
3005 cluster->GetPosition(clsPos);
3007 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));
3010 AliExternalTrackParam trkPamTmp (*trkParam);
3012 if (!AliEMCALRecoUtilsBase::ExtrapolateTrackToCluster(&trkPamTmp, cluster,
fMass,
fStepCluster, tmpEta, tmpPhi))
continue;
3016 Float_t tmpR=TMath::Sqrt(tmpEta*tmpEta + tmpPhi*tmpPhi);
3027 if (TMath::Abs(tmpEta)<TMath::Abs(dEtaMax) && TMath::Abs(tmpPhi)<TMath::Abs(dPhiMax))
3036 AliError(
"Please specify your cut criteria");
3037 AliError(
"To cut on sqrt(dEta^2+dPhi^2), use: SwitchOnCutEtaPhiSum()");
3038 AliError(
"To cut on dEta and dPhi separately, use: SwitchOnCutEtaPhiSeparate()");
3063 const AliVCluster *cluster,
3067 return AliEMCALRecoUtilsBase::ExtrapolateTrackToCluster(trkParam, cluster,
fMass,
fStepCluster, tmpEta, tmpPhi);
3085 AliDebug(2,
"No matched tracks found!\n");
3109 AliDebug(2,
"No matched cluster found!\n");
3203 AliDebug(3,Form(
"Matched cluster index: index: %d, dEta: %2.4f, dPhi: %2.4f.\n",
3233 AliDebug(3,Form(
"Matched track index: index: %d, dEta: %2.4f, dPhi: %2.4f.\n",
3257 const AliEMCALGeometry *geom,
3258 AliVCaloCells* cells,
Int_t bc)
3262 if (!cluster || !cluster->IsEMCAL())
return kFALSE;
3283 UInt_t status = esdTrack->GetStatus();
3285 Int_t nClustersITS = esdTrack->GetITSclusters(0);
3286 Int_t nClustersTPC = esdTrack->GetTPCclusters(0);
3288 Float_t chi2PerClusterITS = -1;
3289 Float_t chi2PerClusterTPC = -1;
3290 if (nClustersITS!=0)
3291 chi2PerClusterITS = esdTrack->GetITSchi2()/
Float_t(nClustersITS);
3292 if (nClustersTPC!=0)
3293 chi2PerClusterTPC = esdTrack->GetTPCchi2()/
Float_t(nClustersTPC);
3301 Float_t maxDCAToVertexXYPtDep = 0.0182 + 0.0350/TMath::Power(esdTrack->Pt(),1.01);
3310 Float_t maxDCAToVertexXYPtDep = 0.0105 + 0.0350/TMath::Power(esdTrack->Pt(),1.1);
3320 esdTrack->GetImpactParameters(b,bCov);
3321 if (bCov[0]<=0 || bCov[2]<=0)
3323 AliDebug(1,
"Estimated b resolution lower or equal zero!");
3324 bCov[0]=0; bCov[2]=0;
3335 dcaToVertex = TMath::Sqrt(dcaToVertexXY*dcaToVertexXY + dcaToVertexZ*dcaToVertexZ);
3367 if ( (esdTrack->HasPointOnITSLayer(0) || esdTrack->HasPointOnITSLayer(1)) == kFALSE)
3374 if ((status & AliESDtrack::kITSin) == 0 || (status & AliESDtrack::kTPCin))
3384 if (status & AliESDtrack::kITSpureSA) cuts[11] = kTRUE;
3388 if (!(status & AliESDtrack::kITSpureSA)) cuts[11] = kTRUE;
3395 if (cuts[i]) { cut = kTRUE ; }
3416 AliInfo(Form(
"Track cuts for matching: AliESDtrackCuts::GetStandardTPCOnlyTrackCuts()"));
3434 AliInfo(Form(
"Track cuts for matching: AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE)"));
3452 AliInfo(Form(
"Track cuts for matching: Loose cut w/o DCA cut"));
3461 AliInfo(Form(
"Track cuts for matching: ITS Stand Alone tracks cut w/o DCA cut"));
3470 AliInfo(Form(
"Track cuts for matching: AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kTRUE)"));
3488 AliInfo(Form(
"Track cuts for matching: Loose cut w/o DCA cut plus ITSrefit"));
3506 Int_t nTracks =
event->GetNumberOfTracks();
3507 for (
Int_t iTrack = 0; iTrack < nTracks; ++iTrack)
3509 AliVTrack* track =
dynamic_cast<AliVTrack*
>(
event->GetTrack(iTrack));
3512 AliWarning(Form(
"Could not receive track %d", iTrack));
3517 track->SetEMCALcluster(matchClusIndex);
3520 AliESDtrack* esdtrack =
dynamic_cast<AliESDtrack*
>(track);
3523 if (matchClusIndex != -1)
3524 esdtrack->SetStatus(AliESDtrack::kEMCALmatch);
3526 esdtrack->ResetStatus(AliESDtrack::kEMCALmatch);
3530 AliAODTrack* aodtrack =
dynamic_cast<AliAODTrack*
>(track);
3531 if (matchClusIndex != -1)
3532 aodtrack->SetStatus(AliESDtrack::kEMCALmatch);
3534 aodtrack->ResetStatus(AliESDtrack::kEMCALmatch);
3537 AliDebug(2,
"Track matched to closest cluster");
3549 for (
Int_t iClus=0; iClus <
event->GetNumberOfCaloClusters(); ++iClus)
3551 AliVCluster *cluster =
event->GetCaloCluster(iClus);
3552 if (!cluster->IsEMCAL())
3558 if(cluster->GetNTracksMatched() > 0)
3560 if(!strcmp(
"AliESDCaloCluster",Form(
"%s",cluster->ClassName())))
3563 ((AliESDCaloCluster*)cluster)->AddTracksMatched(arrayTrackMatched);
3567 for(
Int_t iTrack = 0; iTrack < cluster->GetNTracksMatched(); iTrack++)
3569 ((AliAODCaloCluster*)cluster)->RemoveTrackMatched((
TObject*)((AliAODCaloCluster*)cluster)->GetTrackMatched(iTrack));
3577 Int_t nTracks =
event->GetNumberOfTracks();
3578 TArrayI arrayTrackMatched(nTracks);
3583 if (matchTrackIndex != -1)
3585 arrayTrackMatched[nMatched] = matchTrackIndex;
3590 for (
Int_t iTrk=0; iTrk<nTracks; ++iTrk)
3592 AliVTrack* track =
dynamic_cast<AliVTrack*
>(
event->GetTrack(iTrk));
3594 if( !track )
continue;
3596 if ( iTrk == matchTrackIndex )
continue;
3598 if ( track->GetEMCALcluster() == iClus )
3600 arrayTrackMatched[nMatched] = iTrk;
3605 AliDebug(2,Form(
"cluster E %f, N matches %d, first match %d\n",cluster->E(),nMatched,arrayTrackMatched[0]));
3607 arrayTrackMatched.Set(nMatched);
3608 AliESDCaloCluster *esdcluster =
dynamic_cast<AliESDCaloCluster*
>(cluster);
3610 esdcluster->AddTracksMatched(arrayTrackMatched);
3611 else if ( nMatched > 0 )
3613 AliAODCaloCluster *aodcluster =
dynamic_cast<AliAODCaloCluster*
>(cluster);
3616 aodcluster->AddTrackMatched(event->GetTrack(arrayTrackMatched.At(0)));
3623 Float_t eta= -999, phi = -999;
3624 if (matchTrackIndex != -1)
3627 cluster->SetTrackDistance(phi, eta);
3630 AliDebug(2,
"Cluster matched to tracks");
3643 for(
int i = 0; i < map->GetEntries(); i++){
3644 TH2F *hist =
dynamic_cast<TH2F *
>(map->At(i));
3658 clone->SetDirectory(NULL);
3672 for(
int i = 0; i < map->GetEntries(); i++){
3673 TH2I *hist =
dynamic_cast<TH2I *
>(map->At(i));
3686 TH2I *clone =
new TH2I(*h);
3687 clone->SetDirectory(NULL);
3701 for(
int i = 0; i < map->GetEntries(); i++){
3702 TH1F *hist =
dynamic_cast<TH1F *
>(map->At(i));
3715 TH1F *clone =
new TH1F(*h);
3716 clone->SetDirectory(NULL);
3730 for(
int i = 0; i < map->GetEntries(); i++) {
3731 TH1C *hist =
dynamic_cast<TH1C *
>(map->At(i));
3743 TH1C *clone =
new TH1C(*h);
3744 clone->SetDirectory(NULL);
3754 printf(
"-------------------------------------------------------------------------------------------------------------------------------------- \n");
3755 printf(
"AliEMCALRecoUtils Settings: \n");
3756 printf(
"\tMisalignment shifts\n");
3757 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,
3766 printf(
"\tMatching criteria: ");
3768 printf(
"\t\tsqrt(dEta^2+dPhi^2)<%4.3f\n",
fCutR);
3772 printf(
"\t\tError\n");
3773 printf(
"\t\tplease specify your cut criteria\n");
3774 printf(
"\t\tTo cut on sqrt(dEta^2+dPhi^2), use: SwitchOnCutEtaPhiSum()\n");
3775 printf(
"\t\tTo cut on dEta and dPhi separately, use: SwitchOnCutEtaPhiSeparate()\n");
3778 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);
3779 printf(
"\tCluster selection window: dR < %2.0f\n",
fClusterWindow);
3781 printf(
"\tTrack cuts: \n");
3789 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, ESDs.
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)
Bool_t fUseOuterTrackParam
Use OuterTrackParam not InnerTrackParam, ESDs.
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()
Bool_t fUseTrackDCA
Activate use of aodtrack->GetXYZ or XvYxZv like in AliEMCALRecoUtilsBase::ExtrapolateTrackToEMCalSurf...
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)