Skip to content

Commit 462e17f

Browse files
authored
[PWGEM/Dilepton] update prefiter task and phiv sorted by pT (#8748)
1 parent a0b82ce commit 462e17f

File tree

13 files changed

+187
-370
lines changed

13 files changed

+187
-370
lines changed

PWGEM/Dilepton/Core/DielectronCut.cxx

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// or submit itself to any jurisdiction.
1111

1212
//
13-
// Class for dilepton Cut
13+
// Class for dielectron Cut
1414
//
1515

1616
#include <utility>
@@ -54,18 +54,12 @@ void DielectronCut::SetPairOpAng(float minOpAng, float maxOpAng)
5454
mMaxOpAng = maxOpAng;
5555
LOG(info) << "Dielectron Cut, set pair opening angle range: " << mMinOpAng << " - " << mMaxOpAng;
5656
}
57-
void DielectronCut::SetMaxPhivPairMeeDep(std::function<float(float)> meeDepCut)
58-
{
59-
mMaxPhivPairMeeDep = meeDepCut;
60-
LOG(info) << "Dielectron Cut, set max phiv pair mee dep: " << mMaxPhivPairMeeDep(0.02);
61-
}
62-
void DielectronCut::SetPhivPairRange(float min_phiv, float max_phiv, float min_mee, float max_mee)
57+
void DielectronCut::SetMaxMeePhiVDep(std::function<float(float)> phivDepCut, float min_phiv, float max_phiv)
6358
{
59+
mMaxMeePhiVDep = phivDepCut;
6460
mMinPhivPair = min_phiv;
6561
mMaxPhivPair = max_phiv;
66-
mMinMeeForPhivPair = min_mee;
67-
mMaxMeeForPhivPair = max_mee;
68-
LOG(info) << "Dielectron Cut, set phiv range: " << mMinPhivPair << " - " << mMaxPhivPair << " and mee range: " << mMinMeeForPhivPair << " - " << mMaxMeeForPhivPair;
62+
LOG(info) << "Dielectron Cut, set max mee phiv dep: " << mMaxMeePhiVDep(2.5);
6963
}
7064
void DielectronCut::SelectPhotonConversion(bool flag)
7165
{
@@ -84,21 +78,6 @@ void DielectronCut::SetRequireDifferentSides(bool flag)
8478
mRequireDiffSides = flag;
8579
LOG(info) << "Dielectron Cut, require 2 tracks to be from different sides: " << mRequireDiffSides;
8680
}
87-
void DielectronCut::SetPrefilterPhiV(float max_mee_uls, float max_phiv_uls, float max_mee_ls, float max_phiv_ls)
88-
{
89-
mMaxMee_phiv_uls = max_mee_uls;
90-
mMaxPhiV_uls = max_phiv_uls;
91-
mSlope_phiv_ls = max_mee_ls / (M_PI - max_phiv_ls);
92-
mIntercept_phiv_ls = max_mee_ls - mSlope_phiv_ls * M_PI;
93-
LOG(info) << "Dielectron Cut, set phiv prefilter ULS: " << " mMaxMee_phiv_uls: " << mMaxMee_phiv_uls << " mMaxPhiV_uls: " << mMaxPhiV_uls;
94-
LOG(info) << "Dielectron Cut, set phiv prefilter LS: " << " mSlope_phiv_ls: " << mSlope_phiv_ls << " mIntercept_phiv_ls: " << mIntercept_phiv_ls;
95-
}
96-
void DielectronCut::SetPrefilterMee(float min_mee_uls, float max_mee_uls)
97-
{
98-
mMinMee_uls = min_mee_uls;
99-
mMaxMee_uls = max_mee_uls;
100-
LOG(info) << "Dielectron Cut, set mee prefilter ULS: " << " mMinMee_uls: " << mMinMee_uls << " mMaxMee_uls: " << mMaxMee_uls;
101-
}
10281
void DielectronCut::SetTrackPtRange(float minPt, float maxPt)
10382
{
10483
mMinTrackPt = minPt;

PWGEM/Dilepton/Core/DielectronCut.h

Lines changed: 6 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,8 @@ class DielectronCut : public TNamed
128128
}
129129

130130
if (mApplyPhiV) {
131-
if (mMaxPhivPairMeeDep) {
132-
if ((phiv < mMinPhivPair || mMaxPhivPairMeeDep(v12.M()) < phiv) ^ mSelectPC) {
133-
return false;
134-
}
135-
} else {
136-
if ((!(mMinPhivPair < phiv && phiv < mMaxPhivPair) && !(mMinMeeForPhivPair < v12.M() && v12.M() < mMaxMeeForPhivPair)) ^ mSelectPC) {
137-
return false;
138-
}
131+
if (((mMinPhivPair < phiv && phiv < mMaxPhivPair) && v12.M() < mMaxMeePhiVDep(phiv)) ^ mSelectPC) {
132+
return false;
139133
}
140134
}
141135

@@ -161,70 +155,6 @@ class DielectronCut : public TNamed
161155
return true;
162156
}
163157

164-
template <typename TTrack1, typename TTrack2>
165-
bool IsSelectedPair_PrefilterULS(TTrack1 const& t1, TTrack2 const& t2, const float bz) const
166-
{
167-
// don't move this function into IsSelectedPair.
168-
if (!IsSelectedPair_PrefilterULS_Mee(t1, t2, bz)) {
169-
return false;
170-
}
171-
if (!IsSelectedPair_PrefilterULS_PhiV(t1, t2, bz)) {
172-
return false;
173-
}
174-
return true;
175-
}
176-
177-
template <typename TTrack1, typename TTrack2>
178-
bool IsSelectedPair_PrefilterULS_Mee(TTrack1 const& t1, TTrack2 const& t2, const float /*bz*/) const
179-
{
180-
// don't move this function into IsSelectedPair.
181-
ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), o2::constants::physics::MassElectron);
182-
ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), o2::constants::physics::MassElectron);
183-
ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;
184-
if (mMinMee_uls < v12.M() && v12.M() < mMaxMee_uls) {
185-
return false;
186-
}
187-
return true;
188-
}
189-
190-
template <typename TTrack1, typename TTrack2>
191-
bool IsSelectedPair_PrefilterULS_PhiV(TTrack1 const& t1, TTrack2 const& t2, const float bz) const
192-
{
193-
// don't move this function into IsSelectedPair.
194-
ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), o2::constants::physics::MassElectron);
195-
ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), o2::constants::physics::MassElectron);
196-
ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;
197-
float phiv = getPhivPair(t1.px(), t1.py(), t1.pz(), t2.px(), t2.py(), t2.pz(), t1.sign(), t2.sign(), bz);
198-
if (v12.M() < mMaxMee_phiv_uls && mMaxPhiV_uls < phiv) {
199-
return false;
200-
}
201-
return true;
202-
}
203-
204-
template <typename TTrack1, typename TTrack2>
205-
bool IsSelectedPair_PrefilterLS(TTrack1 const& t1, TTrack2 const& t2, const float bz) const
206-
{
207-
// don't move this function into IsSelectedPair.
208-
if (!IsSelectedPair_PrefilterLS_PhiV(t1, t2, bz)) {
209-
return false;
210-
}
211-
return true;
212-
}
213-
214-
template <typename TTrack1, typename TTrack2>
215-
bool IsSelectedPair_PrefilterLS_PhiV(TTrack1 const& t1, TTrack2 const& t2, const float bz) const
216-
{
217-
// don't move this function into IsSelectedPair.
218-
ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), o2::constants::physics::MassElectron);
219-
ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), o2::constants::physics::MassElectron);
220-
ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;
221-
float phiv = getPhivPair(t1.px(), t1.py(), t1.pz(), t2.px(), t2.py(), t2.pz(), t1.sign(), t2.sign(), bz);
222-
if (v12.M() < phiv * mSlope_phiv_ls + mIntercept_phiv_ls || v12.M() < (M_PI - phiv) * mSlope_phiv_ls + mIntercept_phiv_ls) {
223-
return false;
224-
}
225-
return true;
226-
}
227-
228158
template <bool dont_require_pteta = false, bool isML = false, typename TTrack, typename TCollision = int>
229159
bool IsSelectedTrack(TTrack const& track, TCollision const& collision = 0) const
230160
{
@@ -472,13 +402,10 @@ class DielectronCut : public TNamed
472402
void SetPairDCARange(float min = 0.f, float max = 1e10f); // 3D DCA in sigma
473403
void SetMeeRange(float min = 0.f, float max = 0.5);
474404
void SetPairOpAng(float minOpAng = 0.f, float maxOpAng = 1e10f);
475-
void SetMaxPhivPairMeeDep(std::function<float(float)> meeDepCut);
476-
void SetPhivPairRange(float min_phiv, float max_phiv, float min_mee, float max_mee);
405+
void SetMaxMeePhiVDep(std::function<float(float)> phivDepCut, float min_phiv, float max_phiv);
477406
void SelectPhotonConversion(bool flag);
478407
void SetMindEtadPhi(bool flag, float min_deta, float min_dphi);
479408
void SetRequireDifferentSides(bool flag);
480-
void SetPrefilterPhiV(float max_mee_uls, float max_phiv_uls, float max_mee_ls, float max_phiv_ls);
481-
void SetPrefilterMee(float min_mee_uls, float max_mee_uls);
482409

483410
void SetTrackPtRange(float minPt = 0.f, float maxPt = 1e10f);
484411
void SetTrackEtaRange(float minEta = -1e10f, float maxEta = 1e10f);
@@ -537,20 +464,14 @@ class DielectronCut : public TNamed
537464
float mMinPairY{-1e10f}, mMaxPairY{1e10f}; // range in rapidity
538465
float mMinPairDCA3D{0.f}, mMaxPairDCA3D{1e10f}; // range in 3D DCA in sigma
539466
float mMinPhivPair{0.f}, mMaxPhivPair{+3.2};
540-
float mMinMeeForPhivPair{0.f}, mMaxMeeForPhivPair{1e10f};
541-
std::function<float(float)> mMaxPhivPairMeeDep{}; // max phiv as a function of mee
542-
bool mSelectPC{false}; // flag to select photon conversion used in mMaxPhivPairMeeDep
543-
bool mApplydEtadPhi{false}; // flag to apply deta, dphi cut between 2 tracks
467+
std::function<float(float)> mMaxMeePhiVDep{}; // max mee as a function of phiv
468+
bool mSelectPC{false}; // flag to select photon conversion used in mMaxPhivPairMeeDep
469+
bool mApplydEtadPhi{false}; // flag to apply deta, dphi cut between 2 tracks
544470
float mMinDeltaEta{0.f};
545471
float mMinDeltaPhi{0.f};
546472
float mMinOpAng{0.f}, mMaxOpAng{1e10f};
547473
bool mRequireDiffSides{false}; // flag to require 2 tracks to be from different sides. (A-C combination). If one wants 2 tracks to be in the same side (A-A or C-C), one can simply use track eta cut.
548474

549-
// only for prefilter
550-
float mMinMee_uls{0.f}, mMaxMee_uls{0.f};
551-
float mMaxMee_phiv_uls{0.f}, mMaxPhiV_uls{0.f}; // rectangle
552-
float mSlope_phiv_ls{0.f}, mIntercept_phiv_ls{0.f}; // mee > phiv * slope + intercept
553-
554475
// kinematic cuts
555476
float mMinTrackPt{0.f}, mMaxTrackPt{1e10f}; // range in pT
556477
float mMinTrackEta{-1e10f}, mMaxTrackEta{1e10f}; // range in eta

0 commit comments

Comments
 (0)