ATLAS Offline Software
InDetPriVxDummyFinder.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  InDetPriVxDummyFinder.cxx - Description
7  -------------------
8  ***************************************************************************/
11 #include "xAODTracking/Vertex.h"
17 #include <vector>
18 
19 namespace InDet
20 {
21 
22  InDetPriVxDummyFinder::InDetPriVxDummyFinder ( const std::string &n, ISvcLocator *pSvcLoc )
23  : AthAlgorithm ( n, pSvcLoc ),
24  m_vxCandidatesOutputName ( "VxPrimaryCandidate" )
25  {
26  declareProperty ( "VxCandidatesOutputName",m_vxCandidatesOutputName );
27  }
28 
30 
32  {
34  return StatusCode::SUCCESS;
35  }
36 
38  {
39  xAOD::VertexContainer* theVxContainer = new xAOD::VertexContainer();
41  theVxContainer->setStore( aux );
43  xAOD::Vertex* dummyVertex = new xAOD::Vertex();
44  theVxContainer->push_back ( dummyVertex ); // have to add vertex to container here first so it can use its aux store - David S.
45  dummyVertex->setPosition(beamSpotHandle->beamVtx().position());
46  dummyVertex->setCovariancePosition(beamSpotHandle->beamVtx().covariancePosition());
47  dummyVertex->setVertexType(xAOD::VxType::NoVtx);
48 
49  //---- Recording section: write the results to StoreGate ---//
50  if ( evtStore()->record ( theVxContainer, m_vxCandidatesOutputName,false ).isFailure() )
51  {
52  if (msgLvl(MSG::ERROR)) msg() << "Unable to record Vertex Container in StoreGate" << endmsg;
53  return StatusCode::FAILURE;
54  }
55 
56  return StatusCode::SUCCESS;
57  }
58 
60  {
61  return StatusCode::SUCCESS;
62  }
63 
64 } // end namespace InDet
xAOD::Vertex_v1::setPosition
void setPosition(const Amg::Vector3D &position)
Sets the 3-position.
xAOD::VertexAuxContainer_v1
Temporary container used until we have I/O for AuxStoreInternal.
Definition: VertexAuxContainer_v1.h:32
InDet::InDetPriVxDummyFinder::execute
StatusCode execute()
Definition: InDetPriVxDummyFinder.cxx:40
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition: Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
InDet::InDetPriVxDummyFinder::finalize
StatusCode finalize()
Definition: InDetPriVxDummyFinder.cxx:62
InDet
DUMMY Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
AthCommonMsg< Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
xAOD::VertexContainer
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Definition: VertexContainer.h:14
xAOD::VxType::NoVtx
@ NoVtx
Dummy vertex. TrackParticle was not used in vertex fit.
Definition: TrackingPrimitives.h:570
xAOD::Vertex_v1::setVertexType
void setVertexType(VxType::VertexType vType)
Set the type of the vertex.
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
TrackParticleAuxContainer.h
xAOD::VertexAuxContainer
VertexAuxContainer_v1 VertexAuxContainer
Definition of the current jet auxiliary container.
Definition: VertexAuxContainer.h:19
beamspotman.n
n
Definition: beamspotman.py:731
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDet::InDetPriVxDummyFinder::~InDetPriVxDummyFinder
virtual ~InDetPriVxDummyFinder()
VxTrackAtVertex.h
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
Vertex.h
AthAlgorithm
Definition: AthAlgorithm.h:47
InDet::InDetPriVxDummyFinder::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: InDetPriVxDummyFinder.h:42
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
InDet::InDetPriVxDummyFinder::initialize
StatusCode initialize()
Definition: InDetPriVxDummyFinder.cxx:34
TrackParticle.h
InDetPriVxDummyFinder.h
VertexContainer.h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
InDet::InDetPriVxDummyFinder::InDetPriVxDummyFinder
InDetPriVxDummyFinder(const std::string &name, ISvcLocator *pSvcLocator)
Definition: InDetPriVxDummyFinder.cxx:25
xAOD::Vertex_v1::setCovariancePosition
void setCovariancePosition(const AmgSymMatrix(3)&covariancePosition)
Sets the vertex covariance matrix.
InDet::InDetPriVxDummyFinder::m_vxCandidatesOutputName
std::string m_vxCandidatesOutputName
Name of output container to store results.
Definition: InDetPriVxDummyFinder.h:41
TrackParticleContainer.h
VertexAuxContainer.h