ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::AmbiguityProcessorBase Class Referenceabstract

#include <AmbiguityProcessorBase.h>

Inheritance diagram for Trk::AmbiguityProcessorBase:
Collaboration diagram for Trk::AmbiguityProcessorBase:

Public Types

enum class  CounterIndex {
  kNcandidates , kNcandScoreZero , kNcandDouble , kNscoreOk ,
  kNscoreZeroBremRefit , kNscoreZeroBremRefitFailed , kNscoreZeroBremRefitScoreZero , kNscoreZero ,
  kNaccepted , kNsubTrack , kNnoSubTrack , kNacceptedBrem ,
  kNbremFits , kNfits , kNrecoveryBremFits , kNgoodFits ,
  kNfailedFits , kNCounter
}
using Counter = AmbiCounter<CounterIndex>
using TrackScoreMap = std::multimap<TrackScore, TrackPtr>

Public Member Functions

 AmbiguityProcessorBase (const std::string &, const std::string &, const IInterface *)
virtual ~AmbiguityProcessorBase ()=default
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
virtual const TrackCollectionprocess (const TrackCollection *, Trk::PRDtoTrackMap *prd_to_track_map=nullptr) const =0
 (in concrete object) Returns a processed TrackCollection from the passed 'tracks'
virtual const TrackCollectionprocess (const TracksScores *) const =0
virtual void statistics ()=0
 Print statistics at the end of the processing.

Static Public Member Functions

static const InterfaceID & interfaceID ()

Protected Types

using UniqueClusterSplitProbabilityContainerPtr

Protected Member Functions

bool shouldTryBremRecovery (const Trk::Track &track) const
bool shouldTryBremRecovery (const Trk::Track &track, const TrackParameters *pPar) const
virtual std::unique_ptr< Trk::TrackdoBremRefit (const Trk::Track &track) const =0
TrackrefitTrack (const Trk::Track *track, Trk::PRDtoTrackMap &prdToTrackMap, Counter &stat, int trackId, int subtrackId) const
 refit track
virtual Trk::TrackrefitPrds (const Trk::Track *track, Trk::PRDtoTrackMap &prdToTrackMap, Counter &stat) const =0
virtual Trk::TrackrefitRots (const Trk::Track *track, Counter &stat) const
virtual std::unique_ptr< Trk::Trackfit (const Track &track, bool flag, Trk::ParticleHypothesis hypo) const =0
void addTrack (Trk::Track *in_track, const bool fitted, TrackScoreMap &trackScoreTrackMap, std::vector< std::unique_ptr< const Trk::Track > > &trackDustbin, Counter &stat, int parentTrackId) const
const TrackParametersgetTrackParameters (const Trk::Track *track) const
StatusCode initializeClusterSplitProbContainer ()
 Initialize read and write handles for ClusterSplitProbabilityContainers.
AmbiguityProcessorBase::UniqueClusterSplitProbabilityContainerPtr createAndRecordClusterSplitProbContainer (const EventContext &ctx) const
 Create a new cluster splitting probability container and (optionally) record it in storegate The new container may be populated from an already existing container, and might be stored in StoreGate.
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.

Protected Attributes

std::vector< float > m_etaBounds
 eta intervals for internal monitoring
std::mutex m_statMutex
Counter m_stat ATLAS_THREAD_SAFE
ToolHandle< ITrackScoringToolm_scoringTool
 Scoring tool This tool is used to 'score' the tracks, i.e.
PublicToolHandle< Trk::ITrkObserverToolm_observerTool
 Observer tool This tool is used to observe the tracks and their 'score'.
ToolHandle< Trk::IExtendedTrackSummaryToolm_trackSummaryTool
bool m_tryBremFit {}
 brem recovery mode with brem fit ?
bool m_caloSeededBrem {}
float m_pTminBrem {1000.}
bool m_suppressHoleSearch {}
bool m_suppressTrackFit {}
bool m_refitPrds {}
bool m_forceRefit {true}
 by default tracks at input get refitted
int m_matEffects {3}
 read in as an integer and convert to particle hypothesis
Trk::ParticleHypothesis m_particleHypothesis {undefined}

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< Trk::ClusterSplitProbabilityContainerm_clusterSplitProbContainerIn
SG::WriteHandleKey< Trk::ClusterSplitProbabilityContainerm_clusterSplitProbContainerOut
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

Definition at line 35 of file AmbiguityProcessorBase.h.

Member Typedef Documentation

◆ Counter

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

◆ TrackScoreMap

Definition at line 59 of file AmbiguityProcessorBase.h.

◆ UniqueClusterSplitProbabilityContainerPtr

Initial value:
Container to associate Cluster with cluster splitting probabilities.

Definition at line 113 of file AmbiguityProcessorBase.h.

Member Enumeration Documentation

◆ CounterIndex

Enumerator
kNcandidates 
kNcandScoreZero 
kNcandDouble 
kNscoreOk 
kNscoreZeroBremRefit 
kNscoreZeroBremRefitFailed 
kNscoreZeroBremRefitScoreZero 
kNscoreZero 
kNaccepted 
kNsubTrack 
kNnoSubTrack 
kNacceptedBrem 
kNbremFits 
kNfits 
kNrecoveryBremFits 
kNgoodFits 
kNfailedFits 
kNCounter 

Definition at line 38 of file AmbiguityProcessorBase.h.

38 {
39 kNcandidates,
40 kNcandScoreZero,
41 kNcandDouble,
42 kNscoreOk,
43 kNscoreZeroBremRefit,
44 kNscoreZeroBremRefitFailed,
45 kNscoreZeroBremRefitScoreZero,
46 kNscoreZero,
47 kNaccepted,
48 kNsubTrack,
49 kNnoSubTrack,
50 kNacceptedBrem,
51 kNbremFits,
52 kNfits,
53 kNrecoveryBremFits,
54 kNgoodFits,
55 kNfailedFits,
56 kNCounter
57 };

Constructor & Destructor Documentation

◆ AmbiguityProcessorBase()

Trk::AmbiguityProcessorBase::AmbiguityProcessorBase ( const std::string & t,
const std::string & n,
const IInterface * p )

Definition at line 12 of file AmbiguityProcessorBase.cxx.

15 : AthAlgTool(t, n, p),
16 m_etaBounds{0.8, 1.6, 2.5, 4.0},
17 m_stat(m_etaBounds) {}
AthAlgTool()
Default constructor:
std::vector< float > m_etaBounds
eta intervals for internal monitoring

◆ ~AmbiguityProcessorBase()

virtual Trk::AmbiguityProcessorBase::~AmbiguityProcessorBase ( )
virtualdefault

Member Function Documentation

◆ addTrack()

void Trk::AmbiguityProcessorBase::addTrack ( Trk::Track * in_track,
const bool fitted,
TrackScoreMap & trackScoreTrackMap,
std::vector< std::unique_ptr< const Trk::Track > > & trackDustbin,
Counter & stat,
int parentTrackId ) const
protected

Definition at line 152 of file AmbiguityProcessorBase.cxx.

155 {
156
157 std::unique_ptr<Trk::Track> atrack(in_track);
158 // compute score
160 bool suppressHoleSearch = fitted ? m_suppressHoleSearch : true;
161 bool passBasicSelections = m_scoringTool->passBasicSelections(*atrack);
162 if(passBasicSelections){
163 if (m_trackSummaryTool.isEnabled()) {
164 m_trackSummaryTool->computeAndReplaceTrackSummary(*atrack,
165 suppressHoleSearch);
166 }
167 bool recheckBasicSel = false;
168 score = m_scoringTool->score(*atrack, recheckBasicSel);
169 }
170
171 if (m_observerTool.isEnabled()) {
172 m_observerTool->updateScore(parentTrackId, static_cast<double>(score));
173 }
174
175 // do we accept the track ?
176 if (score != 0) {
177 ATH_MSG_DEBUG("Track (" << atrack.get() << ") has score " << score);
178 // statistic
179 stat.incrementCounterByRegion(CounterIndex::kNscoreOk, atrack.get());
180 // add track to map, map is sorted small to big !
181 if (m_observerTool.isEnabled()) {
182 trackScoreTrackMap.emplace(
183 -score, TrackPtr(atrack.release(), fitted, parentTrackId));
184 } else {
185 trackScoreTrackMap.emplace(-score, TrackPtr(atrack.release(), fitted));
186 }
187 return;
188 }
189 // do we try to recover the track ?
190 if (fitted and shouldTryBremRecovery(*atrack)) {
191 ATH_MSG_DEBUG("Track score is zero, try to recover it via brem fit");
192 // run track fit using electron hypothesis
193 auto bremTrack(doBremRefit(*atrack));
194 if (!bremTrack) {
195 ATH_MSG_DEBUG("Brem refit failed, drop track");
196 if (m_observerTool.isEnabled()) {
197 m_observerTool->rejectTrack(parentTrackId,
200 }
201 // statistic
202 stat.incrementCounterByRegion(CounterIndex::kNscoreZeroBremRefitFailed,
203 atrack.get());
204 stat.incrementCounterByRegion(CounterIndex::kNfailedFits, atrack.get());
205 // clean up
206 trackDustbin.push_back(std::move(atrack));
207 } else {
208 int newTrackId = AmbiguityProcessor::getUid();
209 if (m_observerTool.isEnabled()) {
210 m_observerTool->rejectTrack(
211 parentTrackId, xAOD::RejectionStep::addTrack,
213 m_observerTool->addSubTrack(newTrackId, parentTrackId, *bremTrack);
214 }
215 // statistic
216 stat.incrementCounterByRegion(CounterIndex::kNgoodFits, bremTrack.get());
217 // rerun score
219 passBasicSelections = m_scoringTool->passBasicSelections(*bremTrack);
220 if(passBasicSelections){
221 if (m_trackSummaryTool.isEnabled()) {
222 m_trackSummaryTool->computeAndReplaceTrackSummary(*bremTrack,
223 suppressHoleSearch);
224 }
225 bool recheckBasicSel = false;
226 score = m_scoringTool->score(*bremTrack, recheckBasicSel);
227 }
228 if (m_observerTool.isEnabled()) {
229 m_observerTool->updateScore(newTrackId, static_cast<double>(score));
230 }
231 // put original track in the bin, ready to preserve a new Brem track
232 trackDustbin.push_back(std::move(atrack));
233 // do we accept the track ?
234 if (score != 0) {
235 ATH_MSG_DEBUG("Brem refit successful, recovered track ("
236 << bremTrack.get() << ") has score " << score);
237 // statistics
238 stat.incrementCounterByRegion(CounterIndex::kNscoreZeroBremRefit,
239 bremTrack.get());
240 // add track to map, map is sorted small to big !
241 if (m_observerTool.isEnabled()) {
242 m_observerTool->addSubTrack(newTrackId, parentTrackId, *bremTrack);
243 trackScoreTrackMap.emplace(
244 -score, TrackPtr(bremTrack.release(), fitted, newTrackId));
245 } else {
246 trackScoreTrackMap.emplace(-score,
247 TrackPtr(bremTrack.release(), fitted));
248 }
249 return;
250 } else {
251 ATH_MSG_DEBUG("Brem refit gave still track score zero, reject it");
252 if (m_observerTool.isEnabled()) {
253 m_observerTool->rejectTrack(
256 }
257 // statistic
258 stat.incrementCounterByRegion(
260 }
261 }
262 } else {
263 ATH_MSG_DEBUG("Track score is zero, reject it");
264 if (m_observerTool.isEnabled()) {
265 m_observerTool->rejectTrack(parentTrackId, xAOD::RejectionStep::addTrack,
267 }
268 // statistic
269 stat.incrementCounterByRegion(CounterIndex::kNscoreZero, atrack.get());
270 trackDustbin.push_back(std::move(atrack));
271 }
272}
#define ATH_MSG_DEBUG(x)
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trackSummaryTool
ToolHandle< ITrackScoringTool > m_scoringTool
Scoring tool This tool is used to 'score' the tracks, i.e.
virtual std::unique_ptr< Trk::Track > doBremRefit(const Trk::Track &track) const =0
bool shouldTryBremRecovery(const Trk::Track &track) const
PublicToolHandle< Trk::ITrkObserverTool > m_observerTool
Observer tool This tool is used to observe the tracks and their 'score'.
float TrackScore
Definition TrackScore.h:10
@ bremRefitTrackScoreZero
@ bremRefitSubtrackCreated

◆ createAndRecordClusterSplitProbContainer()

AmbiguityProcessorBase::UniqueClusterSplitProbabilityContainerPtr Trk::AmbiguityProcessorBase::createAndRecordClusterSplitProbContainer ( const EventContext & ctx) const
protected

Create a new cluster splitting probability container and (optionally) record it in storegate The new container may be populated from an already existing container, and might be stored in StoreGate.

The ownersip, which might be either storegate or the calling scope, is taken into account by the UniqueClusterSplitProbabilityContainerPtr and must not be touched i.e. unique_ptr::release must not be called.

Definition at line 71 of file AmbiguityProcessorBase.cxx.

72 {
73 SG::ReadHandle<Trk::ClusterSplitProbabilityContainer> splitProbContainerIn;
74 if (!m_clusterSplitProbContainerIn.key().empty()) {
75 splitProbContainerIn = SG::ReadHandle(m_clusterSplitProbContainerIn, ctx);
76 if (!splitProbContainerIn.isValid()) {
77 ATH_MSG_ERROR("Failed to get input cluster split probability container "
79 }
80 }
81 std::unique_ptr<Trk::ClusterSplitProbabilityContainer> newSplitProbContainer(
83 ? std::make_unique<Trk::ClusterSplitProbabilityContainer>(
84 *splitProbContainerIn)
85 : std::make_unique<Trk::ClusterSplitProbabilityContainer>());
86 SG::WriteHandle<Trk::ClusterSplitProbabilityContainer>
87 splitProbContainerHandle;
88 if (!m_clusterSplitProbContainerOut.key().empty()) {
89 splitProbContainerHandle =
90 SG::WriteHandle<Trk::ClusterSplitProbabilityContainer>(
92 if (splitProbContainerHandle.record(std::move(newSplitProbContainer))
93 .isFailure()) {
95 "Failed to record output cluster split probability container "
97 }
98 // newSplitProbContainer owned by storegate -> no cleanup
99 return {splitProbContainerHandle.ptr(),
100 [](Trk::ClusterSplitProbabilityContainer*) {}};
101 } else {
102 // when not recording the split prob container in storegate the container
103 // must be deleted once going out of scope
104 return {newSplitProbContainer.release(),
105 [](Trk::ClusterSplitProbabilityContainer* ptr) { delete ptr; }};
106 }
107}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
virtual bool isValid() override final
Can the handle be successfully dereferenced?
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
pointer_type ptr()
Dereference the pointer.
SG::WriteHandleKey< Trk::ClusterSplitProbabilityContainer > m_clusterSplitProbContainerOut
SG::ReadHandleKey< Trk::ClusterSplitProbabilityContainer > m_clusterSplitProbContainerIn
void * ptr(T *p)
Definition SGImplSvc.cxx:74

◆ 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.

◆ doBremRefit()

virtual std::unique_ptr< Trk::Track > Trk::AmbiguityProcessorBase::doBremRefit ( const Trk::Track & track) const
protectedpure virtual

◆ 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

◆ fit()

virtual std::unique_ptr< Trk::Track > Trk::AmbiguityProcessorBase::fit ( const Track & track,
bool flag,
Trk::ParticleHypothesis hypo ) const
protectedpure virtual

◆ getTrackParameters()

const TrackParameters * Trk::AmbiguityProcessorBase::getTrackParameters ( const Trk::Track * track) const
protected

Definition at line 274 of file AmbiguityProcessorBase.cxx.

275 {
276 const TrackParameters* par = track->perigeeParameters();
277 if (not par) {
278 ATH_MSG_DEBUG("Track (" << track << ") has no perigee! Try any other ?");
279 par = track->trackParameters()->front();
280 }
281 if (not par)
282 ATH_MSG_DEBUG("Track (" << track
283 << ") has no Track Parameters ! No refit !");
284 return par;
285}
ParametersBase< TrackParametersDim, Charged > TrackParameters

◆ initializeClusterSplitProbContainer()

StatusCode Trk::AmbiguityProcessorBase::initializeClusterSplitProbContainer ( )
protected

Initialize read and write handles for ClusterSplitProbabilityContainers.

If a write handle key is specified for the new ClusterSplitProbabilityContainer, read handles for this key are "renounced" in all child tools.

usage:

Definition at line 28 of file AmbiguityProcessorBase.cxx.

28 {
29 // init ClusterSplitProb input and output container handles and renounce the
30 // output handle from its tools. the latter works because the ClusterSplitProb
31 // output container is created and recorded before the tools are called.
33 !m_clusterSplitProbContainerIn.key().empty()));
35 !m_clusterSplitProbContainerOut.key().empty()));
36 if (!m_clusterSplitProbContainerOut.key().empty()) {
37 auto visitor = [this](const IAlgTool* tool) {
38 const AlgTool* alg_tool = dynamic_cast<const AlgTool*>(tool);
39 for (Gaudi::DataHandle* handle : alg_tool->inputHandles()) {
40 this->msg(MSG::DEBUG) << " input Handle " << tool->name() << " . "
41 << handle->objKey() << endmsg;
42 }
43 for (const auto& elm : alg_tool->inputDataObjs()) {
44 this->msg(MSG::DEBUG)
45 << " input object " << tool->name() << " . " << elm.key() << endmsg;
46 }
47 };
48 if (msgLvl(MSG::DEBUG)) {
49 ToolVisitor::visit(tools(), visitor);
50 }
52 ATH_MSG_DEBUG(" Renounce " << m_clusterSplitProbContainerOut.objKey());
53 auto logger = RenounceToolInputsVisitor::createLogger(
54 [this](const std::string_view& tool_name, const std::string_view& key) {
55 this->msg(MSG::INFO)
56 << " Renounce " << tool_name << " . " << key << endmsg;
57 });
58 RenounceToolInputsVisitor renounce(
59 std::vector<DataObjID>{m_clusterSplitProbContainerOut.fullKey()},
60 logger);
61 ToolVisitor::visit(tools(), renounce);
62 ATH_MSG_DEBUG(" renounced " << m_clusterSplitProbContainerOut.objKey());
63 if (msgLvl(MSG::DEBUG)) {
64 ToolVisitor::visit(tools(), visitor);
65 }
66 }
67 return StatusCode::SUCCESS;
68}
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
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)
bool msgLvl(const MSG::Level lvl) const
MsgStream & msg() const
static Root::TMsgLogger logger("iLumiCalc")

◆ 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::ITrackAmbiguityProcessorTool::interfaceID ( )
inlinestaticinherited

Definition at line 52 of file ITrackAmbiguityProcessorTool.h.

53{
55}
static const InterfaceID IID_ITrackAmbiguityProcessorTool("Trk::ITrackAmbiguityProcessorTool", 1, 0)

◆ 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.

◆ process() [1/2]

virtual const TrackCollection * Trk::ITrackAmbiguityProcessorTool::process ( const TrackCollection * ,
Trk::PRDtoTrackMap * prd_to_track_map = nullptr ) const
pure virtualinherited

(in concrete object) Returns a processed TrackCollection from the passed 'tracks'

Parameters
trackscollection of tracks which will have ambiguities resolved. Will not be modified.
prd_to_track_mapon optional prd-to-track map being filled by the processor.
Returns
new collections of tracks, with ambiguities resolved. Ownership is passed on. (i.e. client handles deletion).
If no prd-to-track map is given the processor might create one internally (for internal
use only, or exported to storegate).

Implemented in Trk::DenseEnvironmentsAmbiguityProcessorTool, Trk::SimpleAmbiguityProcessorTool, and Trk::TrackSelectionProcessorTool.

◆ process() [2/2]

virtual const TrackCollection * Trk::ITrackAmbiguityProcessorTool::process ( const TracksScores * ) const
pure virtualinherited

◆ refitPrds()

virtual Trk::Track * Trk::AmbiguityProcessorBase::refitPrds ( const Trk::Track * track,
Trk::PRDtoTrackMap & prdToTrackMap,
Counter & stat ) const
protectedpure virtual

◆ refitRots()

Trk::Track * Trk::AmbiguityProcessorBase::refitRots ( const Trk::Track * track,
Counter & stat ) const
protectedvirtual

Definition at line 289 of file AmbiguityProcessorBase.cxx.

290 {
291 ATH_MSG_VERBOSE("Refit track " << track);
292 // refit using first parameter, do outliers
293 std::unique_ptr<Trk::Track> newTrack{};
294 if (m_tryBremFit and track->info().trackProperties(Trk::TrackInfo::BremFit)) {
295 stat.incrementCounterByRegion(CounterIndex::kNbremFits, track);
296 ATH_MSG_VERBOSE("Brem track, refit with electron brem fit");
297 newTrack = doBremRefit(*track);
298 } else {
299 stat.incrementCounterByRegion(CounterIndex::kNfits, track);
300 ATH_MSG_VERBOSE("Normal track, refit");
301 newTrack = fit(*track, true, m_particleHypothesis);
302 if ((not newTrack) and shouldTryBremRecovery(*track)) {
303 stat.incrementCounterByRegion(CounterIndex::kNrecoveryBremFits, track);
304 ATH_MSG_VERBOSE("Normal fit failed, try brem recovery");
305 newTrack = doBremRefit(*track);
306 }
307 }
308
309 if (newTrack) {
310 stat.incrementCounterByRegion(CounterIndex::kNgoodFits, newTrack.get());
311 // keeping the track of previously accumulated TrackInfo
312 const Trk::TrackInfo& originalInfo = track->info();
313 newTrack->info().addPatternReco(originalInfo);
314 } else {
315 stat.incrementCounterByRegion(CounterIndex::kNfailedFits, track);
316 }
317 return newTrack.release();
318}
#define ATH_MSG_VERBOSE(x)
Trk::ParticleHypothesis m_particleHypothesis
virtual std::unique_ptr< Trk::Track > fit(const Track &track, bool flag, Trk::ParticleHypothesis hypo) const =0
bool m_tryBremFit
brem recovery mode with brem fit ?
@ BremFit
A brem fit was performed on this track.

◆ refitTrack()

Track * Trk::AmbiguityProcessorBase::refitTrack ( const Trk::Track * track,
Trk::PRDtoTrackMap & prdToTrackMap,
Counter & stat,
int trackId,
int subtrackId ) const
protected

refit track

Definition at line 116 of file AmbiguityProcessorBase.cxx.

119 {
120 std::unique_ptr<Trk::Track> newTrack;
121 if (!m_suppressTrackFit) {
122 if (m_refitPrds) {
123 // simple case, fit PRD directly
124 ATH_MSG_VERBOSE("Refit track " << track << " from PRDs");
125 newTrack.reset(refitPrds(track, prdToTrackMap, stat));
126 } else {
127 // ok, we fit ROTs
128 ATH_MSG_VERBOSE("Refit track " << track << " from ROTs");
129 newTrack.reset(refitRots(track, stat));
130 }
131 } else {
133 }
134 if (newTrack) {
135 if (m_observerTool.isEnabled()) {
138 m_observerTool->addSubTrack(subtrackId, trackId, *newTrack);
139 }
140 ATH_MSG_DEBUG("New track " << newTrack.get() << " successfully fitted from "
141 << track);
142 } else {
143 if (m_observerTool.isEnabled()) {
146 }
147 ATH_MSG_DEBUG("Fit failed !");
148 }
149 return newTrack.release();
150}
virtual Trk::Track * refitPrds(const Trk::Track *track, Trk::PRDtoTrackMap &prdToTrackMap, Counter &stat) const =0
virtual Trk::Track * refitRots(const Trk::Track *track, Counter &stat) const
std::unique_ptr< Trk::Track > createNewFitQualityTrack(const Trk::Track &track)

◆ 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 }

◆ 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 }

◆ shouldTryBremRecovery() [1/2]

bool Trk::AmbiguityProcessorBase::shouldTryBremRecovery ( const Trk::Track & track) const
protected

Definition at line 19 of file AmbiguityProcessorBase.cxx.

20 {
21 return m_tryBremFit and
22 not(track.info().trackProperties(Trk::TrackInfo::BremFit)) and
23 (track.trackParameters()->front()->pT() > m_pTminBrem) and
24 ((not m_caloSeededBrem) or
25 track.info().patternRecoInfo(Trk::TrackInfo::TrackInCaloROI));
26}

◆ shouldTryBremRecovery() [2/2]

bool Trk::AmbiguityProcessorBase::shouldTryBremRecovery ( const Trk::Track & track,
const TrackParameters * pPar ) const
protected

Definition at line 109 of file AmbiguityProcessorBase.cxx.

110 {
111 return m_tryBremFit and (pPar->pT() > m_pTminBrem) and
112 ((not m_caloSeededBrem) or
113 track.info().patternRecoInfo(Trk::TrackInfo::TrackInCaloROI));
114}

◆ statistics()

virtual void Trk::ITrackAmbiguityProcessorTool::statistics ( )
pure virtualinherited

Print statistics at the end of the processing.

Implemented in Trk::DenseEnvironmentsAmbiguityProcessorTool, Trk::SimpleAmbiguityProcessorTool, and Trk::TrackSelectionProcessorTool.

◆ 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.

◆ 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

◆ ATLAS_THREAD_SAFE

Counter m_stat Trk::AmbiguityProcessorBase::ATLAS_THREAD_SAFE
mutableprotected

Definition at line 130 of file AmbiguityProcessorBase.h.

◆ m_caloSeededBrem

bool Trk::AmbiguityProcessorBase::m_caloSeededBrem {}
protected

Definition at line 159 of file AmbiguityProcessorBase.h.

159{};

◆ m_clusterSplitProbContainerIn

SG::ReadHandleKey<Trk::ClusterSplitProbabilityContainer> Trk::AmbiguityProcessorBase::m_clusterSplitProbContainerIn
private
Initial value:
{this, "InputClusterSplitProbabilityName",
"", ""}

Definition at line 150 of file AmbiguityProcessorBase.h.

150 {this, "InputClusterSplitProbabilityName",
151 "", ""};

◆ m_clusterSplitProbContainerOut

SG::WriteHandleKey<Trk::ClusterSplitProbabilityContainer> Trk::AmbiguityProcessorBase::m_clusterSplitProbContainerOut
private
Initial value:
{this, "OutputClusterSplitProbabilityName",
"", ""}

Definition at line 153 of file AmbiguityProcessorBase.h.

153 {this, "OutputClusterSplitProbabilityName",
154 "", ""};

◆ 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_etaBounds

std::vector<float> Trk::AmbiguityProcessorBase::m_etaBounds
protected

eta intervals for internal monitoring

Definition at line 128 of file AmbiguityProcessorBase.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_forceRefit

bool Trk::AmbiguityProcessorBase::m_forceRefit {true}
protected

by default tracks at input get refitted

Definition at line 166 of file AmbiguityProcessorBase.h.

166{true};

◆ m_matEffects

int Trk::AmbiguityProcessorBase::m_matEffects {3}
protected

read in as an integer and convert to particle hypothesis

reference: /TrkEventPrimitives/ParticleHypothesis.h

Definition at line 170 of file AmbiguityProcessorBase.h.

170{3}; // pion

◆ m_observerTool

PublicToolHandle<Trk::ITrkObserverTool> Trk::AmbiguityProcessorBase::m_observerTool
protected
Initial value:
{
this, "ObserverTool", "", "track observer within ambiguity solver"}

Observer tool This tool is used to observe the tracks and their 'score'.

Definition at line 140 of file AmbiguityProcessorBase.h.

140 {
141 this, "ObserverTool", "", "track observer within ambiguity solver"};

◆ m_particleHypothesis

Trk::ParticleHypothesis Trk::AmbiguityProcessorBase::m_particleHypothesis {undefined}
protected

