ATLAS Offline Software
EndOfEventROIConfirmerAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
7 
8 
9 EndOfEventROIConfirmerAlg::EndOfEventROIConfirmerAlg(const std::string& name, ISvcLocator* pSvcLocator)
10  : AthReentrantAlgorithm(name, pSvcLocator) {}
11 
12 
14  ATH_MSG_DEBUG( "EndOfEventROIConfirmerAlg::initialize()" );
15  ATH_CHECK( m_writeHandleKeyArray_ROIs.initialize() );
16  return StatusCode::SUCCESS;
17 }
18 
19 
20 StatusCode EndOfEventROIConfirmerAlg::execute(const EventContext& context) const {
21  ATH_MSG_DEBUG( "EndOfEventROIConfirmerAlg::execute()" );
22 
23  for (const auto& whk : m_writeHandleKeyArray_ROIs) {
24  SG::ReadHandle<TrigRoiDescriptorCollection> readHandle( whk.key() );
25  if ( readHandle.isValid() ) {
26  ATH_MSG_DEBUG( "The " << whk.key() << " already present - this chain must have run as part of the trigger in this event" );
27  } else {
28  ATH_MSG_DEBUG( "The " << whk.key() << " is not here - we should create it such that we can run algorithms at the end of the HLT-accepted event" );
29 
30  auto handle = SG::makeHandle(whk, context);
31  auto objp = std::make_unique<TrigRoiDescriptorCollection> (TrigRoiDescriptorCollection());
32  ATH_CHECK( handle.record (std::move (objp)) );
33  handle->push_back(new TrigRoiDescriptor(true));
34  }
35  }
36  return StatusCode::SUCCESS;
37 }
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
EndOfEventROIConfirmerAlg::EndOfEventROIConfirmerAlg
EndOfEventROIConfirmerAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: EndOfEventROIConfirmerAlg.cxx:9
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
EndOfEventROIConfirmerAlg.h
EndOfEventROIConfirmerAlg::m_writeHandleKeyArray_ROIs
SG::WriteHandleKeyArray< TrigRoiDescriptorCollection > m_writeHandleKeyArray_ROIs
Definition: EndOfEventROIConfirmerAlg.h:26
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TrigRoiDescriptorCollection
Athena::TPCnvVers::Current Athena::TPCnvVers::Old TrigRoiDescriptorCollection
Definition: TrigSteeringEventTPCnv.cxx:78
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
EndOfEventROIConfirmerAlg::initialize
virtual StatusCode initialize() override
Definition: EndOfEventROIConfirmerAlg.cxx:13
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
EndOfEventROIConfirmerAlg::execute
virtual StatusCode execute(const EventContext &context) const override
Definition: EndOfEventROIConfirmerAlg.cxx:20
TrigRoiDescriptor
Athena::TPCnvVers::Current TrigRoiDescriptor
Definition: TrigSteeringEventTPCnv.cxx:68