ATLAS Offline Software
Loading...
Searching...
No Matches
InDet::InDetTrtTrackScoringTool Class Reference

Concrete implementation of the ITrackScoringTool pABC. More...

#include <InDetTrtTrackScoringTool.h>

Inheritance diagram for InDet::InDetTrtTrackScoringTool:
Collaboration diagram for InDet::InDetTrtTrackScoringTool:

Public Member Functions

 InDetTrtTrackScoringTool (const std::string &, const std::string &, const IInterface *)
virtual ~InDetTrtTrackScoringTool ()=default
virtual StatusCode initialize () override
virtual bool passBasicSelections (const Trk::Track &track) const override
 check track selections independent from TrackSummary
virtual Trk::TrackScore score (const Trk::Track &track, bool checkBasicSel) const override
 create a score based on how good the passed track is
virtual Trk::TrackScore simpleScore (const Trk::Track &track, const Trk::TrackSummary &trackSum) const override
 create a score based on how good the passed TrackSummary is
Trk::TrackScore TRT_ambigScore (const Trk::Track &track, const Trk::TrackSummary &trackSum) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

void setupTRT_ScoreModifiers ()
bool isGoodTRT (const Trk::Track &) const
 Decide whether standalone TRT tracks pass the minimum hit requirement.
unsigned int getEtaBin (const Trk::Perigee &perigee) const
double getMuDependentNtrtMinCut (unsigned int eta_bin) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

const TRT_IDm_trtId
 ID TRT helper.
int m_maxSigmaChi2 = -1
int m_maxTrtRatio = -1
int m_maxTrtFittedRatio = -1
std::vector< double > m_factorSigmaChi2
std::vector< double > m_factorTrtRatio
std::vector< double > m_factorTrtFittedRatio
std::vector< double > m_boundsSigmaChi2
std::vector< double > m_boundsTrtRatio
std::vector< double > m_boundsTrtFittedRatio
BooleanProperty m_useAmbigFcn {this, "useAmbigFcn", true}
 use the scoring tuned to Ambiguity processing or not
BooleanProperty m_useSigmaChi2 {this, "useSigmaChi2", false}
std::vector< Trk::TrackScorem_summaryTypeScore
 holds the scores assigned to each Trk::SummaryType from the track's Trk::TrackSummary
ToolHandle< ITrtDriftCircleCutToolm_selectortool {this, "DriftCircleCutTool", "InDet::InDetTrtDriftCircleCutTool"}
 Returns minimum number of expected TRT drift circles depending on eta.
SG::ReadCondHandleKey< AtlasFieldCacheCondObjm_fieldCacheCondObjInputKey
ToolHandle< ILumiBlockMuToolm_lumiBlockMuTool
IntegerProperty m_minTRTonTrk {this, "minTRTonTrk", 15, "minimum number of TRT hits"}
 cuts for selecting good tracks
DoubleProperty m_maxEta {this, "maxEta", 2.1, "maximal Eta cut"}
DoubleProperty m_ptmin {this, "PtMin", 1.0, "Minimum Pt"}
BooleanProperty m_parameterization {this, "UseParameterization", true, "use parameterization to cut instead of custom cut"}
BooleanProperty m_oldLogic {this, "OldTransitionLogic", false, "use old transition hit logic"}
DoubleProperty m_minTRTprecision {this, "minTRTPrecisionFraction", 0.5, "minimum fraction of TRT precision hits"}
DoubleArrayProperty m_TRTTrksEtaBins
DoubleArrayProperty m_TRTTrksMinTRTHitsThresholds
DoubleArrayProperty m_TRTTrksMinTRTHitsMuDependencies
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Concrete implementation of the ITrackScoringTool pABC.

Definition at line 34 of file InDetTrtTrackScoringTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ InDetTrtTrackScoringTool()

InDet::InDetTrtTrackScoringTool::InDetTrtTrackScoringTool ( const std::string & t,
const std::string & n,
const IInterface * p )

Definition at line 18 of file InDetTrtTrackScoringTool.cxx.

21 : AthAlgTool(t, n, p)
22 , m_trtId(nullptr)
24{
25 declareInterface<Trk::ITrackScoringTool>(this);
26
27 // declare properties
28 m_summaryTypeScore[Trk::numberOfTRTHits] = 1; // 10 straws ~ 1 SCT
29 m_summaryTypeScore[Trk::numberOfTRTHighThresholdHits] = 0; // addition for being TR
30}
AthAlgTool()
Default constructor:
std::vector< Trk::TrackScore > m_summaryTypeScore
holds the scores assigned to each Trk::SummaryType from the track's Trk::TrackSummary
const TRT_ID * m_trtId
ID TRT helper.
@ numberOfTRTHighThresholdHits
total number of TRT hits which pass the high threshold

◆ ~InDetTrtTrackScoringTool()

virtual InDet::InDetTrtTrackScoringTool::~InDetTrtTrackScoringTool ( )
virtualdefault

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ getEtaBin()

unsigned int InDet::InDetTrtTrackScoringTool::getEtaBin ( const Trk::Perigee & perigee) const
private

Definition at line 417 of file InDetTrtTrackScoringTool.cxx.

418{
419 // Find the correct bin for applying eta-dependent cuts
420
421 double tanThetaOver2 = std::tan(perigee.parameters()[Trk::theta] / 2.);
422 double abs_eta = (tanThetaOver2 == 0) ? 999.0 : std::abs(std::log(tanThetaOver2));
423
424 for (unsigned int i = 0; i < m_TRTTrksEtaBins.size(); ++i) {
425 if (abs_eta < m_TRTTrksEtaBins[i]) {
426 return i;
427 }
428 }
429 return m_TRTTrksEtaBins.size() - 1;
430}
@ theta
Definition ParamDefs.h:66

◆ getMuDependentNtrtMinCut()

double InDet::InDetTrtTrackScoringTool::getMuDependentNtrtMinCut ( unsigned int eta_bin) const
private

Definition at line 433 of file InDetTrtTrackScoringTool.cxx.

434{
435
436 double minTRT = m_TRTTrksMinTRTHitsThresholds[eta_bin];
437
438 if (m_TRTTrksMinTRTHitsMuDependencies[eta_bin] > 0) {
439
440 float avg_mu = m_lumiBlockMuTool->averageInteractionsPerCrossing(Gaudi::Hive::currentContext());
441
442 // The mu-dependent cuts have only been validted up to mu = 80.
443 // Also there is some physical limit to nTRT, so at some point
444 // there needs to be a ceiling for this threshold.
445 // To be revisited when a higher mu value is reached.
446 avg_mu = std::min(80.f,avg_mu);
447
448 // minTRT = a + avg_mu * b
449 minTRT += avg_mu * m_TRTTrksMinTRTHitsMuDependencies[eta_bin];
450 }
451
452 return minTRT;
453}
DoubleArrayProperty m_TRTTrksMinTRTHitsMuDependencies
ToolHandle< ILumiBlockMuTool > m_lumiBlockMuTool

◆ initialize()

StatusCode InDet::InDetTrtTrackScoringTool::initialize ( )
overridevirtual

Definition at line 35 of file InDetTrtTrackScoringTool.cxx.

36{
37 ATH_CHECK(m_selectortool.retrieve( DisableTool{m_selectortool.empty() } ));
38 ATH_CHECK(m_lumiBlockMuTool.retrieve());
39
40 if (detStore()->retrieve(m_trtId, "TRT_ID").isFailure()) {
41 ATH_MSG_FATAL("Could not get TRT_ID helper !");
42 return StatusCode::FAILURE;
43 }
44 if (m_useAmbigFcn) {
46 }
47
48 // Read handle for AtlasFieldCacheCondObj
50
51 return StatusCode::SUCCESS;
52}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
const ServiceHandle< StoreGateSvc > & detStore() const
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
BooleanProperty m_useAmbigFcn
use the scoring tuned to Ambiguity processing or not
ToolHandle< ITrtDriftCircleCutTool > m_selectortool
Returns minimum number of expected TRT drift circles depending on eta.
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & Trk::ITrackScoringTool::interfaceID ( )
inlinestaticinherited

