|
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "GaudiKernel/MsgStream.h"
7 #include "GaudiKernel/StatusCode.h"
8 #include "GaudiKernel/DataObject.h"
9 #include "GaudiKernel/IRegistry.h"
10 #include "GaudiKernel/IToolSvc.h"
11 #include "GaudiKernel/ServiceHandle.h"
37 :
AthConstConverter(storageType(), classID(), svcloc,
"TileRawChannelContByteStreamCnv")
38 , m_tool(
"TileRawChannelContByteStreamTool")
39 , m_byteStreamCnvSvc(
"ByteStreamCnvSvc",
name())
40 , m_robSvc(
"ROBDataProviderSvc",
name())
41 , m_decoder(
"TileROD_Decoder")
67 return StatusCode::SUCCESS;
79 return StatusCode::FAILURE;
82 const std::string containerName(*(pRE_Addr->par()));
83 bool isTMDB(containerName == std::string(
"MuRcvRawChCnt"));
88 std::vector<uint32_t> robid(1);
90 std::vector<const ROBDataProviderSvc::ROBF*> robf;
101 std::unordered_map<uint32_t,int> bsflags;
107 rawChannelCollection->
clear();
117 if (newrob != robid[0]) {
120 m_robSvc->getROBData(Gaudi::Hive::currentContext(), robid, robf);
124 if (robf.size() > 0 ) {
126 m_decoder->fillCollection_TileMuRcv_RawChannel(robf[0], *rawChannelCollection);
128 m_decoder->fillCollection(robf[0], *rawChannelCollection, cont);
130 flag = cont->get_bsflags();
131 auto result = bsflags.insert(std::pair<uint32_t, int>(
flag, 1));
134 ATH_MSG_DEBUG(
"ROB for " << ((isTMDB)?
"TMDB ":
"") <<
"drawer 0x" << MSG::hex << collID << MSG::dec <<
" not found in BS" );
137 ATH_MSG_DEBUG(
"Status for " << ((isTMDB)?
"TMDB ":
"") <<
"drawer 0x" << MSG::hex << collID <<
" is 0x" <<
status << MSG::dec);
141 if (bsflags.size() > 1) {
143 for (
const auto & elem : bsflags) {
144 if (elem.second >
n) {
150 if (
flag != cont->get_bsflags()) {
155 ATH_MSG_DEBUG(
"Changing units for " << ((isTMDB)?
"TMDB ":
"") <<
"RawChannelContainer from "
156 << cont->get_unit() <<
" to " <<
unit << MSG::hex
157 <<
" and BS flags from 0x" << cont->get_bsflags() <<
" to 0x" <<
flag << MSG::dec);
160 cont->set_bsflags(
flag);
164 ATH_MSG_DEBUG(
"Creating raw channel container: " << containerName );
170 return StatusCode::SUCCESS;
181 std::string
key(
"Tile");
192 return StatusCode::FAILURE;
195 std::string
name = pObj->registry()->name();
197 if ( pAddr !=
nullptr ) pAddr->release();
204 return StatusCode::SUCCESS;
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Template class for assembling a full atlas raw event from subfragments.
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)
convert to and from a SG storable
StatusCode status() const
Return the error status from the constructors.
uint32_t getRobFromFragID(int frag_id) const
make a ROB SrcID for a fragment ID
virtual StatusCode finalize() override
void setFragGlobalCRC(uint32_t globalcrc)
Various set methods.
const TileHid2RESrcID * m_hid2re
Pointer to TileHid2RESrcID.
ToolHandle< TileROD_Decoder > m_decoder
Pointer to TileROD_Decoder.
uint32_t getRobFromTileMuRcvFragID(int frag_id) const
ToolHandle< TileRawChannelContByteStreamTool > m_tool
Gaudi converter base class with const interfaces.
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
Convert the transient object to the requested representation.
virtual StatusCode createObjConst(IOpaqueAddress *pAddr, DataObject *&pObj) const override
Create the transient representation of an object.
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
static const CLID & ID()
the CLID of T
TileRawChannelContByteStreamCnv(ISvcLocator *svcloc)
::StatusCode StatusCode
StatusCode definition for legacy code.
Helper for holding non-const raw data prior to recording in SG.
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
static long storageType()
uint32_t CLID
The Class ID type.
static constexpr long storageType()
ServiceHandle< IByteStreamCnvSvc > m_byteStreamCnvSvc
Collection * indexFindPtr(IdentifierHash hash)
Look up a (non-const) collection via hash.
ServiceHandle< IROBDataProviderSvc > m_robSvc
Pointer to IROBDataProviderSvc.
Helpers for checking error return status codes and reporting errors.
const std::string & name() const
Incident sent after a store is cleared.
void clear()
Clear everything for next event.
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
virtual StatusCode initialize() override
macros to associate a CLID to a type
static const CLID & classID()