Skip to content

Commit 51b22c3

Browse files
committed
updated with Vit's suggestions
1 parent 2974d1a commit 51b22c3

File tree

2 files changed

+31
-24
lines changed

2 files changed

+31
-24
lines changed

PWGHF/Core/HfHelper.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -177,16 +177,6 @@ class HfHelper
177177
return candidate.cosThetaStar(std::array{o2::constants::physics::MassD0, o2::constants::physics::MassPiPlus}, o2::constants::physics::MassBPlus, 1);
178178
}
179179

180-
// Z → e+ e- decay
181-
182-
template <typename T>
183-
auto invMassZtoEE(const T& e1, const T& e2)
184-
{
185-
auto arr1 = std::array{e1.px(), e1.py(), e1.pz()};
186-
auto arr2 = std::array{e2.px(), e2.py(), e2.pz()};
187-
return RecoDecay::m(std::array{arr1, arr2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron});
188-
}
189-
190180
// 3-prong
191181

192182
// D± → π± K∓ π±

PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,18 @@ struct HfTaskElectronWeakBoson {
7777

7878
struct HfElectronCandidate {
7979
float pt, eta, phi, energy;
80-
HfElectronCandidate(float p, float e, float ph, float en)
81-
: pt(p), eta(e), phi(ph), energy(en) {}
80+
int charge;
81+
HfElectronCandidate(float p, float e, float ph, float en, int ch)
82+
: pt(p), eta(e), phi(ph), energy(en), charge(ch) {}
8283

8384
float px() const { return pt * std::cos(phi); }
8485
float py() const { return pt * std::sin(phi); }
8586
float pz() const { return pt * std::sinh(eta); }
87+
int sign() const { return charge; }
8688
};
8789
std::vector<HfElectronCandidate> selectedElectronsIso;
8890
std::vector<HfElectronCandidate> selectedElectronsAss;
8991

90-
HfHelper hfHelper;
91-
9292
using SelectedClusters = o2::aod::EMCALClusters;
9393
// PbPb
9494
using TrackEle = o2::soa::Join<o2::aod::Tracks, o2::aod::FullTracks, o2::aod::TracksExtra, o2::aod::TracksDCA, o2::aod::TrackSelection, o2::aod::pidTPCFullEl>;
@@ -163,8 +163,10 @@ struct HfTaskElectronWeakBoson {
163163
registry.add("hEMCtime", "EMC timing", kTH1F, {axisEMCtime});
164164
registry.add("hIsolationEnergy", "Isolation Energy", kTH2F, {{axisE}, {axisIsoEnergy}});
165165
registry.add("hIsolationTrack", "Isolation Track", kTH2F, {{axisE}, {axisIsoTrack}});
166-
registry.add("hInvMassZee", "invariant mass for Z", kTH2F, {{axisPt}, {axisInvMassZ}});
167-
registry.add("hInvMassDy", "invariant mass for DY", kTH2F, {{axisPt}, {axisInvMassDy}});
166+
registry.add("hInvMassZeeLs", "invariant mass for Z LS pair", kTH2F, {{axisPt}, {axisInvMassZ}});
167+
registry.add("hInvMassZeeUls", "invariant mass for Z ULS pair", kTH2F, {{axisPt}, {axisInvMassZ}});
168+
registry.add("hInvMassDyLs", "invariant mass for DY LS pair", kTH2F, {{axisPt}, {axisInvMassDy}});
169+
registry.add("hInvMassDyULs", "invariant mass for DY ULS pair", kTH2F, {{axisPt}, {axisInvMassDy}});
168170
}
169171
bool isIsolatedCluster(const o2::aod::EMCALCluster& cluster,
170172
const SelectedClusters& clusters)
@@ -275,7 +277,8 @@ struct HfTaskElectronWeakBoson {
275277
track.pt(),
276278
track.eta(),
277279
track.phi(),
278-
energyTrk);
280+
energyTrk,
281+
track.sign());
279282
}
280283

281284
// track - match
@@ -355,7 +358,8 @@ struct HfTaskElectronWeakBoson {
355358
match.track_as<TrackEle>().pt(),
356359
match.track_as<TrackEle>().eta(),
357360
match.track_as<TrackEle>().phi(),
358-
energyEmc);
361+
energyEmc,
362+
match.track_as<TrackEle>().sign());
359363
}
360364

361365
if (isIsolatedTr) {
@@ -382,15 +386,28 @@ struct HfTaskElectronWeakBoson {
382386
for (size_t j = 0; j < selectedElectronsAss.size() - 1; ++j) {
383387
const auto& e2 = selectedElectronsAss[j];
384388

385-
if (e1.px() == e2.px())
389+
float ptIso = RecoDecay::pt2(e1.px(), e1.py());
390+
float ptAss = RecoDecay::pt2(e2.px(), e2.py());
391+
if (ptIso == ptAss)
386392
continue;
387-
auto mass = hfHelper.invMassZtoEE(e1, e2);
388-
float ptIso = std::sqrt(e1.px() * e1.px() + e1.py() * e1.py());
389-
float ptAss = std::sqrt(e2.px() * e2.px() + e2.py() * e2.py());
390-
registry.fill(HIST("hInvMassDy"), ptIso, mass);
393+
394+
auto arr1 = std::array{e1.px(), e1.py(), e1.pz()};
395+
auto arr2 = std::array{e2.px(), e2.py(), e2.pz()};
396+
double mass = RecoDecay::m(std::array{arr1, arr2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron});
397+
if (e1.sign() * e2.sign() > 0) {
398+
registry.fill(HIST("hInvMassDyLs"), ptIso, mass);
399+
} else {
400+
registry.fill(HIST("hInvMassDyUls"), ptIso, mass);
401+
}
402+
391403
if (ptAss < 20.0 && ptIso < 20.0)
392404
continue;
393-
registry.fill(HIST("hInvMassZee"), ptIso, mass);
405+
406+
if (e1.sign() * e2.sign() > 0) {
407+
registry.fill(HIST("hInvMassZeeLs"), ptIso, mass);
408+
} else {
409+
registry.fill(HIST("hInvMassZeeUls"), ptIso, mass);
410+
}
394411
}
395412
}
396413
} // end of inv. mass calculation

0 commit comments

Comments
 (0)