ATLAS Offline Software
Loading...
Searching...
No Matches
JiveXML::BeamSpotRetriever Class Reference

Retrieve the BeamSpot information (official ID s/w result) More...

#include <BeamSpotRetriever.h>

Inheritance diagram for JiveXML::BeamSpotRetriever:
Collaboration diagram for JiveXML::BeamSpotRetriever:

Public Member Functions

virtual StatusCode initialize () override
 BeamSpotRetriever (const std::string &type, const std::string &name, const IInterface *parent)
 Standard constructor.
virtual StatusCode retrieve (ToolHandle< IFormatTool > &FormatTool) override
 Retrieve all the data.
virtual std::string dataTypeName () const override
 Return the name of the data type.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Return the interface identifier.

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadCondHandleKey< InDet::BeamSpotDatam_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Retrieve the BeamSpot information (official ID s/w result)

Definition at line 23 of file BeamSpotRetriever.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ BeamSpotRetriever()

JiveXML::BeamSpotRetriever::BeamSpotRetriever ( const std::string & type,
const std::string & name,
const IInterface * parent )

Standard constructor.

Standard AthAlgTool constructor.

Parameters
typeAlgTool type name
nameAlgTool instance name
parentAlgTools parent owning this tool

Definition at line 17 of file BeamSpotRetriever.cxx.

17 :
18 AthAlgTool(type,name,parent) {
19
20 //Declare the interface
21 declareInterface<IDataRetriever>(this);
22 }
AthAlgTool()
Default constructor:

Member Function Documentation

◆ dataTypeName()

virtual std::string JiveXML::BeamSpotRetriever::dataTypeName ( ) const
inlineoverridevirtual

Return the name of the data type.

Implements JiveXML::IDataRetriever.

Definition at line 37 of file BeamSpotRetriever.h.

37{ return "BeamSpot"; };

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ initialize()

StatusCode JiveXML::BeamSpotRetriever::initialize ( )
overridevirtual

Definition at line 24 of file BeamSpotRetriever.cxx.

24 {
25 ATH_CHECK(m_beamSpotKey.initialize());
26 return StatusCode::SUCCESS;
27 }
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & JiveXML::IDataRetriever::interfaceID ( )
inlinestaticinherited

Return the interface identifier.

Definition at line 40 of file IDataRetriever.h.

40{ return IID_IDataRetriever; }
static const InterfaceID IID_IDataRetriever("JiveXML::IDataRetriever", 3, 0)

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ retrieve()

StatusCode JiveXML::BeamSpotRetriever::retrieve ( ToolHandle< IFormatTool > & FormatTool)
overridevirtual

Retrieve all the data.

Implementation of DataRetriever interface.

  • for each pixel raw data object obtain the identifier
  • find the corresponding detector element and get its coordinates
  • fill in all information in the data map
    Parameters
    FormatToolthe tool that will create formated output from the DataMap

from: https://twiki.cern.ch/twiki/bin/view/Atlas/InDetBeamSpotFAQ#How_can_I_retrieve_the_beam_spot

Implements JiveXML::IDataRetriever.

Definition at line 36 of file BeamSpotRetriever.cxx.

36 {
37
38 //be verbose
39 ATH_MSG_DEBUG( "Retrieving " << dataTypeName() );
40
41 DataVect x; x.reserve( 1 );
42 DataVect y; y.reserve( 1 );
43 DataVect z; z.reserve( 1 );
44 DataVect sigmaX; sigmaX.reserve( 1 );
45 DataVect sigmaXY; sigmaXY.reserve( 1 );
46 DataVect sigmaY; sigmaY.reserve( 1 );
47 DataVect sigmaZ; sigmaZ.reserve( 1 );
48 DataVect tiltX; tiltX.reserve( 1 );
49 DataVect tiltY; tiltY.reserve( 1 );
50 DataVect label; label.reserve( 1 );
51 DataVect status; status.reserve( 1 );
52
54 SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey };
55// add the following into the initialize routine.
56 if ( !beamSpotHandle.isValid() ) {
57 ATH_MSG_ERROR( "Failed to retrieve beamspot " );
58 return StatusCode::RECOVERABLE;
59 } else {
60
61// references:
62// https://twiki.cern.ch/twiki/bin/view/Atlas/InDetBeamSpotFAQ#How_can_I_retrieve_the_beam_spot
63// InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/trunk/#path_InnerDetector_InDetCalibAlgs_InDetBeamSpotFinder_trunk_
64//
65// https://twiki.cern.ch/twiki/bin/view/Atlas/CoolBeamSpotParameters#Beam_Spot_Parametrization
66//
67// status Status word - see bit definition below
68// posX x position of beam spot center (mm)
69// posY y position of beam spot center (mm)
70// posZ z position of beam spot center (mm)
71// sigmaX Width of beam spot in x (mm)
72// sigmaY Width of beam spot in x (mm)
73// sigmaXY rhoXY*sigmaX*sigmaY (mm^2) (describes rotation of non-circular beam spot in transverse plane)
74// sigmaZ Width of beam spot in z (mm)
75// tiltX Tilt angle in x-z plane (rad)
76// tiltY Tilt angle in y-z plane (rad)
77
78
79
80 label.push_back( "Beamspot_position_at_PV_z_position" );
81
82 Trk::RecVertex beamposition(beamSpotHandle->beamVtx());
83 Amg::Vector3D posBS(beamposition.position());
84
85 x.push_back( posBS.x() );
86 y.push_back( posBS.y() );
87 z.push_back( posBS.z() );
88
89 sigmaX.push_back( beamSpotHandle->beamSigma(0) );
90 sigmaY.push_back( beamSpotHandle->beamSigma(1) );
91 sigmaZ.push_back( beamSpotHandle->beamSigma(2) );
92 sigmaXY.push_back( beamSpotHandle->beamSigmaXY() );
93
94 tiltX.push_back( beamSpotHandle->beamTilt(0) );
95 tiltY.push_back( beamSpotHandle->beamTilt(1) );
96
97 status.push_back( beamSpotHandle->beamStatus() );
98
99 ATH_MSG_DEBUG( "BeamSpot Position: "
100 << beamSpotHandle->beamPos() );
101 ATH_MSG_DEBUG( "BeamSpot Sigma "
102 << beamSpotHandle->beamSigma(0) << ", "
103 << beamSpotHandle->beamSigma(1) << ", "
104 << beamSpotHandle->beamSigma(2) );
105 ATH_MSG_DEBUG( "BeamSpot Tilt: "
106 << beamSpotHandle->beamTilt(0) << ", "
107 << beamSpotHandle->beamTilt(1) );
108 ATH_MSG_DEBUG( "Beamspot position at PV z-position" );
109
110 //be verbose about the amount of data we retrieved
111 ATH_MSG_DEBUG( "Retrieved " << label.size() << "Beamspot" );
112
113 //Create a data map
115 //Add the data vectors to our map
116 dataMap["x"]=std::move(x);
117 dataMap["y"]=std::move(y);
118 dataMap["z"]=std::move(z);
119 dataMap["sigmaX"]=std::move(sigmaX);
120 dataMap["sigmaY"]=std::move(sigmaY);
121 dataMap["sigmaXY"]=std::move(sigmaXY);
122 dataMap["sigmaZ"]=std::move(sigmaZ);
123 dataMap["tiltX"]=std::move(tiltX);
124 dataMap["tiltY"]=std::move(tiltY);
125 dataMap["label"]=std::move(label);
126 dataMap["status"]=std::move(status);
127
128 //Forward data to formatting tool
129 if ( FormatTool->AddToEvent(dataTypeName(), "BeamSpot", &dataMap).isFailure())
130 return StatusCode::RECOVERABLE;
131
132 //Clean up and exit
133 ATH_MSG_DEBUG( dataTypeName() << " retrieved" );
134
135 return StatusCode::SUCCESS;
136 }
137 }
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
#define y
#define x
#define z
virtual std::string dataTypeName() const override
Return the name of the data type.
std::string label(const std::string &format, int i)
Definition label.h:19
Eigen::Matrix< double, 3, 1 > Vector3D
std::map< std::string, DataVect > DataMap
Definition DataType.h:59
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
Definition DataType.h:58
status
Definition merge.py:16

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_beamSpotKey

SG::ReadCondHandleKey<InDet::BeamSpotData> JiveXML::BeamSpotRetriever::m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }
private

Definition at line 41 of file BeamSpotRetriever.h.

41{ this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: