Skip to content

Commit d07dbbe

Browse files
committed
dPhi fixes
1 parent 3f6b4b7 commit d07dbbe

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

PWGJE/Tasks/jetCorrelationD0.cxx

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ struct JetCorrelationD0 {
201201
registry.fill(HIST("hJetEta"), jet.eta());
202202
registry.fill(HIST("hJetPhi"), jet.phi());
203203
registry.fill(HIST("hJet3D"), jet.pt(), jet.eta(), jet.phi());
204+
registry.fill(HIST("h_Jet_D0_Jet_dPhi"), dPhi);
204205
registry.fill(HIST("h_Jet_pT_D0_Jet_dPhi"), jet.pt(), dPhi);
205206
}
206207

@@ -242,6 +243,7 @@ struct JetCorrelationD0 {
242243
registry.add("hJetEta", "jet #eta;#eta_{jet};entries", HistType::kTH1F, {axisEta});
243244
registry.add("hJetPhi", "jet #phi;#phi_{jet};entries", HistType::kTH1F, {axisPhi});
244245
registry.add("hJet3D", "3D jet distribution;p_{T};#eta;#phi", {HistType::kTH3F, {{500, -100, 400}, {100, -1.0, 1.0}, {100, 0.0, o2::constants::math::TwoPI}}});
246+
registry.add("h_Jet_D0_Jet_dPhi", "#Delta #phi _{D^{0}, jet}", kTH1F, {{100, 0, o2::constants::math::TwoPI}});
245247
registry.add("h_Jet_pT_D0_Jet_dPhi", "p_{T, jet} vs #Delta #phi _{D^{0}, jet}", kTH2F, {{100, 0, 100}, {100, 0, o2::constants::math::TwoPI}});
246248

247249
// Matching histograms
@@ -280,10 +282,7 @@ struct JetCorrelationD0 {
280282
if (jet.pt() < jetPtCutMin) {
281283
continue;
282284
}
283-
float dPhi = RecoDecay::constrainAngle(jet.phi() - d0Candidate.phi());
284-
if (dPhi > o2::constants::math::PI) {
285-
dPhi = 2 * o2::constants::math::PI - dPhi;
286-
}
285+
float dPhi = RecoDecay::constrainAngle(jet.phi() - d0Candidate.phi(), -M_PI);
287286
if (std::abs(dPhi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) {
288287
continue;
289288
}
@@ -326,10 +325,7 @@ struct JetCorrelationD0 {
326325
if (jet.pt() < jetPtCutMin) {
327326
continue;
328327
}
329-
float dPhi = RecoDecay::constrainAngle(jet.phi() - d0Candidate.phi());
330-
if (dPhi > o2::constants::math::PI) {
331-
dPhi = 2 * o2::constants::math::PI - dPhi;
332-
}
328+
float dPhi = RecoDecay::constrainAngle(jet.phi() - d0Candidate.phi(), -M_PI);
333329
if (std::abs(dPhi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) {
334330
continue;
335331
}
@@ -368,10 +364,7 @@ struct JetCorrelationD0 {
368364
if (jet.pt() < jetMcPtCutMin) {
369365
continue;
370366
}
371-
float dPhi = RecoDecay::constrainAngle(jet.phi() - d0McPCandidate.phi());
372-
if (dPhi > o2::constants::math::PI) {
373-
dPhi = 2 * o2::constants::math::PI - dPhi;
374-
}
367+
float dPhi = RecoDecay::constrainAngle(jet.phi() - d0McPCandidate.phi(), -M_PI);
375368
if (std::abs(dPhi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) {
376369
continue;
377370
}
@@ -411,19 +404,13 @@ struct JetCorrelationD0 {
411404
if (McDJet.pt() < jetPtCutMin) {
412405
continue;
413406
}
414-
float dPhiD = RecoDecay::constrainAngle(McDJet.phi() - d0Candidate.phi());
415-
if (dPhiD > o2::constants::math::PI) {
416-
dPhiD = 2 * o2::constants::math::PI - dPhiD;
417-
}
407+
float dPhiD = RecoDecay::constrainAngle(McDJet.phi() - d0Candidate.phi(), -o2::constants::math::PI);
418408
if (std::abs(dPhiD - o2::constants::math::PI) > (o2::constants::math::PI / 2)) {
419409
continue;
420410
}
421411
if (McDJet.has_matchedJetGeo()) { // geometric matching
422412
for (auto const& McPJet : McDJet.template matchedJetGeo_as<aod::ChargedMCParticleLevelJets>()) {
423-
float dPhiP = RecoDecay::constrainAngle(McPJet.phi() - d0Particle.phi());
424-
if (dPhiP > o2::constants::math::PI) {
425-
dPhiP = 2 * o2::constants::math::PI - dPhiP;
426-
}
413+
float dPhiP = RecoDecay::constrainAngle(McPJet.phi() - d0Particle.phi(), -o2::constants::math::PI);
427414
// if (std::abs(dPhiP - o2::constants::math::PI) > (o2::constants::math::PI / 2)) {
428415
// continue;
429416
// }

0 commit comments

Comments
 (0)