17#include "GaudiKernel/EventIDRange.h"
24#include "eformat/SourceIdentifier.h"
31#include "CaloDetDescr/CaloDetDescrElement.h"
56 return StatusCode::SUCCESS;
77 return StatusCode::SUCCESS;
83 return StatusCode::FAILURE;
86 EventIDRange id_range;
88 if( !hid2RESrcID.
range( id_range ) ) {
89 ATH_MSG_ERROR(
"Failed to retrieve validity range for " << hid2RESrcID.
key());
90 return StatusCode::FAILURE;
98 std::unique_ptr<IRegSelLUT> rd =
createTable(*hid2RESrcID);
100 if ( !rd )
return StatusCode::FAILURE;
113 if( lutCondData.
record( id_range, rcd ).isFailure() ) {
115 <<
" " << lutCondData.
key()
116 <<
" with range " << id_range );
117 return StatusCode::FAILURE;
123 return StatusCode::FAILURE;
129 return StatusCode::SUCCESS;
137 std::unique_ptr<RegSelectorMap> lut(
nullptr);
145 if (
detStore()->retrieve(tileID,
"TileID").isFailure()) {
152 if (
detStore()->retrieve(tileHWID,
"TileHWID").isFailure()) {
159 if (
detStore()->retrieve(tileMgr).isFailure()) {
160 ATH_MSG_ERROR(
"Unable to retrieve TileDetDescrManager from DetectorStore" );
164 std::unique_ptr<RegionSelectorLUT> ttLut = std::make_unique<RegionSelectorLUT>(256);
166 enum Partition { Ancillary = 0, LBA = 1, LBC = 2, EBA = 3, EBC = 4 };
175 etamin[EBA]=+0.708779;
176 etamin[EBC]=-1.60943;
180 etamax[EBA]=+1.60943;
181 etamax[EBC]=-0.708779;
186# if (defined USE_MODULE_PHI)
198 if (hash<0)
continue;
200 int coll = tileHWID->
frag(ros, drawer);
203 double etami = etamin[ros];
204 double etama = etamax[ros];
206# if (defined USE_MODULE_PHI)
214 if ( phimin < 0.0 ) {
216 if ( phimax < phimin ) phimax+=2*
M_PI;
220 double phimin = drawer * dphi;
221 double phimax = (drawer+1) * dphi;
224 ttLut->additem(etami,etama,phimin,phimax,sam,layer,hash,rod);
236 lut = std::make_unique<RegSelectorMap>();
237 lut->addLut( ttLut.get() );
238 lut->mountDataStruct();
#define ATH_CHECK
Evaluate an expression and check for errors.
RegSelCondData< IRegSelLUT > IRegSelLUTCondData
emacs: this is -*- c++ -*-
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
Base class for conditions algorithms.
This is a base class for LAr and Tile Descriptors The primary goal is to speed up loops over all the ...
double calo_phi_max() const
'ideal' geometry: phi maximal
double calo_phi_min() const
'ideal' geometry: phi minimal
virtual StatusCode execute(const EventContext &ctx) const override
virtual std::unique_ptr< RegSelectorMap > createTable(const TileHid2RESrcID *hid2re) const
SG::ReadCondHandleKey< TileHid2RESrcID > m_hid2RESrcIDKey
std::string m_managerName
SG::WriteCondHandleKey< IRegSelLUTCondData > m_tableKey
Output conditions object.
RegSelCondAlg_Tile(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize() override
bool range(EventIDRange &r)
const std::string & key() const
const std::string & key() const
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
const DataObjID & fullKey() const
static const unsigned int MAX_ROS
Number of ROSs.
static const unsigned int MAX_DRAWER
Number of drawers in ROS 1-4.
CaloDetDescriptor * get_module_element(const IdentifierHash module_hash) const
Helper class for TileCal online (hardware) identifiers.
int frag(const HWIdentifier &id) const
extract frag field from HW identifier
int drawerIdx(const HWIdentifier &id) const
construct drawer index from HW identifier
HWIdentifier drawer_id(int frag) const
ROS HWIdentifer.
This class provides conversion between fragment ID and RESrcID.
uint32_t getRodID(int frag_id) const
make a ROD SrcID for a fragment ID
Helper class for TileCal offline identifiers.
Identifier module_id(int section, int side, int module) const