Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
29 const IInterface*
p) :
30 base_class(
t,
n,
p), m_vertexEstimator(
"InDet::VertexPointEstimator"), m_iVertexFitter(
"Trk::TrkVKalVrtFitter"),
33 m_v0Tools(
"Trk::V0Tools"),
34 m_pvRefitter(
"Analysis::PrimaryVertexRefitter", this),
36 m_vertexFittingWithPV(false),
39 m_useAdditionalTrack(false)
48 declareProperty(
"TrackContainerName",
m_trackContainer =
"InDetTrackParticles");
62 declareProperty(
"SubVertexTrackIndices",
m_indices);
66 declareProperty(
"RefitPV" ,
m_refitPV =
false);
69 declareProperty(
"MaxPVrefit" ,
m_PV_max = 1000);
73 declareProperty(
"Do3d" ,
m_do3d =
false);
88 return StatusCode::FAILURE;
95 if(
m_VKVFitter==
nullptr)
return StatusCode::FAILURE;
104 return StatusCode::SUCCESS;
109 const EventContext& ctx = Gaudi::Hive::currentContext();
111 ATH_CHECK(vtxContainer.
record(std::make_unique<xAOD::VertexContainer>(), std::make_unique<xAOD::VertexAuxContainer>()));
136 for(
size_t i =0;
i<Ntracks;
i++)
139 if(trackN >=
v->nTrackParticles())
142 return StatusCode::FAILURE;
144 fitpair[
i] =
v->trackParticle(trackN);
150 for (
auto trkItr=importedTrackCollection->
cbegin(); trkItr!=importedTrackCollection->
cend(); ++trkItr) {
152 fitpair.back() =
nullptr;
161 fitAndStore(vtxContainer.
ptr(),
v,InVtxContainer.cptr(),fitpair,importedTrackCollection.
cptr(),pvContainer.
cptr());
166 fitAndStore(vtxContainer.
ptr(),
v,InVtxContainer.cptr(),fitpair,importedTrackCollection.
cptr(),pvContainer.
cptr());
183 ATH_CHECK(refPvContainer.
record(std::make_unique<xAOD::VertexContainer>(), std::make_unique<xAOD::VertexAuxContainer>()));
185 if(vtxContainer->
size() >0){
195 std::vector<const xAOD::TrackParticleContainer*> trackCols;
198 trackCols.push_back(handle.
cptr());
200 if(not trackCols.empty()){
204 }
catch(std::runtime_error
const&
e){
206 return StatusCode::FAILURE;
210 return StatusCode::SUCCESS;
216 const std::vector<const xAOD::TrackParticle*> &
inputTracks,
220 std::unique_ptr<xAOD::Vertex>
ptr(
fit(
inputTracks, importedTrackCollection,
nullptr));
223 double chi2DOF =
ptr->chiSquared()/
ptr->numberDoF();
226 if(!chi2CutPassed) {
ATH_MSG_DEBUG(
"Chi Cut failed!");
return; }
231 double bMass = bMomentum.M();
233 if(!passesCuts)
return;
237 std::vector<const xAOD::Vertex*> thePreceding;
238 thePreceding.push_back(
v);
242 if (!closestRefPV.
get())
return;
243 std::unique_ptr<xAOD::Vertex> ptrPV(
fit(
inputTracks, importedTrackCollection, closestRefPV.
get()));
249 if(!chi2CutPassed) {
ATH_MSG_DEBUG(
"Chi Cut failed!");
return; }
254 double bMass = bMomentumPV.M();
256 if(!passesCuts)
return;
260 vtxContainer->
push_back(ptrPV.release());
287 pv->position().z(), *state);
303 if (errorcode != 0) {startingPoint(0) = 0.0; startingPoint(1) = 0.0; startingPoint(2) = 0.0;}
308 std::vector<ElementLink<DataVector<xAOD::TrackParticle> > > newLinkVector;
313 newLinkVector.push_back( mylink );
SG::WriteHandleKey< xAOD::VertexContainer > m_refPVContainerName
static Analysis::CleanUpVertex ClosestRefPV(xAOD::BPhysHelper &, const xAOD::VertexContainer *, const Analysis::PrimaryVertexRefitter *)
std::vector< int > m_TrackIndices
TVector3 totalP()
: Returns total 3-momentum calculated from the refitted tracks
const xAOD::Vertex * get() const
SG::WriteHandleKey< xAOD::VertexContainer > m_OutputContainerName
xAOD::Vertex * fit(const std::vector< const xAOD::TrackParticle * > &inputTracks, const xAOD::TrackParticleContainer *importedTrackCollection, const xAOD::Vertex *pv) const
virtual void setVertexForConstraint(const xAOD::Vertex &, IVKalState &istate) const override final
virtual void setCovVrtForConstraint(double XX, double XY, double YY, double XZ, double YZ, double ZZ, IVKalState &istate) const override final
@ z
global position (cartesian)
virtual StatusCode addBranches() const override
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
const_pointer_type cptr()
Dereference the pointer.
bool m_vertexFittingWithPV
bool m_useAdditionalTrack
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo_key
std::vector< std::string > m_hypoNames
SG::ReadHandleKey< xAOD::VertexContainer > m_inputContainerName
bool pass() const
get the pass flag for this hypothesis
const_iterator cend() const noexcept
Return a const_iterator pointing past the end of the collection.
Trk::TrkVKalVrtFitter * m_VKVFitter
static bool isContainedIn(const xAOD::TrackParticle *, const std::vector< const xAOD::TrackParticle * > &)
bool setPrecedingVertices(const std::vector< const xAOD::Vertex * > &vertices, const xAOD::VertexContainer *vertexContainer)
Sets links to preceding vertices.
ToolHandle< InDet::VertexPointEstimator > m_vertexEstimator
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackContainer
virtual void setMassForConstraint(double Mass, IVKalState &istate) const override final
ToolHandle< Analysis::PrimaryVertexRefitter > m_pvRefitter
SG::ReadHandleKeyArray< xAOD::TrackParticleContainer > m_RelinkContainers
std::vector< double > m_trkMasses
std::vector< int > m_indices
::StatusCode StatusCode
StatusCode definition for legacy code.
pointer_type ptr()
Dereference the pointer.
: B-physics xAOD helpers.
virtual StatusCode initialize() override
virtual void setCnstType(int, IVKalState &istate) const override final
void setTrackParticleLinks(const TrackParticleLinks_t &trackParticles)
Set all track particle links at once.
ToolHandle< Trk::V0Tools > m_v0Tools
ReVertex(const std::string &t, const std::string &n, const IInterface *p)
void clearTracks()
Remove all tracks from the vertex.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ElementLink implementation for ROOT usage.
static void RelinkVertexTracks(const std::vector< const xAOD::TrackParticleContainer * > &trkcols, xAOD::Vertex *vtx)
bool setStorableObject(BaseConstReference data, bool replace=false, IProxyDict *sg=0)
Set link to point to a new container (storable).
value_type push_back(value_type pElem)
Add an element to the end of the collection.
Eigen::Matrix< double, 3, 1 > Vector3D
float numberDoF() const
Returns the number of degrees of freedom of the vertex fit as float.
bool setRefTrks(std::vector< float > px, std::vector< float > py, std::vector< float > pz)
Sets refitted track momenta.
float chiSquared() const
Returns the of the vertex fit as float.
Class describing a Vertex.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
const_iterator cbegin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
SG::ReadHandleKey< xAOD::VertexContainer > m_pvContainerName
void fitAndStore(xAOD::VertexContainer *vtxContainer, const xAOD::Vertex *v, const xAOD::VertexContainer *InVtxContainer, const std::vector< const xAOD::TrackParticle * > &inputTracks, const xAOD::TrackParticleContainer *importedTrackCollection, const xAOD::VertexContainer *pvContainer) const
Class describing a TrackParticle.
virtual xAOD::Vertex * fit(const std::vector< const TrackParameters * > &perigeeList, const Amg::Vector3D &startingPoint) const override final
Interface for MeasuredPerigee with starting point.
ToolHandle< Trk::IVertexFitter > m_iVertexFitter
SG::ReadHandleKeyArray< xAOD::VertexContainer > m_CollectionsToCheck
size_type size() const noexcept
Returns the number of elements in the collection.
virtual void setMassInputParticles(const std::vector< double > &, IVKalState &istate) const override final
virtual std::unique_ptr< IVKalState > makeState(const EventContext &ctx) const override final