ATLAS Offline Software
SiDetElementBoundaryLinksCondAlg_xk.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
11 
12 namespace InDet {
13 
15  : ::AthReentrantAlgorithm(name, pSvcLocator)
16 {
17 }
18 
20  {
21  ATH_MSG_DEBUG("initialize " << name());
22 
23  // Read Handle
25 
26  // Write Handle
28 
29  return StatusCode::SUCCESS;
30  }
31 
33  {
34  ATH_MSG_DEBUG("execute " << name());
35 
36  // ____________ Construct Write Cond Handle and check its validity ____________
38 
39  // Do we have a valid Write Cond Handle for current time?
40  if (writeHandle.isValid()) {
41  ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid."
42  << ". In theory this should not be called, but may happen"
43  << " if multiple concurrent events are being processed out of order.");
44  return StatusCode::SUCCESS;
45  }
46 
47  // ____________ Get Read Cond Object ____________
49  const InDetDD::SiDetectorElementCollection* readCdo{*readHandle};
50  if (readCdo==nullptr) {
51  ATH_MSG_FATAL("Null pointer to the read conditions object of " << m_readKey.key());
52  return StatusCode::FAILURE;
53  }
54 
55  // Add dependency
56  writeHandle.addDependency(readHandle);
57 
58  // ____________ Construct new Write Cond Object ____________
59  // Copied from
60  // InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx
61  std::unique_ptr<InDet::SiDetElementBoundaryLinks_xk> writeCdo{std::make_unique<InDet::SiDetElementBoundaryLinks_xk>()};
62  // ____________ Fill writeCdo using readCdo ____________
63  for (const InDetDD::SiDetectorElement* newEl: *readCdo) {
65  writeCdo->push_back(dl);
66  }
67 
68  // Record WriteCondHandle
69  if (writeHandle.record(std::move(writeCdo)).isFailure()) {
70  ATH_MSG_FATAL("Could not record " << writeHandle.key()
71  << " with EventRange " << writeHandle.getRange()
72  << " into Conditions Store");
73  return StatusCode::FAILURE;
74  }
75  ATH_MSG_DEBUG("recorded new CDO " << writeHandle.key() << " with range " << writeHandle.getRange() << " into ConditionStore");
76 
77  return StatusCode::SUCCESS;
78  }
79 
81  {
82  ATH_MSG_DEBUG("finalize " << name());
83 
84  return StatusCode::SUCCESS;
85  }
86 
87 }
InDet::SiDetElementBoundaryLinksCondAlg_xk::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: SiDetElementBoundaryLinksCondAlg_xk.cxx:32
InDet::SiDetElementBoundaryLinksCondAlg_xk::SiDetElementBoundaryLinksCondAlg_xk
SiDetElementBoundaryLinksCondAlg_xk(const std::string &name, ISvcLocator *pSvcLocator)
Definition: SiDetElementBoundaryLinksCondAlg_xk.cxx:14
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
TestSUSYToolsAlg.dl
dl
Definition: TestSUSYToolsAlg.py:83
InDet::SiDetElementBoundaryLinksCondAlg_xk::initialize
virtual StatusCode initialize() override
Definition: SiDetElementBoundaryLinksCondAlg_xk.cxx:19
InDetDD::SiDetectorElementCollection
Definition: SiDetectorElementCollection.h:30
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
InDet
DUMMY Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
InDet::SiDetElementBoundaryLinksCondAlg_xk::m_writeKey
SG::WriteCondHandleKey< InDet::SiDetElementBoundaryLinks_xk > m_writeKey
Output condition object for SiCombinatorialTrackFinder_xk.
Definition: SiDetElementBoundaryLinksCondAlg_xk.h:42
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
ReadCondHandle.h
SiDetElementBoundaryLinksCondAlg_xk.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
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
InDet::SiDetElementBoundaryLinksCondAlg_xk::m_readKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_readKey
Input condition object, detector elements of Pixel or SCT in condition store.
Definition: SiDetElementBoundaryLinksCondAlg_xk.h:40
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
SiDetectorElement.h
InDet::SiDetElementBoundaryLinksCondAlg_xk::m_ITkGeometry
BooleanProperty m_ITkGeometry
Definition: SiDetElementBoundaryLinksCondAlg_xk.h:43
InDet::SiDetElementBoundaryLinksCondAlg_xk::finalize
virtual StatusCode finalize() override
Definition: SiDetElementBoundaryLinksCondAlg_xk.cxx:80
SG::WriteCondHandle
Definition: WriteCondHandle.h:26