Skip to content

Commit 71b5d25

Browse files
sdudi123sandeep dudi
andauthored
[PWGLF] pdg bug is fixed and QA plot added (#12002)
Co-authored-by: sandeep dudi <sandeep.dudi@cern.ch>
1 parent 903d361 commit 71b5d25

File tree

1 file changed

+40
-16
lines changed

1 file changed

+40
-16
lines changed

PWGLF/Tasks/Nuspex/spectraKinkPiKa.cxx

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,12 @@ struct spectraKinkPiKa {
5555
Configurable<float> cutNSigmaPi{"cutNSigmaPi", 4, "NSigmaTPCPion"};
5656
Configurable<float> cutNSigmaKa{"cutNSigmaKa", 4, "NSigmaTPCKaon"};
5757
Configurable<float> rapCut{"rapCut", 0.8, "rapCut"};
58+
Configurable<float> kinkanglecut{"kinkanglecut", 2.0, "kinkanglecut"};
59+
Configurable<float> minradius{"minradius", 1.0, "minradiuscut"};
60+
Configurable<float> maxradius{"maxradius", 200.0, "maxradiuscut"};
5861

5962
Configurable<int> pid{"pidMother", 321, ""};
63+
Configurable<int> dpid{"pidDaughter", 13, ""};
6064
Configurable<bool> d0pid{"dopid", 0, ""};
6165

6266
Preslice<aod::KinkCands> mPerCol = aod::track::collisionId;
@@ -68,10 +72,11 @@ struct spectraKinkPiKa {
6872
const AxisSpec qtAxis{2000, 0, 2, "#it{q}_{T} (GeV/#it{c})"};
6973
const AxisSpec kinkAxis{200, 0, 4, "#theta"};
7074
const AxisSpec etaAxis{200, -5.0, 5.0, "#eta"};
71-
const AxisSpec vertexZAxis{100, -15., 15., "vrtx_{Z} [cm]"};
75+
const AxisSpec vertexAxis{1200, -300., 300., "vrtx [cm]"};
76+
const AxisSpec radiusAxis{600, 0., 300., "vrtx [cm]"};
7277

7378
// Event selection
74-
rEventSelection.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}});
79+
rEventSelection.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexAxis}});
7580

