|
ATLAS Offline Software
|
#include <KalmanVertexUpdator.h>
|
virtual StatusCode | initialize () override |
|
| KalmanVertexUpdator (const std::string &t, const std::string &n, const IInterface *p) |
| Constructor. More...
|
|
| ~KalmanVertexUpdator () |
| Destructor. More...
|
|
virtual xAOD::Vertex * | add (xAOD::Vertex &vtx, VxTrackAtVertex &trk) const override |
| Method adding a single track to the vertex estimate. More...
|
|
virtual xAOD::Vertex * | remove (xAOD::Vertex &vtx, VxTrackAtVertex &trk) const override |
| Method removing already added track from the vertex estimate. More...
|
|
virtual IVertexUpdator::positionUpdateOutcome | positionUpdate (const xAOD::Vertex &vtx, const LinearizedTrack *trk, double trackWeight, IVertexUpdator::updateMode mode) const override |
| Position update method. More...
|
|
virtual float | trackParametersChi2 (const xAOD::Vertex &new_vtx, const LinearizedTrack *trk) const override |
| Method calculating the interstep Chi2 increment. More...
|
|
virtual float | trackParametersChi2 (const IVertexUpdator::positionUpdateOutcome &new_vtx, const LinearizedTrack *trk) const override |
|
virtual float | vertexPositionChi2 (const xAOD::Vertex &old_vtx, const xAOD::Vertex &new_vtx) const override |
| Method calculating the vertex displacement-related part of the chi2
More...
|
|
virtual float | vertexPositionChi2 (const xAOD::Vertex &old_vtx, const IVertexUpdator::positionUpdateOutcome &new_vtx) const override |
|
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 |
|
A concrete implementation of the Vertex Updator using the Kalman filter algorithm. The algorithm adds or removes a single track from the vertex estimate.
Based on R. Fruhwirth et al. Comp. Phys. Comm 96(1996) 189
- Author
- Kirill Prokofiev, November 2005
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, from Trk::RecVertex to xAOD::Vertex, from Trk::Vertex to Amg::Vector3D
Definition at line 36 of file KalmanVertexUpdator.h.
◆ StoreGateSvc_t
◆ updateMode
◆ KalmanVertexUpdator()
Trk::KalmanVertexUpdator::KalmanVertexUpdator |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~KalmanVertexUpdator()
Trk::KalmanVertexUpdator::~KalmanVertexUpdator |
( |
| ) |
|
|
default |
◆ add()
◆ 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()
◆ 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
◆ initialize()
StatusCode Trk::KalmanVertexUpdator::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 23 of file KalmanVertexUpdator.cxx.
28 msg(MSG::ERROR)<<
" Unable to initialize the AlgTool"<<
endmsg;
29 return StatusCode::FAILURE;
32 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()
static const InterfaceID& Trk::IVertexUpdator::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
AlgTool interface methods.
Definition at line 56 of file IVertexUpdator.h.
56 {
return IID_IVertexUpdator; };
◆ 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.
◆ positionUpdate()
Position update method.
The 'mode' parameter is used to indicate whether we want to add or remove a track.
Implements Trk::IVertexUpdator.
Definition at line 126 of file KalmanVertexUpdator.cxx.
129 const AmgMatrix(5,3)&
A = trk->positionJacobian();
130 const AmgMatrix(5,3)&
B = trk->momentumJacobian();
131 const AmgVector(5) & trackParameters = trk->expectedParametersAtPCA();
132 const AmgVector(5) & constantTerm = trk->constantTerm();
133 const AmgSymMatrix(5) & trackParametersWeight = trk->expectedWeightAtPCA();
139 const AmgSymMatrix(3)& old_vrt_weight = vtx.covariancePosition().inverse();
149 AmgSymMatrix(5) gB = trackParametersWeight - trackParametersWeight*(B*(
S*B.transpose()))*trackParametersWeight.transpose();
152 AmgSymMatrix(3) new_vrt_weight_later_cov = old_vrt_weight + trackWeight *
sign *
A.transpose()*(gB*
A);
154 new_vrt_weight_later_cov = new_vrt_weight_later_cov.
inverse().eval();
157 Amg::
Vector3D new_vrt_position = new_vrt_weight_later_cov*(old_vrt_weight * old_pos + trackWeight *
sign *
A.transpose() * gB *(trackParameters - constantTerm) );
159 return IVertexUpdator::positionUpdateOutcome{new_vrt_position, new_vrt_weight_later_cov,trackParametersWeight};
◆ remove()
◆ renounce()
◆ renounceArray()
◆ 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.
◆ trackParametersChi2() [1/3]
Definition at line 175 of file KalmanVertexUpdator.cxx.
178 const AmgMatrix(5,3)&
A = trk->positionJacobian();
179 const AmgMatrix(5,3) &
B = trk->momentumJacobian();
180 const AmgVector(5) & trkParameters = trk->expectedParametersAtPCA();
183 AmgSymMatrix(3) Sm = B.transpose()*(trkParametersWeight*B);
186 Sm.computeInverseWithCheck(Sm_inverse,invertible);
190 Sm= Sm_inverse.eval();
192 const AmgVector(5)& theResidual = trk->constantTerm();
195 Amg::Vector3D newTrackMomentum = Sm*
B.transpose()*trkParametersWeight*(trkParameters - theResidual -
A*new_position);
198 AmgVector(5) refTrackParameters = theResidual +
A * new_position + B * newTrackMomentum;
201 AmgVector(5) paramDifference = trkParameters - refTrackParameters;
203 return paramDifference.transpose() * ( trkParametersWeight * paramDifference );;
◆ trackParametersChi2() [2/3]
◆ trackParametersChi2() [3/3]
◆ update()
Method where the fit is actually done.
Definition at line 48 of file KalmanVertexUpdator.cxx.
52 std::vector<Trk::VxTrackAtVertex> & tracksAtVertex = vtx.
vxTrackAtVertex();
56 auto righttrack =
std::find(tracksAtVertex.begin(), tracksAtVertex.end(), trk);
59 if (righttrack == tracksAtVertex.end())
61 ATH_MSG_VERBOSE (
"The track requested for removal or adding is not found in the vector of tracks");
64 ATH_MSG_ERROR (
"During remove track has to be already attached to the vertex");
65 msg(MSG::ERROR) <<
"The copy of initial xAOD::Vertex returned" <<
endmsg;
70 righttrack = tracksAtVertex.insert(tracksAtVertex.end(),trk);
71 ATH_MSG_VERBOSE (
"Updating vertex with new track which is still not attached to vertex. Adding it before updating...");
79 double trkWeight = trk.weight();
83 vtx.covariancePosition().computeInverseWithCheck(vrt_inverse,invertible);
89 const IVertexUpdator::positionUpdateOutcome & fit_vrt =
positionUpdate( vtx, trk.linState(), trkWeight,
mode);
103 ndf +=
sign * trkWeight * (2.0);
114 righttrack->setWeight( trkWeight );
115 righttrack->setTrackQuality(
Trk::FitQuality(trk_chi, 2 * trkWeight) );
119 tracksAtVertex.erase( righttrack );
◆ updateVHKA()
◆ vertexPositionChi2() [1/3]
Definition at line 206 of file KalmanVertexUpdator.cxx.
208 Amg::
Vector3D posDifference = new_position - old_vtx.position();
209 return posDifference.transpose()*(old_wrt_weight*posDifference);
◆ vertexPositionChi2() [2/3]
◆ vertexPositionChi2() [3/3]
◆ m_detStore
◆ m_evtStore
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
AmgMatrix(3, 3) NeutralParticleParameterCalculator
void setPosition(const Amg::Vector3D &position)
Sets the 3-position.
void setFitQuality(float chiSquared, float numberDoF)
Set the 'Fit Quality' information.
std::string find(const std::string &s)
return a remapped string
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
xAOD::Vertex * update(xAOD::Vertex &vtx, const VxTrackAtVertex &trk, IVertexUpdator::updateMode mode) const
Method where the fit is actually done.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
const Amg::Vector3D & position() const
Returns the 3-pos.
#define ATH_MSG_VERBOSE(x)
virtual void setOwner(IDataHandleHolder *o)=0
AmgSymMatrix(5) &GXFTrackState
::StatusCode StatusCode
StatusCode definition for legacy code.
CalibratedSpacePoint::Covariance_t inverse(const CalibratedSpacePoint::Covariance_t &mat)
Inverts the parsed matrix.
double chi2(TH1 *h0, TH1 *h1)
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual IVertexUpdator::positionUpdateOutcome positionUpdate(const xAOD::Vertex &vtx, const LinearizedTrack *trk, double trackWeight, IVertexUpdator::updateMode mode) const override
Position update method.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition of ATLAS Math & Geometry primitives (Amg)
Eigen::Matrix< double, 3, 1 > Vector3D
float numberDoF() const
Returns the number of degrees of freedom of the vertex fit as float.
float chiSquared() const
Returns the of the vertex fit as float.
virtual float trackParametersChi2(const xAOD::Vertex &new_vtx, const LinearizedTrack *trk) const override
Method calculating the interstep Chi2 increment.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
virtual float vertexPositionChi2(const xAOD::Vertex &old_vtx, const xAOD::Vertex &new_vtx) const override
Method calculating the vertex displacement-related part of the chi2
std::vector< Trk::VxTrackAtVertex > & vxTrackAtVertex()
Non-const access to the VxTrackAtVertex vector.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
void setCovariancePosition(const AmgSymMatrix(3)&covariancePosition)
Sets the vertex covariance matrix.