Skip to content

Commit 0c4e3a7

Browse files
sarjeeta gamiclaude
authored andcommitted
[PWGLF] Fix code-check issues in kstarpbpb.cxx and phianalysisrun3pbpb.cxx
Remove the unused TF1.h include, return braced initializer lists for XYZVector and SAValues, and simplify the negated boolean expressions flagged by clang-tidy. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 5bb1afe commit 0c4e3a7

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

‎PWGLF/Tasks/Resonances/kstarpbpb.cxx‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
#include <Math/Vector3Dfwd.h>
5050
#include <Math/Vector4D.h> // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h)
5151
#include <Math/Vector4Dfwd.h>
52-
#include <TF1.h>
5352
#include <THn.h>
5453
#include <TPDGCode.h>
5554
#include <TRandom3.h>
@@ -531,7 +530,7 @@ struct Kstarpbpb {
531530
if (cfgSAFrame.value == kProductionPlane) {
532531
return ROOT::Math::XYZVector(0., 0., 1.).Cross(mother.Vect()).Unit(); // z x p
533532
}
534-
return ROOT::Math::XYZVector(std::sin(cfgEPNormalHarmonic.value * psiSA), -std::cos(cfgEPNormalHarmonic.value * psiSA), 0.);
533+
return {std::sin(cfgEPNormalHarmonic.value * psiSA), -std::cos(cfgEPNormalHarmonic.value * psiSA), 0.};
535534
}
536535

537536
// ---------------- event selection, common to all K* and phi(1020) process functions ----------------
@@ -686,7 +685,7 @@ struct Kstarpbpb {
686685
double pz1 = candidate1.pz(), pz2 = candidate2.pz();
687686
double p1 = candidate1.p(), p2 = candidate2.p();
688687
double angle = std::acos(std::clamp((pt1 * pt2 + pz1 * pz2) / (p1 * p2), -1.0, 1.0)); // clamp = TMath::ACos behaviour
689-
return !(phiSA.isDeepAngle && angle < phiSA.cfgDeepAngle);
688+
return !phiSA.isDeepAngle || angle >= phiSA.cfgDeepAngle;
690689
}
691690

692691
template <typename T>
@@ -699,7 +698,7 @@ struct Kstarpbpb {
699698
ROOT::Math::XYZVector getSAAxisPhiMC(const ROOT::Math::PxPyPzMVector& mother, double psiSA)
700699
{
701700
if (cfgSAFrame.value == kEventPlane) {
702-
return ROOT::Math::XYZVector(std::cos(2.0 * psiSA), std::sin(2.0 * psiSA), 0.);
701+
return {std::cos(2.0 * psiSA), std::sin(2.0 * psiSA), 0.};
703702
}
704703
return getSAAxis(mother, psiSA);
705704
}
@@ -1451,7 +1450,7 @@ struct Kstarpbpb {
14511450
auto threeVecDau = boost(kaonMinus).Vect();
14521451
auto cosThetaStar = axis.Dot(threeVecDau) / std::sqrt(threeVecDau.Mag2()) / std::sqrt(axis.Mag2());
14531452
auto sa = std::cos(2.0 * getPhiInRange(threeVecDau.Phi() - getSAPlaneAngle(mother, psiSA)));
1454-
return {cosThetaStar, sa};
1453+
return {.cosThetaStar = cosThetaStar, .sa = sa};
14551454
}
14561455

14571456
void processSEPhi(EventCandidates::iterator const& collision, TrackCandidates const& tracks)

‎PWGLF/Tasks/Resonances/phianalysisrun3pbpb.cxx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ struct Phianalysisrun3pbpb {
410410
return false;
411411
}
412412
int occupancy = collision.trackOccupancyInTimeRange();
413-
return !(selectionConfig.fillOccupancy && (occupancy < cfgMinOccupancy || occupancy > cfgMaxOccupancy));
413+
return !selectionConfig.fillOccupancy || (occupancy >= cfgMinOccupancy && occupancy <= cfgMaxOccupancy);
414414
}
415415
template <typename CheckColCent>
416416
float selColMultMC(CheckColCent const& col)
@@ -448,7 +448,7 @@ struct Phianalysisrun3pbpb {
448448
double p1 = candidate1.p();
449449
double p2 = candidate2.p();
450450
double angle = std::acos((pt1 * pt2 + pz1 * pz2) / (p1 * p2));
451-
return !(isDeepAngle && angle < cfgDeepAngle);
451+
return !isDeepAngle || angle >= cfgDeepAngle;
452452
}
453453
template <typename T1, typename T2>
454454
void fillinvMass(const T1& candidate1, const T2& candidate2, float multiplicity, bool unlike, bool mix, bool likesign, float massd1, float massd2)

0 commit comments

Comments
 (0)