7681
rpiKkink.add("h2_dau_pt_vs_eta_rec", "pt_vs_eta_dau", {HistType::kTH2F, {ptAxis, etaAxis}});
7782
rpiKkink.add("h2_moth_pt_vs_eta_rec", "pt_vs_eta_moth", {HistType::kTH2F, {ptAxis, etaAxis}});
@@ -91,6 +96,11 @@ struct spectraKinkPiKa {
9196
rpiKkink.add("h2_qt_vs_ptpion", "qt_pt", {HistType::kTH2F, {qtAxis, ptAxis}});
9297
rpiKkink.add("h2_kink_angle_pion", "kink angle", {HistType::kTH1F, {kinkAxis}});
9398

99+
// track qa
100+
101+
rpiKkink.add("h2_kinkradius_vs_vz", "kink radius_vz", {HistType::kTH2F, {vertexAxis, radiusAxis}});
102+
rpiKkink.add("h2_kink_vx_vs_vy", "kink vx vs vz ", {HistType::kTH2F, {vertexAxis, vertexAxis}});
103+
94104
if (doprocessMC) {
95105
rpiKkink.add("h2_dau_pt_vs_eta_gen", "pt_vs_eta_dau", {HistType::kTH2F, {ptAxis, etaAxis}});
96106
rpiKkink.add("h2_moth_pt_vs_eta_gen", "pt_vs_eta_moth", {HistType::kTH2F, {ptAxis, etaAxis}});
@@ -113,7 +123,6 @@ struct spectraKinkPiKa {
113123
if (!collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) {
114124
return;
115125
}
116-
117126
rEventSelection.fill(HIST("hVertexZRec"), collision.posZ());
118127
for (const auto& kinkCand : KinkCands) {
119128
auto dauTrack = kinkCand.trackDaug_as<TracksFull>();
@@ -126,15 +135,25 @@ struct spectraKinkPiKa {
126135
if (std::abs(mothTrack.tpcNSigmaPi()) < cutNSigmaPi) {
127136
pion = true;
128137
}
129-
if (!kaon && !pion)
138+
if (!kaon && !pion) {
139+
continue;
140+
}
141+
double radiusxy = std::sqrt(kinkCand.xDecVtx() * kinkCand.xDecVtx() + kinkCand.yDecVtx() * kinkCand.yDecVtx());
142+
if (radiusxy < minradius || radiusxy > maxradius)
130143
continue;
144+
rpiKkink.fill(HIST("h2_kinkradius_vs_vz"), kinkCand.zDecVtx(), radiusxy);
145+
rpiKkink.fill(HIST("h2_kink_vx_vs_vy"), kinkCand.xDecVtx(), kinkCand.yDecVtx());
146+
131147
v0.SetCoordinates(mothTrack.px(), mothTrack.py(), mothTrack.pz(), o2::constants::physics::MassPionCharged);
132148
v1.SetCoordinates(dauTrack.px(), dauTrack.py(), dauTrack.pz(), o2::constants::physics::MassMuon);
133149

134150
float pMoth = v0.P();
135151
float pDaug = v1.P();
136152
float spKink = mothTrack.px() * dauTrack.px() + mothTrack.py() * dauTrack.py() + mothTrack.pz() * dauTrack.pz();
137153
float kinkangle = std::acos(spKink / (pMoth * pDaug));
154+
float radToDeg = o2::constants::math::Rad2Deg;
155+
if (kinkangle * radToDeg < kinkanglecut)
156+
continue;
138157
if (kaon) {
139158
rpiKkink.fill(HIST("h2_moth_pt_vs_eta_rec"), v0.Pt(), v0.Eta());
140159
rpiKkink.fill(HIST("h2_dau_pt_vs_eta_rec"), v1.Pt(), v1.Eta());
@@ -194,6 +213,11 @@ struct spectraKinkPiKa {
194213
}
195214
if (!kaon && !pion)
196215
continue;
216+
double radiusxy = std::sqrt(kinkCand.xDecVtx() * kinkCand.xDecVtx() + kinkCand.yDecVtx() * kinkCand.yDecVtx());
217+
if (radiusxy < minradius || radiusxy > maxradius)
218+
continue;
219+
rpiKkink.fill(HIST("h2_kinkradius_vs_vz"), kinkCand.zDecVtx(), radiusxy);
220+
rpiKkink.fill(HIST("h2_kink_vx_vs_vy"), kinkCand.xDecVtx(), kinkCand.yDecVtx());
197221

198222
v0.SetCoordinates(mothTrack.px(), mothTrack.py(), mothTrack.pz(), o2::constants::physics::MassPionCharged);
199223
v1.SetCoordinates(dauTrack.px(), dauTrack.py(), dauTrack.pz(), o2::constants::physics::MassMuon);
@@ -202,6 +226,9 @@ struct spectraKinkPiKa {
202226
float pDaug = v1.P();
203227
float spKink = mothTrack.px() * dauTrack.px() + mothTrack.py() * dauTrack.py() + mothTrack.pz() * dauTrack.pz();
204228
float kinkangle = std::acos(spKink / (pMoth * pDaug));
229+
float radToDeg = o2::constants::math::Rad2Deg;
230+
if (kinkangle * radToDeg < kinkanglecut)
231+
continue;
205232

206233
rpiKkink.fill(HIST("h2_moth_pt_vs_eta_rec"), v0.Pt(), v0.Eta());
207234
rpiKkink.fill(HIST("h2_dau_pt_vs_eta_rec"), v1.Pt(), v1.Eta());
@@ -228,10 +255,9 @@ struct spectraKinkPiKa {
228255
if (piMother.globalIndex() != mcTrackMoth.globalIndex()) {
229256
continue;
230257
}
231-
if (std::abs(mcTrackMoth.pdgCode()) != pid || std::abs(mcTrackDau.pdgCode()) != kMuonPlus) {
258+
if (std::abs(mcTrackMoth.pdgCode()) != pid || std::abs(mcTrackDau.pdgCode()) != dpid) {
232259
continue;
233260
}
234-
// rpiKkink.fill(HIST("h2MassPtMCRec"), kinkCand.ptMoth(), v1.Pt());
235261
rpiKkink.fill(HIST("h2_qt_rec"), ptd);
236262
}
237263
}
@@ -240,20 +266,19 @@ struct spectraKinkPiKa {
240266
for (const auto& mcPart : particlesMC) {
241267
ROOT::Math::PxPyPzMVector v0;
242268
ROOT::Math::PxPyPzMVector v1;
243-
244269
if (!d0pid && (std::abs(mcPart.pdgCode()) != pid || std::abs(mcPart.y()) > rapCut)) {
245270
continue;
246271
}
247-
if (d0pid && (std::abs(mcPart.pdgCode()) != kD0 || std::abs(mcPart.pdgCode()) != kDPlus || std::abs(mcPart.pdgCode()) != kDStar || std::abs(mcPart.y()) > rapCut)) {
272+
bool isDmeson = std::abs(mcPart.pdgCode()) == kD0 || std::abs(mcPart.pdgCode()) == kDPlus || std::abs(mcPart.pdgCode()) == kDStar;
273+
if (d0pid && (!isDmeson || std::abs(mcPart.y()) > rapCut)) {
248274
continue;
249275
}
250-
251276
if (!mcPart.has_daughters()) {
252277
continue; // Skip if no daughters
253278
}
254279
bool hasKaonpionDaughter = false;
255280
for (const auto& daughter : mcPart.daughters_as<aod::McParticles>()) {
256-
if (std::abs(daughter.pdgCode()) == kMuonPlus) { // muon PDG code
281+
if (std::abs(daughter.pdgCode()) == dpid) { // muon PDG code
257282
hasKaonpionDaughter = true;
258283
v1.SetCoordinates(daughter.px(), daughter.py(), daughter.pz(), o2::constants::physics::MassMuon);
259284
break; // Found a muon daughter, exit loop
@@ -262,28 +287,27 @@ struct spectraKinkPiKa {
262287
if (!hasKaonpionDaughter) {
263288
continue; // Skip if no muon daughter found
264289
}
265-
if (pid == kKPlus) {
290+
if (!d0pid && pid == kKPlus) {
266291
v0.SetCoordinates(mcPart.px(), mcPart.py(), mcPart.pz(), o2::constants::physics::MassKaonCharged);
267292
}
268293

269-
if (pid == kPiPlus) {
294+
if (!d0pid && pid == kPiPlus) {
270295
v0.SetCoordinates(mcPart.px(), mcPart.py(), mcPart.pz(), o2::constants::physics::MassPionCharged);
271296
}
272297
if (d0pid) {
273298
v0.SetCoordinates(mcPart.px(), mcPart.py(), mcPart.pz(), o2::constants::physics::MassD0);
274299
}
275-
276300
float pMoth = v0.P();
277301
float pDaug = v1.P();
278302
float spKink = v0.Px() * v1.Px() + v0.Py() * v1.Py() + v0.Pz() * v1.Pz();
279303
float kinkangle = std::acos(spKink / (pMoth * pDaug));
280-
281-
// std::cout<< kinkCand.ptMoth()<<" check "<<v0.Pt()<<std::endl;
304+
float radToDeg = o2::constants::math::Rad2Deg;
305+
if (kinkangle * radToDeg < kinkanglecut)
306+
continue;
282307
rpiKkink.fill(HIST("h2_moth_pt_vs_eta_gen"), v0.Pt(), v0.Eta());
283308
rpiKkink.fill(HIST("h2_dau_pt_vs_eta_gen"), v1.Pt(), v1.Eta());
284309
rpiKkink.fill(HIST("h2_pt_moth_vs_dau_gen"), v0.Pt(), v1.Pt());
285310
rpiKkink.fill(HIST("h2_kink_angle_gen"), kinkangle);
286-
287311
TVector3 pdlab(v1.Px(), v1.Py(), v1.Pz());
288312
// Compute transverse component
289313
TVector3 motherDir(v0.Px(), v0.Py(), v0.Pz());

0 commit comments

Comments
 (0)