Skip to content

Commit 13610f9

Browse files
authored
add QA plots for MC + add dca v0-to-pv cut (#5958)
1 parent 6255cbe commit 13610f9

1 file changed

Lines changed: 56 additions & 5 deletions

File tree

PWGLF/Tasks/Nuspex/antidLambdaEbye.cxx

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,19 @@ float etaFromMom(std::array<float, 3> const& momA, std::array<float, 3> const& m
138138
(1.f * momA[2] + 1.f * momB[2]) * (1.f * momA[2] + 1.f * momB[2])) -
139139
(1.f * momA[2] + 1.f * momB[2])));
140140
}
141+
float CalculateDCAStraightToPV(float X, float Y, float Z, float Px, float Py, float Pz, float pvX, float pvY, float pvZ)
142+
{
143+
return std::sqrt((std::pow((pvY - Y) * Pz - (pvZ - Z) * Py, 2) + std::pow((pvX - X) * Pz - (pvZ - Z) * Px, 2) + std::pow((pvX - X) * Py - (pvY - Y) * Px, 2)) / (Px * Px + Py * Py + Pz * Pz));
144+
}
141145
} // namespace
142146

143147
struct CandidateV0 {
144148
float pt;
145149
float eta;
150+
float mass;
151+
float cpa;
152+
float dcav0daugh;
153+
float dcav0pv;
146154
int64_t globalIndexPos = -999;
147155
int64_t globalIndexNeg = -999;
148156
};
@@ -245,8 +253,8 @@ struct antidLambdaEbye {
245253
Configurable<float> tofMassMaxQA{"tofMassMaxQA", 0.6f, "(temporary) tof mass cut (for QA histograms)"};
246254

247255
Configurable<float> v0setting_dcav0dau{"v0setting_dcav0dau", 1, "DCA V0 Daughters"};
248-
Configurable<float> v0setting_dcapostopv{"v0setting_dcapostopv", 0.1f, "DCA Pos To PV"};
249-
Configurable<float> v0setting_dcanegtopv{"v0setting_dcanegtopv", 0.1f, "DCA Neg To PV"};
256+
Configurable<float> v0setting_dcav0pv{"v0setting_dcav0pv", 1, "DCA V0 to Pv"};
257+
Configurable<float> v0setting_dcadaughtopv{"v0setting_dcadaughtopv", 0.1f, "DCA Pos To PV"};
250258
Configurable<double> v0setting_cospa{"v0setting_cospa", 0.98, "V0 CosPA"};
251259
Configurable<float> v0setting_radius{"v0setting_radius", 0.5f, "v0radius"};
252260
Configurable<float> v0setting_lifetime{"v0setting_lifetime", 40.f, "v0 lifetime cut"};
@@ -480,13 +488,26 @@ struct antidLambdaEbye {
480488
// v0 QA
481489
histos.add<TH3>("QA/massLambda", ";Centrality (%);#it{p}_{T} (GeV/#it{c});#it{M}(p + #pi^{-}) (GeV/#it{c}^{2});Entries", HistType::kTH3F, {centAxis, momAxis, massLambdaAxis});
482490
histos.add<TH1>("QA/cosPa", ";cosPa;Entries", HistType::kTH1F, {cosPaAxis});
491+
histos.add<TH1>("QA/cosPaSig", ";cosPa;Entries", HistType::kTH1F, {cosPaAxis});
492+
histos.add<TH1>("QA/cosPaBkg", ";cosPa;Entries", HistType::kTH1F, {cosPaAxis});
493+
histos.add<TH1>("QA/dcaV0daughSig", ";dcaV0daugh;Entries", HistType::kTH1F, {dcaV0daughAxis});
494+
histos.add<TH1>("QA/dcaV0daughBkg", ";dcaV0daugh;Entries", HistType::kTH1F, {dcaV0daughAxis});
495+
histos.add<TH1>("QA/dcaV0PvSig", ";dcaV0Pv;Entries", HistType::kTH1F, {dcaV0daughAxis});
496+
histos.add<TH1>("QA/dcaV0PvBkg", ";dcaV0Pv;Entries", HistType::kTH1F, {dcaV0daughAxis});
497+
histos.add<TH2>("QA/cosPaDcaV0daughSig", ";cosPa;dcaV0daugh", HistType::kTH2F, {cosPaAxis, dcaV0daughAxis});
498+
histos.add<TH2>("QA/cosPaDcaV0daughBkg", ";cosPa;dcaV0daugh", HistType::kTH2F, {cosPaAxis, dcaV0daughAxis});
499+
histos.add<TH3>("QA/massLambdaEvRej", ";Centrality (%);#it{p}_{T} (GeV/#it{c});#it{M}(p + #pi^{-}) (GeV/#it{c}^{2});Entries", HistType::kTH3F, {centAxis, momAxis, massLambdaAxis});
500+
histos.add<TH3>("QA/massLambdaEvRejSig", ";Centrality (%);#it{p}_{T} (GeV/#it{c});#it{M}(p + #pi^{-}) (GeV/#it{c}^{2});Entries", HistType::kTH3F, {centAxis, momAxis, massLambdaAxis});
501+
histos.add<TH3>("QA/massLambdaEvRejBkg", ";Centrality (%);#it{p}_{T} (GeV/#it{c});#it{M}(p + #pi^{-}) (GeV/#it{c}^{2});Entries", HistType::kTH3F, {centAxis, momAxis, massLambdaAxis});
483502
histos.add<TH1>("QA/radius", ";radius;Entries", HistType::kTH1F, {radiusAxis});
484503
histos.add<TH1>("QA/dcaV0daugh", ";dcaV0daugh;Entries", HistType::kTH1F, {dcaV0daughAxis});
504+
histos.add<TH1>("QA/dcaV0Pv", ";dcaV0Pv;Entries", HistType::kTH1F, {dcaV0daughAxis});
485505
histos.add<TH1>("QA/dcaPosPv", ";dcaPosPv;Entries", HistType::kTH1F, {dcaDaughPvAxis});
486506
histos.add<TH1>("QA/dcaNegPv", ";dcaNegPv;Entries", HistType::kTH1F, {dcaDaughPvAxis});
487507
histos.add<TH1>("QA/cosPaBeforeCut", ";cosPa;Entries", HistType::kTH1F, {cosPaAxis});
488508
histos.add<TH1>("QA/radiusBeforeCut", ";radius;Entries", HistType::kTH1F, {radiusAxis});
489509
histos.add<TH1>("QA/dcaV0daughBeforeCut", ";dcaV0daugh;Entries", HistType::kTH1F, {dcaV0daughAxis});
510+
histos.add<TH1>("QA/dcaV0PvBeforeCut", ";dcaV0Pv;Entries", HistType::kTH1F, {dcaV0daughAxis});
490511

491512
// d QA
492513
histos.add<TH2>("QA/dcaPv", ";#it{p}_{T} (GeV/#it{c});dcaPv;Entries", HistType::kTH2F, {momAxis, dcaDaughPvAxis});
@@ -726,6 +747,17 @@ struct antidLambdaEbye {
726747
continue;
727748
}
728749

750+
float dcaV0Pv = CalculateDCAStraightToPV(
751+
vtx[0], vtx[1], vtx[2],
752+
momPos[0] + momNeg[0],
753+
momPos[1] + momNeg[1],
754+
momPos[2] + momNeg[2],
755+
collision.posX(), collision.posY(), collision.posZ());
756+
histos.fill(HIST("QA/dcaV0PvBeforeCut"), dcaV0Pv);
757+
if (std::abs(dcaV0Pv) > v0setting_dcav0pv) {
758+
continue;
759+
}
760+
729761
double cosPA = RecoDecay::cpa(primVtx, vtx, momV0);
730762
histos.fill(HIST("QA/cosPaBeforeCut"), cosPA);
731763
if (cosPA < v0setting_cospa) {
@@ -741,13 +773,13 @@ struct antidLambdaEbye {
741773

742774
o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, posTrackCov, 2.f, fitter.getMatCorrType(), &dcaInfo);
743775
auto posDcaToPv = std::hypot(dcaInfo[0], dcaInfo[1]);
744-
if (posDcaToPv < v0setting_dcapostopv && std::abs(dcaInfo[0]) < v0setting_dcapostopv) {
776+
if (posDcaToPv < v0setting_dcadaughtopv && std::abs(dcaInfo[0]) < v0setting_dcadaughtopv) {
745777
continue;
746778
}
747779

748780
o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, negTrackCov, 2.f, fitter.getMatCorrType(), &dcaInfo);
749781
auto negDcaToPv = std::hypot(dcaInfo[0], dcaInfo[1]);
750-
if (negDcaToPv < v0setting_dcanegtopv && std::abs(dcaInfo[0]) < v0setting_dcanegtopv) {
782+
if (negDcaToPv < v0setting_dcadaughtopv && std::abs(dcaInfo[0]) < v0setting_dcadaughtopv) {
751783
continue;
752784
}
753785

@@ -764,6 +796,7 @@ struct antidLambdaEbye {
764796
histos.fill(HIST("QA/dcaV0daugh"), dcaV0dau);
765797
histos.fill(HIST("QA/dcaPosPv"), posDcaToPv);
766798
histos.fill(HIST("QA/dcaNegPv"), negDcaToPv);
799+
histos.fill(HIST("QA/dcaV0Pv"), dcaV0Pv);
767800

768801
if (matter) {
769802
tempHistos.fill(HIST("tempLambda"), std::abs(etaV0), ptV0);
@@ -777,6 +810,10 @@ struct antidLambdaEbye {
777810
CandidateV0 candV0;
778811
candV0.pt = ptV0;
779812
candV0.eta = etaV0;
813+
candV0.mass = mLambda;
814+
candV0.cpa = cosPA;
815+
candV0.dcav0daugh = dcaV0dau;
816+
candV0.dcav0pv = dcaV0Pv;
780817
candV0.globalIndexPos = posTrack.globalIndex();
781818
candV0.globalIndexNeg = negTrack.globalIndex();
782819
candidateV0s.push_back(candV0);
@@ -795,6 +832,9 @@ struct antidLambdaEbye {
795832
candidateV0s.push_back(candV0);
796833
return -1;
797834
}
835+
for (auto& candidateV0 : candidateV0s) {
836+
histos.fill(HIST("QA/massLambdaEvRej"), centrality, candidateV0.pt, candidateV0.mass);
837+
}
798838

799839
histos.fill(HIST("nEv"), subsample, centrality);
800840

@@ -874,12 +914,23 @@ struct antidLambdaEbye {
874914
continue;
875915
if (!((mcTrackPos.pdgCode() == 2212 && mcTrackNeg.pdgCode() == -211) || (mcTrackPos.pdgCode() == 211 && mcTrackNeg.pdgCode() == -2212)))
876916
continue;
877-
if (std::abs(posMother.pdgCode()) != 3122)
917+
if (std::abs(posMother.pdgCode()) != 3122) {
918+
histos.fill(HIST("QA/cosPaBkg"), candidateV0.cpa);
919+
histos.fill(HIST("QA/dcaV0daughBkg"), candidateV0.dcav0daugh);
920+
histos.fill(HIST("QA/dcaV0PvBkg"), candidateV0.dcav0pv);
921+
histos.fill(HIST("QA/cosPaDcaV0daughBkg"), candidateV0.cpa, candidateV0.dcav0daugh);
922+
histos.fill(HIST("QA/massLambdaEvRejBkg"), centrality, candidateV0.pt, candidateV0.mass);
878923
continue;
924+
}
879925
if (!posMother.isPhysicalPrimary() && !posMother.has_mothers())
880926
continue;
881927
if (((posMother.flags() & 0x8) && doprocessMcRun2) || (posMother.flags() & 0x2) || (posMother.flags() & 0x1))
882928
continue;
929+
histos.fill(HIST("QA/cosPaSig"), candidateV0.cpa);
930+
histos.fill(HIST("QA/dcaV0daughSig"), candidateV0.dcav0daugh);
931+
histos.fill(HIST("QA/dcaV0PvSig"), candidateV0.dcav0pv);
932+
histos.fill(HIST("QA/cosPaDcaV0daughSig"), candidateV0.cpa, candidateV0.dcav0daugh);
933+
histos.fill(HIST("QA/massLambdaEvRejSig"), centrality, candidateV0.pt, candidateV0.mass);
883934
if (posMother.pdgCode() > 0) {
884935
histos.fill(HIST("recL"), centrality, candidateV0.pt, std::abs(candidateV0.eta));
885936
if (fillOnlySignal)

0 commit comments

Comments
 (0)