ATLAS Offline Software
|
#include <AdaptiveMultiVertexFitter.h>
Public Member Functions | |
StatusCode | initialize () |
StatusCode | finalize () |
AdaptiveMultiVertexFitter (const std::string &t, const std::string &n, const IInterface *p) | |
default constructor due to Athena interface More... | |
virtual | ~AdaptiveMultiVertexFitter () |
destructor More... | |
void | fit (std::vector< xAOD::Vertex * > &allVertices) const |
fit all the provided MVFVxCandidate, which have to be already properly initialized. More... | |
void | addVtxToFit (xAOD::Vertex *pVtx) const |
Adds a new MVFVxCandidate to a previous multi-vertex fit and fits everything together. More... | |
void | addVtxTofit (xAOD::Vertex *pVtx) 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 |
Static Public Member Functions | |
static const InterfaceID & | interfaceID () |
Protected Member Functions | |
void | renounceArray (SG::VarHandleKeyArray &handlesArray) |
remove all handles from I/O resolution More... | |
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. More... | |
Private Types | |
typedef ServiceHandle< StoreGateSvc > | StoreGateSvc_t |
Private Member Functions | |
std::vector< double > | collectWeights (TrackToVtxLink &tracklink) const |
Internal function to collect the weights of the tracks partecipating to all the possible vertices (needed to renormalize the probability of the track to belong to the vertex under consideration, to be provided to the AnnealingMaker class). More... | |
void | prepareCompatibility (xAOD::Vertex *newvertex) const |
Internal function to prepare the compatibility information of all the tracks of the new vertex (an IP3dAtaPlane is added, which makes later the estimation of the compatibilities of the tracks to the vertex for the downweighting faster). 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... | |
Static Private Member Functions | |
static bool | findAmongVertices (const xAOD::Vertex *vertex, const std::vector< xAOD::Vertex * > &previousVertices) |
Internal method to find a VxCandidate among a vector of VxCandidates. More... | |
Private Attributes | |
long int | m_maxIterations |
Max number of iterations. More... | |
double | m_maxDistToLinPoint |
Maximum distance of linearization point of track to actual fitted vertex before needing to relinearize (in mm) More... | |
double | m_initialError |
Initial error in form of diagonal elements of the inverse of the covariance matrix (name is misleading: take the error, square it and initialize the variable with its inverse) More... | |
bool | m_doSmoothing |
True if smoothing after fit iterations has to be performed: otherwise the Smoother AlgoTool provided to the fitter will be ignored. More... | |
double | m_minweight |
Minimum weight a track as to have in order to be considered in the fit of one of the vertices. More... | |
double | m_maxRelativeShift |
Maximum shift allowed for last iteration... More... | |
ToolHandle< Trk::IVertexLinearizedTrackFactory > | m_LinearizedTrackFactory |
ToolHandle< Trk::IVertexTrackCompatibilityEstimator > | m_TrackCompatibilityEstimator |
ToolHandle< Trk::IImpactPoint3dEstimator > | m_ImpactPoint3dEstimator |
ToolHandle< Trk::IVertexUpdator > | m_VertexUpdator |
ToolHandle< Trk::IVertexSmoother > | m_VertexSmoother |
ToolHandle< Trk::IVertexAnnealingMaker > | m_AnnealingMaker |
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 |
This class implements a multi vertex fitting algorithm which is adaptive and robust, quite insensitive to the presence of outliers.
The multi-vertex version of the fit is more complicate than the single-vertex version and needs the input to be provided in the form of a vector of already initialized MVFVxCandidate objects. Details of the the objects to provide in the fit() and addVtxToFit() functions.
During the multi-vertex fit all the vertices are fit, using the tracks which are contained in their respective vertex candidates. Tracks which are shared among more than one vertex get their weights adjusted dynamically iteration after iteration thanks to a Deterministic Annealing procedure, so that in the end they are dinamically assigned to the vertex they most probably belong to.
As for the single-vertex fitter, for greater modularity the algorithm is divided into 6 modules (AlgTools in Athena):
Changes:
David Shope david (2016-04-19) .ric hard. shop e@cer n.ch
EDM Migration to xAOD - from Trk::VxCandidate to xAOD::Vertex, from Trk::RecVertex to xAOD::Vertex, from Trk::Vertex to Amg::Vector3D
Also, VxMultiVertex EDM has been migrated to the following:
Trk::MvfFitInfo
constraintVertex now uses xAOD::Vertex seedVertex now uses Amg::Vector3D linearizationVertex now uses Amg::Vector3D
Vertex objects stored using this class are now xAOD::Vertex
Instead of using the MVFVxCandidate class, xAOD::Vertex is employed by decorating it with the multi-vertex information:
bool isInitialized MvfFitInfo* MvfFitInfo std::Vector<VxTrackAtVertex*> VTAV
This last decoration is needed in order to be able to use MVFVxTrackAtVertex objects which have the additional information of xAOD::Vertices associated to the track and (through polymorphism) to still be able to pass them to the KalmanVertexUpdator as VxTracksAtVertex objects.
This is obviously not an ideal implementation and could be avoided if xAOD::Vertex stored a std::vector<VxTrackAtVertex*> instead of a std::vector<VxTrackAtVertex>, but I think it must remain this way until such a time as the xAOD::Vertex EDM is changed.
Definition at line 109 of file AdaptiveMultiVertexFitter.h.
|
privateinherited |
Definition at line 388 of file AthCommonDataStore.h.
Trk::AdaptiveMultiVertexFitter::AdaptiveMultiVertexFitter | ( | const std::string & | t, |
const std::string & | n, | ||
const IInterface * | p | ||
) |
default constructor due to Athena interface
Definition at line 27 of file AdaptiveMultiVertexFitter.cxx.
|
virtualdefault |
destructor
void Trk::AdaptiveMultiVertexFitter::addVtxToFit | ( | xAOD::Vertex * | pVtx | ) | const |
Adds a new MVFVxCandidate to a previous multi-vertex fit and fits everything together.
Please note that the new MVFVxCandidate provided has to be properly initialized, which means it has to have already a proper seed vertex, a constraint rec vertex, a list of initialized MVFVxTrackAtVertex, each with a link to the TrackToVtxLink object, which has to be already be updated to contain also a pointer to the MVFVxCandidate among the vertex candidates the track belongs to.
There are three steps:
1) the new vertex is added to the fit (all the tracks get initialized, so that the Plane through their IP point and the seed vertex (IP3dAtAPlane) is created, to be later able to estimate in a fast way the compatibility of the tracks to their respective vertices.
2) all tracks belonging to the new vertex are scanned and all the vertices which shares tracks with the new vertex to be fit are also added to the fit.
3) the multivertex fit is performed with all the involved vertices.
This has the clear advantage that only vertices which are really affected by adding the new vertex are being refitted, improving the overall finding performance.
Definition at line 316 of file AdaptiveMultiVertexFitter.cxx.
|
inline |
Definition at line 174 of file AdaptiveMultiVertexFitter.h.
|
private |
Internal function to collect the weights of the tracks partecipating to all the possible vertices (needed to renormalize the probability of the track to belong to the vertex under consideration, to be provided to the AnnealingMaker class).
The input is the TrackToVtxLink, where the weights are stored.
Definition at line 283 of file AdaptiveMultiVertexFitter.cxx.
|
inlineprivateinherited |
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
|
inlineprivateinherited |
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
|
inlineprivateinherited |
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
|
inlineprivateinherited |
specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>
Definition at line 199 of file AthCommonDataStore.h.
|
inlineinherited |
Declare a new Gaudi property.
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.
|
inlineinherited |
Declare a new Gaudi property.
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.
|
inlineinherited |
Definition at line 259 of file AthCommonDataStore.h.
|
inlineinherited |
Declare a new Gaudi property.
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.
|
inlineinherited |
Declare a new Gaudi property.
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.
|
inlineinherited |
Definition at line 145 of file AthCommonDataStore.h.
|
inlineinherited |
The standard StoreGateSvc/DetectorStore
Returns (kind of) a pointer to the StoreGateSvc
.
Definition at line 95 of file AthCommonDataStore.h.
|
inlineinherited |
The standard StoreGateSvc
(event store) Returns (kind of) a pointer to the StoreGateSvc
.
Definition at line 85 of file AthCommonDataStore.h.
|
inlineinherited |
The standard StoreGateSvc
(event store) Returns (kind of) a pointer to the StoreGateSvc
.
Definition at line 90 of file AthCommonDataStore.h.
|
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
StatusCode Trk::AdaptiveMultiVertexFitter::finalize | ( | ) |
Definition at line 65 of file AdaptiveMultiVertexFitter.cxx.
|
staticprivate |
Internal method to find a VxCandidate among a vector of VxCandidates.
Returns true if the vertex is found.
Definition at line 396 of file AdaptiveMultiVertexFitter.cxx.
void Trk::AdaptiveMultiVertexFitter::fit | ( | std::vector< xAOD::Vertex * > & | allVertices | ) | const |
fit all the provided MVFVxCandidate, which have to be already properly initialized.
The information about the Vertices to Tracks association is provided in the following way: the MVFVxCandidate contains a list of MVFVxTrackAtVertex, which contain each a TrackToVtxLink class: this class contains the information about all the vertices (MVFVxCandidate objects) the tracks belongs to and is shared among all MVFVxTrackAtVertex which represents the same track at the different vertices.
This has the clear advantage that the equivalent matrix of the assignments between vertices and tracks can be made block diagonal, so that no time is wasted in case of tracks which are clearly incompatible with some of the other vertices.
Definition at line 72 of file AdaptiveMultiVertexFitter.cxx.
StatusCode Trk::AdaptiveMultiVertexFitter::initialize | ( | ) |
Definition at line 50 of file AdaptiveMultiVertexFitter.cxx.
|
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.
|
inlinestatic |
Definition at line 177 of file AdaptiveMultiVertexFitter.h.
|
inlineinherited |
Definition at line 24 of file AthCommonMsg.h.
|
inlineinherited |
Definition at line 27 of file AthCommonMsg.h.
|
inlineinherited |
Definition at line 30 of file AthCommonMsg.h.
|
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.
|
private |
Internal function to prepare the compatibility information of all the tracks of the new vertex (an IP3dAtaPlane is added, which makes later the estimation of the compatibilities of the tracks to the vertex for the downweighting faster).
Further information in the TrkVertexFitterUtils package (IP3dAtAPlaneFactory class).
Definition at line 369 of file AdaptiveMultiVertexFitter.cxx.
|
inlineprotectedinherited |
Definition at line 380 of file AthCommonDataStore.h.
|
inlineprotectedinherited |
remove all handles from I/O resolution
Definition at line 364 of file AthCommonDataStore.h.
|
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 DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.
|
overridevirtualinherited |
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
|
inlineinherited |
Definition at line 308 of file AthCommonDataStore.h.
|
private |
Definition at line 285 of file AdaptiveMultiVertexFitter.h.
|
privateinherited |
Pointer to StoreGate (detector store by default)
Definition at line 393 of file AthCommonDataStore.h.
|
private |
True if smoothing after fit iterations has to be performed: otherwise the Smoother AlgoTool provided to the fitter will be ignored.
Definition at line 242 of file AdaptiveMultiVertexFitter.h.
|
privateinherited |
Pointer to StoreGate (event store by default)
Definition at line 390 of file AthCommonDataStore.h.
|
private |
Definition at line 269 of file AdaptiveMultiVertexFitter.h.
|
private |
Initial error in form of diagonal elements of the inverse of the covariance matrix (name is misleading: take the error, square it and initialize the variable with its inverse)
Definition at line 234 of file AdaptiveMultiVertexFitter.h.
|
private |
Definition at line 260 of file AdaptiveMultiVertexFitter.h.
|
private |
Maximum distance of linearization point of track to actual fitted vertex before needing to relinearize (in mm)
Definition at line 226 of file AdaptiveMultiVertexFitter.h.
|
private |
Max number of iterations.
Definition at line 217 of file AdaptiveMultiVertexFitter.h.
|
private |
Maximum shift allowed for last iteration...
(in terms of Delta|VecR|/sigma|VecR|)
Definition at line 258 of file AdaptiveMultiVertexFitter.h.
|
private |
Minimum weight a track as to have in order to be considered in the fit of one of the vertices.
This should make the fit slightly faster.
Definition at line 250 of file AdaptiveMultiVertexFitter.h.
|
private |
Definition at line 266 of file AdaptiveMultiVertexFitter.h.
|
privateinherited |
Definition at line 399 of file AthCommonDataStore.h.
|
private |
Definition at line 280 of file AdaptiveMultiVertexFitter.h.
|
private |
Definition at line 275 of file AdaptiveMultiVertexFitter.h.
|
privateinherited |
Definition at line 398 of file AthCommonDataStore.h.