Skip to content

Commit a7ad7db

Browse files
committed
[PWGDQ] fixes to the feature extraction in the ML response class
- add computation of the pT pull - fix assignment of the dcaY value (was set to dcaX by mistake)
1 parent 5cbd65a commit a7ad7db

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

PWGDQ/Core/MuonMatchingMlResponse.h

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,24 @@ float getPullR(T1 const& mftprop, T2 const& mchprop)
206206
return deltaR / errR;
207207
}
208208

209+
template <typename T1, typename T2>
210+
float getPullPt(T1 const& mftprop, T2 const& mchprop)
211+
{
212+
double invPtMFT = std::abs(mftprop.getInvQPt());
213+
double ptMFT = (invPtMFT != 0) ? 1.0 / invPtMFT : 0;
214+
double invPtErr2MFT = mftprop.getCovariances()(4, 4);
215+
double ptErr2MFT = invPtErr2MFT * ptMFT * ptMFT * ptMFT * ptMFT;
216+
217+
double invPtMCH = std::abs(mchprop.getInvQPt());
218+
double ptMCH = (invPtMCH != 0) ? 1.0 / invPtMCH : 0;
219+
double invPtErr2MCH = mchprop.getCovariances()(4, 4);
220+
double ptErr2MCH = invPtErr2MCH * ptMCH * ptMCH * ptMCH * ptMCH;
221+
222+
float delta = ptMCH - ptMFT;
223+
float err = std::sqrt(ptErr2MCH + ptErr2MFT);
224+
return (err > 0 ? delta / err : 0);
225+
}
226+
209227
template <typename T1, typename T2>
210228
float getDeltaDirection(T1 const& mftprop, T2 const& mchprop)
211229
{
@@ -317,7 +335,7 @@ class MlResponseMFTMuonMatch : public MlResponse<TypeOutputScore>
317335
CHECK_AND_FILL_FEATURE(pullPhi, getPull(mftprop.getPhi(), mftprop.getCovariances()(2, 2), mchprop.getPhi(), mchprop.getCovariances()(2, 2)));
318336
CHECK_AND_FILL_FEATURE(pullTgl, getPull(mftprop.getTgl(), mftprop.getCovariances()(3, 3), mchprop.getTgl(), mchprop.getCovariances()(3, 3)));
319337
/*dummy value*/ CHECK_AND_FILL_FEATURE(pullEta, 0);
320-
/*dummy value*/ CHECK_AND_FILL_FEATURE(pullPt, 0);
338+
CHECK_AND_FILL_FEATURE(pullPt, getPullPt(mftprop, mchprop));
321339
CHECK_AND_FILL_FEATURE(pullR, getPullR(mftprop, mchprop));
322340
// primary vertex parameters
323341
CHECK_AND_FILL_FEATURE(posX, collision.posX());
@@ -342,7 +360,7 @@ class MlResponseMFTMuonMatch : public MlResponse<TypeOutputScore>
342360
CHECK_AND_FILL_FEATURE(chi2MCHMFT, muon.chi2MatchMCHMFT());
343361
CHECK_AND_FILL_FEATURE(chi2GlobMUON, muon.chi2());
344362
CHECK_AND_FILL_FEATURE_OPTIONAL(dcaX, muon, fwdDcaX);
345-
CHECK_AND_FILL_FEATURE_OPTIONAL(dcaY, muon, fwdDcaX);
363+
CHECK_AND_FILL_FEATURE_OPTIONAL(dcaY, muon, fwdDcaY);
346364
CHECK_AND_FILL_FEATURE_OPTIONAL(isAmbig, muon, compatibleCollIds, (muon.compatibleCollIds().size() == 1) ? 0 : 1);
347365
}
348366
return inputFeature;

0 commit comments

Comments
 (0)