ATLAS Offline Software
Classes | Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
MuonGMR4::RpcReadoutGeomTool Class Reference

#include <RpcReadoutGeomTool.h>

Inheritance diagram for MuonGMR4::RpcReadoutGeomTool:
Collaboration diagram for MuonGMR4::RpcReadoutGeomTool:

Classes

struct  FactoryCache
 
struct  wRPCTable
 Struct to cache the relevant parameters of from the WRPC tables. More...
 

Public Types

using physNodeMap = std::map< std::string, GeoFullPhysVol * >
 

Public Member Functions

 RpcReadoutGeomTool (const std::string &type, const std::string &name, const IInterface *parent)
 
StatusCode buildReadOutElements (MuonDetectorManager &mgr) override final
 Retrieves the GeoModel from the GeoModelSvc and append the ReadoutElements of the Given MuonDetectorTechnology to the MuonDetectorManager. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 
 DeclareInterfaceID (IMuonReadoutGeomTool, 1, 0)
 Gaudi interface ID. More...
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

StatusCode readParameterBook (FactoryCache &cache)
 Retrieves the auxillary tables from the database. More...
 
StatusCode loadDimensions (RpcReadoutElement::defineArgs &args, FactoryCache &factory)
 Loads the chamber dimensions from GeoModel. More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc
 
ServiceHandle< IGeoDbTagSvcm_geoDbTagSvc {this, "GeoDbTagSvc", "GeoDbTagSvc"}
 
PublicToolHandle< IMuonGeoUtilityToolm_geoUtilTool {this,"GeoUtilTool", "" }
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 19 of file RpcReadoutGeomTool.h.

Member Typedef Documentation

◆ physNodeMap

using MuonGMR4::IMuonReadoutGeomTool::physNodeMap = std::map<std::string, GeoFullPhysVol*>
inherited

Definition at line 25 of file IMuonReaoutGeomTool.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ RpcReadoutGeomTool()

MuonGMR4::RpcReadoutGeomTool::RpcReadoutGeomTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 56 of file RpcReadoutGeomTool.cxx.

59  : AthAlgTool{type, name, parent} {
60  declareInterface<IMuonReadoutGeomTool>(this);
61 
62 }

Member Function Documentation

◆ buildReadOutElements()

StatusCode MuonGMR4::RpcReadoutGeomTool::buildReadOutElements ( MuonDetectorManager mgr)
finaloverridevirtual

Retrieves the GeoModel from the GeoModelSvc and append the ReadoutElements of the Given MuonDetectorTechnology to the MuonDetectorManager.

Retrieve the list of full physical volumes & alignable nodes and connect them together afterwards

The keys should be formatted like <STATION_NAME>_<MUON_CHAMBERTYPE>_etc. The <MUON_CHAMBERTYPE> also indicates whether we're dealing with a MDT / TGC / CSC / RPC chamber If we are dealing with a MDT chamber, then there are 3 additional properties encoded into the chamber <STATIONETA>_<STATIONPHI>_<DOUBLETR>_<DOUBLETPHI>_<DOUBLETZ>

Retrieve first the station Identifier

stationEta

stationPhi

DoubletR

DoubletZ

DoubletPhi

Implements MuonGMR4::IMuonReadoutGeomTool.

Definition at line 217 of file RpcReadoutGeomTool.cxx.

217  {
218  GeoModelIO::ReadGeoModel* sqliteReader = m_geoDbTagSvc->getSqliteReader();
219  if (!sqliteReader) {
220  ATH_MSG_FATAL("Error, the tool works exclusively from sqlite geometry inputs");
221  return StatusCode::FAILURE;
222  }
223 
224  FactoryCache facCache{};
225  ATH_CHECK(readParameterBook(facCache));
226 
227  const RpcIdHelper& idHelper{m_idHelperSvc->rpcIdHelper()};
228  // Get the list of full phys volumes from SQLite, and create detector elements
229 
231  physNodeMap mapFPV = sqliteReader->getPublishedNodes<std::string, GeoFullPhysVol*>("Muon");
232 #ifndef SIMULATIONBASE
233  SurfaceBoundSetPtr<Acts::RectangleBounds> layerBounds = std::make_shared<SurfaceBoundSet<Acts::RectangleBounds>>();
234 #endif
235  for (auto& [key, pv] : mapFPV) {
242  std::vector<std::string> key_tokens = tokenize(key, "_");
243  if (key_tokens.size() < 7 ||
244  key_tokens[1].find("RPC") == std::string::npos) {
245  continue;
246  }
247  bool isValid{false};
249  const Identifier elementID = idHelper.padID(idHelper.stationNameIndex(key_tokens[0].substr(0, 3)),
250  atoi(key_tokens[2]),
251  atoi(key_tokens[3]),
252  atoi(key_tokens[4]),
253  atoi(key_tokens[6]),
254  atoi(key_tokens[5]),
255  isValid);
256  if (!isValid) {
257  ATH_MSG_FATAL("Failed to construct the station Identifier from "<<key);
258  return StatusCode::FAILURE;
259  }
260  defineArgs define{};
261  define.physVol = pv;
262  define.chambDesign = key_tokens[1];
263  define.alignTransform = m_geoUtilTool->findAlignableTransform(define.physVol);
264  define.detElId = elementID;
265  ATH_MSG_VERBOSE("Key "<<key<<" lead to Identifier "<<m_idHelperSvc->toStringDetEl(elementID));
266  ATH_CHECK(loadDimensions(define, facCache));
267 #ifndef SIMULATIONBASE
268  define.layerBounds = layerBounds;
269 #endif
270  std::unique_ptr<RpcReadoutElement> readoutEle = std::make_unique<RpcReadoutElement>(std::move(define));
271  ATH_CHECK(mgr.addRpcReadoutElement(std::move(readoutEle)));
272  }
273  return StatusCode::SUCCESS;
274 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ DeclareInterfaceID()

MuonGMR4::IMuonReadoutGeomTool::DeclareInterfaceID ( IMuonReadoutGeomTool  ,
,
 
)
inherited

Gaudi interface ID.

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ loadDimensions()

StatusCode MuonGMR4::RpcReadoutGeomTool::loadDimensions ( RpcReadoutElement::defineArgs args,
FactoryCache factory 
)
private

Loads the chamber dimensions from GeoModel.

The half sizes of the

Rpc are made up out of 2 or 3 gasGap singlet. A singlet module is a RPC gas gap sandwiched by two strip layers. In large sectors, the gas gap may be split into two gasGaps.

    | Strip layer  |  Strip layer |    |  Strip layer  |  Strip layer |
    |           gas gap           |    |    Gas gap    |    Gas gap   | 
    | Strip layer  |  Strip layer |    |  Strip layer  |  Strip layer |

In the GeoModel world, the x-axis points in radial direction & y axis along the phi direction

The strip layers are used to express the dimensions of the strip layer. However, that's projected into the Center of the gasgap which may or maybe not be split into two --> Find the closest gas gap in x for each strip layer and overwrite the x coordinate of the strip layerof that one.

Find the closest gas Gap

Now we need to associate the gasGap volumes with the gas gap number & the doublet Phi

The volume points to a new gasgap

Rpc volumes with doubletZ = 3 have two gas gaps along phi but they're split into two distnict modules with doublePhi = 1, 2.

We know now whether we had 2 or 3 gasgaps and also whether there 2 or 1 panels in phi

Special case for the BML4 DBZ = 3 chambers. The doubletPhi is incorporated into the detector element but there's only one strip panel

Define the strip layout

Define the box layout

Next build the phi layer

Definition at line 63 of file RpcReadoutGeomTool.cxx.

64  {
65 
66  ATH_MSG_VERBOSE("Load dimensions of "<<m_idHelperSvc->toString(define.detElId)
67  <<std::endl<<std::endl<<m_geoUtilTool->dumpVolume(define.physVol));
68 
69  const GeoShape* shape = m_geoUtilTool->extractShape(define.physVol);
70  if (!shape) {
71  ATH_MSG_FATAL("Failed to deduce a valid shape for "<<m_idHelperSvc->toString(define.detElId));
72  return StatusCode::FAILURE;
73  }
74  ATH_MSG_DEBUG("Extracted shape "<<m_geoUtilTool->dumpShape(shape));
76  if (shape->typeID() != GeoBox::getClassTypeID()) {
77  ATH_MSG_FATAL(__FILE__<<":"<<__LINE__<<" expect shape to be a box but it's "<<m_geoUtilTool->dumpShape(shape));
78  return StatusCode::FAILURE;
79  }
80 
81  const GeoBox* box = static_cast<const GeoBox*>(shape);
82  define.halfThickness = box->getXHalfLength() * Gaudi::Units::mm;
83  define.halfLength = box->getZHalfLength() * Gaudi::Units::mm;
84  define.halfWidth = box->getYHalfLength() * Gaudi::Units::mm;
85 
95  std::vector<physVolWithTrans> stripLayers = m_geoUtilTool->findAllLeafNodesByName(define.physVol, "bottomStripLayer");
96  if (stripLayers.empty()) {
97  ATH_MSG_FATAL("The volume "<<m_idHelperSvc->toStringDetEl(define.detElId)<<" does not have any childern 'bottomStripLayer'"
98  <<std::endl<<m_geoUtilTool->dumpVolume(define.physVol));
99  return StatusCode::FAILURE;
100  }
101  std::vector<physVolWithTrans> allGasGaps = m_geoUtilTool->findAllLeafNodesByName(define.physVol, "RpcGasGap");
102  if (allGasGaps.empty()) {
103  ATH_MSG_FATAL("The volume "<<m_idHelperSvc->toStringDetEl(define.detElId)<<" does not have any childern 'RpcGasGap'"
104  <<std::endl<<m_geoUtilTool->dumpVolume(define.physVol));
105  return StatusCode::FAILURE;
106  }
108  std::stable_sort(allGasGaps.begin(), allGasGaps.end(), layerSorter);
109  std::stable_sort(stripLayers.begin(),stripLayers.end(), layerSorter);
113  for (physVolWithTrans& stripLayer : stripLayers){
115  const Amg::Vector3D stripTrans = stripLayer.transform.translation();
116  std::vector<physVolWithTrans>::iterator closestGap = std::min_element(allGasGaps.begin(), allGasGaps.end(),
117  [&stripTrans](const physVolWithTrans& a, const physVolWithTrans& b){
118  return std::abs(stripTrans.x() - a.transform.translation().x()) <
119  std::abs(stripTrans.x() - b.transform.translation().x());
120  });
121  stripLayer.transform.translation().x() = closestGap->transform.translation().x();
122  }
123 
126  Amg::Vector3D prevGap{stripLayers[0].transform.translation()};
127  unsigned int gasGap{1}, doubletPhi{0};
128 
129  unsigned int modulePhi = m_idHelperSvc->rpcIdHelper().doubletPhi(define.detElId);
130  std::vector<gapVolume> allGapsWithIdx{};
131  const bool isAside{m_idHelperSvc->stationEta(define.detElId) > 0};
132  for (physVolWithTrans& gapVol : stripLayers) {
133  Amg::Vector3D gCen = gapVol.transform.translation();
135  if (std::abs(gCen.x() - prevGap.x()) > tolerance) {
136  ++gasGap;
137  doubletPhi = 1;
138  } else ++doubletPhi;
139  ATH_MSG_DEBUG("Gas gap at "<<Amg::toString(gCen, 2)<<" is associated with gasGap: "<<gasGap<<", doubletPhi: "<<doubletPhi);
140  prevGap = std::move(gCen);
143  doubletPhi = std::max (doubletPhi, modulePhi);
144  allGapsWithIdx.emplace_back(std::move(gapVol), gasGap, doubletPhi);
145  }
147  define.nGasGaps = gasGap;
150  define.nPanelsInPhi = modulePhi == 2 ? 1 : doubletPhi;
151  FactoryCache::ParamBookTable::const_iterator parBookItr = factoryCache.parameterBook.find(define.chambDesign);
152  if (parBookItr == factoryCache.parameterBook.end()) {
153  ATH_MSG_FATAL("The chamber "<<define.chambDesign<<" is not part of the WRPC table");
154  return StatusCode::FAILURE;
155  }
156  const wRPCTable& paramBook{parBookItr->second};
157 
158  for (gapVolume& gapVol : allGapsWithIdx) {
159  const GeoShape* gapShape = m_geoUtilTool->extractShape(gapVol.volume);
160  if (gapShape->typeID() != GeoBox::getClassTypeID()) {
161  ATH_MSG_FATAL("Failed to extract a geo shape");
162  return StatusCode::FAILURE;
163  }
164  const GeoBox* gapBox = static_cast<const GeoBox*>(gapShape);
165  ATH_MSG_DEBUG("Gas gap dimensions "<<m_geoUtilTool->dumpShape(gapBox));
166  StripDesignPtr etaDesign = std::make_unique<StripDesign>();
168  const double firstStripPosEta = -gapBox->getZHalfLength() + paramBook.firstOffSetEta;
169  etaDesign->defineStripLayout(firstStripPosEta * Amg::Vector2D::UnitX(),
170  paramBook.stripPitchEta,
171  paramBook.stripWidthEta,
172  paramBook.numEtaStrips);
174  etaDesign->defineTrapezoid(gapBox->getYHalfLength(), gapBox->getYHalfLength(), gapBox->getZHalfLength());
175  gapVol.transform = gapVol.transform * Amg::getRotateY3D( (isAside ? -90. : 90.)* Gaudi::Units::degree);
176 
177  etaDesign = (*factoryCache.stripDesigns.emplace(etaDesign).first);
178  const IdentifierHash etaHash {RpcReadoutElement::createHash(0, gapVol.gasGap, gapVol.doubPhi, false)};
179  const unsigned int etaIdx = static_cast<unsigned int>(etaHash);
180  if (etaIdx >= define.layers.size()) {
181  define.layers.resize(etaIdx + 1);
182  }
183 
184  auto etaLayer = std::make_unique<StripLayer>(gapVol.transform, etaDesign, etaHash);
185  define.layers[etaIdx] = (*factoryCache.stripLayers.emplace(std::move(etaLayer)).first);
186 
187  ATH_MSG_VERBOSE("Added new eta gap at "<<(*define.layers[etaIdx]));
188  if (!define.etaDesign) define.etaDesign = etaDesign;
189 
190  if (!paramBook.numPhiStrips) {
191  ATH_MSG_VERBOSE("Rpc readout element without phi strips");
192  continue;
193  }
194  StripDesignPtr phiDesign = std::make_unique<StripDesign>();
195  const double firstStripPosPhi = -gapBox->getYHalfLength() + paramBook.firstOffSetPhi;
196  phiDesign->defineStripLayout(firstStripPosPhi * Amg::Vector2D::UnitX(),
197  paramBook.stripPitchPhi,
198  paramBook.stripWidthPhi,
199  paramBook.numPhiStrips);
200  phiDesign->defineTrapezoid(gapBox->getZHalfLength(), gapBox->getZHalfLength(), gapBox->getYHalfLength());
202  phiDesign = (*factoryCache.stripDesigns.emplace(phiDesign).first);
203 
204  const IdentifierHash phiHash {RpcReadoutElement::createHash(0, gapVol.gasGap, gapVol.doubPhi, true)};
205  const unsigned int phiIdx = static_cast<unsigned int>(phiHash);
206  if (phiIdx >= define.layers.size()) {
207  define.layers.resize(phiIdx + 1);
208  }
209  auto phiLayer = std::make_unique<StripLayer>(gapVol.transform * Amg::getRotateZ3D(90. * Gaudi::Units::deg),
210  phiDesign, phiHash);
211  define.layers[phiIdx] = (*factoryCache.stripLayers.emplace(std::move(phiLayer)).first);
212  ATH_MSG_VERBOSE("Added new phi gap at "<<(*define.layers[phiIdx]));
213  if (!define.phiDesign) define.phiDesign = phiDesign;
214  }
215  return StatusCode::SUCCESS;
216 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ readParameterBook()

StatusCode MuonGMR4::RpcReadoutGeomTool::readParameterBook ( FactoryCache cache)
private

Retrieves the auxillary tables from the database.

Definition at line 275 of file RpcReadoutGeomTool.cxx.

275  {
276  ServiceHandle<IRDBAccessSvc> accessSvc(m_geoDbTagSvc->getParamSvcName(), name());
277  ATH_CHECK(accessSvc.retrieve());
278  IRDBRecordset_ptr paramTable = accessSvc->getRecordsetPtr("WRPC", "");
279  if (paramTable->size() == 0) {
280  ATH_MSG_FATAL("Empty parameter book table found");
281  return StatusCode::FAILURE;
282  }
283  ATH_MSG_VERBOSE("Found the " << paramTable->nodeName() << " ["
284  << paramTable->tagName() << "] table with "
285  << paramTable->size() << " records");
286 
287  for (const IRDBRecord_ptr& record : *paramTable) {
288  const std::string chambType = record->getString("WRPC_TYPE");
289  wRPCTable& parBook = cache.parameterBook[record->getString("WRPC_TYPE")];
290  parBook.stripPitchEta = record->getDouble("etaStripPitch") * Gaudi::Units::cm;
291  parBook.stripPitchPhi = record->getDouble("phiStripPitch") * Gaudi::Units::cm;
292  const double stripDeadWidth = record->getDouble("stripDeadWidth") * Gaudi::Units::cm;
293  parBook.stripWidthEta = parBook.stripPitchEta - stripDeadWidth;
294  parBook.stripWidthPhi = parBook.stripPitchPhi - stripDeadWidth;
295  parBook.numEtaStrips = record->getInt("nEtaStrips");
296  parBook.numPhiStrips = record->getInt("nPhiStrips");
297  parBook.firstOffSetPhi = record->getDouble("phiStripOffSet") * Gaudi::Units::cm +
298  0.5 * parBook.stripPitchPhi;
299  parBook.firstOffSetEta = record->getDouble("etaStripOffSet") * Gaudi::Units::cm +
300  record->getDouble("TCKSSU") * Gaudi::Units::cm +
301  0.5 * parBook.stripPitchEta;
302 
303  ATH_MSG_VERBOSE("Extracted parameters for chamber "<<chambType
304  <<", num strips (eta/phi): "<<parBook.numEtaStrips<<"/"<<parBook.numPhiStrips
305  <<", strip pitch (eta/phi) "<<parBook.stripPitchEta<<"/"<<parBook.stripPitchPhi
306  <<", strip width (eta/phi): "<<parBook.stripWidthEta<<"/"<<parBook.stripWidthPhi
307  <<", strip offset (eta/phi): "<<parBook.firstOffSetEta<<"/"<<parBook.firstOffSetPhi
308  <<", etaStripOffSet: "<<(record->getDouble("etaStripOffSet") * Gaudi::Units::cm)
309  <<", phiStripOffSet: "<<(record->getDouble("phiStripOffSet") * Gaudi::Units::cm)
310  <<", TCKSSU: "<<(record->getDouble("TCKSSU")* Gaudi::Units::cm));
311  }
312  return StatusCode::SUCCESS;
313 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_geoDbTagSvc

ServiceHandle<IGeoDbTagSvc> MuonGMR4::RpcReadoutGeomTool::m_geoDbTagSvc {this, "GeoDbTagSvc", "GeoDbTagSvc"}
private

Definition at line 32 of file RpcReadoutGeomTool.h.

◆ m_geoUtilTool

PublicToolHandle<IMuonGeoUtilityTool> MuonGMR4::RpcReadoutGeomTool::m_geoUtilTool {this,"GeoUtilTool", "" }
private

Definition at line 34 of file RpcReadoutGeomTool.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> MuonGMR4::RpcReadoutGeomTool::m_idHelperSvc
private
Initial value:
{this, "IdHelperSvc",
"Muon::MuonIdHelperSvc/MuonIdHelperSvc"}

Definition at line 29 of file RpcReadoutGeomTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
MuonGMR4::RpcReadoutGeomTool::loadDimensions
StatusCode loadDimensions(RpcReadoutElement::defineArgs &args, FactoryCache &factory)
Loads the chamber dimensions from GeoModel.
Definition: RpcReadoutGeomTool.cxx:63
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
max
#define max(a, b)
Definition: cfImp.cxx:41
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CxxUtils::tokenize
std::vector< std::string > tokenize(const std::string &the_str, std::string_view delimiters)
Splits the string into smaller substrings.
Definition: Control/CxxUtils/Root/StringUtils.cxx:15
MuonGMR4::RpcReadoutGeomTool::readParameterBook
StatusCode readParameterBook(FactoryCache &cache)
Retrieves the auxillary tables from the database.
Definition: RpcReadoutGeomTool.cxx:275
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
deg
#define deg
Definition: SbPolyhedron.cxx:17
MuonGMR4::RpcReadoutGeomTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: RpcReadoutGeomTool.h:29
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
isValid
bool isValid(const T &p)
Definition: AtlasPID.h:214
RpcIdHelper
Definition: RpcIdHelper.h:51
std::stable_sort
void stable_sort(std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, std::reverse_iterator< DataModel_detail::iterator< DVL > > end, Compare comp)
Specialization of stable_sort for DataVector/List.
Definition: DVL_algorithms.h:711
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Amg::getRotateZ3D
Amg::Transform3D getRotateZ3D(double angle)
get a rotation transformation around Z-axis
Definition: GeoPrimitivesHelpers.h:270
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
AthCommonDataStore
Definition: AthCommonDataStore.h:52
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MuonGMR4::layerSorter
bool layerSorter(const physVolWithTrans &a, const physVolWithTrans &b)
Definition: RpcReadoutGeomTool.cxx:48
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition: IRDBAccessSvc.h:25
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
MuonGMR4::StripDesignPtr
GeoModel::TransientConstSharedPtr< StripDesign > StripDesignPtr
Definition: StripDesign.h:29
tolerance
Definition: suep_shower.h:17
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
MuonGMR4::physVolWithTrans
IMuonGeoUtilityTool::physVolWithTrans physVolWithTrans
Definition: MdtReadoutGeomTool.cxx:25
Amg::getRotateY3D
Amg::Transform3D getRotateY3D(double angle)
get a rotation transformation around Y-axis
Definition: GeoPrimitivesHelpers.h:261
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonGMR4::RpcReadoutGeomTool::m_geoDbTagSvc
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
Definition: RpcReadoutGeomTool.h:32
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
a
TList * a
Definition: liststreamerinfos.cxx:10
h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
IRDBRecord_ptr
std::unique_ptr< IRDBRecord > IRDBRecord_ptr
Definition: IRDBRecordset.h:23
python.changerun.pv
pv
Definition: changerun.py:81
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
MuonGMR4::RpcReadoutGeomTool::m_geoUtilTool
PublicToolHandle< IMuonGeoUtilityTool > m_geoUtilTool
Definition: RpcReadoutGeomTool.h:34
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85
createCablingJSON.doubletPhi
int doubletPhi
Definition: createCablingJSON.py:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
ActsTrk::SurfaceBoundSetPtr
std::shared_ptr< SurfaceBoundSet< BoundType > > SurfaceBoundSetPtr
Aberivation to create a new SurfaceBoundSetPtr.
Definition: SurfaceBoundSet.h:50
AthAlgTool
Definition: AthAlgTool.h:26
MuonGMR4::IMuonReadoutGeomTool::physNodeMap
std::map< std::string, GeoFullPhysVol * > physNodeMap
Definition: IMuonReaoutGeomTool.h:25
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
python.SystemOfUnits.degree
tuple degree
Definition: SystemOfUnits.py:106
fitman.k
k
Definition: fitman.py:528
MuonGMR4::defineArgs
MuonChamber::defineArgs defineArgs
Definition: ChamberAssembleTool.cxx:32
ServiceHandle< IRDBAccessSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
MuonGMR4::RpcReadoutElement::createHash
static IdentifierHash createHash(const unsigned int strip, const unsigned int gasGap, const unsigned int doubPhi, const bool measPhi)
Constructs an Identifier hash from the Identifier fields controlled by this readout element