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