Skip to content
Snippets Groups Projects
Commit f13c2dc7 authored by Edward Moyse's avatar Edward Moyse
Browse files

Merge branch 'bsreader' into 'master'

InDetBeamSpotReader: Create component and make vertex optional

See merge request atlas/athena!27216
parents 712e715a 20c4c729
No related branches found
No related tags found
No related merge requests found
...@@ -16,7 +16,7 @@ StatusCode InDet::InDetBeamSpotReader::initialize() { ...@@ -16,7 +16,7 @@ StatusCode InDet::InDetBeamSpotReader::initialize() {
ATH_CHECK( m_beamSpotKey.initialize() ); ATH_CHECK( m_beamSpotKey.initialize() );
ATH_CHECK( m_eventInfo.initialize() ); ATH_CHECK( m_eventInfo.initialize() );
ATH_CHECK( m_vxContainer.initialize() ); ATH_CHECK( m_vxContainer.initialize(!m_vxContainer.empty()) );
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
...@@ -37,24 +37,26 @@ StatusCode InDet::InDetBeamSpotReader::execute(const EventContext& ctx) const { ...@@ -37,24 +37,26 @@ StatusCode InDet::InDetBeamSpotReader::execute(const EventContext& ctx) const {
ATH_MSG_INFO("BeamSpot Tilt\n\t" ATH_MSG_INFO("BeamSpot Tilt\n\t"
<< beamSpotHandle->beamTilt(0) << "\n\t" << beamSpotHandle->beamTilt(0) << "\n\t"
<< beamSpotHandle->beamTilt(1) << "\n\t"); << beamSpotHandle->beamTilt(1) << "\n\t");
ATH_MSG_INFO("Beamspot position at PV z-position");
//get list of PVs //get list of PVs
SG::ReadHandle<VxContainer> importedVxContainer(m_vxContainer, ctx); if (!m_vxContainer.empty()) {
VxContainer::const_iterator vtxItr; ATH_MSG_INFO("Beamspot position at PV z-position");
for(vtxItr=importedVxContainer->begin(); SG::ReadHandle<VxContainer> importedVxContainer(m_vxContainer, ctx);
vtxItr!=importedVxContainer->end(); ++vtxItr) { VxContainer::const_iterator vtxItr;
if (static_cast<int>((*vtxItr)->vxTrackAtVertex()->size())==0) continue; for(vtxItr=importedVxContainer->begin();
if (msgLvl(MSG::INFO)) ATH_MSG_INFO("PV position: " vtxItr!=importedVxContainer->end(); ++vtxItr) {
<< (*vtxItr)->recVertex().position() ); if (static_cast<int>((*vtxItr)->vxTrackAtVertex()->size())==0) continue;
double z = (*vtxItr)->recVertex().position().z(); if (msgLvl(MSG::INFO)) ATH_MSG_INFO("PV position: "
if (msgLvl(MSG::INFO)) ATH_MSG_INFO("\n\t" << (*vtxItr)->recVertex().position() );
<< beamSpotHandle->beamPos()(0) double z = (*vtxItr)->recVertex().position().z();
+ (z - beamSpotHandle->beamPos()(2)) if (msgLvl(MSG::INFO)) ATH_MSG_INFO("\n\t"
*beamSpotHandle->beamTilt(0) << "\n\t" << beamSpotHandle->beamPos()(0)
<< beamSpotHandle->beamPos()(1) + (z - beamSpotHandle->beamPos()(2))
+ (z - beamSpotHandle->beamPos()(2)) *beamSpotHandle->beamTilt(0) << "\n\t"
*beamSpotHandle->beamTilt(1) ); << beamSpotHandle->beamPos()(1)
+ (z - beamSpotHandle->beamPos()(2))
*beamSpotHandle->beamTilt(1) );
}
} }
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
......
#include "../InDetBeamSpotFinder.h" #include "../InDetBeamSpotFinder.h"
#include "../InDetBeamSpotRooFit.h" #include "../InDetBeamSpotRooFit.h"
#include "../InDetBeamSpotReader.h"
#include "../InDetBeamSpotVertex.h" #include "../InDetBeamSpotVertex.h"
#include "../RefitTracksAndVertex.h" #include "../RefitTracksAndVertex.h"
DECLARE_COMPONENT( InDet::InDetBeamSpotFinder ) DECLARE_COMPONENT( InDet::InDetBeamSpotFinder )
DECLARE_COMPONENT( InDet::InDetBeamSpotVertex ) DECLARE_COMPONENT( InDet::InDetBeamSpotVertex )
DECLARE_COMPONENT( InDet::InDetBeamSpotRooFit ) DECLARE_COMPONENT( InDet::InDetBeamSpotRooFit )
DECLARE_COMPONENT( InDet::InDetBeamSpotReader )
DECLARE_COMPONENT( RefitTracksAndVertex ) DECLARE_COMPONENT( RefitTracksAndVertex )
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