ATLAS Offline Software
TGCTriggerCondAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "TGCTriggerCondAlg.h"
9 
10 
11 TGCTriggerCondAlg::TGCTriggerCondAlg(const std::string& name, ISvcLocator* pSvcLocator) :
12  AthAlgorithm(name, pSvcLocator)
13 {
14 }
15 
17 
18  ATH_MSG_INFO( "initialize " << name() );
19 
22 
23  return StatusCode::SUCCESS;
24 }
25 
27 
28  ATH_MSG_DEBUG( "start execute " << name() );
29 
31  if (writeHandle.isValid()) {
32  ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid."
33  << ". In theory this should not be called, but may happen"
34  << " if multiple concurrent events are being processed out of order.");
35  return StatusCode::SUCCESS;
36  }
37 
38  auto writeCdo = std::make_unique<TGCTriggerLUTs>();
39 
40  // Big wheel for Run3
42  const CondAttrListCollection* readCdo_bw(*readHandle_bw);
43 
44 
45  if (readCdo_bw == 0) {
46  ATH_MSG_ERROR("Null pointer to the read conditions object");
47  return StatusCode::FAILURE;
48  }
49 
50  ATH_MSG_INFO("Size of CondAttrListCollection " << readHandle_bw.fullKey() << " readCdo->size()= " << readCdo_bw->size());
51 
52  EventIDRange rangeW_bw;
53  if ( !readHandle_bw.range(rangeW_bw) ) {
54  ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandle_bw.key());
55  return StatusCode::FAILURE;
56  }
57  ATH_MSG_INFO("Range of input is " << rangeW_bw);
58 
59  //LUT loader will be implemented.
60 
61  if (writeHandle.record(rangeW_bw, std::move(writeCdo)).isFailure()) {
62  ATH_MSG_FATAL("Could not record TGCTriggerLUTs " << writeHandle.key()
63  << " with EventRange " << rangeW_bw
64  << " into Conditions Store");
65  return StatusCode::FAILURE;
66  }
67 
68 
69 
70 
71  return StatusCode::SUCCESS;
72 }
73 
TGCTriggerCondAlg::m_readKey_bw
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_bw
Definition: TGCTriggerCondAlg.h:26
TGCTriggerCondAlg::TGCTriggerCondAlg
TGCTriggerCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TGCTriggerCondAlg.cxx:11
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
SG::ReadCondHandle::fullKey
const DataObjID & fullKey() const
Definition: ReadCondHandle.h:60
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:224
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:16
ReadCondHandle.h
TGCTriggerCondAlg.h
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
TGCTriggerCondAlg::execute
virtual StatusCode execute() override
Definition: TGCTriggerCondAlg.cxx:26
AthAlgorithm
Definition: AthAlgorithm.h:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
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:27
SG::ReadCondHandle::key
const std::string & key() const
Definition: ReadCondHandle.h:59
SG::WriteCondHandle
Definition: WriteCondHandle.h:26