ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
MuonCalibStreamAddressProviderSvc Class Reference

#include <MuonCalibStreamAddressProviderSvc.h>

Inheritance diagram for MuonCalibStreamAddressProviderSvc:
Collaboration diagram for MuonCalibStreamAddressProviderSvc:

Public Member Functions

 MuonCalibStreamAddressProviderSvc (const std::string &name, ISvcLocator *svcloc)
 Standard constructor. More...
 
virtual ~MuonCalibStreamAddressProviderSvc ()
 Standard Destructor. More...
 
virtual StatusCode initialize ()
 Initialize the service. More...
 
virtual StatusCode preLoadAddresses (StoreID::type id, tadList &tlist)
 
virtual StatusCode updateAddress (StoreID::type tp, SG::TransientAddress *tad, const EventContext &)
 update an existing transient Address More...
 

Private Attributes

std::vector< std::string > m_typeNames
 
ServiceHandle< IMuonCalibStreamDataProviderSvcm_dataSvc
 
std::map< CLID, std::set< std::string > > m_clidKey
 

Detailed Description

Definition at line 12 of file MuonCalibStreamAddressProviderSvc.h.

Constructor & Destructor Documentation

◆ MuonCalibStreamAddressProviderSvc()

MuonCalibStreamAddressProviderSvc::MuonCalibStreamAddressProviderSvc ( const std::string &  name,
ISvcLocator *  svcloc 
)

Standard constructor.

Definition at line 12 of file MuonCalibStreamAddressProviderSvc.cxx.

12  :
13  base_class(name, svc),
14  m_dataSvc("MuonCalibStreamDataProviderSvc", name) {
15  m_typeNames.push_back("Muon::MdtPrepDataContainer/MDT_DriftCircles");
16  m_typeNames.push_back("RpcPadContainer/RPCPAD");
17  m_typeNames.push_back("TgcRdoContainer/TGCRDO");
18  //m_typeNames.push_back("CscRawDataContainer/CSCRDO");
19  m_typeNames.push_back("xAOD::EventInfo");
20  declareProperty("TypeNames", m_typeNames);
21 }

◆ ~MuonCalibStreamAddressProviderSvc()

MuonCalibStreamAddressProviderSvc::~MuonCalibStreamAddressProviderSvc ( )
virtual

Standard Destructor.

Definition at line 24 of file MuonCalibStreamAddressProviderSvc.cxx.

24 {}

Member Function Documentation

◆ initialize()

StatusCode MuonCalibStreamAddressProviderSvc::initialize ( )
virtual

Initialize the service.

Definition at line 27 of file MuonCalibStreamAddressProviderSvc.cxx.

27  {
28  ATH_CHECK(m_dataSvc.retrieve());
29  ATH_MSG_INFO(" initialized ");
30  return StatusCode::SUCCESS;
31 }

◆ preLoadAddresses()

StatusCode MuonCalibStreamAddressProviderSvc::preLoadAddresses ( StoreID::type  id,
tadList &  tlist 
)
virtual

Definition at line 33 of file MuonCalibStreamAddressProviderSvc.cxx.

33  {
34  ATH_MSG_DEBUG(" call MuonCalibStreamAddressProviderSvc::preLoadAddresses");
35 
36  if (idp != StoreID::EVENT_STORE) {
37  ATH_MSG_DEBUG("idp = " << idp << " != StoreID::EVENT_STORE; not creating TADs");
38  return StatusCode::SUCCESS;
39  } else {
40  ATH_MSG_DEBUG("idp = " << idp << " == StoreID::EVENT_STORE; Creating TADs for muon detectors!");
41  }
42 
43  // only deal with event store.
44  std::vector<std::string>::const_iterator it = m_typeNames.begin();
45  std::vector<std::string>::const_iterator it_e = m_typeNames.end();
46 
47  SmartIF<IClassIDSvc> clidSvc{service("ClassIDSvc")};
48  ATH_CHECK(clidSvc.isValid());
49 
50  for (; it != it_e; ++it) {
51  Gaudi::Utils::TypeNameString item(*it);
52  std::string t = item.type();
53  std::string nm = item.name();
54 
55  CLID id;
56  ATH_CHECK(clidSvc->getIDOfTypeName(t, id));
57 
59  tlist.push_back(tad);
60  ATH_MSG_DEBUG(" created TAD for (type,clid,name,TAD)" << t << " " << id << " " << nm);
61 
62  // save the clid and key.
63  m_clidKey[id].insert(nm);
64  }
65  return StatusCode::SUCCESS;
66 } // MuonCalibStreamAddressProviderSvc::preLoadAddresses()

◆ updateAddress()

StatusCode MuonCalibStreamAddressProviderSvc::updateAddress ( StoreID::type  tp,
SG::TransientAddress tad,
const EventContext &   
)
virtual

update an existing transient Address

Definition at line 69 of file MuonCalibStreamAddressProviderSvc.cxx.

69  {
70  CLID clid = tad->clID();
71  std::string nm = tad->name();
72  std::map<CLID, std::set<std::string> >::const_iterator it = m_clidKey.find(clid);
73 
74  if (it == m_clidKey.end()) return StatusCode::FAILURE;
75 
76  if ((*it).second.count(nm) == 0) return StatusCode::FAILURE;
77 
78  ATH_MSG_DEBUG(" creating address for " << clid << " " << nm);
79 
81  tad->setAddress(add);
82  return StatusCode::SUCCESS;
83 }

Member Data Documentation

◆ m_clidKey

std::map<CLID, std::set<std::string> > MuonCalibStreamAddressProviderSvc::m_clidKey
private

Definition at line 32 of file MuonCalibStreamAddressProviderSvc.h.

◆ m_dataSvc

ServiceHandle<IMuonCalibStreamDataProviderSvc> MuonCalibStreamAddressProviderSvc::m_dataSvc
private

Definition at line 31 of file MuonCalibStreamAddressProviderSvc.h.

◆ m_typeNames

std::vector<std::string> MuonCalibStreamAddressProviderSvc::m_typeNames
private

Definition at line 30 of file MuonCalibStreamAddressProviderSvc.h.


The documentation for this class was generated from the following files:
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
query_example.tlist
tlist
Definition: query_example.py:25
skel.it
it
Definition: skel.GENtoEVGEN.py:396
SG::TransientAddress
Definition: TransientAddress.h:32
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::TransientAddress::name
const std::string & name() const
Get the primary (hashed) SG key.
Definition: TransientAddress.h:208
PyPoolBrowser.item
item
Definition: PyPoolBrowser.py:129
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
SG::TransientAddress::clID
CLID clID() const
Retrieve string key:
Definition: TransientAddress.h:201
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
add
bool add(const std::string &hname, TKey *tobj)
Definition: fastadd.cxx:55
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
MuonCalibStreamAddressProviderSvc::m_dataSvc
ServiceHandle< IMuonCalibStreamDataProviderSvc > m_dataSvc
Definition: MuonCalibStreamAddressProviderSvc.h:31
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
item
Definition: ItemListSvc.h:43
SG::TransientAddress::setAddress
void setAddress(IOpaqueAddress *pAddress)
Retrieve primary clid.
Definition: TransientAddress.cxx:172
MuonCalibStreamAddressProviderSvc::m_clidKey
std::map< CLID, std::set< std::string > > m_clidKey
Definition: MuonCalibStreamAddressProviderSvc.h:32
CalibCoolCompareRT.nm
nm
Definition: CalibCoolCompareRT.py:110
StoreID::EVENT_STORE
@ EVENT_STORE
Definition: StoreID.h:26
MuonCalibStreamAddress
Definition: MuonCalibStreamAddress.h:14
MuonCalibStreamAddressProviderSvc::m_typeNames
std::vector< std::string > m_typeNames
Definition: MuonCalibStreamAddressProviderSvc.h:30