23 fHistMatchEtaPhiAll(0),
24 fHistMatchEtaPhiAllTr(0),
25 fHistMatchEtaPhiAllCl(0),
27 fHistNclusMatchvsCent(0),
32 fHistNClusMatchCent(0)
35 AliDebug(3, Form(
"%s", __PRETTY_FUNCTION__));
37 for(
Int_t i=0; i<8; i++) {
53 for(
Int_t j=0; j<4; j++)
57 for(
Int_t j=0; j<9; j++) {
58 for(
Int_t k=0; k<2; k++)
74 AliDebug(3, Form(
"%s", __PRETTY_FUNCTION__));
88 Double_t clusterNonLinCorrEnergyMin = 0.15;
89 GetProperty(
"clusterNonLinCorrEnergyMin", clusterNonLinCorrEnergyMin);
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}");
237 AliDebug(3, Form(
"%s", __PRETTY_FUNCTION__));
244 AliVCluster *cluster = 0;
264 energyclus = cluster->GetNonLinCorrEnergy();
267 if (energyclus < 0) energyclus = 0;
269 cluster->SetHadCorrEnergy(energyclus);
286 else if (p>=0.5 && p<1.0)
288 else if (p>=1.0 && p<1.5)
290 else if (p>=1.5 && p<2.)
292 else if (p>=2. && p<3.)
294 else if (p>=3. && p<4.)
296 else if (p>=4. && p<5.)
298 else if (p>=5. && p<8.)
311 Double_t EtaSigma[9]={0.0097,0.0075,0.0059,0.0055,0.0053,0.005,0.005,0.0045,0.0042};
312 return 2.0*EtaSigma[pbin];
330 return PhiMean[pbin];
331 }
else if (centbin==1) {
341 return PhiMean[pbin];
342 }
else if (centbin==2) {
352 return PhiMean[pbin];
353 }
else if (centbin==3) {
363 return PhiMean[pbin];
364 }
else if (centbin==4) {
374 return PhiMean[pbin]*(-1.);
375 }
else if (centbin==5) {
385 return PhiMean[pbin]*(-1.);
386 }
else if (centbin==6) {
396 return PhiMean[pbin]*(-1.);
397 }
else if (centbin==7) {
407 return PhiMean[pbin]*(-1.);
428 return 2.*PhiSigma[pbin];
429 }
else if (centbin==1) {
439 return 2.*PhiSigma[pbin];
440 }
else if (centbin==2) {
450 return 2.*PhiSigma[pbin];
451 }
else if (centbin==3) {
461 return 2.*PhiSigma[pbin];
462 }
else if (centbin==4) {
472 return 2.*PhiSigma[pbin];
473 }
else if (centbin==5) {
483 return 2.*PhiSigma[pbin];
484 }
else if (centbin==6) {
494 return 2.*PhiSigma[pbin];
495 }
else if (centbin==7) {
505 return 2.*PhiSigma[pbin];
519 if (!cluster)
return;
522 Int_t Ntrks = Ntrks = cluster->GetNTracksMatched();
523 for (
Int_t i = 0; i < Ntrks; ++i) {
524 AliVTrack* track = 0;
527 Int_t itrack = cluster->GetTrackMatchedIndex(i);
531 track =
static_cast<AliVTrack*
>(cluster->GetTrackMatched(i));
532 UInt_t rejectionReason = 0;
536 if (!track)
continue;
544 if (
fDoTrackClus && (track->GetEMCALcluster() != icluster))
continue;
550 if (track->Charge() < 0) centbinch +=
fNcentBins;
554 if (track->Eta() > 0) etabin=1;
579 if ((phidiff < phiCuthi && phidiff > phiCutlo) && TMath::Abs(etadiff) < etaCut) {
592 Double_t dR = TMath::Sqrt(dphi*dphi + deta*deta);
593 Double_t energyclus = cluster->GetNonLinCorrEnergy();
600 if (totalTrkP > 0) trkPMCfrac /= totalTrkP;
610 Double_t energyclus = cluster->GetNonLinCorrEnergy();
612 AliVTrack* track = 0;
614 if (cluster->GetNTracksMatched() > 0) {
616 Int_t itrack = cluster->GetTrackMatchedIndex(0);
620 track =
static_cast<AliVTrack*
>(cluster->GetTrackMatched(0));
621 UInt_t rejectionReason = 0;
626 if (!track || track->P() < 1e-6)
return energyclus;
637 Int_t cid = track->GetEMCALcluster();
638 if (
fDoTrackClus && (cid != icluster))
return energyclus;
642 if (track->Charge() < 0) centbinch +=
fNcentBins;
647 if(track->Eta() > 0) etabin = 1;
656 Double_t dRmin = TMath::Sqrt(etadiff*etadiff + phidiff*phidiff);
683 if ((dPhiMin < phiCuthi && dPhiMin > phiCutlo) && TMath::Abs(dEtaMin) < etaCut) {
684 energyclus -= hadCorr * mom;
697 Double_t energyclus = cluster->GetNonLinCorrEnergy();
698 Double_t cNcells = cluster->GetNCells();
704 Int_t NMCmatches = 0;
709 Double_t Esub = hadCorr * totalTrkP;
711 if (Esub > energyclus) Esub = energyclus;
716 if (energyclus < clusEexcl) clusEexcl = energyclus;
717 if ((energyclus - Esub) < clusEexcl) Esub = (energyclus - clusEexcl);
729 EsubMC = hadCorr * totalTrkP * trkPMCfrac;
730 EsubBkg = hadCorr * totalTrkP - EsubMC;
731 EclusMC = energyclus * cluster->GetMCEnergyFraction();
732 EclusBkg = energyclus - EclusMC;
734 if (energyclus > Esub)
735 EclusCorr = energyclus - Esub;
737 if (EclusMC > EsubMC)
738 EclusMCcorr = EclusMC - EsubMC;
740 if (EclusBkg > EsubBkg)
741 EclusBkgcorr = EclusBkg - EsubBkg;
743 overSub = EclusMCcorr + EclusBkgcorr - EclusCorr;
761 Double_t EoP = energyclus / totalTrkP;
768 AliVTrack* track = 0;
770 Int_t itrack = cluster->GetTrackMatchedIndex(0);
774 track =
static_cast<AliVTrack*
>(cluster->GetTrackMatched(0));
775 UInt_t rejectionReason = 0;
780 if (track->Charge() < 0) centbinchm +=
fNcentBins;
789 if (cluster->GetMCEnergyFraction() > 0.95)
791 else if (cluster->GetMCEnergyFraction() < 0.05)
794 if (trkPMCfrac < 0.05)
796 else if (trkPMCfrac > 0.95)
804 if (EclusBkgcorr + EclusMCcorr > 0) {
805 Double_t newfrac = EclusMCcorr / (EclusBkgcorr + EclusMCcorr);
806 cluster->SetMCEnergyFraction(newfrac);
Int_t fNcentBins
how many centrality bins (this member copied from AliAnalysisTaskEmcal)
TH2 * fHistEsubPchRatAll[8]
Esub/momentum of matched tracks vs. total momentum of matched tracks (only 1 match) ...
void AddContainer(inputObjectType type)
void SetParticlePtCut(Double_t cut)
TH2 * fHistMatchdRvsEP[4]
n cells vs. cluster energy
TH2 * fHistNCellsEnergy[4][4]
n matches vs. cluster energy
TH2 * fHistMatchEtaPhiAll
deta vs. dphi of matched cluster-track pairs
static RegisterCorrectionComponent< AliEmcalCorrectionClusterHadronicCorrection > reg
TH2 * fHistOversubNonMCClusters[4]
Over-subtracted energy / cluster energy (cluster MC energy fraction > 95%)
TH2 * fHistOversub[4]
Over-subtracted energy / cluster energy (cluster MC energy fraction < 5%)
Int_t fCentBin
!event centrality bin
TH2 * fHistMatchEvsP[4]
deta vs. dphi of all cluster-track pairs (cl loop)
Double_t ApplyHadCorrOneTrack(Int_t icluster, Double_t hadCorr)
TH2 * fHistEsubPchRat[8]
Esub vs. total momentum of matched tracks (only 1 match)
TH1 * fHistEafter
average energy of clusters before correction vs. centrality
AliClusterContainer * fClusCont
! pointer to the cluster container
Double_t ApplyHadCorrAllTracks(Int_t icluster, Double_t hadCorr)
void SetClusNonLinCorrEnergyCut(Double_t cut)
TH2 * fHistNMatchCent
E/P vs. centrality.
Int_t fMinMCLabel
minimum MC label value for the tracks/clusters being considered MC particles
virtual AliVParticle * GetAcceptParticle(Int_t i=-1) const
void GetProperty(std::string propertyName, T &property, bool requiredProperty=true, std::string correctionName="")
Retrieve property.
TH2 * fHistEoPCent
average energy of clusters after correction vs. centrality
virtual Bool_t AcceptParticle(const AliVParticle *vp, UInt_t &rejectionReason) const
AliEmcalCorrectionClusterHadronicCorrection()
TH2 * fHistNMatchEnergy[4]
cluster energy vs. track momentum of matched pairs
TH2 * fHistNonEmbTrackMatchesOversub[4]
Over-subtracted energy / cluster energy with embedded track matches (non-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
TH1 * fHistEbefore
n clusters matched to some track vs. centrality
Double_t GetEtaSigma(Int_t pbin) const
Double_t fCent
!event centrality
TH2 * fHistMatchEtaPhi[8][9][2]
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]
Esub/momentum of matched tracks vs. total momentum of matched tracks (all number of matches) ...
TH1 * fHistNclusMatchvsCent
n clusters vs. centrality
void SetClusPtCut(Double_t cut)
void GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
TH2 * fHistMatchEtaPhiAllTr
deta vs. dphi of matched cluster-track pairs
TH1 * fHistEsubPch[8]
n clusters macthed to some track (tracks allowed to match more than one cluster)
Int_t fNbins
no. of pt bins
void SetClusECut(Double_t cut)
TH2 * fHistOversubMCClusters[4]
Over-subtracted energy / cluster energy with non-embedded track matches (embedded matches < 5%) ...
AliParticleContainer * fPartCont
! pointer to the track/particle container
AliVCluster * GetNextAcceptCluster()
UInt_t GetMomBin(Double_t pt) const
TH1 * fHistNclusvsCent
matching distance vs. E/P
TH2 * fHistMatchEtaPhiAllCl
deta vs. dphi of all cluster-track pairs (tr loop)
virtual ~AliEmcalCorrectionClusterHadronicCorrection()
Double_t GetPhiMean(Int_t pbin, Int_t centbin) const
TH2 * fHistNClusMatchCent
n matches vs. centraity
Bool_t fIsEmbedded
trigger, embedded signal