Skip to content

Commit 94597f9

Browse files
author
Veronika Barbasova
committed
pi redefinition
Signed-off-by: Veronika Barbasova <vernika.barbasova@cern.ch>
1 parent 319aece commit 94597f9

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

PWGLF/Tasks/Resonances/phianalysisTHnSparse.cxx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -281,20 +281,20 @@ struct PhianalysisTHnSparse {
281281
registry.add("QAPhi/hRapidity", "Rapidity distribution of #phi candidates", kTH1F, {rapidityaxis});
282282
registry.add("QAPhi/hEta", "Pseudorapidity distribution of #phi candidates", kTH1F, {etaaxis});
283283

284-
registry.add("QAPhi/hdPhi", "Azimuthal distribution of #phi candidates", kTH1F, {{100, -2 * TMath::Pi(), 2 * TMath::Pi()}});
284+
registry.add("QAPhi/hdPhi", "Azimuthal distribution of #phi candidates", kTH1F, {{100, -o2::constants::math::TwoPI, o2::constants::math::TwoPI}});
285285
auto hdPhi = registry.get<TH1>(HIST("QAPhi/hdPhi"));
286286
hdPhi->GetXaxis()->SetTitle("#phi (rad)");
287287

288-
registry.add("QAPhi/h2dPhiPt", "Azimuthal distribution of #Delta#phi candidates vs p_{T}", kTH2F, {ptaxis, {100, -2 * TMath::Pi(), 2 * TMath::Pi()}});
288+
registry.add("QAPhi/h2dPhiPt", "Azimuthal distribution of #Delta#phi candidates vs p_{T}", kTH2F, {ptaxis, {100, -o2::constants::math::TwoPI, o2::constants::math::TwoPI}});
289289
auto h2dPhiPt = registry.get<TH2>(HIST("QAPhi/h2dPhiPt"));
290290
h2dPhiPt->GetXaxis()->SetTitle("p_{T} (GeV/c)");
291291
h2dPhiPt->GetYaxis()->SetTitle("#Delta#phi (rad)");
292292

293-
registry.add("QAPhi/hTheta", "Polar distribution of #phi candidates", kTH1F, {{100, 0, TMath::Pi()}});
293+
registry.add("QAPhi/hTheta", "Polar distribution of #phi candidates", kTH1F, {{100, 0.0f, o2::constants::math::PI}});
294294
auto hTheta = registry.get<TH1>(HIST("QAPhi/hTheta"));
295295
hTheta->GetXaxis()->SetTitle("#theta (rad)");
296296

297-
registry.add("QAPhi/h2dThetaPt", "Polar distribution of #phi candidates vs p_{T}", kTH2F, {{12, 0, 12}, {100, -TMath::Pi(), TMath::Pi()}});
297+
registry.add("QAPhi/h2dThetaPt", "Polar distribution of #phi candidates vs p_{T}", kTH2F, {{12, 0, 12}, {100, -o2::constants::math::PI, o2::constants::math::PI}});
298298
auto h2dThetaPt = registry.get<TH2>(HIST("QAPhi/h2dThetaPt"));
299299
h2dThetaPt->GetXaxis()->SetTitle("p_{T} (GeV/c)");
300300
h2dThetaPt->GetYaxis()->SetTitle("#theta (rad)");
@@ -369,22 +369,22 @@ struct PhianalysisTHnSparse {
369369
registry.add("QARotational/hEta", "Pseudorapidity distribution of #phi candidates from rotational background", kTH1F, {etaaxis});
370370

371371
// Angular distributions for rotational background
372-
registry.add("QARotational/hdPhi", "Rotational background #Delta#phi distribution", kTH1F, {{100, -2 * TMath::Pi(), 2 * TMath::Pi()}});
372+
registry.add("QARotational/hdPhi", "Rotational background #Delta#phi distribution", kTH1F, {{100, -o2::constants::math::TwoPI, o2::constants::math::TwoPI}});
373373
auto hRPhi = registry.get<TH1>(HIST("QARotational/hdPhi"));
374374
hRPhi->GetXaxis()->SetTitle("#Delta#phi");
375375
hRPhi->GetYaxis()->SetTitle("Counts");
376376

377-
registry.add("QARotational/h2dPhiPt", "Rotational background #Delta#phi vs p_{T}", kTH2F, {ptaxis, {100, -2 * TMath::Pi(), 2 * TMath::Pi()}});
377+
registry.add("QARotational/h2dPhiPt", "Rotational background #Delta#phi vs p_{T}", kTH2F, {ptaxis, {100, -o2::constants::math::TwoPI, o2::constants::math::TwoPI}});
378378
auto hR2dPhiPt = registry.get<TH2>(HIST("QARotational/h2dPhiPt"));
379379
hR2dPhiPt->GetXaxis()->SetTitle("p_{T} (GeV/c)");
380380
hR2dPhiPt->GetYaxis()->SetTitle("#Delta#phi");
381381

382-
registry.add("QARotational/hTheta", "Rotational background #Delta#theta distribution", kTH1F, {{100, 0, TMath::Pi()}});
382+
registry.add("QARotational/hTheta", "Rotational background #Delta#theta distribution", kTH1F, {{100, 0.0f, o2::constants::math::PI}});
383383
auto hRdTheta = registry.get<TH1>(HIST("QARotational/hTheta"));
384384
hRdTheta->GetXaxis()->SetTitle("#Delta#theta");
385385
hRdTheta->GetYaxis()->SetTitle("Counts");
386386

387-
registry.add("QARotational/h2dThetaPt", "Rotational background #Delta#theta vs p_{T}", kTH2F, {{12, 0, 12}, {100, -TMath::Pi(), TMath::Pi()}});
387+
registry.add("QARotational/h2dThetaPt", "Rotational background #Delta#theta vs p_{T}", kTH2F, {{12, 0, 12}, {100, -o2::constants::math::PI, o2::constants::math::PI}});
388388
auto hR2dThetaPt = registry.get<TH2>(HIST("QARotational/h2dThetaPt"));
389389
hR2dThetaPt->GetXaxis()->SetTitle("p_{T} (GeV/c)");
390390
hR2dThetaPt->GetYaxis()->SetTitle("#Delta#theta");
@@ -616,9 +616,11 @@ struct PhianalysisTHnSparse {
616616

617617
if (produceRotational) {
618618
for (int i = 1; i <= static_cast<int>(numberofRotations); i++) {
619-
float angle = i * (360.0f / (static_cast<int>(numberofRotations) + 1));
620-
float px2new = track2.px() * std::cos(angle * TMath::DegToRad()) - track2.py() * std::sin(angle * TMath::DegToRad());
621-
float py2new = track2.px() * std::sin(angle * TMath::DegToRad()) + track2.py() * std::cos(angle * TMath::DegToRad());
619+
// compute rotation angle in radians using o2::constants::math::PI
620+
float angleDeg = i * (360.0f / (static_cast<int>(numberofRotations) + 1));
621+
float angleRad = angleDeg * (o2::constants::math::PI / 180.0f);
622+
float px2new = track2.px() * std::cos(angleRad) - track2.py() * std::sin(angleRad);
623+
float py2new = track2.px() * std::sin(angleRad) + track2.py() * std::cos(angleRad);
622624
d2 = ROOT::Math::PxPyPzMVector(px2new, py2new, track2.pz(), massNeg);
623625
mother = d1 + d2;
624626

0 commit comments

Comments
 (0)