Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
SiElementPropertiesTableCondAlg.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 
9 
10 #include <memory>
11 
12 namespace InDet {
13 
14  SiElementPropertiesTableCondAlg::SiElementPropertiesTableCondAlg(const std::string& name, ISvcLocator* pSvcLocator)
15  : ::AthReentrantAlgorithm(name, pSvcLocator)
16 {
17 }
18 
20  {
21  // Read Handle
23 
24  // Write Handle
26 
27  ATH_CHECK(detStore()->retrieve(m_idHelper, "SCT_ID"));
28 
30  ATH_MSG_INFO("Processing eta neighbour module also for strip endcaps");
31  }
32 
33  return StatusCode::SUCCESS;
34  }
35 
37  {
38  ATH_MSG_DEBUG("execute " << name());
39 
40  // ____________ Construct Write Cond Handle and check its validity ____________
42 
43  // Do we have a valid Write Cond Handle for current time?
44  if (writeHandle.isValid()) {
45  ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid."
46  << ". In theory this should not be called, but may happen"
47  << " if multiple concurrent events are being processed out of order.");
48  return StatusCode::SUCCESS;
49  }
50 
51  // ____________ Get Read Cond Object ____________
53  const InDetDD::SiDetectorElementCollection* readCdo{*readHandle};
54  if (readCdo==nullptr) {
55  ATH_MSG_FATAL("Null pointer to the read conditions object of " << m_readKey.key());
56  return StatusCode::FAILURE;
57  }
58 
59  // Add dependency
60  writeHandle.addDependency(readHandle);
61 
62  // ____________ Construct new Write Cond Object ____________
63  std::unique_ptr<InDet::SiElementPropertiesTable> writeCdo{std::make_unique<InDet::SiElementPropertiesTable>(*m_idHelper, *readCdo, m_epsWidth, m_doEndcapEtaNeighbour)};
64 
65  // ____________ Fill writeCdo using readCdo ____________
66 
67  // Record WriteCondHandle
68  if (writeHandle.record(std::move(writeCdo)).isFailure()) {
69  ATH_MSG_FATAL("Could not record " << writeHandle.key()
70  << " with EventRange " << writeHandle.getRange()
71  << " into Conditions Store");
72  return StatusCode::FAILURE;
73  }
74  ATH_MSG_DEBUG("recorded new CDO " << writeHandle.key() << " with range " << writeHandle.getRange() << " into ConditionStore");
75 
76  return StatusCode::SUCCESS;
77  }
78 
80  {
81  return StatusCode::SUCCESS;
82  }
83 
84 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
InDet::SiElementPropertiesTableCondAlg::m_writeKey
SG::WriteCondHandleKey< InDet::SiElementPropertiesTable > m_writeKey
Definition: SiElementPropertiesTableCondAlg.h:56
InDet::SiElementPropertiesTableCondAlg::m_idHelper
const SCT_ID * m_idHelper
Definition: SiElementPropertiesTableCondAlg.h:71
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
InDet::SiElementPropertiesTableCondAlg::m_epsWidth
FloatProperty m_epsWidth
Definition: SiElementPropertiesTableCondAlg.h:63
InDetDD::SiDetectorElementCollection
Definition: SiDetectorElementCollection.h:30
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
InDet::SiElementPropertiesTableCondAlg::m_doEndcapEtaNeighbour
BooleanProperty m_doEndcapEtaNeighbour
Definition: SiElementPropertiesTableCondAlg.h:64
SiElementPropertiesTableCondAlg.h
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
InDet::SiElementPropertiesTableCondAlg::initialize
virtual StatusCode initialize() override final
Definition: SiElementPropertiesTableCondAlg.cxx:19
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:74
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
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
InDet::SiElementPropertiesTableCondAlg::SiElementPropertiesTableCondAlg
SiElementPropertiesTableCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: SiElementPropertiesTableCondAlg.cxx:14
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
InDet::SiElementPropertiesTableCondAlg::finalize
virtual StatusCode finalize() override final
Definition: SiElementPropertiesTableCondAlg.cxx:79
SiDetectorElement.h
InDet::SiElementPropertiesTableCondAlg::m_readKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_readKey
Definition: SiElementPropertiesTableCondAlg.h:49
InDet::SiElementPropertiesTableCondAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition: SiElementPropertiesTableCondAlg.cxx:36
SG::WriteCondHandle
Definition: WriteCondHandle.h:26