Skip to content

Commit f8cb4eb

Browse files
author
Cristian Moscatelli
committed
Add-constrain-angle-function
1 parent ddd25c4 commit f8cb4eb

File tree

1 file changed

+8
-23
lines changed

1 file changed

+8
-23
lines changed

PWGLF/Tasks/Nuspex/DeuteronInJetsTrgPt.cxx

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111
//
12-
// Task for analysing (anti)deuteron production in jets using pT-triggered data - update: 04-02-2026
12+
// Task for analysing (anti)deuteron production in jets using pT-triggered data - update: 05-02-2026
1313
//
1414
// Executable : o2-analysis-lf-deuteron-in-jet-trg-pt
1515

1616
#include "PWGJE/Core/JetBkgSubUtils.h"
1717
#include "PWGJE/Core/JetUtilities.h"
1818

19+
#include "Common/Core/RecoDecay.h"
1920
#include "Common/Core/TrackSelection.h"
2021
#include "Common/Core/Zorro.h"
2122
#include "Common/Core/ZorroSummary.h"
@@ -256,25 +257,9 @@ struct DeuteronInJetsTrgPt {
256257
u2.SetXYZ(u2x, u2y, pz);
257258
}
258259

259-
// Compute delta phi
260-
double getDeltaPhi(double a1, double a2)
261-
{
262-
double deltaPhi(0);
263-
double phi1 = TVector2::Phi_0_2pi(a1);
264-
double phi2 = TVector2::Phi_0_2pi(a2);
265-
double diff = std::fabs(phi1 - phi2);
266-
267-
if (diff <= PI)
268-
deltaPhi = diff;
269-
if (diff > PI)
270-
deltaPhi = TwoPI - diff;
271-
272-
return deltaPhi;
273-
}
274-
275-
// Find ITS hit
260+
// Find hit on ITS layer
276261
template <typename TrackIts>
277-
bool hasITShit(const TrackIts& track, int layer)
262+
bool hasHitITS(const TrackIts& track, int layer)
278263
{
279264
int ibit = layer - 1;
280265
return (track.itsClusterMap() & (1 << ibit));
@@ -305,7 +290,7 @@ struct DeuteronInJetsTrgPt {
305290
// Part relative to ITS
306291
if (!track.hasITS())
307292
return false;
308-
if ((!hasITShit(track, 1)) && (!hasITShit(track, 2)) && (!hasITShit(track, 3)))
293+
if ((!hasHitITS(track, 1)) && (!hasHitITS(track, 2)) && (!hasHitITS(track, 3)))
309294
return false; // Has Inner Barrel hit
310295
if (track.itsChi2NCl() >= MaxChi2Its)
311296
return false;
@@ -334,7 +319,7 @@ struct DeuteronInJetsTrgPt {
334319
// Part relative to ITS
335320
if (!track.hasITS())
336321
return false; // Flag to check if track has a ITS match
337-
if ((!hasITShit(track, 1)) && (!hasITShit(track, 2)) && (!hasITShit(track, 3)))
322+
if ((!hasHitITS(track, 1)) && (!hasHitITS(track, 2)) && (!hasHitITS(track, 3)))
338323
return false; // Require IB hit
339324
if (track.itsNCls() < cfgTrackCut.ITSnClusMin)
340325
return false; // Minimum number of ITS cluster
@@ -498,10 +483,10 @@ struct DeuteronInJetsTrgPt {
498483

499484
// Calculate the angular distance between the track and the UE axes in eta-phi space
500485
double deltaEtaUe1 = track.eta() - ueAxis1.Eta();
501-
double deltaPhiUe1 = getDeltaPhi(track.phi(), ueAxis1.Phi());
486+
double deltaPhiUe1 = std::fabs(RecoDecay::constrainAngle(track.phi() - ueAxis1.Phi(), -PI));
502487
double deltaRUe1 = std::sqrt(deltaEtaUe1 * deltaEtaUe1 + deltaPhiUe1 * deltaPhiUe1);
503488
double deltaEtaUe2 = track.eta() - ueAxis2.Eta();
504-
double deltaPhiUe2 = getDeltaPhi(track.phi(), ueAxis2.Phi());
489+
double deltaPhiUe2 = std::fabs(RecoDecay::constrainAngle(track.phi() - ueAxis2.Phi(), -PI));
505490
double deltaRUe2 = std::sqrt(deltaEtaUe2 * deltaEtaUe2 + deltaPhiUe2 * deltaPhiUe2);
506491

507492
double maxConeRadius = coneRadius;

0 commit comments

Comments
 (0)