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 (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 114 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 152 of file AmbiguityProcessorBase.cxx.

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

276 {
277 const TrackParameters* par = track->perigeeParameters();
278 if (not par) {
279 ATH_MSG_DEBUG("Track (" << track << ") has no perigee! Try any other ?");
280 par = track->trackParameters()->front();
281 }
282 if (not par)
283 ATH_MSG_DEBUG("Track (" << track
284 << ") has no Track Parameters ! No refit !");
285 return par;
286}
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.

◆ 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 290 of file AmbiguityProcessorBase.cxx.

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

◆ m_caloSeededBrem

bool Trk::AmbiguityProcessorBase::m_caloSeededBrem {}
protected

Definition at line 160 of file AmbiguityProcessorBase.h.

160{};

◆ m_clusterSplitProbContainerIn

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

Definition at line 151 of file AmbiguityProcessorBase.h.

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

◆ m_clusterSplitProbContainerOut

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

Definition at line 154 of file AmbiguityProcessorBase.h.

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

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

167{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 171 of file AmbiguityProcessorBase.h.

171{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 141 of file AmbiguityProcessorBase.h.

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

◆ m_particleHypothesis

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

Definition at line 172 of file AmbiguityProcessorBase.h.

172{undefined};

◆ m_pTminBrem

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

Definition at line 161 of file AmbiguityProcessorBase.h.

161{1000.};

◆ m_refitPrds

bool Trk::AmbiguityProcessorBase::m_refitPrds {}
protected

Definition at line 165 of file AmbiguityProcessorBase.h.

165{};

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

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

◆ m_statMutex

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

Definition at line 130 of file AmbiguityProcessorBase.h.

◆ m_suppressHoleSearch

bool Trk::AmbiguityProcessorBase::m_suppressHoleSearch {}
protected

Definition at line 162 of file AmbiguityProcessorBase.h.

162{};

◆ m_suppressTrackFit

bool Trk::AmbiguityProcessorBase::m_suppressTrackFit {}
protected

Definition at line 164 of file AmbiguityProcessorBase.h.

164{};

◆ m_trackSummaryTool

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

Definition at line 143 of file AmbiguityProcessorBase.h.

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

◆ m_tryBremFit

bool Trk::AmbiguityProcessorBase::m_tryBremFit {}
protected

brem recovery mode with brem fit ?

Definition at line 159 of file AmbiguityProcessorBase.h.

159{};

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