Skip to content

Commit 1326c2d

Browse files
committed
Add rotation flag for quantisation axis
1 parent 40f376b commit 1326c2d

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

‎PWGHF/D2H/Tasks/taskCharmPolarisation.cxx‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include <Framework/runDataProcessing.h>
4848

4949
#include <Math/GenVector/Boost.h>
50+
#include <Math/GenVector/RotationZ.h>
5051
#include <Math/Vector3D.h> // IWYU pragma: keep (do not replace with Math/Vector3Dfwd.h)
5152
#include <Math/Vector3Dfwd.h>
5253
#include <Math/Vector4D.h> // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h)
@@ -161,6 +162,8 @@ struct HfTaskCharmPolarisation {
161162
Configurable<int> centralityMin{"centralityMin", 30, "Minimum centrality (0-100) to be considered in the analysis"};
162163
Configurable<int> centralityMax{"centralityMax", 50, "Maximum centrality (0-100) to be considered in the analysis"};
163164
Configurable<int> occEstimator{"occEstimator", 0, "If enabled, replace number of PV contributors with occupancy estimation (0: don't use, 1: ITS, 2: FT0C)"};
165+
Configurable<bool> activateAxisRotation{"activateAxisRotation", false, "Activate the rotation of the quantisation axis for cos(Theta*) calculation for phi dependence studies"};
166+
Configurable<float> axisRotationAngle{"axisRotationAngle", 0.f, "Rotation angle of the quantisation axis for cos(Theta*) calculation for phi dependence studies (in rad)"};
164167

165168
/// activate rotational background
166169
Configurable<int> nBkgRotations{"nBkgRotations", 0, "Number of rotated copies (background) per each original candidate"};
@@ -357,7 +360,9 @@ struct HfTaskCharmPolarisation {
357360
const AxisSpec thnAxisCosThetaStarProduction{configThnAxisCosThetaStarProduction, "cos(#vartheta_{production})"};
358361
const AxisSpec thnAxisCosThetaStarRandom{configThnAxisCosThetaStarRandom, "cos(#vartheta_{random})"};
359362
const AxisSpec thnAxisCosThetaStarBeam{configThnAxisCosThetaStarBeam, "cos(#vartheta_{beam})"};
360-
const AxisSpec thnAxisCosThetaStarEP{configThnAxisCosThetaStarEP, "cos(#vartheta_{EP})"}; // reaction plane
363+
std::string hAxisName = "Rotated cos(#vartheta_{EP}) with" + std::to_string(axisRotationAngle) + " rad";
364+
const AxisSpec thnAxisCosThetaStarEP{configThnAxisCosThetaStarEP, activateAxisRotation ? hAxisName.c_str() : "cos(#vartheta_{EP})"}; // reaction plane
365+
// const AxisSpec thnAxisCosThetaStarEP{configThnAxisCosThetaStarEP, "cos(#vartheta_{EP})"}; // reaction plane
361366
const AxisSpec thnAxisCosPhiStarEP{configThnAxisCosPhiStarEP, "cos(2#varphi_{EP})"}; // reaction plane
362367
const AxisSpec thnAxisCosSqThetaStarEP{configThnAxisCosSqThetaStarEP, "cos^{2}(#vartheta_{EP})"}; // reaction plane
363368
const AxisSpec thnAxisMlBkg{configThnAxisMlBkg, "ML bkg"};
@@ -2344,7 +2349,10 @@ struct HfTaskCharmPolarisation {
23442349
// EP analysis for data
23452350
float const xQvec = (*qVecs).at(0);
23462351
float const yQvec = (*qVecs).at(1);
2347-
ROOT::Math::XYZVector const qVecNorm = ROOT::Math::XYZVector(yQvec, -xQvec, 0.f);
2352+
ROOT::Math::XYZVector qVecNorm = ROOT::Math::XYZVector(yQvec, -xQvec, 0.f);
2353+
if (activateAxisRotation) {
2354+
qVecNorm = ROOT::Math::RotationZ(axisRotationAngle)(qVecNorm);
2355+
}
23482356
float const phiStarBeam = std::atan2(threeVecDauCM.Y(), threeVecDauCM.X());
23492357
float const psiAngle = epHelper.GetEventPlane(xQvec, yQvec, 2);
23502358
float const deltaPhiStarEP = RecoDecay::constrainAngle(phiStarBeam - psiAngle, 0., 2);
@@ -2356,6 +2364,9 @@ struct HfTaskCharmPolarisation {
23562364
double const deltaPhi = sampleDeltaPhi(ptCharmHad);
23572365
double psi = candidate.phi() - deltaPhi;
23582366
ROOT::Math::XYZVector qVecNorm = ROOT::Math::XYZVector(-std::sin(psi), std::cos(psi), 0.f);
2367+
if (activateAxisRotation) {
2368+
qVecNorm = ROOT::Math::RotationZ(axisRotationAngle)(qVecNorm);
2369+
}
23592370
float const cosThetaStarEP = qVecNorm.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2());
23602371
fillRecoHistos<Channel, WithMl, DoMc, charm_polarisation::CosThetaStarType::EP>(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarEP, -99.f, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge, nMuons, partRecoDstar, centrality);
23612372
}
@@ -2721,6 +2732,9 @@ struct HfTaskCharmPolarisation {
27212732
double const deltaPhi = sampleDeltaPhi(ptCharmHad);
27222733
double psi = mcParticle.phi() - deltaPhi;
27232734
ROOT::Math::XYZVector qVecNorm = ROOT::Math::XYZVector(-std::sin(psi), std::cos(psi), 0.f);
2735+
if (activateAxisRotation) {
2736+
qVecNorm = ROOT::Math::RotationZ(axisRotationAngle)(qVecNorm);
2737+
}
27242738
float const cosThetaStarEP = qVecNorm.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2());
27252739
if constexpr (WithCent) {
27262740
fillGenHistos<charm_polarisation::CosThetaStarType::EP, Channel>(ptCharmHad, numPvContributors, rapidity, cosThetaStarEP, origin, ptBhadMother, areDauInAcc, resoChannelLc, charge, partRecoDstar, *centrality);

0 commit comments

Comments
 (0)