Skip to content
Snippets Groups Projects
Commit cacbefb1 authored by Stewart Martin-Haugh's avatar Stewart Martin-Haugh Committed by Walter Lampl
Browse files

Pass EventContext down

parent 19003fe0
No related branches found
No related tags found
No related merge requests found
Showing
with 41 additions and 27 deletions
......@@ -119,7 +119,7 @@ StatusCode PixelRawDataProvider::execute(const EventContext& ctx) const {
}
std::vector<const ROBFragment*> listOfRobf;
m_robDataProvider->getROBData( listOfRobs, listOfRobf);
m_robDataProvider->getROBData(ctx, listOfRobs, listOfRobf);
#ifdef PIXEL_DEBUG
ATH_MSG_DEBUG("Number of ROB fragments " << listOfRobf.size()
......
......@@ -66,12 +66,12 @@ StatusCode PixelRawDataProviderTool::convert(std::vector<const ROBFragment*>& ve
// are we working on a new event ?
bool isNewEvent = (m_checkLVL1ID ? ((*rob_it)->rod_lvl1_id() != ent->m_LastLvl1ID) : true);
if (isNewEvent) {
LVL1Collection = SG::makeHandle(m_LVL1CollectionKey);
LVL1Collection = SG::makeHandle(m_LVL1CollectionKey,ctx);
ATH_CHECK(LVL1Collection.record(std::make_unique<InDetTimeCollection>()));
ATH_MSG_DEBUG("InDetTimeCollection " << LVL1Collection.name() << " registered in StoreGate");
LVL1Collection->reserve(vecRobs.size());
BCIDCollection = SG::makeHandle(m_BCIDCollectionKey);
BCIDCollection = SG::makeHandle(m_BCIDCollectionKey,ctx);
ATH_CHECK(BCIDCollection.record(std::make_unique<InDetTimeCollection>()));
ATH_MSG_DEBUG("InDetTimeCollection " << BCIDCollection.name() << " registered in StoreGate");
BCIDCollection->reserve(vecRobs.size());
......
// -*- C++ -*-
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
/**
......@@ -39,7 +39,8 @@ class ISCTRawDataProviderTool : virtual public IAlgTool
/** Main decoding methods */
virtual StatusCode convert(std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>&,
SCT_RDO_Container&,
IDCInDetBSErrContainer& errs) const = 0;
IDCInDetBSErrContainer& errs,
const EventContext& ctx) const = 0;
};
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
/**
......@@ -37,6 +37,7 @@ class ISCT_RodDecoder : virtual public IAlgTool
virtual StatusCode fillCollection(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment&,
SCT_RDO_Container&,
IDCInDetBSErrContainer& errs,
const EventContext& ctx,
const std::vector<IdentifierHash>* vecHash = nullptr) const = 0;
};
......
......@@ -91,7 +91,7 @@ StatusCode SCTRawDataProvider::execute(const EventContext& ctx) const
if (not m_roiSeeded.value()) {
std::vector<uint32_t> rodList;
m_cabling->getAllRods(rodList, ctx);
m_robDataProvider->getROBData(rodList , vecROBFrags);
m_robDataProvider->getROBData(ctx, rodList, vecROBFrags);
}
else {
// Only load ROBs from RoI
......@@ -106,7 +106,7 @@ StatusCode SCTRawDataProvider::execute(const EventContext& ctx) const
}
m_regionSelector->ROBIDList(superRoI, listOfROBs);
m_regionSelector->HashIDList(superRoI, hashIDs);
m_robDataProvider->getROBData(listOfROBs, vecROBFrags);
m_robDataProvider->getROBData(ctx, listOfROBs, vecROBFrags);
}
......@@ -152,7 +152,7 @@ StatusCode SCTRawDataProvider::execute(const EventContext& ctx) const
// Ask SCTRawDataProviderTool to decode it and to fill the IDC
if (m_rawDataTool->convert(vecROBFrags,
*(rdoContainer.ptr()),
*bsIDCErrContainer).isFailure()) {
*bsIDCErrContainer,ctx).isFailure()) {
ATH_MSG_WARNING("BS conversion into RDOs failed");
}
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "SCTRawDataProviderTool.h"
......@@ -28,7 +28,8 @@ StatusCode SCTRawDataProviderTool::initialize()
// Convert method
StatusCode SCTRawDataProviderTool::convert(std::vector<const ROBFragment*>& vecROBFrags,
SCT_RDO_Container& rdoIDCont,
IDCInDetBSErrContainer& errs) const
IDCInDetBSErrContainer& errs,
const EventContext& ctx) const
{
if (vecROBFrags.empty()) return StatusCode::SUCCESS;
ATH_MSG_DEBUG("SCTRawDataProviderTool::convert()");
......@@ -38,7 +39,7 @@ StatusCode SCTRawDataProviderTool::convert(std::vector<const ROBFragment*>& vecR
StatusCode sc{StatusCode::SUCCESS};
for (const ROBFragment* robFrag : vecROBFrags) {
// get the ID of this ROB/ROD
sc = m_decoder->fillCollection(*robFrag, rdoIDCont, errs);
sc = m_decoder->fillCollection(*robFrag, rdoIDCont, errs, ctx);
if (sc == StatusCode::FAILURE) {
if (m_decodeErrCount <= 100) {
if (100 == m_decodeErrCount) {
......
......@@ -51,7 +51,8 @@ class SCTRawDataProviderTool : public extends<AthAlgTool, ISCTRawDataProviderToo
* */
virtual StatusCode convert(std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>& vecROBFrags,
SCT_RDO_Container& rdoIDCont,
IDCInDetBSErrContainer& errs) const override;
IDCInDetBSErrContainer& errs,
const EventContext& ctx) const override;
private:
......
......@@ -167,6 +167,7 @@ StatusCode SCT_RodDecoder::finalize()
StatusCode SCT_RodDecoder::fillCollection(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment& robFrag,
SCT_RDO_Container& rdoIDCont,
IDCInDetBSErrContainer& errorsIDC,
const EventContext& ctx,
const std::vector<IdentifierHash>* vecHash) const
{
SCT_RodDecoderErrorsHelper errs{errorsIDC}; // on destruction will fill the IDC
......@@ -255,7 +256,7 @@ StatusCode SCT_RodDecoder::fillCollection(const OFFLINE_FRAGMENTS_NAMESPACE::ROB
bool hasError{false};
if (((data16[n]>>13) & 0x7) == 0x1) { // Header
bool breakNow{false};
ATH_CHECK(processHeader(data16[n], robID, data, rdoIDCont, cache, errs, hasError, breakNow));
ATH_CHECK(processHeader(data16[n], robID, data, rdoIDCont, cache, errs, hasError, breakNow,ctx));
if (hasError) sc = StatusCode::RECOVERABLE;
if (breakNow) break;
continue;
......@@ -630,7 +631,8 @@ StatusCode SCT_RodDecoder::processHeader(const uint16_t inData,
CacheHelper& cache,
SCT_RodDecoderErrorsHelper& errs,
bool& hasError,
bool& breakNow) const
bool& breakNow,
const EventContext& ctx) const
{
StatusCode sc{StatusCode::SUCCESS, true};
......@@ -668,7 +670,7 @@ StatusCode SCT_RodDecoder::processHeader(const uint16_t inData,
return sc;
}
else {
data.setCollection(m_sctID, m_cabling->getHashFromOnlineId(onlineID), rdoIDCont, errs);
data.setCollection(m_sctID, m_cabling->getHashFromOnlineId(onlineID, ctx), rdoIDCont, errs);
}
// Look for masked off links - bit 7
if ((inData >> 7) & 0x1) {
......
......@@ -108,6 +108,7 @@ class SCT_RodDecoder : public extends<AthAlgTool, ISCT_RodDecoder>
virtual StatusCode fillCollection(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment& robFrag,
SCT_RDO_Container& rdoIDCont,
IDCInDetBSErrContainer& errs,
const EventContext& ctx,
const std::vector<IdentifierHash>* vecHash = nullptr) const override;
private:
......@@ -275,7 +276,8 @@ class SCT_RodDecoder : public extends<AthAlgTool, ISCT_RodDecoder>
CacheHelper& cache,
SCT_RodDecoderErrorsHelper& errs,
bool& hasError,
bool& breakNow) const;
bool& breakNow,
const EventContext& ctx) const;
/**
* @brief Process hit word in Super-Condensed mode
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
/////////////////////////////////////////////////////////////////////////////////
......@@ -69,7 +69,8 @@ namespace InDet {
( std::list<Amg::Vector3D>& globalPositions,
std::list<const InDetDD::SiDetectorElement*>& Road,
bool testDirection,
InDet::SiDetElementRoadMakerData_xk & roadMakerData) const=0;
InDet::SiDetElementRoadMakerData_xk & roadMakerData,
const EventContext& ctx) const=0;
/// This is the signature used in most ATLAS clients.
/// @param[in] ctx: Event context
......
......@@ -95,7 +95,8 @@ namespace InDet{
(std::list<Amg::Vector3D>& globalPositions,
std::list<const InDetDD::SiDetectorElement*>& Road,
bool testDirection,
SiDetElementRoadMakerData_xk & roadMakerData) const override;
SiDetElementRoadMakerData_xk & roadMakerData,
const EventContext& ctx) const override;
/// This is the signature used in most ATLAS clients.
......@@ -176,8 +177,8 @@ namespace InDet{
MsgStream& dumpConditions(MsgStream& out) const;
inline
const SiDetElementsLayerVectors_xk *getLayers() const {
SG::ReadCondHandle<SiDetElementsLayerVectors_xk> layerVec(m_layerVecKey);
const SiDetElementsLayerVectors_xk *getLayers(const EventContext& ctx) const {
SG::ReadCondHandle<SiDetElementsLayerVectors_xk> layerVec(m_layerVecKey,ctx);
if (not layerVec.isValid()) {
ATH_MSG_ERROR("Failed to get " << m_layerVecKey.key());
}
......
......@@ -140,7 +140,9 @@ MsgStream& InDet::SiDetElementsRoadMaker_xk::dumpConditions(MsgStream& out) cons
for (int i=0; i<n; ++i) s6.append(" ");
s6.append("|");
const SiDetElementsLayerVectors_xk &layer = *getLayers();
const EventContext& ctx = Gaudi::Hive::currentContext();
const SiDetElementsLayerVectors_xk &layer = *getLayers(ctx);
int maps = 0;
if (layer[0].size()) ++maps;
......@@ -303,7 +305,8 @@ void InDet::SiDetElementsRoadMaker_xk::detElementsRoad
(std::list<Amg::Vector3D>& globalPositions,
std::list<const InDetDD::SiDetectorElement*>& Road,
bool testDirection,
SiDetElementRoadMakerData_xk & roadMakerData) const
SiDetElementRoadMakerData_xk & roadMakerData,
const EventContext& ctx) const
{
if (!m_usePIX && !m_useSCT) return;
......@@ -318,7 +321,7 @@ void InDet::SiDetElementsRoadMaker_xk::detElementsRoad
/// for same r in phi.
/// For the barrel, we first sort in R, then for same R in phi, then for same
/// phi in Z.
const SiDetElementsLayerVectors_xk &layer = *getLayers();
const SiDetElementsLayerVectors_xk &layer = *getLayers(ctx);
/// iterators over the positions to consider
std::list<Amg::Vector3D>::iterator currentPosition=globalPositions.begin(), endPositions=globalPositions.end();
......@@ -583,7 +586,7 @@ void InDet::SiDetElementsRoadMaker_xk::detElementsRoad
}
}
/// now perform the road building using our set of positions
detElementsRoad(G, Road,testDirection, roadMakerData);
detElementsRoad(G, Road,testDirection, roadMakerData,ctx);
}
......
......@@ -177,7 +177,8 @@ namespace InDet {
// ask SCTRawDataProviderTool to decode it and to fill the IDC
StatusCode scon = StatusCode::FAILURE;
if (m_container){
scon = m_rawDataTool->convert(listOfRobf,*m_container,*m_bsErrCont);
auto ctx = Gaudi::Hive::currentContext();
scon = m_rawDataTool->convert(listOfRobf,*m_container,*m_bsErrCont,ctx);
if (scon==StatusCode::FAILURE)
msg(MSG::ERROR) << "BS conversion into RDOs failed" << endmsg;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment