Skip to content

Commit 710ee27

Browse files
authored
[PWGEM] PhotonMeson: Fix bug in photonconversionbuilder `v0photoncand… (#16966)
1 parent 019a377 commit 710ee27

3 files changed

Lines changed: 117 additions & 109 deletions

File tree

PWGEM/PhotonMeson/Core/EmMlResponsePCM.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,16 @@
3535
// matches the entry in EnumInputFeatures associated to this FEATURE
3636
// if so, the inputFeatures vector is filled with the FEATURE's value
3737
// by calling the corresponding GETTER from OBJECT
38+
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
3839
#define CHECK_AND_FILL_VEC_PCM_FULL(OBJECT, FEATURE, GETTER) \
3940
case static_cast<uint8_t>(InputFeaturesPCM::FEATURE): { \
40-
inputFeatures.emplace_back(OBJECT.GETTER()); \
41+
inputFeatures.emplace_back((OBJECT).GETTER()); \
4142
break; \
4243
}
4344

4445
// Specific case of CHECK_AND_FILL_VEC_PCM_FULL(OBJECT, FEATURE, GETTER)
4546
// where OBJECT is named candidate and FEATURE = GETTER
47+
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
4648
#define CHECK_AND_FILL_VEC_PCM(GETTER) \
4749
case static_cast<uint8_t>(InputFeaturesPCM::GETTER): { \
4850
inputFeatures.emplace_back(candidate.GETTER()); \
@@ -52,6 +54,11 @@
5254
namespace o2::analysis
5355
{
5456

57+
enum NClassesML {
58+
kTwo = 2,
59+
kThree
60+
};
61+
5562
enum class InputFeaturesPCM : uint8_t {
5663
v0PhotonCandidatefVx,
5764
v0PhotonCandidatefVy,

PWGEM/PhotonMeson/Core/V0PhotonCandidate.h

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct V0PhotonCandidate {
3838
V0PhotonCandidate() = default;
3939
// Set method for photonconversionbuilder
4040
template <class TTrack>
41-
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)
41+
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_)
4242
{
4343
conversionPointx = v0DecayVtx.GetX();
4444
conversionPointy = v0DecayVtx.GetY();
@@ -82,28 +82,28 @@ struct V0PhotonCandidate {
8282

8383
float v0mom = RecoDecay::sqrtSumOfSquares(v0DecayVtx.GetPx(), v0DecayVtx.GetPy(), v0DecayVtx.GetPz());
8484
float length = RecoDecay::sqrtSumOfSquares(v0DecayVtx.GetX() - collision.posX(), v0DecayVtx.GetY() - collision.posY(), v0DecayVtx.GetZ() - collision.posZ());
85-
float dcaXV0ToPV = (v0DecayVtx.GetX() - v0DecayVtx.GetPx() * cospa * length / v0mom) - collision.posX();
86-
float dcaYV0ToPV = (v0DecayVtx.GetY() - v0DecayVtx.GetPy() * cospa * length / v0mom) - collision.posY();
85+
float dcaXV0ToPV = (v0DecayVtx.GetX() - v0DecayVtx.GetPx() * cospa_ * length / v0mom) - collision.posX();
86+
float dcaYV0ToPV = (v0DecayVtx.GetY() - v0DecayVtx.GetPy() * cospa_ * length / v0mom) - collision.posY();
8787
float tmpSign = (dcaXV0ToPV * dcaYV0ToPV > 0.f) ? +1.f : -1.f;
8888

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

9292
alpha = v0_alpha(posPx, posPy, posPz, elePx, elePy, elePz);
9393
qt = v0_qt(posPx, posPy, posPz, elePx, elePy, elePz);
9494

95-
this->cospa = cospa;
96-
this->cospaRZ = cospaRZ;
97-
this->cospaXY = cospaXY;
98-
this->psipair = psipair;
99-
this->phiv = phiv;
100-
this->centType = centType;
101-
this->posdcaXY = posdcaXY;
102-
this->eledcaXY = eledcaXY;
103-
this->posdcaZ = posdcaZ;
104-
this->eledcaZ = eledcaZ;
95+
cospa = cospa_;
96+
cospaRZ = cospaRZ_;
97+
cospaXY = cospaXY_;
98+
psipair = psipair_;
99+
phiv = phiv_;
100+
centType = centType_;
101+
posdcaXY = posdcaXY_;
102+
eledcaXY = eledcaXY_;
103+
posdcaZ = posdcaZ_;
104+
eledcaZ = eledcaZ_;
105105

106-
switch (centType) {
106+
switch (centType_) {
107107
case CentType::CentFT0A:
108108
cent = collision.centFT0A();
109109
break;
@@ -117,7 +117,7 @@ struct V0PhotonCandidate {
117117
}
118118

119119
// Set-Method for V0PhotonCut
120-
void setPhoton(const auto& v0, const auto& pos, const auto& ele, float cent, CentType centType)
120+
void setPhoton(const auto& v0, const auto& pos, const auto& ele, float cent_, CentType centType_)
121121
{
122122
conversionPointx = v0.vx();
123123
conversionPointy = v0.vy();
@@ -174,60 +174,60 @@ struct V0PhotonCandidate {
174174
psipair = v0.psipair();
175175
phiv = v0.phiv();
176176
}
177-
this->cent = cent;
178-
this->centType = centType;
177+
cent = cent_;
178+
centType = centType_;
179179
}
180180

181181
// Getter functions
182-
float getPosPt() const { return posPT; }
183-
float getElePt() const { return elePT; }
184-
float getChi2NDF() const { return chi2ndf; }
185-
float getDcaXYToPV() const { return dcaXYV0ToPV; }
186-
float getDcaZToPV() const { return dcaZV0ToPV; }
187-
float getAlpha() const { return alpha; }
188-
float getQt() const { return qt; }
189-
float getPhiV() const { return phiv; }
190-
float getPsiPair() const { return psipair; }
191-
float getCosPA() const { return cospa; }
192-
float getCosPARZ() const { return cospaRZ; }
193-
float getCosPAXY() const { return cospaXY; }
194-
float getEta() const { return eta; }
195-
float getPosEta() const { return posEta; }
196-
float getEleEta() const { return eleEta; }
197-
float getConversionPointX() const { return conversionPointx; }
198-
float getConversionPointY() const { return conversionPointy; }
199-
float getConversionPointZ() const { return conversionPointz; }
200-
float getPx() const { return px; }
201-
float getPy() const { return py; }
202-
float getPz() const { return pz; }
203-
float getPt() const { return pT; }
204-
float getPosPx() const { return posPx; }
205-
float getPosPy() const { return posPy; }
206-
float getPosPz() const { return posPz; }
207-
float getElePx() const { return elePx; }
208-
float getElePy() const { return elePy; }
209-
float getElePz() const { return elePz; }
210-
float getPosDcaXY() const { return posdcaXY; }
211-
float getPosDcaZ() const { return posdcaZ; }
212-
float getEleDcaXY() const { return eledcaXY; }
213-
float getEleDcaZ() const { return eledcaZ; }
214-
float getPosTPCNClsShared() const { return posTPCNClsShared; }
215-
float getPosTPCNClsFindable() const { return posTPCNClsFindable; }
216-
float getPosTPCNClsFindableMinusShared() const { return posTPCNClsFindableMinusShared; }
217-
float getPosTPCNClsFindableMinusCrossedRows() const { return posTPCNClsFindableMinusCrossedRows; }
218-
float getPosTPCChi2NCl() const { return posTPCChi2NCl; }
219-
float getPosTPCSignal() const { return posTPCSignal; }
220-
float getPosITSClusterSizes() const { return posITSClusterSizes; }
221-
float getEleTPCNClsShared() const { return eleTPCNClsShared; }
222-
float getEleTPCNClsFindable() const { return eleTPCNClsFindable; }
223-
float getEleTPCNClsFindableMinusShared() const { return eleTPCNClsFindableMinusShared; }
224-
float getEleTPCNClsFindableMinusCrossedRows() const { return eleTPCNClsFindableMinusCrossedRows; }
225-
float getEleTPCChi2NCl() const { return eleTPCChi2NCl; }
226-
float getEleTPCSignal() const { return eleTPCSignal; }
227-
float getEleITSClusterSizes() const { return eleITSClusterSizes; }
228-
float getCent() const { return cent; }
229-
float getPCA() const { return pca; }
230-
CentType getCentType() const { return centType; }
182+
[[nodiscard]] float getPosPt() const { return posPT; }
183+
[[nodiscard]] float getElePt() const { return elePT; }
184+
[[nodiscard]] float getChi2NDF() const { return chi2ndf; }
185+
[[nodiscard]] float getDcaXYToPV() const { return dcaXYV0ToPV; }
186+
[[nodiscard]] float getDcaZToPV() const { return dcaZV0ToPV; }
187+
[[nodiscard]] float getAlpha() const { return alpha; }
188+
[[nodiscard]] float getQt() const { return qt; }
189+
[[nodiscard]] float getPhiV() const { return phiv; }
190+
[[nodiscard]] float getPsiPair() const { return psipair; }
191+
[[nodiscard]] float getCosPA() const { return cospa; }
192+
[[nodiscard]] float getCosPARZ() const { return cospaRZ; }
193+
[[nodiscard]] float getCosPAXY() const { return cospaXY; }
194+
[[nodiscard]] float getEta() const { return eta; }
195+
[[nodiscard]] float getPosEta() const { return posEta; }
196+
[[nodiscard]] float getEleEta() const { return eleEta; }
197+
[[nodiscard]] float getConversionPointX() const { return conversionPointx; }
198+
[[nodiscard]] float getConversionPointY() const { return conversionPointy; }
199+
[[nodiscard]] float getConversionPointZ() const { return conversionPointz; }
200+
[[nodiscard]] float getPx() const { return px; }
201+
[[nodiscard]] float getPy() const { return py; }
202+
[[nodiscard]] float getPz() const { return pz; }
203+
[[nodiscard]] float getPt() const { return pT; }
204+
[[nodiscard]] float getPosPx() const { return posPx; }
205+
[[nodiscard]] float getPosPy() const { return posPy; }
206+
[[nodiscard]] float getPosPz() const { return posPz; }
207+
[[nodiscard]] float getElePx() const { return elePx; }
208+
[[nodiscard]] float getElePy() const { return elePy; }
209+
[[nodiscard]] float getElePz() const { return elePz; }
210+
[[nodiscard]] float getPosDcaXY() const { return posdcaXY; }
211+
[[nodiscard]] float getPosDcaZ() const { return posdcaZ; }
212+
[[nodiscard]] float getEleDcaXY() const { return eledcaXY; }
213+
[[nodiscard]] float getEleDcaZ() const { return eledcaZ; }
214+
[[nodiscard]] float getPosTPCNClsShared() const { return posTPCNClsShared; }
215+
[[nodiscard]] float getPosTPCNClsFindable() const { return posTPCNClsFindable; }
216+
[[nodiscard]] float getPosTPCNClsFindableMinusShared() const { return posTPCNClsFindableMinusShared; }
217+
[[nodiscard]] float getPosTPCNClsFindableMinusCrossedRows() const { return posTPCNClsFindableMinusCrossedRows; }
218+
[[nodiscard]] float getPosTPCChi2NCl() const { return posTPCChi2NCl; }
219+
[[nodiscard]] float getPosTPCSignal() const { return posTPCSignal; }
220+
[[nodiscard]] float getPosITSClusterSizes() const { return posITSClusterSizes; }
221+
[[nodiscard]] float getEleTPCNClsShared() const { return eleTPCNClsShared; }
222+
[[nodiscard]] float getEleTPCNClsFindable() const { return eleTPCNClsFindable; }
223+
[[nodiscard]] float getEleTPCNClsFindableMinusShared() const { return eleTPCNClsFindableMinusShared; }
224+
[[nodiscard]] float getEleTPCNClsFindableMinusCrossedRows() const { return eleTPCNClsFindableMinusCrossedRows; }
225+
[[nodiscard]] float getEleTPCChi2NCl() const { return eleTPCChi2NCl; }
226+
[[nodiscard]] float getEleTPCSignal() const { return eleTPCSignal; }
227+
[[nodiscard]] float getEleITSClusterSizes() const { return eleITSClusterSizes; }
228+
[[nodiscard]] float getCent() const { return cent; }
229+
[[nodiscard]] float getPCA() const { return pca; }
230+
[[nodiscard]] CentType getCentType() const { return centType; }
231231

232232
private:
233233
float conversionPointx{0.f};

0 commit comments

Comments
 (0)