21#include "GaudiKernel/MsgStream.h"
22#include "GaudiKernel/ThreadLocalContext.h"
31 (
"LArRawDataContByteStreamTool", 1, 0);
40(
const std::string&
type,
const std::string& name,
const IInterface* parent )
42{ declareInterface< LArRawDataContByteStreamTool >(
this );
67 ATH_MSG_ERROR (
"LArRodBlockStructure type 0 is obsolete and can't be used any more." );
68 return StatusCode::FAILURE;
73 ATH_MSG_INFO (
"Initialization done for reading and writing" );
84 return StatusCode::SUCCESS;
92 return StatusCode::SUCCESS;
101 << name()<<
".InitializeForWriting" );
102 return StatusCode::FAILURE;
105 ATH_MSG_DEBUG (
"Null pointer passed to WriteLArCalibDigit routine!" );
106 return StatusCode::FAILURE;
111 if (!blstruct->canSetEnergy()) {
112 ATH_MSG_DEBUG (
"This instance of LArRodBlockStructure can't hold LArRawChannels!" );
113 return StatusCode::FAILURE;
120 LArRawChannelContainer::const_iterator it = channelCont->begin();
121 LArRawChannelContainer::const_iterator it_e= channelCont->end();
123 ATH_MSG_WARNING (
"Attempt to persistify a empty LArDigitContainer to ByteStream" );
124 return StatusCode::SUCCESS;
127 const EventContext& ctx = Gaudi::Hive::currentContext();
133 std::map<uint32_t, LArRodEncoder> mapEncoder;
136 {
return mapEncoder.try_emplace (reid,
140 blstruct.get()).first->second; };
142 ATH_MSG_DEBUG(
" number of LArRawChannel container "<< channelCont->size() );
143 for(; it!=it_e; ++it){
146 uint32_t reid = hid2re.
getRodID( **febRodMapping, chid );
148 getEncoder(reid).add (&rawChan);
156 if ( blstruct->canIncludeRawData() ){
160 ATH_MSG_WARNING (
"Attempt to persistify a empty LArDigitContainer to ByteStream" );
162 for(; it_b!=it_e; ++it_b){
165 uint32_t reid = hid2re.
getRodID( **febRodMapping, chid );
167 getEncoder(reid).add (digit);
176 std::map<uint32_t,LArRodEncoder>::iterator it_m =mapEncoder.begin();
177 std::map<uint32_t,LArRodEncoder>::iterator it_m_e=mapEncoder.end();
180 for(; it_m!=it_m_e;++it_m) {
186 ATH_MSG_DEBUG (
"Filled " << mapEncoder.size() <<
" Rod Blocks" );
187 return StatusCode::SUCCESS;
201 ATH_MSG_ERROR (
"RawEvent passed to 'convert'-function is a null pointer!" );
202 return StatusCode::FAILURE;
205 if (!
m_decoder->check_valid (
re,
msg()))
return StatusCode::FAILURE;
208 ATH_MSG_VERBOSE ( MSG::hex <<
"Full source ID: " <<
re->source_id() << MSG::dec );
213 eformat::helper::build_toc(*
re, robIndex );
214 if ( robIndex.empty() ) {
215 return StatusCode::FAILURE;
217 return StatusCode::SUCCESS;
222std::unique_ptr<LArRodBlockStructure>
230 ATH_MSG_DEBUG (
"Set Rod Block Type to LArRodBlockTransparent (#2)" );
231 return std::make_unique<LArRodBlockTransparentV0<LArRodBlockHeaderTransparentV0> >(this->msgSvc().get());
236 ATH_MSG_DEBUG (
"Set Rod Block Type to LArRodBlockPhysics (#5)" );
237 return std::make_unique<LArRodBlockPhysicsV5>(this->msgSvc().
get());
240 ATH_MSG_DEBUG (
"Set Rod Block Type to LArRodBlockPhysics (#6)" );
241 return std::make_unique<LArRodBlockPhysicsV6>(this->msgSvc().
get());
260 auto hid2re = std::make_unique<Hid2RESrcID>();
261 if (hid2re->initialize (rodMapping).isFailure()) {
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_VERBOSE(x,...)
#define ATH_MSG_INFO(x,...)
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
const ServiceHandle< StoreGateSvc > & detStore() const
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
void setRodMinorVersion(uint16_t m)
change the ROD minor version
void setDetEvtType(uint32_t m)
change Detector Event Type
std::vector< uint32_t > RODDATA
RODDATA * getRodData(uint32_t id)
get a block of ROD data
uint32_t getRodID(const LArFebRodMapping &rodMapping, const HWIdentifier &hid) const
make a ROD SrcID for a HWIdentifier
Container class for LArDigit.
Liquid Argon digit base class.
Container for LArRawChannel (IDC using LArRawChannelCollection).
Liquid Argon ROD output object base class.
HWIdentifier channelID() const
This class provides conversion from LArRawChannel and LArDigit to ROD format.
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)