Definition at line 37 of file ITrackScoringTool.h.

38{
40}
static const InterfaceID IID_ITrackScoringTool("Trk::ITrackScoringTool", 1, 0)

◆ isGoodTRT()

bool InDet::InDetTrtTrackScoringTool::isGoodTRT ( const Trk::Track & track) const
private

Decide whether standalone TRT tracks pass the minimum hit requirement.

Definition at line 336 of file InDetTrtTrackScoringTool.cxx.

337{
338
339 int nTRT = 0;
340
341 // some cointer for the custom cuts
342 int nEC = 0;
343 int nBRL = 0;
344 int firstWheel = -999;
345 int lastLayer = -999;
346
347 // get list of measurements
348 const DataVector<const Trk::MeasurementBase>* trkV = track.measurementsOnTrack();
349
350 // loop over the measurements
352 for (im = trkV->begin(); im != ime; ++im) {
353
354 const InDet::TRT_DriftCircleOnTrack* trtcircle = nullptr;
355 // Make sure is not a pseudomeasurement
356 if ((*im)->type(Trk::MeasurementBaseType::RIO_OnTrack)) {
357 const Trk::RIO_OnTrack* rot = static_cast<const Trk::RIO_OnTrack*>((*im));
358 // is it really a TRT ?
360 trtcircle = static_cast<const InDet::TRT_DriftCircleOnTrack*>(*im);
361 }
362 }
363 if (!trtcircle) {
364 continue;
365 }
366
367 // increment measurment
368 ++nTRT;
369
370 // compute some transition area variables...
372 Identifier id = trtcircle->detectorElement()->identify();
373 int isB = m_trtId->barrel_ec(id);
374 if (isB == 2 || isB == -2)
375 nEC++;
376 else if (isB == 1 || isB == -1)
377 nBRL++;
378 if (nBRL > 0)
379 lastLayer = m_trtId->layer_or_wheel(id);
380 if (nEC == 1)
381 firstWheel = m_trtId->layer_or_wheel(id);
382 }
383 }
384
385 if (!m_parameterization) {
386
387 bool toLower = false;
388
389 // Cases where the min number of required TRT drift circles drops to 10
390 if (m_oldLogic && int(trkV->size()) <= m_minTRTonTrk) {
391 if ((nEC > 0 && nBRL > 0) || (nEC == 0 && nBRL > 0 && lastLayer < 2) ||
392 (nEC > 0 && nBRL == 0 && (firstWheel > 10 || firstWheel < 2))) {
393 toLower = true;
394 }
395 }
396
397 if ((int(trkV->size()) > m_minTRTonTrk) || toLower) {
398 return true; // Ask for a minimum number of TRT hits to process
399 } else {
400 return false;
401 }
402 } else {
403
404 // new pass, this is using the parameterization
405 const DataVector<const Trk::TrackParameters>* vpar = track.trackParameters();
406 const Trk::TrackParameters* par = (*vpar)[0];
407 int nCutTRT = m_minTRTonTrk;
408 assert( m_selectortool.isEnabled() );
409 int expected = m_selectortool->minNumberDCs(par);
410 if (expected > m_minTRTonTrk)
411 nCutTRT = expected;
412 return nTRT > nCutTRT;
413 }
414}
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual Identifier identify() const override final
identifier of this detector element:
IntegerProperty m_minTRTonTrk
cuts for selecting good tracks
virtual const InDetDD::TRT_BaseElement * detectorElement() const override final
returns the detector element, assoicated with the PRD of this class
virtual bool rioType(RIO_OnTrackType::Type type) const =0
Method checking the Rio On Track type.
ParametersBase< TrackParametersDim, Charged > TrackParameters

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ passBasicSelections()

bool InDet::InDetTrtTrackScoringTool::passBasicSelections ( const Trk::Track & track) const
overridevirtual

check track selections independent from TrackSummary

Reject track below the pT cut

Implements Trk::ITrackScoringTool.

Definition at line 55 of file InDetTrtTrackScoringTool.cxx.

56{
57 // get parameters without error - this is faster
58 const Trk::TrackParameters* input = track.trackParameters()->front();
59
61
62 const EventContext& ctx = Gaudi::Hive::currentContext();
63 SG::ReadCondHandle<AtlasFieldCacheCondObj> readHandle{ m_fieldCacheCondObjInputKey, ctx };
64 const AtlasFieldCacheCondObj* fieldCondObj{ *readHandle };
65 if (fieldCondObj == nullptr) {
66 ATH_MSG_ERROR("simpleScore: Failed to retrieve AtlasFieldCacheCondObj with key "
68 return false;
69 }
70 MagField::AtlasFieldCache fieldCache;
71 fieldCondObj->getInitializedCache(fieldCache);
72
73 if (fieldCache.solenoidOn()) { // B field
74 if (input->pT() < m_ptmin) {
75 ATH_MSG_DEBUG("Reject track below Pt cut !");
76 return false;
77 }
78 }
79
80 if (std::abs(input->eta()) > m_maxEta) {
81 return false;
82 }
83
84 return true;
85}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
void getInitializedCache(MagField::AtlasFieldCache &cache) const
get B field cache for evaluation as a function of 2-d or 3-d position.
bool solenoidOn() const
status of the magnets

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ score()

Trk::TrackScore InDet::InDetTrtTrackScoringTool::score ( const Trk::Track & track,
bool checkBasicSel ) const
overridevirtual

create a score based on how good the passed track is

Implements Trk::ITrackScoringTool.

Definition at line 90 of file InDetTrtTrackScoringTool.cxx.

91{
92 if(checkBasicSel && !passBasicSelections(track)){
93 ATH_MSG_VERBOSE ("Track fail basic selections");
94 return Trk::TrackScore(0);
95 }
96 if (!track.trackSummary()) {
97 ATH_MSG_FATAL("Track without a summary");
98 }
99 Trk::TrackScore score = Trk::TrackScore(simpleScore(track, *track.trackSummary()));
100 return score;
101}
#define ATH_MSG_VERBOSE(x)
virtual Trk::TrackScore simpleScore(const Trk::Track &track, const Trk::TrackSummary &trackSum) const override
create a score based on how good the passed TrackSummary is
virtual Trk::TrackScore score(const Trk::Track &track, bool checkBasicSel) const override
create a score based on how good the passed track is
virtual bool passBasicSelections(const Trk::Track &track) const override
check track selections independent from TrackSummary
float TrackScore
Definition TrackScore.h:10

◆ setupTRT_ScoreModifiers()

void InDet::InDetTrtTrackScoringTool::setupTRT_ScoreModifiers ( )
private

Definition at line 263 of file InDetTrtTrackScoringTool.cxx.

264{
265
266 //
267 // --- ratio of TRT hits over expected
268 //
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 };
272 // this needs tuning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
273 constexpr double goodTrtRatio[maxTrtRatio] = { 0.05, 0.11, 0.12, 0.15,
274 0.20, 0.16, 0.17 };
275 constexpr double fakeTrtRatio[maxTrtRatio] = { 0.6, 0.08, 0.06, 0.05,
276 0.04, 0.03, 0.03 };
277 // put it into the private members
278 m_maxTrtRatio = m_selectortool.isEnabled() ? maxTrtRatio : 0;
279 for (int i = 0; i < m_maxTrtRatio; ++i)
280 m_factorTrtRatio.push_back(goodTrtRatio[i] / fakeTrtRatio[i]);
281 for (int i = 0; i <= m_maxTrtRatio; ++i)
282 m_boundsTrtRatio.push_back(TrtRatioBounds[i]);
283
284 //
285 // --- ratio of TRT fitted to (fitted+outliers)
286 //
287 const int maxTrtFittedRatio = 4;
288 const double TrtFittedRatioBounds[maxTrtFittedRatio + 1] = { 0, 0.3, 0.6, 0.9, 1.0 };
289 // this needs tuning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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 };
292 // put it into the private members
293 m_maxTrtFittedRatio = maxTrtFittedRatio;
294 for (int i = 0; i < m_maxTrtFittedRatio; ++i)
295 m_factorTrtFittedRatio.push_back(goodTrtFittedRatio[i] / fakeTrtFittedRatio[i]);
296 for (int i = 0; i <= m_maxTrtFittedRatio; ++i)
297 m_boundsTrtFittedRatio.push_back(TrtFittedRatioBounds[i]);
298
299 //
300 // --- sigma chi2
301 //
302 if (!m_useSigmaChi2) {
303 // do not use it !
304 m_maxSigmaChi2 = -1;
305 } else {
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
311 };
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
316 };
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
321 };
322 // put it into the private members
323 m_maxSigmaChi2 = maxSigmaChi2;
324 for (int i = 0; i < maxSigmaChi2; ++i) {
325 if (vetoSigmaChi2[i] == 0.0)
326 m_factorSigmaChi2.push_back(1.0);
327 else
328 m_factorSigmaChi2.push_back(modiSigmaChi2[i] / vetoSigmaChi2[i]);
329 }
330 for (int i = 0; i < maxSigmaChi2; ++i)
331 m_boundsSigmaChi2.push_back(SigmaChi2Bounds[i]);
332 }
333}

◆ simpleScore()

Trk::TrackScore InDet::InDetTrtTrackScoringTool::simpleScore ( const Trk::Track & track,
const Trk::TrackSummary & trackSum ) const
overridevirtual

create a score based on how good the passed TrackSummary is

Implements Trk::ITrackScoringTool.

Definition at line 106 of file InDetTrtTrackScoringTool.cxx.

107{
108 int numTRT = trackSummary.get(Trk::numberOfTRTHits);
109 int numTRTTube = trackSummary.get(Trk::numberOfTRTTubeHits);
110
111 // TRT precision hits cut
112 if (numTRT >= 15 && ((double)(numTRT - numTRTTube)) / numTRT < m_minTRTprecision) {
113 return Trk::TrackScore(0);
114 }
115
116 const Trk::Perigee* perigee = track.perigeeParameters();
117 int numTRT_plusOutliers = numTRT + trackSummary.get(Trk::numberOfTRTOutliers);
118 unsigned int eta_bin = getEtaBin(*perigee);
119 double minTRT = getMuDependentNtrtMinCut(eta_bin);
120
121 // nTRT cut from egamma optimization
122 if (numTRT_plusOutliers < minTRT) {
123 return Trk::TrackScore(0);
124 }
125
126 // Cut on the minimum number of hits
127 bool isGood = m_selectortool.isEnabled() ? isGoodTRT(track) : true;
128 if (!isGood) {
129 return Trk::TrackScore(0);
130 }
131
132 //
133 // --- Now Start Scoring
134 //
135
136 if (m_useAmbigFcn) {
137
138 //
139 // -- modern score
140 //
141 return TRT_ambigScore(track, trackSummary);
142
143 } else {
144
145 //
146 // --classical scoring !
147 //
148 // score of 100 per track
150 // --- summary score analysis
151 for (int i = 0; i < Trk::numberOfTrackSummaryTypes; ++i) {
152 int value = trackSummary.get(static_cast<Trk::SummaryType>(i));
153 // value is -1 if undefined.
154 if (value > 0) {
156 }
157 }
158 // --- prob(chi2,NDF), protect for chi2 <= 0
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());
161 if (p > 0)
162 score += log10(p);
163 else
164 score -= 50;
165 }
166 return score;
167 }
168}
unsigned int getEtaBin(const Trk::Perigee &perigee) const
bool isGoodTRT(const Trk::Track &) const
Decide whether standalone TRT tracks pass the minimum hit requirement.
Trk::TrackScore TRT_ambigScore(const Trk::Track &track, const Trk::TrackSummary &trackSum) const
double getMuDependentNtrtMinCut(unsigned int eta_bin) const
float chiSquared(const U &p)
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
SummaryType
enumerates the different types of information stored in Summary.
@ numberOfTRTTubeHits
number of TRT hits on track in straws with xenon

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ TRT_ambigScore()

Trk::TrackScore InDet::InDetTrtTrackScoringTool::TRT_ambigScore ( const Trk::Track & track,
const Trk::TrackSummary & trackSum ) const

Definition at line 173 of file InDetTrtTrackScoringTool.cxx.

174{
175 //
176 // --- start with bonus for high pt tracks
177 //
178 // double prob = 1.;
179 double pt = std::abs(track.trackParameters()->front()->pT());
180 double prob = log10(pt) - 1.; // 100 MeV is min and gets score 1
181
182 //
183 // --- special treatment for TRT hits
184 //
185 int iTRT_Hits = trackSummary.get(Trk::numberOfTRTHits);
186 int iTRT_Outliers = trackSummary.get(Trk::numberOfTRTOutliers);
187 //
188
189 if (iTRT_Hits > 0 && m_maxTrtRatio > 0) {
190 // get expected number of TRT hits
191 double nTrtExpected = 30.;
192 assert( m_selectortool.isEnabled());
193 nTrtExpected = m_selectortool->minNumberDCs(track.trackParameters()->front());
194 double ratio = iTRT_Hits / nTrtExpected;
195 if (ratio > m_boundsTrtRatio[m_maxTrtRatio])
197 for (int i = 0; i < m_maxTrtRatio; ++i) {
198 if (m_boundsTrtRatio[i] < ratio && ratio <= m_boundsTrtRatio[i + 1]) {
200 break;
201 }
202 }
203 }
204
205 if (iTRT_Hits > 0 && iTRT_Outliers >= 0 && m_maxTrtFittedRatio > 0) {
206 double fitted = double(iTRT_Hits) / double(iTRT_Hits + iTRT_Outliers);
209 for (int i = 0; i < m_maxTrtFittedRatio; ++i) {
210 if (fitted <= m_boundsTrtFittedRatio[i + 1]) {
212 break;
213 }
214 }
215 }
216
217 //
218 // --- non binned Chi2
219
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); // very soft chi2
224 prob *= fac;
225 }
226
227 //
228 // --- do we use the binned prob for chi2/NDF or sigma chi2 ?
229 //
230 if ((m_useSigmaChi2) && track.fitQuality()) {
231 int indf = track.fitQuality()->numberDoF();
232 double ichi2 = track.fitQuality()->chiSquared();
233 if (indf > 0) {
234 //
235 // --- binned sigma chi2 score
236 //
237 if (m_useSigmaChi2) {
238 int sigmaChi2times100 = trackSummary.get(Trk::standardDeviationOfChi2OS);
239 if (sigmaChi2times100 > 0) {
240 double testvar = double(sigmaChi2times100) / 100. - sqrt(2. * ichi2 / indf);
241 if (testvar < m_boundsSigmaChi2[0]) {
243 } else if (m_boundsSigmaChi2[m_maxSigmaChi2] <= testvar) {
245 } else {
246 for (int i = 0; i < m_maxSigmaChi2; ++i) {
247 if (m_boundsSigmaChi2[i] <= testvar && testvar < m_boundsSigmaChi2[i + 1]) {
249 }
250 }
251 }
252 }
253 }
254 }
255 }
256
258 return score;
259}
double chi2(TH1 *h0, TH1 *h1)

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_boundsSigmaChi2

std::vector<double> InDet::InDetTrtTrackScoringTool::m_boundsSigmaChi2
private

Definition at line 80 of file InDetTrtTrackScoringTool.h.

◆ m_boundsTrtFittedRatio

std::vector<double> InDet::InDetTrtTrackScoringTool::m_boundsTrtFittedRatio
private

Definition at line 81 of file InDetTrtTrackScoringTool.h.

◆ m_boundsTrtRatio

std::vector<double> InDet::InDetTrtTrackScoringTool::m_boundsTrtRatio
private

Definition at line 80 of file InDetTrtTrackScoringTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_factorSigmaChi2

std::vector<double> InDet::InDetTrtTrackScoringTool::m_factorSigmaChi2
private

Definition at line 77 of file InDetTrtTrackScoringTool.h.

◆ m_factorTrtFittedRatio

std::vector<double> InDet::InDetTrtTrackScoringTool::m_factorTrtFittedRatio
private

Definition at line 78 of file InDetTrtTrackScoringTool.h.

◆ m_factorTrtRatio

std::vector<double> InDet::InDetTrtTrackScoringTool::m_factorTrtRatio
private

Definition at line 77 of file InDetTrtTrackScoringTool.h.

◆ m_fieldCacheCondObjInputKey

SG::ReadCondHandleKey<AtlasFieldCacheCondObj> InDet::InDetTrtTrackScoringTool::m_fieldCacheCondObjInputKey
private
Initial value:
{
this,
"AtlasFieldCacheCondObj",
"fieldCondObj",
"Name of the Magnetic Field conditions object key"
}

Definition at line 96 of file InDetTrtTrackScoringTool.h.

96 {
97 this,
98 "AtlasFieldCacheCondObj",
99 "fieldCondObj",
100 "Name of the Magnetic Field conditions object key"
101 };

◆ m_lumiBlockMuTool

ToolHandle<ILumiBlockMuTool> InDet::InDetTrtTrackScoringTool::m_lumiBlockMuTool
private
Initial value:
{
this,
"LuminosityTool",
"LumiBlockMuTool/LumiBlockMuTool",
"Luminosity Tool"
}

Definition at line 103 of file InDetTrtTrackScoringTool.h.

103 {
104 this,
105 "LuminosityTool",
106 "LumiBlockMuTool/LumiBlockMuTool",
107 "Luminosity Tool"
108 };

◆ m_maxEta

DoubleProperty InDet::InDetTrtTrackScoringTool::m_maxEta {this, "maxEta", 2.1, "maximal Eta cut"}
private

Definition at line 113 of file InDetTrtTrackScoringTool.h.

113{this, "maxEta", 2.1, "maximal Eta cut"};

◆ m_maxSigmaChi2

int InDet::InDetTrtTrackScoringTool::m_maxSigmaChi2 = -1
private

Definition at line 75 of file InDetTrtTrackScoringTool.h.

◆ m_maxTrtFittedRatio

int InDet::InDetTrtTrackScoringTool::m_maxTrtFittedRatio = -1
private

Definition at line 75 of file InDetTrtTrackScoringTool.h.

◆ m_maxTrtRatio

int InDet::InDetTrtTrackScoringTool::m_maxTrtRatio = -1
private

Definition at line 75 of file InDetTrtTrackScoringTool.h.

◆ m_minTRTonTrk

IntegerProperty InDet::InDetTrtTrackScoringTool::m_minTRTonTrk {this, "minTRTonTrk", 15, "minimum number of TRT hits"}
private

cuts for selecting good tracks

Definition at line 111 of file InDetTrtTrackScoringTool.h.

112{this, "minTRTonTrk", 15, "minimum number of TRT hits"};

◆ m_minTRTprecision

DoubleProperty InDet::InDetTrtTrackScoringTool::m_minTRTprecision {this, "minTRTPrecisionFraction", 0.5, "minimum fraction of TRT precision hits"}
private

Definition at line 119 of file InDetTrtTrackScoringTool.h.

120{this, "minTRTPrecisionFraction", 0.5, "minimum fraction of TRT precision hits"};

◆ m_oldLogic

BooleanProperty InDet::InDetTrtTrackScoringTool::m_oldLogic {this, "OldTransitionLogic", false, "use old transition hit logic"}
private

Definition at line 117 of file InDetTrtTrackScoringTool.h.

118{this, "OldTransitionLogic", false, "use old transition hit logic"};

◆ m_parameterization

BooleanProperty InDet::InDetTrtTrackScoringTool::m_parameterization {this, "UseParameterization", true, "use parameterization to cut instead of custom cut"}
private

Definition at line 115 of file InDetTrtTrackScoringTool.h.

116{this, "UseParameterization", true, "use parameterization to cut instead of custom cut"};

◆ m_ptmin

DoubleProperty InDet::InDetTrtTrackScoringTool::m_ptmin {this, "PtMin", 1.0, "Minimum Pt"}
private

Definition at line 114 of file InDetTrtTrackScoringTool.h.

114{this, "PtMin", 1.0, "Minimum Pt"};

◆ m_selectortool

ToolHandle<ITrtDriftCircleCutTool> InDet::InDetTrtTrackScoringTool::m_selectortool {this, "DriftCircleCutTool", "InDet::InDetTrtDriftCircleCutTool"}
private

Returns minimum number of expected TRT drift circles depending on eta.

Definition at line 92 of file InDetTrtTrackScoringTool.h.

93{this, "DriftCircleCutTool", "InDet::InDetTrtDriftCircleCutTool"};

◆ m_summaryTypeScore

std::vector<Trk::TrackScore> InDet::InDetTrtTrackScoringTool::m_summaryTypeScore
private

holds the scores assigned to each Trk::SummaryType from the track's Trk::TrackSummary

Definition at line 89 of file InDetTrtTrackScoringTool.h.

◆ m_trtId

const TRT_ID* InDet::InDetTrtTrackScoringTool::m_trtId
private

ID TRT helper.

Definition at line 72 of file InDetTrtTrackScoringTool.h.

◆ m_TRTTrksEtaBins

DoubleArrayProperty InDet::InDetTrtTrackScoringTool::m_TRTTrksEtaBins
private
Initial value:
{this, "TRTTrksEtaBins",
{999., 999., 999., 999., 999., 999., 999., 999., 999., 999.},
"Eta bins (10 expected) for TRT-only track cuts"}

Definition at line 122 of file InDetTrtTrackScoringTool.h.

123 {this, "TRTTrksEtaBins",
124 {999., 999., 999., 999., 999., 999., 999., 999., 999., 999.},
125 "Eta bins (10 expected) for TRT-only track cuts"};

◆ m_TRTTrksMinTRTHitsMuDependencies

DoubleArrayProperty InDet::InDetTrtTrackScoringTool::m_TRTTrksMinTRTHitsMuDependencies
private
Initial value:
{this, "TRTTrksMinTRTHitsMuDependencies",
{0., 0., 0., 0., 0., 0., 0., 0., 0., 0.},
"Eta-bined Mu-dependent component for nTRT cut"}

Definition at line 130 of file InDetTrtTrackScoringTool.h.

131 {this, "TRTTrksMinTRTHitsMuDependencies",
132 {0., 0., 0., 0., 0., 0., 0., 0., 0., 0.},
133 "Eta-bined Mu-dependent component for nTRT cut"};

◆ m_TRTTrksMinTRTHitsThresholds

DoubleArrayProperty InDet::InDetTrtTrackScoringTool::m_TRTTrksMinTRTHitsThresholds
private
Initial value:
{this, "TRTTrksMinTRTHitsThresholds",
{0., 0., 0., 0., 0., 0., 0., 0., 0., 0.},
"Eta-binned nTRT cut for TRT-only cuts"}

Definition at line 126 of file InDetTrtTrackScoringTool.h.

127 {this, "TRTTrksMinTRTHitsThresholds",
128 {0., 0., 0., 0., 0., 0., 0., 0., 0., 0.},
129 "Eta-binned nTRT cut for TRT-only cuts"};

◆ m_useAmbigFcn

BooleanProperty InDet::InDetTrtTrackScoringTool::m_useAmbigFcn {this, "useAmbigFcn", true}
private

use the scoring tuned to Ambiguity processing or not

Definition at line 84 of file InDetTrtTrackScoringTool.h.

84{this, "useAmbigFcn", true};

◆ m_useSigmaChi2

BooleanProperty InDet::InDetTrtTrackScoringTool::m_useSigmaChi2 {this, "useSigmaChi2", false}
private

Definition at line 85 of file InDetTrtTrackScoringTool.h.

85{this, "useSigmaChi2", false};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: