25#include "Identifier/Identifier.h"
33#include "GaudiKernel/EventIDRange.h"
54 return StatusCode::FAILURE;
64 return StatusCode::SUCCESS;
75 <<
". In theory this should not be called, but may happen"
76 <<
" if multiple concurrent events are being processed out of order.");
77 return StatusCode::SUCCESS;
81 std::unique_ptr<ITkPixelCablingData> pCabling = std::make_unique<ITkPixelCablingData>();
91 ATH_MSG_DEBUG(
"Using test cabling generated with ITkPixelCablingAlg::generateTestCabling(...)");
95 return StatusCode::FAILURE;
98 return StatusCode::SUCCESS;
103 auto inputFile = std::ifstream(
m_source.value());
104 if (not inputFile.good()){
106 return StatusCode::FAILURE;
110 inputFile>>*pCabling;
111 const int numEntries = pCabling->size();
112 ATH_MSG_DEBUG(numEntries <<
" entries were made to the identifier map.");
115 const EventIDBase start{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, 0, 0, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM};
116 const EventIDBase stop{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM};
117 const EventIDRange rangeW{start, stop};
118 if (writeHandle.
record(rangeW, std::move(pCabling)).isFailure()) {
120 <<
" with EventRange " << rangeW
121 <<
" into Conditions Store");
122 return StatusCode::FAILURE;
124 ATH_MSG_VERBOSE(
"recorded new conditions data object " << writeHandle.
key() <<
" with range " << rangeW <<
" into Conditions Store");
125 return (numEntries==0) ? (StatusCode::FAILURE) : (StatusCode::SUCCESS);
135 for (
size_t hash = 0; hash <
m_idHelper->wafer_hash_max(); hash++){
137 uint32_t onID = (
id.get_compact() >> 32) & 0xFFFFFFFF;
191 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
Fills an ITkPixelCablingData object and records it in Storegate.
This is an Identifier helper class for the Pixel subdetector.
const ServiceHandle< StoreGateSvc > & detStore() const
An algorithm that can be simultaneously executed in multiple threads.
static EventIDRange infiniteRunLB()
Produces an EventIDRange that is infinite in RunLumi and invalid in Time.
SG::WriteCondHandleKey< ITkPixelCablingData > m_writeKey
virtual StatusCode initialize() override
virtual StatusCode execute(const EventContext &ctx) const override
const InDetDD::PixelDetectorManager * m_detManager
const PixelID * m_idHelper
StatusCode generateTestCabling(std::unique_ptr< ITkPixelCablingData > &cabling) const
ITkPixelCablingAlg(const std::string &name, ISvcLocator *svc)
Gaudi::Property< bool > m_useTestCabling
Class used to describe the design of a module (diode segmentation and readout scheme)
int numberOfCircuits() const
Total number of circuits:
Class to hold geometrical description of a silicon detector element.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)
const std::string & key() const
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
const DataObjID & fullKey() const
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())