|
ATLAS Offline Software
|
#include <DenseEnvironmentsAmbiguityScoreProcessorTool.h>
|
| DenseEnvironmentsAmbiguityScoreProcessorTool (const std::string &, const std::string &, const IInterface *) |
|
virtual | ~DenseEnvironmentsAmbiguityScoreProcessorTool () |
|
virtual StatusCode | initialize () override final |
|
virtual StatusCode | finalize () override final |
|
virtual void | process (const TrackCollection &tracks, TracksScores *trackScoreTrackMap) const override final |
| Do actual processing of event. More...
|
|
void | statistics () override |
| statistics output to be called by algorithm during finalize. More...
|
|
void | dumpStat (MsgStream &out) const |
|
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 |
|
|
void | addNewTracks (const TrackCollection &tracks, TracksScores *trackScoreTrackMap) const |
| Add passed TrackCollection, and Trk::PrepRawData from tracks to caches. More...
|
|
void | overlappingTracks (const TracksScores *scoreTrackMap, InDet::PixelGangedClusterAmbiguities *splitClusterMap, Trk::ClusterSplitProbabilityContainer &splitProbContainer, Trk::PRDtoTrackMap &prd_to_track_map) const |
| Find SiS Tracks that share hits in the track score map. More...
|
|
void | updatePixelSplitInformationForCluster (const std::pair< const InDet::PixelCluster *const, const Trk::TrackParameters * > &clusterTrkPara, InDet::PixelGangedClusterAmbiguities *splitClusterMap, Trk::ClusterSplitProbabilityContainer &splitProbContainer) const |
| Update pixel split information based using the fitted track. More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
ToolHandle< ITrackScoringTool > | m_scoringTool {this, "ScoringTool", "Trk::TrackScoringTool/TrackScoringTool" } |
| Scoring tool This tool is used to 'score' the tracks, i.e. More...
|
|
ToolHandle< Trk::IPRDtoTrackMapTool > | m_assoTool {this, "AssociationTool", "InDet::InDetPRDtoTrackMapToolGangedPixels" } |
|
ToolHandle< Trk::IPRDtoTrackMapTool > | m_assoToolNotGanged {this, "AssociationToolNotGanged", "Trk::PRDtoTrackMapTool" } |
|
ToolHandle< InDet::IPixelClusterSplitProbTool > | m_splitProbTool {this, "SplitProbTool", "InDet::NnPixelClusterSplitProbTool/NnPixelClusterSplitProbTool" } |
| recalculate split prob tool More...
|
|
PublicToolHandle< Trk::ITrkObserverTool > | m_observerTool {this, "ObserverTool", "", "track observer within ambiguity solver"} |
| Observer tool This tool is used to observe the tracks and their 'score'. More...
|
|
SG::ReadHandleKey< InDet::PixelGangedClusterAmbiguities > | m_splitClusterMapKey_last |
| cluster split information generated by previous instances More...
|
|
SG::WriteHandleKey< InDet::PixelGangedClusterAmbiguities > | m_splitClusterMapKey |
| cluster split information which m_splitClusterMap_last will be merged into More...
|
|
SG::WriteHandleKey< Trk::PRDtoTrackMap > | m_assoMapName {this,"AssociationMapName",""} |
| key for the PRDtoTrackMap to be used by the ambiguity process to resolve the ambiguities. More...
|
|
SG::ReadHandleKey< Trk::ClusterSplitProbabilityContainer > | m_clusterSplitProbContainerIn {this,"InputClusterSplitProbabilityName",""} |
| the key given to the newly created association map More...
|
|
SG::WriteHandleKey< Trk::ClusterSplitProbabilityContainer > | m_clusterSplitProbContainerOut {this,"OutputClusterSplitProbabilityName",""} |
| the key given to the newly created association map More...
|
|
float | m_sharedProbCut |
| NN split sprob cut for 2 particle clusters. More...
|
|
float | m_sharedProbCut2 |
| NN split sprob cut for 3 particle clusters. More...
|
|
std::vector< float > | m_etaBounds |
| eta intervals for internal monitoring More...
|
|
std::mutex | m_statMutex |
|
Counter m_stat | ATLAS_THREAD_SAFE |
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
◆ Counter
◆ PrdSignature
◆ PrdSignatureSet
◆ StoreGateSvc_t
◆ TrackScoreMap
◆ ScoreCategory
◆ DenseEnvironmentsAmbiguityScoreProcessorTool()
Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::DenseEnvironmentsAmbiguityScoreProcessorTool |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~DenseEnvironmentsAmbiguityScoreProcessorTool()
Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::~DenseEnvironmentsAmbiguityScoreProcessorTool |
( |
| ) |
|
|
virtualdefault |
◆ addNewTracks()
Add passed TrackCollection, and Trk::PrepRawData from tracks to caches.
- Parameters
-
Definition at line 163 of file DenseEnvironmentsAmbiguityScoreProcessorTool.cxx.
167 std::unique_ptr<Trk::PRDtoTrackMap> prdToTrackMap(
m_assoTool->createPRDtoTrackMap() );
171 constexpr
bool dropDuplicateTracks{
true};
175 for(
const Track* pThisTrack : tracks) {
184 if (
category<categoryMapping.size()) {
185 stat.incrementCounterByRegion(categoryMapping[
category],pThisTrack);
191 trackScoreTrackMap->push_back(std::make_pair(pThisTrack, -
score));
200 static_cast<double>(
score),
209 static_cast<double>(
score),
220 if ((
unsigned int) (nZeroScore+
nDuplicates+nToMap) != tracks.size()){
221 ATH_MSG_ERROR(
"(nZeroScore+nDuplicates+nToMap) = "<<nZeroScore+
nDuplicates+nToMap<<
" but tracks.size() = "<<tracks.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);
◆ 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.
◆ 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.
◆ 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()
◆ dumpStat()
void Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::dumpStat |
( |
MsgStream & |
out | ) |
const |
Definition at line 361 of file DenseEnvironmentsAmbiguityScoreProcessorTool.cxx.
363 auto parseFileName=[](
const std::string & fullname){
364 auto dotPosition = fullname.rfind(
'.');
365 auto slashPosition = fullname.rfind(
'/');
366 auto stringLength = dotPosition - slashPosition;
367 return fullname.substr(slashPosition, stringLength);
369 std::streamsize
ss =
out.precision();
371 out <<
"Output from ";
372 out << parseFileName(__FILE__);
376 out <<
"------------------------------------------------------------------------------------" <<
"\n";
384 out <<
" statistics by eta range ------All---Barrel---Trans.-- Endcap-- Forwrd-- " <<
"\n";
385 out <<
"------------------------------------------------------------------------------------" <<
"\n";
389 out <<
"------------------------------------------------------------------------------------" <<
"\n";
390 out << std::setiosflags(std::ios::fixed | std::ios::showpoint) << std::setprecision(2)
393 out <<
"------------------------------------------------------------------------------------" <<
"\n";
394 out << std::setprecision(
ss);
◆ 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::DenseEnvironmentsAmbiguityScoreProcessorTool::finalize |
( |
| ) |
|
|
finaloverridevirtual |
◆ initialize()
StatusCode Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::initialize |
( |
| ) |
|
|
finaloverridevirtual |
◆ 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::ITrackAmbiguityScoreProcessorTool::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.
◆ overlappingTracks()
Find SiS Tracks that share hits in the track score map.
Definition at line 270 of file DenseEnvironmentsAmbiguityScoreProcessorTool.cxx.
279 std::map< const InDet::PixelCluster*, const Trk::TrackParameters* > setOfPixelClustersOnTrack;
280 std::map< const InDet::PixelCluster*, const Trk::Track* > setOfPixelClustersToTrackAssoc;
283 for(
const std::pair<const Track*, float>& scoredTracksItem : *scoredTracks ){
286 <<
":" << (scoredTracksItem.first->trackParameters() ? scoredTracksItem.first->trackParameters()->front()->pT() : -1.)
287 <<
", " << scoredTracksItem.first->measurementsOnTrack()->size()
288 <<
"\t with score "<<-scoredTracksItem.second <<
" to PRD map");
292 if(the_asso_tool->
addPRDs( prdToTrackMap, *scoredTracksItem.first ).isSuccess()){
299 const Trk::TrackStates* tsosVec = scoredTracksItem.first->trackStateOnSurfaces();
304 ATH_MSG_VERBOSE(
"---> Looping over TSOS's to allow for cluster updates: "<< tsosVec->
size() );
306 for (; tsos != tsosVec->
end(); ++tsos) {
307 const MeasurementBase* measurement = (*tsos)->measurementOnTrack();
308 if(!measurement || ! (*tsos)->trackParameters()){
309 ATH_MSG_VERBOSE(
"---- TSOS has either no measurement or parameters: "<< measurement <<
" " << (*tsos)->trackParameters() );
318 auto ret = setOfPixelClustersOnTrack.insert(std::make_pair(
pixel, (*tsos)->trackParameters() ));
322 setOfPixelClustersToTrackAssoc.insert( std::make_pair(
pixel, scoredTracksItem.first ) );
328 std::vector< std::pair< const InDet::PixelCluster*, const Trk::Track* > >
sorted;
329 sorted.reserve( setOfPixelClustersToTrackAssoc.size() );
330 for(
const std::pair< const InDet::PixelCluster* const, const Trk::Track* > &pixelTrackItem : setOfPixelClustersToTrackAssoc ) {
331 sorted.emplace_back(pixelTrackItem );
333 std::sort(
sorted.begin(),
sorted.end(), [](
const std::pair< const InDet::PixelCluster*, const Trk::Track* > &
a,
334 const std::pair< const InDet::PixelCluster*, const Trk::Track* > &
b) {
335 return a.first->getHashAndIndex().collHash() < b.first->getHashAndIndex().collHash()
336 || ( a.first->getHashAndIndex().collHash() == b.first->getHashAndIndex().collHash()
337 && a.first->getHashAndIndex().objIndex() < b.first->getHashAndIndex().objIndex() );
339 for (
const std::pair< const InDet::PixelCluster*, const Trk::Track* > &pixelTrackItem :
sorted) {
340 ATH_MSG_VERBOSE (
"---- Checking if track shares pixel hits if other tracks: " << pixelTrackItem.first <<
" with R " << pixelTrackItem.first->globalPosition().perp() );
345 TString tracks(
"---- number of tracks with this shared Prd: ");
346 tracks += numberOfTracksWithThisPrd;
349 tracks += Form(
" %p",(
void*)(
it->second));
350 double pt = (
it->second->trackParameters() ?
it->second->trackParameters()->front()->pT() : -1);
351 tracks += Form(
":%.3f",
pt);
352 tracks += Form(
",%i",
static_cast<int>(
it->second->measurementsOnTrack()->size()));
◆ process()
Do actual processing of event.
Takes a track container, and then returns the tracks which have been selected
Implements Trk::ITrackAmbiguityScoreProcessorTool.
Definition at line 96 of file DenseEnvironmentsAmbiguityScoreProcessorTool.cxx.
98 const EventContext& ctx = Gaudi::Hive::currentContext();
103 if ( !splitClusterMapHandle_last.isValid() ){
116 if (!splitProbContainerIn.
isValid()) {
121 ? std::make_unique<ClusterSplitProbabilityContainer>(*splitProbContainerIn)
122 : std::make_unique<ClusterSplitProbabilityContainer>());
129 if (splitProbContainerHandle.
record(std::move(splitProbContainerCleanup)).isFailure()) {
132 splitProbContainer=splitProbContainerHandle.
ptr();
135 splitProbContainer=splitProbContainerCleanup.get();
142 overlappingTracks(trackScoreTrackMap, splitClusterMap, *splitProbContainer, *prdToTrackMap);
147 :
m_assoTool->reduceToStorableMap(std::move(prdToTrackMap)) )).isFailure()) {
153 splitClusterMapHandle = std::unique_ptr<InDet::PixelGangedClusterAmbiguities>(splitClusterMap);
154 if( !splitClusterMapHandle.isValid() ){
◆ renounce()
◆ renounceArray()
◆ statistics()
void Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::statistics |
( |
| ) |
|
|
overridevirtual |
◆ 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.
◆ updatePixelSplitInformationForCluster()
◆ updateVHKA()
◆ ATLAS_THREAD_SAFE
Counter m_stat Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::ATLAS_THREAD_SAFE |
|
mutableprivate |
◆ m_assoMapName
◆ m_assoTool
◆ m_assoToolNotGanged
◆ m_clusterSplitProbContainerIn
◆ m_clusterSplitProbContainerOut
◆ m_detStore
◆ m_etaBounds
std::vector<float> Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::m_etaBounds |
|
private |
◆ m_evtStore
◆ m_observerTool
PublicToolHandle<Trk::ITrkObserverTool> Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::m_observerTool {this, "ObserverTool", "", "track observer within ambiguity solver"} |
|
private |
◆ m_scoringTool
◆ m_sharedProbCut
float Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::m_sharedProbCut |
|
private |
◆ m_sharedProbCut2
float Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::m_sharedProbCut2 |
|
private |
◆ m_splitClusterMapKey
◆ m_splitClusterMapKey_last
◆ m_splitProbTool
◆ m_statMutex
std::mutex Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::m_statMutex |
|
mutableprivate |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
Const iterator class for DataVector/DataList.
TrackFilterCategory categoriseTrack(const Trk::Track &track, const Trk::TrackScore &score, const bool dropDuplicates, const AssociationTool &associate, AssociationMap &map, DuplicationCheckSet &set)
ProbabilityInfo & setSplitInformation(const PrepRawData *cluster, float prob1, float prob2)
std::multimap< const SiCluster *, const SiCluster *, ::InDet::compare_SiCluster > PixelGangedClusterAmbiguities
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
virtual bool rioType(RIO_OnTrackType::Type type) const =0
Method checking the Rio On Track type.
#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?
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
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.
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
float splitProbability1() const
const ProbabilityInfo & splitProbability(const PrepRawData *cluster) const
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
size_type size() const noexcept
Returns the number of elements in the collection.
static const ProbabilityInfo & getNoSplitProbability()
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
float splitProbability2() const
std::pair< PrepRawDataTrackMap::const_iterator, PrepRawDataTrackMap::const_iterator > ConstPrepRawDataTrackMapRange
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
double splitProbability(unsigned int nParticles=2) const
return method : total split probability