11 #include "AliVTrack.h"
29 fHistMatchEtaPhiAll(0),
30 fHistMatchEtaPhiAllTr(0),
31 fHistMatchEtaPhiAllCl(0),
33 fHistNclusMatchvsCent(0),
38 fHistNClusMatchCent(0)
41 AliDebug(3, Form(
"%s", __PRETTY_FUNCTION__));
43 for(
Int_t i=0; i<8; i++) {
59 for(
Int_t j=0; j<4; j++)
63 for(
Int_t j=0; j<9; j++) {
64 for(
Int_t k=0; k<2; k++)
80 AliDebug(3, Form(
"%s", __PRETTY_FUNCTION__));
99 AliDebug(3, Form(
"%s", __PRETTY_FUNCTION__));
118 for(
Int_t icent=0; icent<nCentChBins; ++icent) {
119 for(
Int_t ipt=0; ipt<9; ++ipt) {
120 for(
Int_t ieta=0; ieta<2; ++ieta) {
121 name = Form(
"fHistMatchEtaPhi_%i_%i_%i",icent,ipt,ieta);
129 name = Form(
"fHistEsubPch_%i",icent);
130 temp = Form(
"%s (Nmatches==1)",name.Data());
132 fHistEsubPch[icent]->SetXTitle(
"#sum p (GeV) weighted with E_{sub}");
133 fOutput->Add(fHistEsubPch[icent]);
135 name = Form(
"fHistEsubPchRat_%i",icent);
136 temp = Form(
"%s (Nmatches==1)",name.Data());
138 fHistEsubPchRat[icent]->SetXTitle(
"#Sigma p (GeV)");
139 fHistEsubPchRat[icent]->SetYTitle(
"E_{sub} / #sum p");
140 fOutput->Add(fHistEsubPchRat[icent]);
142 name = Form(
"fHistEsubPchRatAll_%i",icent);
143 temp = Form(
"%s (all Nmatches)",name.Data());
145 fHistEsubPchRatAll[icent]->SetXTitle(
"#Sigma p (GeV)");
146 fHistEsubPchRatAll[icent]->SetYTitle(
"E_{sub} / #sum p");
147 fOutput->Add(fHistEsubPchRatAll[icent]);
150 for(
Int_t itrk=0; itrk<4; ++itrk) {
151 name = Form(
"fHistNCellsEnergy_%i_%i",icent,itrk);
152 temp = Form(
"%s (Nmatches==%d);N_{cells};E_{clus} (GeV)",name.Data(),itrk);
154 fOutput->Add(fHistNCellsEnergy[icent][itrk]);
157 name = Form(
"fHistMatchEvsP_%i",icent);
158 temp = Form(
"%s (all Nmatches)",name.Data());
160 fHistMatchEvsP[icent]->SetXTitle(
"E_{clus} (GeV)");
161 fHistMatchEvsP[icent]->SetYTitle(
"E_{clus} / #sum p");
162 fOutput->Add(fHistMatchEvsP[icent]);
164 name = Form(
"fHistMatchdRvsEP_%i",icent);
165 temp = Form(
"%s (all Nmatches)",name.Data());
167 fHistMatchdRvsEP[icent]->SetXTitle(
"#Delta R between track and cluster");
168 fHistMatchdRvsEP[icent]->SetYTitle(
"E_{clus} / p");
169 fOutput->Add(fHistMatchdRvsEP[icent]);
171 name = Form(
"fHistNMatchEnergy_%i",icent);
179 fHistNclusvsCent =
new TH1F(
"Nclusvscent",
"NclusVsCent; Cent (%)", 100, 0, 100);
180 fHistNclusMatchvsCent =
new TH1F(
"NclusMatchvscent",
"NclusMatchVsCent (all Nmatches); Cent (%)", 100, 0, 100);
181 fHistEbefore =
new TH1F(
"Ebefore",
"Ebefore; Cent (%); E_{clus} (GeV)", 100, 0, 100);
182 fHistEafter =
new TH1F(
"Eafter",
"Eafter; Cent (%); E_{clus} (GeV)", 100, 0, 100);
184 fHistNMatchCent =
new TH2F(
"NMatchesCent",
"NMatchesCent; Cent (%); Nmatches", 100, 0, 100, 11, -0.5, 10.5);
185 fHistNClusMatchCent =
new TH2F(
"NClusMatchesCent",
"NClusMatchesCent; Cent (%); Nmatches", 100, 0, 100, 11, -0.5, 10.5);
197 name = Form(
"fHistEmbTrackMatchesOversub_%d",icent);
203 name = Form(
"fHistNonEmbTrackMatchesOversub_%d",icent);
209 name = Form(
"fHistOversubMCClusters_%d",icent);
215 name = Form(
"fHistOversubNonMCClusters_%d",icent);
221 name = Form(
"fHistOversub_%d",icent);
223 fHistOversub[icent]->GetXaxis()->SetTitle(
"E_{clus}^{raw} (GeV)");
224 fHistOversub[icent]->GetYaxis()->SetTitle(
"E_{oversub} / E_{clus}^{raw}");
235 AliDebug(3, Form(
"%s", __PRETTY_FUNCTION__));
242 AliVCluster *cluster = 0;
262 energyclus = cluster->GetNonLinCorrEnergy();
265 if (energyclus < 0) energyclus = 0;
267 cluster->SetHadCorrEnergy(energyclus);
284 else if (p>=0.5 && p<1.0)
286 else if (p>=1.0 && p<1.5)
288 else if (p>=1.5 && p<2.)
290 else if (p>=2. && p<3.)
292 else if (p>=3. && p<4.)
294 else if (p>=4. && p<5.)
296 else if (p>=5. && p<8.)
309 Double_t EtaSigma[9]={0.0097,0.0075,0.0059,0.0055,0.0053,0.005,0.005,0.0045,0.0042};
310 return 2.0*EtaSigma[pbin];
328 return PhiMean[pbin];
329 }
else if (centbin==1) {
339 return PhiMean[pbin];
340 }
else if (centbin==2) {
350 return PhiMean[pbin];
351 }
else if (centbin==3) {
361 return PhiMean[pbin];
362 }
else if (centbin==4) {
372 return PhiMean[pbin]*(-1.);
373 }
else if (centbin==5) {
383 return PhiMean[pbin]*(-1.);
384 }
else if (centbin==6) {
394 return PhiMean[pbin]*(-1.);
395 }
else if (centbin==7) {
405 return PhiMean[pbin]*(-1.);
426 return 2.*PhiSigma[pbin];
427 }
else if (centbin==1) {
437 return 2.*PhiSigma[pbin];
438 }
else if (centbin==2) {
448 return 2.*PhiSigma[pbin];
449 }
else if (centbin==3) {
459 return 2.*PhiSigma[pbin];
460 }
else if (centbin==4) {
470 return 2.*PhiSigma[pbin];
471 }
else if (centbin==5) {
481 return 2.*PhiSigma[pbin];
482 }
else if (centbin==6) {
492 return 2.*PhiSigma[pbin];
493 }
else if (centbin==7) {
503 return 2.*PhiSigma[pbin];
517 if (!cluster)
return;
520 Int_t Ntrks = Ntrks = cluster->GetNTracksMatched();
521 for (
Int_t i = 0; i < Ntrks; ++i) {
522 AliVTrack* track = 0;
525 Int_t itrack = cluster->GetTrackMatchedIndex(i);
529 track =
static_cast<AliVTrack*
>(cluster->GetTrackMatched(i));
530 UInt_t rejectionReason = 0;
534 if (!track)
continue;
542 if (
fDoTrackClus && (track->GetEMCALcluster() != icluster))
continue;
548 if (track->Charge() < 0) centbinch +=
fNcentBins;
552 if (track->Eta() > 0) etabin=1;
577 if ((phidiff < phiCuthi && phidiff > phiCutlo) && TMath::Abs(etadiff) < etaCut) {
590 Double_t dR = TMath::Sqrt(dphi*dphi + deta*deta);
591 Double_t energyclus = cluster->GetNonLinCorrEnergy();
598 if (totalTrkP > 0) trkPMCfrac /= totalTrkP;
608 Double_t energyclus = cluster->GetNonLinCorrEnergy();
610 AliVTrack* track = 0;
612 if (cluster->GetNTracksMatched() > 0) {
614 Int_t itrack = cluster->GetTrackMatchedIndex(0);
618 track =
static_cast<AliVTrack*
>(cluster->GetTrackMatched(0));
619 UInt_t rejectionReason = 0;
624 if (!track || track->P() < 1e-6)
return energyclus;
635 Int_t cid = track->GetEMCALcluster();
636 if (
fDoTrackClus && (cid != icluster))
return energyclus;
640 if (track->Charge() < 0) centbinch +=
fNcentBins;
645 if(track->Eta() > 0) etabin = 1;
654 Double_t dRmin = TMath::Sqrt(etadiff*etadiff + phidiff*phidiff);
681 if ((dPhiMin < phiCuthi && dPhiMin > phiCutlo) && TMath::Abs(dEtaMin) < etaCut) {
682 energyclus -= hadCorr * mom;
695 Double_t energyclus = cluster->GetNonLinCorrEnergy();
696 Double_t cNcells = cluster->GetNCells();
702 Int_t NMCmatches = 0;
707 Double_t Esub = hadCorr * totalTrkP;
709 if (Esub > energyclus) Esub = energyclus;
714 if (energyclus < clusEexcl) clusEexcl = energyclus;
715 if ((energyclus - Esub) < clusEexcl) Esub = (energyclus - clusEexcl);
727 EsubMC = hadCorr * totalTrkP * trkPMCfrac;
728 EsubBkg = hadCorr * totalTrkP - EsubMC;
729 EclusMC = energyclus * cluster->GetMCEnergyFraction();
730 EclusBkg = energyclus - EclusMC;
732 if (energyclus > Esub)
733 EclusCorr = energyclus - Esub;
735 if (EclusMC > EsubMC)
736 EclusMCcorr = EclusMC - EsubMC;
738 if (EclusBkg > EsubBkg)
739 EclusBkgcorr = EclusBkg - EsubBkg;
741 overSub = EclusMCcorr + EclusBkgcorr - EclusCorr;
759 Double_t EoP = energyclus / totalTrkP;
766 AliVTrack* track = 0;
768 Int_t itrack = cluster->GetTrackMatchedIndex(0);
772 track =
static_cast<AliVTrack*
>(cluster->GetTrackMatched(0));
773 UInt_t rejectionReason = 0;
778 if (track->Charge() < 0) centbinchm +=
fNcentBins;
787 if (cluster->GetMCEnergyFraction() > 0.95)
789 else if (cluster->GetMCEnergyFraction() < 0.05)
792 if (trkPMCfrac < 0.05)
794 else if (trkPMCfrac > 0.95)
802 if (EclusBkgcorr + EclusMCcorr > 0) {
803 Double_t newfrac = EclusMCcorr / (EclusBkgcorr + EclusMCcorr);
804 cluster->SetMCEnergyFraction(newfrac);
Int_t fNcentBins
how many centrality bins (this member copied from AliAnalysisTaskEmcal)
Bool_t fEsdMode
flag for ESD
TH2 * fHistEsubPchRatAll[8]
!Esub/momentum of matched tracks vs. total momentum of matched tracks (all number of matches) ...
Double_t fHadCorr
hadronic correction (fraction)
TH2 * fHistMatchdRvsEP[4]
!matching distance vs. E/P
TH2 * fHistNCellsEnergy[4][4]
!n cells vs. cluster energy
TH2 * fHistMatchEtaPhiAll
!deta vs. dphi of matched cluster-track pairs
static RegisterCorrectionComponent< AliEmcalCorrectionClusterHadronicCorrection > reg
virtual void UserCreateOutputObjects()
TH2 * fHistOversubNonMCClusters[4]
!Over-subtracted energy / cluster energy (cluster MC energy fraction < 5%)
TH2 * fHistOversub[4]
!Over-subtracted energy / cluster energy
Int_t fCentBin
!event centrality bin
TH2 * fHistMatchEvsP[4]
!cluster energy vs. track momentum of matched pairs
Double_t fEtaMatch
eta match value (pp=0.025)
Double_t ApplyHadCorrOneTrack(Int_t icluster, Double_t hadCorr)
TH2 * fHistEsubPchRat[8]
!Esub/momentum of matched tracks vs. total momentum of matched tracks (only 1 match) ...
TH1 * fHistEafter
!average energy of clusters after correction vs. centrality
AliClusterContainer * fClusCont
pointer to the cluster container
Double_t ApplyHadCorrAllTracks(Int_t icluster, Double_t hadCorr)
Bool_t fDoExact
do exact correction (embedding only)
Base class for correction components in the EMCal correction framework.
Double_t fEexclCell
energy/cell that we cannot subtract from the clusters
TH2 * fHistNMatchCent
!n matches vs. centraity
Int_t fMinMCLabel
minimum MC label value for the tracks/clusters being considered MC particles
virtual AliVParticle * GetAcceptParticle(Int_t i=-1) const
TH2 * fHistEoPCent
!E/P vs. centrality
Double_t fPhiMatch
phi match value (pp=0.050)
virtual Bool_t AcceptParticle(const AliVParticle *vp, UInt_t &rejectionReason) const
AliEmcalCorrectionClusterHadronicCorrection()
TH2 * fHistNMatchEnergy[4]
!n matches vs. cluster energy
TH2 * fHistNonEmbTrackMatchesOversub[4]
!Over-subtracted energy / cluster energy with non-embedded track matches (embedded matches < 5%) ...
AliVCluster * GetCluster(Int_t i) const
Double_t GetPhiSigma(Int_t pbin, Int_t centbin) const
Double_t fMaxBinPt
max pt in histograms
TList * fOutput
! list of output histograms
Bool_t fCreateHisto
flag to make some basic histograms
Hadronic correction component in the EMCal correction framework.Charged particles deposit some energy...
TH1 * fHistEbefore
!average energy of clusters before correction vs. centrality
Double_t GetEtaSigma(Int_t pbin) const
Double_t fCent
!event centrality
TH2 * fHistMatchEtaPhi[8][9][2]
!deta vs. dphi of matched cluster-track pairs
virtual Bool_t Initialize()
void DoMatchedTracksLoop(Int_t icluster, Double_t &totalTrkP, Int_t &Nmatches, Double_t &trkPMCfrac, Int_t &NMCmatches)
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
Double_t fMinBinPt
min pt in histograms
TH2 * fHistEmbTrackMatchesOversub[4]
!Over-subtracted energy / cluster energy with embedded track matches (non-embedded matches < 5%) ...
TH1 * fHistNclusMatchvsCent
!n clusters matched to some track vs. centrality
void GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
Bool_t fDoTrackClus
loop over tracks first
TH2 * fHistMatchEtaPhiAllTr
!deta vs. dphi of all cluster-track pairs (tr loop)
TH1 * fHistEsubPch[8]
!Esub vs. total momentum of matched tracks (only 1 match)
Int_t fNbins
no. of pt bins
TH2 * fHistOversubMCClusters[4]
!Over-subtracted energy / cluster energy (cluster MC energy fraction > 95%)
AliParticleContainer * fPartCont
pointer to the track/particle container
AliVCluster * GetNextAcceptCluster()
void UserCreateOutputObjects()
UInt_t GetMomBin(Double_t pt) const
TH1 * fHistNclusvsCent
!n clusters vs. centrality
TH2 * fHistMatchEtaPhiAllCl
!deta vs. dphi of all cluster-track pairs (cl loop)
virtual ~AliEmcalCorrectionClusterHadronicCorrection()
Double_t GetPhiMean(Int_t pbin, Int_t centbin) const
TH2 * fHistNClusMatchCent
!n clusters macthed to some track (tracks allowed to match more than one cluster) ...
bool GetProperty(std::string propertyName, T &property, bool requiredProperty=true, std::string correctionName="")
Retrieve property.
Bool_t fIsEmbedded
trigger, embedded signal