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

#include <TrigSiSpacePointRetriever.h>

Inheritance diagram for JiveXML::TrigSiSpacePointRetriever:
Collaboration diagram for JiveXML::TrigSiSpacePointRetriever:

Public Member Functions

 TrigSiSpacePointRetriever (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 ()
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

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

Private Attributes

const std::string m_typeName
 The data type that is generated by this retriever.
const PixelIDm_pixelHelper
const SCT_IDm_sctHelper
std::string m_pixelSpContainerName
std::string m_SCT_SpContainerName
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

Definition at line 21 of file TrigSiSpacePointRetriever.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

◆ TrigSiSpacePointRetriever()

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

Standard Constructor.

Definition at line 20 of file TrigSiSpacePointRetriever.cxx.

20 :
21 AthAlgTool(type, name, parent),
22 m_typeName("TrigS3D"),
23 m_pixelHelper(nullptr),
24 m_sctHelper(nullptr),
25 m_pixelSpContainerName ("TrigPixelSpacePoints"),
26 m_SCT_SpContainerName ("TrigSCT_SpacePoints")
27 {
28
29 declareInterface<IDataRetriever>(this);
30
31 declareProperty("PixelSpacePoints", m_pixelSpContainerName);
32 declareProperty("SCTSpacePoints" , m_SCT_SpContainerName);
33 }
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const std::string m_typeName
The data type that is generated by this retriever.

Member Function Documentation

◆ calcPixelLayer()

int JiveXML::TrigSiSpacePointRetriever::calcPixelLayer ( const Identifier & id)
private

Definition at line 125 of file TrigSiSpacePointRetriever.cxx.

126 {
127 int layer = m_pixelHelper->layer_disk( id );
128 if ( m_pixelHelper->barrel_ec( id ) ) layer += 3;
129 // Endcap Pixels 3,4,5
130 return layer;
131 }
@ layer
Definition HitInfo.h:79

◆ calcSCTLayer()

int JiveXML::TrigSiSpacePointRetriever::calcSCTLayer ( const Identifier & id)
private

Definition at line 135 of file TrigSiSpacePointRetriever.cxx.

136 {
137 int layer = m_sctHelper->layer_disk( id );
138 if ( m_sctHelper->barrel_ec( id ) ) layer += 11;
139 // Endcap SCT 11,12,13,14,15,16,17,18,19
140 else layer += 7;
141 // Barrel SCT 7,8,9,10
142 return layer;
143 }

◆ dataTypeName()

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

Return the name of the data type.

Implements JiveXML::IDataRetriever.

Definition at line 32 of file TrigSiSpacePointRetriever.h.

32{ return m_typeName; };

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

Definition at line 107 of file TrigSiSpacePointRetriever.cxx.

107 {
108
109//migration: https://twiki.cern.ch/twiki/bin/view/Atlas/InDetPkgFixing
110 if ( detStore()->retrieve(m_pixelHelper, "PixelID").isFailure() ){
111 if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "Could not get Pixel ID helper" << endmsg;
112 return StatusCode::RECOVERABLE;
113 }
114
115 if ( detStore()->retrieve(m_sctHelper, "SCT_ID").isFailure() ){
116 if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "Could not get SCT ID helper" << endmsg;
117 return StatusCode::RECOVERABLE;
118 }
119
120 return StatusCode::SUCCESS;
121 }
#define endmsg
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
MsgStream & msg() const
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::TrigSiSpacePointRetriever::retrieve ( ToolHandle< IFormatTool > & FormatTool)
virtual

Retrieve all the data.

Implements JiveXML::IDataRetriever.

Definition at line 37 of file TrigSiSpacePointRetriever.cxx.

37 {
38
39 const TrigSiSpacePointContainer* pCont;
40
41 DataVect x;
42 DataVect y;
43 DataVect z;
45 DataVect clustersVec;
46 std::string clustersStr = "clusters multiple=\"2\"";
47
48 if ( evtStore()->retrieve(pCont,m_pixelSpContainerName).isFailure() ) {
49 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Trig SP Pixel container not found at "
51// return StatusCode::SUCCESS; // not exit here (as in original code)
52 }else{
53 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " Retrieving TrigSPPixel with size "
54 << pCont->size() << " from " << m_pixelSpContainerName << endmsg;
55
56 int maxHash = m_pixelHelper->wafer_hash_max();
57 for(int id=0;id<maxHash;++id){
58 auto spCollIt=pCont->indexFindPtr(id);
59 if(spCollIt==nullptr) continue;
60 for(TrigSiSpacePointCollection::const_iterator spIt=spCollIt->begin(); spIt!=spCollIt->end();++spIt){
61 x.push_back(DataType((*spIt)->x() /10.));
62 y.push_back(DataType((*spIt)->y() /10.));
63 z.push_back(DataType((*spIt)->z() /10.));
64 layer.push_back( DataType( calcPixelLayer( (*spIt)->identify() ) ) );
65 clustersVec.push_back(DataType(((*spIt)->clusters()).first->identify().get_compact()));
66 clustersVec.push_back(DataType(-1));
67 }
68 }
69 }
70 if ( evtStore()->retrieve(pCont,m_SCT_SpContainerName).isFailure() ) {
71 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Trig SP Pixel container not found at "
73// return StatusCode::SUCCESS; // not exit here (as in original code)
74 }else{
75 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " Retrieving TrigSPPixel with size "
76 << pCont->size() << " from " << m_SCT_SpContainerName << endmsg;
77
78 int maxHash = m_sctHelper->wafer_hash_max();
79 for(int id=0;id<maxHash;++id){
80 auto spCollIt=pCont->indexFindPtr(id);
81 if(spCollIt==nullptr) continue;
82 for(TrigSiSpacePointCollection::const_iterator spIt=spCollIt->begin(); spIt!=spCollIt->end();++spIt){
83 x.push_back(DataType((*spIt)->x() /10.));
84 y.push_back(DataType((*spIt)->y() /10.));
85 z.push_back(DataType((*spIt)->z() /10.));
86 layer.push_back( DataType( calcSCTLayer( (*spIt)->identify() ) ) );
87 clustersVec.push_back(DataType(((*spIt)->clusters()).first->identify().get_compact()));
88 clustersVec.push_back(DataType(((*spIt)->clusters()).second->identify().get_compact()));
89 }
90 }
91 }
92 DataMap myDataMap;
93 myDataMap["x"] = x;
94 myDataMap["y"] = y;
95 myDataMap["z"] = z;
96 myDataMap["layer"] = layer;
97 myDataMap[clustersStr] = clustersVec;
98
99 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << dataTypeName() << ": "<< x.size() << endmsg;
100
101 //forward data to formating tool
102 std::string emptyStr="";
103 return FormatTool->AddToEvent(dataTypeName(), emptyStr, &myDataMap);
104 }
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
Trk::PrepRawDataContainer< TrigSiSpacePointCollection > TrigSiSpacePointContainer
#define y
#define x
#define z
ServiceHandle< StoreGateSvc > & evtStore()
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
virtual const T * indexFindPtr(IdentifierHash hashId) const override final
return pointer on the found entry or null if out of range using hashed index - fast version,...
size_t size() const
Duplicate of fullSize for backwards compatability.
virtual std::string dataTypeName() const
Return the name of the data type.
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

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

const PixelID* JiveXML::TrigSiSpacePointRetriever::m_pixelHelper
private

Definition at line 44 of file TrigSiSpacePointRetriever.h.

◆ m_pixelSpContainerName

std::string JiveXML::TrigSiSpacePointRetriever::m_pixelSpContainerName
private

Definition at line 47 of file TrigSiSpacePointRetriever.h.

◆ m_SCT_SpContainerName

std::string JiveXML::TrigSiSpacePointRetriever::m_SCT_SpContainerName
private

Definition at line 48 of file TrigSiSpacePointRetriever.h.

◆ m_sctHelper

const SCT_ID* JiveXML::TrigSiSpacePointRetriever::m_sctHelper
private

Definition at line 45 of file TrigSiSpacePointRetriever.h.

◆ m_typeName

const std::string JiveXML::TrigSiSpacePointRetriever::m_typeName
private

The data type that is generated by this retriever.

Definition at line 39 of file TrigSiSpacePointRetriever.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: