 |
ATLAS Offline Software
|
#include <TrackParametersKVU.h>
the code used in this implementation is kindly stolen from: atlasoff:: ISF/ISF_Core/ISF_Tools
- Author
- James Catmore -at- cern.ch
Definition at line 57 of file TrackParametersKVU.h.
◆ TrackParametersKVU()
| DerivationFramework::TrackParametersKVU::TrackParametersKVU |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~TrackParametersKVU()
| virtual DerivationFramework::TrackParametersKVU::~TrackParametersKVU |
( |
| ) |
|
|
virtualdefault |
◆ addBranches()
| StatusCode DerivationFramework::TrackParametersKVU::addBranches |
( |
const EventContext & |
ctx | ) |
const |
|
overridevirtual |
Check that the current event passes this filter.
Definition at line 62 of file TrackParameterKVU.cxx.
70 if(tracks->size() !=0) {
80 for (
const auto track : *tracks) {
84 std::unique_ptr<
AmgSymMatrix(5)> updateTrackCov =
nullptr;
85 float updatephi = -999;
86 float updatetheta = -999;
87 float updated0 = -999;
88 float updatez0 = -999;
89 float updateqOverP = -999;
90 float updateChi2 = -999;
91 bool usedPrimaryVertex =
false;
92 std::vector<float>
vec;
94 std::unique_ptr<const Trk::TrackParameters> trackParams =
nullptr;
100 if (vxContainer.isValid()) {
105 auto vtxSurface = std::make_unique<Trk::PerigeeSurface>(vtxPos);
106 trackParams =
m_extrapolator->extrapolate(ctx,*tPerigee,*vtxSurface);
107 std::unique_ptr<const Trk::ImpactParametersAndSigma> iPandSigma =
nullptr;
108 iPandSigma =
m_IPEstimator->estimate(trackParams.get(), vtx);
109 if(sqrt(iPandSigma->
IPd0*iPandSigma->
IPd0+iPandSigma->
IPz0*iPandSigma->
IPz0) < minIP){
110 minIP = sqrt(iPandSigma->
IPd0*iPandSigma->
IPd0+iPandSigma->
IPz0*iPandSigma->
IPz0);
113 ATH_MSG_VERBOSE(
"n vtx pos(x, y, z) IPd0 IPz0 : " << nVtx <<
" " << vtx->position().x() <<
" "<< vtx->position().y() <<
" "<< vtx->position().z() <<
" " << iPandSigma->
IPd0 <<
" " << iPandSigma->
IPz0);
120 return StatusCode::FAILURE;
131 auto recVtx = std::make_unique<xAOD::Vertex>();
132 recVtx->makePrivateStore(*closestVertex);
133 auto surface = std::make_unique<const Trk::PerigeeSurface>(globPos);
134 trackParams =
m_extrapolator->extrapolate(ctx,*tPerigee,*surface);
135 auto linearTrack = std::make_unique<Trk::VxTrackAtVertex>(0.,
nullptr,
nullptr, trackParams.get(),
nullptr);
139 ATH_MSG_VERBOSE(
"Updating linearized track parameters after vertex fit. Track weight = " << linearTrack->weight());
141 ATH_MSG_VERBOSE (
"track info after vertex track updator !"<<*linearTrack );
142 if(linearTrack->perigeeAtVertex()) {
144 updateqOverP = linearTrack->perigeeAtVertex()->parameters()[
Trk::qOverP];
145 updated0 = linearTrack->perigeeAtVertex()->parameters()[
Trk::d0];
146 updatez0 = linearTrack->perigeeAtVertex()->parameters()[
Trk::z0];
147 updatephi = linearTrack->perigeeAtVertex()->parameters()[
Trk::phi0];
148 updatetheta = linearTrack->perigeeAtVertex()->parameters()[
Trk::theta];
150 updateTrackCov = std::make_unique<AmgSymMatrix(5)>(*linearTrack->perigeeAtVertex()->covariance());
151 updateChi2 = linearTrack->trackQuality().chiSquared();
159 decoratorKVUqOverP(*
track) = updateqOverP;
160 decoratorKVUd0(*
track) = updated0;
161 decoratorKVUz0(*
track) = updatez0;
162 decoratorKVUphi(*
track) = updatephi;
163 decoratorKVUtheta(*
track) = updatetheta;
164 decoratorKVUChi2(*
track) = updateChi2;
165 decoratorKVUusedPV(*
track) = usedPrimaryVertex;
178 return StatusCode::SUCCESS;
◆ initialize()
| StatusCode DerivationFramework::TrackParametersKVU::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 22 of file TrackParameterKVU.cxx.
26 ATH_MSG_ERROR(
"No selection variables for the TrackParametersKVU tool!");
27 return StatusCode::FAILURE;
57 ATH_MSG_DEBUG(
"Successfully retrieved the TrackParametersKVU tool" );
58 return StatusCode::SUCCESS;
◆ m_extrapolator
Initial value:{
this, "TrackExtrapolator", "Trk::Extrapolator/AtlasExtrapolator"}
Definition at line 96 of file TrackParametersKVU.h.
◆ m_IPEstimator
Initial value:{
this, "IPEstimator", "Trk::TrackToVertexIPEstimator/TrackToVertexIPEstimator"}
Definition at line 100 of file TrackParametersKVU.h.
◆ m_KVUChi2Key
◆ m_KVUCovMatKey
◆ m_KVUd0Key
◆ m_KVUphiKey
◆ m_KVUqOverPKey
◆ m_KVUthetaKey
◆ m_KVUusedPVKey
◆ m_KVUz0Key
◆ m_LinearizedTrackFactory
Initial value:{
this, "LinearizedTrackFactory", "Trk::FullLinearizedTrackFactory/FullLinearizedTrackFactory"}
Definition at line 98 of file TrackParametersKVU.h.
◆ m_sgName
| StringProperty DerivationFramework::TrackParametersKVU::m_sgName {this, "DecorationPrefix", "", "decoration prefix"} |
|
private |
◆ m_trackContainerKey
Initial value:{
this, "TrackParticleContainerName", "InDetDisappearingTrackParticles"}
Definition at line 73 of file TrackParametersKVU.h.
◆ m_vertexContainerKey
Initial value:{
this, "VertexContainerName", "PrimaryVertices"}
Definition at line 75 of file TrackParametersKVU.h.
◆ m_vertexTrackUpdator
Initial value:{
this, "VertexTrackUpdator", "Trk::KalmanVertexTrackUpdator"}
Definition at line 94 of file TrackParametersKVU.h.
The documentation for this class was generated from the following files:
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
void compress(const AmgSymMatrix(N) &covMatrix, std::vector< float > &vec)
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainerKey
const Amg::Vector3D & position() const
Returns the 3-pos.
std::vector< size_t > vec
ToolHandle< Trk::IVertexTrackUpdator > m_vertexTrackUpdator
#define ATH_MSG_VERBOSE(x)
ToolHandle< Trk::IExtrapolator > m_extrapolator
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool empty() const
Test if the key is blank.
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_KVUqOverPKey
VxType::VertexType vertexType() const
The type of the vertex.
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_KVUthetaKey
#define AmgSymMatrix(dim)
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_KVUChi2Key
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_KVUCovMatKey
Handle class for adding a decoration to an object.
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_KVUphiKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackContainerKey
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Eigen::Matrix< double, 3, 1 > Vector3D
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_KVUz0Key
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.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Class describing a Vertex.
ToolHandle< Trk::IVertexLinearizedTrackFactory > m_LinearizedTrackFactory
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_KVUd0Key
ToolHandle< Trk::ITrackToVertexIPEstimator > m_IPEstimator
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_KVUusedPVKey