ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::SequentialVertexSmoother Class Reference

A concrete implementation of the Vertex smoother Takes the tracks from the VxCandidates and updates them with the knowledge of the reconstructed vertex position. More...

#include <SequentialVertexSmoother.h>

Inheritance diagram for Trk::SequentialVertexSmoother:
Collaboration diagram for Trk::SequentialVertexSmoother:

Public Member Functions

virtual StatusCode initialize () override
 default AlgTools methods
 SequentialVertexSmoother (const std::string &t, const std::string &n, const IInterface *p)
 constructor and destructor
virtual ~SequentialVertexSmoother ()
virtual void smooth (xAOD::Vertex &vtx) const override
 Smooth method itself: updates the tracks belonging to the VxCandidate with the knowledge of the vertex position.
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

Static Public Member Functions

static const InterfaceID & interfaceID ()
 AlgTool interface methods.

Protected Member Functions

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.

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

ToolHandle< IVertexTrackUpdatorm_vertexTrackUpdator
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

A concrete implementation of the Vertex smoother Takes the tracks from the VxCandidates and updates them with the knowledge of the reconstructed vertex position.

Can be used with any VertexTrackUpdator. The default is KalmanVertexTrackUpdator

Author
Kirill Prokofiev, November 2005

Modifications due to EDM changes + additional protection against empty pointers. August 2006 Kiril.nosp@m.l.Pr.nosp@m.okofi.nosp@m.ev@c.nosp@m.ern.c.nosp@m.h


Changes:

David Shope david.nosp@m..ric.nosp@m.hard..nosp@m.shop.nosp@m.e@cer.nosp@m.n.ch (2016-04-19) EDM Migration to xAOD - from Trk::VxCandidate to xAOD::Vertex

Definition at line 41 of file SequentialVertexSmoother.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ SequentialVertexSmoother()

Trk::SequentialVertexSmoother::SequentialVertexSmoother ( const std::string & t,
const std::string & n,
const IInterface * p )

constructor and destructor

Definition at line 28 of file SequentialVertexSmoother.cxx.

28 :
29 AthAlgTool(t,n,p),
30 m_vertexTrackUpdator("Trk::KalmanVertexTrackUpdator", this)
31 {
32 declareProperty("VertexTrackUpdator",m_vertexTrackUpdator);
33 declareInterface<IVertexSmoother>(this);
34 }//end of constructor description
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ToolHandle< IVertexTrackUpdator > m_vertexTrackUpdator

◆ ~SequentialVertexSmoother()

Trk::SequentialVertexSmoother::~SequentialVertexSmoother ( )
virtualdefault

Member Function Documentation

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

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

◆ 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

◆ initialize()

StatusCode Trk::SequentialVertexSmoother::initialize ( )
overridevirtual

default AlgTools methods

Definition at line 13 of file SequentialVertexSmoother.cxx.

14 {
15
16//uploading the corresponding tools
17 if ( m_vertexTrackUpdator.retrieve().isFailure() ) {
18 msg(MSG::FATAL) << "Failed to retrieve tool " << m_vertexTrackUpdator << endmsg;
19 return StatusCode::FAILURE;
20 }
21 msg(MSG::INFO) << "Retrieved tool " << m_vertexTrackUpdator << endmsg;
22
23 return StatusCode::SUCCESS;
24 }//end of initialize method
#define endmsg
MsgStream & msg() const

◆ 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::IVertexSmoother::interfaceID ( )
inlinestaticinherited

AlgTool interface methods.

Definition at line 52 of file IVertexSmoother.h.

52{ return IID_IVertexSmoother; };
static const InterfaceID IID_IVertexSmoother("IVertexSmoother", 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.

◆ 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 }
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)

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

◆ smooth()

void Trk::SequentialVertexSmoother::smooth ( xAOD::Vertex & vtx) const
overridevirtual

Smooth method itself: updates the tracks belonging to the VxCandidate with the knowledge of the vertex position.

Implements Trk::IVertexSmoother.

Definition at line 42 of file SequentialVertexSmoother.cxx.

43 {
44
45 //vector of associated tracks at vertex:
46 //protection check whether vxTrackAtVertices are attached to the object
47 if( vtx.vxTrackAtVertexAvailable() ) //TODO: is this the right thing to check?
48 {
49 std::vector<Trk::VxTrackAtVertex> & tracks = vtx.vxTrackAtVertex();
50
51 //updating the tracks one by one
52 if(!tracks.empty())
53 {
54 for(auto & track : tracks)
55 {
56 //TODO: There were previously null pointer checks on both the contents and vector itself
57 // of std::vector<Trk::VxTrackAtVertex*>* in VxCandidate
58 // but now in xAOD::Vertex, there is only a std::vector<Trk::VxTrackAtVertex> so
59 // pointer checks are not possible
60 //
61 // -David S.
62 m_vertexTrackUpdator->update( track, vtx );
63 }//end of loop over all tracks in particular vertex
64 }
65 else{
66
67 //something wrong: notification to user
68 msg(MSG::ERROR) << "Vertex to be smoothed containes no tracks!" << endmsg;
69 msg(MSG::ERROR) << "No action taken; Initial xAOD::Vertex returned." << endmsg;
70 }//end of protection statement
71 }else{
72 msg(MSG::ERROR) << "Vertex to be smoothed has no vxTrackAtVertices available!" << endmsg;
73 msg(MSG::ERROR) << "No action taken; Initial xAOD::Vertex returned." << endmsg;
74 }//end of protection check whether vxTrackAtVertices are attached to the object
75 }//end of smooth method
bool vxTrackAtVertexAvailable() const
Check if VxTrackAtVertices are attached to the object.
std::vector< Trk::VxTrackAtVertex > & vxTrackAtVertex()
Non-const access to the VxTrackAtVertex vector.

◆ 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

◆ 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_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_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vertexTrackUpdator

ToolHandle< IVertexTrackUpdator > Trk::SequentialVertexSmoother::m_vertexTrackUpdator
private

Definition at line 67 of file SequentialVertexSmoother.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: