ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCalib
MuonCalibStream
MuonCalibStreamCnv
src
EventInfoCalibRawDataProvider.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonCalibStreamCnv/EventInfoCalibRawDataProvider.h
"
6
7
#include "
AthenaBaseComps/AthCheckMacros.h
"
8
#include "
AthenaBaseComps/AthMsgStreamMacros.h
"
9
#include "MuCalDecode/CalibEvent.h"
10
#include "
MuonCalibStreamCnvSvc/IMuonCalibStreamDataProviderSvc.h
"
11
#include "
xAODEventInfo/EventInfo.h
"
12
#include "
xAODEventInfo/EventAuxInfo.h
"
13
14
#include "GaudiKernel/StatusCode.h"
15
16
#include <memory>
17
18
// Instantiation of a static factory class used by clients to create
19
// instances of this service
20
// static CnvFactory<EventInfoMuonCalibStreamCnv> s_factory;
21
// const ICnvFactory& EventInfoMuonCalibStreamCnvFactory = s_factory;
22
using namespace
LVL2_MUON_CALIBRATION
;
23
24
EventInfoCalibRawDataProvider::EventInfoCalibRawDataProvider
(
const
std::string& name, ISvcLocator* pSvcLocator) :
25
AthReentrantAlgorithm
(name, pSvcLocator) {}
26
27
StatusCode
EventInfoCalibRawDataProvider::initialize
() {
28
ATH_MSG_INFO
(
"EventInfoCalibRawDataProvider::initialize"
);
29
30
// retrieve the dataProviderSvc
31
ATH_CHECK
(
m_dataProvider
.retrieve());
32
//ATH_CHECK(m_lumiBlockCoolSvc.retrieve());
33
// init output EventInfo key
34
ATH_CHECK
(
m_eventInfoKey
.initialize());
35
36
return
StatusCode::SUCCESS;
37
}
38
39
// Execute
40
StatusCode
EventInfoCalibRawDataProvider::execute
(
const
EventContext& ctx)
const
{
41
42
ATH_MSG_INFO
(
"EventInfoCalibRawDataProvider::execute"
);
43
44
const
CalibEvent *
event
=
m_dataProvider
->getEvent();
45
46
// Build EventInfo
47
uint64_t eventNumber =
event
->lvl1_id();
48
int
runNumber =
event
->run_number();
49
float
pt =
event
->pt();
50
// Time Stamp
51
uint64_t timeStamp =
event
->timestamp();
52
int
lb_nr(0);
53
54
ATH_MSG_DEBUG
(
"New EventInfo made, run/event/timestamp/pt/LB = "
<<runNumber<<
" "
<<eventNumber<<
" "
<<timeStamp<<
" "
<<pt<<
" "
<<lb_nr);
55
56
auto
evtInfo = std::make_unique<xAOD::EventInfo>();
57
auto
evtAuxInfo = std::make_unique<xAOD::EventAuxInfo>();
58
evtInfo->setStore(evtAuxInfo.get());
59
60
evtInfo->setRunNumber(runNumber);
61
evtInfo->setEventNumber(eventNumber);
62
evtInfo->setLumiBlock(lb_nr);
63
evtInfo->setTimeStamp(timeStamp);
64
evtInfo->setBCID(0);
65
evtInfo->setTimeStampNSOffset(pt);
66
uint32_t eventTypeBitmask = 0;
67
eventTypeBitmask |=
xAOD::EventInfo::IS_CALIBRATION
;
68
evtInfo->setEventTypeBitmask( eventTypeBitmask );
69
70
SG::WriteHandle<xAOD::EventInfo>
handle{
m_eventInfoKey
, ctx};
71
ATH_CHECK
(handle.record(std::move(evtInfo),std::move(evtAuxInfo)));
72
73
ATH_MSG_DEBUG
(
"Created EventInfo "
<<
m_eventInfoKey
.key());
74
ATH_MSG_DEBUG
(
"EventInfo core decode processed in MT decode (calibration stream event)"
);
75
76
return
StatusCode::SUCCESS;
77
}
AthCheckMacros.h
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
AthMsgStreamMacros.h
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
EventAuxInfo.h
EventInfoCalibRawDataProvider.h
IMuonCalibStreamDataProviderSvc.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
EventInfoCalibRawDataProvider::m_dataProvider
ServiceHandle< IMuonCalibStreamDataProviderSvc > m_dataProvider
Definition
EventInfoCalibRawDataProvider.h:48
EventInfoCalibRawDataProvider::EventInfoCalibRawDataProvider
EventInfoCalibRawDataProvider(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
EventInfoCalibRawDataProvider.cxx:24
EventInfoCalibRawDataProvider::m_eventInfoKey
SG::WriteHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition
EventInfoCalibRawDataProvider.h:52
EventInfoCalibRawDataProvider::initialize
virtual StatusCode initialize() override
Initialize.
Definition
EventInfoCalibRawDataProvider.cxx:27
EventInfoCalibRawDataProvider::execute
virtual StatusCode execute(const EventContext &ctx) const override
Execute.
Definition
EventInfoCalibRawDataProvider.cxx:40
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
xAOD::EventInfo_v1::IS_CALIBRATION
@ IS_CALIBRATION
true: calibration, false: physics
Definition
EventInfo_v1.h:155
LVL2_MUON_CALIBRATION
Definition
MuCalStreamerTool.h:37
EventInfo.h
Generated on
for ATLAS Offline Software by
1.17.0