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

#include <EventInfoMuonCalibStreamCnv.h>

Inheritance diagram for EventInfoMuonCalibStreamCnv:
Collaboration diagram for EventInfoMuonCalibStreamCnv:

Public Member Functions

virtual StatusCode initialize ()
virtual StatusCode createObj (IOpaqueAddress *pAddr, DataObject *&pObj)
virtual StatusCode createRep (DataObject *pObj, IOpaqueAddress *&pAddr)
virtual long repSvcType () const
 Storage type and class ID.
 EventInfoMuonCalibStreamCnv (ISvcLocator *svcloc)
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< IConversionSvc > m_MuonCalibStreamCnvSvc
ServiceHandle< IMuonCalibStreamDataProviderSvc > m_dataProvider
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 20 of file EventInfoMuonCalibStreamCnv.h.

Constructor & Destructor Documentation

◆ EventInfoMuonCalibStreamCnv()

EventInfoMuonCalibStreamCnv::EventInfoMuonCalibStreamCnv ( ISvcLocator * svcloc)

Definition at line 30 of file EventInfoMuonCalibStreamCnv.cxx.

30 :
31 Converter(storageType(), classID(), svcloc),
32 AthMessaging(msgSvc(), "EventInfoMuonCalibStreamCnv"),
33 m_MuonCalibStreamCnvSvc("MuonCalibStreamCnvSvc", "EventInfoMuonCalibStreamCnv"),
34 m_dataProvider("MuonCalibStreamDataProviderSvc", "EventInfoMuonCalibStreamCnv")
35{}
AthMessaging()
Default constructor:
ServiceHandle< IMuonCalibStreamDataProviderSvc > m_dataProvider
ServiceHandle< IConversionSvc > m_MuonCalibStreamCnvSvc

Member Function Documentation

◆ classID()

CLID EventInfoMuonCalibStreamCnv::classID ( )
static

◆ createObj()

StatusCode EventInfoMuonCalibStreamCnv::createObj ( IOpaqueAddress * pAddr,
DataObject *& pObj )
virtual

Definition at line 50 of file EventInfoMuonCalibStreamCnv.cxx.

50 {
51
52 MuonCalibStreamAddress *pRE_Addr;
53 pRE_Addr = dynamic_cast<MuonCalibStreamAddress *>(pAddr);
54 if (!pRE_Addr) {
55 ATH_MSG_ERROR(" Cannot cast to MuonCalibStreamAddress ");
56 return StatusCode::FAILURE;
57 }
58
59 ATH_MSG_DEBUG(" Creating Objects ");
60
61 // get CalibEvent
62 const LVL2_MUON_CALIBRATION::CalibEvent *event = m_dataProvider->getEvent();
63 if (!event) {
64 ATH_MSG_ERROR(" Can not get CalibEvent ");
65 return StatusCode::FAILURE;
66 }
67
68 // Build EventInfo
69 uint64_t eventNumber = event->lvl1_id();
70 int runNumber = event->run_number();
71 float pt = event->pt();
72 // Time Stamp
73 uint64_t timeStamp = event->timestamp();
74 int lb_nr(0);
75
76 // create xAOD::EventInfo objects directly
77 xAOD::EventInfo* evtInfo = new xAOD::EventInfo();
78 xAOD::EventAuxInfo* evtAuxInfo = new xAOD::EventAuxInfo();
79 evtInfo->setStore(evtAuxInfo);
80
81 evtInfo->setRunNumber(runNumber);
82 evtInfo->setEventNumber(eventNumber);
83 evtInfo->setLumiBlock(lb_nr);
84 evtInfo->setTimeStamp(timeStamp);
85 evtInfo->setBCID(0);
86 evtInfo->setTimeStampNSOffset(pt);
87 uint32_t eventTypeBitmask = 0;
88 eventTypeBitmask |= xAOD::EventInfo::IS_CALIBRATION;
89 evtInfo->setEventTypeBitmask( eventTypeBitmask );
90
91 pObj = SG::asStorable(evtInfo);
92
93 // PRINT TIMESTAMP INFO
94 ATH_MSG_DEBUG("New EventInfo made, run/event/timestamp/pt/LB = "<<runNumber<<" "<<eventNumber<<" "<<timeStamp<<" "<<pt<<" "<<lb_nr);
95
96 return StatusCode::SUCCESS;
97} // EventInfoMuonCalibStreamCnv::createObj()
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
void setBCID(uint32_t value)
Set the bunch crossing ID of the event.
void setTimeStampNSOffset(uint32_t value)
Set the nanosecond offset wrt. the time stamp.
void setTimeStamp(uint32_t value)
Set the POSIX time of the event.
void setEventNumber(uint64_t value)
Set the current event's event number.
void setEventTypeBitmask(uint32_t value)
Set the event type bitmask.
void setRunNumber(uint32_t value)
Set the current event's run number.
@ IS_CALIBRATION
true: calibration, false: physics
void setLumiBlock(uint32_t value)
Set the current event's luminosity block number.
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
setEventNumber timeStamp
EventInfo_v1 EventInfo
Definition of the latest event info version.
EventAuxInfo_v3 EventAuxInfo
Definition of the latest event auxiliary info version.
setEventNumber uint32_t

◆ createRep()

StatusCode EventInfoMuonCalibStreamCnv::createRep ( DataObject * pObj,
IOpaqueAddress *& pAddr )
virtual

Definition at line 101 of file EventInfoMuonCalibStreamCnv.cxx.

101 {
102 ATH_MSG_DEBUG(" Nothing to be done for EventInfo createRep ");
103 return StatusCode::SUCCESS;
104}

◆ initialize()

StatusCode EventInfoMuonCalibStreamCnv::initialize ( )
virtual

Definition at line 39 of file EventInfoMuonCalibStreamCnv.cxx.

39 {
40 ATH_MSG_DEBUG("Initialize EventInfoMuonCalibStreamCnv");
41
42 ATH_CHECK(Converter::initialize());
43
45 ATH_CHECK( m_dataProvider.retrieve() );
46
47 return StatusCode::SUCCESS;
48}
#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; }
MsgStream & msg() const
The standard message stream.

◆ 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 EventInfoMuonCalibStreamCnv::repSvcType ( ) const
inlinevirtual

Storage type and class ID.

Definition at line 27 of file EventInfoMuonCalibStreamCnv.h.

static constexpr long storageType()

◆ 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 EventInfoMuonCalibStreamCnv::storageType ( )
inlinestatic

Definition at line 28 of file EventInfoMuonCalibStreamCnv.h.

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_dataProvider

ServiceHandle<IMuonCalibStreamDataProviderSvc> EventInfoMuonCalibStreamCnv::m_dataProvider
private

Definition at line 35 of file EventInfoMuonCalibStreamCnv.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_MuonCalibStreamCnvSvc

ServiceHandle<IConversionSvc> EventInfoMuonCalibStreamCnv::m_MuonCalibStreamCnvSvc
private

Definition at line 34 of file EventInfoMuonCalibStreamCnv.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.


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