|  | 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");
 
   63     declareProperty(
"SubVertexTrackIndices", 
m_indices);
 
   67     declareProperty(
"RefitPV"               , 
m_refitPV                = 
false);
 
   70     declareProperty(
"MaxPVrefit"            , 
m_PV_max                = 1000);
 
   74     declareProperty(
"Do3d"        , 
m_do3d          = 
false);
 
   89         return StatusCode::FAILURE;
 
   96     if(
m_VKVFitter==
nullptr) 
return StatusCode::FAILURE;
 
  106     return StatusCode::SUCCESS;
 
  112     ATH_CHECK(vtxContainer.
record(std::make_unique<xAOD::VertexContainer>(), std::make_unique<xAOD::VertexAuxContainer>()));
 
  140         for(
size_t i =0; 
i<Ntracks; 
i++)
 
  143             if(trackN >= 
v->nTrackParticles())
 
  146                 return StatusCode::FAILURE;
 
  148             fitpair[
i] = 
v->trackParticle(trackN);
 
  154       for (
auto trkItr=importedTrackCollection->
cbegin(); trkItr!=importedTrackCollection->
cend(); ++trkItr) {
 
  156          fitpair.back() = 
nullptr;
 
  165          fitAndStore(vtxContainer.
ptr(),
v,InVtxContainer.cptr(),fitpair,importedTrackCollection.
cptr(),pvContainer.
cptr());
 
  170       fitAndStore(vtxContainer.
ptr(),
v,InVtxContainer.cptr(),fitpair,importedTrackCollection.
cptr(),pvContainer.
cptr());
 
  187         ATH_CHECK(refPvContainer.
record(std::make_unique<xAOD::VertexContainer>(), std::make_unique<xAOD::VertexAuxContainer>()));
 
  189         if(vtxContainer->
size() >0){
 
  193       if(pvContainer->
size()==0) {
 
  204     std::vector<const xAOD::TrackParticleContainer*> trackCols;
 
  207       trackCols.push_back(handle.
cptr());
 
  209     if(not trackCols.empty()){
 
  213           }
catch(std::runtime_error 
const& 
e){
 
  215             return StatusCode::FAILURE;
 
  219     return StatusCode::SUCCESS;
 
  225                     const std::vector<const xAOD::TrackParticle*> &
inputTracks,
 
  229    std::unique_ptr<xAOD::Vertex> 
ptr(
fit(
inputTracks, importedTrackCollection, 
nullptr));
 
  232    double chi2DOF = 
ptr->chiSquared()/
ptr->numberDoF();
 
  235    if(!chi2CutPassed) { 
ATH_MSG_DEBUG(
"Chi Cut failed!");  
return; }
 
  240       double bMass = bMomentum.M();
 
  242       if(!passesCuts)
return;
 
  246    std::vector<const xAOD::Vertex*> thePreceding;
 
  247    thePreceding.push_back(
v);
 
  251       if (!closestRefPV.
get()) 
return;
 
  252       std::unique_ptr<xAOD::Vertex> ptrPV(
fit(
inputTracks, importedTrackCollection, closestRefPV.
get()));
 
  258       if(!chi2CutPassed) { 
ATH_MSG_DEBUG(
"Chi Cut failed!");  
return; }
 
  263      double bMass = bMomentumPV.M();
 
  265      if(!passesCuts)
return;
 
  269       vtxContainer->
push_back(ptrPV.release());
 
  296                       pv->position().z(), *state);
 
  312    if (errorcode != 0) {startingPoint(0) = 0.0; startingPoint(1) = 0.0; startingPoint(2) = 0.0;}
 
  317       std::vector<ElementLink<DataVector<xAOD::TrackParticle> > > newLinkVector;
 
  322        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)
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.
SG::ReadHandleKey< xAOD::VertexContainer > m_defaultPVContainerName
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 StatusCode addBranches(const EventContext &ctx) const override
virtual void setMassInputParticles(const std::vector< double > &, IVKalState &istate) const override final
virtual std::unique_ptr< IVKalState > makeState(const EventContext &ctx) const override final