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

Retrieve all PixelRDORawData information (pixel raw hits) More...

#include <PixelRDORetriever.h>

Inheritance diagram for JiveXML::PixelRDORetriever:
Collaboration diagram for JiveXML::PixelRDORetriever:

Public Member Functions

 PixelRDORetriever (const std::string &type, const std::string &name, const IInterface *parent)
 Standard constructor.
virtual StatusCode retrieve (ToolHandle< IFormatTool > &FormatTool)
 Retrieve all the data.
virtual std::string dataTypeName () const
 Return the name of the data type.
virtual StatusCode initialize ()
 Only retrieve geo tool in initialize.
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

const PixelIDm_pixelID {nullptr}
ToolHandle< ISiLorentzAngleToolm_lorentzAngleTool {this, "LorentzAngleTool", "SiLorentzAngleTool/SCTLorentzAngleTool", "Tool to retreive Lorentz angle"}
 A tool handle to the SiLorentzAngleTool.
SG::ReadHandleKey< PixelRDO_Containerm_PixelRDOContainerName {this, "PixelRDOContKey", "PixelRDOs", "Key of PixelRDO_Container for Pixel"}
 The StoreGate key for the PixelRDO container.
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollectionm_pixelDetEleCollKey {this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"}
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 all PixelRDORawData information (pixel raw hits)

  • Properties
    • PixelRDOContainer= 'PixelRDOs' The StoreGate key for the PixelRDO container.
  • Retrieved Data
    • id: the identifier of the hit
    • x,y,z: coordinates of the spacePoint
    • phiModule,etaModule: \(\eta\) and \(\phi\) of module in detector coordinates

Definition at line 34 of file PixelRDORetriever.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

◆ PixelRDORetriever()

JiveXML::PixelRDORetriever::PixelRDORetriever ( 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 22 of file PixelRDORetriever.cxx.

22 :
23 AthAlgTool(type,name,parent)
24 {
25 //Declare the interface
26 declareInterface<IDataRetriever>(this);
27
28 //And properties
29 declareProperty("PixelRDOContainer" , m_PixelRDOContainerName = "PixelRDOs");
30 }
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
SG::ReadHandleKey< PixelRDO_Container > m_PixelRDOContainerName
The StoreGate key for the PixelRDO container.

Member Function Documentation

◆ dataTypeName()

virtual std::string JiveXML::PixelRDORetriever::dataTypeName ( ) const
inlinevirtual

Return the name of the data type.

Implements JiveXML::IDataRetriever.

Definition at line 46 of file PixelRDORetriever.h.

46{ return "PixelRDO"; };

◆ 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 }

◆ 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::PixelRDORetriever::initialize ( )
virtual

Only retrieve geo tool in initialize.

Definition at line 123 of file PixelRDORetriever.cxx.

123 {
124 ATH_CHECK( m_lorentzAngleTool.retrieve() );
125 ATH_CHECK(m_pixelDetEleCollKey.initialize());
127 ATH_CHECK(detStore()->retrieve(m_pixelID, "PixelID"));
128
129 return StatusCode::SUCCESS;
130 }
#define ATH_CHECK
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
A tool handle to the SiLorentzAngleTool.
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.

◆ 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::PixelRDORetriever::retrieve ( ToolHandle< IFormatTool > & FormatTool)
virtual

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

NOTE: This is a temporary fix. Using rdoContainer.key() results in a segfault!

Implements JiveXML::IDataRetriever.

Definition at line 39 of file PixelRDORetriever.cxx.

39 {
40
41 //be verbose
42 ATH_MSG_DEBUG( "Retrieving " << dataTypeName() );
43
44 SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> pixelDetEleHandle(m_pixelDetEleCollKey);
45 const InDetDD::SiDetectorElementCollection* elements(*pixelDetEleHandle);
46 if (not pixelDetEleHandle.isValid() or elements==nullptr) {
47 ATH_MSG_FATAL(m_pixelDetEleCollKey.fullKey() << " is not available.");
48 return StatusCode::FAILURE;
49 }
50
51 //retrieve the PixelRDO container
52 SG::ReadHandle<PixelRDO_Container> rdoContainer(m_PixelRDOContainerName);
53 if (!rdoContainer.isValid()) {
54 ATH_MSG_DEBUG( "Unable to retrieve PixelRDO_Container with name " << m_PixelRDOContainerName.key() );
55 return StatusCode::RECOVERABLE;
56 }
57
58 //Define the data vectors we want to fill
59 DataVect idVec,xVec,yVec,zVec,phiModuleVec,etaModuleVec;
60
61 //Loop over pixel RDO container
62 for (const auto rdoCollection : *rdoContainer) {
63
64 //Loop over raw data objects
65 for (const auto rdoData : *rdoCollection) {
66
67 //Get the pixel identifier
68 const Identifier id = rdoData->identify();
69 const Identifier waferID = m_pixelID->wafer_id(id);
70 IdentifierHash wafer_hash = m_pixelID->wafer_hash(waferID);
71
72 //Get the detector element
73 const InDetDD::SiDetectorElement *element = elements->getDetectorElement(wafer_hash);
74
75 //Make sure we got the detector element
76 if (element == nullptr){
77 ATH_MSG_WARNING( "Unable to obtain detector element for PixelRDO hit with id " << id );
78 continue;
79 }
80
81 //Get the global position from the local position
82 Amg::Vector2D localPos = element->rawLocalPositionOfCell(id);
83 localPos[Trk::distPhi] += m_lorentzAngleTool->getLorentzShift(element->identifyHash(), Gaudi::Hive::currentContext());
84 Amg::Vector3D globalPos = element->globalPosition(localPos);
85
86 //Fill in all the data in our data vectors
87 idVec.push_back(DataType( id.get_compact() ));
88 xVec.push_back(DataType(globalPos.x()*CLHEP::mm/CLHEP::cm));
89 yVec.push_back(DataType(globalPos.y()*CLHEP::mm/CLHEP::cm));
90 zVec.push_back(DataType(globalPos.z()*CLHEP::mm/CLHEP::cm));
91 phiModuleVec.push_back(DataType(m_pixelID->phi_module(waferID)));
92 etaModuleVec.push_back(DataType(m_pixelID->eta_module(waferID)));
93 }
94 }
95
96 //be verbose about the amount of data we retrieved
97 ATH_MSG_DEBUG( "Retrieved " << idVec.size() << " PixelRDO objects" );
98
99 //Create a data map
101 //Add the data vectors to our map
102 dataMap["id"]=idVec;
103 dataMap["x"]=xVec;
104 dataMap["y"]=yVec;
105 dataMap["z"]=zVec;
106 dataMap["phiModule"]=phiModuleVec;
107 dataMap["etaModule"]=etaModuleVec;
108
112 //Forward data to formatting tool
113 if ( FormatTool->AddToEvent(dataTypeName(), "PixelRDOs", &dataMap).isFailure())
114 return StatusCode::RECOVERABLE;
115
116 //Clean up and exit
117 ATH_MSG_DEBUG( dataTypeName() << " retrieved" );
118
119 return StatusCode::SUCCESS;
120 }
#define ATH_MSG_FATAL(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
HepGeom::Point3D< double > globalPosition(const HepGeom::Point3D< double > &localPos) const
transform a reconstruction local position into a global position (inline):
Amg::Vector2D rawLocalPositionOfCell(const SiCellId &cellId) const
Returns position (center) of cell.
virtual std::string dataTypeName() const
Return the name of the data type.
Eigen::Matrix< double, 2, 1 > Vector2D
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
@ distPhi
Definition ParamDefs.h:50

◆ 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_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_lorentzAngleTool

ToolHandle<ISiLorentzAngleTool> JiveXML::PixelRDORetriever::m_lorentzAngleTool {this, "LorentzAngleTool", "SiLorentzAngleTool/SCTLorentzAngleTool", "Tool to retreive Lorentz angle"}
private

A tool handle to the SiLorentzAngleTool.

Definition at line 56 of file PixelRDORetriever.h.

56{this, "LorentzAngleTool", "SiLorentzAngleTool/SCTLorentzAngleTool", "Tool to retreive Lorentz angle"};

◆ m_pixelDetEleCollKey

SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> JiveXML::PixelRDORetriever::m_pixelDetEleCollKey {this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"}
private

Definition at line 61 of file PixelRDORetriever.h.

61{this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"};

◆ m_pixelID

const PixelID* JiveXML::PixelRDORetriever::m_pixelID {nullptr}
private

Definition at line 53 of file PixelRDORetriever.h.

53{nullptr};

◆ m_PixelRDOContainerName

SG::ReadHandleKey<PixelRDO_Container> JiveXML::PixelRDORetriever::m_PixelRDOContainerName {this, "PixelRDOContKey", "PixelRDOs", "Key of PixelRDO_Container for Pixel"}
private

The StoreGate key for the PixelRDO container.

Definition at line 59 of file PixelRDORetriever.h.

59{this, "PixelRDOContKey", "PixelRDOs", "Key of PixelRDO_Container for Pixel"};

◆ 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: