Skip to content

Commit abefbdc

Browse files
committed
Separate methods for Eta and Eta Plateau Cal.
1 parent 57b4bff commit abefbdc

File tree

1 file changed

+64
-41
lines changed

1 file changed

+64
-41
lines changed

PWGLF/Tasks/Nuspex/piKpRAA.cxx

Lines changed: 64 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ struct PiKpRAA {
165165
// Phi cut
166166
Configurable<bool> applyPhiCut{"applyPhiCut", false, "Apply geometrical cut?"};
167167
Configurable<bool> applyEtaCal{"applyEtaCal", false, "Apply eta calibration?"};
168+
Configurable<bool> applyPlateauSel{"applyPlateauSel", false, "Apply eta calibration?"};
168169
Configurable<bool> usePinPhiSelection{"usePinPhiSelection", true, "Uses Phi selection as a function of P or Pt?"};
169170
Configurable<bool> applyNclSel{"applyNclSel", false, "Apply Min. found Ncl in TPC?"};
170171
} v0Selections;
@@ -262,7 +263,8 @@ struct PiKpRAA {
262263
struct ConfigEtaCalib {
263264
TProfile* pEtaCal = nullptr;
264265
TProfile* pEtaCalPlateau = nullptr;
265-
bool isCalLoaded = false;
266+
bool isMIPCalLoaded = false;
267+
bool isCalPlateauLoaded = false;
266268
} etaCal;
267269

268270
TrackSelection trkSelDaugthers;
@@ -387,6 +389,8 @@ struct PiKpRAA {
387389
registry.add("dEdxVsEtaElMIPV0", "e^{+} + e^{-} (0.4 < #it{p} < 0.6 GeV/#it{c});#eta; dE/dx", kTH2F, {{{axisEta}, {100, 0, 100}}});
388390
registry.add("dEdxVsEtaElMIPV0p", "e^{+} + e^{-} (0.4 < #it{p} < 0.6 GeV/#it{c});#eta; #LTdE/dx#GT", kTProfile, {axisEta});
389391

392+
registry.add("pTVsCent", "", kTH2F, {axisPt, axisCent});
393+
390394
for (int i = 0; i < kNEtaHists; ++i) {
391395
dEdx[i] = registry.add<TH3>(Form("dEdx_%s", endingEta[i]), Form("%s;Momentum (GeV/#it{c});dE/dx;", latexEta[i]), kTH3F, {axisPt, axisdEdx, axisCent});
392396
pTVsP[i] = registry.add<TH2>(Form("pTVsP_%s", endingEta[i]), Form("%s;Momentum (GeV/#it{c});#it{p}_{T} (GeV/#it{c});", latexEta[i]), kTH2F, {axisPt, axisPt});
@@ -450,10 +454,15 @@ struct PiKpRAA {
450454
if (v0Selections.applyEtaCal) {
451455
LOG(info) << "\tLoading Eta Cal!";
452456
LOG(info) << "\tpathEtaCal=" << pathEtaCal.value;
453-
LOG(info) << "\tpathEtaCalPlateau=" << pathEtaCalPlateau.value;
454457
loadEtaCalibration();
455458
}
456459

460+
if (v0Selections.applyPlateauSel) {
461+
LOG(info) << "\tLoading Eta Plateau Cal!";
462+
LOG(info) << "\tpathEtaCalPlateau=" << pathEtaCalPlateau.value;
463+
loadEtaPlateauCalibration();
464+
}
465+
457466
if (v0Selections.applyNclSel)
458467
LOG(info) << "\t minNcl=" << v0Selections.minNcl;
459468
}
@@ -573,7 +582,7 @@ struct PiKpRAA {
573582
continue;
574583
}
575584

576-
if (v0Selections.applyEtaCal) {
585+
if (v0Selections.applyEtaCal && etaCal.isMIPCalLoaded) {
577586
const double dedxCal{etaCal.pEtaCal->GetBinContent(etaCal.pEtaCal->FindBin(eta))};
578587
if (dedxCal > kMindEdxMIP && dedxCal < kMaxdEdxMIP)
579588
dedx *= (50.0 / dedxCal);
@@ -618,6 +627,7 @@ struct PiKpRAA {
618627
pTVsP[indexEta]->Fill(momentum, pt);
619628
nClVsP[indexEta]->Fill(pOrPt, ncl);
620629
nClVsPp[indexEta]->Fill(pOrPt, ncl);
630+
registry.fill(HIST("pTVsCent"), pt, centrality);
621631
registry.fill(HIST("dcaVsPt"), pt, track.dcaXY());
622632
registry.fill(HIST("EtaVsPhi"), eta, track.phi());
623633
registry.fill(HIST("NclVsEta"), eta, nclFound);
@@ -697,15 +707,15 @@ struct PiKpRAA {
697707
if (v0Selections.applyNclSel && !(posNcl >= v0Selections.minNcl && negNcl >= v0Selections.minNcl))
698708
continue;
699709

700-
if (v0Selections.applyEtaCal) {
710+
if (v0Selections.applyEtaCal && etaCal.isMIPCalLoaded) {
701711
const double dedxCal{etaCal.pEtaCal->GetBinContent(etaCal.pEtaCal->FindBin(posTrkEta))};
702712
if (dedxCal > kMindEdxMIP && dedxCal < kMaxdEdxMIP)
703713
posTrkdEdx *= (50.0 / dedxCal);
704714
else
705715
continue;
706716
}
707717

708-
if (v0Selections.applyEtaCal) {
718+
if (v0Selections.applyEtaCal && etaCal.isMIPCalLoaded) {
709719
const double dedxCal{etaCal.pEtaCal->GetBinContent(etaCal.pEtaCal->FindBin(negTrkEta))};
710720
if (dedxCal > kMindEdxMIP && dedxCal < kMaxdEdxMIP)
711721
negTrkdEdx *= (50.0 / dedxCal);
@@ -849,37 +859,41 @@ struct PiKpRAA {
849859
if (v0Selections.applyInvMassSel && dMassK0s > v0Selections.dMassSel && dMassL > v0Selections.dMassSel && dMassAL > v0Selections.dMassSel && dMassG < v0Selections.dMassSel) {
850860
if (passesGammaSelection(collision, v0)) {
851861
if (std::abs(alpha) < v0Selections.armAlphaSel && qT < v0Selections.qTSel) {
852-
const double posDedxCal{etaCal.pEtaCalPlateau->GetBinContent(etaCal.pEtaCalPlateau->FindBin(posTrkEta))};
853-
const double negDedxCal{etaCal.pEtaCalPlateau->GetBinContent(etaCal.pEtaCalPlateau->FindBin(negTrkEta))};
854-
if (std::abs(posTrkdEdx - posDedxCal) < v0Selections.dEdxPlateauSel && std::abs(negTrkdEdx - negDedxCal) < v0Selections.dEdxPlateauSel) {
855-
registry.fill(HIST("V0sCounter"), V0sCounter::Gamma);
856-
registry.fill(HIST("ArmG"), alpha, qT);
857-
registry.fill(HIST("MassGVsPt"), v0.pt(), v0.mGamma());
858-
registry.fill(HIST("nSigElFromG"), negTrkPt, negTrack.tpcNSigmaEl());
859-
registry.fill(HIST("nSigElFromG"), posTrkPt, posTrack.tpcNSigmaEl());
860-
registry.fill(HIST("NclVsEtaElV0"), posTrkEta, posNcl);
861-
registry.fill(HIST("NclVsEtaElV0p"), posTrkEta, posNcl);
862-
registry.fill(HIST("NclVsEtaElV0"), negTrkEta, negNcl);
863-
registry.fill(HIST("NclVsEtaElV0p"), negTrkEta, negNcl);
864-
nClVsPElV0[negIndexEta]->Fill(negPorPt, negNcl);
865-
nClVsPpElV0[negIndexEta]->Fill(negPorPt, negNcl);
866-
nClVsPElV0[posIndexEta]->Fill(posPorPt, posNcl);
867-
nClVsPpElV0[posIndexEta]->Fill(posPorPt, posNcl);
868-
nClVsdEdxElV0[negIndexEta]->Fill(negNcl, negTrkdEdx);
869-
nClVsdEdxpElV0[negIndexEta]->Fill(negNcl, negTrkdEdx);
870-
nClVsdEdxElV0[posIndexEta]->Fill(posNcl, posTrkdEdx);
871-
nClVsdEdxpElV0[posIndexEta]->Fill(posNcl, posTrkdEdx);
872-
if (posTrkP > kMinPMIP && posTrkP < kMaxPMIP) {
873-
registry.fill(HIST("dEdxVsEtaElMIPV0"), posTrkEta, posTrkdEdx);
874-
registry.fill(HIST("dEdxVsEtaElMIPV0p"), posTrkEta, posTrkdEdx);
875-
}
876-
if (negTrkP > kMinPMIP && negTrkP < kMaxPMIP) {
877-
registry.fill(HIST("dEdxVsEtaElMIPV0"), negTrkEta, negTrkdEdx);
878-
registry.fill(HIST("dEdxVsEtaElMIPV0p"), negTrkEta, negTrkdEdx);
879-
}
880-
dEdxElV0[posIndexEta]->Fill(posTrkP, posTrkdEdx, centrality);
881-
dEdxElV0[negIndexEta]->Fill(negTrkP, negTrkdEdx, centrality);
862+
863+
if (v0Selections.applyPlateauSel && etaCal.isCalPlateauLoaded) {
864+
const double posDedxCal{etaCal.pEtaCalPlateau->GetBinContent(etaCal.pEtaCalPlateau->FindBin(posTrkEta))};
865+
const double negDedxCal{etaCal.pEtaCalPlateau->GetBinContent(etaCal.pEtaCalPlateau->FindBin(negTrkEta))};
866+
if (!(std::abs(posTrkdEdx - posDedxCal) < v0Selections.dEdxPlateauSel && std::abs(negTrkdEdx - negDedxCal) < v0Selections.dEdxPlateauSel))
867+
continue;
868+
}
869+
870+
registry.fill(HIST("V0sCounter"), V0sCounter::Gamma);
871+
registry.fill(HIST("ArmG"), alpha, qT);
872+
registry.fill(HIST("MassGVsPt"), v0.pt(), v0.mGamma());
873+
registry.fill(HIST("nSigElFromG"), negTrkPt, negTrack.tpcNSigmaEl());
874+
registry.fill(HIST("nSigElFromG"), posTrkPt, posTrack.tpcNSigmaEl());
875+
registry.fill(HIST("NclVsEtaElV0"), posTrkEta, posNcl);
876+
registry.fill(HIST("NclVsEtaElV0p"), posTrkEta, posNcl);
877+
registry.fill(HIST("NclVsEtaElV0"), negTrkEta, negNcl);
878+
registry.fill(HIST("NclVsEtaElV0p"), negTrkEta, negNcl);
879+
nClVsPElV0[negIndexEta]->Fill(negPorPt, negNcl);
880+
nClVsPpElV0[negIndexEta]->Fill(negPorPt, negNcl);
881+
nClVsPElV0[posIndexEta]->Fill(posPorPt, posNcl);
882+
nClVsPpElV0[posIndexEta]->Fill(posPorPt, posNcl);
883+
nClVsdEdxElV0[negIndexEta]->Fill(negNcl, negTrkdEdx);
884+
nClVsdEdxpElV0[negIndexEta]->Fill(negNcl, negTrkdEdx);
885+
nClVsdEdxElV0[posIndexEta]->Fill(posNcl, posTrkdEdx);
886+
nClVsdEdxpElV0[posIndexEta]->Fill(posNcl, posTrkdEdx);
887+
if (posTrkP > kMinPMIP && posTrkP < kMaxPMIP) {
888+
registry.fill(HIST("dEdxVsEtaElMIPV0"), posTrkEta, posTrkdEdx);
889+
registry.fill(HIST("dEdxVsEtaElMIPV0p"), posTrkEta, posTrkdEdx);
882890
}
891+
if (negTrkP > kMinPMIP && negTrkP < kMaxPMIP) {
892+
registry.fill(HIST("dEdxVsEtaElMIPV0"), negTrkEta, negTrkdEdx);
893+
registry.fill(HIST("dEdxVsEtaElMIPV0p"), negTrkEta, negTrkdEdx);
894+
}
895+
dEdxElV0[posIndexEta]->Fill(posTrkP, posTrkdEdx, centrality);
896+
dEdxElV0[negIndexEta]->Fill(negTrkP, negTrkdEdx, centrality);
883897
}
884898
}
885899
}
@@ -1100,14 +1114,14 @@ struct PiKpRAA {
11001114
bool passesPhiSelection(const float& pt, const float& phi)
11011115
{
11021116

1103-
bool isSelected{false};
1117+
bool isSelected{true};
11041118
if (phiCut.isPhiCutLoaded) {
11051119
const int binLow{phiCut.hPhiCutLow->FindBin(pt)};
11061120
const int binHigh{phiCut.hPhiCutHigh->FindBin(pt)};
11071121
const double phiCutLow{phiCut.hPhiCutLow->GetBinContent(binLow)};
11081122
const double phiCutHigh{phiCut.hPhiCutHigh->GetBinContent(binHigh)};
1109-
if (phi < phiCutLow || phi > phiCutHigh)
1110-
isSelected = true;
1123+
if (phi >= phiCutLow && phi <= phiCutHigh)
1124+
isSelected = false;
11111125
}
11121126
return isSelected;
11131127
}
@@ -1263,16 +1277,25 @@ struct PiKpRAA {
12631277
{
12641278
if (pathEtaCal.value.empty() == false) {
12651279
etaCal.pEtaCal = ccdb->getForTimeStamp<TProfile>(pathEtaCal, ccdbNoLaterThan.value);
1266-
etaCal.pEtaCalPlateau = ccdb->getForTimeStamp<TProfile>(pathEtaCalPlateau, ccdbNoLaterThan.value);
12671280
if (etaCal.pEtaCal == nullptr)
12681281
LOGF(fatal, "Could not load pEtaCal from %s", pathEtaCal.value.c_str());
1282+
}
1283+
1284+
if (etaCal.pEtaCal)
1285+
etaCal.isMIPCalLoaded = true;
1286+
}
1287+
1288+
void loadEtaPlateauCalibration()
1289+
{
1290+
if (pathEtaCalPlateau.value.empty() == false) {
1291+
etaCal.pEtaCalPlateau = ccdb->getForTimeStamp<TProfile>(pathEtaCalPlateau, ccdbNoLaterThan.value);
12691292

12701293
if (etaCal.pEtaCalPlateau == nullptr)
12711294
LOGF(fatal, "Could not load pEtaCalPlateau from %s", pathEtaCalPlateau.value.c_str());
12721295
}
12731296

1274-
if (etaCal.pEtaCal && etaCal.pEtaCalPlateau)
1275-
etaCal.isCalLoaded = true;
1297+
if (etaCal.pEtaCalPlateau)
1298+
etaCal.isCalPlateauLoaded = true;
12761299
}
12771300
};
12781301

0 commit comments

Comments
 (0)