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

#include <DummyVertexSmoother.h>

Inheritance diagram for Trk::DummyVertexSmoother:
Collaboration diagram for Trk::DummyVertexSmoother:

Public Member Functions

StatusCode initialize ()
 Athena default methods.
StatusCode finalize ()
 DummyVertexSmoother (const std::string &t, const std::string &n, const IInterface *p)
 Constructor and destructor.
 ~DummyVertexSmoother ()
void smooth (xAOD::Vertex &vtx) const
 Actual smooth method.
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

Trk::IExtrapolatorm_extrapolator
std::string m_extrapolatorName
std::string m_extrapolatorInstance
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

Author
N. Giacinto Piacquadio (University of Freiburg)
Kirill Prokofiev Kiril.nosp@m.l.Pr.nosp@m.okofi.nosp@m.ev@c.nosp@m.ern.c.nosp@m.h

First real implementation: August 2006

Dummy vertex smoother. Does not refit trajectories with the knowledge of the vertex. Instead it takes trajectories, extrapolate them to the transverse point of the closest approach to the reconstructed vertex and calculates the perigee parameters of trajectories with respect to that vertex.

The extrapolated perigee parameters w.r.t the reconstructed vertex are then stored in m_perigeeAtVertex datamembers of VxTrackAtVertex's.


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 42 of file DummyVertexSmoother.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

◆ DummyVertexSmoother()

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

Constructor and destructor.

Definition at line 18 of file DummyVertexSmoother.cxx.

18 :
19 AthAlgTool(t,n,p), m_extrapolator(nullptr), m_extrapolatorName("Trk::Extrapolator"), m_extrapolatorInstance("InDetExtrapolator")
20 {
21 declareProperty("ExtrapolatorName", m_extrapolatorName);
22 declareProperty("ExtrapolatorInstance", m_extrapolatorInstance);
23 declareInterface<IVertexSmoother>(this);
24 }
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Trk::IExtrapolator * m_extrapolator

◆ ~DummyVertexSmoother()

Trk::DummyVertexSmoother::~DummyVertexSmoother ( )
default

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

◆ finalize()

StatusCode Trk::DummyVertexSmoother::finalize ( )

Definition at line 41 of file DummyVertexSmoother.cxx.

42 {
43 msg(MSG::INFO) << "Initialize successful" << endmsg;
44 return StatusCode::SUCCESS;
45 }
#define endmsg
MsgStream & msg() const

◆ initialize()

StatusCode Trk::DummyVertexSmoother::initialize ( )

Athena default methods.

Definition at line 28 of file DummyVertexSmoother.cxx.

29 {
30 StatusCode sc = AlgTool::initialize();
32 if (sc.isFailure())
33 {
34 msg(MSG::FATAL)<<"Could not find extrapolator tool." << endmsg;
35 return sc;
36 }
37 msg(MSG::INFO) << "Initialize successful" << endmsg;
38 return StatusCode::SUCCESS;
39 }
static Double_t sc
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ 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::DummyVertexSmoother::smooth ( xAOD::Vertex & vtx) const
virtual

Actual smooth method.

Implements Trk::IVertexSmoother.

Definition at line 49 of file DummyVertexSmoother.cxx.

50 {
51
52 //vector of associated tracks at vertex:
53 if( vtx.vxTrackAtVertexAvailable() ) //TODO: is this the right thing to check?
54 {
55 std::vector<Trk::VxTrackAtVertex> & tracks = vtx.vxTrackAtVertex();
56
57 if(!tracks.empty())
58 {
59 //iteratively updating private members of VxTrackAtVertex
60 std::vector<Trk::VxTrackAtVertex>::iterator t_it = tracks.begin();
61 std::vector<Trk::VxTrackAtVertex>::iterator te = tracks.end();
62 for( ;t_it != te;++t_it)
63 {
64
65 //TODO: There were previously null pointer checks on both the contents and vector itself
66 // of std::vector<Trk::VxTrackAtVertex*>* in VxCandidate
67 // but now in xAOD::Vertex, there is only a std::vector<Trk::VxTrackAtVertex> so
68 // pointer checks are not possible
69 //
70 // -David S.
71
72 //now the extrapolation will happen anyway, creating the surface
73 PerigeeSurface perigeeSurface(vtx.position());
74 const Trk::TrackParameters * initPar = (*t_it).initialPerigee();
75
76 if(initPar != nullptr)
77 {
78 //Either we should return non-const parameters from the extrapolator
79 //as the owner here has to delete them
80 //Or we need to clone
81 auto extrapolatedPerigee =
82 std::unique_ptr<const Trk::TrackParameters>(m_extrapolator->extrapolate(Gaudi::Hive::currentContext(),
83 *initPar,
84 perigeeSurface));
85 if (extrapolatedPerigee != nullptr) {
86 (*t_it).setPerigeeAtVertex(extrapolatedPerigee->clone());
87 } else {
88 msg(MSG::ERROR) << " Extrapolation failed; VxTrackAtertex will not be updated" << endmsg;
89 } // end of successfull extrapolation check
90 } else {
91 msg(MSG::WARNING) << " The VxTrackAtVertex passed has no initial Parameters? This track will not be refitted" << endmsg;
92 }//end of initial parameters protection check
93
94 }//end of loop over all fitted tracks
95 } else {
96 msg(MSG::ERROR) << "xAOD::Vertex with empty vector of tracks is passed to the Vertex Smoother" << endmsg;
97 msg(MSG::ERROR) << "No action taken; Input xAOD::Vertex stays unchanged " << endmsg;
98 }//end of empty vector check
99
100 } else {
101 msg(MSG::ERROR) << "Vertex to be smoothed has no vxTrackAtVertices available!" << endmsg;
102 msg(MSG::ERROR) << "No action taken; Initial xAOD::Vertex returned." << endmsg;
103 }//end of protection check whether vxTrackAtVertices are attached to the object
104 }//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.
const Amg::Vector3D & position() const
Returns the 3-pos.
ParametersBase< TrackParametersDim, Charged > TrackParameters

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

Trk::IExtrapolator* Trk::DummyVertexSmoother::m_extrapolator
private

Definition at line 66 of file DummyVertexSmoother.h.

◆ m_extrapolatorInstance

std::string Trk::DummyVertexSmoother::m_extrapolatorInstance
private

Definition at line 68 of file DummyVertexSmoother.h.

◆ m_extrapolatorName

std::string Trk::DummyVertexSmoother::m_extrapolatorName
private

Definition at line 67 of file DummyVertexSmoother.h.

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