ATLAS Offline Software
TGCTriggerCondAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "TGCTriggerCondAlg.h"
9 
10 
12 
13  ATH_MSG_INFO( "initialize " << name() );
14 
17 
18  return StatusCode::SUCCESS;
19 }
20 
21 StatusCode TGCTriggerCondAlg::execute(const EventContext& ctx) const {
22 
23  ATH_MSG_DEBUG( "start execute " << name() );
24 
26  if (writeHandle.isValid()) {
27  ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid."
28  << ". In theory this should not be called, but may happen"
29  << " if multiple concurrent events are being processed out of order.");
30  return StatusCode::SUCCESS;
31  }
32 
33  auto writeCdo = std::make_unique<TGCTriggerLUTs>();
34 
35  // Big wheel for Run3
37  const CondAttrListCollection* readCdo_bw(*readHandle_bw);
38 
39 
40  if (readCdo_bw == 0) {
41  ATH_MSG_ERROR("Null pointer to the read conditions object");
42  return StatusCode::FAILURE;
43  }
44 
45  ATH_MSG_INFO("Size of CondAttrListCollection " << readHandle_bw.fullKey() << " readCdo->size()= " << readCdo_bw->size());
46 
47  EventIDRange rangeW_bw;
48  if ( !readHandle_bw.range(rangeW_bw) ) {
49  ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandle_bw.key());
50  return StatusCode::FAILURE;
51  }
52  ATH_MSG_INFO("Range of input is " << rangeW_bw);
53 
54  //LUT loader will be implemented.
55 
56  if (writeHandle.record(rangeW_bw, std::move(writeCdo)).isFailure()) {
57  ATH_MSG_FATAL("Could not record TGCTriggerLUTs " << writeHandle.key()
58  << " with EventRange " << rangeW_bw
59  << " into Conditions Store");
60  return StatusCode::FAILURE;
61  }
62 
63  return StatusCode::SUCCESS;
64 }
65 
TGCTriggerCondAlg::m_readKey_bw
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_bw
Definition: TGCTriggerCondAlg.h:27
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
SG::ReadCondHandle::fullKey
const DataObjID & fullKey() const
Definition: ReadCondHandle.h:64
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadCondHandle::range
bool range(EventIDRange &r)
Definition: ReadCondHandle.h:228
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number....
Definition: CondAttrListCollection.h:52
TGCTriggerCondAlg::initialize
virtual StatusCode initialize() override
Definition: TGCTriggerCondAlg.cxx:11
ReadCondHandle.h
TGCTriggerCondAlg.h
TGCTriggerCondAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: TGCTriggerCondAlg.cxx:21
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
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
WriteCondHandle.h
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CondAttrListCollection::size
size_type size() const
number of Chan/AttributeList pairs
Definition: CondAttrListCollection.h:322
TGCTriggerCondAlg::m_writeKey
SG::WriteCondHandleKey< TGCTriggerLUTs > m_writeKey
Definition: TGCTriggerCondAlg.h:28
SG::ReadCondHandle::key
const std::string & key() const
Definition: ReadCondHandle.h:63
SG::WriteCondHandle
Definition: WriteCondHandle.h:26