Skip to content

Commit 7fe761a

Browse files
authored
[PWGEM,PWGEM-36] Pi0FlowEMC - Add option to revert scaling from NonLin (#10462)
1 parent 07b8e85 commit 7fe761a

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ struct TaskPi0FlowEMC {
9696
Configurable<float> cfgRotAngle{"cfgRotAngle", std::move(const_cast<float&>(o2::constants::math::PIHalf)), "Angle used for the rotation method"};
9797
Configurable<int> cfgDistanceToEdge{"cfgDistanceToEdge", 1, "Distance to edge in cells required for rotated cluster to be accepted"};
9898
Configurable<bool> cfgDoM02{"cfgDoM02", false, "Flag to enable flow vs M02 for single photons"};
99+
Configurable<bool> cfgDoReverseScaling{"cfgDoReverseScaling", false, "Flag to reverse the scaling that is possibly applied during NonLin"};
99100

100101
// configurable axis
101102
ConfigurableAxis thnConfigAxisInvMass{"thnConfigAxisInvMass", {400, 0.0, 0.8}, ""};
@@ -938,6 +939,15 @@ struct TaskPi0FlowEMC {
938939

939940
ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
940941
ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.);
942+
if (cfgDoReverseScaling) {
943+
// Convert to PxPyPzEVector to modify energy
944+
ROOT::Math::PxPyPzEVector v1Mod(v1);
945+
v1Mod.SetE(v1Mod.E() * 1.0505);
946+
v1 = ROOT::Math::PtEtaPhiMVector(v1Mod);
947+
ROOT::Math::PxPyPzEVector v2Mod(v2);
948+
v2Mod.SetE(v2Mod.E() * 1.0505);
949+
v2 = ROOT::Math::PtEtaPhiMVector(v2Mod);
950+
}
941951
ROOT::Math::PtEtaPhiMVector vMeson = v1 + v2;
942952
float dTheta = v1.Theta() - v2.Theta();
943953
float dPhi = v1.Phi() - v2.Phi();
@@ -1036,6 +1046,16 @@ struct TaskPi0FlowEMC {
10361046
}
10371047
ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
10381048
ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.);
1049+
1050+
if (cfgDoReverseScaling) {
1051+
// Convert to PxPyPzEVector to modify energy
1052+
ROOT::Math::PxPyPzEVector v1Mod(v1);
1053+
v1Mod.SetE(v1Mod.E() * 1.0505);
1054+
v1 = ROOT::Math::PtEtaPhiMVector(v1Mod);
1055+
ROOT::Math::PxPyPzEVector v2Mod(v2);
1056+
v2Mod.SetE(v2Mod.E() * 1.0505);
1057+
v2 = ROOT::Math::PtEtaPhiMVector(v2Mod);
1058+
}
10391059
ROOT::Math::PtEtaPhiMVector vMeson = v1 + v2;
10401060

10411061
float dTheta = v1.Theta() - v2.Theta();
@@ -1253,6 +1273,15 @@ struct TaskPi0FlowEMC {
12531273

12541274
ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
12551275
ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.);
1276+
if (cfgDoReverseScaling) {
1277+
// Convert to PxPyPzEVector to modify energy
1278+
ROOT::Math::PxPyPzEVector v1Mod(v1);
1279+
v1Mod.SetE(v1Mod.E() * 1.0505);
1280+
v1 = ROOT::Math::PtEtaPhiMVector(v1Mod);
1281+
ROOT::Math::PxPyPzEVector v2Mod(v2);
1282+
v2Mod.SetE(v2Mod.E() * 1.0505);
1283+
v2 = ROOT::Math::PtEtaPhiMVector(v2Mod);
1284+
}
12561285
ROOT::Math::PtEtaPhiMVector vMeson = v1 + v2;
12571286
float dTheta = v1.Theta() - v2.Theta();
12581287
float dPhi = v1.Phi() - v2.Phi();

0 commit comments

Comments
 (0)