|
ATLAS Offline Software
|
#include <TrackSelectionProcessorTool.h>
|
| TrackSelectionProcessorTool (const std::string &, const std::string &, const IInterface *) |
|
virtual | ~TrackSelectionProcessorTool () |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | finalize () override |
|
virtual const TrackCollection * | process (const TrackCollection *tracksCol, Trk::PRDtoTrackMap *prdToTrackMap) const override |
| Returns a processed TrackCollection from the passed 'tracks' WITHOUT copying or refitting the input tracks. More...
|
|
virtual const TrackCollection * | process (const TracksScores *) const override |
|
void | statistics () override |
| statistics output to be called by algorithm during finalize. More...
|
|
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 |
|
◆ PrdSignature
◆ PrdSignatureSet
◆ StoreGateSvc_t
◆ TrackScoreMap
◆ TrackSelectionProcessorTool()
Trk::TrackSelectionProcessorTool::TrackSelectionProcessorTool |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~TrackSelectionProcessorTool()
Trk::TrackSelectionProcessorTool::~TrackSelectionProcessorTool |
( |
| ) |
|
|
virtualdefault |
◆ addNewTracks()
Add passed TrackCollection, and Trk::PrepRawData from tracks to caches.
- Parameters
-
Definition at line 99 of file TrackSelectionProcessorTool.cxx.
102 ATH_MSG_DEBUG (
"Number of tracks at Input: "<<tracks.size());
105 for (
const Track*a_track : tracks ) {
108 trackScoreTrackMap.insert( std::make_pair(itrack,
TrackPtr(a_track)) );
120 const std::vector<const Trk::PrepRawData*> & prds =
m_assoTool->getPrdsOnTrack(prdToTrackMap, *a_track);
123 prdSig.insert( prds.begin(),prds.end() );
125 if ( !(prdSigSet.insert(prdSig)).second ) {
136 trackScoreTrackMap.insert( std::make_pair(-
score,
TrackPtr(a_track) ) );
139 ATH_MSG_DEBUG (
"Number of tracks in map:"<<trackScoreTrackMap.size());
◆ 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()
◆ dumpTracks()
◆ 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
◆ finalize()
StatusCode Trk::TrackSelectionProcessorTool::finalize |
( |
| ) |
|
|
overridevirtual |
◆ initialize()
StatusCode Trk::TrackSelectionProcessorTool::initialize |
( |
| ) |
|
|
overridevirtual |
◆ 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]
Returns a processed TrackCollection from the passed 'tracks' WITHOUT copying or refitting the input tracks.
Do actual processing of event.
The pointers of the tracks in the input collection are copied into the output collection which does NOT own the pointers. Clients must ensure that the Input Collection is not deleted before the output collection else all pointers in the output collection will be invalid!
- Parameters
-
tracks | collection of tracks which will have ambiguities resolved. Will not be modified. |
prdToTrackMap | on optional prd-to-track map being filled by the processor. |
- Returns
- new collections of tracks, with ambiguities resolved. The returned track collection is a SG::VIEW_ELEMENTS container, meaning that it should NOT be written to disk. Ownership of the collection 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).
Takes a track container, and then returns the tracks which have been selected
Implements Trk::ITrackAmbiguityProcessorTool.
Definition at line 61 of file TrackSelectionProcessorTool.cxx.
64 std::vector<const Track*> tracks;
65 tracks.reserve(tracksCol->size());
66 for(
const auto *
e: *tracksCol){
70 std::unique_ptr<Trk::PRDtoTrackMap> tmpPrdToTrackMap;
71 if (!pPrdToTrackMap) {
72 tmpPrdToTrackMap =
m_assoTool->createPRDtoTrackMap();
75 if (!inputPrdMap.isValid()) {
78 *tmpPrdToTrackMap = *inputPrdMap;
81 pPrdToTrackMap = tmpPrdToTrackMap.get();
85 addNewTracks(trackScoreTrackMap,*pPrdToTrackMap, tracks);
93 return result.release()->asDataVector();
◆ process() [2/2]
◆ renounce()
◆ renounceArray()
◆ solveTracks()
Definition at line 143 of file TrackSelectionProcessorTool.cxx.
149 const EventContext& ctx = Gaudi::Hive::currentContext();
153 if (!splitProbContainerIn.
isValid()) {
158 ? std::make_unique<ClusterSplitProbabilityContainer>(*splitProbContainerIn)
159 : std::make_unique<ClusterSplitProbabilityContainer>());
164 if (splitProbContainerHandle.
record(std::move(splitProbContainerCleanup)).isFailure()) {
167 splitProbContainer=splitProbContainerHandle.
ptr();
170 splitProbContainer=splitProbContainerCleanup.get();
175 while ( !trackScoreTrackMap.empty() ) {
177 TrackPtr atrack( std::move(itnext->second) );
179 trackScoreTrackMap.erase(itnext);
180 ATH_MSG_VERBOSE (
"--- Trying next track "<<atrack.track()<<
"\t with score "<<-ascore);
181 std::unique_ptr<Trk::Track> cleanedTrack;
182 const auto &[cleanedTrack_tmp,
keepOriginal] =
m_selectionTool->getCleanedOutTrack( atrack.track() , -(ascore), *splitProbContainer, prdToTrackMap, -1, -1);
183 cleanedTrack.reset(cleanedTrack_tmp);
186 ATH_MSG_DEBUG (
"Accepted track "<<atrack.track()<<
"\t has score "<<-(ascore));
191 result.push_back( atrack.track() );
193 }
else if ( !cleanedTrack ) {
195 ATH_MSG_DEBUG (
"Track "<< atrack.track() <<
" doesn't meet the cuts of the AmbiTrack Selection tool");
198 cleanedTrack.reset();
200 ATH_MSG_DEBUG(
"Selection tool returned a new track, cannot handle memory management of new track, deleting it. Check you configuration ");
◆ statistics()
void Trk::TrackSelectionProcessorTool::statistics |
( |
| ) |
|
|
inlineoverridevirtual |
◆ 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()
◆ m_assoMapName
Initial value:{
this, "AssociationMapName",
""}
key for the PRDtoTrackMap to filled by the ambiguity score processor.
the key given to the newly created association map
Definition at line 119 of file TrackSelectionProcessorTool.h.
◆ m_assoTool
◆ m_clusterSplitProbContainerIn
◆ m_clusterSplitProbContainerOut
◆ m_detStore
◆ m_disableSorting
bool Trk::TrackSelectionProcessorTool::m_disableSorting |
|
private |
◆ m_dropDouble
bool Trk::TrackSelectionProcessorTool::m_dropDouble |
|
private |
◆ m_evtStore
◆ m_scoringTool
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 107 of file TrackSelectionProcessorTool.h.
◆ m_selectionTool
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Const iterator class for DataVector/DataList.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
virtual void setOwner(IDataHandleHolder *o)=0
::StatusCode StatusCode
StatusCode definition for legacy code.
pointer_type ptr()
Dereference the pointer.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Container to associate Cluster with cluster splitting probabilities.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
DataVector adapter that acts like it holds const pointers.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
SortedObjPtr< xAOD::TrackParticle > TrackPtr