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

#include <TgcReadoutGeomTool.h>

Inheritance diagram for MuonGMR4::TgcReadoutGeomTool:
Collaboration diagram for MuonGMR4::TgcReadoutGeomTool:

Classes

struct  FactoryCache
 
struct  wTgcTable
 Helper struct to cache the essential readout parameters from the WTGC tables. More...
 

Public Types

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

Public Member Functions

 TgcReadoutGeomTool (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 writeSectorMapping (const MuonDetectorManager &mgr) const
 Map the Tgc sectors to the classical Muon System sectors. More...
 
StatusCode readParameterBook (FactoryCache &cache)
 Retrieves the auxillary tables from the database. More...
 
StatusCode loadDimensions (TgcReadoutElement::defineArgs &args, FactoryCache &factory)
 Loads the chamber dimensions from GeoModel. More...
 
IdentifierHash layerHash (const TgcReadoutElement::defineArgs &args, const int gasGap, const int doubPhi, const bool measPhi) const
 
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 TgcReadoutGeomTool.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

◆ TgcReadoutGeomTool()

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

Definition at line 35 of file TgcReadoutGeomTool.cxx.

38  : AthAlgTool{type, name, parent} {
39  declareInterface<IMuonReadoutGeomTool>(this);
40 
41 }

Member Function Documentation

◆ buildReadOutElements()

StatusCode MuonGMR4::TgcReadoutGeomTool::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 <CHAMBERTYPE>_<STATIONNAME>_<STATIONETA>_<STATIONPHI> where CHAMBERTYPE has to start with TGC

Retrieve first the station Identifier

Implements MuonGMR4::IMuonReadoutGeomTool.

Definition at line 154 of file TgcReadoutGeomTool.cxx.

154  {
155  ATH_CHECK(m_geoDbTagSvc.retrieve());
156  ATH_CHECK(m_idHelperSvc.retrieve());
157  ATH_CHECK(m_geoUtilTool.retrieve());
158  GeoModelIO::ReadGeoModel* sqliteReader = m_geoDbTagSvc->getSqliteReader();
159  if (!sqliteReader) {
160  ATH_MSG_FATAL("Error, the tool works exclusively from sqlite geometry inputs");
161  return StatusCode::FAILURE;
162  }
163 
164  FactoryCache facCache{};
165  ATH_CHECK(readParameterBook(facCache));
166 
167 #ifndef SIMULATIONBASE
168  SurfaceBoundSetPtr<Acts::TrapezoidBounds> layerBounds = std::make_shared<SurfaceBoundSet<Acts::TrapezoidBounds>>();
169 #endif
170  const TgcIdHelper& idHelper{m_idHelperSvc->tgcIdHelper()};
171  // Get the list of full phys volumes from SQLite, and create detector elements
173  physNodeMap mapFPV = sqliteReader->getPublishedNodes<std::string, GeoFullPhysVol*>("Muon");
174  for (auto& [key, pv] : mapFPV) {
178  std::vector<std::string> key_tokens = tokenize(key, "_");
179  if (key_tokens.size() < 4 ||
180  !CxxUtils::starts_with (key_tokens[0], "TGC"))
181  continue;
182 
183  bool isValid{false};
184  const Identifier elementID = idHelper.elementID(key_tokens[1].substr(0,3), atoi(key_tokens[2]), atoi(key_tokens[3]), isValid);
186  if (!isValid){
187  ATH_MSG_FATAL("Failed to construct the station Identifier from "<<key);
188  return StatusCode::FAILURE;
189  }
190  defineArgs define{};
191  define.physVol = pv;
192  define.detElId = elementID;
193  define.chambDesign = key_tokens[0];
194  define.alignTransform = m_geoUtilTool->findAlignableTransform(define.physVol);
195 #ifndef SIMULATIONBASE
196  define.layerBounds = layerBounds;
197 #endif
198  ATH_MSG_DEBUG("Key "<<key<<" lead to Identifier "<<m_idHelperSvc->toStringDetEl(define.detElId));
199  ATH_CHECK(loadDimensions(define, facCache));
200  std::unique_ptr<TgcReadoutElement> readoutEle = std::make_unique<TgcReadoutElement>(std::move(define));
201  ATH_CHECK(mgr.addTgcReadoutElement(std::move(readoutEle)));
202  }
204  return StatusCode::SUCCESS;
205 }

◆ 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.

◆ layerHash()

IdentifierHash MuonGMR4::TgcReadoutGeomTool::layerHash ( const TgcReadoutElement::defineArgs args,
const int  gasGap,
const int  doubPhi,
const bool  measPhi 
) const
private

◆ loadDimensions()

StatusCode MuonGMR4::TgcReadoutGeomTool::loadDimensions ( TgcReadoutElement::defineArgs args,
FactoryCache factory 
)
private

Loads the chamber dimensions from GeoModel.

Navigate through the GeoModel tree to find all gas volume leaves

Reserve the first bit for the isStrip property

The extra 1 to account for the is Strip true

Definition at line 42 of file TgcReadoutGeomTool.cxx.

43  {
44  ATH_MSG_VERBOSE("Load dimensions of "<<m_idHelperSvc->toString(define.detElId)
45  <<std::endl<<std::endl<<m_geoUtilTool->dumpVolume(define.physVol));
46  const GeoShape* shape = m_geoUtilTool->extractShape(define.physVol);
47  if (!shape) {
48  ATH_MSG_FATAL("Failed to deduce a valid shape for "<<m_idHelperSvc->toString(define.detElId));
49  return StatusCode::FAILURE;
50  }
51 
52  if (shape->typeID() != GeoTrd::getClassTypeID()) {
53  ATH_MSG_FATAL("The shape of "<<m_idHelperSvc->toStringDetEl(define.detElId)
54  <<" is expected to be a trapezoid "<<m_geoUtilTool->dumpShape(shape));
55  return StatusCode::FAILURE;
56  }
57  const GeoTrd* chambTrd = static_cast<const GeoTrd*>(shape);
58  define.halfWidthShort = std::min(chambTrd->getYHalfLength1(), chambTrd->getYHalfLength2());
59  define.halfWidthLong = std::max(chambTrd->getYHalfLength1(), chambTrd->getYHalfLength2());
60  define.halfHeight = chambTrd->getZHalfLength();
61  define.halfThickness = chambTrd->getXHalfLength1();
63  std::vector<physVolWithTrans> allGasGaps = m_geoUtilTool->findAllLeafNodesByName(define.physVol, "TgcGas");
64  if (allGasGaps.empty()) {
65  ATH_MSG_FATAL("The volume "<<m_idHelperSvc->toStringDetEl(define.detElId)<<" does not have any childern TgcGas"
66  <<std::endl<<m_geoUtilTool->dumpVolume(define.physVol));
67  return StatusCode::FAILURE;
68  }
69  unsigned int gasGap{0};
70  for (const physVolWithTrans& pVolTrans : allGasGaps) {
71  std::stringstream key{};
72  key<<define.chambDesign<<"_"<<(gasGap+1)
73  <<(m_idHelperSvc->stationEta(define.detElId) > 0 ? "A" : "C");
74 
75  StripLayerPtr& stripLayout{factoryCache.stripDesigns[key.str()]};
76  StripLayerPtr& wireLayout{factoryCache.wireDesigns[key.str()]};
77 
78  if (!stripLayout || !wireLayout) {
79  const wTgcTable& table{factoryCache.parameterBook[key.str()]};
80  if (!table.gasGap) {
81  ATH_MSG_FATAL("No wTGC table could be found for "
82  <<m_idHelperSvc->toStringDetEl(define.detElId)
83  <<" "<<define.chambDesign<<", gasGap "<<(gasGap+1));
84  return StatusCode::FAILURE;
85  }
86  const GeoShape* gapShape = m_geoUtilTool->extractShape(pVolTrans.volume);
87  if (gapShape->typeID() != GeoTrd::getClassTypeID()) {
88  ATH_MSG_FATAL("Expected shape "<<m_geoUtilTool->dumpShape(gapShape)
89  <<" to be a trapezoid");
90  return StatusCode::FAILURE;
91  }
92  const GeoTrd* gapTrd = static_cast<const GeoTrd*>(gapShape);
93 
94  const double halfMinX = std::min(gapTrd->getYHalfLength1(), gapTrd->getYHalfLength2());
95  const double halfMaxX = std::max(gapTrd->getYHalfLength1(), gapTrd->getYHalfLength2());
96  const double halfY = gapTrd->getZHalfLength();
97 
98  if (!wireLayout && table.wireGangs.size()) {
99  WireDesignPtr wireGrp = std::make_unique<WireGroupDesign>();
100  wireGrp->defineTrapezoid(halfMinX, halfMaxX, halfY);
101  for (unsigned int gang : table.wireGangs) {
102  wireGrp->declareGroup(gang);
103  }
104  const double wireOffSet = -0.5*table.wirePitch * wireGrp->nAllWires();
105  wireGrp->defineStripLayout(Amg::Vector2D{wireOffSet, 0.},
106  table.wirePitch, 0., table.wireGangs.size());
107 
108  const Amg::Transform3D trans{pVolTrans.transform
112  const IdentifierHash hash{gasGap << 1};
113  wireLayout = std::make_unique<StripLayer>(trans, (*factoryCache.wireLayouts.insert(std::move(wireGrp)).first), hash);
114  }
115  if (!stripLayout && table.bottomStripPos.size()) {
116  RadialStripDesignPtr radDesign = std::make_unique<RadialStripDesign>();
117  radDesign->defineTrapezoid(halfMinX, halfMaxX, halfY);
118  radDesign->defineStripLayout(Amg::Vector2D{-halfY,0.},
119  0.,0.,table.bottomStripPos.size());
120  radDesign->flipTrapezoid();
121  for (size_t s = 0; s < table.bottomStripPos.size(); ++s) {
122  radDesign->addStrip(table.bottomStripPos.at(s),
123  table.topStripPos.at(s));
124  }
126  const IdentifierHash hash{gasGap<< 1 | 1};
127  const Amg::Transform3D trans{pVolTrans.transform
130  stripLayout = std::make_unique<StripLayer>(trans, (*factoryCache.stripLayouts.insert(std::move(radDesign)).first), hash);
131  }
132  }
133  ++gasGap;
134  if (stripLayout) {
135  unsigned int stripIdx = static_cast<unsigned>(stripLayout->hash());
136  if (stripIdx >= define.sensorLayouts.size()) {
137  ATH_MSG_FATAL("The strip index "<<stripIdx<<" is out of range for gasGap "<<gasGap);
138  return StatusCode::FAILURE;
139  }
140  define.sensorLayouts[stripIdx] = stripLayout;
141  }
142  if (wireLayout) {
143  unsigned int wireIdx = static_cast<unsigned>(wireLayout->hash());
144  if (wireIdx >= define.sensorLayouts.size()) {
145  ATH_MSG_FATAL("The wire index "<<wireIdx<<" is out of range for gasGap "<<gasGap);
146  return StatusCode::FAILURE;
147  }
148  define.sensorLayouts[wireIdx] = wireLayout;
149  }
150  }
151  define.nGasGaps = gasGap;
152  return StatusCode::SUCCESS;
153 }

◆ 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::TgcReadoutGeomTool::readParameterBook ( FactoryCache cache)
private

Retrieves the auxillary tables from the database.

Definition at line 220 of file TgcReadoutGeomTool.cxx.

220  {
221  ServiceHandle<IRDBAccessSvc> accessSvc(m_geoDbTagSvc->getParamSvcName(), name());
222  ATH_CHECK(accessSvc.retrieve());
223  IRDBRecordset_ptr paramTable = accessSvc->getRecordsetPtr("TgcSensorLayout", "");
224  if (paramTable->size() == 0) {
225  ATH_MSG_FATAL("Empty parameter book table found");
226  return StatusCode::FAILURE;
227  }
228  for (const IRDBRecord_ptr& record : *paramTable) {
229  const std::string chambType = record->getString("technology");
230  const int gasGap = record->getInt("gasGap");
231  const std::vector<int> wireGangs{tokenizeInt(record->getString("wireGangs"),",")};
232  const std::vector<double> botStrips = tokenizeDouble(record->getString("bottomStrips"), ",");
233  const std::vector<double> topStrips = tokenizeDouble(record->getString("topStrips"), ",");
234  const std::vector<std::string> sides = tokenize(record->getString("side"), ";");
235  const double wirePitch = record->getDouble("wirePitch");
236  for (const std::string& side : sides) {
237  std::stringstream key{};
238  key<<chambType<<"_"<<gasGap<<side;
239  wTgcTable& parBook{cache.parameterBook[key.str()]};
240  parBook.wireGangs.insert(parBook.wireGangs.end(), wireGangs.begin(), wireGangs.end());
241  parBook.bottomStripPos = botStrips;
242  parBook.topStripPos = topStrips;
243  parBook.wirePitch = wirePitch;
244  parBook.gasGap = gasGap;
245  }
246 
247  }
248  ATH_MSG_DEBUG("Read in total "<<cache.parameterBook.size()<<" chamber layouts");
249  return StatusCode::SUCCESS;
250 }

◆ 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  }

◆ writeSectorMapping()

StatusCode MuonGMR4::TgcReadoutGeomTool::writeSectorMapping ( const MuonDetectorManager mgr) const
private

Map the Tgc sectors to the classical Muon System sectors.

Map the Tgc sectors to the classic muon sectors

Definition at line 206 of file TgcReadoutGeomTool.cxx.

206  {
208  std::vector<const TgcReadoutElement*> tgcReadOutEles = mgr.getAllTgcReadoutElements();
209  std::unique_ptr<std::vector<int>> tgcSectorMapping = std::make_unique<std::vector<int>>();
210  tgcSectorMapping->resize(m_idHelperSvc->tgcIdHelper().module_hash_max());
211  Muon::MuonSectorMapping sectorMapping{};
212  const ActsGeometryContext gctx{};
213  for (const TgcReadoutElement* readoutEle : tgcReadOutEles) {
214  int& sectNumb = (*tgcSectorMapping)[m_idHelperSvc->moduleHash(readoutEle->identify())];
215  sectNumb = sectorMapping.getSector(readoutEle->center(gctx).phi());
216  }
217  ATH_CHECK(detStore()->record(std::move(tgcSectorMapping), "TGC_SectorMapping"));
218  return StatusCode::SUCCESS;
219 }

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::TgcReadoutGeomTool::m_geoDbTagSvc {this, "GeoDbTagSvc", "GeoDbTagSvc"}
private

Definition at line 35 of file TgcReadoutGeomTool.h.

◆ m_geoUtilTool

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

Definition at line 37 of file TgcReadoutGeomTool.h.

◆ m_idHelperSvc

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

Definition at line 32 of file TgcReadoutGeomTool.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:
GeoModel::TransientConstSharedPtr
The TransientConstSharedPtr allows non-const access if the pointer itself is non-const but in the con...
Definition: TransientConstSharedPtr.h:13
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
CxxUtils::tokenizeDouble
std::vector< double > tokenizeDouble(const std::string &the_str, std::string_view delimiter)
Definition: Control/CxxUtils/Root/StringUtils.cxx:34
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
CxxUtils::starts_with
bool starts_with(const char *s, const char *prefix)
Test whether one null-terminated byte string starts with another.
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
max
#define max(a, b)
Definition: cfImp.cxx:41
TgcIdHelper
Definition: TgcIdHelper.h:50
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
CxxUtils::tokenizeInt
std::vector< int > tokenizeInt(const std::string &the_str, std::string_view delimiter)
Definition: Control/CxxUtils/Root/StringUtils.cxx:55
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
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
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
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
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
TRT::Hit::side
@ side
Definition: HitInfo.h:83
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
MuonGMR4::TgcReadoutGeomTool::writeSectorMapping
StatusCode writeSectorMapping(const MuonDetectorManager &mgr) const
Map the Tgc sectors to the classical Muon System sectors.
Definition: TgcReadoutGeomTool.cxx:206
Amg::getRotateX3D
Amg::Transform3D getRotateX3D(double angle)
get a rotation transformation around X-axis
Definition: GeoPrimitivesHelpers.h:252
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
MuonGMR4::WireDesignPtr
GeoModel::TransientConstSharedPtr< WireGroupDesign > WireDesignPtr
Definition: WireGroupDesign.h:21
MuonGMR4::TgcReadoutGeomTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: TgcReadoutGeomTool.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
MuonGMR4::TgcReadoutGeomTool::readParameterBook
StatusCode readParameterBook(FactoryCache &cache)
Retrieves the auxillary tables from the database.
Definition: TgcReadoutGeomTool.cxx:220
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MuonGMR4::TgcReadoutGeomTool::loadDimensions
StatusCode loadDimensions(TgcReadoutElement::defineArgs &args, FactoryCache &factory)
Loads the chamber dimensions from GeoModel.
Definition: TgcReadoutGeomTool.cxx:42
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
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:28
min
#define min(a, b)
Definition: cfImp.cxx:40
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
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
python.ext.table_printer.table
list table
Definition: table_printer.py:81
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
MuonGMR4::RadialStripDesignPtr
GeoModel::TransientConstSharedPtr< RadialStripDesign > RadialStripDesignPtr
Definition: RadialStripDesign.h:21
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
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
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
Muon::MuonSectorMapping
Definition: MuonSectorMapping.h:20
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
MuonGMR4::TgcReadoutGeomTool::m_geoDbTagSvc
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
Definition: TgcReadoutGeomTool.h:35
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
MuonGMR4::TgcReadoutGeomTool::m_geoUtilTool
PublicToolHandle< IMuonGeoUtilityTool > m_geoUtilTool
Definition: TgcReadoutGeomTool.h:37
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