|
ATLAS Offline Software
|
#include <AmbiguityProcessorBase.h>
|
enum | CounterIndex {
CounterIndex::kNcandidates,
CounterIndex::kNcandScoreZero,
CounterIndex::kNcandDouble,
CounterIndex::kNscoreOk,
CounterIndex::kNscoreZeroBremRefit,
CounterIndex::kNscoreZeroBremRefitFailed,
CounterIndex::kNscoreZeroBremRefitScoreZero,
CounterIndex::kNscoreZero,
CounterIndex::kNaccepted,
CounterIndex::kNsubTrack,
CounterIndex::kNnoSubTrack,
CounterIndex::kNacceptedBrem,
CounterIndex::kNbremFits,
CounterIndex::kNfits,
CounterIndex::kNrecoveryBremFits,
CounterIndex::kNgoodFits,
CounterIndex::kNfailedFits,
CounterIndex::kNCounter
} |
|
using | Counter = AmbiCounter< CounterIndex > |
|
using | TrackScoreMap = std::multimap< TrackScore, TrackPtr > |
|
|
| 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 . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
virtual const TrackCollection * | process (const TrackCollection *, Trk::PRDtoTrackMap *prd_to_track_map=nullptr) const =0 |
| (in concrete object) Returns a processed TrackCollection from the passed 'tracks' More...
|
|
virtual const TrackCollection * | process (const TracksScores *) const =0 |
|
virtual void | statistics ()=0 |
| Print statistics at the end of the processing. More...
|
|
|
bool | shouldTryBremRecovery (const Trk::Track &track) const |
|
bool | shouldTryBremRecovery (const Trk::Track &track, const TrackParameters *pPar) const |
|
virtual std::unique_ptr< Trk::Track > | doBremRefit (const Trk::Track &track) const =0 |
|
Track * | refitTrack (const Trk::Track *track, Trk::PRDtoTrackMap &prdToTrackMap, Counter &stat, int trackId, int subtrackId) const |
| refit track More...
|
|
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 |
|
virtual std::unique_ptr< Trk::Track > | fit (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 TrackParameters * | getTrackParameters (const Trk::Track *track) const |
|
StatusCode | initializeClusterSplitProbContainer () |
| Initialize read and write handles for ClusterSplitProbabilityContainers. More...
|
|
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. More...
|
|
void | renounceArray (SG::VarHandleKeyArray &handlesArray) |
| remove all handles from I/O resolution More...
|
|
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. More...
|
|
Definition at line 35 of file AmbiguityProcessorBase.h.
◆ Counter
◆ StoreGateSvc_t
◆ TrackScoreMap
◆ UniqueClusterSplitProbabilityContainerPtr
◆ 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.
44 kNscoreZeroBremRefitFailed,
45 kNscoreZeroBremRefitScoreZero,
◆ AmbiguityProcessorBase()
Trk::AmbiguityProcessorBase::AmbiguityProcessorBase |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~AmbiguityProcessorBase()
virtual Trk::AmbiguityProcessorBase::~AmbiguityProcessorBase |
( |
| ) |
|
|
virtualdefault |
◆ addTrack()
Definition at line 152 of file AmbiguityProcessorBase.cxx.
157 std::unique_ptr<Trk::Track> atrack(in_track);
161 bool passBasicSelections =
m_scoringTool->passBasicSelections(*atrack);
162 if(passBasicSelections){
167 bool recheckBasicSel =
false;
182 trackScoreTrackMap.emplace(
185 trackScoreTrackMap.emplace(-
score,
TrackPtr(atrack.release(), fitted));
191 ATH_MSG_DEBUG(
"Track score is zero, try to recover it via brem fit");
206 trackDustbin.push_back(std::move(atrack));
213 m_observerTool->addSubTrack(newTrackId, parentTrackId, *bremTrack);
219 passBasicSelections =
m_scoringTool->passBasicSelections(*bremTrack);
220 if(passBasicSelections){
225 bool recheckBasicSel =
false;
232 trackDustbin.push_back(std::move(atrack));
236 << bremTrack.get() <<
") has score " <<
score);
242 m_observerTool->addSubTrack(newTrackId, parentTrackId, *bremTrack);
243 trackScoreTrackMap.emplace(
246 trackScoreTrackMap.emplace(-
score,
247 TrackPtr(bremTrack.release(), fitted));
251 ATH_MSG_DEBUG(
"Brem refit gave still track score zero, reject it");
258 stat.incrementCounterByRegion(
270 trackDustbin.push_back(std::move(atrack));
◆ createAndRecordClusterSplitProbContainer()
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.
76 if (!splitProbContainerIn.
isValid()) {
77 ATH_MSG_ERROR(
"Failed to get input cluster split probability container "
81 std::unique_ptr<Trk::ClusterSplitProbabilityContainer> newSplitProbContainer(
83 ? std::make_unique<Trk::ClusterSplitProbabilityContainer>(
84 *splitProbContainerIn)
85 : std::make_unique<Trk::ClusterSplitProbabilityContainer>());
87 splitProbContainerHandle;
89 splitProbContainerHandle =
92 if (splitProbContainerHandle.
record(std::move(newSplitProbContainer))
95 "Failed to record output cluster split probability container "
99 return {splitProbContainerHandle.
ptr(),
104 return {newSplitProbContainer.release(),
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ doBremRefit()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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()
◆ getTrackParameters()
◆ 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.
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()) {
41 << handle->objKey() <<
endmsg;
43 for (
const auto& elm : alg_tool->inputDataObjs()) {
45 <<
" input object " <<
tool->name() <<
" . " << elm.key() <<
endmsg;
49 ToolVisitor::visit(
tools(), visitor);
53 auto logger = RenounceToolInputsVisitor::createLogger(
54 [
this](
const std::string_view& tool_name,
const std::string_view&
key) {
56 <<
" Renounce " << tool_name <<
" . " <<
key <<
endmsg;
64 ToolVisitor::visit(
tools(), visitor);
67 return StatusCode::SUCCESS;
◆ inputHandles()
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 |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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]
(in concrete object) Returns a processed TrackCollection from the passed 'tracks'
- Parameters
-
tracks | collection of tracks which will have ambiguities resolved. Will not be modified. |
prd_to_track_map | on 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::TrackSelectionProcessorTool, Trk::SimpleAmbiguityProcessorTool, and Trk::DenseEnvironmentsAmbiguityProcessorTool.
◆ process() [2/2]
◆ refitPrds()
◆ refitRots()
Definition at line 289 of file AmbiguityProcessorBase.cxx.
293 std::unique_ptr<Trk::Track> newTrack{};
313 newTrack->info().addPatternReco(originalInfo);
317 return newTrack.release();
◆ refitTrack()
refit track
Definition at line 116 of file AmbiguityProcessorBase.cxx.
120 std::unique_ptr<Trk::Track> newTrack;
140 ATH_MSG_DEBUG(
"New track " << newTrack.get() <<
" successfully fitted from "
149 return newTrack.release();
◆ renounce()
◆ renounceArray()
◆ shouldTryBremRecovery() [1/2]
bool Trk::AmbiguityProcessorBase::shouldTryBremRecovery |
( |
const Trk::Track & |
track | ) |
const |
|
protected |
◆ shouldTryBremRecovery() [2/2]
◆ statistics()
virtual void Trk::ITrackAmbiguityProcessorTool::statistics |
( |
| ) |
|
|
pure virtualinherited |
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ ATLAS_THREAD_SAFE
Counter m_stat Trk::AmbiguityProcessorBase::ATLAS_THREAD_SAFE |
|
mutableprotected |
◆ m_caloSeededBrem
bool Trk::AmbiguityProcessorBase::m_caloSeededBrem {} |
|
protected |
◆ m_clusterSplitProbContainerIn
◆ m_clusterSplitProbContainerOut
◆ m_detStore
◆ m_etaBounds
std::vector<float> Trk::AmbiguityProcessorBase::m_etaBounds |
|
protected |
◆ m_evtStore
◆ m_forceRefit
bool Trk::AmbiguityProcessorBase::m_forceRefit {true} |
|
protected |
◆ 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.
◆ m_observerTool
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.
◆ m_particleHypothesis
◆ m_pTminBrem
float Trk::AmbiguityProcessorBase::m_pTminBrem {1000.} |
|
protected |
◆ m_refitPrds
bool Trk::AmbiguityProcessorBase::m_refitPrds {} |
|
protected |
◆ m_scoringTool
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.
◆ m_statMutex
std::mutex Trk::AmbiguityProcessorBase::m_statMutex |
|
mutableprotected |
◆ m_suppressHoleSearch
bool Trk::AmbiguityProcessorBase::m_suppressHoleSearch {} |
|
protected |
◆ m_suppressTrackFit
bool Trk::AmbiguityProcessorBase::m_suppressTrackFit {} |
|
protected |
◆ m_trackSummaryTool
Initial value:{
this, "TrackSummaryTool", "InDetTrackSummaryToolNoHoleSearch"}
Definition at line 142 of file AmbiguityProcessorBase.h.
◆ m_tryBremFit
bool Trk::AmbiguityProcessorBase::m_tryBremFit {} |
|
protected |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
SG::ReadHandleKey< Trk::ClusterSplitProbabilityContainer > m_clusterSplitProbContainerIn
Contains information about the 'fitter' of this track.
std::vector< float > m_etaBounds
eta intervals for internal monitoring
@ bremRefitTrackScoreZero
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
@ kNscoreZeroBremRefitFailed
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)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
virtual Trk::Track * refitRots(const Trk::Track *track, Counter &stat) const
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
PublicToolHandle< Trk::ITrkObserverTool > m_observerTool
Observer tool This tool is used to observe the tracks and their 'score'.
virtual void setOwner(IDataHandleHolder *o)=0
pointer_type ptr()
Dereference the pointer.
bool shouldTryBremRecovery(const Trk::Track &track) const
@ kNscoreZeroBremRefitScoreZero
virtual std::unique_ptr< Trk::Track > fit(const Track &track, bool flag, Trk::ParticleHypothesis hypo) const =0
std::unique_ptr< Trk::Track > createNewFitQualityTrack(const Trk::Track &track)
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
@ BremFit
A brem fit was performed on this track.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
@ TrackInCaloROI
A track in a CaloROI.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
bool m_tryBremFit
brem recovery mode with brem fit ?
@ bremRefitSubtrackCreated
ToolHandle< ITrackScoringTool > m_scoringTool
Scoring tool This tool is used to 'score' the tracks, i.e.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
SG::WriteHandleKey< Trk::ClusterSplitProbabilityContainer > m_clusterSplitProbContainerOut
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trackSummaryTool
Container to associate Cluster with cluster splitting probabilities.
bool m_suppressHoleSearch
ParametersBase< TrackParametersDim, Charged > TrackParameters
Trk::ParticleHypothesis m_particleHypothesis
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
virtual std::unique_ptr< Trk::Track > doBremRefit(const Trk::Track &track) const =0
virtual Trk::Track * refitPrds(const Trk::Track *track, Trk::PRDtoTrackMap &prdToTrackMap, Counter &stat) const =0
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
SortedObjPtr< xAOD::TrackParticle > TrackPtr