ATLAS Offline Software
Loading...
Searching...
No Matches
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
6
9#include "MuCalDecode/CalibEvent.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;
22using namespace LVL2_MUON_CALIBRATION;
23
24EventInfoCalibRawDataProvider::EventInfoCalibRawDataProvider(const std::string& name, ISvcLocator* pSvcLocator) :
25 AthReentrantAlgorithm(name, pSvcLocator) {}
26
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
40StatusCode 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
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
An algorithm that can be simultaneously executed in multiple threads.
ServiceHandle< IMuonCalibStreamDataProviderSvc > m_dataProvider
EventInfoCalibRawDataProvider(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
SG::WriteHandleKey< xAOD::EventInfo > m_eventInfoKey
virtual StatusCode initialize() override
Initialize.
virtual StatusCode execute(const EventContext &ctx) const override
Execute.
@ IS_CALIBRATION
true: calibration, false: physics