6 #include "CLHEP/GenericFunctions/CumulativeChiSquare.hh"
25 declareInterface<Trk::ITrackScoringTool>(
this);
42 return StatusCode::FAILURE;
51 return StatusCode::SUCCESS;
62 const EventContext& ctx = Gaudi::Hive::currentContext();
65 if (fieldCondObj ==
nullptr) {
66 ATH_MSG_ERROR(
"simpleScore: Failed to retrieve AtlasFieldCacheCondObj with key "
71 fieldCondObj->getInitializedCache(fieldCache);
96 if (!
track.trackSummary()) {
112 if (numTRT >= 15 && ((
double)(numTRT - numTRTTube)) / numTRT <
m_minTRTprecision) {
122 if (numTRT_plusOutliers < minTRT) {
159 if (
track.fitQuality() !=
nullptr &&
track.fitQuality()->chiSquared() > 0 &&
track.fitQuality()->numberDoF() > 0) {
160 double p = 1.0 - Genfun::CumulativeChiSquare(
track.fitQuality()->numberDoF())(
track.fitQuality()->chiSquared());
179 double pt = std::abs(
track.trackParameters()->front()->pT());
180 double prob = log10(
pt) - 1.;
191 double nTrtExpected = 30.;
194 double ratio = iTRT_Hits / nTrtExpected;
206 double fitted =
double(iTRT_Hits) /
double(iTRT_Hits + iTRT_Outliers);
220 if (
track.fitQuality() !=
nullptr &&
track.fitQuality()->chiSquared() > 0 &&
track.fitQuality()->numberDoF() > 0) {
221 int indf =
track.fitQuality()->numberDoF();
222 double chi2 =
track.fitQuality()->chiSquared();
223 double fac = 1. / log10(10. + 10. *
chi2 / indf);
231 int indf =
track.fitQuality()->numberDoF();
232 double ichi2 =
track.fitQuality()->chiSquared();
239 if (sigmaChi2times100 > 0) {
240 double testvar =
double(sigmaChi2times100) / 100. - sqrt(2. * ichi2 / indf);
269 constexpr
int maxTrtRatio = 7;
270 constexpr
double TrtRatioBounds[maxTrtRatio + 1] = { 0, 0.2, 0.4, 0.6,
271 0.8, 1.0, 1.2, 2.4 };
273 constexpr
double goodTrtRatio[maxTrtRatio] = { 0.05, 0.11, 0.12, 0.15,
275 constexpr
double fakeTrtRatio[maxTrtRatio] = { 0.6, 0.08, 0.06, 0.05,
287 const int maxTrtFittedRatio = 4;
288 const double TrtFittedRatioBounds[maxTrtFittedRatio + 1] = { 0, 0.3, 0.6, 0.9, 1.0 };
290 const double goodTrtFittedRatio[maxTrtFittedRatio] = { 0.1, 0.2, 0.3, 0.5 };
291 const double fakeTrtFittedRatio[maxTrtFittedRatio] = { 0.6, 0.1, 0.1, 0.1 };
306 constexpr
int maxSigmaChi2 = 26;
307 constexpr
double SigmaChi2Bounds[maxSigmaChi2 + 1] = {
308 -5.0, -4.5, -4.0, -3.5, -3.0, -2.5, -2.0, -1.5, -1.0,
309 -0.5, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5,
310 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0
312 constexpr
double modiSigmaChi2[maxSigmaChi2] = {
313 0.0001, 0.0001, 0.0001, 0.0001, 0.001, 0.005, 0.024, 0.255, 0.644,
314 0.045, 0.008, 0.005, 0.004, 0.003, 0.002, 0.001, 0.001, 0.001,
315 0.001, 0.001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001
317 constexpr
double vetoSigmaChi2[maxSigmaChi2] = {
318 0.001, 0.001, 0.001, 0.003, 0.014, 0.030, 0.079, 0.244, 0.295,
319 0.064, 0.029, 0.028, 0.030, 0.026, 0.023, 0.023, 0.021, 0.019,
320 0.016, 0.018, 0.012, 0.009, 0.007, 0.005, 0.001, 0.001
324 for (
int i = 0;
i < maxSigmaChi2; ++
i) {
325 if (vetoSigmaChi2[
i] == 0.0)
330 for (
int i = 0;
i < maxSigmaChi2; ++
i)
344 int firstWheel = -999;
345 int lastLayer = -999;
374 if (isB == 2 || isB == -2)
376 else if (isB == 1 || isB == -1)
391 if ((nEC > 0 && nBRL > 0) || (nEC == 0 && nBRL > 0 && lastLayer < 2) ||
392 (nEC > 0 && nBRL == 0 && (firstWheel > 10 || firstWheel < 2))) {
412 return nTRT > nCutTRT;
422 double abs_eta = (tanThetaOver2 == 0) ? 999.0 : std::abs(
std::log(tanThetaOver2));
440 float avg_mu =
m_lumiBlockMuTool->averageInteractionsPerCrossing(Gaudi::Hive::currentContext());