ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
Muon::MDT_RawDataProviderToolMT Class Reference

#include <MDT_RawDataProviderToolMT.h>

Inheritance diagram for Muon::MDT_RawDataProviderToolMT:
Collaboration diagram for Muon::MDT_RawDataProviderToolMT:

Public Member Functions

 MDT_RawDataProviderToolMT (const std::string &, const std::string &, const IInterface *)
 
virtual ~MDT_RawDataProviderToolMT ()=default
 default destructor More...
 
virtual StatusCode initialize () override
 standard Athena-Algorithm method More...
 
virtual StatusCode convert (const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vecRobs) const override
 Convert method - declared in Muon::IMuonRdoToPrepDataTool. More...
 
virtual StatusCode convert (const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vecRobs, const std::vector< IdentifierHash > &) const override
 
virtual StatusCode convert () const override
 the new ones More...
 
virtual StatusCode convert (const std::vector< IdentifierHash > &HashVec) const override
 
virtual StatusCode convert (const std::vector< uint32_t > &robIds) const override
 for a particular vector of ROBId's More...
 
virtual StatusCode convert (const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vecRobs, const EventContext &ctx) const override
 EventContext. More...
 
virtual StatusCode convert (const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vecRobs, const std::vector< IdentifierHash > &, const EventContext &ctx) const override
 
virtual StatusCode convert (const EventContext &ctx) const override
 for the entire event More...
 
virtual StatusCode convert (const std::vector< IdentifierHash > &HashVec, const EventContext &ctx) const override
 
virtual StatusCode convert (const std::vector< uint32_t > &robIds, const EventContext &ctx) const override
 for a particular vector of ROBId's More...
 
virtual StatusCode convertIntoContainer (const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vecRobs, MdtCsmContainer &mdtContainer) const
 Convert method. More...
 

Private Attributes

ToolHandle< MdtROD_Decoderm_decoder {this, "Decoder", "MdtROD_Decoder/MdtROD_Decoder"}
 
SG::WriteHandleKey< MdtCsmContainerm_rdoContainerKey
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
unsigned int m_maxhashtoUse = 0U
 
ServiceHandle< IROBDataProviderSvcm_robDataProvider {this, "ROBDataProviderSvc", "ROBDataProviderSvc"}
 
SG::ReadCondHandleKey< MuonMDT_CablingMapm_readKey {this, "ReadKey", "MuonMDT_CablingMap", "Key of MuonMDT_CablingMap"}
 
SG::UpdateHandleKey< MdtCsm_Cachem_rdoContainerCacheKey
 This is the key for the cache for the CSM containers, can be empty. More...
 

Detailed Description

Author
Mark Owen marko.nosp@m.wen@.nosp@m.cern..nosp@m.ch

Definition at line 32 of file MDT_RawDataProviderToolMT.h.

Constructor & Destructor Documentation

◆ MDT_RawDataProviderToolMT()

Muon::MDT_RawDataProviderToolMT::MDT_RawDataProviderToolMT ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 11 of file MDT_RawDataProviderToolMT.cxx.

11  :
12  base_class(t, n, p) {
13  declareInterface<Muon::IMuonRawDataProviderTool>(this);
14 
15 }

◆ ~MDT_RawDataProviderToolMT()

virtual Muon::MDT_RawDataProviderToolMT::~MDT_RawDataProviderToolMT ( )
virtualdefault

default destructor

Member Function Documentation

◆ convert() [1/10]

StatusCode Muon::MDT_RawDataProviderToolMT::convert ( ) const
overridevirtual

the new ones

for the entire event

Definition at line 60 of file MDT_RawDataProviderToolMT.cxx.

61 {
62  return convert(Gaudi::Hive::currentContext());
63 }

◆ convert() [2/10]

StatusCode Muon::MDT_RawDataProviderToolMT::convert ( const EventContext &  ctx) const
overridevirtual

for the entire event

Definition at line 65 of file MDT_RawDataProviderToolMT.cxx.

67 {
69  const MuonMDT_CablingMap* readCdo{*readHandle};
70  if (!readCdo) {
71  ATH_MSG_ERROR("Null pointer to the read conditions object");
72  return StatusCode::FAILURE;
73  }
74  return convert(readCdo->getAllROBId(), ctx);
75 }

◆ convert() [3/10]

StatusCode Muon::MDT_RawDataProviderToolMT::convert ( const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &  vecRobs) const
overridevirtual

Convert method - declared in Muon::IMuonRdoToPrepDataTool.

Definition at line 111 of file MDT_RawDataProviderToolMT.cxx.

111  {
112  return convert(vecRobs, Gaudi::Hive::currentContext());
113 }

◆ convert() [4/10]

StatusCode Muon::MDT_RawDataProviderToolMT::convert ( const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &  vecRobs,
const EventContext &  ctx 
) const
overridevirtual

EventContext.

Definition at line 115 of file MDT_RawDataProviderToolMT.cxx.

116  {
117  ATH_MSG_VERBOSE("convert(): " << vecRobs.size() << " ROBFragments.");
118 
119  SG::WriteHandle<MdtCsmContainer> rdoContainerHandle(m_rdoContainerKey, ctx);
120 
121  MdtCsmContainer* rdoContainer = nullptr;
122 
123  // here we have two paths. The first one we do not use an external cache, so just create
124  // the MDT CSM container and record it. For the second path, we create the container
125  // by passing in the container cache key so that the container is linked with the event
126  // wide cache.
127  const bool externalCacheRDO = !m_rdoContainerCacheKey.key().empty();
128  if (!externalCacheRDO) {
129  // without the cache we just record the container
130  ATH_CHECK(rdoContainerHandle.record(std::make_unique<MdtCsmContainer>(m_maxhashtoUse)));
131  ATH_MSG_DEBUG("Created container");
132  rdoContainer = rdoContainerHandle.ptr();
133  } else {
134  // use the cache to get the container
136  ATH_CHECK(update.isValid());
137  ATH_CHECK(rdoContainerHandle.record(std::make_unique<MdtCsmContainer>(update.ptr())));
138  ATH_MSG_DEBUG("Created container using cache for " << m_rdoContainerCacheKey.key());
139  rdoContainer = rdoContainerHandle.ptr();
140  }
141 
142  // this should never happen, but since we dereference the pointer we should check it first
143  if (!rdoContainer) {
144  ATH_MSG_ERROR("MdtCsmContainer is null, cannot convert MDT raw data");
145  return StatusCode::FAILURE;
146  }
147 
148  // use the convert function in the MDT_RawDataProviderToolCore class
149  ATH_CHECK(convertIntoContainer(vecRobs, *rdoContainer));
150 
151  return StatusCode::SUCCESS;
152 }

◆ convert() [5/10]

StatusCode Muon::MDT_RawDataProviderToolMT::convert ( const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &  vecRobs,
const std::vector< IdentifierHash > &   
) const
overridevirtual

Definition at line 101 of file MDT_RawDataProviderToolMT.cxx.

102  {
103  return convert(vecRobs, Gaudi::Hive::currentContext());
104 }

◆ convert() [6/10]

StatusCode Muon::MDT_RawDataProviderToolMT::convert ( const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &  vecRobs,
const std::vector< IdentifierHash > &  ,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 106 of file MDT_RawDataProviderToolMT.cxx.

107  {
108  return convert(vecRobs, ctx);
109 }

◆ convert() [7/10]

StatusCode Muon::MDT_RawDataProviderToolMT::convert ( const std::vector< IdentifierHash > &  HashVec) const
overridevirtual

Definition at line 77 of file MDT_RawDataProviderToolMT.cxx.

77  {
78  return convert(HashVec, Gaudi::Hive::currentContext());
79 }

◆ convert() [8/10]

StatusCode Muon::MDT_RawDataProviderToolMT::convert ( const std::vector< IdentifierHash > &  HashVec,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 81 of file MDT_RawDataProviderToolMT.cxx.

81  {
83  const MuonMDT_CablingMap* readCdo{*readHandle};
84  if (!readCdo) {
85  ATH_MSG_ERROR("Null pointer to the read conditions object");
86  return StatusCode::FAILURE;
87  }
88  return convert(readCdo->getROBId(HashVec, msgStream()), ctx);
89 }

◆ convert() [9/10]

StatusCode Muon::MDT_RawDataProviderToolMT::convert ( const std::vector< uint32_t > &  robIds) const
overridevirtual

for a particular vector of ROBId's

Definition at line 91 of file MDT_RawDataProviderToolMT.cxx.

91  {
92  return convert(robIds, Gaudi::Hive::currentContext());
93 }

◆ convert() [10/10]

StatusCode Muon::MDT_RawDataProviderToolMT::convert ( const std::vector< uint32_t > &  robIds,
const EventContext &  ctx 
) const
overridevirtual

for a particular vector of ROBId's

Definition at line 95 of file MDT_RawDataProviderToolMT.cxx.

95  {
96  std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> vecOfRobf;
97  m_robDataProvider->getROBData(ctx, robIds, vecOfRobf);
98  return convert(vecOfRobf, ctx); // using the old one
99 }

◆ convertIntoContainer()

StatusCode Muon::MDT_RawDataProviderToolMT::convertIntoContainer ( const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &  vecRobs,
MdtCsmContainer mdtContainer 
) const
virtual

Convert method.

Definition at line 41 of file MDT_RawDataProviderToolMT.cxx.

42  {
43  ATH_MSG_VERBOSE("convert(): " << vecRobs.size() << " ROBFragments.");
44 
45  for (const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment* frag : vecRobs) {
46  // convert only if data payload is delivered
47  if (frag->rod_ndata() != 0) {
48  m_decoder->fillCollections(*frag, mdtContainer).ignore();
49  } else {
50  ATH_MSG_DEBUG(" ROB " << MSG::hex << frag->source_id() << " is delivered with an empty payload" );
51  // store the error condition into the StatusCode and continue
52  }
53  }
54  // in presence of errors return FAILURE
55  ATH_MSG_DEBUG("After processing numColls=" << mdtContainer.numberOfCollections());
56  return StatusCode::SUCCESS;
57 }

◆ initialize()

StatusCode Muon::MDT_RawDataProviderToolMT::initialize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 17 of file MDT_RawDataProviderToolMT.cxx.

17  {
18  ATH_MSG_VERBOSE("Starting init");
19 
20  ATH_MSG_VERBOSE("Getting m_robDataProvider");
21 
22  // Get ROBDataProviderSvc
23  ATH_CHECK(m_robDataProvider.retrieve());
24  ATH_CHECK(m_idHelperSvc.retrieve());
25 
26  ATH_MSG_VERBOSE("Getting m_decoder");
27 
28  // Retrieve decoder
29  ATH_CHECK(m_decoder.retrieve());
30  m_maxhashtoUse = m_idHelperSvc->mdtIdHelper().stationNameIndex("BME") != -1 ? m_idHelperSvc->mdtIdHelper().detectorElement_hash_max()
31  : m_idHelperSvc->mdtIdHelper().module_hash_max();
32 
35  ATH_CHECK(m_rdoContainerCacheKey.initialize(!m_rdoContainerCacheKey.key().empty()));
36 
37  ATH_MSG_DEBUG("initialize() successful in " << name());
38  return StatusCode::SUCCESS;
39 }

Member Data Documentation

◆ m_decoder

ToolHandle<MdtROD_Decoder> Muon::MDT_RawDataProviderToolMT::m_decoder {this, "Decoder", "MdtROD_Decoder/MdtROD_Decoder"}
private

Definition at line 66 of file MDT_RawDataProviderToolMT.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> Muon::MDT_RawDataProviderToolMT::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 70 of file MDT_RawDataProviderToolMT.h.

◆ m_maxhashtoUse

unsigned int Muon::MDT_RawDataProviderToolMT::m_maxhashtoUse = 0U
private

Definition at line 72 of file MDT_RawDataProviderToolMT.h.

◆ m_rdoContainerCacheKey

SG::UpdateHandleKey<MdtCsm_Cache> Muon::MDT_RawDataProviderToolMT::m_rdoContainerCacheKey
private
Initial value:
{this, "CsmContainerCacheKey", "",
"Optional external cache for the CSM container"
}

This is the key for the cache for the CSM containers, can be empty.

Definition at line 79 of file MDT_RawDataProviderToolMT.h.

◆ m_rdoContainerKey

SG::WriteHandleKey<MdtCsmContainer> Muon::MDT_RawDataProviderToolMT::m_rdoContainerKey
private
Initial value:
{this, "RdoLocation", "MDTCSM",
"Name of the MDTCSM produced by RawDataProvider"}

Definition at line 67 of file MDT_RawDataProviderToolMT.h.

◆ m_readKey

SG::ReadCondHandleKey<MuonMDT_CablingMap> Muon::MDT_RawDataProviderToolMT::m_readKey {this, "ReadKey", "MuonMDT_CablingMap", "Key of MuonMDT_CablingMap"}
private

Definition at line 77 of file MDT_RawDataProviderToolMT.h.

◆ m_robDataProvider

ServiceHandle<IROBDataProviderSvc> Muon::MDT_RawDataProviderToolMT::m_robDataProvider {this, "ROBDataProviderSvc", "ROBDataProviderSvc"}
private

Definition at line 75 of file MDT_RawDataProviderToolMT.h.


The documentation for this class was generated from the following files:
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
Muon::MDT_RawDataProviderToolMT::m_decoder
ToolHandle< MdtROD_Decoder > m_decoder
Definition: MDT_RawDataProviderToolMT.h:66
Muon::MDT_RawDataProviderToolMT::convert
virtual StatusCode convert() const override
the new ones
Definition: MDT_RawDataProviderToolMT.cxx:60
Muon::MDT_RawDataProviderToolMT::convertIntoContainer
virtual StatusCode convertIntoContainer(const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vecRobs, MdtCsmContainer &mdtContainer) const
Convert method.
Definition: MDT_RawDataProviderToolMT.cxx:41
MdtCsmContainer
This container provides acces to the MDT RDOs.
Definition: MdtCsmContainer.h:22
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Muon::MDT_RawDataProviderToolMT::m_rdoContainerKey
SG::WriteHandleKey< MdtCsmContainer > m_rdoContainerKey
Definition: MDT_RawDataProviderToolMT.h:67
MuonMDT_CablingMap
Definition: MuonMDT_CablingMap.h:28
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
IdentifiableContainerMT::numberOfCollections
virtual size_t numberOfCollections() const override final
return number of collections
Definition: IdentifiableContainerMT.h:213
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
eformat::ROBFragment
Definition: L1CaloBsDecoderUtil.h:12
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Muon::MDT_RawDataProviderToolMT::m_readKey
SG::ReadCondHandleKey< MuonMDT_CablingMap > m_readKey
Definition: MDT_RawDataProviderToolMT.h:77
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
Muon::MDT_RawDataProviderToolMT::m_maxhashtoUse
unsigned int m_maxhashtoUse
Definition: MDT_RawDataProviderToolMT.h:72
Muon::MDT_RawDataProviderToolMT::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MDT_RawDataProviderToolMT.h:70
Muon::MDT_RawDataProviderToolMT::m_rdoContainerCacheKey
SG::UpdateHandleKey< MdtCsm_Cache > m_rdoContainerCacheKey
This is the key for the cache for the CSM containers, can be empty.
Definition: MDT_RawDataProviderToolMT.h:79
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SG::UpdateHandle
Definition: UpdateHandle.h:94
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
WriteBchToCool.update
update
Definition: WriteBchToCool.py:67
Muon::MDT_RawDataProviderToolMT::m_robDataProvider
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
Definition: MDT_RawDataProviderToolMT.h:75