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

#include <MmReadoutGeomTool.h>

Inheritance diagram for MuonGMR4::MmReadoutGeomTool:
Collaboration diagram for MuonGMR4::MmReadoutGeomTool:

Classes

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

Public Types

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

Public Member Functions

 MmReadoutGeomTool (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 (MmReadoutElement::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 MmReadoutGeomTool.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

◆ MmReadoutGeomTool()

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

Definition at line 29 of file MmReadoutGeomTool.cxx.

32  : AthAlgTool{type, name, parent} {
33  declareInterface<IMuonReadoutGeomTool>(this);
34 
35 }

Member Function Documentation

◆ buildReadOutElements()

StatusCode MuonGMR4::MmReadoutGeomTool::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

For MicroMegas the Keys are formatted in the following way. <MM>_<LARGE/SMALL SECTOR + MODULE TYPE>_<QUADRUPLET NUMBER>_<ETA INDEX>_<PHI INDEX>_<Quadruplet>

Implements MuonGMR4::IMuonReadoutGeomTool.

Definition at line 165 of file MmReadoutGeomTool.cxx.

165  {
166  ATH_CHECK(m_geoDbTagSvc.retrieve());
167  ATH_CHECK(m_idHelperSvc.retrieve());
168  ATH_CHECK(m_geoUtilTool.retrieve());
169  GeoModelIO::ReadGeoModel* sqliteReader = m_geoDbTagSvc->getSqliteReader();
170  if (!sqliteReader) {
171  ATH_MSG_FATAL("Error, the tool works exclusively from sqlite geometry inputs");
172  return StatusCode::FAILURE;
173  }
174 
175  FactoryCache facCache{};
176  ATH_CHECK(readParameterBook(facCache));
177 
178 
179  const MmIdHelper& idHelper{m_idHelperSvc->mmIdHelper()};
180  // Get the list of full phys volumes from SQLite, and create detector elements
182  physNodeMap mapFPV = sqliteReader->getPublishedNodes<std::string, GeoFullPhysVol*>("Muon");
183 #ifndef SIMULATIONBASE
184  SurfaceBoundSetPtr<Acts::TrapezoidBounds> layerBounds= std::make_shared<SurfaceBoundSet<Acts::TrapezoidBounds>>();
185 #endif
186 
187  for (auto& [key, pv] : mapFPV) {
190  // e.g. MM_SM1Q2_1_6_1 . It's the "type" Attribute in the new GeoModel XML files.
191  std::vector<std::string> key_tokens = tokenize(key, "_");
192 
193  if (key_tokens[0].find("MM") == std::string::npos){
194  continue;
195  }
196  ATH_MSG_DEBUG("Retrieving MicroMegas Quadruplet : " << key );
197 
199  bool isValid{false};
200  define.detElId = idHelper.channelID(key_tokens[1][0] == 'S' ? "MMS" : "MML", // Replace <MM> string part with <MMS> or <MML> to match the Identifier.
201  atoi(key_tokens[2].c_str()), // Eta index
202  atoi(key_tokens[3].c_str()), // Phi index (from 0 to 7 in GeoModel). needs a +1
203  atoi(key_tokens[4].c_str()), 1, 1, isValid); //Copy Number which reflects the number of the multilayer.
204  // THen the two 1s are reflecting gasGap and channel Number. They can be set to 1s as this is all we need
205  // to get the Identifier for the multilayer.
206 
207 
208  if (!isValid) {
209  ATH_MSG_FATAL("Failed to build a good identifier out of " << key);
210  return StatusCode::FAILURE;
211  }
212 
213  ATH_MSG_DEBUG("Key "<<key<<" brought us "<<m_idHelperSvc->toStringDetEl(define.detElId));
214  define.physVol = pv;
215  define.chambDesign = key_tokens[0]+"_"+key_tokens[1]; // Recover the string denoted in WMM tables. e.g. chambDesign = "MM_SM1Q2"
216  define.alignTransform = m_geoUtilTool->findAlignableTransform(define.physVol);
217  ATH_CHECK(loadDimensions(define, facCache));
218 #ifndef SIMULATIONBASE
219  define.layerBounds = layerBounds;
220 #endif
221  std::unique_ptr<MmReadoutElement> readoutEle = std::make_unique<MmReadoutElement>(std::move(define));
222  ATH_CHECK(mgr.addMmReadoutElement(std::move(readoutEle)));
223  }
224  return StatusCode::SUCCESS;
225 }

◆ 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::MmReadoutGeomTool::loadDimensions ( MmReadoutElement::defineArgs args,
FactoryCache factory 
)
private

Loads the chamber dimensions from GeoModel.

The half sizes of the MicroMegas trapezoid

Filling in number of layers

The stereo angle is defined clock-wise from the y-axis. So we need to input it with a minus when defining the trapezoid

Definition at line 36 of file MmReadoutGeomTool.cxx.

37  {
38 
39  ATH_MSG_VERBOSE("Load dimensions of "<<m_idHelperSvc->toString(define.detElId)
40  <<std::endl<<std::endl<<m_geoUtilTool->dumpVolume(define.physVol->getParent()));
41  const GeoShape* shape = m_geoUtilTool->extractShape(define.physVol);
42  if (!shape) {
43  ATH_MSG_FATAL("Failed to deduce a valid shape for "<<m_idHelperSvc->toString(define.detElId));
44  return StatusCode::FAILURE;
45  }
46  ATH_MSG_DEBUG("Extracted shape "<<m_geoUtilTool->dumpShape(shape));
48  if (shape->typeID() != GeoTrd::getClassTypeID()) {
49  ATH_MSG_FATAL(__FILE__<<":"<<__LINE__<<" expect shape to be a trapezoid but it's "<<m_geoUtilTool->dumpShape(shape));
50  return StatusCode::FAILURE;
51  }
52 
53  const GeoTrd* trapezoid = static_cast<const GeoTrd*>(shape);
54  define.halfThickness = trapezoid->getXHalfLength1() * Gaudi::Units::mm;
55  define.halfShortWidth = trapezoid->getYHalfLength1() * Gaudi::Units::mm;
56  define.halfLongWidth = trapezoid->getYHalfLength2() * Gaudi::Units::mm;
57  define.halfHeight = trapezoid->getZHalfLength() * Gaudi::Units::mm;
58 
59  ATH_MSG_DEBUG("Extracted parameters "
60  <<", halfThickness: "<<define.halfThickness<<"/"
61  <<", halfShortWidth : "<<define.halfShortWidth<<"/"
62  <<", halfLongWidth : "<<define.halfLongWidth<<"/"
63  <<", halfHeight : "<<define.halfHeight);
64 
65 
66  std::vector<physVolWithTrans> allGasGaps = m_geoUtilTool->findAllLeafNodesByName(define.physVol, "actMicroMegaGas");
67  if (allGasGaps.empty()) {
68  ATH_MSG_FATAL("The volume "<<m_idHelperSvc->toStringDetEl(define.detElId)<<" does not have any children actMicroMegaGas");
69  return StatusCode::FAILURE;
70  }
71 
73  define.nGasGaps = allGasGaps.size();
74  ATH_MSG_VERBOSE("The number of gasGaps are: " << define.nGasGaps);
75 
76  FactoryCache::ParamBookTable::const_iterator parBookItr = factoryCache.parameterBook.find(define.chambDesign);
77  if (parBookItr == factoryCache.parameterBook.end()) {
78  ATH_MSG_FATAL("The chamber "<<define.chambDesign<<" is not part of the WMM table");
79  return StatusCode::FAILURE;
80  }
81 
82  const wMMTable& paramBook{parBookItr->second};
83 
84  define.readoutSide = paramBook.readoutSide;
85 
86  /*Sort Gas Gaps in a module quadruplet based on their Z position
87  On side A the gas gap have local x axis translations : -24.975 , -8.175 , 8.175, 24.975
88  This order refers to the gap closest to the origin to the outermost gap of the experiement.
89  On side C the order is reversed : 24.975 , 8.175 , -8.175, -24.975.
90  I'm sorting the gas gap with the first one being closest to the experiment's origin.
91  I doing this in case the gaps aren't sorted in that way within the Full Phys Vol Quadruplet.
92  Also, now the stereoAngles and totalActiveStrips vectors will match the sequence of the allGasGaps vector.*/
93 
94  std::sort(allGasGaps.begin(), allGasGaps.end(),
95  [](const physVolWithTrans&gapI, const physVolWithTrans & gapJ) {
96  const Amg::Vector3D posGapI = gapI.transform.translation();
97  const Amg::Vector3D posGapJ = gapJ.transform.translation();
98  return posGapI.x() < posGapJ.x();
99  });
100  ATH_MSG_DEBUG("**************************************");
101  for (std::size_t gap = 0; gap < allGasGaps.size(); ++gap) {
102 
103  auto& gapVol = allGasGaps[gap];
104  const Amg::Vector3D posGapI = gapVol.transform.translation();
105 
106  //Check sorting of gasGaps. For Q1 --> Eta layers should be first. For Q2--> Stereo Layers should be first.
107  //Add ATH_MSG_INFO("**************************************"); before the gasGap loop.
108  ATH_MSG_DEBUG("quadruplet " << define.chambDesign.substr(6,7) << " stereoAngle : " << paramBook.stereoAngle.at(gap) << " totalStrips " << paramBook.totalActiveStrips.at(gap) << " GasGAP POS X : " << posGapI.x() );
109 
110  const GeoShape* gapShape = m_geoUtilTool->extractShape(gapVol.volume);
111  if (gapShape->typeID() != GeoTrd::getClassTypeID()) {
112  ATH_MSG_FATAL("Failed to extract a geo shape");
113  return StatusCode::FAILURE;
114  }
115 
116  bool isStereo = static_cast<bool>(paramBook.stereoAngle.at(gap));
117 
118  const GeoTrd* gapTrd = static_cast<const GeoTrd*>(gapShape);
119  ATH_MSG_DEBUG("MicroMegas Gas gap dimensions "<<m_geoUtilTool->dumpShape(gapTrd));
120  double gapHalfHeight = gapTrd->getZHalfLength();
121  double gapHalfShortY = std::min(gapTrd->getYHalfLength1(), gapTrd->getYHalfLength2());
122  double gapHalfLongY = std::max(gapTrd->getYHalfLength1(), gapTrd->getYHalfLength2());
123 
124  double firstStripPos{0.};
125  int firstActiveStrip{0};
126  if (isStereo) {
127  firstActiveStrip = paramBook.nMissedBottomStereo + 1;
128  firstStripPos = -gapHalfHeight + (1.*(firstActiveStrip - paramBook.nMissedTopEta) + 2.5)* paramBook.stripPitch;
129  } else {
130  firstActiveStrip = paramBook.nMissedBottomEta + 1;
131  firstStripPos = -gapHalfHeight + 1.5 *paramBook.stripPitch;
132  }
133 
134 
135 
136  /*The origin of the chamber/gasGap axes system is located at the center of the chamber.
137  We subtract the HalfLength across the Z axis to transform from the center to the origin of the trapezoid
138  The we add the strip pitch to reach the position of the first strip.*/
139  StripDesignPtr stripDesign = std::make_unique<StripDesign>();
140 
141  stripDesign->defineStripLayout(firstStripPos * Amg::Vector2D::UnitX(),
142  paramBook.stripPitch,
143  paramBook.stripWidth,
144  paramBook.totalActiveStrips.at(gap),
145  firstActiveStrip);
146 
148  stripDesign->defineTrapezoid(gapHalfShortY, gapHalfLongY, gapHalfHeight, paramBook.stereoAngle.at(gap));
149 
150  //Necessary strip layer rotation to match the alignment coordinate system
151  Amg::Transform3D stripLayerRotation{gapVol.transform
154  * Amg::getRotateZ3D(-stripDesign->stereoAngle())};
155 
156 
157  stripDesign = (*factoryCache.stripDesigns.emplace(stripDesign).first);
158  auto stripLayer = std::make_unique<StripLayer>(stripLayerRotation, stripDesign,
159  IdentifierHash{static_cast<unsigned int>(gap)});
160  define.layers.push_back(*factoryCache.stripLayers.emplace(std::move(stripLayer)).first);
161  } //end of gas gap loop
162  return StatusCode::SUCCESS;
163 }

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

Retrieves the auxillary tables from the database.

Definition at line 229 of file MmReadoutGeomTool.cxx.

229  {
230 
231  ServiceHandle<IRDBAccessSvc> accessSvc(m_geoDbTagSvc->getParamSvcName(), name());
232  ATH_CHECK(accessSvc.retrieve());
233  IRDBRecordset_ptr paramTable = accessSvc->getRecordsetPtr("WMM", "");
234  if (paramTable->size() == 0) {
235  ATH_MSG_FATAL("Empty parameter book table found");
236  return StatusCode::FAILURE;
237  }
238  ATH_MSG_VERBOSE("Found the " << paramTable->nodeName() << " ["
239  << paramTable->tagName() << "] table with "
240  << paramTable->size() << " records");
241 
242 
243 
244  for (const IRDBRecord_ptr& record : *paramTable) {
245  const std::string chambType = record->getString("WMM_TYPE");
246  wMMTable& parBook = cache.parameterBook[chambType];
247  parBook.stripPitch = record->getDouble("stripPitch") ;
248  parBook.stripWidth = record->getDouble("stripWidth") ;
249  parBook.stereoAngle = tokenizeDouble(record->getString("stereoAngle"), ";");
250  parBook.totalActiveStrips = tokenizeInt(record->getString("totalActiveStrips"), ";");
251  parBook.readoutSide = tokenizeInt(record->getString("readoutSide"),";");
252  parBook.nMissedBottomEta = record->getInt("nMissedBottomEta");
253  parBook.nMissedBottomStereo = record->getInt("nMissedBottomStereo");
254  parBook.nMissedTopEta = record->getInt("nMissedTopEta");
255  parBook.distBotFrameStrip = record->getDouble("dR_botFrame1stStrip");
256 
257  ATH_MSG_VERBOSE("Extracted parameters for chamber "<<chambType
258  <<", stripPitch: "<<parBook.stripPitch
259  <<", stripWidth: "<<parBook.stripWidth
260  <<", steroAngle: "<<parBook.stereoAngle
261  <<", totalActiveStrips: "<<parBook.totalActiveStrips
262  <<", readoutSites: "<<parBook.readoutSide);
263  }
264 
265  return StatusCode::SUCCESS;
266 }

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

Definition at line 33 of file MmReadoutGeomTool.h.

◆ m_geoUtilTool

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

Definition at line 35 of file MmReadoutGeomTool.h.

◆ m_idHelperSvc

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

Definition at line 30 of file MmReadoutGeomTool.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:
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.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
max
#define max(a, b)
Definition: cfImp.cxx:41
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
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
CaloSwCorrections.gap
def gap(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:212
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
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
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
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
MuonGMR4::MmReadoutGeomTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MmReadoutGeomTool.h:30
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
MuonGMR4::StripDesignPtr
GeoModel::TransientConstSharedPtr< StripDesign > StripDesignPtr
Definition: StripDesign.h:29
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
MuonGMR4::MmReadoutGeomTool::m_geoDbTagSvc
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
Definition: MmReadoutGeomTool.h:33
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::MmReadoutGeomTool::readParameterBook
StatusCode readParameterBook(FactoryCache &cache)
Retrieves the auxillary tables from the database.
Definition: MmReadoutGeomTool.cxx:229
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
MuonGMR4::MmReadoutGeomTool::m_geoUtilTool
PublicToolHandle< IMuonGeoUtilityTool > m_geoUtilTool
Definition: MmReadoutGeomTool.h:35
a
TList * a
Definition: liststreamerinfos.cxx:10
h
MmIdHelper
Definition: MmIdHelper.h:54
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
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
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
fitman.k
k
Definition: fitman.py:528
MuonGMR4::MmReadoutGeomTool::loadDimensions
StatusCode loadDimensions(MmReadoutElement::defineArgs &args, FactoryCache &factory)
Loads the chamber dimensions from GeoModel.
Definition: MmReadoutGeomTool.cxx:36
MuonGMR4::defineArgs
MuonChamber::defineArgs defineArgs
Definition: ChamberAssembleTool.cxx:32
ServiceHandle< IRDBAccessSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37