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

#include <CSC_RawDataProviderToolMT.h>

Inheritance diagram for Muon::CSC_RawDataProviderToolMT:
Collaboration diagram for Muon::CSC_RawDataProviderToolMT:

Public Member Functions

 CSC_RawDataProviderToolMT (const std::string &t, const std::string &n, const IInterface *p)
 
virtual ~CSC_RawDataProviderToolMT ()
 default destructor More...
 
virtual StatusCode initialize () override
 standard Athena-Algorithm method More...
 
virtual StatusCode convert (const ROBFragmentList &vecRobs, const std::vector< IdentifierHash > &) const override
 
virtual StatusCode convert (const ROBFragmentList &vecRobs) const override
 
virtual StatusCode convert (const std::vector< IdentifierHash > &collections) const override
 
virtual StatusCode convert () const override
 
virtual StatusCode convert (const std::vector< uint32_t > &) const override
 
virtual StatusCode convert (const ROBFragmentList &vecRobs, const EventContext &ctx) const override
 
virtual StatusCode convert (const EventContext &ctx) const override
 
virtual StatusCode convert (const std::vector< IdentifierHash > &, const EventContext &) const override
 
virtual StatusCode convert (const std::vector< uint32_t > &, const EventContext &) const override
 
virtual StatusCode convert (const ROBFragmentList &, const std::vector< IdentifierHash > &, const EventContext &) const override
 

Private Attributes

SG::UpdateHandleKey< CscRawDataCollection_Cachem_rdoContainerCacheKey
 CSC container cache key. More...
 

Detailed Description

Definition at line 21 of file CSC_RawDataProviderToolMT.h.

Constructor & Destructor Documentation

◆ CSC_RawDataProviderToolMT()

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

Definition at line 25 of file CSC_RawDataProviderToolMT.cxx.

25  :
26  base_class(t, n, p) {
27  declareProperty("CscContainerCacheKey", m_rdoContainerCacheKey, "Optional external cache for the CSC container");
28 }

◆ ~CSC_RawDataProviderToolMT()

Muon::CSC_RawDataProviderToolMT::~CSC_RawDataProviderToolMT ( )
virtualdefault

default destructor

Member Function Documentation

◆ convert() [1/10]

virtual StatusCode Muon::CSC_RawDataProviderToolMT::convert ( ) const
inlineoverridevirtual

Definition at line 38 of file CSC_RawDataProviderToolMT.h.

38 { return this->convert(Gaudi::Hive::currentContext()); }

◆ convert() [2/10]

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

Definition at line 74 of file CSC_RawDataProviderToolMT.cxx.

74  {
75  std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> vecOfRobf;
76  const std::vector<uint32_t>& robIds = m_hid2re.allRobIds();
77  ATH_MSG_VERBOSE("Number of ROB ids " << robIds.size());
78  // ask ROBDataProviderSvc for the vector of ROBFragment for all MDT ROBIDs
79  m_robDataProvider->getROBData(ctx, robIds, vecOfRobf);
80  ATH_MSG_VERBOSE("Number of ROB fragments " << vecOfRobf.size());
81 
82  return convert(vecOfRobf, ctx);
83 }

◆ convert() [3/10]

virtual StatusCode Muon::CSC_RawDataProviderToolMT::convert ( const ROBFragmentList &  ,
const std::vector< IdentifierHash > &  ,
const EventContext &   
) const
inlineoverridevirtual

Definition at line 47 of file CSC_RawDataProviderToolMT.h.

47  {
48  return StatusCode::FAILURE;
49  }

◆ convert() [4/10]

virtual StatusCode Muon::CSC_RawDataProviderToolMT::convert ( const ROBFragmentList &  vecRobs) const
inlineoverridevirtual

Definition at line 33 of file CSC_RawDataProviderToolMT.h.

33  {
34  return this->convert(vecRobs, Gaudi::Hive::currentContext());
35  }

◆ convert() [5/10]

StatusCode Muon::CSC_RawDataProviderToolMT::convert ( const ROBFragmentList &  vecRobs,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 90 of file CSC_RawDataProviderToolMT.cxx.

90  {
91  SG::WriteHandle<CscRawDataContainer> rdoContainerHandle(m_containerKey, ctx);
92 
93  // Split the methods to have one where we use the cache and one where we just setup the container
94  const bool externalCacheRDO = !m_rdoContainerCacheKey.key().empty();
95  if (!externalCacheRDO) {
96  ATH_CHECK(rdoContainerHandle.record(std::make_unique<CscRawDataContainer>(m_idHelperSvc->cscIdHelper().module_hash_max())));
97  ATH_MSG_DEBUG("Created CSCRawDataContainer");
98  } else {
100  ATH_CHECK(update.isValid());
101  ATH_CHECK(rdoContainerHandle.record(std::make_unique<CscRawDataContainer>(update.ptr())));
102  ATH_MSG_DEBUG("Created container using cache for " << m_rdoContainerCacheKey.key());
103  }
104 
105  CscRawDataContainer* container = rdoContainerHandle.ptr();
106 
107  if (!container) {
108  ATH_MSG_ERROR("CSC RDO container pointer is null, cannot decode data");
109  return StatusCode::FAILURE;
110  }
111 
112  // call conversion function from the base class
113  ATH_CHECK(convertIntoContainer(vecRobs, ctx, *container));
114 
115  return StatusCode::SUCCESS;
116 }

◆ convert() [6/10]

StatusCode Muon::CSC_RawDataProviderToolMT::convert ( const ROBFragmentList &  vecRobs,
const std::vector< IdentifierHash > &   
) const
overridevirtual

Definition at line 85 of file CSC_RawDataProviderToolMT.cxx.

86  {
87  return this->convert(vecRobs, Gaudi::Hive::currentContext());
88 }

◆ convert() [7/10]

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

Definition at line 56 of file CSC_RawDataProviderToolMT.cxx.

56  {
57  IdContext cscContext = m_idHelperSvc->cscIdHelper().module_context();
58 
59  std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> vecOfRobf;
60  std::vector<uint32_t> robIds;
61 
62  for (unsigned int i = 0; i < rdoIdhVect.size(); ++i) {
63  uint32_t rob_id = 0xffff;
64  m_cabling->hash2RobFull(rdoIdhVect[i], rob_id);
65  robIds.push_back(rob_id);
66  }
67  m_robDataProvider->getROBData(ctx, robIds, vecOfRobf);
68  ATH_MSG_VERBOSE("Number of ROB fragments " << vecOfRobf.size());
69 
70  // This would be passed to the function which does not use the IdentifierHash further
71  return convert(vecOfRobf, ctx);
72 }

◆ convert() [8/10]

StatusCode Muon::CSC_RawDataProviderToolMT::convert ( const std::vector< IdentifierHash > &  collections) const
overridevirtual

Definition at line 52 of file CSC_RawDataProviderToolMT.cxx.

52  {
53  return this->convert(rdoIdhVect, Gaudi::Hive::currentContext());
54 }

◆ convert() [9/10]

virtual StatusCode Muon::CSC_RawDataProviderToolMT::convert ( const std::vector< uint32_t > &  ) const
inlineoverridevirtual

Definition at line 39 of file CSC_RawDataProviderToolMT.h.

39 { return StatusCode::FAILURE; }

◆ convert() [10/10]

virtual StatusCode Muon::CSC_RawDataProviderToolMT::convert ( const std::vector< uint32_t > &  ,
const EventContext &   
) const
inlineoverridevirtual

Definition at line 46 of file CSC_RawDataProviderToolMT.h.

46 { return StatusCode::FAILURE; }

◆ initialize()

StatusCode Muon::CSC_RawDataProviderToolMT::initialize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 36 of file CSC_RawDataProviderToolMT.cxx.

36  {
37  // call initialize from base class
39 
40  // Initialise the container cache if available
41  ATH_CHECK(m_rdoContainerCacheKey.initialize(!m_rdoContainerCacheKey.key().empty()));
42 
43  ATH_CHECK(m_idHelperSvc.retrieve());
44 
45  return StatusCode::SUCCESS;
46 }

Member Data Documentation

◆ m_rdoContainerCacheKey

SG::UpdateHandleKey<CscRawDataCollection_Cache> Muon::CSC_RawDataProviderToolMT::m_rdoContainerCacheKey
private

CSC container cache key.

Definition at line 53 of file CSC_RawDataProviderToolMT.h.


The documentation for this class was generated from the following files:
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Muon::CSC_RawDataProviderToolMT::m_rdoContainerCacheKey
SG::UpdateHandleKey< CscRawDataCollection_Cache > m_rdoContainerCacheKey
CSC container cache key.
Definition: CSC_RawDataProviderToolMT.h:53
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:85
Muon::CSC_RawDataProviderToolCore::initialize
virtual StatusCode initialize() override
standard Athena-Algorithm method
Definition: CSC_RawDataProviderToolCore.cxx:25
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Muon::CSC_RawDataProviderToolMT::convert
virtual StatusCode convert() const override
Definition: CSC_RawDataProviderToolMT.h:38
SG::UpdateHandle
Definition: UpdateHandle.h:94
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
CscRawDataContainer
This container provides access to collections of CSC RDOs and a mechanism for recording them.
Definition: CscRawDataContainer.h:23
IdContext
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
WriteBchToCool.update
update
Definition: WriteBchToCool.py:67