Definition at line 171 of file AmbiguityProcessorBase.h.

171{undefined};

◆ m_pTminBrem

float Trk::AmbiguityProcessorBase::m_pTminBrem {1000.}
protected

Definition at line 160 of file AmbiguityProcessorBase.h.

160{1000.};

◆ m_refitPrds

bool Trk::AmbiguityProcessorBase::m_refitPrds {}
protected

Definition at line 164 of file AmbiguityProcessorBase.h.

164{};

◆ m_scoringTool

ToolHandle<ITrackScoringTool> Trk::AmbiguityProcessorBase::m_scoringTool
protected
Initial value:
{this, "ScoringTool", "",
"track scoring tool"}

Scoring tool This tool is used to 'score' the tracks, i.e.

to quantify what a good track is.

Todo
The actual tool that is used should be configured through job options

Definition at line 136 of file AmbiguityProcessorBase.h.

136 {this, "ScoringTool", "",
137 "track scoring tool"};

◆ m_statMutex

std::mutex Trk::AmbiguityProcessorBase::m_statMutex
mutableprotected

Definition at line 129 of file AmbiguityProcessorBase.h.

◆ m_suppressHoleSearch

bool Trk::AmbiguityProcessorBase::m_suppressHoleSearch {}
protected

Definition at line 161 of file AmbiguityProcessorBase.h.

161{};

◆ m_suppressTrackFit

bool Trk::AmbiguityProcessorBase::m_suppressTrackFit {}
protected

Definition at line 163 of file AmbiguityProcessorBase.h.

163{};

◆ m_trackSummaryTool

ToolHandle<Trk::IExtendedTrackSummaryTool> Trk::AmbiguityProcessorBase::m_trackSummaryTool
protected
Initial value:
{
this, "TrackSummaryTool", "InDetTrackSummaryToolNoHoleSearch"}

Definition at line 142 of file AmbiguityProcessorBase.h.

142 {
143 this, "TrackSummaryTool", "InDetTrackSummaryToolNoHoleSearch"};

◆ m_tryBremFit

bool Trk::AmbiguityProcessorBase::m_tryBremFit {}
protected

brem recovery mode with brem fit ?

Definition at line 158 of file AmbiguityProcessorBase.h.

158{};

◆ 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: