Skip to content

Commit 1fa431c

Browse files
authored
[PWGEM/PhotonMeson] fix in pcmQCMC.cxx (#10573)
1 parent bf9dfac commit 1fa431c

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

PWGEM/PhotonMeson/Tasks/pcmQC.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ struct PCMQC {
298298
fRegistry.fill(HIST("V0/hThetaResolution"), v0.p(), getThetaResolution(v0));
299299
fRegistry.fill(HIST("V0/hPhiResolution"), v0.p(), getPhiResolution(v0));
300300

301-
float phi_cp = atan2(v0.vy(), v0.vx());
301+
float phi_cp = std::atan2(v0.vy(), v0.vx());
302302
o2::math_utils::bringTo02Pi(phi_cp);
303303
float eta_cp = std::atanh(v0.vz() / std::sqrt(std::pow(v0.vx(), 2) + std::pow(v0.vy(), 2) + std::pow(v0.vz(), 2)));
304304
fRegistry.fill(HIST("V0/hsConvPoint"), v0.v0radius(), phi_cp, eta_cp);

PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ struct PCMQCMC {
376376
fRegistry.fill(HIST("V0/") + HIST(mcphoton_types[mctype]) + HIST("hXY_MC"), mcleg.vx(), mcleg.vy());
377377
fRegistry.fill(HIST("V0/") + HIST(mcphoton_types[mctype]) + HIST("hRZ_MC"), mcleg.vz(), std::sqrt(std::pow(mcleg.vx(), 2) + std::pow(mcleg.vy(), 2)));
378378

379-
float phi_cp = atan2(v0.vy(), v0.vx());
379+
float phi_cp = std::atan2(v0.vy(), v0.vx());
380380
o2::math_utils::bringTo02Pi(phi_cp);
381381
float eta_cp = std::atanh(v0.vz() / std::sqrt(std::pow(v0.vx(), 2) + std::pow(v0.vy(), 2) + std::pow(v0.vz(), 2)));
382382
fRegistry.fill(HIST("V0/") + HIST(mcphoton_types[mctype]) + HIST("hsConvPoint"), v0.v0radius(), phi_cp, eta_cp);
@@ -490,25 +490,29 @@ struct PCMQCMC {
490490
// LOGF(info, "mcphoton.vx() = %f, mcphoton.vy() = %f, mcphoton.vz() = %f, mother_pdg = %d", mcphoton.vx(), mcphoton.vy(), mcphoton.vz(), mother_pdg);
491491
}
492492
} else if (pi0id > 0) {
493-
auto mcpi0 = mcparticles.iteratorAt(photonid);
493+
auto mcpi0 = mcparticles.iteratorAt(pi0id);
494494
if (cfgRequireTrueAssociation && (mcpi0.emmceventId() != collision.emmceventId())) {
495495
continue;
496496
}
497-
fillV0Info<3>(v0, mcpi0, elemc);
498-
for (auto& leg : {pos, ele}) {
499-
fillV0LegInfo<3>(leg);
497+
if (mcpi0.isPhysicalPrimary() || mcpi0.producedByGenerator()) {
498+
fillV0Info<3>(v0, mcpi0, elemc);
499+
for (auto& leg : {pos, ele}) {
500+
fillV0LegInfo<3>(leg);
501+
}
502+
nee_pi0++;
500503
}
501-
nee_pi0++;
502504
} else if (etaid > 0) {
503-
auto mceta = mcparticles.iteratorAt(photonid);
505+
auto mceta = mcparticles.iteratorAt(etaid);
504506
if (cfgRequireTrueAssociation && (mceta.emmceventId() != collision.emmceventId())) {
505507
continue;
506508
}
507-
fillV0Info<4>(v0, mceta, elemc);
508-
for (auto& leg : {pos, ele}) {
509-
fillV0LegInfo<4>(leg);
509+
if (mceta.isPhysicalPrimary() || mceta.producedByGenerator()) {
510+
fillV0Info<4>(v0, mceta, elemc);
511+
for (auto& leg : {pos, ele}) {
512+
fillV0LegInfo<4>(leg);
513+
}
514+
nee_eta++;
510515
}
511-
nee_eta++;
512516
}
513517
} // end of v0 loop
514518
fRegistry.fill(HIST("V0/primary/hNgamma"), ng_primary);
@@ -573,7 +577,7 @@ struct PCMQCMC {
573577
if (std::abs(mctrack.pdgCode()) == 22 && (mctrack.isPhysicalPrimary() || mctrack.producedByGenerator())) {
574578
auto daughter = mcparticles.iteratorAt(mctrack.daughtersIds()[0]); // choose ele or pos.
575579
float rxy_gen_e = std::sqrt(std::pow(daughter.vx(), 2) + std::pow(daughter.vy(), 2));
576-
float phi_cp = atan2(daughter.vy(), daughter.vx());
580+
float phi_cp = std::atan2(daughter.vy(), daughter.vx());
577581
o2::math_utils::bringTo02Pi(phi_cp);
578582
float eta_cp = std::atanh(daughter.vz() / std::sqrt(std::pow(daughter.vx(), 2) + std::pow(daughter.vy(), 2) + std::pow(daughter.vz(), 2)));
579583

0 commit comments

Comments
 (0)