@@ -247,6 +247,8 @@ struct TaskPi0FlowEMC {
247247 Configurable<bool > cfgApplySPresolution{" cfgApplySPresolution" , false , " Apply resolution correction" };
248248 Configurable<bool > doEMCalCalib{" doEMCalCalib" , false , " Produce output for EMCal calibration" };
249249 Configurable<bool > cfgEnableNonLin{" cfgEnableNonLin" , false , " flag to turn extra non linear energy calibration on/off" };
250+ Configurable<float > cfgEmcalEffRadius{" cfgEmcalEffRadius" , 430 .f , " effective EMCal radius (cm) used for mixed-event vertex-swap correction" };
251+ Configurable<bool > cfgCorrectMixedVtxEta{" cfgCorrectMixedVtxEta" , true , " re-project cluster2 eta onto collision1's vertex in mixed event" };
250252 } correctionConfig;
251253
252254 SliceCache cache;
@@ -528,6 +530,18 @@ struct TaskPi0FlowEMC {
528530 registry.fill (HIST (HistTypes[histType]), mass, pt, cent);
529531 }
530532
533+ // / \brief eta a cluster would have if its own vertex vzOld is swapped for vzNew,
534+ // / assuming a nominal cylindrical EMCal surface at transverse radius emcalR (cm).
535+ // / phi is untouched: transverse vertex spread is negligible next to emcalR.
536+ // / \param etaOld old eta value
537+ // / \param vzOld old primary vertex z position
538+ // / \param vzNew new primary vertex z position
539+ // / \param emcalR radius of the EMCal
540+ static float correctEtaForVertexShift (float etaOld, float vzOld, float vzNew, float emcalR)
541+ {
542+ return std::asinh (std::sinh (etaOld) + (vzOld - vzNew) / emcalR);
543+ }
544+
531545 // / Get the centrality
532546 // / \param collision is the collision with the centrality information
533547 template <o2::soa::is_iterator TCollision>
@@ -1202,7 +1216,13 @@ struct TaskPi0FlowEMC {
12021216 }
12031217 }
12041218 ROOT ::Math::PtEtaPhiMVector v1 (g1.corrPt (), g1.eta (), g1.phi (), 0 .);
1205- ROOT ::Math::PtEtaPhiMVector v2 (g2.corrPt (), g2.eta (), g2.phi (), 0 .);
1219+
1220+ // changing the eta position of cluster 2 from collision 2 to match the z-vertex position of collision 1
1221+ float eta2 = g2.eta ();
1222+ if (correctionConfig.cfgCorrectMixedVtxEta .value ) {
1223+ eta2 = correctEtaForVertexShift (g2.eta (), c2.posZ (), c1.posZ (), correctionConfig.cfgEmcalEffRadius .value );
1224+ }
1225+ ROOT ::Math::PtEtaPhiMVector v2 (g2.corrPt (), eta2, g2.phi (), 0 .);
12061226 ROOT ::Math::PtEtaPhiMVector vMeson = v1 + v2;
12071227
12081228 float dTheta = v1.Theta () - v2.Theta ();
0 commit comments