ATLAS Offline Software
Loading...
Searching...
No Matches
LUCID_DigitByteStreamCnv Class Reference

#include <LUCID_DigitByteStreamCnv.h>

Inheritance diagram for LUCID_DigitByteStreamCnv:
Collaboration diagram for LUCID_DigitByteStreamCnv:

Public Member Functions

 LUCID_DigitByteStreamCnv (ISvcLocator *svcloc)
virtual StatusCode initialize () override
virtual StatusCode createRep (DataObject *pObj, IOpaqueAddress *&pAddr) override
virtual long repSvcType () const override
StatusCode fillFEA (LUCID_DigitContainer *RDO_container, RawEventWrite *re)
unsigned short RodBlockVersion (void)
int BCs_per_LVL1ID (void)
unsigned int getSourceID ()
bool msgLvl (const MSG::Level lvl) const
 Test the output level.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.
void setLevel (MSG::Level lvl)
 Change the current logging level.

Static Public Member Functions

static long storageType ()
static CLID classID ()

Private Member Functions

void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

ServiceHandle< IByteStreamEventAccess > m_ByteStreamEventAccess
FullEventAssembler< SrcIdMap > m_fea
unsigned short m_RodBlockVersion
int m_BCs_per_LVL1ID
std::string m_nm
 Message source name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels).
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging).

Detailed Description

Definition at line 28 of file LUCID_DigitByteStreamCnv.h.

Constructor & Destructor Documentation

◆ LUCID_DigitByteStreamCnv()

LUCID_DigitByteStreamCnv::LUCID_DigitByteStreamCnv ( ISvcLocator * svcloc)

Definition at line 19 of file LUCID_DigitByteStreamCnv.cxx.

19 :
20 Converter(storageType(), classID(), svcloc),
21 AthMessaging("LUCID_DigitByteStreamCnv"),
22 m_ByteStreamEventAccess("ByteStreamCnvSvc", "LUCID_DigitByteStreamCnv"),
25{
26
27}
AthMessaging()
Default constructor:
ServiceHandle< IByteStreamEventAccess > m_ByteStreamEventAccess

Member Function Documentation

◆ BCs_per_LVL1ID()

int LUCID_DigitByteStreamCnv::BCs_per_LVL1ID ( void )
inline

Definition at line 46 of file LUCID_DigitByteStreamCnv.h.

46{ return m_BCs_per_LVL1ID; }

◆ classID()

CLID LUCID_DigitByteStreamCnv::classID ( )
static

Definition at line 37 of file LUCID_DigitByteStreamCnv.cxx.

◆ createRep()

StatusCode LUCID_DigitByteStreamCnv::createRep ( DataObject * pObj,
IOpaqueAddress *& pAddr )
overridevirtual

Definition at line 47 of file LUCID_DigitByteStreamCnv.cxx.

47 {
48
49 ATH_MSG_DEBUG(" LUCID_DigitByteStreamCnv::createRep");
50
52 LUCID_DigitContainer* RDO_container = nullptr;
53
54 // dynamic cast of the pObj to RDO_container based in clid of pObj
55 if (!SG::fromStorable(pObj, RDO_container)) {
56 ATH_MSG_ERROR("Can not cast to LUCID_DigitContainer");
57 return StatusCode::RECOVERABLE;
58 }
59
60// get name of the persistent object (pObj)
61 std::string nm = pObj->registry()->name();
62
63// and create a empty generic BytestreamAddress for the specific clid of pObj
64 ByteStreamAddress* addr = new ByteStreamAddress(classID(), nm, "");
65
66 pAddr = addr;
67
68 StatusCode sc = fillFEA(RDO_container, re);
69
70 if (sc.isFailure()){
71 ATH_MSG_ERROR(" Could not convert RawData with to ByteStream ");
72 return StatusCode::RECOVERABLE;
73 }
74
75 return StatusCode::SUCCESS;
76}
const std::regex re(r_e)
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
static Double_t sc
OFFLINE_FRAGMENTS_NAMESPACE_WRITE::FullEventFragment RawEventWrite
data type for writing raw event
Definition RawEvent.h:39
StatusCode fillFEA(LUCID_DigitContainer *RDO_container, RawEventWrite *re)
::StatusCode StatusCode
StatusCode definition for legacy code.
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)

◆ fillFEA()

StatusCode LUCID_DigitByteStreamCnv::fillFEA ( LUCID_DigitContainer * RDO_container,
RawEventWrite * re )

Definition at line 78 of file LUCID_DigitByteStreamCnv.cxx.

78 {
79
80 m_fea.clear();
81 // type of RODDATA is std::vector<uint32_t>
83
84 m_fea.setRodMinorVersion(RodBlockVersion());
85 ATH_MSG_DEBUG("Setting ROD Minor Version Number to: " << m_RodBlockVersion);
86
87 LucidRodEncoder_map RDOEncoder_map;
88
89 LUCID_DigitContainer::const_iterator it_cont = RDO_container->begin();
90 LUCID_DigitContainer::const_iterator it_cont_end = RDO_container->end();
91 LUCID_RodEncoder::Cache cache{};
92 for( ; it_cont != it_cont_end; ++it_cont) {
93
94 if ((*it_cont) != nullptr) {
95
96 uint32_t rodId = getSourceID();
97
98 RDOEncoder_map[rodId].addDigit((*it_cont),cache);
99 }
100 else ATH_MSG_WARNING(" Digit is empty, skipping digit.");
101 }
102
103 LucidRodEncoder_map::iterator it_map = RDOEncoder_map.begin();
104 LucidRodEncoder_map::iterator it_map_end = RDOEncoder_map.end();
105
106 for (; it_map != it_map_end; ++it_map) {
107
108 // (*it_map) is now a pointer of the type std::pair<const uint32_t, LUCID_RDOEncoder >
109
110 theROD = m_fea.getRodData((*it_map).first);
111
112 ((*it_map).second).encode(*theROD, cache, msg());
113
114 (*theROD).push_back(0); // add status word
115
116 LUCID_RawData lrd(*theROD);
117
118 lrd.encodeLumatMapping();
119
120 *theROD = lrd.getDataBlock();
121 }
122
123 m_fea.fill(re, msg(MSG::INFO));
124
125 return StatusCode::SUCCESS;
126}
#define ATH_MSG_WARNING(x,...)
std::map< uint32_t, LUCID_RodEncoder > LucidRodEncoder_map
MsgStream & msg() const
The standard message stream.
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:861
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.
std::vector< uint32_t > RODDATA
ROD data as a vector of unsigned int.
FullEventAssembler< SrcIdMap > m_fea
unsigned short RodBlockVersion(void)
number_type encode(double weight)
const IIntersectionCache * cache() const
Retrieve the associated cache block, if it exists.
setEventNumber uint32_t

◆ getSourceID()

unsigned int LUCID_DigitByteStreamCnv::getSourceID ( )
inline

Definition at line 48 of file LUCID_DigitByteStreamCnv.h.

48{ return 0x00820000; }

◆ initialize()

StatusCode LUCID_DigitByteStreamCnv::initialize ( )
overridevirtual

Definition at line 29 of file LUCID_DigitByteStreamCnv.cxx.

29 {
30
31 ATH_CHECK( Converter::initialize() );
33
34 return StatusCode::SUCCESS;
35}
#define ATH_CHECK
Evaluate an expression and check for errors.

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)
int outputLevel(const IMessageSvc *ims, const std::string &source)

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 167 of file AthMessaging.h.

168{
169 MsgStream* ms = m_msg_tls.get();
170 if (!ms) {
171 if (!m_initialized.test_and_set()) initMessaging();
172 ms = new MsgStream(m_imsg,m_nm);
173 m_msg_tls.reset( ms );
174 }
175
176 ms->setLevel (m_lvl);
177 return *ms;
178}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels).
void initMessaging() const
Initialize our message level and MessageSvc.

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 182 of file AthMessaging.h.

183{ return msg() << lvl; }

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152{
153 // If user did not set explicit message level we have to initialize
154 // the messaging and retrieve the default via the MessageSvc.
155 if (m_lvl==MSG::NIL && !m_initialized.test_and_set()) initMessaging();
156
157 if (m_lvl <= lvl) {
158 msg() << lvl;
159 return true;
160 } else {
161 return false;
162 }
163}

◆ repSvcType()

virtual long LUCID_DigitByteStreamCnv::repSvcType ( ) const
inlineoverridevirtual

Definition at line 39 of file LUCID_DigitByteStreamCnv.h.

39{ return i_repSvcType(); }

◆ RodBlockVersion()

unsigned short LUCID_DigitByteStreamCnv::RodBlockVersion ( void )
inline

Definition at line 45 of file LUCID_DigitByteStreamCnv.h.

45{ return m_RodBlockVersion; }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29{
30 m_lvl = lvl;
31}

◆ storageType()

long LUCID_DigitByteStreamCnv::storageType ( )
static

Definition at line 42 of file LUCID_DigitByteStreamCnv.cxx.

42 {
43
45}
static constexpr long storageType()

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging).

Definition at line 141 of file AthMessaging.h.

◆ m_BCs_per_LVL1ID

int LUCID_DigitByteStreamCnv::m_BCs_per_LVL1ID
private

Definition at line 56 of file LUCID_DigitByteStreamCnv.h.

◆ m_ByteStreamEventAccess

ServiceHandle<IByteStreamEventAccess> LUCID_DigitByteStreamCnv::m_ByteStreamEventAccess
private

Definition at line 52 of file LUCID_DigitByteStreamCnv.h.

◆ m_fea

FullEventAssembler<SrcIdMap> LUCID_DigitByteStreamCnv::m_fea
private

Definition at line 54 of file LUCID_DigitByteStreamCnv.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels).

Definition at line 132 of file AthMessaging.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_RodBlockVersion

unsigned short LUCID_DigitByteStreamCnv::m_RodBlockVersion
private

Definition at line 55 of file LUCID_DigitByteStreamCnv.h.


The documentation for this class was generated from the following files: