Skip to content

Commit f07d76c

Browse files
[PWGLF] To fix the background issue (#16536)
Co-authored-by: Navneet <navneet.kumar@cern.ch>
1 parent 90c9cdf commit f07d76c

1 file changed

Lines changed: 75 additions & 21 deletions

File tree

PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx

Lines changed: 75 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ struct Chargedkstaranalysis {
116116
Configurable<bool> activateProductionFrame{"activateProductionFrame", false, "Activate the THnSparse with cosThStar w.r.t. production axis"};
117117
Configurable<bool> activateBeamAxisFrame{"activateBeamAxisFrame", false, "Activate the THnSparse with cosThStar w.r.t. beam axis (Gottified jackson frame)"};
118118
Configurable<bool> activateRandomFrame{"activateRandomFrame", false, "Activate the THnSparse with cosThStar w.r.t. random axis"};
119-
Configurable<int> cRotations{"cRotations", 5, "Number of random rotations in the rotational background"};
120-
Configurable<bool> cBoostKShot{"cBoostKShot", true, "Boost the Kshot in Charged Kstar frame of reference"};
119+
Configurable<int> cRotations{"cRotations", 4, "Number of random rotations in the rotational background"};
120+
Configurable<bool> cCosWithKShot{"cCosWithKShot", true, "Measure the angle with Kshort in Charged Kstar frame of reference"};
121121
// Other cuts on Ks
122-
Configurable<int> rotationalCut{"rotationalCut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"};
122+
Configurable<int> rotationalCut{"rotationalCut", 6, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"};
123123

124124
// fixed variables
125125
float rapidityMotherData = 0.5;
@@ -807,7 +807,7 @@ struct Chargedkstaranalysis {
807807
ROOT::Math::PxPyPzMVector fourVecDauCM, daughterRot, motherRot, daughterRotCM;
808808
ROOT::Math::XYZVectorF beam1CM, beam2CM, zAxisCS, yAxisCS, xAxisCS;
809809
ROOT::Math::XYZVectorF v1CM, zaxisHE, yaxisHE, xaxisHE;
810-
ROOT::Math::XYZVector randomVec, beamVec, normalVec;
810+
ROOT::Math::XYZVector randomVec, beamVec, normalVec, normalVecRot, randomVecRot;
811811
float theta2;
812812
// //polarization calculations
813813
// zBeam = ROOT::Math::XYZVector(0.f, 0.f, 1.f); // ẑ: beam direction in lab frame
@@ -857,13 +857,20 @@ struct Chargedkstaranalysis {
857857
if (doRotation) {
858858
for (int i = 0; i < helicityCfgs.cRotations; i++) {
859859
theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / helicityCfgs.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / helicityCfgs.rotationalCut);
860+
if (helicityCfgs.cCosWithKShot) {
861+
daughterRot = ROOT::Math::PxPyPzMVector(daughter2.Px() * std::cos(theta2) - daughter2.Py() * std::sin(theta2), daughter2.Px() * std::sin(theta2) + daughter2.Py() * std::cos(theta2), daughter2.Pz(), daughter2.M());
860862

861-
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());
862-
863-
motherRot = daughterRot + daughter2;
863+
motherRot = daughterRot + daughter1;
864+
} else {
865+
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());
864866

867+
motherRot = daughterRot + daughter2;
868+
}
865869
ROOT::Math::Boost boost2{motherRot.BoostToCM()};
866-
daughterRotCM = boost2(daughterRot);
870+
if (helicityCfgs.cCosWithKShot)
871+
daughterRotCM = boost2(daughter1);
872+
else
873+
daughterRotCM = boost2(daughterRot);
867874

868875
auto cosThetaStarHelicityRot = motherRot.Vect().Dot(daughterRotCM.Vect()) / (std::sqrt(daughterRotCM.Vect().Mag2()) * std::sqrt(motherRot.Vect().Mag2()));
869876
auto phiHelicityRot = std::atan2(yaxisHE.Dot(daughterRotCM.Vect().Unit()), xaxisHE.Dot(daughterRotCM.Vect().Unit()));
@@ -883,9 +890,15 @@ struct Chargedkstaranalysis {
883890
for (int i = 0; i < helicityCfgs.cRotations; i++) {
884891
theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / helicityCfgs.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / helicityCfgs.rotationalCut);
885892

886-
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());
893+
if (helicityCfgs.cCosWithKShot) {
894+
daughterRot = ROOT::Math::PxPyPzMVector(daughter2.Px() * std::cos(theta2) - daughter2.Py() * std::sin(theta2), daughter2.Px() * std::sin(theta2) + daughter2.Py() * std::cos(theta2), daughter2.Pz(), daughter2.M());
887895

888-
motherRot = daughterRot + daughter2;
896+
motherRot = daughterRot + daughter1;
897+
} else {
898+
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());
899+
900+
motherRot = daughterRot + daughter2;
901+
}
889902

890903
ROOT::Math::Boost boost2{motherRot.BoostToCM()};
891904
daughterRotCM = boost2(daughterRot);
@@ -910,11 +923,26 @@ struct Chargedkstaranalysis {
910923
if (doRotation) {
911924
for (int i = 0; i < helicityCfgs.cRotations; i++) {
912925
theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / helicityCfgs.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / helicityCfgs.rotationalCut);
913-
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());
914926

915-
motherRot = daughterRot + daughter2;
927+
if (helicityCfgs.cCosWithKShot) {
928+
daughterRot = ROOT::Math::PxPyPzMVector(daughter2.Px() * std::cos(theta2) - daughter2.Py() * std::sin(theta2), daughter2.Px() * std::sin(theta2) + daughter2.Py() * std::cos(theta2), daughter2.Pz(), daughter2.M());
929+
930+
motherRot = daughterRot + daughter1;
931+
} else {
932+
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());
933+
934+
motherRot = daughterRot + daughter2;
935+
}
936+
ROOT::Math::Boost boost2{motherRot.BoostToCM()};
937+
if (helicityCfgs.cCosWithKShot)
938+
daughterRotCM = boost2(daughter1);
939+
else
940+
daughterRotCM = boost2(daughterRot);
941+
942+
normalVecRot = ROOT::Math::XYZVector(motherRot.Py(), -motherRot.Px(), 0.f);
943+
auto cosThetaProductionRot = normalVecRot.Dot(daughterRotCM.Vect()) / (std::sqrt(daughterRotCM.Vect().Mag2()) * std::sqrt(normalVecRot.Mag2()));
916944
if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) {
917-
fillKstarHist(true, multiplicity, motherRot, cosThetaProduction);
945+
fillKstarHist(true, multiplicity, motherRot, cosThetaProductionRot);
918946
}
919947
}
920948
}
@@ -929,9 +957,17 @@ struct Chargedkstaranalysis {
929957
if (doRotation) {
930958
for (int i = 0; i < helicityCfgs.cRotations; i++) {
931959
theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / helicityCfgs.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / helicityCfgs.rotationalCut);
932-
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());
933960

934-
motherRot = daughterRot + daughter2;
961+
if (helicityCfgs.cCosWithKShot) {
962+
daughterRot = ROOT::Math::PxPyPzMVector(daughter2.Px() * std::cos(theta2) - daughter2.Py() * std::sin(theta2), daughter2.Px() * std::sin(theta2) + daughter2.Py() * std::cos(theta2), daughter2.Pz(), daughter2.M());
963+
964+
motherRot = daughterRot + daughter1;
965+
} else {
966+
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());
967+
968+
motherRot = daughterRot + daughter2;
969+
}
970+
935971
if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) {
936972
fillKstarHist(true, multiplicity, motherRot, cosThetaStarBeam);
937973
}
@@ -950,12 +986,30 @@ struct Chargedkstaranalysis {
950986
}
951987
if (doRotation) {
952988
for (int i = 0; i < helicityCfgs.cRotations; i++) {
989+
auto phiRandomRot = gRandom->Uniform(0.f, constants::math::TwoPI);
990+
auto thetaRandomRot = gRandom->Uniform(0.f, constants::math::PI);
991+
randomVecRot = ROOT::Math::XYZVector(std::sin(thetaRandomRot) * std::cos(phiRandomRot), std::sin(thetaRandomRot) * std::sin(phiRandomRot), std::cos(thetaRandomRot));
953992
theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / helicityCfgs.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / helicityCfgs.rotationalCut);
954-
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());
955993

956-
motherRot = daughterRot + daughter2;
994+
if (helicityCfgs.cCosWithKShot) {
995+
daughterRot = ROOT::Math::PxPyPzMVector(daughter2.Px() * std::cos(theta2) - daughter2.Py() * std::sin(theta2), daughter2.Px() * std::sin(theta2) + daughter2.Py() * std::cos(theta2), daughter2.Pz(), daughter2.M());
996+
997+
motherRot = daughterRot + daughter1;
998+
} else {
999+
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());
1000+
1001+
motherRot = daughterRot + daughter2;
1002+
}
1003+
1004+
ROOT::Math::Boost boost2{motherRot.BoostToCM()};
1005+
if (helicityCfgs.cCosWithKShot)
1006+
daughterRotCM = boost2(daughter1);
1007+
else
1008+
daughterRotCM = boost2(daughterRot);
1009+
auto cosThetaStarRandomRot = randomVecRot.Dot(daughterRotCM.Vect()) / std::sqrt(daughterRotCM.Vect().Mag2());
1010+
9571011
if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) {
958-
fillKstarHist(true, multiplicity, motherRot, cosThetaStarRandom);
1012+
fillKstarHist(true, multiplicity, motherRot, cosThetaStarRandomRot);
9591013
}
9601014
}
9611015
}
@@ -1152,7 +1206,7 @@ struct Chargedkstaranalysis {
11521206
histos.fill(HIST("QA/after/kstarinvmass"), lResoKstar.M());
11531207
}
11541208

1155-
if (helicityCfgs.cBoostKShot) {
1209+
if (helicityCfgs.cCosWithKShot) {
11561210
fillInvMass(lResoKstar, collision.centFT0M(), lResoSecondary, lDecayDaughter_bach, IsMix);
11571211
} else {
11581212
fillInvMass(lResoKstar, collision.centFT0M(), lDecayDaughter_bach, lResoSecondary, IsMix);
@@ -1361,7 +1415,7 @@ struct Chargedkstaranalysis {
13611415
const float lCentrality = iter->second;
13621416

13631417
histos.fill(HIST("EffKstar/genKstar"), part.pt(), lCentrality);
1364-
if (helicityCfgs.cBoostKShot) {
1418+
if (helicityCfgs.cCosWithKShot) {
13651419
fillInvMass(lResoKstar, lCentrality, lResoSecondary, lDecayDaughter_bach, eventCutCfgs.confIsMix);
13661420
} else {
13671421
fillInvMass(lResoKstar, lCentrality, lDecayDaughter_bach, lResoSecondary, eventCutCfgs.confIsMix);
@@ -1453,7 +1507,7 @@ struct Chargedkstaranalysis {
14531507
}
14541508

14551509
histos.fill(HIST("EffKstar/recoKstar"), ptreco, lCentrality);
1456-
if (helicityCfgs.cBoostKShot) {
1510+
if (helicityCfgs.cCosWithKShot) {
14571511
fillInvMass(lResoKstar, lCentrality, lResoSecondary, lDecayDaughter_bach, eventCutCfgs.confIsMix);
14581512
} else {
14591513
fillInvMass(lResoKstar, lCentrality, lDecayDaughter_bach, lResoSecondary, eventCutCfgs.confIsMix);

0 commit comments

Comments
 (0)