Commit 87631ebf authored by Attila Krasznahorkay's avatar Attila Krasznahorkay Committed by Graeme Stewart
Browse files

Declared an interface library for the header(s) of the package (InDetBeamSpotService-01-00-04-02)

	* Declared an interface library for the header(s) of the package.
	  So that they could be used conveniently in the CMake build.
	* Implemented the logic necessary for the AthSimulationBase build.
	* Tagging as InDetBeamSpotService-01-00-04-02

2016-03-16  John Chapman
	* InDetBeamSpotService/IBeamCondSvc.h, src/BeamCondSvc.cxx,
	src/BeamCondSvc.h, cmt/requirements - Hide dependency on
	Tracking/TrkEvent/VxVertex. ATLASSIM-2399
	* InDetBeamSpotService-01-00-04-01
parent aa5d5261
# $Id: CMakeLists.txt 773822 2016-09-19 10:04:57Z krasznaa $
################################################################################
# Package: InDetBeamSpotService
################################################################################
......@@ -5,36 +6,47 @@
# Declare the package name:
atlas_subdir( InDetBeamSpotService )
# Possible extra dependencies:
set( extra_dep )
set( extra_lib )
if( NOT SIMULATIONBASE )
set( extra_dep Tracking/TrkEvent/VxVertex )
set( extra_lib VxVertex )
endif()
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
DetectorDescription/GeoPrimitives
GaudiKernel
Tracking/TrkEvent/VxVertex
PRIVATE
Control/AthenaBaseComps
Control/StoreGate
Database/AthenaPOOL/AthenaPoolUtilities
Event/EventPrimitives )
atlas_depends_on_subdirs(
PUBLIC
DetectorDescription/GeoPrimitives
GaudiKernel
${extra_dep}
PRIVATE
Control/AthenaBaseComps
Control/StoreGate
Database/AthenaPOOL/AthenaPoolUtilities
Event/EventPrimitives )
# External dependencies:
find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
find_package( Eigen )
find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
find_package( CORAL COMPONENTS CoralBase )
# Component(s) in the package:
atlas_add_library( InDetBeamSpotServiceLib
InDetBeamSpotService/*.h
INTERFACE
PUBLIC_HEADERS InDetBeamSpotService
LINK_LIBRARIES GaudiKernel GeoPrimitives ${extra_lib} )
atlas_add_component( InDetBeamSpotService
src/BeamCondSvc.cxx
src/components/*.cxx
INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
LINK_LIBRARIES ${CORAL_LIBRARIES} ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} GeoPrimitives GaudiKernel VxVertex AthenaBaseComps StoreGateLib SGtests AthenaPoolUtilities EventPrimitives )
src/*.h src/*.cxx src/components/*.cxx
INCLUDE_DIRS ${CORAL_INCLUDE_DIRS}
LINK_LIBRARIES ${CORAL_LIBRARIES} GeoPrimitives GaudiKernel AthenaBaseComps
StoreGateLib AthenaPoolUtilities EventPrimitives InDetBeamSpotServiceLib
${extra_lib} )
atlas_add_dictionary( InDetBeamSpotServiceDict
InDetBeamSpotService/IBeamCondSvc.h
InDetBeamSpotService/selection.xml
INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
LINK_LIBRARIES ${CORAL_LIBRARIES} ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} GeoPrimitives GaudiKernel VxVertex AthenaBaseComps StoreGateLib SGtests AthenaPoolUtilities EventPrimitives )
InDetBeamSpotService/IBeamCondSvc.h
InDetBeamSpotService/selection.xml
LINK_LIBRARIES InDetBeamSpotServiceLib )
# Install files from the package:
atlas_install_headers( InDetBeamSpotService )
atlas_install_joboptions( share/*.py )
......@@ -9,7 +9,9 @@
#include "GaudiKernel/IInterface.h"
#include "GeoPrimitives/GeoPrimitives.h"
#ifndef SIMULATIONBASE
#include "VxVertex/RecVertex.h"
#endif
class IBeamCondSvc : virtual public IInterface {
......@@ -35,7 +37,9 @@ class IBeamCondSvc : virtual public IInterface {
// return the beamspot centroid as a RecVertex, ready for use in fitting
// this takes into account the position, RMS width and tilts
#ifndef SIMULATIONBASE
virtual const Trk::RecVertex& beamVtx() const =0;
#endif
// fill the beamspot record in the TDS for (not to be used)
virtual bool fillRec() const =0;
......
#
# @version $Id: requirements 577526 2014-01-09 12:13:23Z neldik $
# @version $Id: requirements 773822 2016-09-19 10:04:57Z krasznaa $
#
package InDetBeamSpotService
......@@ -11,7 +11,7 @@ public
use AtlasPolicy AtlasPolicy-*
use GaudiInterface GaudiInterface-* External
use GeoPrimitives GeoPrimitives-* DetectorDescription
use VxVertex VxVertex-* Tracking/TrkEvent
use_ifndef pplist="SIMULATIONBASE" pkg="Tracking/TrkEvent/VxVertex"
private
use AtlasCORAL AtlasCORAL-* External
......@@ -32,3 +32,4 @@ private
use AtlasReflex AtlasReflex-* External -no_auto_imports
apply_pattern lcgdict dict=InDetBeamSpotService selectionfile=selection.xml headerfiles="../InDetBeamSpotService/IBeamCondSvc.h"
......@@ -126,8 +126,11 @@ void BeamCondSvc::initCache(int status, float x, float y, float z,
beamerr.fillSymmetric(0,2,tan(tx)*sz*sz);
beamerr.fillSymmetric(1,2,tan(ty)*sz*sz);
beamerr.fillSymmetric(2,2,sz*sz);
#ifndef SIMULATIONBASE
// fill in RecVertex information, ndof and chisq are set to 0 by default
m_vertex=Trk::RecVertex(m_beampos,beamerr);
#endif
}
bool BeamCondSvc::fillRec() const {
......
......@@ -13,9 +13,11 @@
#include "GaudiKernel/ServiceHandle.h"
#include "StoreGate/StoreGate.h"
#ifndef SIMULATIONBASE
namespace Trk {
class RecVertex;
}
#endif
class BeamCondSvc : public virtual IBeamCondSvc, public virtual AthService
{
......@@ -34,8 +36,9 @@ public:
virtual float beamSigmaXY() const;
virtual float beamTilt(int i) const;
virtual int beamStatus() const;
#ifndef SIMULATIONBASE
virtual const Trk::RecVertex& beamVtx() const;
#endif
virtual bool fillRec() const;
virtual StatusCode initialize();
......@@ -67,7 +70,9 @@ private:
int m_status;
Amg::Vector3D m_beampos;
float m_errpar[6];
#ifndef SIMULATIONBASE
Trk::RecVertex m_vertex;
#endif
};
// inline implementations of access functions
......@@ -81,8 +86,8 @@ inline float BeamCondSvc::beamSigmaXY() const { return m_errpar[5]; }
inline float BeamCondSvc::beamTilt(int i) const { return m_errpar[3+i]; }
inline int BeamCondSvc::beamStatus() const { return m_status; }
#ifndef SIMULATIONBASE
inline const Trk::RecVertex& BeamCondSvc::beamVtx() const { return m_vertex; }
#endif
#endif // InDetBeamSpotService_BEAMCOND_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment