[PWGHF/HFL] Calculate mass of Zee#10153
Conversation
| struct HfElectronCandidate { | ||
| float pt, eta, phi, energy; | ||
| ElectronCandidate(float p, float e, float ph, float en) | ||
| : pt(p), eta(e), phi(ph), energy(en) {} | ||
|
|
||
| // 運動量成分を計算する関数を追加 | ||
| float px() const { return pt * std::cos(phi); } | ||
| float py() const { return pt * std::sin(phi); } | ||
| float pz() const { return pt * std::sinh(eta); } | ||
| }; | ||
| std::vector<HfElectronCandidate> selectedElectronsIso; | ||
| std::vector<HfElectronCandidate> selectedElectronsAss; | ||
|
|
||
| HfHelper hfHelper; | ||
|
|
There was a problem hiding this comment.
This seems completely unnecessary if you just use std::array for the momenta and RecoDecay methods.
| auto mass = hfHelper.invMassZtoEE(e1, e2); | ||
| float ptIso = std::sqrt(e1.px() * e1.px() + e1.py() * e1.py()); | ||
| float ptAss = std::sqrt(e2.px() * e2.px() + e2.py() * e2.py()); |
There was a problem hiding this comment.
This can be simplified with RecoDecay methods.
|
Doesn't compile. Converted to draft until fixed. @sashingo Please open for review only after local tests. |
|
Error while checking build/O2Physics/o2 for f0b4201 at 2025-02-24 17:15: Full log here. |
|
Hi Vit, thank you for the suggestions. |
Thanks @sashingo . What do you mean by "the std::array is statistics"? |
| for (size_t i = 0; i < selectedElectronsIso.size() - 1; ++i) { | ||
| const auto& e1 = selectedElectronsIso[i]; | ||
| for (size_t j = 0; j < selectedElectronsAss.size() - 1; ++j) { | ||
| const auto& e2 = selectedElectronsAss[j]; |
There was a problem hiding this comment.
Why do you skip the last element?
Why do you not use a range-based loop?
| HfElectronCandidate(float p, float e, float ph, float en, int ch) | ||
| : pt(p), eta(e), phi(ph), energy(en), charge(ch) {} |
| float px() const { return pt * std::cos(phi); } | ||
| float py() const { return pt * std::sin(phi); } | ||
| float pz() const { return pt * std::sinh(eta); } | ||
| int sign() const { return charge; } |
There was a problem hiding this comment.
These methods are useless.
|
Hi Vit or HFCL convener, |
|
Hi Vit, |
No description provided.