[PWGUD] use get track size and add flowMC#15679
[PWGUD] use get track size and add flowMC#15679miedema-11 wants to merge 5 commits intoAliceO2Group:masterfrom
Conversation
|
O2 linter results: ❌ 1 errors, |
|
Error while checking build/O2Physics/o2 for 4eeefde at 2026-04-08 08:43: Full log here. |
|
@miedema-11 This is a duplicate of #15626. Please do not do that. I made several suggestions on your previous PR which are now completely disconnected from this version and I have to visually compare both versions to see your implementation of my comments. |
PWGUD/Tasks/flowMcUpc.cxx
Outdated
| bool trackSelected(TTrack const& track) | ||
| { | ||
| // auto momentum = std::array<double, 3>{track.px(), track.py(), track.pz()}; | ||
| double pt = track.pt(); |
There was a problem hiding this comment.
Will it be fine if I use auto type here?
PWGUD/Tasks/flowMcUpc.cxx
Outdated
| LorentzVectorM pMC(mcParticle.px(), mcParticle.py(), mcParticle.pz(), 0); // double phi = RecoDecay::phi(momentum); // focus on bulk: e, mu, pi, k, p | ||
| int pdgCode = std::abs(mcParticle.pdgCode()); | ||
| if (pdgCode == PDG_t::kElectron) | ||
| pMC.SetM(o2::constants::physics::MassElectron); | ||
| else if (pdgCode == PDG_t::kMuonMinus) | ||
| pMC.SetM(o2::constants::physics::MassMuon); | ||
| else if (pdgCode == PDG_t::kPiPlus) | ||
| pMC.SetM(o2::constants::physics::MassPionCharged); | ||
| else if (pdgCode == PDG_t::kKPlus) | ||
| pMC.SetM(o2::constants::physics::MassKaonCharged); | ||
| else if (pdgCode == PDG_t::kProton) | ||
| pMC.SetM(o2::constants::physics::MassProton); | ||
| else | ||
| continue; | ||
|
|
||
| double pt = pMC.Pt(); | ||
| double eta = pMC.Eta(); |
There was a problem hiding this comment.
All this is completely useless. Transverse momentum and pseudorapidity do not depend on the mass.
There was a problem hiding this comment.
Hi, you suggested to use the mcparticle.eta(), but it seems that it is not included the table. So I used these codes taking reference from other ud task.
has no member named 'eta'; did you mean 'beta'?
191 | double eta = track.eta();
| ^~~
There was a problem hiding this comment.
Indeed. I got confused by your subscription to McParticles which is not referring to the table in the central data model. My point about mass still holds though.
For the eta calculation, you can just use a RecoDecay method.
A more general improvement would be to add dynamic columns in the UD tables for the missing variables.
PWGUD/Tasks/flowMcUpc.cxx
Outdated
| auto mcParticle = track.udMcParticle(); | ||
| int pdgCode = std::abs(mcParticle.pdgCode()); | ||
| if (pdgCode == PDG_t::kElectron) | ||
| recoMC.SetM(o2::constants::physics::MassElectron); | ||
| else if (pdgCode == PDG_t::kMuonMinus) | ||
| recoMC.SetM(o2::constants::physics::MassMuon); | ||
| else if (pdgCode == PDG_t::kPiPlus) | ||
| recoMC.SetM(o2::constants::physics::MassPionCharged); | ||
| else if (pdgCode == PDG_t::kKPlus) | ||
| recoMC.SetM(o2::constants::physics::MassKaonCharged); | ||
| else if (pdgCode == PDG_t::kProton) | ||
| recoMC.SetM(o2::constants::physics::MassProton); | ||
| else | ||
| continue; | ||
|
|
||
| double pt = recoMC.Pt(); | ||
| double eta = recoMC.Eta(); |
|
Hi @miedema-11, |
Not exactly, I also modify the flowcorrelationupc.cxx, so I open a new one to avoid conflict. And I already corrected the code according to your comment. Maybe I haven't done it correctly? |
PWGUD/Tasks/flowMcUpc.cxx
Outdated
|
|
||
| double epsilon = 1e-6; | ||
|
|
||
| using McParticles = soa::Join<aod::UDMcParticles, aod::UDMcTrackLabels>; |
There was a problem hiding this comment.
This is very misleading. McParticles is a table in the central data model.
No description provided.