Skip to content
Snippets Groups Projects
Commit 382f54f9 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'Beamspotsvc7' into 'master'

Retiring BeamSpotSvc commit 5 (ATLASRECTS-4042)

See merge request atlas/athena!16781
parents 738a7d72 738d5aac
No related branches found
No related tags found
No related merge requests found
......@@ -62,7 +62,8 @@ namespace xAODMaker {
m_lumiTool( "LuminosityTool" ),
#endif
m_beamCondSvcAvailable( false ),
m_lumiToolAvailable( false ) {
m_lumiToolAvailable( false ),
m_disableBeamSpot( false ) {
// Declare the interface(s) provided by the tool:
declareInterface< IEventInfoCnvTool >( this );
......@@ -70,6 +71,7 @@ namespace xAODMaker {
// Declare the tool's properties:
declareProperty( "BeamCondSvc", m_beamCondSvc );
declareProperty( "LuminosityTool", m_lumiTool );
declareProperty( "DisableBeamSpot", m_disableBeamSpot );
#endif
}
......@@ -88,7 +90,10 @@ namespace xAODMaker {
"xAOD::EventInfo" );
m_beamCondSvcAvailable = false;
}
if(m_disableBeamSpot){
ATH_MSG_WARNING( "Beam conditions service manually disabled on EventInfo object" );
m_beamCondSvcAvailable = false;
}
// Try to access the beam conditions service:
if( m_beamCondSvcAvailable ) {
CHECK( m_beamCondSvc.retrieve() );
......
......@@ -69,6 +69,9 @@ namespace xAODMaker {
/// Internal flag for the availability of the luminosity tool
bool m_lumiToolAvailable;
/// Flag to disable beamspot service for AthenaMT migration purposes
bool m_disableBeamSpot;
}; // class EventInfoCnvTool
} // namespace xAODMaker
......
......@@ -9,12 +9,12 @@ atlas_subdir( InDetPriVxFinder )
atlas_depends_on_subdirs( PUBLIC
Control/AthenaBaseComps
GaudiKernel
InnerDetector/InDetConditions/BeamSpotConditionsData
PRIVATE
Control/CxxUtils
Event/EventPrimitives
Event/xAOD/xAODCore
Event/xAOD/xAODTracking
InnerDetector/InDetConditions/InDetBeamSpotService
InnerDetector/InDetRecTools/InDetRecToolInterfaces
Reconstruction/RecoTools/ITrackToVertex
Tracking/TrkDetDescr/TrkSurfaces
......
......@@ -11,6 +11,7 @@
#define INDETPRIVXFINDER_INDETPRIVXDUMMYFINDER_H
#include "AthenaBaseComps/AthAlgorithm.h"
#include "GaudiKernel/ServiceHandle.h"
#include "BeamSpotConditionsData/BeamSpotData.h"
/** DUMMY Primary Vertex Finder.
InDetPriVxDummyFinder just fills one dummy vertex into the vertex container. The position and error of this
......@@ -19,7 +20,6 @@
*/
/* Forward declarations */
class IBeamCondSvc;
namespace InDet
{
......@@ -32,8 +32,8 @@ namespace InDet
StatusCode execute();
StatusCode finalize();
private:
ServiceHandle<IBeamCondSvc> m_iBeamCondSvc;
std::string m_vxCandidatesOutputName; //!< Name of output container to store results
SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
};
}
#endif
......@@ -7,7 +7,6 @@
-------------------
***************************************************************************/
#include "InDetPriVxFinder/InDetPriVxDummyFinder.h"
#include "InDetBeamSpotService/IBeamCondSvc.h"
#include "VxVertex/VxTrackAtVertex.h"
#include "xAODTracking/Vertex.h"
#include "xAODTracking/TrackParticle.h"
......@@ -22,10 +21,8 @@ namespace InDet
InDetPriVxDummyFinder::InDetPriVxDummyFinder ( const std::string &n, ISvcLocator *pSvcLoc )
: AthAlgorithm ( n, pSvcLoc ),
m_iBeamCondSvc("BeamCondSvc",n),
m_vxCandidatesOutputName ( "VxPrimaryCandidate" )
{
declareProperty ( "BeamPositionSvc", m_iBeamCondSvc);
declareProperty ( "VxCandidatesOutputName",m_vxCandidatesOutputName );
}
......@@ -33,11 +30,7 @@ namespace InDet
StatusCode InDetPriVxDummyFinder::initialize()
{
if ( m_iBeamCondSvc.retrieve().isFailure() )
{
msg(MSG::ERROR) << "Could not find BeamCondSvc." << endmsg;
return StatusCode::FAILURE;
}
ATH_CHECK(m_beamSpotKey.initialize());
return StatusCode::SUCCESS;
}
......@@ -46,11 +39,11 @@ namespace InDet
xAOD::VertexContainer* theVxContainer = new xAOD::VertexContainer();
xAOD::VertexAuxContainer* aux = new xAOD::VertexAuxContainer();
theVxContainer->setStore( aux );
SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
xAOD::Vertex* dummyVertex = new xAOD::Vertex();
theVxContainer->push_back ( dummyVertex ); // have to add vertex to container here first so it can use its aux store - David S.
dummyVertex->setPosition(m_iBeamCondSvc->beamVtx().position());
dummyVertex->setCovariancePosition(m_iBeamCondSvc->beamVtx().covariancePosition());
dummyVertex->setPosition(beamSpotHandle->beamVtx().position());
dummyVertex->setCovariancePosition(beamSpotHandle->beamVtx().covariancePosition());
dummyVertex->setVertexType(xAOD::VxType::NoVtx);
//---- Recording section: write the results to StoreGate ---//
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment