Skip to content

Commit 65e4fed

Browse files
committed
fixed megalinter errors
1 parent 26d248f commit 65e4fed

2 files changed

Lines changed: 39 additions & 17 deletions

File tree

PWGLF/Tasks/Resonances/higherMassResonances.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ struct HigherMassResonances {
895895
// Normal to production plane
896896
auto yAxisGJ = ROOT::Math::XYZVectorF(zAxisGJ.Cross(motherLab));
897897

898-
if (yAxisGJ.Mag2() > tolerance)
898+
if (yAxisGJ.Mag2() > config.tolerance)
899899
yAxisGJ = yAxisGJ.Unit();
900900
else
901901
yAxisGJ = ROOT::Math::XYZVectorF(0.f, 1.f, 0.f);

PWGLF/Tasks/Resonances/kstarqa.cxx

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,47 +1057,69 @@ struct Kstarqa {
10571057
bool isMix = false;
10581058

10591059
template <typename T1, typename T2>
1060-
void fillInvMass(const T1& daughter1, const T1& daughter2, const T1& mother, float multiplicity, bool isMix, const T2& track1, const T2& track2)
1060+
void fillInvMass(const T1& dau1, const T1& dau2, const T1& motherVec, float multiplicity, bool isMix, const T2& track1, const T2& track2)
10611061
{
1062-
daughterSelected = (boostDaugter1) ? daughter1 : daughter2; // polarization calculations
1063-
ROOT::Math::Boost boost{mother.BoostToCM()}; // boost mother to center of mass frame
1064-
fourVecDauCM = boost(daughterSelected); // boost the frame of daughter same as mother
1062+
daughterSelected = (boostDaugter1) ? dau1 : dau2; // polarization calculations
1063+
1064+
// Boost mother to the center-of-mass frame
1065+
ROOT::Math::Boost boost{motherVec.BoostToCM()};
1066+
1067+
// Boost selected daughter to the mother rest frame
1068+
fourVecDauCM = boost(daughterSelected);
10651069

1066-
// if (std::abs(mother.Rapidity()) < configGp.rapidityMotherData) {
10671070
if (activateTHnSparseCosThStarHelicity) {
1068-
auto cosThetaStarHelicity = mother.Vect().Dot(fourVecDauCM.Vect()) / (std::sqrt(fourVecDauCM.Vect().Mag2()) * std::sqrt(mother.Vect().Mag2()));
10691071

1072+
auto cosThetaStarHelicity = motherVec.Vect().Dot(fourVecDauCM.Vect()) / (std::sqrt(fourVecDauCM.Vect().Mag2()) * std::sqrt(motherVec.Vect().Mag2()));
1073+
1074+
// Unlike-sign pairs
10701075
if (track1.sign() * track2.sign() < 0) {
1076+
1077+
// Same-event
10711078
if (!isMix) {
1072-
if (std::abs(mother.Rapidity()) < configGp.rapidityMotherData) {
1073-
hInvMass.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, mother.Pt(), mother.M(), cosThetaStarHelicity);
1079+
1080+
if (std::abs(motherVec.Rapidity()) < configGp.rapidityMotherData) {
1081+
hInvMass.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, motherVec.Pt(), motherVec.M(), cosThetaStarHelicity);
10741082
}
10751083

1084+
// Rotational background
10761085
for (int i = 0; i < cRotations; i++) {
1086+
10771087
theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / configGp.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / configGp.rotationalCut);
10781088

1079-
daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M());
1089+
daughterRot = ROOT::Math::PxPyPzMVector(dau1.Px() * std::cos(theta2) - dau1.Py() * std::sin(theta2), dau1.Px() * std::sin(theta2) + dau1.Py() * std::cos(theta2), dau1.Pz(), dau1.M());
10801090

1081-
motherRot = daughterRot + daughter2;
1091+
motherRot = daughterRot + dau2;
10821092

10831093
ROOT::Math::Boost boost2{motherRot.BoostToCM()};
10841094
daughterRotCM = boost2(daughterRot);
10851095

10861096
auto cosThetaStarHelicityRot = motherRot.Vect().Dot(daughterRotCM.Vect()) / (std::sqrt(daughterRotCM.Vect().Mag2()) * std::sqrt(motherRot.Vect().Mag2()));
10871097

1088-
if (calcRotational && std::abs(motherRot.Rapidity()) < configGp.rapidityMotherData)
1098+
if (calcRotational && std::abs(motherRot.Rapidity()) < configGp.rapidityMotherData) {
10891099
hInvMass.fill(HIST("h3KstarInvMassRotated"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarHelicityRot);
1100+
}
10901101
}
1091-
} else if (isMix && std::abs(mother.Rapidity()) < configGp.rapidityMotherData) {
1092-
hInvMass.fill(HIST("h3KstarInvMassMixed"), multiplicity, mother.Pt(), mother.M(), cosThetaStarHelicity);
1102+
1103+
// Mixed-event
1104+
} else if (std::abs(motherVec.Rapidity()) < configGp.rapidityMotherData) {
1105+
1106+
hInvMass.fill(HIST("h3KstarInvMassMixed"), multiplicity, motherVec.Pt(), motherVec.M(), cosThetaStarHelicity);
10931107
}
1108+
1109+
// Like-sign pairs
10941110
} else {
1111+
10951112
if (!isMix) {
1096-
if (calcLikeSign && std::abs(mother.Rapidity()) < configGp.rapidityMotherData) {
1113+
1114+
if (calcLikeSign && std::abs(motherVec.Rapidity()) < configGp.rapidityMotherData) {
1115+
10971116
if (track1.sign() > 0 && track2.sign() > 0) {
1098-
hInvMass.fill(HIST("h3KstarInvMasslikeSignPP"), multiplicity, mother.Pt(), mother.M(), cosThetaStarHelicity);
1117+
1118+
hInvMass.fill(HIST("h3KstarInvMasslikeSignPP"), multiplicity, motherVec.Pt(), motherVec.M(), cosThetaStarHelicity);
1119+
10991120
} else if (track1.sign() < 0 && track2.sign() < 0) {
1100-
hInvMass.fill(HIST("h3KstarInvMasslikeSignMM"), multiplicity, mother.Pt(), mother.M(), cosThetaStarHelicity);
1121+
1122+
hInvMass.fill(HIST("h3KstarInvMasslikeSignMM"), multiplicity, motherVec.Pt(), motherVec.M(), cosThetaStarHelicity);
11011123
}
11021124
}
11031125
}

0 commit comments

Comments
 (0)