|
ATLAS Offline Software
|
Go to the documentation of this file.
24 #include "GaudiKernel/MsgStream.h"
25 #include "GaudiKernel/ThreadLocalContext.h"
33 static const InterfaceID IID_ILArRawDataContByteStreamTool
34 (
"LArRawDataContByteStreamTool", 1, 0);
38 {
return IID_ILArRawDataContByteStreamTool; }
43 (
const std::string&
type,
const std::string&
name,
const IInterface*
parent )
45 { declareInterface< LArRawDataContByteStreamTool >(
this );
70 ATH_MSG_ERROR (
"LArRodBlockStructure type 0 is obsolete and can't be used any more." );
71 return StatusCode::FAILURE;
76 ATH_MSG_INFO (
"Initialization done for reading and writing" );
87 return StatusCode::SUCCESS;
95 return StatusCode::SUCCESS;
105 <<
name()<<
".InitializeForWriting" );
106 return StatusCode::FAILURE;
110 ATH_MSG_ERROR (
"Null pointer passed to WriteLArDigit routine!" );
111 return StatusCode::FAILURE;
117 ATH_MSG_DEBUG (
"This instance of LArRodBlockStructure can't hold LArDigits!" );
118 return StatusCode::FAILURE;
129 ATH_MSG_WARNING (
"Attempt to persistify an empty LArDigitContainer to ByteStream" );
130 return StatusCode::SUCCESS;
133 const EventContext& ctx = Gaudi::Hive::currentContext();
139 std::map<uint32_t, LArRodEncoder> mapEncoder;
142 {
return mapEncoder.try_emplace (reid,
146 blstruct.get()).
first->second; };
151 int fixgain=(*it_b)->gain();
152 ATH_MSG_DEBUG(
" number of Digits in LArDigitContainer for gain " << fixgain <<
": "
153 << digitCont->
size() );
155 for(; it_b!=it_e; ++it_b){
159 getEncoder(reid).add (
digit, fixgain);
162 ATH_MSG_VERBOSE(
" number of channels in the LArDigitContainer for gain "
163 << fixgain <<
": "<<
n );
167 ATH_MSG_DEBUG(
" number of channels in LArDigit container: "<< digitCont->
size() );
170 for(; it_b!=it_e; ++it_b){
174 getEncoder(reid).add (
digit);
187 for(;
it!=it_end;++
it) {
191 ATH_MSG_DEBUG (
"Filled " << mapEncoder.size() <<
" Rod Blocks" );
194 return StatusCode::SUCCESS;
205 <<
name()<<
".InitializeForWriting" );
206 return StatusCode::FAILURE;
208 ATH_MSG_DEBUG (
"Writing LArCalibDigitContainer to ByteStream" );
210 ATH_MSG_DEBUG (
"Null pointer passed to WriteLArCalibDigit routine!" );
211 return StatusCode::FAILURE;
217 ATH_MSG_DEBUG (
"This instance of LArRodBlockStructure can't hold LArCalibDigits!" );
218 return StatusCode::FAILURE;
229 ATH_MSG_WARNING (
"Attempt to persistify a empty LArDigitContainer to ByteStream" );
230 return StatusCode::SUCCESS;
233 ATH_MSG_ERROR (
"Inconsistent gain in LArCalibDigitContainer" );
234 return StatusCode::FAILURE;
237 const EventContext& ctx = Gaudi::Hive::currentContext();
243 std::map<uint32_t, LArRodEncoder> mapEncoder;
246 {
return mapEncoder.try_emplace (reid,
250 blstruct.get()).
first->second; };
253 int fixgain=(*it_b)->gain();
256 for(; it_b!=it_e; ++it_b){
260 getEncoder(reid).add (
digit, fixgain);
264 ATH_MSG_VERBOSE(
" number of channels in the LArCalibDigitContainer for gain "
265 << fixgain <<
": "<<
n );
274 for(;
it!=it_end;++
it) {
278 ATH_MSG_DEBUG (
"Filled " << mapEncoder.size() <<
" Rod Blocks" );
279 return StatusCode::SUCCESS;
289 <<
name()<<
".InitializeForWriting" );
290 return StatusCode::FAILURE;
293 ATH_MSG_DEBUG (
"Null pointer passed to WriteLArCalibDigit routine!" );
294 return StatusCode::FAILURE;
300 ATH_MSG_DEBUG (
"This instance of LArRodBlockStructure can't hold LArRawChannels!" );
301 return StatusCode::FAILURE;
308 LArRawChannelContainer::const_iterator
it = channelCont->begin();
309 LArRawChannelContainer::const_iterator it_e= channelCont->end();
311 ATH_MSG_WARNING (
"Attempt to persistify a empty LArDigitContainer to ByteStream" );
312 return StatusCode::SUCCESS;
315 const EventContext& ctx = Gaudi::Hive::currentContext();
321 std::map<uint32_t, LArRodEncoder> mapEncoder;
324 {
return mapEncoder.try_emplace (reid,
328 blstruct.get()).
first->second; };
333 ATH_MSG_DEBUG(
" number of LArRawChannel container "<< channelCont->size() );
334 for(;
it!=it_e; ++
it){
349 getEncoder(reid).add (&rawChan);
361 ATH_MSG_WARNING (
"Attempt to persistify a empty LArDigitContainer to ByteStream" );
363 for(; it_b!=it_e; ++it_b){
368 getEncoder(reid).add (
digit);
381 for(; it_m!=it_m_e;++it_m) {
387 ATH_MSG_DEBUG (
"Filled " << mapEncoder.size() <<
" Rod Blocks" );
388 return StatusCode::SUCCESS;
403 ATH_MSG_ERROR (
"RawEvent passed to 'convert'-function is a null pointer!" );
404 return StatusCode::FAILURE;
407 if (!
m_decoder->check_valid (
re,
msg()))
return StatusCode::FAILURE;
410 ATH_MSG_VERBOSE ( MSG::hex <<
"Full source ID: " <<
re->source_id() << MSG::dec );
415 eformat::helper::build_toc(*
re, robIndex );
416 if ( robIndex.empty() ) {
417 return StatusCode::FAILURE;
419 return StatusCode::SUCCESS;
424 std::unique_ptr<LArRodBlockStructure>
432 ATH_MSG_DEBUG (
"Set Rod Block Type to LArRodBlockTransparent (#2)" );
433 return std::make_unique<LArRodBlockTransparentV0<LArRodBlockHeaderTransparentV0> >();
437 ATH_MSG_DEBUG (
"Set Rod Block Type to LArRodBlockCalibration (#7)" );
438 return std::make_unique<LArRodBlockCalibrationV0<LArRodBlockHeaderCalibrationV0> >();
443 ATH_MSG_DEBUG (
"Set Rod Block Type to LArRodBlockPhysics (#5)" );
444 return std::make_unique<LArRodBlockPhysicsV5>();
447 ATH_MSG_DEBUG (
"Set Rod Block Type to LArRodBlockPhysics (#6)" );
448 return std::make_unique<LArRodBlockPhysicsV6>();
451 ATH_MSG_DEBUG (
"Set Rod Block Type to LArRodBlockPhysics (#4)" );
452 return std::make_unique<LArRodBlockPhysicsV0>();
457 ATH_MSG_DEBUG (
"Set Rod Block Type to LArRodBlockPhysics (#5)" );
458 return std::make_unique<LArRodBlockPhysicsV3>();
462 return std::make_unique<LArRodBlockPhysicsV0>();
471 auto hid2re = std::make_unique<Hid2RESrcID>();
472 if (hid2re->initialize (rodMapping).isFailure()) {
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Const iterator class for DataVector/DataList.
HWIdentifier channelID() const
Template class for assembling a full atlas raw event from subfragments.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
uint32_t getRodID(const LArFebRodMapping &rodMapping, const HWIdentifier &hid) const
make a ROD SrcID for a HWIdentifier
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
#define ATH_MSG_VERBOSE(x)
virtual bool canSetRawData()
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Container class for LArCalibDigit.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
virtual bool canIncludeRawData()
Liquid Argon digit base class.
Liquid Argon ROD output object base class.
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual bool canSetRawDataFixed()
virtual bool canSetCalibration()
Base class for LArDigits taken during calibration runs.
StatusCode initialize(bool used=true)
virtual bool canSetEnergy()
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
This class provides conversion from LArRawChannel and LArDigit to ROD format.
void setRodMinorVersion(uint16_t m)
change the ROD minor version
#define ATH_MSG_WARNING(x)
const boost::regex re(r_e)
Container class for LArDigit.
std::vector< uint32_t > RODDATA
ROD data as a vector of unsigned int.
size_type size() const noexcept
Returns the number of elements in the collection.
RODDATA * getRodData(uint32_t id)
get a block of ROD data
void setDetEvtType(uint32_t m)
change Detector Event Type
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
Container for LArRawChannel (IDC using LArRawChannelCollection)