diff --git a/LArCalorimeter/LArCalibTools/LArCalibTools/LArDigits2Ntuple.h b/LArCalorimeter/LArCalibTools/LArCalibTools/LArDigits2Ntuple.h index cb96ad6c1cfea52a54fc1eadc294f2023ee54201..dcca0bb0ba330f79c3fa9818e4e5a20a269f2d28 100644 --- a/LArCalorimeter/LArCalibTools/LArCalibTools/LArDigits2Ntuple.h +++ b/LArCalorimeter/LArCalibTools/LArCalibTools/LArDigits2Ntuple.h @@ -8,7 +8,6 @@ #include "LArCalibTools/LArCond2NtupleBase.h" #include "StoreGate/ReadHandleKey.h" #include "LArRawEvent/LArDigitContainer.h" -#include "xAODEventInfo/EventInfo.h" #include "LArRawEvent/LArFebHeaderContainer.h" @@ -39,7 +38,6 @@ class LArDigits2Ntuple : public LArCond2NtupleBase NTuple::Item<short> m_bcid; SG::ReadHandleKey<LArDigitContainer> m_contKey{this, "ContainerKey", "FREE", "key for LArDigitContainer"}; - SG::ReadHandleKey<xAOD::EventInfo> m_evtInfoKey { this, "EventInfoKey", "EventInfo", "SG for EventInfo Key" }; SG::ReadHandleKey<LArFebHeaderContainer> m_LArFebHeaderContainerKey { this, "LArFebHeaderKey", "LArFebHeader" }; }; diff --git a/LArCalorimeter/LArCalibTools/LArCalibTools/LArPulseShape.h b/LArCalorimeter/LArCalibTools/LArCalibTools/LArPulseShape.h index 12a21e61bee0d60ddb54b69e56d89348c4bebc93..4b1366018a7006805bfb27c68d36faf0aa24dc79 100644 --- a/LArCalorimeter/LArCalibTools/LArCalibTools/LArPulseShape.h +++ b/LArCalorimeter/LArCalibTools/LArCalibTools/LArPulseShape.h @@ -8,7 +8,6 @@ #include "AthenaBaseComps/AthAlgorithm.h" #include "GaudiKernel/NTuple.h" -#include "xAODEventInfo/EventInfo.h" #include "LArElecCalib/ILArFEBTempTool.h" #include "LArCalibTools/LArCond2NtupleBase.h" @@ -77,7 +76,6 @@ class LArPulseShape : public AthAlgorithm { SG::ReadCondHandleKey<LuminosityCondData> m_lumiDataKey{this,"LumiKey", "LuminosityCondData","SG Key of LuminosityCondData object"}; SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}; SG::ReadCondHandleKey<LArBadChannelCont> m_BCKey{this, "BadChanKey", "LArBadChannel", "SG bad channels key"}; - SG::ReadHandleKey<xAOD::EventInfo> m_evtInfoKey { this, "EventInfo", "EventInfo", "" }; const ILArPedestal* m_larPedestal = nullptr; diff --git a/LArCalorimeter/LArCalibTools/src/LArDigits2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/LArDigits2Ntuple.cxx index 8e46d547ee1b9a3b4b92401dc92b66b9d952dc8e..e436540a1889e294df37616b6ed23e21cc549731 100644 --- a/LArCalorimeter/LArCalibTools/src/LArDigits2Ntuple.cxx +++ b/LArCalorimeter/LArCalibTools/src/LArDigits2Ntuple.cxx @@ -3,8 +3,6 @@ */ #include "LArCalibTools/LArDigits2Ntuple.h" -#include "EventInfo/EventInfo.h" -#include "EventInfo/EventID.h" #include "LArRawEvent/LArDigitContainer.h" #include "Identifier/HWIdentifier.h" #include "LArRawEvent/LArSCDigit.h" @@ -72,7 +70,6 @@ StatusCode LArDigits2Ntuple::initialize() } ATH_CHECK(m_contKey.initialize(m_contKey.key().size()) ); - ATH_CHECK(m_evtInfoKey.initialize() ); ATH_CHECK(m_LArFebHeaderContainerKey.initialize(!m_isSC) ); m_ipass = 0; @@ -85,6 +82,7 @@ StatusCode LArDigits2Ntuple::initialize() StatusCode LArDigits2Ntuple::execute() { + const EventContext& ctx = Gaudi::Hive::currentContext(); if(m_contKey.key().empty()) return StatusCode::SUCCESS; StatusCode sc; @@ -95,8 +93,7 @@ StatusCode LArDigits2Ntuple::execute() unsigned long thisbcid = 0; unsigned long thisELVL1Id = 0; - SG::ReadHandle<xAOD::EventInfo>evt (m_evtInfoKey); - thisevent = evt->eventNumber(); + thisevent = ctx.eventID().event_number(); // Get BCID from FEB header if ( !m_isSC ){ // we are not processing SC data, Feb header could be accessed @@ -113,7 +110,7 @@ StatusCode LArDigits2Ntuple::execute() } }else{ // This should be used for main readout later, once TDAQ fill event headers also in calib. runs properly - thisbcid = evt->bcid(); + thisbcid = ctx.eventID().bunch_crossing_id(); } SG::ReadHandle<LArDigitContainer> hdlDigit(m_contKey); diff --git a/LArCalorimeter/LArCalibTools/src/LArPulseShape.cxx b/LArCalorimeter/LArCalibTools/src/LArPulseShape.cxx index 7d052938021ca394af51abf0fd6d65e76aeb0674..b394d95cc79498e7b8c2a81cdcdeb6cb1413c684 100644 --- a/LArCalorimeter/LArCalibTools/src/LArPulseShape.cxx +++ b/LArCalorimeter/LArCalibTools/src/LArPulseShape.cxx @@ -3,7 +3,6 @@ */ #include "LArCalibTools/LArPulseShape.h" -#include "EventInfo/EventID.h" #include "LArIdentifier/LArOnlineID.h" #include "LArIdentifier/LArOnline_SuperCellID.h" #include "CaloIdentifier/CaloIdManager.h" @@ -39,8 +38,6 @@ StatusCode LArPulseShape::initialize() { ATH_CHECK( m_trigDec.retrieve() ); - ATH_CHECK( m_evtInfoKey.initialize() ); - if (m_ntpath.size()==0 || m_ntTitle.size()==0) { ATH_MSG_ERROR( "Need to set variable 'm_ntpath' and 'm_ntTitle' in constructor of deriving class!" ); return StatusCode::FAILURE; @@ -386,6 +383,7 @@ StatusCode LArPulseShape::initialize() { StatusCode LArPulseShape::execute() { + const EventContext& ctx = Gaudi::Hive::currentContext(); short int bunchStr[8] = {1, 101, 201, 301, 1786, 1886, 1986, 2086}; //move to JO std::vector<std::string> chains = m_trigDec->getListOfTriggers(); @@ -395,9 +393,7 @@ StatusCode LArPulseShape::execute() { if (m_trigDec->isPassed("L1_RD1_BGRP10")) { - SG::ReadHandle<xAOD::EventInfo> evt (m_evtInfoKey); - - int bunchId = evt->bcid(); + int bunchId = ctx.eventID().bunch_crossing_id(); m_mindist = 3564; m_closestBC = 0; diff --git a/LArCalorimeter/LArCalibTools/src/LArSC2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/LArSC2Ntuple.cxx index 29c51ae817902097882701091817792afd56a0f5..2af8f98c401356a99cb9f99f525dd0221668d1e5 100644 --- a/LArCalorimeter/LArCalibTools/src/LArSC2Ntuple.cxx +++ b/LArCalorimeter/LArCalibTools/src/LArSC2Ntuple.cxx @@ -137,11 +137,10 @@ StatusCode LArSC2Ntuple::execute() unsigned long long thisevent = 0; unsigned long thisbcid = 0; - SG::ReadHandle<xAOD::EventInfo>evt (m_evtInfoKey, ctx); - thisevent = evt->eventNumber(); + thisevent = ctx.eventID().event_number(); // This should be used for main readout later, once TDAQ fill event headers also in calib. runs properly - thisbcid = evt->bcid(); + thisbcid = ctx.eventID().bunch_crossing_id(); // /// set it here once and no need to set at each SC/cell bool hasDigitContainer=true;