6 #include "CLHEP/GenericFunctions/CumulativeChiSquare.hh"
25 , m_maxTrtFittedRatio(-1)
27 , m_selectortool(
"InDet::InDetTrtDriftCircleCutTool")
29 declareInterface<Trk::ITrackScoringTool>(
this);
39 for (
unsigned int i = 0;
i < 10; ++
i) {
72 return StatusCode::FAILURE;
81 return StatusCode::SUCCESS;
89 if (!
track.trackSummary()) {
105 if (numTRT >= 15 && ((
double)(numTRT - numTRTTube)) / numTRT <
m_minTRTprecision) {
115 if (numTRT_plusOutliers < minTRT) {
130 const EventContext& ctx = Gaudi::Hive::currentContext();
133 if (fieldCondObj ==
nullptr) {
134 ATH_MSG_ERROR(
"simpleScore: Failed to retrieve AtlasFieldCacheCondObj with key "
139 fieldCondObj->getInitializedCache(fieldCache);
178 if (
track.fitQuality() !=
nullptr &&
track.fitQuality()->chiSquared() > 0 &&
track.fitQuality()->numberDoF() > 0) {
179 double p = 1.0 - Genfun::CumulativeChiSquare(
track.fitQuality()->numberDoF())(
track.fitQuality()->chiSquared());
198 double pt = fabs(
track.trackParameters()->front()->pT());
199 double prob = log10(
pt) - 1.;
210 double nTrtExpected = 30.;
213 double ratio = iTRT_Hits / nTrtExpected;
225 double fitted =
double(iTRT_Hits) /
double(iTRT_Hits + iTRT_Outliers);
239 if (
track.fitQuality() !=
nullptr &&
track.fitQuality()->chiSquared() > 0 &&
track.fitQuality()->numberDoF() > 0) {
240 int indf =
track.fitQuality()->numberDoF();
241 double chi2 =
track.fitQuality()->chiSquared();
242 double fac = 1. / log10(10. + 10. *
chi2 / indf);
250 int indf =
track.fitQuality()->numberDoF();
251 double ichi2 =
track.fitQuality()->chiSquared();
258 if (sigmaChi2times100 > 0) {
259 double testvar =
double(sigmaChi2times100) / 100. - sqrt(2. * ichi2 / indf);
288 constexpr
int maxTrtRatio = 7;
289 constexpr
double TrtRatioBounds[maxTrtRatio + 1] = { 0, 0.2, 0.4, 0.6,
290 0.8, 1.0, 1.2, 2.4 };
292 constexpr
double goodTrtRatio[maxTrtRatio] = { 0.05, 0.11, 0.12, 0.15,
294 constexpr
double fakeTrtRatio[maxTrtRatio] = { 0.6, 0.08, 0.06, 0.05,
306 const int maxTrtFittedRatio = 4;
307 const double TrtFittedRatioBounds[maxTrtFittedRatio + 1] = { 0, 0.3, 0.6, 0.9, 1.0 };
309 const double goodTrtFittedRatio[maxTrtFittedRatio] = { 0.1, 0.2, 0.3, 0.5 };
310 const double fakeTrtFittedRatio[maxTrtFittedRatio] = { 0.6, 0.1, 0.1, 0.1 };
325 constexpr
int maxSigmaChi2 = 26;
326 constexpr
double SigmaChi2Bounds[maxSigmaChi2 + 1] = {
327 -5.0, -4.5, -4.0, -3.5, -3.0, -2.5, -2.0, -1.5, -1.0,
328 -0.5, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5,
329 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0
331 constexpr
double modiSigmaChi2[maxSigmaChi2] = {
332 0.0001, 0.0001, 0.0001, 0.0001, 0.001, 0.005, 0.024, 0.255, 0.644,
333 0.045, 0.008, 0.005, 0.004, 0.003, 0.002, 0.001, 0.001, 0.001,
334 0.001, 0.001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001
336 constexpr
double vetoSigmaChi2[maxSigmaChi2] = {
337 0.001, 0.001, 0.001, 0.003, 0.014, 0.030, 0.079, 0.244, 0.295,
338 0.064, 0.029, 0.028, 0.030, 0.026, 0.023, 0.023, 0.021, 0.019,
339 0.016, 0.018, 0.012, 0.009, 0.007, 0.005, 0.001, 0.001
343 for (
int i = 0;
i < maxSigmaChi2; ++
i) {
344 if (vetoSigmaChi2[
i] == 0.0)
349 for (
int i = 0;
i < maxSigmaChi2; ++
i)
363 int firstWheel = -999;
364 int lastLayer = -999;
393 if (isB == 2 || isB == -2)
395 else if (isB == 1 || isB == -1)
410 if ((nEC > 0 && nBRL > 0) || (nEC == 0 && nBRL > 0 && lastLayer < 2) ||
411 (nEC > 0 && nBRL == 0 && (firstWheel > 10 || firstWheel < 2))) {
431 return nTRT > nCutTRT;
441 double abs_eta = (tanThetaOver2 == 0) ? 999.0 : std::fabs(
std::log(tanThetaOver2));