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
 DeclareInterfaceID (ITrackAmbiguityProcessorTool, 1, 0)
virtual const TrackCollectionprocess (const EventContext &ctx, 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 EventContext &ctx, const TracksScores *) const =0
virtual void statistics ()=0
 Print statistics at the end of the processing.

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 EventContext &ctx, const Trk::Track &track) const =0
TrackrefitTrack (const EventContext &ctx, const Trk::Track *track, Trk::PRDtoTrackMap &prdToTrackMap, Counter &stat, int trackId, int subtrackId) const
 refit track
virtual Trk::TrackrefitPrds (const EventContext &ctx, const Trk::Track *track, Trk::PRDtoTrackMap &prdToTrackMap, Counter &stat) const =0
virtual Trk::TrackrefitRots (const EventContext &ctx, const Trk::Track *track, Counter &stat) const
virtual std::unique_ptr< Trk::Trackfit (const EventContext &ctx, const Track &track, bool flag, Trk::ParticleHypothesis hypo) const =0
void addTrack (const EventContext &ctx, 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 115 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 ( const EventContext & ctx,
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 153 of file AmbiguityProcessorBase.cxx.

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

◆ DeclareInterfaceID()

Trk::ITrackAmbiguityProcessorTool::DeclareInterfaceID ( ITrackAmbiguityProcessorTool ,
1 ,
0  )
inherited

◆ 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 EventContext & ctx,
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 EventContext & ctx,
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 276 of file AmbiguityProcessorBase.cxx.

277 {
278 const TrackParameters* par = track->perigeeParameters();
279 if (not par) {
280 ATH_MSG_DEBUG("Track (" << track << ") has no perigee! Try any other ?");
281 par = track->trackParameters()->front();
282 }
283 if (not par)
284 ATH_MSG_DEBUG("Track (" << track
285 << ") has no Track Parameters ! No refit !");
286 return par;
287}
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")
virtual void handle(const Incident &inc)
Handle end of run incidents to save the metadata at that point.

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

◆ 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 EventContext & ctx,
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 EventContext & ctx,
const TracksScores *  ) const
pure virtualinherited

◆ refitPrds()

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

◆ refitRots()

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

Definition at line 291 of file AmbiguityProcessorBase.cxx.

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

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

◆ 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 132 of file AmbiguityProcessorBase.h.

◆ m_caloSeededBrem

bool Trk::AmbiguityProcessorBase::m_caloSeededBrem {}
protected

Definition at line 161 of file AmbiguityProcessorBase.h.

161{};

◆ m_clusterSplitProbContainerIn

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

Definition at line 152 of file AmbiguityProcessorBase.h.

152 {this, "InputClusterSplitProbabilityName",
153 "", ""};

◆ m_clusterSplitProbContainerOut

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

Definition at line 155 of file AmbiguityProcessorBase.h.

155 {this, "OutputClusterSplitProbabilityName",
156 "", ""};

◆ 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 130 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 168 of file AmbiguityProcessorBase.h.

168{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 172 of file AmbiguityProcessorBase.h.

172{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 142 of file AmbiguityProcessorBase.h.

142 {
143 this, "ObserverTool", "", "track observer within ambiguity solver"};

◆ m_particleHypothesis

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

Definition at line 173 of file AmbiguityProcessorBase.h.

173{undefined};

◆ m_pTminBrem

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

Definition at line 162 of file AmbiguityProcessorBase.h.

162{1000.};

◆ m_refitPrds

bool Trk::AmbiguityProcessorBase::m_refitPrds {}
protected

Definition at line 166 of file AmbiguityProcessorBase.h.

166{};

◆ 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 138 of file AmbiguityProcessorBase.h.

138 {this, "ScoringTool", "",
139 "track scoring tool"};

◆ m_statMutex

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

Definition at line 131 of file AmbiguityProcessorBase.h.

◆ m_suppressHoleSearch

bool Trk::AmbiguityProcessorBase::m_suppressHoleSearch {}
protected

Definition at line 163 of file AmbiguityProcessorBase.h.

163{};

◆ m_suppressTrackFit

bool Trk::AmbiguityProcessorBase::m_suppressTrackFit {}
protected

Definition at line 165 of file AmbiguityProcessorBase.h.

165{};

◆ m_trackSummaryTool

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

Definition at line 144 of file AmbiguityProcessorBase.h.

144 {
145 this, "TrackSummaryTool", "InDetTrackSummaryToolNoHoleSearch"};

◆ m_tryBremFit

bool Trk::AmbiguityProcessorBase::m_tryBremFit {}
protected

brem recovery mode with brem fit ?

Definition at line 160 of file AmbiguityProcessorBase.h.

160{};

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