Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ struct TaskPi0FlowEMC {
Configurable<bool> cfgApplySPresolution{"cfgApplySPresolution", false, "Apply resolution correction"};
Configurable<bool> doEMCalCalib{"doEMCalCalib", false, "Produce output for EMCal calibration"};
Configurable<bool> cfgEnableNonLin{"cfgEnableNonLin", false, "flag to turn extra non linear energy calibration on/off"};
Configurable<float> cfgEmcalEffRadius{"cfgEmcalEffRadius", 430.f, "effective EMCal radius (cm) used for mixed-event vertex-swap correction"};
Configurable<bool> cfgCorrectMixedVtxEta{"cfgCorrectMixedVtxEta", true, "re-project cluster2 eta onto collision1's vertex in mixed event"};
} correctionConfig;

SliceCache cache;
Expand Down Expand Up @@ -528,6 +530,18 @@ struct TaskPi0FlowEMC {
registry.fill(HIST(HistTypes[histType]), mass, pt, cent);
}

/// \brief eta a cluster would have if its own vertex vzOld is swapped for vzNew,
/// assuming a nominal cylindrical EMCal surface at transverse radius emcalR (cm).
/// phi is untouched: transverse vertex spread is negligible next to emcalR.
/// \param etaOld old eta value
/// \param vzOld old primary vertex z position
/// \param vzNew new primary vertex z position
/// \param emcalR radius of the EMCal
static float correctEtaForVertexShift(float etaOld, float vzOld, float vzNew, float emcalR)
{
return std::asinh(std::sinh(etaOld) + (vzOld - vzNew) / emcalR);
}

/// Get the centrality
/// \param collision is the collision with the centrality information
template <o2::soa::is_iterator TCollision>
Expand Down Expand Up @@ -1202,7 +1216,13 @@ struct TaskPi0FlowEMC {
}
}
ROOT::Math::PtEtaPhiMVector v1(g1.corrPt(), g1.eta(), g1.phi(), 0.);
ROOT::Math::PtEtaPhiMVector v2(g2.corrPt(), g2.eta(), g2.phi(), 0.);

// changing the eta position of cluster 2 from collision 2 to match the z-vertex position of collision 1
float eta2 = g2.eta();
if (correctionConfig.cfgCorrectMixedVtxEta.value) {
eta2 = correctEtaForVertexShift(g2.eta(), c2.posZ(), c1.posZ(), correctionConfig.cfgEmcalEffRadius.value);
}
ROOT::Math::PtEtaPhiMVector v2(g2.corrPt(), eta2, g2.phi(), 0.);
ROOT::Math::PtEtaPhiMVector vMeson = v1 + v2;

float dTheta = v1.Theta() - v2.Theta();
Expand Down
Loading