Skip to content

Commit 74b90fc

Browse files
committed
updated with Vit's suggestions
1 parent 51b22c3 commit 74b90fc

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ struct HfTaskElectronWeakBoson {
8181
HfElectronCandidate(float p, float e, float ph, float en, int ch)
8282
: pt(p), eta(e), phi(ph), energy(en), charge(ch) {}
8383

84-
float px() const { return pt * std::cos(phi); }
85-
float py() const { return pt * std::sin(phi); }
86-
float pz() const { return pt * std::sinh(eta); }
8784
int sign() const { return charge; }
8885
};
8986
std::vector<HfElectronCandidate> selectedElectronsIso;
@@ -381,18 +378,17 @@ struct HfTaskElectronWeakBoson {
381378

382379
// calculate inv. mass
383380
if (selectedElectronsIso.size() > 1) {
384-
for (size_t i = 0; i < selectedElectronsIso.size() - 1; ++i) {
381+
for (size_t i = 0; i < selectedElectronsIso.size(); i++) {
385382
const auto& e1 = selectedElectronsIso[i];
386-
for (size_t j = 0; j < selectedElectronsAss.size() - 1; ++j) {
383+
for (size_t j = 0; j < selectedElectronsAss.size(); j++) {
387384
const auto& e2 = selectedElectronsAss[j];
388385

389-
float ptIso = RecoDecay::pt2(e1.px(), e1.py());
390-
float ptAss = RecoDecay::pt2(e2.px(), e2.py());
386+
float ptIso = e1.pt;
387+
float ptAss = e2.pt;
391388
if (ptIso == ptAss)
392389
continue;
393-
394-
auto arr1 = std::array{e1.px(), e1.py(), e1.pz()};
395-
auto arr2 = std::array{e2.px(), e2.py(), e2.pz()};
390+
auto arr1 = RecoDecayPtEtaPhi::pVector(e1.pt, e1.eta, e1.phi);
391+
auto arr2 = RecoDecayPtEtaPhi::pVector(e2.pt, e2.eta, e2.phi);
396392
double mass = RecoDecay::m(std::array{arr1, arr2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron});
397393
if (e1.sign() * e2.sign() > 0) {
398394
registry.fill(HIST("hInvMassDyLs"), ptIso, mass);

0 commit comments

Comments
 (0)