Skip to content

Commit 605dd8f

Browse files
author
Isabel Kantak
committed
Implement comments
1 parent fa7d5bd commit 605dd8f

File tree

5 files changed

+55
-54
lines changed

5 files changed

+55
-54
lines changed

PWGEM/PhotonMeson/Core/EmMlResponsePCM.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ namespace o2::analysis
5555
enum class InputFeaturesPCM : uint8_t {
5656
v0PhotonCandidatefVx,
5757
v0PhotonCandidatefVy,
58+
v0PhotonCandidatefVz,
5859
v0PhotonCandidatefDCAxyToPV,
5960
v0PhotonCandidatefDCAzToPV,
6061
v0PhotonCandidatefPCA,
@@ -92,7 +93,7 @@ enum class InputFeaturesPCM : uint8_t {
9293
negV0LegfITSClusterSizes
9394
};
9495

95-
template <typename TypeOutputScore = float>
96+
template <std::floating_point TypeOutputScore = float>
9697
class EmMlResponsePCM : public EmMlResponse<TypeOutputScore>
9798
{
9899
public:
@@ -111,8 +112,9 @@ class EmMlResponsePCM : public EmMlResponse<TypeOutputScore>
111112

112113
for (const auto& idx : MlResponse<TypeOutputScore>::mCachedIndices) {
113114
switch (idx) {
114-
CHECK_AND_FILL_VEC_PCM_FULL(candidate, v0PhotonCandidatefVx, getX);
115-
CHECK_AND_FILL_VEC_PCM_FULL(candidate, v0PhotonCandidatefVy, getY);
115+
CHECK_AND_FILL_VEC_PCM_FULL(candidate, v0PhotonCandidatefVx, getConversionPointX);
116+
CHECK_AND_FILL_VEC_PCM_FULL(candidate, v0PhotonCandidatefVy, getConversionPointY);
117+
CHECK_AND_FILL_VEC_PCM_FULL(candidate, v0PhotonCandidatefVz, getConversionPointZ);
116118
CHECK_AND_FILL_VEC_PCM_FULL(candidate, v0PhotonCandidatefDCAxyToPV, getDcaXYToPV);
117119
CHECK_AND_FILL_VEC_PCM_FULL(candidate, v0PhotonCandidatefDCAzToPV, getDcaZToPV);
118120
CHECK_AND_FILL_VEC_PCM_FULL(candidate, v0PhotonCandidatefPCA, getPCA);
@@ -160,6 +162,7 @@ class EmMlResponsePCM : public EmMlResponse<TypeOutputScore>
160162
MlResponse<TypeOutputScore>::mAvailableInputFeatures = {
161163
FILL_MAP_PCM(v0PhotonCandidatefVx),
162164
FILL_MAP_PCM(v0PhotonCandidatefVy),
165+
FILL_MAP_PCM(v0PhotonCandidatefVz),
163166
FILL_MAP_PCM(v0PhotonCandidatefDCAxyToPV),
164167
FILL_MAP_PCM(v0PhotonCandidatefDCAzToPV),
165168
FILL_MAP_PCM(v0PhotonCandidatefPCA),

PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ struct Pi0EtaToGammaGamma {
100100

101101
o2::framework::Configurable<int> cfgAlphaMesonCut{"cfgAlphaMesonCut", 0, "flag for photon energy asymmetry distribution cut: 0: no cut, 1: cut specific value, 2: cut depending on pT"};
102102
o2::framework::Configurable<float> cfgAlphaMeson{"cfgAlphaMeson", 0.65, "photon energy asymmetry distribution parameter for specific value cut"};
103-
o2::framework::Configurable<float> cfgAlphaMesonA{"cfgAlphaMesonA", 0.65, "photon energy asymmetry distribution parameter A for pT dependent cut"};
104-
o2::framework::Configurable<float> cfgAlphaMesonB{"cfgAlphaMesonB", 1.2, "photon energy asymmetry distribution parameter B for pT dependent cut"};
103+
o2::framework::Configurable<float> cfgAlphaMesonA{"cfgAlphaMesonA", 0.65, "photon energy asymmetry distribution parameter A for pT dependent cut(A * tanh(B*pT))"};
104+
o2::framework::Configurable<float> cfgAlphaMesonB{"cfgAlphaMesonB", 1.2, "photon energy asymmetry distribution parameter B for pT dependent cut (A * tanh(B*pT))"};
105105

106106
EMPhotonEventCut fEMEventCut;
107107
struct : o2::framework::ConfigurableGroup {
@@ -891,23 +891,22 @@ struct Pi0EtaToGammaGamma {
891891
continue;
892892
}
893893

894-
float alpha_meson = std::fabs(g1.e() - g2.e()) / (g1.e() + g2.e());
895-
float alpha_cut = 999.f;
896-
AlphaMesonCutOption alpha_meson_cut = static_cast<AlphaMesonCutOption>(cfgAlphaMesonCut.value);
897-
switch (alpha_meson_cut) {
894+
float alphaMeson = std::fabs(g1.e() - g2.e()) / (g1.e() + g2.e());
895+
float alphaCut = 999.f;
896+
switch (static_cast<AlphaMesonCutOption>(cfgAlphaMesonCut.value)) {
898897
case AlphaMesonCutOption::Off:
899898
break;
900899
case AlphaMesonCutOption::SpecificValue:
901-
alpha_cut = cfgAlphaMeson;
900+
alphaCut = cfgAlphaMeson;
902901
break;
903902
case AlphaMesonCutOption::PTDependent: {
904-
alpha_cut = cfgAlphaMesonA * std::tanh(cfgAlphaMesonB * v12.pt());
903+
alphaCut = cfgAlphaMesonA * std::tanh(cfgAlphaMesonB * v12.pt());
905904
break;
906905
}
907906
default:
908907
LOGF(error, "Invalid option for alpha meson cut. No alpha cut will be applied.");
909908
}
910-
if (alpha_meson > alpha_cut) {
909+
if (alphaMeson > alphaCut) {
911910
continue;
912911
}
913912

PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -683,23 +683,22 @@ struct Pi0EtaToGammaGammaMC {
683683
continue;
684684
}
685685

686-
float alpha_meson = std::fabs(g1.e() - g2.e()) / (g1.e() + g2.e());
687-
float alpha_cut = 999.f;
688-
AlphaMesonCutOption alpha_meson_cut = static_cast<AlphaMesonCutOption>(cfgAlphaMesonCut.value);
689-
switch (alpha_meson_cut) {
686+
float alphaMeson = std::fabs(g1.e() - g2.e()) / (g1.e() + g2.e());
687+
float alphaCut = 999.f;
688+
switch (static_cast<AlphaMesonCutOption>(cfgAlphaMesonCut.value)) {
690689
case AlphaMesonCutOption::Off:
691690
break;
692691
case AlphaMesonCutOption::SpecificValue:
693-
alpha_cut = cfgAlphaMeson;
692+
alphaCut = cfgAlphaMeson;
694693
break;
695694
case AlphaMesonCutOption::PTDependent: {
696-
alpha_cut = cfgAlphaMesonA * std::tanh(cfgAlphaMesonB * v12.pt());
695+
alphaCut = cfgAlphaMesonA * std::tanh(cfgAlphaMesonB * v12.pt());
697696
break;
698697
}
699698
default:
700699
LOGF(error, "Invalid option for alpha meson cut. No alpha cut will be applied.");
701700
}
702-
if (alpha_meson > alpha_cut) {
701+
if (alphaMeson > alphaCut) {
703702
continue;
704703
}
705704

PWGEM/PhotonMeson/Core/V0PhotonCandidate.h

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,22 @@ struct V0PhotonCandidate {
3636
V0PhotonCandidate() = default;
3737
// Set method for photonconversionbuilder
3838
template <class TTrack>
39-
void setPhotonCandidate(const KFParticle& v0_DecayVtx, const KFParticle& v0_PV, const TTrack& pos, const KFParticle& pos_DecayVtx, const TTrack& ele, const KFParticle& ele_DecayVtx, const auto& collision, float cospa, float cospaRZ, float cospaXY, float psipair, float phiv, CentType centType, auto posdcaXY, auto eledcaXY, auto posdcaZ, auto eledcaZ)
39+
void setPhotonCandidate(const KFParticle& v0DecayVtx, const KFParticle& v0PV, const TTrack& pos, const KFParticle& posDecayVtx, const TTrack& ele, const KFParticle& eleDecayVtx, const auto& collision, float cospa, float cospaRZ, float cospaXY, float psipair, float phiv, CentType centType, auto posdcaXY, auto eledcaXY, auto posdcaZ, auto eledcaZ)
4040
{
41-
x = v0_DecayVtx.GetX();
42-
y = v0_DecayVtx.GetY();
43-
z = v0_DecayVtx.GetZ();
44-
px = v0_PV.GetPx();
45-
py = v0_PV.GetPy();
46-
pz = v0_PV.GetPz();
41+
conversionPointx = v0DecayVtx.GetX();
42+
conversionPointy = v0DecayVtx.GetY();
43+
conversionPointz = v0DecayVtx.GetZ();
44+
px = v0PV.GetPx();
45+
py = v0PV.GetPy();
46+
pz = v0PV.GetPz();
4747
pT = RecoDecay::sqrtSumOfSquares(px, py);
4848

49-
posPx = pos_DecayVtx.GetPx();
50-
posPy = pos_DecayVtx.GetPy();
51-
posPz = pos_DecayVtx.GetPz();
52-
elePx = ele_DecayVtx.GetPx();
53-
elePy = ele_DecayVtx.GetPy();
54-
elePz = ele_DecayVtx.GetPz();
49+
posPx = posDecayVtx.GetPx();
50+
posPy = posDecayVtx.GetPy();
51+
posPz = posDecayVtx.GetPz();
52+
elePx = eleDecayVtx.GetPx();
53+
elePy = eleDecayVtx.GetPy();
54+
elePz = eleDecayVtx.GetPz();
5555
posPT = RecoDecay::sqrtSumOfSquares(posPx, posPy);
5656
elePT = RecoDecay::sqrtSumOfSquares(elePx, elePy);
5757
posEta = RecoDecay::eta(std::array{posPx, posPy, posPz});
@@ -72,20 +72,20 @@ struct V0PhotonCandidate {
7272
eleTPCSignal = ele.tpcSignal();
7373
eleITSClusterSizes = ele.itsClusterSizes();
7474

75-
chi2ndf = v0_DecayVtx.GetChi2() / v0_DecayVtx.GetNDF();
76-
pca = pos_DecayVtx.GetDistanceFromParticle(ele_DecayVtx);
75+
chi2ndf = v0DecayVtx.GetChi2() / v0DecayVtx.GetNDF();
76+
pca = posDecayVtx.GetDistanceFromParticle(eleDecayVtx);
7777
eta = RecoDecay::eta(std::array{px, py, pz});
7878
posEta = RecoDecay::eta(std::array{posPx, posPy, posPz});
7979
eleEta = RecoDecay::eta(std::array{elePx, elePy, elePz});
8080

81-
float v0mom = RecoDecay::sqrtSumOfSquares(v0_DecayVtx.GetPx(), v0_DecayVtx.GetPy(), v0_DecayVtx.GetPz());
82-
float length = RecoDecay::sqrtSumOfSquares(v0_DecayVtx.GetX() - collision.posX(), v0_DecayVtx.GetY() - collision.posY(), v0_DecayVtx.GetZ() - collision.posZ());
83-
float dcaXV0ToPV = (v0_DecayVtx.GetX() - v0_DecayVtx.GetPx() * cospa * length / v0mom) - collision.posX();
84-
float dcaYV0ToPV = (v0_DecayVtx.GetY() - v0_DecayVtx.GetPy() * cospa * length / v0mom) - collision.posY();
81+
float v0mom = RecoDecay::sqrtSumOfSquares(v0DecayVtx.GetPx(), v0DecayVtx.GetPy(), v0DecayVtx.GetPz());
82+
float length = RecoDecay::sqrtSumOfSquares(v0DecayVtx.GetX() - collision.posX(), v0DecayVtx.GetY() - collision.posY(), v0DecayVtx.GetZ() - collision.posZ());
83+
float dcaXV0ToPV = (v0DecayVtx.GetX() - v0DecayVtx.GetPx() * cospa * length / v0mom) - collision.posX();
84+
float dcaYV0ToPV = (v0DecayVtx.GetY() - v0DecayVtx.GetPy() * cospa * length / v0mom) - collision.posY();
8585
float tmpSign = (dcaXV0ToPV * dcaYV0ToPV > 0.f) ? +1.f : -1.f;
8686

8787
dcaXYV0ToPV = RecoDecay::sqrtSumOfSquares(dcaXV0ToPV, dcaYV0ToPV) * tmpSign;
88-
dcaZV0ToPV = (v0_DecayVtx.GetZ() - v0_DecayVtx.GetPz() * cospa * length / v0mom) - collision.posZ();
88+
dcaZV0ToPV = (v0DecayVtx.GetZ() - v0DecayVtx.GetPz() * cospa * length / v0mom) - collision.posZ();
8989

9090
alpha = v0_alpha(posPx, posPy, posPz, elePx, elePy, elePz);
9191
qt = v0_qt(posPx, posPy, posPz, elePx, elePy, elePz);
@@ -117,9 +117,9 @@ struct V0PhotonCandidate {
117117
// Set-Method for V0PhotonCut
118118
void setPhoton(const auto& v0, const auto& pos, const auto& ele, float cent, CentType centType)
119119
{
120-
x = v0.vx();
121-
y = v0.vy();
122-
z = v0.vz();
120+
conversionPointx = v0.vx();
121+
conversionPointy = v0.vy();
122+
conversionPointz = v0.vz();
123123
px = v0.px();
124124
py = v0.py();
125125
pz = v0.pz();
@@ -192,9 +192,9 @@ struct V0PhotonCandidate {
192192
float getEta() const { return eta; }
193193
float getPosEta() const { return posEta; }
194194
float getEleEta() const { return eleEta; }
195-
float getX() const { return x; }
196-
float getY() const { return y; }
197-
float getZ() const { return z; }
195+
float getConversionPointX() const { return conversionPointx; }
196+
float getConversionPointY() const { return conversionPointy; }
197+
float getConversionPointZ() const { return conversionPointz; }
198198
float getPx() const { return px; }
199199
float getPy() const { return py; }
200200
float getPz() const { return pz; }
@@ -228,9 +228,9 @@ struct V0PhotonCandidate {
228228
CentType getCentType() const { return centType; }
229229

230230
private:
231-
float x;
232-
float y;
233-
float z;
231+
float conversionPointx;
232+
float conversionPointy;
233+
float conversionPointz;
234234
float px;
235235
float py;
236236
float pz;

PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -723,10 +723,10 @@ struct PhotonConversionBuilder {
723723
kfp_pos_DecayVtx.TransportToPoint(xyz); // Don't set Primary Vertex
724724
kfp_ele_DecayVtx.TransportToPoint(xyz); // Don't set Primary Vertex
725725

726-
float cospaXY_kf = cospaXY_KF(gammaKF_DecayVtx, KFPV);
727-
float cospaRZ_kf = cospaRZ_KF(gammaKF_DecayVtx, KFPV);
726+
float cospaXYKF = cospaXY_KF(gammaKF_DecayVtx, KFPV);
727+
float cospaRZKF = cospaRZ_KF(gammaKF_DecayVtx, KFPV);
728728
CentType centType = static_cast<CentType>(centTypePCMMl.value);
729-
v0photoncandidate.setPhotonCandidate(gammaKF_DecayVtx, gammaKF_PV, pos, kfp_pos_DecayVtx, ele, kfp_ele_DecayVtx, collision, cospa_kf, cospaRZ_kf, cospaXY_kf, psipair, phiv, centType, posdcaXY, posdcaZ, eledcaXY, eledcaZ);
729+
v0photoncandidate.setPhotonCandidate(gammaKF_DecayVtx, gammaKF_PV, pos, kfp_pos_DecayVtx, ele, kfp_ele_DecayVtx, collision, cospaXYKF, cospaRZKF, cospaXYKF, psipair, phiv, centType, posdcaXY, posdcaZ, eledcaXY, eledcaZ);
730730

731731
if (!ele.hasITS() && !pos.hasITS()) { // V0s with TPConly-TPConly
732732
if (max_r_itsmft_ss < rxy && rxy < maxX + margin_r_tpc) {
@@ -825,8 +825,8 @@ struct PhotonConversionBuilder {
825825
registry.fill(HIST("V0/hPhiVPsiPair"), v0photoncandidate.getPsiPair(), v0photoncandidate.getPhiV());
826826

827827
// LOGF(info, "cospa_kf = %f, cospaXY_kf = %f, cospaRZ_kf = %f", cospa_kf, cospaXY_kf, cospaRZ_kf);
828-
registry.fill(HIST("V0/hCosPAXY_Rxy"), rxy, cospaXY_kf);
829-
registry.fill(HIST("V0/hCosPARZ_Rxy"), rxy, cospaRZ_kf);
828+
registry.fill(HIST("V0/hCosPAXY_Rxy"), rxy, cospaXYKF);
829+
registry.fill(HIST("V0/hCosPARZ_Rxy"), rxy, cospaRZKF);
830830

831831
for (const auto& leg : {kfp_pos_DecayVtx, kfp_ele_DecayVtx}) {
832832
float legpt = RecoDecay::sqrtSumOfSquares(leg.GetPx(), leg.GetPy());
@@ -855,7 +855,7 @@ struct PhotonConversionBuilder {
855855
gammaKF_DecayVtx.GetX(), gammaKF_DecayVtx.GetY(), gammaKF_DecayVtx.GetZ(),
856856
gammaKF_PV.GetPx(), gammaKF_PV.GetPy(), gammaKF_PV.GetPz(),
857857
v0_sv.M(), v0photoncandidate.getDcaXYToPV(), v0photoncandidate.getDcaZToPV(),
858-
cospa_kf, cospaXY_kf, cospaRZ_kf,
858+
cospa_kf, cospaXYKF, cospaRZKF,
859859
v0photoncandidate.getPCA(), v0photoncandidate.getAlpha(), v0photoncandidate.getQt(), v0photoncandidate.getChi2NDF());
860860
v0photonsphivpsi(v0photoncandidate.getPhiV(), v0photoncandidate.getPsiPair());
861861

0 commit comments

Comments
 (0)