ATLAS Offline Software
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
Muon::MuonTrackingGeometryBuilderImpl Class Reference

#include <MuonTrackingGeometryBuilderImpl.h>

Inheritance diagram for Muon::MuonTrackingGeometryBuilderImpl:
Collaboration diagram for Muon::MuonTrackingGeometryBuilderImpl:

Classes

struct  LocalVariablesContainer
 Private struct to contain local variables we dont want to be global in this class. More...
 

Public Types

using DetachedVolPtr = std::unique_ptr< Trk::DetachedTrackingVolume >
 TrackingGeometry Interface method. More...
 
using DetachedVolVec = std::vector< DetachedVolPtr >
 
using VolumeSpanPtr = std::shared_ptr< const Trk::VolumeSpan >
 
using DetachedVolSpanPair = std::pair< Trk::DetachedTrackingVolume *, VolumeSpanPtr >
 
using VolumeSpanArray = std::array< std::vector< DetachedVolSpanPair >, 9 >
 
using TrackingVolumePtr = std::unique_ptr< Trk::TrackingVolume >
 
using SharedTrackingVolume = std::shared_ptr< Trk::TrackingVolume >
 
using TrackingVolumeVec = std::vector< TrackingVolumePtr >
 

Public Member Functions

virtual ~MuonTrackingGeometryBuilderImpl ()=default
 Destructor. More...
 
virtual StatusCode initialize () override
 AlgTool initailize method. More...
 
std::unique_ptr< Trk::TrackingGeometrytrackingGeometryImpl (DetachedVolVec &&stations, DetachedVolVec &&inertObjs, Trk::TrackingVolume *tvol) const
 
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
 

Static Public Member Functions

static Trk::GeometrySignature signature ()
 The unique signature. More...
 

Protected Member Functions

 MuonTrackingGeometryBuilderImpl (const std::string &, const std::string &, const IInterface *)
 
VolumeSpanArray findVolumesSpan (const DetachedVolVec &objs, double zTol, double phiTol, const LocalVariablesContainer &aLVC) const
 Private method to filter detached volumes in z span. More...
 
TrackingVolumePtr processVolume (const Trk::Volume &, int, int, const std::string &, LocalVariablesContainer &aLVC, bool hasStations) const
 Private methods to define subvolumes and fill them with detached volumes. More...
 
TrackingVolumePtr processVolume (const Trk::Volume &, int, const std::string &, LocalVariablesContainer &aLVC, bool hasStations) const
 
TrackingVolumePtr processShield (const Trk::Volume &, int, const std::string &, LocalVariablesContainer &aLVC, bool hasStations) const
 
std::vector< Trk::DetachedTrackingVolume * > getDetachedObjects (const Trk::Volume &trkVol, std::vector< Trk::DetachedTrackingVolume * > &, LocalVariablesContainer &aLVC, int mode=0) const
 Private method to find detached volumes. More...
 
bool enclosed (const Trk::Volume &volume, const Trk::VolumeSpan &span, LocalVariablesContainer &aLVC) const
 Private method to check if constituent enclosed. More...
 
void getZParts (LocalVariablesContainer &aLVC) const
 Private method to retrieve z partition. More...
 
void getPhiParts (int, LocalVariablesContainer &aLVC) const
 Private method to retrieve phi partition. More...
 
void getHParts (LocalVariablesContainer &aLVC) const
 Private method to retrieve h partition. More...
 
void getShieldParts (LocalVariablesContainer &aLVC) const
 Private method to retrieve shield partition. More...
 
void blendMaterial (LocalVariablesContainer &aLVC) const
 Private method to blend the inert material. More...
 
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...
 

Protected Attributes

Trk::VolumeConverter m_volumeConverter
 Volume helper to find geometrical span of enclosed volumes. More...
 
ToolHandle< Trk::ITrackingVolumeArrayCreatorm_trackingVolumeArrayCreator
 Helper Tool to create TrackingVolume Arrays. More...
 
ToolHandle< Trk::ITrackingVolumeHelperm_trackingVolumeHelper
 Helper Tool to create TrackingVolumes. More...
 
ServiceHandle< IEnvelopeDefSvcm_enclosingEnvelopeSvc
 service to provide input volume size More...
 
Gaudi::Property< bool > m_muonSimple {this, "SimpleMuonGeometry", false}
 
Gaudi::Property< bool > m_loadMSentry {this, "LoadMSEntry", false}
 
Gaudi::Property< bool > m_muonActive {this, "BuildActiveMaterial", true}
 
Gaudi::Property< bool > m_muonInert {this, "BuildInertMaterial", true}
 
Gaudi::Property< double > m_innerBarrelRadius
 < minimal extend in radial dimension of the muon barrel More...
 
Gaudi::Property< double > m_outerBarrelRadius
 maximal extend in z of the muon barrel More...
 
Gaudi::Property< double > m_barrelZ {this, "BarrelZ", 6785.}
 maximal extend in z of the inner part of muon endcap More...
 
Gaudi::Property< double > m_innerEndcapZ {this, "InnerEndcapZ", 12900.}
 maximal extend in z of the outer part of muon endcap More...
 
Gaudi::Property< double > m_outerEndcapZ {this, "OuterEndcapZ", 26046.}
 
Gaudi::Property< int > m_barrelEtaPartition {this, "EtaBarrelPartitions", 9}
 
Gaudi::Property< int > m_innerEndcapEtaPartition
 
Gaudi::Property< int > m_outerEndcapEtaPartition
 
Gaudi::Property< int > m_phiPartition {this, "PhiPartitions", 16}
 
Gaudi::Property< bool > m_adjustStatic {this, "AdjustStatic", true}
 
Gaudi::Property< bool > m_static3d {this, "StaticPartition3D", true}
 
Gaudi::Property< bool > m_blendInertMaterial
 
Gaudi::Property< bool > m_removeBlended
 
Gaudi::Property< double > m_alignTolerance
 
Gaudi::Property< int > m_colorCode {this, "ColorCode", 0}
 
Gaudi::Property< int > m_activeAdjustLevel {this, "ActiveAdjustLevel", 2}
 
Gaudi::Property< int > m_inertAdjustLevel {this, "InertAdjustLevel", 1}
 
Gaudi::Property< std::string > m_entryVolume
 
Gaudi::Property< std::string > m_exitVolume
 

Static Protected Attributes

static constexpr double m_bigWheel {15600.}
 maximal extend in z of the big wheel More...
 
static constexpr double m_outerWheel {21000.}
 minimal extend in z of the outer wheel (EO) More...
 
static constexpr double m_ectZ {7920.}
 minimal extent in z of the ECT More...
 
static constexpr double m_beamPipeRadius {70.}
 
static constexpr double m_innerShieldRadius {850.}
 
static constexpr double m_outerShieldRadius {1500.}
 
static constexpr double m_diskShieldZ {6915.}
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

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

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

The Muon::MuonTrackingGeometryBuilderImpl retrieves MuonStationBuilder and MuonInertMaterialBuilder for the Muon Detector sub detectors and combines the given Volumes to a full Trk::TrackingGeometry.

Inheriting directly from IGeometryBuilderCond it can use the protected member functions of the IGeometryBuilderCond to glue Volumes together and exchange BoundarySurfaces

Author
Sarka.nosp@m..Tod.nosp@m.orova.nosp@m.@cer.nosp@m.n.ch

Definition at line 54 of file MuonTrackingGeometryBuilderImpl.h.

Member Typedef Documentation

◆ DetachedVolPtr

TrackingGeometry Interface method.

Definition at line 62 of file MuonTrackingGeometryBuilderImpl.h.

◆ DetachedVolSpanPair

Definition at line 65 of file MuonTrackingGeometryBuilderImpl.h.

◆ DetachedVolVec

Definition at line 63 of file MuonTrackingGeometryBuilderImpl.h.

◆ SharedTrackingVolume

Definition at line 68 of file MuonTrackingGeometryBuilderImpl.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

◆ TrackingVolumePtr

Definition at line 67 of file MuonTrackingGeometryBuilderImpl.h.

◆ TrackingVolumeVec

Definition at line 69 of file MuonTrackingGeometryBuilderImpl.h.

◆ VolumeSpanArray

Definition at line 66 of file MuonTrackingGeometryBuilderImpl.h.

◆ VolumeSpanPtr

Definition at line 64 of file MuonTrackingGeometryBuilderImpl.h.

Constructor & Destructor Documentation

◆ ~MuonTrackingGeometryBuilderImpl()

virtual Muon::MuonTrackingGeometryBuilderImpl::~MuonTrackingGeometryBuilderImpl ( )
virtualdefault

Destructor.

◆ MuonTrackingGeometryBuilderImpl()

Muon::MuonTrackingGeometryBuilderImpl::MuonTrackingGeometryBuilderImpl ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)
protected

Definition at line 58 of file MuonTrackingGeometryBuilderImpl.cxx.

60  : AthAlgTool(t, n, p) {}

Member Function Documentation

◆ blendMaterial()

void Muon::MuonTrackingGeometryBuilderImpl::blendMaterial ( LocalVariablesContainer aLVC) const
protected

Private method to blend the inert material.

Definition at line 2731 of file MuonTrackingGeometryBuilderImpl.cxx.

2732  {
2733  // loop over map
2734  // std::map<const Trk::DetachedTrackingVolume*,std::vector<const
2735  // Trk::TrackingVolume*>* >::iterator mIter = m_blendMap.begin();
2736  for (const auto&[viter, vv] : aLVC.m_blendMap) {
2737  // find material source
2738  const Trk::Material* detMat = viter->trackingVolume();
2739  double csVol = m_volumeConverter.calculateVolume(*viter->trackingVolume());
2740  std::unique_ptr<const Trk::VolumeSpan> span{m_volumeConverter.findVolumeSpan(viter->trackingVolume()->volumeBounds(),
2741  viter->trackingVolume()->transform(), 0., 0.)};
2742  if (span && csVol > 0) {
2743  double enVol = 0.;
2744  // loop over frame volumes, check if confined
2745  std::vector<bool> fEncl;
2746  // blending factors can be saved, and not recalculated for each
2747  // clone
2748  for (const auto fIter : vv) {
2749  fEncl.push_back(enclosed(*fIter, *span, aLVC));
2750  if (fEncl.back())
2751  enVol += m_volumeConverter.calculateVolume(*fIter);
2752  }
2753  // diluting factor
2754  double dil = enVol > 0. ? csVol / enVol : 0.;
2755  if (dil > 0.) {
2756  for (auto fIter = vv.begin(); fIter != vv.end(); ++fIter) {
2757  if (fEncl[fIter - vv.begin()]) {
2758  Trk::TrackingVolume* vol = (*fIter);
2759  vol->addMaterial(*detMat, dil);
2760  if (m_colorCode == 0) {
2761  vol->registerColorCode(12);
2762  }
2763  ATH_MSG_VERBOSE((*fIter)->volumeName()
2764  << " acquires material from "
2765  << viter->name());
2766  }
2767  }
2768  ATH_MSG_VERBOSE("diluting factor:" << dil << " for "
2769  << viter->name()
2770  << ", blended ");
2771 
2772  } else {
2773  ATH_MSG_VERBOSE("diluting factor:" << dil << " for "
2774  << viter->name()
2775  << ", not blended ");
2776  }
2777  }
2778  }
2779 }

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

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

◆ enclosed()

bool Muon::MuonTrackingGeometryBuilderImpl::enclosed ( const Trk::Volume volume,
const Trk::VolumeSpan span,
LocalVariablesContainer aLVC 
) const
protected

Private method to check if constituent enclosed.

Definition at line 2006 of file MuonTrackingGeometryBuilderImpl.cxx.

2008  {
2009  bool encl = false;
2010  constexpr double tol = 1.;
2011  constexpr double ptol = 0.11; // 0.08 for BT, 0.11 feet
2012 
2013  // get min/max Z/Phi from volume (allways a cylinder/bevelled cylinder
2014  // volume )
2015  auto cyl = dynamic_cast<const Trk::CylinderVolumeBounds*>(&(vol.volumeBounds()));
2016  auto bcyl =dynamic_cast<const Trk::BevelledCylinderVolumeBounds*>(&(vol.volumeBounds()));
2017 
2018  double rmed{0.}, dphi{0.}, hz{0.}, rMin{0.}, rMax{0.};
2019  if (cyl) {
2020  rmed = cyl->mediumRadius();
2021  dphi = cyl->halfPhiSector();
2022  hz = cyl->halflengthZ();
2023  rMin = cyl->innerRadius();
2024  rMax = cyl->outerRadius();
2025  } else if (bcyl) {
2026  rmed = bcyl->mediumRadius();
2027  dphi = bcyl->halfPhiSector();
2028  hz = bcyl->halflengthZ();
2029  rMin = bcyl->innerRadius();
2030  rMax = bcyl->outerRadius();
2031  } else
2032  return false;
2033 
2034  const Amg::Vector3D center = vol.transform() * (rmed* Amg::Vector3D::UnitX());
2035 
2036  double zMin = center[2] - hz;
2037  double zMax = center[2] + hz;
2038  double pMin = 0.;
2039  double pMax = +2 * M_PI;
2040  bool phiLim = false;
2041  if (dphi < M_PI) {
2042  pMin = center.phi() - dphi + M_PI;
2043  pMax = center.phi() + dphi + M_PI;
2044  phiLim = true;
2045  }
2046  //
2047  ATH_MSG_VERBOSE("enclosing volume:z:" << zMin << "," << zMax
2048  << ":r:" << rMin << "," << rMax
2049  << ":phi:" << pMin << "," << pMax);
2050  //
2051  bool rLimit = (!aLVC.m_static3d ||
2052  (span.rMin < rMax - tol && span.rMax > rMin + tol));
2053  if (rLimit && span.zMin < zMax - tol && span.zMax > zMin + tol) {
2054  if (phiLim) {
2055  if (pMin >= 0 && pMax <= 2 * M_PI) {
2056  if (span.phiMin <= span.phiMax && span.phiMin < pMax + ptol &&
2057  span.phiMax > pMin - ptol)
2058  return true;
2059  if (span.phiMin > span.phiMax &&
2060  (span.phiMin < pMax - ptol || span.phiMax > pMin + ptol))
2061  return true;
2062  } else if (pMin < 0) {
2063  if (span.phiMin <= span.phiMax &&
2064  (span.phiMin < pMax + ptol ||
2065  span.phiMax > pMin - ptol + 2 * M_PI))
2066  return true;
2067  if (span.phiMin > span.phiMax)
2068  return true;
2069  } else if (pMax > 2 * M_PI) {
2070  if (span.phiMin <= span.phiMax &&
2071  (span.phiMin < pMax + ptol - 2 * M_PI ||
2072  span.phiMax > pMin - ptol))
2073  return true;
2074  if (span.phiMin > span.phiMax)
2075  return true;
2076  }
2077  } else {
2078  return true;
2079  }
2080  }
2081  return encl;
2082 }

◆ 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

◆ findVolumesSpan()

VolumeSpanArray Muon::MuonTrackingGeometryBuilderImpl::findVolumesSpan ( const DetachedVolVec objs,
double  zTol,
double  phiTol,
const LocalVariablesContainer aLVC 
) const
protected

Private method to filter detached volumes in z span.

Definition at line 851 of file MuonTrackingGeometryBuilderImpl.cxx.

854  {
855  VolumeSpanArray spans{};
856 
857  if (objs.empty()) {
858  return spans;
859  }
860 
861  for (const auto& obj : objs) {
862  VolumeSpanPtr span{m_volumeConverter.findVolumeSpan(obj->trackingVolume()->volumeBounds(),
863  obj->trackingVolume()->transform(), zTol, phiTol)};
864  double x0 = obj->trackingVolume()->X0;
865  double intX0 = std::abs(span->zMin - span->zMax) / (x0 + 0.000000001);
866  double l0 = obj->trackingVolume()->L0;
867  ATH_MSG_DEBUG("span:" << obj->name() << "," << span->zMin << ","
868  << span->zMax << "," << span->phiMin << ","
869  << span->phiMax << "," << span->rMin << ","
870  << span->rMax << " X0 " << x0 << " L0 " << l0
871  << " intX0 for span0 span1 " << intX0);
872 
873  int nspans = 0;
874  // negative outer wheel
875  if (span->zMin < -m_bigWheel) {
876  spans[0].emplace_back(obj.get(), span);
877  nspans++;
878  }
879  // negative big wheel
880  if (span->zMin < -aLVC.m_innerEndcapZ && span->zMax > -m_bigWheel) {
881  spans[1].emplace_back(obj.get(), span);
882  nspans++;
883  }
884  // neg.ect
885  if (span->zMin < -m_ectZ && span->zMax > -aLVC.m_innerEndcapZ) {
886  spans[2].emplace_back(obj.get(), span);
887  nspans++;
888  }
889  // neg.small wheel
890  if (span->zMin < -m_diskShieldZ && span->zMax > -m_ectZ) {
891  spans[3].emplace_back(obj.get(), span);
892  nspans++;
893  }
894  // barrel
895  if (span->zMin < m_diskShieldZ && span->zMax > -m_diskShieldZ) {
896  spans[4].emplace_back(obj.get(), span);
897  nspans++;
898  }
899  // pos.small wheel
900  if (span->zMin < m_ectZ && span->zMax > m_diskShieldZ) {
901  spans[5].emplace_back(obj.get(), span);
902  nspans++;
903  }
904  // pos.ect
905  if (span->zMin < aLVC.m_innerEndcapZ && span->zMax > m_ectZ) {
906  spans[6].emplace_back(obj.get(), span);
907  nspans++;
908  }
909  // positive big wheel
910  if (span->zMin < m_bigWheel && span->zMax > aLVC.m_innerEndcapZ) {
911  spans[7].emplace_back(obj.get(), span);
912  nspans++;
913  }
914  // positive outer wheel
915  if (span->zMax > m_bigWheel) {
916  spans[8].emplace_back(obj.get(), span);
917  nspans++;
918  }
919 
920  if (nspans == 0)
921  ATH_MSG_WARNING(" object not selected in span regions "
922  << obj->name());
923  if (nspans > 1)
924  ATH_MSG_VERBOSE(" object selected in " << nspans << " span regions "
925  << obj->name());
926  }
927 
928  return spans;
929 }

◆ getDetachedObjects()

std::vector< Trk::DetachedTrackingVolume * > Muon::MuonTrackingGeometryBuilderImpl::getDetachedObjects ( const Trk::Volume trkVol,
std::vector< Trk::DetachedTrackingVolume * > &  blendVols,
LocalVariablesContainer aLVC,
int  mode = 0 
) const
protected

Private method to find detached volumes.

Definition at line 1806 of file MuonTrackingGeometryBuilderImpl.cxx.

1809  {
1810  // mode : 0 all, 1 active only, 2 inert only
1811 
1812  std::vector<Trk::DetachedTrackingVolume*> detTVs{};
1813 
1814  // get min/max Z/Phi from volume (allways a cylinder/bevelled cylinder
1815  // volume )
1816  auto cyl = dynamic_cast<const Trk::CylinderVolumeBounds*>(&(vol.volumeBounds()));
1817  auto bcyl = dynamic_cast<const Trk::BevelledCylinderVolumeBounds*>(&(vol.volumeBounds()));
1818 
1819  double rmed{0.}, dphi{0.}, hz{0.}, rMin{0.}, rMax{0.}, rMaxc{0.};
1820  int type = 0;
1821  if (cyl) {
1822  rmed = cyl->mediumRadius();
1823  dphi = cyl->halfPhiSector();
1824  hz = cyl->halflengthZ();
1825  rMin = cyl->innerRadius();
1826  rMax = cyl->outerRadius();
1827  rMaxc = rMax;
1828  } else if (bcyl) {
1829  rmed = bcyl->mediumRadius();
1830  dphi = bcyl->halfPhiSector();
1831  hz = bcyl->halflengthZ();
1832  rMin = bcyl->innerRadius();
1833  rMax = bcyl->outerRadius();
1834  rMaxc = rMax;
1835  type = bcyl->type();
1836  if (type > 1)
1837  rMaxc *= 1. / cos(dphi);
1838  } else {
1839  return detTVs;
1840  }
1841  const Amg::Vector3D center = vol.transform() * (rmed *Amg::Vector3D::UnitX());
1842 
1843  double zMin = center[2] - hz;
1844  double zMax = center[2] + hz;
1845  double pMin = 0.;
1846  double pMax = +2 * M_PI;
1847  bool phiLim = false;
1848  if (dphi < M_PI) {
1849  pMin = center.phi() - dphi + M_PI;
1850  pMax = center.phi() + dphi + M_PI;
1851  phiLim = true;
1852  }
1853 
1854  ATH_MSG_VERBOSE(" zMin " << zMin << " zMax " << zMax << " rMin " << rMin
1855  << " rMax " << rMax << " rMaxc " << rMaxc
1856  << " phi limits " << pMin << " phiMax " << pMax
1857  << " phiLim " << phiLim);
1858 
1859  // define detector region : can extend over several
1860  int gMin = (zMax <= -m_bigWheel) ? 0 : 1;
1861  if (zMin >= m_bigWheel)
1862  gMin = 8;
1863  else if (zMin >= aLVC.m_innerEndcapZ)
1864  gMin = 7;
1865  else if (zMin >= m_ectZ)
1866  gMin = 6;
1867  else if (zMin >= m_diskShieldZ)
1868  gMin = 5;
1869  else if (zMin >= -m_diskShieldZ)
1870  gMin = 4;
1871  else if (zMin >= -m_ectZ)
1872  gMin = 3;
1873  else if (zMin >= -aLVC.m_innerEndcapZ)
1874  gMin = 2;
1875  int gMax = (zMax >= m_bigWheel) ? 8 : 7;
1876  if (zMax <= -m_bigWheel)
1877  gMax = 0;
1878  else if (zMax <= -aLVC.m_innerEndcapZ)
1879  gMax = 1;
1880  else if (zMax <= -m_ectZ)
1881  gMax = 2;
1882  else if (zMax <= -m_diskShieldZ)
1883  gMax = 3;
1884  else if (zMax <= m_diskShieldZ)
1885  gMax = 4;
1886  else if (zMax <= m_ectZ)
1887  gMax = 5;
1888  else if (zMax <= aLVC.m_innerEndcapZ)
1889  gMax = 6;
1890 
1891  ATH_MSG_VERBOSE(" active volumes gMin " << gMin << " gMax " << gMax);
1892 
1893  // active, use corrected rMax
1894  if (mode < 2 && aLVC.m_stationSpan.size()) {
1895  for (int gMode = gMin; gMode <= gMax; gMode++) {
1896  for (const auto&[station, s] : (aLVC.m_stationSpan)[gMode]) {
1897  bool rLimit = !aLVC.m_static3d || (s->rMin <= rMaxc && s->rMax >= rMin);
1898  // Check meanZ for BME stations
1899  bool meanZOK = false;
1900  if (station->name() == "BME1_Station" ||
1901  station->name() == "BME2_Station") {
1902  if ((s->zMin + s->zMax) / 2. < zMax &&
1903  (s->zMin + s->zMax) / 2. > zMin)
1904  meanZOK = true;
1905  if ((s->phiMin + s->phiMax) / 2 < pMin && phiLim)
1906  meanZOK = false;
1907  // if ((s->phiMin + s->phiMax) / 2 < pMin && phiLim)
1908  // meanZOK = false;
1909  }
1910  if (rLimit &&
1911  ((s->zMin < zMax && s->zMax > zMin) || meanZOK)) {
1912  bool accepted = false;
1913  if (phiLim) {
1914  if (pMin >= 0 && pMax <= 2 * M_PI) {
1915  if (s->phiMin <= s->phiMax &&
1916  s->phiMin <= pMax && s->phiMax >= pMin)
1917  accepted = true;
1918  if (s->phiMin > s->phiMax &&
1919  (s->phiMin <= pMax || s->phiMax >= pMin))
1920  accepted = true;
1921  } else if (pMin < 0) {
1922  if (s->phiMin <= s->phiMax &&
1923  (s->phiMin <= pMax ||
1924  s->phiMax >= pMin + 2 * M_PI))
1925  accepted = true;
1926  if (s->phiMin > s->phiMax)
1927  accepted = true;
1928  } else if (pMax > 2 * M_PI) {
1929  if (s->phiMin <= s->phiMax &&
1930  (s->phiMin <= pMax - 2 * M_PI ||
1931  s->phiMax >= pMin))
1932  accepted = true;
1933  if (s->phiMin > s->phiMax)
1934  accepted = true;
1935  }
1936  } else
1937  accepted = true;
1938  if (meanZOK)
1939  accepted = true;
1940  if (accepted) {
1941  detTVs.push_back(station);
1942  ATH_MSG_VERBOSE(" active volume accepted by rLimit "
1943  << station->name() << " zMin " << zMin
1944  << " zMax " << zMax << " rMin " << rMin
1945  << " rMax " << rMax << " PhiMin "
1946  << pMin << " PhiMax " << pMax);
1947  }
1948  }
1949  }
1950  }
1951  }
1952  // passive
1953  if (mode != 1 && aLVC.m_inertSpan.size()) {
1954  for (int gMode = gMin; gMode <= gMax; gMode++) {
1955  for (const auto& [inert, s]: (aLVC.m_inertSpan)[gMode]) {
1956  bool rLimit = (!aLVC.m_static3d ||
1957  (s->rMin <= rMaxc && s->rMax >= rMin));
1958  if (rLimit && s->zMin < zMax && s->zMax > zMin) {
1959  bool accepted = false;
1960  if (phiLim) {
1961  if (pMin >= 0 && pMax <= 2 * M_PI) {
1962  if (s->phiMin <= s->phiMax &&
1963  s->phiMin <= pMax && s->phiMax >= pMin)
1964  accepted = true;
1965  if (s->phiMin > s->phiMax &&
1966  (s->phiMin <= pMax || s->phiMax >= pMin))
1967  accepted = true;
1968  } else if (pMin < 0) {
1969  if (s->phiMin <= s->phiMax &&
1970  (s->phiMin <= pMax ||
1971  s->phiMax >= pMin + 2 * M_PI))
1972  accepted = true;
1973  if (s->phiMin > s->phiMax)
1974  accepted = true;
1975  } else if (pMax > 2 * M_PI) {
1976  if (s->phiMin <= s->phiMax &&
1977  (s->phiMin <= pMax - 2 * M_PI ||
1978  s->phiMax >= pMin))
1979  accepted = true;
1980  if (s->phiMin > s->phiMax)
1981  accepted = true;
1982  }
1983  } else
1984  accepted = true;
1985  if (accepted) {
1986  bool perm =
1987  inert->name().compare(inert->name().size() - 4, 4,
1988  "PERM") == 0;
1989  if (!m_blendInertMaterial || !m_removeBlended || perm)
1990  detTVs.push_back(inert);
1991  if (m_blendInertMaterial && !perm)
1992  blendVols.push_back(inert);
1993  ATH_MSG_VERBOSE(" Inert volume accepted by rLimit "
1994  << inert->name() << " zMin " << zMin
1995  << " zMax " << zMax << " rMin " << rMin
1996  << " rMax " << rMax << " PhiMin "
1997  << pMin << " PhiMax " << pMax);
1998  }
1999  }
2000  }
2001  }
2002  }
2003  return detTVs;
2004 }

◆ getHParts()

void Muon::MuonTrackingGeometryBuilderImpl::getHParts ( LocalVariablesContainer aLVC) const
protected

Private method to retrieve h partition.

Definition at line 2396 of file MuonTrackingGeometryBuilderImpl.cxx.

2397  {
2398  // hardcode for the moment
2399  aLVC.m_hPartitions.clear(); // barrel, inner endcap, outer endcap
2400 
2401  // 0: barrel 2x2
2402  // non BT sector
2403  std::vector<std::pair<int, float> > barrelZ0F0;
2404  barrelZ0F0.emplace_back(0, aLVC.m_innerBarrelRadius);
2405  if (m_activeAdjustLevel > 0) {
2406  barrelZ0F0.emplace_back(0, 4450.); // for DiskShieldingBackDisk
2407  barrelZ0F0.emplace_back(0, 6500.); // BI/BM
2408  barrelZ0F0.emplace_back(0, 8900.); // BM/BO
2409  barrelZ0F0.emplace_back(0, 13000.); // outer envelope
2410  }
2411  barrelZ0F0.emplace_back(0, aLVC.m_outerBarrelRadius);
2412 
2413  std::vector<std::pair<int, float> > barrelZ0F1;
2414  barrelZ0F1.emplace_back(0, aLVC.m_innerBarrelRadius);
2415  if (m_inertAdjustLevel > 0) {
2416  barrelZ0F1.emplace_back(1, 4500.);
2417  barrelZ0F1.emplace_back(1, 5900.);
2418  } else if (m_activeAdjustLevel > 0)
2419  barrelZ0F1.emplace_back(0, 4450.);
2420  if (m_activeAdjustLevel > 0)
2421  barrelZ0F1.emplace_back(0, 6500.);
2422  if (m_inertAdjustLevel > 0)
2423  barrelZ0F1.emplace_back(1, 8900.);
2424  else if (m_activeAdjustLevel > 0)
2425  barrelZ0F1.emplace_back(0, 8900.);
2426  if (m_inertAdjustLevel > 0)
2427  barrelZ0F1.emplace_back(1, 10100.);
2428  barrelZ0F1.emplace_back(0, 13000.); // outer envelope
2429  barrelZ0F1.emplace_back(0, aLVC.m_outerBarrelRadius);
2430 
2431  // BT sector
2432  std::vector<std::pair<int, float> > barrelZ1F0;
2433  barrelZ1F0.emplace_back(0, aLVC.m_innerBarrelRadius);
2434  if (static_cast<int>(m_activeAdjustLevel) +
2435  static_cast<int>(m_inertAdjustLevel) >
2436  0)
2437  barrelZ1F0.emplace_back(0, 4450.);
2438  if (m_inertAdjustLevel > 0) {
2439  barrelZ1F0.emplace_back(1, 5800.);
2440  barrelZ1F0.emplace_back(1, 6500.);
2441  } else if (m_activeAdjustLevel > 0)
2442  barrelZ1F0.emplace_back(0, 6500.);
2443  if (m_inertAdjustLevel > 0) {
2444  barrelZ1F0.emplace_back(1, 6750.);
2445  barrelZ1F0.emplace_back(1, 8400.);
2446  }
2447  if (m_activeAdjustLevel > 0)
2448  barrelZ1F0.emplace_back(0, 8770.); // adapted for cryoring (from 8900)
2449  if (m_inertAdjustLevel > 0)
2450  barrelZ1F0.emplace_back(1, 9850.); // adapted for cryoring (from 9600)
2451  barrelZ1F0.emplace_back(0, 13000.); // outer envelope
2452  barrelZ1F0.emplace_back(0, aLVC.m_outerBarrelRadius);
2453 
2454  std::vector<std::pair<int, float> > barrelZ1F1;
2455  barrelZ1F1.emplace_back(0, aLVC.m_innerBarrelRadius);
2456  if (m_inertAdjustLevel > 0) {
2457  barrelZ1F1.emplace_back(1, 4500.);
2458  barrelZ1F1.emplace_back(1, 6000.);
2459  } else if (m_activeAdjustLevel > 0)
2460  barrelZ1F1.emplace_back(0, 4450.);
2461  if (m_activeAdjustLevel > 0)
2462  barrelZ1F1.emplace_back(0, 6500.);
2463  if (m_inertAdjustLevel > 0)
2464  barrelZ1F1.emplace_back(1, 6800.);
2465  if (m_inertAdjustLevel > 0) {
2466  barrelZ1F1.emplace_back(1, 8900.);
2467  barrelZ1F1.emplace_back(1, 10100.);
2468  } else if (m_activeAdjustLevel > 0)
2469  barrelZ1F1.emplace_back(0, 8900.);
2470  barrelZ1F1.emplace_back(0, 13000.); // outer envelope
2471  barrelZ1F1.emplace_back(0, aLVC.m_outerBarrelRadius);
2472 
2473  std::vector<std::vector<std::vector<std::pair<int, float> > > > barrelZF(2);
2474  barrelZF[0].push_back(barrelZ0F0);
2475  barrelZF[0].push_back(barrelZ0F1);
2476  barrelZF[1].push_back(barrelZ1F0);
2477  barrelZF[1].push_back(barrelZ1F1);
2478 
2479  // small wheel 1x2 ( no z BT sector)
2480  // non BT sector
2481  std::vector<std::pair<int, float> > swZ0F0;
2482  swZ0F0.emplace_back(0, m_innerShieldRadius);
2483  if (m_activeAdjustLevel > 1) {
2484  swZ0F0.emplace_back(0, 2700.);
2485  }
2486  if (static_cast<int>(m_activeAdjustLevel) +
2487  static_cast<int>(m_inertAdjustLevel) >
2488  0)
2489  swZ0F0.emplace_back(0, 4450.);
2490  if (m_activeAdjustLevel > 0) {
2491  swZ0F0.emplace_back(0, 6560.); // BI/BM
2492  swZ0F0.emplace_back(0, 8900.); // BM/BO
2493  }
2494  swZ0F0.emplace_back(0, aLVC.m_outerBarrelRadius);
2495 
2496  // phi BT sector
2497  std::vector<std::pair<int, float> > swZ0F1;
2498  swZ0F1.emplace_back(0, m_innerShieldRadius);
2499  if (m_activeAdjustLevel > 1)
2500  swZ0F1.emplace_back(0, 2700.);
2501  if (static_cast<int>(m_inertAdjustLevel) +
2502  static_cast<int>(m_activeAdjustLevel) >
2503  0)
2504  swZ0F1.emplace_back(0, 4450.);
2505  if (m_inertAdjustLevel > 0)
2506  swZ0F1.emplace_back(1, 5900.);
2507  if (m_activeAdjustLevel > 0)
2508  swZ0F1.emplace_back(0, 6560.);
2509  if (m_inertAdjustLevel > 0) {
2510  swZ0F1.emplace_back(1, 8900.);
2511  swZ0F1.emplace_back(1, 10100.);
2512  } else if (m_activeAdjustLevel > 0)
2513  swZ0F1.emplace_back(0, 8900.);
2514  swZ0F1.emplace_back(0, aLVC.m_outerBarrelRadius);
2515 
2516  std::vector<std::vector<std::vector<std::pair<int, float> > > > swZF(1);
2517  swZF[0].push_back(swZ0F0);
2518  swZF[0].push_back(swZ0F1);
2519 
2520  // inner endcap/ECT 2x3
2521  // ect coil, non-BT z
2522  std::vector<std::pair<int, float> > innerZ0F0;
2523  innerZ0F0.emplace_back(0, m_innerShieldRadius);
2524  if (m_inertAdjustLevel > 0)
2525  innerZ0F0.emplace_back(0, 1100.);
2526  if (m_inertAdjustLevel > 1)
2527  innerZ0F0.emplace_back(1, 5150.);
2528  if (m_inertAdjustLevel > 0)
2529  innerZ0F0.emplace_back(1, 5300.);
2530  if (m_activeAdjustLevel > 0) {
2531  innerZ0F0.emplace_back(0, 6500.);
2532  innerZ0F0.emplace_back(0, 8900.);
2533  }
2534  innerZ0F0.emplace_back(0, aLVC.m_outerBarrelRadius);
2535 
2536  // coil gap, non-BT z
2537  std::vector<std::pair<int, float> > innerZ0F1;
2538  innerZ0F1.emplace_back(0, m_innerShieldRadius);
2539  if (m_inertAdjustLevel > 0)
2540  innerZ0F1.emplace_back(0, 1100.);
2541  if (m_inertAdjustLevel > 1) {
2542  innerZ0F1.emplace_back(1, 1400.);
2543  innerZ0F1.emplace_back(1, 1685.);
2544  }
2545  if (m_inertAdjustLevel > 0) {
2546  innerZ0F1.emplace_back(1, 4700.);
2547  innerZ0F1.emplace_back(1, 5900.);
2548  }
2549  if (m_activeAdjustLevel > 0) {
2550  innerZ0F1.emplace_back(0, 6500.);
2551  innerZ0F1.emplace_back(0, 8900.);
2552  }
2553  innerZ0F1.emplace_back(0, aLVC.m_outerBarrelRadius);
2554 
2555  // BT coil, no-BT z
2556  std::vector<std::pair<int, float> > innerZ0F2;
2557  innerZ0F2.emplace_back(0, m_innerShieldRadius);
2558  if (m_inertAdjustLevel > 0)
2559  innerZ0F2.emplace_back(0, 1100.);
2560  if (m_inertAdjustLevel > 1) {
2561  innerZ0F2.emplace_back(1, 1400.);
2562  innerZ0F2.emplace_back(1, 1685.);
2563  }
2564  if (m_inertAdjustLevel > 0) {
2565  innerZ0F2.emplace_back(1, 4450.);
2566  innerZ0F2.emplace_back(1, 5900.);
2567  }
2568  if (m_activeAdjustLevel > 0)
2569  innerZ0F2.emplace_back(0, 6500.);
2570  if (m_inertAdjustLevel > 0) {
2571  innerZ0F2.emplace_back(1, 8900.);
2572  innerZ0F2.emplace_back(1, 10100.);
2573  } else if (m_activeAdjustLevel > 0)
2574  innerZ0F2.emplace_back(0, 8900.);
2575  innerZ0F2.emplace_back(0, aLVC.m_outerBarrelRadius);
2576 
2577  // ect coil, z BT sector
2578  std::vector<std::pair<int, float> > innerZ1F0;
2579  innerZ1F0.emplace_back(0, m_innerShieldRadius);
2580  if (m_inertAdjustLevel > 0)
2581  innerZ1F0.emplace_back(0, 1100.);
2582  if (m_inertAdjustLevel > 1)
2583  innerZ1F0.emplace_back(1, 5150.);
2584  if (m_inertAdjustLevel > 0)
2585  innerZ1F0.emplace_back(1, 5300.);
2586  if (m_inertAdjustLevel > 0)
2587  innerZ1F0.emplace_back(1, 5800.);
2588  if (m_inertAdjustLevel > 0)
2589  innerZ1F0.emplace_back(1, 6750.);
2590  else if (m_activeAdjustLevel > 0)
2591  innerZ1F0.emplace_back(0, 6500.);
2592  if (m_inertAdjustLevel > 0) {
2593  innerZ1F0.emplace_back(1, 8400.);
2594  innerZ1F0.emplace_back(1, 9600.);
2595  } else if (m_activeAdjustLevel > 0)
2596  innerZ1F0.emplace_back(0, 8900.);
2597  innerZ1F0.emplace_back(0, aLVC.m_outerBarrelRadius);
2598 
2599  // coil gap, BT z sector
2600  std::vector<std::pair<int, float> > innerZ1F1;
2601  innerZ1F1.emplace_back(0, m_innerShieldRadius);
2602  if (m_inertAdjustLevel > 0)
2603  innerZ1F1.emplace_back(0, 1100.);
2604  if (m_inertAdjustLevel > 1) {
2605  innerZ1F1.emplace_back(1, 1400.);
2606  innerZ1F1.emplace_back(1, 1685.);
2607  }
2608  if (m_inertAdjustLevel > 0) {
2609  innerZ1F1.emplace_back(1, 4700.);
2610  innerZ1F1.emplace_back(1, 5800.);
2611  innerZ1F1.emplace_back(1, 6750.);
2612  } else if (m_activeAdjustLevel > 0)
2613  innerZ1F1.emplace_back(0, 6500.);
2614  if (m_inertAdjustLevel > 0) {
2615  innerZ1F1.emplace_back(1, 8400.);
2616  innerZ1F1.emplace_back(1, 9600.);
2617  } else if (m_activeAdjustLevel > 0)
2618  innerZ1F1.emplace_back(0, 8900.);
2619  innerZ1F1.emplace_back(0, aLVC.m_outerBarrelRadius);
2620 
2621  // BT coil, BT z sector
2622  std::vector<std::pair<int, float> > innerZ1F2;
2623  innerZ1F2.emplace_back(0, m_innerShieldRadius);
2624  if (m_inertAdjustLevel > 0)
2625  innerZ1F2.emplace_back(0, 1100.);
2626  if (m_inertAdjustLevel > 1) {
2627  innerZ1F2.emplace_back(1, 1400.);
2628  innerZ1F2.emplace_back(1, 1685.);
2629  }
2630  innerZ1F2.emplace_back(0, 4150.);
2631  if (m_inertAdjustLevel > 0) {
2632  innerZ1F2.emplace_back(1, 4700.);
2633  innerZ1F2.emplace_back(1, 5900.);
2634  innerZ1F2.emplace_back(1, 6800.);
2635  } else if (m_activeAdjustLevel > 0)
2636  innerZ1F2.emplace_back(0, 6500.);
2637  if (m_inertAdjustLevel > 0) {
2638  innerZ1F2.emplace_back(1, 8900.);
2639  innerZ1F2.emplace_back(1, 10100.);
2640  } else if (m_activeAdjustLevel > 0)
2641  innerZ1F2.emplace_back(0, 8900.);
2642  innerZ1F2.emplace_back(0, aLVC.m_outerBarrelRadius);
2643 
2644  std::vector<std::vector<std::vector<std::pair<int, float> > > > innerZF(2);
2645  innerZF[0].push_back(innerZ0F0);
2646  innerZF[0].push_back(innerZ0F1);
2647  innerZF[0].push_back(innerZ0F2);
2648  innerZF[1].push_back(innerZ1F0);
2649  innerZF[1].push_back(innerZ1F1);
2650  innerZF[1].push_back(innerZ1F2);
2651 
2652  // outer 1x1
2653  std::vector<std::pair<int, float> > outerZ0F0;
2654  outerZ0F0.emplace_back(0, m_outerShieldRadius);
2655  outerZ0F0.emplace_back(0, 2750.); // outer envelope
2656  outerZ0F0.emplace_back(0, 12650.); // outer envelope
2657  outerZ0F0.emplace_back(0, 13400.); // outer envelope
2658  outerZ0F0.emplace_back(0, aLVC.m_outerBarrelRadius);
2659 
2660  std::vector<std::pair<int, float> > outerZ0F1;
2661  outerZ0F1.emplace_back(0, m_outerShieldRadius);
2662  outerZ0F1.emplace_back(0, 2750.); // outer envelope
2663  if (m_activeAdjustLevel > 0) {
2664  outerZ0F1.emplace_back(0, 3600.);
2665  outerZ0F1.emplace_back(0, 5300.);
2666  outerZ0F1.emplace_back(0, 7000.);
2667  outerZ0F1.emplace_back(0, 8500.);
2668  outerZ0F1.emplace_back(0, 10000.);
2669  outerZ0F1.emplace_back(0, 12000.);
2670  }
2671  outerZ0F1.emplace_back(0, 12650.); // outer envelope
2672  outerZ0F1.emplace_back(0, 13400.); // outer envelope
2673  outerZ0F1.emplace_back(0, aLVC.m_outerBarrelRadius);
2674 
2675  std::vector<std::vector<std::vector<std::pair<int, float> > > > outerZF(2);
2676  outerZF[0].push_back(outerZ0F0);
2677  outerZF[0].push_back(outerZ0F0);
2678  outerZF[0].push_back(outerZ0F0);
2679  outerZF[1].push_back(outerZ0F1);
2680  outerZF[1].push_back(outerZ0F1);
2681  outerZF[1].push_back(outerZ0F1);
2682 
2683  // collect everything
2684  aLVC.m_hPartitions.push_back(barrelZF);
2685  aLVC.m_hPartitions.push_back(swZF);
2686  aLVC.m_hPartitions.push_back(innerZF);
2687  aLVC.m_hPartitions.push_back(outerZF);
2688 }

◆ getPhiParts()

void Muon::MuonTrackingGeometryBuilderImpl::getPhiParts ( int  mode,
LocalVariablesContainer aLVC 
) const
protected

Private method to retrieve phi partition.

Definition at line 2319 of file MuonTrackingGeometryBuilderImpl.cxx.

2320  {
2321  if (mode == 0) { // trivial
2322  aLVC.m_adjustedPhi.clear();
2323  aLVC.m_adjustedPhiType.clear();
2324  aLVC.m_adjustedPhi.push_back(0.);
2325  aLVC.m_adjustedPhiType.push_back(0);
2326 
2327  } else if (mode == 1) {
2328  int phiNum = 1;
2329  if (m_activeAdjustLevel > 0)
2330  phiNum = m_phiPartition;
2331  aLVC.m_adjustedPhi.resize(phiNum);
2332  aLVC.m_adjustedPhiType.resize(phiNum);
2333  aLVC.m_adjustedPhi[0] = 0.;
2334  aLVC.m_adjustedPhiType[0] = 0;
2335  int ic = 0;
2336  while (ic < phiNum - 1) {
2337  ic++;
2338  aLVC.m_adjustedPhi[ic] =
2339  aLVC.m_adjustedPhi[ic - 1] + 2. * M_PI / phiNum;
2340  aLVC.m_adjustedPhiType[ic] = 0;
2341  }
2342 
2343  } else if (mode == 2) { // barrel(BT)
2344  // hardcode for the moment
2345  aLVC.m_adjustedPhi.resize(16);
2346  aLVC.m_adjustedPhiType.resize(16);
2347 
2348  double phiSect[2];
2349  phiSect[0] = (M_PI / 8 - 0.105);
2350  phiSect[1] = 0.105;
2351 
2352  aLVC.m_adjustedPhi[0] = -phiSect[0];
2353  aLVC.m_adjustedPhiType[0] = 0;
2354  int ic = 0;
2355  int is = 1;
2356 
2357  while (ic < 15) {
2358  ic++;
2359  is = 1 - is;
2360  aLVC.m_adjustedPhi[ic] =
2361  aLVC.m_adjustedPhi[ic - 1] + 2 * phiSect[is];
2362  aLVC.m_adjustedPhiType[ic] = 1 - is;
2363  }
2364 
2365  } else if (mode == 3) { // ECT(+BT)
2366  // hardcode for the moment
2367  aLVC.m_adjustedPhi.resize(32);
2368  aLVC.m_adjustedPhiType.resize(32);
2369 
2370  double phiSect[3];
2371  phiSect[0] = 0.126;
2372  phiSect[2] = 0.105;
2373  phiSect[1] = 0.5 * (M_PI / 8. - phiSect[0] - phiSect[2]);
2374 
2375  aLVC.m_adjustedPhi[0] = -phiSect[0];
2376  aLVC.m_adjustedPhiType[0] = 0;
2377  aLVC.m_adjustedPhi[1] = aLVC.m_adjustedPhi[0] + 2 * phiSect[0];
2378  aLVC.m_adjustedPhiType[1] = 1;
2379  int ic = 1;
2380  int is = 0;
2381 
2382  while (ic < 31) {
2383  ic++;
2384  is = 2 - is;
2385  aLVC.m_adjustedPhi[ic] =
2386  aLVC.m_adjustedPhi[ic - 1] + 2 * phiSect[1];
2387  aLVC.m_adjustedPhiType[ic] = is;
2388  ic++;
2389  aLVC.m_adjustedPhi[ic] =
2390  aLVC.m_adjustedPhi[ic - 1] + 2 * phiSect[is];
2391  aLVC.m_adjustedPhiType[ic] = 1;
2392  }
2393  }
2394 }

◆ getShieldParts()

void Muon::MuonTrackingGeometryBuilderImpl::getShieldParts ( LocalVariablesContainer aLVC) const
protected

Private method to retrieve shield partition.

Definition at line 2690 of file MuonTrackingGeometryBuilderImpl.cxx.

2691  {
2692  aLVC.m_shieldZPart.resize(18);
2693 
2694  aLVC.m_shieldZPart[0] = -21900.; // elm2
2695  aLVC.m_shieldZPart[1] = -21500.; // elm1
2696  aLVC.m_shieldZPart[2] = -21000.; // octogon
2697  aLVC.m_shieldZPart[3] = -18000.; // tube
2698  aLVC.m_shieldZPart[4] = -12882.; // ect
2699  aLVC.m_shieldZPart[5] = -7930.; // ect
2700  aLVC.m_shieldZPart[6] = -7914.; // cone
2701  aLVC.m_shieldZPart[7] = -6941.; // disk
2702  aLVC.m_shieldZPart[8] = -6783.; //
2703  for (unsigned int i = 9; i < 18; i++)
2704  aLVC.m_shieldZPart[i] = -aLVC.m_shieldZPart[17 - i];
2705 
2706  aLVC.m_shieldHPart.clear();
2707 
2708  std::vector<std::pair<int, float> > outerShield;
2709  outerShield.emplace_back(0, m_beamPipeRadius);
2710  outerShield.emplace_back(0, 279.); // outer envelope
2711  outerShield.emplace_back(0, 436.7); // outer envelope
2712  outerShield.emplace_back(0, 1050.); // outer envelope
2713  outerShield.emplace_back(0, m_outerShieldRadius);
2714  aLVC.m_shieldHPart.push_back(outerShield);
2715 
2716  std::vector<std::pair<int, float> > innerShield;
2717  innerShield.emplace_back(0, m_beamPipeRadius);
2718  innerShield.emplace_back(0, 530.);
2719  innerShield.emplace_back(0, m_innerShieldRadius);
2720  aLVC.m_shieldHPart.push_back(innerShield);
2721 
2722  std::vector<std::pair<int, float> > diskShield;
2723  diskShield.emplace_back(0, 0.);
2724  diskShield.emplace_back(0, 540.);
2725  diskShield.emplace_back(0, 750.);
2726  diskShield.emplace_back(0, 2700.);
2727  diskShield.emplace_back(0, 4255.);
2728  aLVC.m_shieldHPart.push_back(diskShield);
2729 }

◆ getZParts()

void Muon::MuonTrackingGeometryBuilderImpl::getZParts ( LocalVariablesContainer aLVC) const
protected

Private method to retrieve z partition.

Definition at line 2083 of file MuonTrackingGeometryBuilderImpl.cxx.

2084  {
2085  // activeAdjustLevel: 1: separate MDT stations
2086  // +(inertLevel=0) barrel Z partition
2087  // 2: split TGC
2088  // +(inertLevel=0) barrel R partition
2089  // 3: split TGC supports
2090  // inertAdjustLevel: 1: BT,ECT
2091 
2092  // hardcode for the moment
2093  aLVC.m_zPartitions.clear();
2094  aLVC.m_zPartitionsType.clear();
2095  aLVC.m_zPartitions.reserve(120);
2096  aLVC.m_zPartitionsType.reserve(120);
2097 
2098  // outer endcap
2099  aLVC.m_zPartitions.push_back(-aLVC.m_outerEndcapZ);
2100  aLVC.m_zPartitionsType.push_back(1); // EO
2101  aLVC.m_zPartitions.push_back(-23001.);
2102  aLVC.m_zPartitionsType.push_back(1); // oute envelope change
2103  // if (m_activeAdjustLevel>0) { m_zPartitions.push_back(-21630.);
2104  // m_zPartitionsType.push_back(1); } // EOL
2105  aLVC.m_zPartitions.push_back(-22030.);
2106  aLVC.m_zPartitionsType.push_back(1); // EOL
2107  aLVC.m_zPartitions.push_back(-m_outerWheel);
2108  aLVC.m_zPartitionsType.push_back(0); // Octogon
2109  // m_zPartitions.push_back(-17990.); m_zPartitionsType.push_back(0); //
2110  // buffer
2111  aLVC.m_zPartitions.push_back(-18650.);
2112  aLVC.m_zPartitionsType.push_back(0); // buffer
2113  aLVC.m_zPartitions.push_back(-m_bigWheel);
2114  aLVC.m_zPartitionsType.push_back(1); // TGC3
2115  if (m_activeAdjustLevel > 2) {
2116  aLVC.m_zPartitions.push_back(-15225.);
2117  aLVC.m_zPartitionsType.push_back(1);
2118  }
2119  if (m_activeAdjustLevel > 1) {
2120  aLVC.m_zPartitions.push_back(-15172.);
2121  aLVC.m_zPartitionsType.push_back(1);
2122  } // end supp
2123  if (m_activeAdjustLevel > 2) {
2124  aLVC.m_zPartitions.push_back(-15128.);
2125  aLVC.m_zPartitionsType.push_back(1);
2126  } // supp
2127  if (m_activeAdjustLevel > 2) {
2128  aLVC.m_zPartitions.push_back(-15070.);
2129  aLVC.m_zPartitionsType.push_back(1);
2130  }
2131  if (m_activeAdjustLevel > 0) {
2132  aLVC.m_zPartitions.push_back(-14940.);
2133  aLVC.m_zPartitionsType.push_back(1);
2134  } //
2135  if (m_activeAdjustLevel > 2) {
2136  aLVC.m_zPartitions.push_back(-14805.);
2137  aLVC.m_zPartitionsType.push_back(1);
2138  }
2139  if (m_activeAdjustLevel > 1) {
2140  aLVC.m_zPartitions.push_back(-14733.);
2141  aLVC.m_zPartitionsType.push_back(1);
2142  } // end supp.
2143  if (m_activeAdjustLevel > 2) {
2144  aLVC.m_zPartitions.push_back(-14708.);
2145  aLVC.m_zPartitionsType.push_back(1);
2146  } // supp.
2147  if (m_activeAdjustLevel > 2) {
2148  aLVC.m_zPartitions.push_back(-14650.);
2149  aLVC.m_zPartitionsType.push_back(1);
2150  } //
2151  if (m_activeAdjustLevel > 0) {
2152  aLVC.m_zPartitions.push_back(-14560.);
2153  aLVC.m_zPartitionsType.push_back(1);
2154  } // EML
2155  if (m_activeAdjustLevel > 0) {
2156  aLVC.m_zPartitions.push_back(-14080.);
2157  aLVC.m_zPartitionsType.push_back(1);
2158  } // EMS
2159  if (m_activeAdjustLevel > 0) {
2160  aLVC.m_zPartitions.push_back(-13620.);
2161  aLVC.m_zPartitionsType.push_back(1);
2162  } // TGC
2163  if (m_activeAdjustLevel > 2) {
2164  aLVC.m_zPartitions.push_back(-13525.);
2165  aLVC.m_zPartitionsType.push_back(1);
2166  } // TGC
2167  if (m_activeAdjustLevel > 1) {
2168  aLVC.m_zPartitions.push_back(-13448.5);
2169  aLVC.m_zPartitionsType.push_back(1);
2170  } // end supp.
2171  if (m_activeAdjustLevel > 2) {
2172  aLVC.m_zPartitions.push_back(-13421.5);
2173  aLVC.m_zPartitionsType.push_back(1);
2174  } // supp.
2175  if (m_activeAdjustLevel > 2) {
2176  aLVC.m_zPartitions.push_back(-13346);
2177  aLVC.m_zPartitionsType.push_back(1);
2178  } // TGC
2179 
2180  // inner endcap
2181  aLVC.m_zPartitions.push_back(-aLVC.m_innerEndcapZ);
2182  aLVC.m_zPartitionsType.push_back(0); //
2183  if (m_inertAdjustLevel > 0) {
2184  aLVC.m_zPartitions.push_back(-12790);
2185  aLVC.m_zPartitionsType.push_back(0);
2186  } // ECT
2187  if (m_inertAdjustLevel > 1) {
2188  aLVC.m_zPartitions.push_back(-12100.);
2189  aLVC.m_zPartitionsType.push_back(0);
2190  } //
2191  if (m_inertAdjustLevel > 0) {
2192  aLVC.m_zPartitions.push_back(-12000.);
2193  aLVC.m_zPartitionsType.push_back(0);
2194  } //
2195  if (m_inertAdjustLevel > 0) {
2196  aLVC.m_zPartitions.push_back(-11210.);
2197  aLVC.m_zPartitionsType.push_back(1);
2198  } // BT
2199  if (m_inertAdjustLevel > 0) {
2200  aLVC.m_zPartitions.push_back(-10480.);
2201  aLVC.m_zPartitionsType.push_back(0);
2202  } //
2203  if (m_inertAdjustLevel > 0) {
2204  aLVC.m_zPartitions.push_back(-9700.);
2205  aLVC.m_zPartitionsType.push_back(0);
2206  } //
2207  if (m_inertAdjustLevel > 1) {
2208  aLVC.m_zPartitions.push_back(-9300.);
2209  aLVC.m_zPartitionsType.push_back(0);
2210  } // rib
2211  if (m_inertAdjustLevel > 1) {
2212  aLVC.m_zPartitions.push_back(-8800.);
2213  aLVC.m_zPartitionsType.push_back(0);
2214  } // ect
2215  if (m_inertAdjustLevel > 0) {
2216  aLVC.m_zPartitions.push_back(-8610.);
2217  aLVC.m_zPartitionsType.push_back(1);
2218  } // BT
2219  if (m_inertAdjustLevel > 0) {
2220  aLVC.m_zPartitions.push_back(-8000.);
2221  aLVC.m_zPartitionsType.push_back(1);
2222  } // BT
2223  aLVC.m_zPartitions.push_back(-m_ectZ);
2224  aLVC.m_zPartitionsType.push_back(0); // ECT/small wheel
2225  if (m_activeAdjustLevel > 0) {
2226  aLVC.m_zPartitions.push_back(-7450.);
2227  aLVC.m_zPartitionsType.push_back(0);
2228  } // EIS
2229  if (m_activeAdjustLevel > 2) {
2230  aLVC.m_zPartitions.push_back(-7364.);
2231  aLVC.m_zPartitionsType.push_back(0);
2232  } // EIS
2233  if (m_activeAdjustLevel > 0 || m_inertAdjustLevel > 0) {
2234  aLVC.m_zPartitions.push_back(-7170.);
2235  aLVC.m_zPartitionsType.push_back(0);
2236  } // cone assembly,TGC
2237  if (m_activeAdjustLevel > 0) {
2238  aLVC.m_zPartitions.push_back(-7030.);
2239  aLVC.m_zPartitionsType.push_back(0);
2240  } // TGC
2241  if (m_activeAdjustLevel > 2) {
2242  aLVC.m_zPartitions.push_back(-6978.);
2243  aLVC.m_zPartitionsType.push_back(0);
2244  } // TGC
2245 
2246  // barrel
2247  aLVC.m_zPartitions.push_back(-m_diskShieldZ);
2248  aLVC.m_zPartitionsType.push_back(0); // disk
2249  if (m_inertAdjustLevel > 0) {
2250  aLVC.m_zPartitions.push_back(-6829.);
2251  aLVC.m_zPartitionsType.push_back(0);
2252  } // back disk
2253  // if (m_inertAdjustLevel>1) { (*m_zPartitions).push_back(-6600.);
2254  // m_zPartitionsType.push_back(0); } //
2255  aLVC.m_zPartitions.push_back(-6550.);
2256  aLVC.m_zPartitionsType.push_back(0); // outer envelope change
2257  if (m_activeAdjustLevel > 0) {
2258  aLVC.m_zPartitions.push_back(-6100.);
2259  aLVC.m_zPartitionsType.push_back(0);
2260  }
2261  if (m_inertAdjustLevel > 0) {
2262  aLVC.m_zPartitions.push_back(-5503.);
2263  aLVC.m_zPartitionsType.push_back(1);
2264  } // BT
2265  if (m_inertAdjustLevel > 0) {
2266  aLVC.m_zPartitions.push_back(-4772.);
2267  aLVC.m_zPartitionsType.push_back(0);
2268  } //
2269  if (m_activeAdjustLevel > 0) {
2270  aLVC.m_zPartitions.push_back(-4300.);
2271  aLVC.m_zPartitionsType.push_back(0);
2272  } //
2273  aLVC.m_zPartitions.push_back(-4000.);
2274  aLVC.m_zPartitionsType.push_back(0); // outer envelope change
2275  if (m_inertAdjustLevel > 1) {
2276  aLVC.m_zPartitions.push_back(-3700.);
2277  aLVC.m_zPartitionsType.push_back(0);
2278  } //
2279  if (m_inertAdjustLevel > 1) {
2280  aLVC.m_zPartitions.push_back(-3300.);
2281  aLVC.m_zPartitionsType.push_back(0);
2282  } //
2283  if (m_activeAdjustLevel > 0) {
2284  aLVC.m_zPartitions.push_back(-2600.);
2285  aLVC.m_zPartitionsType.push_back(0);
2286  } //
2287  if (m_inertAdjustLevel > 0) {
2288  aLVC.m_zPartitions.push_back(-2078.);
2289  aLVC.m_zPartitionsType.push_back(1);
2290  } // BT
2291  if (m_inertAdjustLevel > 0) {
2292  aLVC.m_zPartitions.push_back(-1347.);
2293  aLVC.m_zPartitionsType.push_back(1);
2294  } // cryoring
2295  if (m_activeAdjustLevel > 0) {
2296  aLVC.m_zPartitions.push_back(-800.);
2297  aLVC.m_zPartitionsType.push_back(1);
2298  } // cryoring
2299  if (m_inertAdjustLevel > 1) {
2300  aLVC.m_zPartitions.push_back(-300.);
2301  aLVC.m_zPartitionsType.push_back(0);
2302  } //
2303  if (static_cast<int>(m_inertAdjustLevel) +
2304  static_cast<int>(m_activeAdjustLevel) <
2305  1) {
2306  aLVC.m_zPartitions.push_back(-0.7 * m_diskShieldZ);
2307  aLVC.m_zPartitionsType.push_back(0);
2308  } //
2309 
2310  unsigned int zSiz = aLVC.m_zPartitions.size();
2311  for (unsigned int i = 0; i < zSiz; i++) {
2312  aLVC.m_zPartitions.push_back(-aLVC.m_zPartitions[zSiz - 1 - i]);
2313  if (i < zSiz - 1)
2314  aLVC.m_zPartitionsType.push_back(
2315  aLVC.m_zPartitionsType[zSiz - 2 - i]);
2316  }
2317 }

◆ initialize()

StatusCode Muon::MuonTrackingGeometryBuilderImpl::initialize ( )
overridevirtual

AlgTool initailize method.

Reimplemented in Muon::MuonTrackingGeometryBuilderCond, and Muon::MuonTrackingGeometryBuilder.

Definition at line 65 of file MuonTrackingGeometryBuilderImpl.cxx.

65  {
66  // Retrieve the tracking volume helper
67  // -------------------------------------------------
70  if (m_loadMSentry) {
71  // retrieve envelope definition service
72  // --------------------------------------------------
74  }
75 
76  ATH_MSG_DEBUG( " initialize() successful");
77  return StatusCode::SUCCESS;
78 }

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

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

◆ processShield()

TrackingVolumePtr Muon::MuonTrackingGeometryBuilderImpl::processShield ( const Trk::Volume vol,
int  type,
const std::string &  volumeName,
LocalVariablesContainer aLVC,
bool  hasStations 
) const
protected

Fix me

Definition at line 1614 of file MuonTrackingGeometryBuilderImpl.cxx.

1618  {
1619  ATH_MSG_VERBOSE( "processing shield volume " << volumeName
1620  << " in mode:" << type);
1621 
1622  TrackingVolumePtr tVol{};
1623 
1624  unsigned int colorCode = m_colorCode;
1625 
1626  std::vector<Trk::DetachedTrackingVolume*> blendVols;
1627 
1628  // getPartitionFromMaterial(vol);
1629 
1630  // retrieve cylinder
1631  auto cyl = dynamic_cast<const Trk::CylinderVolumeBounds*>(&(vol.volumeBounds()));
1632  if (!cyl) {
1633  ATH_MSG_ERROR(" process volume: volume cylinder boundaries not retrieved, return 0 ");
1634  return nullptr;
1635  }
1636  // create vector of zSteps for this volume
1637  std::vector<float> zSteps;
1638  zSteps.clear();
1639  double zPos = vol.center().z();
1640  double hz = cyl->halflengthZ();
1641  double z1 = zPos - hz;
1642  double z2 = zPos + hz;
1643  zSteps.push_back(z1);
1644  for (double iz : aLVC.m_shieldZPart) {
1645  if (iz > z1 && iz < z2) {
1646  zSteps.push_back(iz);
1647  z1 = iz;
1648  }
1649  }
1650  zSteps.push_back(z2);
1651 
1652  // phi binning trivial
1653  aLVC.m_adjustedPhi.clear();
1654  aLVC.m_adjustedPhi.push_back(0.);
1655 
1656  unsigned int etaN = zSteps.size() - 1;
1657 
1658  // create z,h bin utilities
1659  auto zBinUtil = std::make_unique<Trk::BinUtility>(zSteps, Trk::BinningOption::open,
1661  auto pBinUtil = std::make_unique<Trk::BinUtility>(1, -M_PI, M_PI, Trk::BinningOption::closed,
1663  std::vector<std::vector<std::unique_ptr<Trk::BinUtility>> > hBinUtil{};
1664  float phiRef = 0.;
1665  for (unsigned iz = 0; iz < zSteps.size() - 1; iz++) {
1666  std::vector<std::unique_ptr<Trk::BinUtility>> phBinUtil;
1667  phBinUtil.push_back(std::make_unique<Trk::BinUtility>(phiRef, aLVC.m_shieldHPart[type]));
1668  hBinUtil.push_back(std::move(phBinUtil));
1669  }
1670 
1671 
1672  // create subvolumes & BinnedArray
1673  std::vector<Trk::TrackingVolumeOrderPosition> subVolumesVect;
1674  std::vector<std::vector<std::vector<Trk::TrackingVolume*>>> subVolumes;
1675  std::vector<std::vector<std::shared_ptr<Trk::BinnedArray<Trk::TrackingVolume>>>> hBins;
1676  std::vector<Trk::TrackingVolume*> sVolsInn; // for gluing
1677  std::vector<Trk::TrackingVolume*> sVolsOut; // for gluing
1678  std::vector<Trk::TrackingVolume*> sVolsNeg; // for gluing
1679  std::vector<Trk::TrackingVolume*> sVolsPos; // for gluing
1680  for (unsigned int eta = 0; eta < zSteps.size() - 1; eta++) {
1681  if (colorCode > 0)
1682  colorCode = 26 - colorCode;
1683  double posZ = 0.5 * (zSteps[eta] + zSteps[eta + 1]);
1684  double hZ = 0.5 * std::abs(zSteps[eta + 1] - zSteps[eta]);
1685  std::vector<std::vector<Trk::TrackingVolume*> > phiSubs;
1686  std::vector<std::shared_ptr<Trk::BinnedArray<Trk::TrackingVolume>>> phBins{};
1687  int phi = 0;
1688  double posPhi = 0.;
1689  double phiSect = M_PI;
1690  std::vector<std::pair<int, float> > hSteps = aLVC.m_shieldHPart[type];
1691  std::vector<Trk::TrackingVolume*> hSubs;
1692  std::vector<Trk::TrackingVolumeOrderPosition> hSubsTr;
1693  unsigned int hCode = 1;
1694  for (unsigned int h = 0; h < hSteps.size() - 1; h++) {
1695  hCode = (colorCode > 0) ? 1 - hCode : 0;
1696  // define subvolume
1697  auto subBds = std::make_unique<Trk::CylinderVolumeBounds>(hSteps[h].second, hSteps[h + 1].second, phiSect, hZ);
1698  const double mediumRadius = subBds->mediumRadius();
1700  Trk::Volume subVol(makeTransform(transf), subBds.release());
1701 
1702  // enclosed muon objects ? also adjusts material properties in case
1703  // of material blend
1704  std::string volName = volumeName + MuonGM::buildString(eta, 2) +
1705  MuonGM::buildString(phi, 2) +
1706  MuonGM::buildString(h, 2);
1707  blendVols.clear();
1708  std::vector<Trk::DetachedTrackingVolume*> detVols{};
1709  if (hasStations) {
1710  detVols = getDetachedObjects(subVol, blendVols, aLVC);
1711  }
1712  auto detVolPtr = std::make_unique<std::vector<Trk::DetachedTrackingVolume*>>(detVols);
1713  auto sVol = std::make_unique<Trk::TrackingVolume>(subVol, aLVC.m_muonMaterial,
1714  detVolPtr.release(), volName);
1715 
1716  // statistics
1717  ++aLVC.m_frameNum;
1718  aLVC.m_frameStat += detVols.size();
1719  // prepare blending
1720  if (m_blendInertMaterial && !blendVols.empty()) {
1721  for (auto& blendVol : blendVols) {
1722  aLVC.m_blendMap[blendVol].push_back(sVol.get());
1723  }
1724  }
1725  // reference point for the check of envelope
1726  double posR = 0.5 * (hSteps[h].second + hSteps[h + 1].second);
1727  // loop over inner cutouts
1728  for (unsigned int in = 1; in < aLVC.m_msCutoutsIn.size(); in++) {
1729  if (posZ >= aLVC.m_msCutoutsIn[in].second &&
1730  posZ <= aLVC.m_msCutoutsIn[in - 1].second) {
1731  if (posR < aLVC.m_msCutoutsIn[in].first)
1732  sVol->sign(Trk::BeamPipe);
1733  break;
1734  }
1735  }
1736  //
1737  sVol->registerColorCode(colorCode + hCode);
1738  // reference position
1739  const Amg::Vector3D gp = mediumRadius * Amg::Vector3D::UnitX();
1740  hSubs.push_back(sVol.get());
1741 
1742  // glue subVolume
1743  if (h == 0)
1744  sVolsInn.push_back(sVol.get());
1745  if (h == hSteps.size() - 2)
1746  sVolsOut.push_back(sVol.get());
1747  if (eta == 0)
1748  sVolsNeg.push_back(sVol.get());
1749  if (eta == etaN - 1)
1750  sVolsPos.push_back(sVol.get());
1751  // in R/H
1752  if (h > 0) { // glue 'manually'
1753  m_trackingVolumeHelper->setInsideTrackingVolume(*sVol,
1755  hSubs[h - 1]);
1756  m_trackingVolumeHelper->setOutsideTrackingVolume(*hSubs[h - 1],
1758  sVol.get());
1759  }
1760  // in eta
1761  if (etaN > 1 && eta > 0)
1762  m_trackingVolumeHelper->setOutsideTrackingVolumeArray(*sVol,
1764  hBins[eta - 1][phi]);
1765 
1766  subVolumesVect.emplace_back(std::move(sVol), transf * gp);
1767  hSubsTr.emplace_back(subVolumesVect.back());
1768 
1769  }
1770  phiSubs.push_back(hSubs);
1772  auto volBinArray = std::make_unique<Trk::BinnedArray1D<Trk::TrackingVolume>>(hSubsTr, hBinUtil[eta][phi]->clone());
1773  phBins.push_back(std::move(volBinArray));
1774 
1775  // finish eta gluing
1776  if (etaN > 1 && eta > 0) {
1777  for (auto& j : subVolumes[eta - 1][phi]) {
1778  m_trackingVolumeHelper->setOutsideTrackingVolumeArray(*j,
1780  phBins[phi]);
1781  }
1782  }
1783  subVolumes.push_back(phiSubs);
1784  hBins.push_back(phBins);
1785  }
1786 
1787  auto hBinVecPtr = std::make_unique<std::vector<std::vector<Trk::BinUtility*>>>(Muon::release(hBinUtil));
1788  auto subVols = std::make_unique<Trk::BinnedArray1D1D1D<Trk::TrackingVolume>>(subVolumesVect,
1789  zBinUtil.release(),
1790  pBinUtil.release(),
1791  hBinVecPtr.release());
1792 
1793  tVol = std::make_unique<Trk::TrackingVolume>(vol, aLVC.m_muonMaterial, nullptr,
1794  subVols.release(), volumeName);
1795  // register glue volumes
1796  Trk::GlueVolumesDescriptor& volGlueVolumes = tVol->glueVolumesDescriptor();
1797  volGlueVolumes.registerGlueVolumes(Trk::tubeInnerCover, sVolsInn);
1798  volGlueVolumes.registerGlueVolumes(Trk::tubeOuterCover, sVolsOut);
1799  volGlueVolumes.registerGlueVolumes(Trk::negativeFaceXY, sVolsNeg);
1800  volGlueVolumes.registerGlueVolumes(Trk::positiveFaceXY, sVolsPos);
1801 
1802  return tVol;
1803 }

◆ processVolume() [1/2]

TrackingVolumePtr Muon::MuonTrackingGeometryBuilderImpl::processVolume ( const Trk::Volume vol,
int  mode,
const std::string &  volumeName,
LocalVariablesContainer aLVC,
bool  hasStations 
) const
protected

Definition at line 1106 of file MuonTrackingGeometryBuilderImpl.cxx.

1110  {
1111  ATH_MSG_VERBOSE( "processing volume in mode:" << mode);
1112 
1113  // mode : -1 ( adjusted z/phi partition )
1114  // 0 ( -"- plus barrel H binning )
1115  // 0 ( -"- plus inner endcap H binning )
1116  // 0 ( -"- plus outer endcap H binning )
1117 
1118  TrackingVolumePtr tVol{};
1119 
1120  unsigned int colorCode = m_colorCode;
1121 
1122  std::vector<Trk::DetachedTrackingVolume*> blendVols;
1123 
1124  // getPartitionFromMaterial(vol);
1125 
1126  // retrieve cylinder
1127  auto cyl = dynamic_cast<const Trk::CylinderVolumeBounds*>(&(vol.volumeBounds()));
1128  if (!cyl) {
1129  ATH_MSG_ERROR(" process volume: volume cylinder boundaries not retrieved, return 0 ");
1130  return nullptr;
1131  }
1132  // create vector of zSteps for this volume
1133  std::vector<float> zSteps;
1134  std::vector<int> zTypes;
1135  double zPos = vol.center().z();
1136  double hz = cyl->halflengthZ();
1137  double z1 = zPos - hz;
1138  double z2 = zPos + hz;
1139  zSteps.push_back(z1);
1140  for (unsigned int iz = 0; iz < aLVC.m_zPartitions.size(); iz++) {
1141  if (aLVC.m_zPartitions[iz] == zSteps.front())
1142  zTypes.push_back(aLVC.m_zPartitionsType[iz]);
1143  if (aLVC.m_zPartitions[iz] > z1 && aLVC.m_zPartitions[iz] < z2) {
1144  zSteps.push_back(aLVC.m_zPartitions[iz]);
1145  if (zTypes.empty()) {
1146  if (iz == 0)
1147  zTypes.push_back(0);
1148  else
1149  zTypes.push_back(aLVC.m_zPartitionsType[iz - 1]);
1150  }
1151  zTypes.push_back(aLVC.m_zPartitionsType[iz]);
1152  z1 = aLVC.m_zPartitions[iz];
1153  }
1154  }
1155  zSteps.push_back(z2);
1156 
1157  for (unsigned int iz = 0; iz < zSteps.size(); iz++)
1158  ATH_MSG_DEBUG("z partition in volume:" << volumeName << ":" << iz << ":"
1159  << zSteps[iz]);
1160 
1161  // phi binning
1162  if (std::abs(zPos) > m_barrelZ &&
1163  cyl->outerRadius() < aLVC.m_outerBarrelRadius)
1164  getPhiParts(0, aLVC);
1165  else if (std::abs(zPos) <= m_ectZ)
1166  getPhiParts(2, aLVC);
1167  else if (std::abs(zPos) <= aLVC.m_innerEndcapZ)
1168  getPhiParts(3, aLVC);
1169  else if (std::abs(zPos) > m_outerWheel &&
1170  cyl->outerRadius() > m_outerShieldRadius)
1171  getPhiParts(1, aLVC);
1172  else if (std::abs(zPos) > aLVC.m_innerEndcapZ &&
1173  std::abs(zPos) < m_bigWheel &&
1174  cyl->outerRadius() > m_outerShieldRadius)
1175  getPhiParts(1, aLVC);
1176  else
1177  getPhiParts(0, aLVC);
1178 
1179  // R/H binning ?
1180  unsigned int etaN = zSteps.size() - 1;
1181  unsigned int phiN = aLVC.m_adjustedPhi.size();
1182 
1183  int phiTypeMax = 0; // count different partitions
1184 
1185  if (mode > -1) {
1186  // create z,phi bin utilities
1187  auto zBinUtil = std::make_unique<Trk::BinUtility>(zSteps, Trk::open, Trk::binZ);
1188  auto pBinUtil = std::make_unique<Trk::BinUtility>(aLVC.m_adjustedPhi, Trk::closed, Trk::binPhi);
1189  std::vector<std::vector<std::unique_ptr<Trk::BinUtility>> > hBinUtil{};
1190  for (unsigned iz = 0; iz < zSteps.size() - 1; iz++) {
1191  std::vector<std::unique_ptr<Trk::BinUtility>> phBinUtil{};
1192  for (unsigned ip = 0; ip < aLVC.m_adjustedPhi.size(); ip++) {
1193  // retrieve reference phi
1194  float phiRef = 0.5 * aLVC.m_adjustedPhi[ip];
1195  if (ip < aLVC.m_adjustedPhi.size() - 1)
1196  phiRef += 0.5 * aLVC.m_adjustedPhi[ip + 1];
1197  else
1198  phiRef += 0.5 * aLVC.m_adjustedPhi[0] + M_PI;
1199 
1200  if (aLVC.m_adjustedPhiType[ip] > phiTypeMax)
1201  phiTypeMax = aLVC.m_adjustedPhiType[ip];
1202  for (std::pair<int, float> i :
1203  aLVC.m_hPartitions[mode][zTypes[iz]]
1204  [aLVC.m_adjustedPhiType[ip]]) {
1205  ATH_MSG_VERBOSE(" mode " << mode << " phiRef " << phiRef
1206  << " zTypes[iz] " << zTypes[iz]
1207  << " m_adjustedPhiType[ip] "
1208  << aLVC.m_adjustedPhiType[ip]
1209  << " hPartitions " << i.second);
1210  }
1211  phBinUtil.push_back(std::make_unique<Trk::BinUtility>(phiRef,
1212  aLVC.m_hPartitions[mode][zTypes[iz]][aLVC.m_adjustedPhiType[ip]]));
1213  }
1214  hBinUtil.push_back(std::move(phBinUtil));
1215  }
1216 
1217  // create subvolumes & BinnedArray
1218  std::vector<Trk::TrackingVolumeOrderPosition> subVolumesVect;
1219  std::vector<std::vector<std::vector<Trk::TrackingVolume*>>> subVolumes;
1220  std::vector<std::vector<std::shared_ptr<Trk::BinnedArray<Trk::TrackingVolume> > > >
1221  hBins;
1222  std::vector<Trk::TrackingVolume*> sVolsInn; // for gluing
1223  std::vector<Trk::TrackingVolume*> sVolsOut; // for gluing
1224  std::vector<Trk::TrackingVolume*> sVolsNeg; // for gluing
1225  std::vector<Trk::TrackingVolume*> sVolsPos; // for gluing
1226  for (unsigned int eta = 0; eta < zSteps.size() - 1; eta++) {
1227  if (colorCode > 0) {
1228  colorCode = 6 - colorCode;
1229  }
1230  double posZ = 0.5 * (zSteps[eta] + zSteps[eta + 1]);
1231  double hZ = 0.5 * std::abs(zSteps[eta + 1] - zSteps[eta]);
1232  std::vector<std::vector<Trk::TrackingVolume*> > phiSubs;
1233  std::vector<std::shared_ptr<Trk::BinnedArray<Trk::TrackingVolume>>> phBins;
1234  std::vector<int> phiType(phiTypeMax + 1, -1);
1235  std::vector<std::vector<Trk::Volume*> > garbVol(phiTypeMax + 1);
1236  unsigned int pCode = 1;
1237  for (unsigned int phi = 0; phi < phiN; phi++) {
1238  pCode = (colorCode > 0) ? 3 - pCode : 0;
1239  double posPhi = 0.5 * aLVC.m_adjustedPhi[phi];
1240  double phiSect = 0.;
1241  if (phi < phiN - 1) {
1242  posPhi += 0.5 * aLVC.m_adjustedPhi[phi + 1];
1243  phiSect = 0.5 * std::abs(aLVC.m_adjustedPhi[phi + 1] -
1244  aLVC.m_adjustedPhi[phi]);
1245  } else {
1246  posPhi += 0.5 * aLVC.m_adjustedPhi[0] + M_PI;
1247  phiSect = 0.5 * std::abs(aLVC.m_adjustedPhi[0] + 2 * M_PI -
1248  aLVC.m_adjustedPhi[phi]);
1249  }
1250  std::vector<std::pair<int, float> > hSteps =
1251  aLVC.m_hPartitions[mode][zTypes[eta]]
1252  [aLVC.m_adjustedPhiType[phi]];
1253  std::vector<Trk::TrackingVolume*> hSubs;
1254  std::vector<Trk::TrackingVolumeOrderPosition> hSubsTr;
1255  int phiP = phiType[aLVC.m_adjustedPhiType[phi]];
1256 
1257  unsigned int hCode = 1;
1258  for (unsigned int h = 0; h < hSteps.size() - 1; h++) {
1259  hCode = colorCode > 0 ? 1 - hCode : 0;
1260  // similar volume may exist already
1261  std::unique_ptr<Trk::Volume> subVol{};
1262  const Amg::Transform3D transf = Amg::getRotateZ3D(posPhi) * Amg::getTranslateZ3D(posZ);
1263  //
1264  int volType = 0; // cylinder
1265  if (hSteps[h].first == 1 && hSteps[h + 1].first == 0)
1266  volType = 1;
1267  if (hSteps[h].first == 0 && hSteps[h + 1].first == 1)
1268  volType = 2;
1269  if (hSteps[h].first == 1 && hSteps[h + 1].first == 1)
1270  volType = 3;
1271  // define subvolume
1272  if (phiP > -1) {
1273  subVol = std::make_unique<Trk::Volume>(*phiSubs[phiP][h],
1274  transf *phiSubs[phiP][h]->transform().inverse());
1275  } else if (phiSect < 0.5 * M_PI) {
1276  auto subBds = std::make_unique<Trk::BevelledCylinderVolumeBounds>(hSteps[h].second,
1277  hSteps[h + 1].second,
1278  phiSect,
1279  hZ, volType);
1280  subVol = std::make_unique<Trk::Volume>(makeTransform(transf), subBds.release());
1281  } else {
1282  auto subBds = std::make_unique<Trk::CylinderVolumeBounds>(hSteps[h].second,
1283  hSteps[h + 1].second,
1284  phiSect, hZ);
1285  subVol = std::make_unique<Trk::Volume>(makeTransform(transf), subBds.release());
1286  }
1287 
1288  // enclosed muon objects ? also adjusts material properties
1289  // in case of material blend
1290  std::string volName = volumeName +
1291  MuonGM::buildString(eta, 2) +
1292  MuonGM::buildString(phi, 2) +
1293  MuonGM::buildString(h, 2);
1294  blendVols.clear();
1295  std::vector<Trk::DetachedTrackingVolume*> detVols{};
1296  if (hasStations) {
1297  detVols = getDetachedObjects(*subVol, blendVols, aLVC);
1298  }
1299  auto detVolsPtr = std::make_unique<std::vector<Trk::DetachedTrackingVolume*>>(detVols);
1300  auto sVol = std::make_unique<Trk::TrackingVolume>(*subVol,
1301  aLVC.m_muonMaterial,
1302  detVolsPtr.release(),
1303  volName);
1304 
1305  // statistics
1306  ++aLVC.m_frameNum;
1307  aLVC.m_frameStat += detVols.size();
1308  // prepare blending
1309  if (m_blendInertMaterial && !blendVols.empty()) {
1310  for (auto& blendVol : blendVols) {
1311  aLVC.m_blendMap[blendVol].push_back(sVol.get());
1312  }
1313  }
1314  // reference point for the check of envelope
1315  double posR = 0.5 * (hSteps[h].second + hSteps[h + 1].second);
1316  // loop over inner cutouts
1317  for (unsigned int in = 1; in < aLVC.m_msCutoutsIn.size(); ++in) {
1318  if (posZ >= aLVC.m_msCutoutsIn[in].second &&
1319  posZ <= aLVC.m_msCutoutsIn[in - 1].second) {
1320  if (posR < aLVC.m_msCutoutsIn[in].first) {
1321  sVol->sign(Trk::BeamPipe);
1322  }
1323  break;
1324  }
1325  }
1326  // loop over outer cutouts
1327  for (unsigned int io = 1; io < aLVC.m_msCutoutsOut.size(); ++io) {
1328  if (posZ >= aLVC.m_msCutoutsOut[io - 1].second &&
1329  posZ <= aLVC.m_msCutoutsOut[io].second) {
1330  if (posR > aLVC.m_msCutoutsOut[io].first){
1331  sVol->sign(Trk::Cavern);
1332  }
1333  break;
1334  }
1335  }
1336  //
1337  sVol->registerColorCode(colorCode + pCode + hCode);
1338  // reference position
1339  const Amg::Vector3D gp =
1340  0.5 * (hSteps[h].second + hSteps[h + 1].second) * Amg::Vector3D::UnitX();
1341  hSubs.push_back(sVol.get());
1342 
1343  // glue subVolume
1344  if (h == 0)
1345  sVolsInn.push_back(sVol.get());
1346  if (h == hSteps.size() - 2)
1347  sVolsOut.push_back(sVol.get());
1348  if (eta == 0)
1349  sVolsNeg.push_back(sVol.get());
1350  if (eta == etaN - 1)
1351  sVolsPos.push_back(sVol.get());
1352  // in R/H
1353  if (h > 0) { // glue 'manually'
1354  if (volType == 1 || volType == 3) { // plane surface
1355  m_trackingVolumeHelper->setOutsideTrackingVolume(*sVol,
1357  hSubs[h - 1]);
1358  m_trackingVolumeHelper->setOutsideTrackingVolume(*hSubs[h - 1],
1360  sVol.get());
1361  } else { // cylinder surface
1362  m_trackingVolumeHelper->setInsideTrackingVolume(*sVol,
1364  hSubs[h - 1]);
1365  m_trackingVolumeHelper->setOutsideTrackingVolume(*hSubs[h - 1],
1367  sVol.get());
1368  }
1369  }
1370  // in phi
1371  if (phiN > 1 && phi > 0) {
1372  m_trackingVolumeHelper->setOutsideTrackingVolumeArray(*sVol,
1374  phBins[phi - 1]);
1375  if (phi == phiN - 1){
1376  m_trackingVolumeHelper->setOutsideTrackingVolumeArray(*sVol,
1378  phBins[0]);
1379  }
1380  }
1381  // in eta
1382  if (etaN > 1 && eta > 0) {
1383  m_trackingVolumeHelper->setOutsideTrackingVolumeArray(*sVol,
1385  hBins[eta - 1][phi]);
1386  }
1387  //
1388  subVolumesVect.emplace_back(std::move(sVol), transf * gp);
1389  hSubsTr.emplace_back(subVolumesVect.back());
1390  }
1391  phiSubs.push_back(hSubs);
1392  auto volBinArray = std::make_unique<Trk::BinnedArray1D<Trk::TrackingVolume>>(hSubsTr,
1393  hBinUtil[eta][phi]->clone());
1394  phBins.emplace_back(std::move(volBinArray));
1395  // save link to current partition for cloning
1396  if (phiP < 0)
1397  phiType[aLVC.m_adjustedPhiType[phi]] = phi;
1398 
1399  // finish phi gluing
1400  if (phiN > 1 && phi > 0) {
1401  for (auto& j : phiSubs[phi - 1]) {
1402  m_trackingVolumeHelper->setOutsideTrackingVolumeArray(*j,
1404  phBins[phi]);
1405  }
1406  }
1407  if (phiN > 1 && phi == phiN - 1) {
1408  for (auto& j : phiSubs[0]) {
1409  m_trackingVolumeHelper->setOutsideTrackingVolumeArray(*j,
1411  phBins[phi]);
1412  }
1413  }
1414  // finish eta gluing
1415  if (etaN > 1 && eta > 0) {
1416  for (auto& j: subVolumes[eta - 1][phi]) {
1417  m_trackingVolumeHelper->setOutsideTrackingVolumeArray(*j, Trk::positiveFaceXY,
1418  phBins[phi]);
1419  }
1420  }
1421  }
1422  subVolumes.push_back(phiSubs);
1423  hBins.push_back(phBins);
1424  }
1425 
1426  auto hBinVecPtr = std::make_unique<std::vector<std::vector<Trk::BinUtility*>>>(Muon::release(hBinUtil));
1427  auto subVols = std::make_unique<Trk::BinnedArray1D1D1D<Trk::TrackingVolume>>(subVolumesVect,
1428  zBinUtil.release(),
1429  pBinUtil.release(),
1430  hBinVecPtr.release());
1431 
1432  tVol = std::make_unique<Trk::TrackingVolume>(vol, aLVC.m_muonMaterial, nullptr,
1433  subVols.release(), volumeName);
1434  // register glue volumes
1435  Trk::GlueVolumesDescriptor& volGlueVolumes = tVol->glueVolumesDescriptor();
1436  volGlueVolumes.registerGlueVolumes(Trk::tubeInnerCover, sVolsInn);
1437  volGlueVolumes.registerGlueVolumes(Trk::tubeOuterCover, sVolsOut);
1438  volGlueVolumes.registerGlueVolumes(Trk::negativeFaceXY, sVolsNeg);
1439  volGlueVolumes.registerGlueVolumes(Trk::positiveFaceXY, sVolsPos);
1440 
1441  return tVol;
1442  }
1443 
1444  // proceed with 2D z/phi binning
1445  // partitions ? include protection against wrong setup
1446  if (phiN < 1) {
1447  ATH_MSG_ERROR( "wrong partition setup");
1448  phiN = 1;
1449  } else {
1450  ATH_MSG_VERBOSE("partition setup:(z,phi):" << etaN << "," << phiN);
1451  }
1452 
1453  if (etaN * phiN > 1) { // partition
1454  // subvolume boundaries
1455 
1456  // create subvolumes & BinnedArray
1457  std::vector<Trk::TrackingVolumeOrderPosition> subVolumes(etaN * phiN);
1458  std::vector<Trk::TrackingVolume*> sVols(etaN * phiN); // for gluing
1459  std::vector<Trk::TrackingVolume*> sVolsNeg(phiN); // for gluing
1460  std::vector<Trk::TrackingVolume*> sVolsPos(phiN); // for gluing
1461  for (unsigned int eta = 0; eta < zSteps.size() - 1; ++eta) {
1462  double posZ = 0.5 * (zSteps[eta] + zSteps[eta + 1]);
1463  double hZ = 0.5 * std::abs(zSteps[eta + 1] - zSteps[eta]);
1464  colorCode = 26 - colorCode;
1465  for (unsigned int phi = 0; phi < phiN; phi++) {
1466  colorCode = 26 - colorCode;
1467  double posPhi = 0.5 * aLVC.m_adjustedPhi[phi];
1468  double phiSect = 0.;
1469  if (phi < phiN - 1) {
1470  posPhi += 0.5 * aLVC.m_adjustedPhi[phi + 1];
1471  phiSect = 0.5 * std::abs(aLVC.m_adjustedPhi[phi + 1] -
1472  aLVC.m_adjustedPhi[phi]);
1473  } else {
1474  posPhi += 0.5 * aLVC.m_adjustedPhi[0] + M_PI;
1475  phiSect = 0.5 * std::abs(aLVC.m_adjustedPhi[0] + 2 * M_PI -
1476  aLVC.m_adjustedPhi[phi]);
1477  }
1478  // define subvolume
1479  auto subBds = std::make_unique<Trk::CylinderVolumeBounds>(cyl->innerRadius(), cyl->outerRadius(), phiSect, hZ);
1480  const Amg::Transform3D transf = Amg::getRotateZ3D(posPhi) *
1482  Trk::Volume subVol(makeTransform(transf), subBds.release());
1483  // enclosed muon objects ?
1484  std::string volName = volumeName + MuonGM::buildString(eta, 2) +
1486 
1487  Trk::Material mat = aLVC.m_muonMaterial;
1488  blendVols.clear();
1489  std::vector<Trk::DetachedTrackingVolume*> detVols{} ;
1490  if (hasStations) {
1491  detVols = getDetachedObjects(subVol, blendVols, aLVC);
1492  }
1493  auto detVolPtr = std::make_unique<std::vector<Trk::DetachedTrackingVolume*>>(detVols);
1494  auto sVol = std::make_unique<Trk::TrackingVolume>(subVol, aLVC.m_muonMaterial,
1495  detVolPtr.release(),
1496  volName);
1497  // statistics
1498  ++aLVC.m_frameNum;
1499  aLVC.m_frameStat += detVols.size();
1500  // prepare blending
1501  if (m_blendInertMaterial && !blendVols.empty()) {
1502  for (auto& blendVol : blendVols) {
1503  aLVC.m_blendMap[blendVol].push_back(sVol.get());
1504  }
1505  }
1506  // reference point for the check of envelope
1507  double posR = 0.5 * (cyl->innerRadius() + cyl->outerRadius());
1508  // loop over inner cutouts
1509  for (unsigned int in = 1; in < aLVC.m_msCutoutsIn.size(); ++in) {
1510  if (posZ >= aLVC.m_msCutoutsIn[in].second &&
1511  posZ <= aLVC.m_msCutoutsIn[in - 1].second) {
1512  if (posR < aLVC.m_msCutoutsIn[in].first)
1513  sVol->sign(Trk::BeamPipe);
1514  break;
1515  }
1516  }
1517  // loop over outer cutouts
1518  for (unsigned int io = 1; io < aLVC.m_msCutoutsOut.size(); ++io) {
1519  if (posZ >= aLVC.m_msCutoutsOut[io - 1].second &&
1520  posZ <= aLVC.m_msCutoutsOut[io].second) {
1521  if (posR > aLVC.m_msCutoutsOut[io].first)
1522  sVol->sign(Trk::Cavern);
1523  break;
1524  }
1525  }
1526  sVol->registerColorCode(colorCode);
1527  // reference position
1528  const Amg::Vector3D gp = cyl->outerRadius() * Amg::Vector3D::UnitX();
1529  // glue subVolumes
1530  // sVols[phi*etaN+eta] = sVol;
1531  sVols[phiN * eta + phi] = sVol.get();
1532  if (eta == 0){
1533  sVolsNeg[phi] = sVol.get();
1534  }
1535  if (eta == etaN - 1) {
1536  sVolsPos[phi] = sVol.get();
1537  }
1538  // in phi
1539  if (phiN > 1 && phi > 0) {
1540  m_trackingVolumeHelper->glueTrackingVolumes(*sVol,
1542  *sVols[eta * phiN + phi - 1],
1544  if (phi == phiN - 1) {
1545  m_trackingVolumeHelper->glueTrackingVolumes(*sVols[eta * phiN],
1547  *sVol,
1549  }
1550  }
1551  // in eta
1552  if (etaN > 1 && eta > 0) {
1553  m_trackingVolumeHelper->glueTrackingVolumes(*sVol,
1555  *sVols[(eta - 1) * phiN + phi],
1557  }
1558  //
1559  subVolumes[phi * etaN + eta] = std::make_pair(std::move(sVol), transf * gp);
1560 
1561  }
1562  }
1563 
1564  // Trk::BinUtility2DZF* volBinUtil=new
1565  // Trk::BinUtility2DZF(zSteps,m_adjustedPhi,new
1566  // Amg::Transform3D(vol->transform()));
1567  Trk::BinUtility zBinUtil(zSteps, Trk::BinningOption::open,
1569  const Trk::BinUtility pBinUtil(aLVC.m_adjustedPhi,
1572 
1573  zBinUtil += pBinUtil;
1574 
1575  auto volBinUtil = std::make_unique<Trk::BinUtility>(zBinUtil); // TODO verify ordering PhiZ vs. ZPhi
1576 
1577  auto subVols = std::make_unique<Trk::BinnedArray2D<Trk::TrackingVolume>>(subVolumes,
1578  volBinUtil.release());
1579 
1580  tVol = std::make_unique<Trk::TrackingVolume>(vol, aLVC.m_muonMaterial, nullptr,
1581  subVols.release(), volumeName);
1582  // register glue volumes
1583  Trk::GlueVolumesDescriptor& volGlueVolumes = tVol->glueVolumesDescriptor();
1584  volGlueVolumes.registerGlueVolumes(Trk::tubeInnerCover, sVols);
1585  volGlueVolumes.registerGlueVolumes(Trk::tubeOuterCover, sVols);
1586  volGlueVolumes.registerGlueVolumes(Trk::negativeFaceXY, sVolsNeg);
1587  volGlueVolumes.registerGlueVolumes(Trk::positiveFaceXY, sVolsPos);
1588 
1589  } else {
1590  // enclosed muon objects ?
1591  blendVols.clear();
1592  std::vector<Trk::DetachedTrackingVolume*> muonObjs{};
1593  if (hasStations) {
1594  muonObjs = getDetachedObjects(vol, blendVols, aLVC);
1595  }
1596  auto muonObjPtr = std::make_unique<std::vector<Trk::DetachedTrackingVolume*>>(muonObjs);
1597  tVol = std::make_unique<Trk::TrackingVolume>(vol, aLVC.m_muonMaterial,
1598  muonObjPtr.release(),
1599  volumeName);
1600  // statistics
1601  ++aLVC.m_frameNum;
1602  aLVC.m_frameStat += muonObjs.size();
1603  // prepare blending
1604  if (m_blendInertMaterial && !blendVols.empty()) {
1605  for (auto& blendVol : blendVols) {
1606  aLVC.m_blendMap[blendVol].push_back(tVol.get());
1607  }
1608  }
1609  }
1610 
1611  return tVol;
1612 }

◆ processVolume() [2/2]

TrackingVolumePtr Muon::MuonTrackingGeometryBuilderImpl::processVolume ( const Trk::Volume vol,
int  etaN,
int  phiN,
const std::string &  volumeName,
LocalVariablesContainer aLVC,
bool  hasStations 
) const
protected

Private methods to define subvolumes and fill them with detached volumes.

Definition at line 931 of file MuonTrackingGeometryBuilderImpl.cxx.

935  {
936  TrackingVolumePtr tVol{};
937 
938  unsigned int colorCode = m_colorCode;
939 
940  std::vector<Trk::DetachedTrackingVolume*> blendVols;
941 
942  // partitions ? include protection against wrong setup
943  if (etaN < 1 || phiN < 1) {
944  ATH_MSG_ERROR( "wrong partition setup");
945  etaN = 1;
946  phiN = 1;
947  }
948  if (etaN * phiN > 1) { // partition
949  auto cyl = dynamic_cast<const Trk::CylinderVolumeBounds*>(&(vol.volumeBounds()));
950  if (!cyl) {
951  ATH_MSG_ERROR(" process volume: volume cylinder boundaries not retrieved, return 0 ");
952  return nullptr;
953  }
954  double phiSect = M_PI / phiN;
955  double etaSect = (cyl->halflengthZ()) / etaN;
956 
957  auto subBds = std::make_unique<Trk::CylinderVolumeBounds>(cyl->innerRadius(), cyl->outerRadius(), phiSect, etaSect);
958  auto protVol = std::make_unique<Trk::Volume>(nullptr, subBds.release());
959 
960  // create subvolumes & BinnedArray
961  std::vector<Trk::TrackingVolumeOrderPosition> subVolumes;
962  std::vector<Trk::TrackingVolume*> sVols; // for gluing
963  std::vector<Trk::TrackingVolume*> sVolsNeg; // for gluing
964  std::vector<Trk::TrackingVolume*> sVolsPos; // for gluing
965  for (int eta = 0; eta < etaN; eta++) {
966  if (colorCode > 0)
967  colorCode = 26 - colorCode;
968  // reference point for the check of envelope
969  double posZ = vol.center().z() + etaSect * (2. * eta + 1. - etaN);
970  double posR = 0.5 * (cyl->innerRadius() + cyl->outerRadius());
971  int geoSignature = 4;
972  // loop over inner cutouts
973  for (unsigned int in = 1; in < aLVC.m_msCutoutsIn.size(); in++) {
974  if (posZ >= aLVC.m_msCutoutsIn[in].second &&
975  posZ <= aLVC.m_msCutoutsIn[in - 1].second) {
976  if (posR < aLVC.m_msCutoutsIn[in].first)
977  geoSignature = 2;
978  break;
979  }
980  }
981  if (geoSignature == 4) {
982  // loop over outer cutouts
983  for (unsigned int io = 1; io < aLVC.m_msCutoutsOut.size();
984  io++) {
985  if (posZ >= aLVC.m_msCutoutsOut[io - 1].second &&
986  posZ <= aLVC.m_msCutoutsOut[io].second) {
987  if (posR > aLVC.m_msCutoutsOut[io].first)
988  geoSignature = 5;
989  break;
990  }
991  }
992  }
993  for (int phi = 0; phi < phiN; phi++) {
994  if (colorCode > 0)
995  colorCode = 26 - colorCode;
996  // define subvolume
997  const Amg::Transform3D transf = Amg::getRotateZ3D(phiSect * (2 * phi + 1)) *
999  auto subVol = std::make_unique<Trk::Volume>(*protVol, transf);
1000  // enclosed muon objects ?
1001  std::string volName = volumeName + MuonGM::buildString(eta, 2) +
1003  blendVols.clear();
1004  std::vector<Trk::DetachedTrackingVolume*> detVols{};
1005  if (hasStations) {
1006  detVols = getDetachedObjects(*subVol, blendVols, aLVC);
1007  }
1008  auto detVolVecPtr = std::make_unique<std::vector<Trk::DetachedTrackingVolume*>>(detVols);
1009  auto sVol = std::make_unique<Trk::TrackingVolume>(*subVol, aLVC.m_muonMaterial,
1010  detVolVecPtr.release(), volName);
1011  // statistics
1012  ++aLVC.m_frameNum;
1013  aLVC.m_frameStat += detVols.size();
1014  // prepare blending
1015  if (m_blendInertMaterial && !blendVols.empty()) {
1016  for (auto& blendVol : blendVols) {
1017  aLVC.m_blendMap[blendVol].push_back(sVol.get());
1018  }
1019  }
1020  //
1021  if (geoSignature == 2) {
1022  sVol->sign(Trk::BeamPipe);
1023  }
1024  if (geoSignature == 5) {
1025  sVol->sign(Trk::Cavern);
1026  }
1027  sVol->registerColorCode(colorCode);
1028  // reference position
1029  const Amg::Vector3D gp = cyl->outerRadius() *
1030  Amg::Vector3D::UnitX();;
1031  // glue subVolumes
1032  sVols.push_back(sVol.get());
1033  if (eta == 0)
1034  sVolsNeg.push_back(sVol.get());
1035  if (eta == etaN - 1)
1036  sVolsPos.push_back(sVol.get());
1037  // in phi
1038  if (phiN > 1 && phi > 0) {
1039  m_trackingVolumeHelper->glueTrackingVolumes(*sVol,
1041  *sVols[eta * phiN + phi - 1],
1043  if (phi == phiN - 1)
1044  m_trackingVolumeHelper->glueTrackingVolumes(*sVols[eta * phiN],
1046  *sVol,
1048  }
1049  // in eta
1050  if (etaN > 1 && eta > 0)
1051  m_trackingVolumeHelper->glueTrackingVolumes(*sVol,
1053  *sVols[(eta - 1) * phiN + phi],
1055  //
1056  subVolumes.emplace_back(std::move(sVol), transf * gp);
1057  }
1058  }
1059 
1060  Trk::BinUtility buPhi(phiN, -M_PI, M_PI, Trk::closed, Trk::binPhi);
1061  const Amg::Vector3D volCenter{vol.transform().translation()};
1062  const Trk::BinUtility buZ(etaN,
1063  volCenter.z() - cyl->halflengthZ(),
1064  volCenter.z() + cyl->halflengthZ(),
1065  Trk::open, Trk::binZ);
1066  buPhi += buZ;
1067 
1068  auto volBinUtil = std::make_unique<Trk::BinUtility>(buPhi);
1069  auto subVols = std::make_unique<Trk::BinnedArray2D<Trk::TrackingVolume>>(std::move(subVolumes),
1070  volBinUtil.release());
1071 
1072  tVol = std::make_unique<Trk::TrackingVolume>(vol, aLVC.m_muonMaterial, nullptr,
1073  subVols.release(), volumeName);
1074  // register glue volumes
1075  Trk::GlueVolumesDescriptor& volGlueVolumes = tVol->glueVolumesDescriptor();
1076  volGlueVolumes.registerGlueVolumes(Trk::tubeInnerCover, sVols);
1077  volGlueVolumes.registerGlueVolumes(Trk::tubeOuterCover, sVols);
1078  volGlueVolumes.registerGlueVolumes(Trk::negativeFaceXY, sVolsNeg);
1079  volGlueVolumes.registerGlueVolumes(Trk::positiveFaceXY, sVolsPos);
1080 
1081  } else {
1082  // enclosed muon objects ?
1083  blendVols.clear();
1084  std::vector<Trk::DetachedTrackingVolume*> muonObjs{};
1085  if (hasStations) {
1086  muonObjs = getDetachedObjects(vol, blendVols, aLVC);
1087  }
1088  auto muonObjsPtr = std::make_unique<std::vector<Trk::DetachedTrackingVolume*>>(muonObjs);
1089 
1090  tVol = std::make_unique<Trk::TrackingVolume>(vol, aLVC.m_muonMaterial, muonObjsPtr.release(),
1091  volumeName);
1092  // statistics
1093  ++aLVC.m_frameNum;
1094  aLVC.m_frameStat += muonObjs.size();
1095  // prepare blending
1096  if (m_blendInertMaterial && !blendVols.empty()) {
1097  for (auto& blendVol : blendVols) {
1098  aLVC.m_blendMap[blendVol].push_back(tVol.get());
1099  }
1100  }
1101  }
1102 
1103  return tVol;
1104 }

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

◆ signature()

static Trk::GeometrySignature Muon::MuonTrackingGeometryBuilderImpl::signature ( )
inlinestatic

The unique signature.

Definition at line 76 of file MuonTrackingGeometryBuilderImpl.h.

76 { return Trk::MS; }

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

◆ trackingGeometryImpl()

std::unique_ptr< Trk::TrackingGeometry > Muon::MuonTrackingGeometryBuilderImpl::trackingGeometryImpl ( DetachedVolVec &&  stations,
DetachedVolVec &&  inertObjs,
Trk::TrackingVolume tvol 
) const

FIX ME

Definition at line 81 of file MuonTrackingGeometryBuilderImpl.cxx.

83  {
84  ATH_MSG_DEBUG( " building tracking geometry");
85  bool hasStations = inertObjs.size() || stations.size();
86 
87  // load local variables to container
88  LocalVariablesContainer aLVC;
89  aLVC.m_innerBarrelRadius = m_innerBarrelRadius;
90  aLVC.m_outerBarrelRadius = m_outerBarrelRadius;
91  aLVC.m_innerEndcapZ = m_innerEndcapZ;
92  aLVC.m_outerEndcapZ = m_outerEndcapZ;
93  aLVC.m_adjustStatic = m_adjustStatic;
94  aLVC.m_static3d = m_static3d;
96  // check setup
98  if (!aLVC.m_adjustStatic || !aLVC.m_static3d) {
99  ATH_MSG_INFO( " diluted inert material hardcoded for 3D "
100  "volume frame, adjusting setup");
101  aLVC.m_adjustStatic = true;
102  aLVC.m_static3d = true;
103  }
104  }
105  // find object's span with tolerance for the alignment
106 
107  aLVC.m_stationSpan = findVolumesSpan(stations, 100. * m_alignTolerance,
109 
110  aLVC.m_inertSpan = findVolumesSpan(inertObjs, 0., 0., aLVC);
111 
112  // 0) Preparation
113  // //////////////////////////////////////////////////////////////////////////////////////
114 
115  aLVC.m_muonMaterial = Trk::Material(10e10, 10e10, 0., 0., 0.); // default material properties
116 
117 
118 
120  // Envelope definition (cutouts)
122  RZPairVector envelopeDefs;
124  // get the dimensions from the envelope service
125  const RZPairVector& envelopeDefsIn = m_enclosingEnvelopeSvc->getMuonRZBoundary();
126 
127  // find the max,max pair
128  unsigned int ii = 0;
129  for (unsigned int i = 0; i < envelopeDefsIn.size(); i++) {
130  if (envelopeDefsIn[i].second > envelopeDefsIn[ii].second)
131  ii = i;
132  else if (envelopeDefsIn[i].second == envelopeDefsIn[ii].second &&
133  envelopeDefsIn[i].first > envelopeDefsIn[ii].first)
134  ii = i;
135  }
136 
137  // find the sense of rotation
138  int irot = 1;
139  unsigned int inext = ii + 1;
140  if (inext == envelopeDefsIn.size())
141  inext = 0;
142  if (envelopeDefsIn[inext].second != envelopeDefsIn[ii].second) {
143  irot = -1;
144  inext = ii > 0 ? ii - 1 : envelopeDefsIn.size() - 1;
145  }
146 
147  // fill starting with upper low edge, end with upper high edge
148  if (irot > 0) {
149  for (unsigned int i = inext; i < envelopeDefsIn.size(); i++)
150  envelopeDefs.push_back(envelopeDefsIn[i]);
151  if (inext > 0)
152  for (unsigned int i = 0; i <= inext - 1; i++)
153  envelopeDefs.push_back(envelopeDefsIn[i]);
154  } else {
155  int i = inext;
156  while (i >= 0) {
157  envelopeDefs.push_back(envelopeDefsIn[i]);
158  i = i - 1;
159  };
160  inext = envelopeDefsIn.size() - 1;
161  while (inext >= ii) {
162  envelopeDefs.push_back(envelopeDefsIn[inext]);
163  inext = inext - 1;
164  };
165  }
166 
167  // find maximal z,R extent
168  double maxR = 0.;
169  for (auto& envelopeDef : envelopeDefs) {
170  if (envelopeDef.first > maxR)
171  maxR = envelopeDef.first;
172  }
173 
174  aLVC.m_outerBarrelRadius = maxR;
175  aLVC.m_outerEndcapZ = envelopeDefs[0].second;
176 
177  ATH_MSG_VERBOSE("Muon envelope definition retrieved: outer R,Z:"
178  << aLVC.m_outerBarrelRadius << ","
179  << aLVC.m_outerEndcapZ);
180 
181  // construct inner and outer envelope
182 
183  for (unsigned int i = 0; i < envelopeDefs.size(); i++) {
184  ATH_MSG_VERBOSE("Rz pair:" << i << ":" << envelopeDefs[i].first
185  << "," << envelopeDefs[i].second);
186  }
187  }
188 
190 
191  if (m_muonSimple) {
192  auto globalBounds = std::make_unique<Trk::CylinderVolumeBounds>(aLVC.m_outerBarrelRadius, aLVC.m_outerEndcapZ);
193  auto topVolume = std::make_unique<Trk::TrackingVolume>(nullptr, globalBounds.release(), aLVC.m_muonMaterial,
194  nullptr, nullptr, "GlobalVolume");
195  return std::make_unique<Trk::TrackingGeometry>(topVolume.release());
196  }
197 
198  ATH_MSG_DEBUG( "building barrel+innerEndcap+outerEndcap");
199 
201  // MuonSpectrometer contains:
202  // - Barrel
203  // - Endcaps inner/outer
204  std::vector<TrackingVolumePtr> volumeGarbage{};
205 
206  TrackingVolumePtr muonBarrel{}, negativeMuonOuterWheel{},
207  negativeMuonBigWheel{}, negativeMuonOuterBuffer{},
208  positiveMuonOuterWheel{}, negativeMuonSmallWheel{},
209  positiveMuonSmallWheel{}, negativeECT{}, positiveECT{},
210  positiveMuonBigWheel{}, positiveMuonOuterBuffer{};
211  // volumes needed to close the geometry
212  TrackingVolumePtr negBeamPipe{}, posBeamPipe{}, negDiskShield{}, posDiskShield{},
213  negInnerShield{}, posInnerShield{}, negOuterShield{}, posOuterShield{};
214 
215  std::unique_ptr<Trk::CylinderVolumeBounds> enclosedBounds{};
216 
217  TrackingVolumePtr barrelZPBuffer{}, barrelZMBuffer{};
218  using TrackingVolumeRawPtr = Trk::TrackingVolume*;
219  TrackingVolumePtr barrelZP{}, centralP{}, central{},
220  negativeMuonInnerEndcap{}, positiveMuonInnerEndcap{},
221  negNavOEndcap{}, posNavOEndcap{}, negativeMuonOuterEndcap{},
222  positiveMuonOuterEndcap{}, barrel{}, negOuterEndcap{},
223  posOuterEndcap{}, negInnerEndcap{}, posInnerEndcap{}, negNavEndcap{},
224  posNavEndcap{}, negEndcap{}, posEndcap{}, negDet{}, detector{}, enclosed{};
225 
226 
227  // if input, redefine dimensions to fit expected MS entry
228  if (tvol) {
229  bool msEntryDefined = false;
230  if (tvol->volumeName() == m_entryVolume)
231  msEntryDefined = true;
232  // get dimensions
233  ATH_MSG_DEBUG(" msEntryDefined " << msEntryDefined);
234  auto enclosedDetectorBounds =dynamic_cast<const Trk::CylinderVolumeBounds*>(&(tvol->volumeBounds()));
235  if (!enclosedDetectorBounds) {
236  ATH_MSG_ERROR(" dynamic cast of enclosed volume to the cylinder bounds failed, aborting MTG build-up ");
237  return nullptr;
238  }
239  double enclosedDetectorHalfZ = enclosedDetectorBounds->halflengthZ();
240  double enclosedDetectorOuterRadius =
241  enclosedDetectorBounds->outerRadius();
242  // get subvolumes at navigation level and check THEIR dimensions
243  Trk::GlueVolumesDescriptor& enclosedDetGlueVolumes = tvol->glueVolumesDescriptor();
244  std::vector<Trk::TrackingVolume*> enclosedCentralFaceVolumes = enclosedDetGlueVolumes.glueVolumes(Trk::cylinderCover);
245  std::vector<Trk::TrackingVolume*> enclosedNegativeFaceVolumes = enclosedDetGlueVolumes.glueVolumes(Trk::negativeFaceXY);
246  std::vector<Trk::TrackingVolume*> enclosedPositiveFaceVolumes = enclosedDetGlueVolumes.glueVolumes(Trk::positiveFaceXY);
247  if (!enclosedCentralFaceVolumes.empty()) {
248  auto cylR = dynamic_cast<const Trk::CylinderVolumeBounds*>(&(enclosedCentralFaceVolumes[0]->volumeBounds()));
249  if (cylR && cylR->outerRadius() != enclosedDetectorOuterRadius) {
250  enclosedDetectorOuterRadius = cylR->outerRadius();
251  ATH_MSG_WARNING(" enclosed volume envelope outer radius does not "
252  "correspond to radius of glue volumes : adjusted ");
253  }
254  }
255  if (!enclosedNegativeFaceVolumes.empty() &&
256  !enclosedPositiveFaceVolumes.empty()) {
257  double negZ = -enclosedDetectorHalfZ;
258  double posZ = enclosedDetectorHalfZ;
259  auto cylN = dynamic_cast<const Trk::CylinderVolumeBounds*>(&(enclosedNegativeFaceVolumes[0]->volumeBounds()));
260  if (cylN){
261  negZ = enclosedNegativeFaceVolumes[0]->center().z() - cylN->halflengthZ();
262  }
263  auto cylP =dynamic_cast<const Trk::CylinderVolumeBounds*>(&(enclosedPositiveFaceVolumes[0]->volumeBounds()));
264  if (cylP) {
265  posZ = enclosedPositiveFaceVolumes[0]->center().z() +
266  cylP->halflengthZ();
267  }
268  if (std::abs(negZ + enclosedDetectorHalfZ) > 0.001 ||
269  std::abs(posZ - enclosedDetectorHalfZ) > 0.001) {
270  ATH_MSG_WARNING(" enclosed volume envelope z dimension does not correspond to that of glue volumes ");
271  if (std::abs(negZ + posZ) < 0.001) {
272  enclosedDetectorHalfZ = posZ;
273  ATH_MSG_WARNING( " z adjusted ");
274  } else {
275  ATH_MSG_ERROR("assymetric Z dimensions - cannot recover " << negZ << "," << posZ);
276  return nullptr;
277  }
278  }
279  }
280  //
281 
282  //
283  ATH_MSG_DEBUG(" dimensions of enclosed detectors (halfZ,outerR):"
284  << enclosedDetectorHalfZ << ","<< enclosedDetectorOuterRadius);
285  // check if input makes sense - gives warning if cuts into muon envelope
286  // adjust radius
287  if (enclosedDetectorOuterRadius > aLVC.m_innerBarrelRadius) {
288  ATH_MSG_WARNING( " enclosed volume too wide, cuts into "
289  "muon envelope, abandon :R:"
290  << enclosedDetectorOuterRadius);
291  return nullptr;
292  }
293  aLVC.m_innerBarrelRadius = enclosedDetectorOuterRadius;
294 
295  // adjust z
296  if (enclosedDetectorHalfZ > m_barrelZ) {
297  ATH_MSG_WARNING( " enclosed volume too long, cuts into "
298  <<"muon envelope, abandon :Z:"<< enclosedDetectorHalfZ);
299  return nullptr;
300  } else {
301  if (enclosedDetectorHalfZ < m_barrelZ) {
302  auto barrelZPBounds = std::make_unique<Trk::CylinderVolumeBounds>(aLVC.m_innerBarrelRadius,
303  0.5 * (m_barrelZ - enclosedDetectorHalfZ));
304  auto barrelZMBounds = std::make_unique<Trk::CylinderVolumeBounds>(aLVC.m_innerBarrelRadius,
305  0.5 * (m_barrelZ - enclosedDetectorHalfZ));
306  double zbShift = 0.5 * (m_barrelZ + enclosedDetectorHalfZ);
307 
308  barrelZPBuffer = std::make_unique<Trk::TrackingVolume>(makeTransform(Amg::getTranslateZ3D(zbShift)),
309  barrelZPBounds.release(), aLVC.m_muonMaterial, nullptr,
310  nullptr, "BarrelRZPosBuffer");
311  barrelZMBuffer = std::make_unique<Trk::TrackingVolume>(makeTransform(Amg::getTranslateZ3D(-zbShift)),
312  barrelZMBounds.release(), aLVC.m_muonMaterial, nullptr,
313  nullptr, "BarrelRZNegBuffer");
314 
315  ATH_MSG_DEBUG( "glue barrel R + barrel Z buffer");
316  barrelZP = (m_trackingVolumeHelper->glueTrackingVolumeArrays(TrackingVolumePtr(tvol),
318  std::move(barrelZPBuffer),
319  Trk::negativeFaceXY, "All::Gaps::BarrelZP"));
320  // set name
321  std::string nameEncl = msEntryDefined ? "All::Gaps::Barrel" : m_entryVolume;
322  ATH_MSG_DEBUG(" nameEncl " << nameEncl);
323  enclosed = m_trackingVolumeHelper->glueTrackingVolumeArrays(std::move(barrelZP),
325  std::move(barrelZMBuffer),
327  nameEncl);
328 
329  } else{
331  enclosed.reset(tvol);
332  }
333  }
334 
335  } else { // no input, create the enclosed volume
337  const RZPairVector& envelopeDefs = m_enclosingEnvelopeSvc->getCaloRZBoundary();
338  // to be implemented in detail - for the moment, take just maximal
339  // extent
340  ATH_MSG_DEBUG(" m_loadMSentry " << m_loadMSentry
341  << " m_enclosingEnvelopeSvc "
343  double rmax = 0.;
344  double zmax = 0.;
345  for (const auto& envelopeDef : envelopeDefs) {
346  rmax = std::max(envelopeDef.first, rmax);
347  zmax = std::max(std::abs(envelopeDef.second), zmax);
348  }
349  if (!envelopeDefs.empty()) {
350  if (rmax > 0. && rmax <= aLVC.m_innerBarrelRadius &&
351  zmax > 0. && zmax <= m_barrelZ) {
352  enclosedBounds = std::make_unique<Trk::CylinderVolumeBounds>(rmax, zmax);
353  } else {
354  ATH_MSG_DEBUG( " input MSEntrance size (R,Z:"<< rmax << "," << zmax
355  << ") clashes with MS material, switch to default values (R,Z:"
356  << aLVC.m_innerBarrelRadius << "," << m_barrelZ << ")");
357  }
358  }
359  }
360 
361  if (!enclosedBounds) {
362  enclosedBounds = std::make_unique<Trk::CylinderVolumeBounds>(aLVC.m_innerBarrelRadius, m_barrelZ);
363  }
364  {
365  enclosed = std::make_unique<Trk::TrackingVolume>(nullptr, enclosedBounds.release(),
366  aLVC.m_muonMaterial, nullptr,
367  nullptr, m_entryVolume);
368  enclosed->registerColorCode(0);
369  }
370  ATH_MSG_DEBUG(" register Barrel m_entryVolume " << m_entryVolume);
371  }
372 
373  // construct inner and outer envelope
374 
375  for (auto& envelopeDef : envelopeDefs) {
376  // ATH_MSG_VERBOSE( "Rz pair:"<< i<<":"<<
377  // envelopeDefs[i].first<<","<<envelopeDefs[i].second );
378  if (!aLVC.m_msCutoutsIn.empty() &&
379  aLVC.m_msCutoutsIn.back().second == -aLVC.m_outerEndcapZ)
380  break;
381  if (aLVC.m_msCutoutsIn.empty() ||
382  std::abs(aLVC.m_msCutoutsIn.back().second) > m_barrelZ ||
383  std::abs(envelopeDef.second) > m_barrelZ)
384  aLVC.m_msCutoutsIn.push_back(envelopeDef);
385  else if (!aLVC.m_msCutoutsIn.empty() &&
386  aLVC.m_msCutoutsIn.back().second == m_barrelZ &&
387  aLVC.m_msCutoutsIn.back().first != aLVC.m_innerBarrelRadius) {
388  aLVC.m_msCutoutsIn.emplace_back(aLVC.m_innerBarrelRadius,
389  m_barrelZ);
390  aLVC.m_msCutoutsIn.emplace_back(aLVC.m_innerBarrelRadius,
391  -m_barrelZ);
392  aLVC.m_msCutoutsIn.emplace_back(
393  aLVC.m_msCutoutsIn[aLVC.m_msCutoutsIn.size() - 3].first,
394  -m_barrelZ);
395  }
396  }
397 
398  unsigned int il = 1;
399  while (envelopeDefs[il - 1].second != -aLVC.m_outerEndcapZ)
400  il++;
401  for (; il < envelopeDefs.size(); il++)
402  aLVC.m_msCutoutsOut.push_back(envelopeDefs[il]);
403 
404  for (unsigned int i = 0; i < aLVC.m_msCutoutsIn.size(); i++) {
405  ATH_MSG_VERBOSE("Rz pair for inner MS envelope:"
406  << i << ":" << aLVC.m_msCutoutsIn[i].first << ","
407  << aLVC.m_msCutoutsIn[i].second);
408  }
409  for (unsigned int i = 0; i < aLVC.m_msCutoutsOut.size(); i++) {
410  ATH_MSG_VERBOSE("Rz pair for outer MS envelope:"
411  << i << ":" << aLVC.m_msCutoutsOut[i].first << ","
412  << aLVC.m_msCutoutsOut[i].second);
413  }
414 
415  if (aLVC.m_msCutoutsIn[5].second != aLVC.m_innerEndcapZ) {
416  aLVC.m_innerEndcapZ = aLVC.m_msCutoutsIn[5].second;
417  }
418  ATH_MSG_VERBOSE("inner endcap Z set to:" << aLVC.m_innerEndcapZ);
419 
420  // create central volume ("enclosed" + disk shields ) - this is to allow
421  // safe gluing with 3D MS binning
422  getShieldParts(aLVC);
423 
424  auto negDiskShieldBounds = std::make_unique<Trk::CylinderVolumeBounds>(aLVC.m_innerBarrelRadius,
425  0.5 * (m_diskShieldZ - m_barrelZ));
427  negDiskShieldBounds.release());
428  negDiskShield = processShield(negDiskVol, 2, "Muons::Detectors::NegativeDiskShield",
429  aLVC, hasStations);
430 
431  auto posDiskShieldBounds = std::make_unique<Trk::CylinderVolumeBounds>(aLVC.m_innerBarrelRadius,
432  0.5 * (m_diskShieldZ - m_barrelZ));
434  posDiskShieldBounds.release());
435  posDiskShield = processShield(posDiskVol, 2, "Muons::Detectors::PositiveDiskShield",
436  aLVC, hasStations);
437 
438  ATH_MSG_DEBUG( "glue enclosed + disk shields");
439  centralP = m_trackingVolumeHelper->glueTrackingVolumeArrays(std::move(enclosed),
441  std::move(posDiskShield),
443  "Container::CentralP");
444  central = m_trackingVolumeHelper->glueTrackingVolumeArrays(std::move(centralP),
446  std::move(negDiskShield),
448  "Container::Central");
449  // define basic volumes
450  if (aLVC.m_adjustStatic) {
451  getZParts(aLVC);
452  getHParts(aLVC);
453  }
454 
455  // muon barrel
456  auto barrelBounds = std::make_unique<Trk::CylinderVolumeBounds>(aLVC.m_innerBarrelRadius,
457  aLVC.m_outerBarrelRadius,
458  m_diskShieldZ);
459  Trk::Volume barrelVol(nullptr, barrelBounds.release());
460  // process volume
461  // barrel
462  if (aLVC.m_adjustStatic && aLVC.m_static3d)
463  muonBarrel = processVolume(barrelVol, 0, "Detectors::Barrel",
464  aLVC, hasStations);
465  else if (aLVC.m_adjustStatic)
466  muonBarrel = processVolume(barrelVol, -1, "Detectors::Barrel",
467  aLVC, hasStations);
468  else
469  muonBarrel = processVolume(barrelVol, m_barrelEtaPartition, m_phiPartition,
470  "Detectors::Barrel", aLVC, hasStations);
471  // inner Endcap
472  // build as smallWheel+ECT
473  // small wheel
474  double smallWheelZHalfSize = 0.5 * (m_ectZ - m_diskShieldZ);
475  auto negativeSmallWheelBounds = std::make_unique<Trk::CylinderVolumeBounds>(m_innerShieldRadius,
476  aLVC.m_outerBarrelRadius,
477  smallWheelZHalfSize);
478 
479  Trk::Volume negSWVol(makeTransform(Amg::getTranslateZ3D(-m_ectZ + smallWheelZHalfSize)),
480  negativeSmallWheelBounds.release());
481  if (aLVC.m_adjustStatic && aLVC.m_static3d) {
482  negativeMuonSmallWheel = processVolume(negSWVol, 1, "Detectors::NegativeSmallWheel",
483  aLVC, hasStations);
484  } else if (aLVC.m_adjustStatic) {
485  negativeMuonSmallWheel = processVolume(negSWVol, -1, "Detectors::NegativeSmallWheel",
486  aLVC, hasStations);
487  } else {
488  negativeMuonSmallWheel = processVolume(negSWVol,
491  "Detectors::NegativeSmallWheel",
492  aLVC, hasStations);
493  }
494  //
495  Trk::Volume posSWVol(negSWVol, Amg::getTranslateZ3D(2 * (m_ectZ - smallWheelZHalfSize)));
496  if (aLVC.m_adjustStatic && aLVC.m_static3d) {
497  positiveMuonSmallWheel = processVolume(posSWVol, 1, "Detectors::PositiveSmallWheel",
498  aLVC, hasStations);
499  } else if (aLVC.m_adjustStatic) {
500  positiveMuonSmallWheel = processVolume(posSWVol, -1, "Detectors::PositiveSmallWheel",
501  aLVC, hasStations);
502  } else {
503  positiveMuonSmallWheel = processVolume(posSWVol, m_innerEndcapEtaPartition,
504  m_phiPartition, "Detectors::PositiveSmallWheel",
505  aLVC, hasStations);
506  }
507  // checkVolume(positiveMuonSmallWheel);
508  // ECT
509  double ectZHalfSize = 0.5 * (aLVC.m_innerEndcapZ - m_ectZ);
510 
511  auto negativeECTBounds = std::make_unique<Trk::CylinderVolumeBounds>(m_innerShieldRadius,
512  aLVC.m_outerBarrelRadius,
513  ectZHalfSize);
514 
515  Trk::Volume negECTVol(makeTransform(Amg::getTranslateZ3D(-m_ectZ - ectZHalfSize)),
516  negativeECTBounds.release());
517  if (aLVC.m_adjustStatic && aLVC.m_static3d) {
518  negativeECT = processVolume(negECTVol, 2, "Detectors::NegativeECT",
519  aLVC, hasStations);
520  } else if (aLVC.m_adjustStatic) {
521  negativeECT = processVolume(negECTVol, -1, "Detectors::NegativeECT",
522  aLVC, hasStations);
523  } else {
524  negativeECT = processVolume(negECTVol, m_innerEndcapEtaPartition, m_phiPartition,
525  "Detectors::NegativeECT", aLVC, hasStations);
526  }
527  // checkVolume(negativeECT);
528  //
529  Trk::Volume posECTVol(negECTVol,
530  Amg::getTranslateZ3D(2 * (m_ectZ + ectZHalfSize)));
531  if (aLVC.m_adjustStatic && m_static3d) {
532  positiveECT = processVolume(posECTVol, 2, "Detectors::PositiveECT",
533  aLVC, hasStations);
534  } else if (aLVC.m_adjustStatic) {
535  positiveECT = processVolume(posECTVol, -1, "Detectors::PositiveECT",
536  aLVC, hasStations);
537  } else {
538  positiveECT = processVolume(posECTVol, m_innerEndcapEtaPartition,
539  m_phiPartition, "Detectors::PositiveECT",
540  aLVC, hasStations);
541  }
542  // checkVolume(positiveECT);
543  // glue
544  negativeMuonInnerEndcap = (m_trackingVolumeHelper->glueTrackingVolumeArrays(std::move(negativeECT),
546  std::move(negativeMuonSmallWheel),
548  "Container::NegInnerEndcap"));
549  positiveMuonInnerEndcap = (m_trackingVolumeHelper->glueTrackingVolumeArrays(std::move(positiveMuonSmallWheel),
551  std::move(positiveECT),
553  "Container::PosInnerEndcap"));
554 
555  // inner shields
556  double innerEndcapZHalfSize = 0.5 * (aLVC.m_innerEndcapZ - m_diskShieldZ);
557  auto negInnerShieldBounds = std::make_unique<Trk::CylinderVolumeBounds>(m_beamPipeRadius,
559  innerEndcapZHalfSize);
560  Trk::Volume negisVol{makeTransform(Amg::getTranslateZ3D(-m_diskShieldZ - innerEndcapZHalfSize)),
561  negInnerShieldBounds.release()};
562  negInnerShield = processShield(negisVol, 1, "Muons::Detectors::NegativeInnerShield",
563  aLVC, hasStations);
564 
565  auto posInnerShieldBounds = std::make_unique<Trk::CylinderVolumeBounds>(m_beamPipeRadius,
567  innerEndcapZHalfSize);
568  Trk::Volume posisVol(makeTransform(Amg::getTranslateZ3D(m_diskShieldZ + innerEndcapZHalfSize)),
569  posInnerShieldBounds.release());
570  posInnerShield = processShield(posisVol, 1, "Muons::Detectors::PositiveInnerShield",
571  aLVC, hasStations);
572 
573  // outer Endcap
574  // build as bigWheel+buffer+outerWheel
575  // outer wheel
576  double outerWheelZHalfSize = 0.5 * (aLVC.m_outerEndcapZ - m_outerWheel);
577  auto negativeOuterWheelBounds = std::make_unique<Trk::CylinderVolumeBounds>(m_outerShieldRadius,
578  aLVC.m_outerBarrelRadius,
579  outerWheelZHalfSize);
580  Trk::Volume negOWVol(makeTransform(Amg::getTranslateZ3D(-aLVC.m_outerEndcapZ +
581  outerWheelZHalfSize)),
582  negativeOuterWheelBounds.release());
583  if (aLVC.m_adjustStatic && aLVC.m_static3d) {
584  negativeMuonOuterWheel = processVolume(negOWVol, 3, "Detectors::NegativeOuterWheel",
585  aLVC, hasStations);
586  } else if (aLVC.m_adjustStatic) {
587  negativeMuonOuterWheel = processVolume(negOWVol, -1, "Detectors::NegativeOuterWheel",
588  aLVC, hasStations);
589  } else {
590  negativeMuonOuterWheel = processVolume(negOWVol, m_outerEndcapEtaPartition,
591  m_phiPartition, "Detectors::NegativeOuterWheel",
592  aLVC, hasStations);
593  }
594  //
595  Trk::Volume posOWVol(negOWVol,
596  Amg::getTranslateZ3D(2 * (aLVC.m_outerEndcapZ - outerWheelZHalfSize)));
597 
598  if (aLVC.m_adjustStatic && aLVC.m_static3d) {
599  positiveMuonOuterWheel = processVolume(posOWVol, 3, "Detectors::PositiveOuterWheel",
600  aLVC, hasStations);
601  } else if (aLVC.m_adjustStatic) {
602  positiveMuonOuterWheel = processVolume(posOWVol, -1, "Detectors::PositiveOuterWheel",
603  aLVC, hasStations);
604  } else {
605  positiveMuonOuterWheel = processVolume(posOWVol, m_outerEndcapEtaPartition,
606  m_phiPartition, "Detectors::PositiveOuterWheel",
607  aLVC, hasStations);
608  }
609  // outer buffer
610  double outerBufferZHalfSize = 0.5 * (m_outerWheel - m_bigWheel);
611  auto negativeOuterBufferBounds = std::make_unique<Trk::CylinderVolumeBounds>(m_outerShieldRadius,
612  aLVC.m_outerBarrelRadius,
613  outerBufferZHalfSize);
614 
616  outerBufferZHalfSize)),
617  negativeOuterBufferBounds.release());
618  if (aLVC.m_adjustStatic && aLVC.m_static3d) {
619  negativeMuonOuterBuffer = processVolume(negBuffVol, 3, "Detectors::NegativeOuterBuffer",
620  aLVC, hasStations);
621  } else if (aLVC.m_adjustStatic) {
622  negativeMuonOuterBuffer = processVolume(negBuffVol, -1, "Detectors::NegativeOuterBuffer",
623  aLVC, hasStations);
624  } else {
625  negativeMuonOuterBuffer = processVolume(negBuffVol, m_outerEndcapEtaPartition,
626  m_phiPartition, "Detectors::NegativeOuterBuffer",
627  aLVC, hasStations);
628  }
629  //
630  Trk::Volume posBuffVol(negBuffVol, Amg::getTranslateZ3D(2 *(m_bigWheel + outerBufferZHalfSize)));
631  if (aLVC.m_adjustStatic && aLVC.m_static3d) {
632  positiveMuonOuterBuffer = processVolume(posBuffVol, 3, "Detectors::PositiveOuterBuffer",
633  aLVC, hasStations);
634  } else if (aLVC.m_adjustStatic) {
635  positiveMuonOuterBuffer = processVolume(posBuffVol, -1, "Detectors::PositiveOuterBuffer",
636  aLVC, hasStations);
637  } else {
638  positiveMuonOuterBuffer = processVolume(posBuffVol, m_outerEndcapEtaPartition,
639  m_phiPartition, "Detectors::PositiveOuterBuffer",
640  aLVC, hasStations);
641  }
642  // big wheel
643  double bigWheelZHalfSize = 0.5 * (m_bigWheel - aLVC.m_innerEndcapZ);
644  auto negativeBigWheelBounds = std::make_unique<Trk::CylinderVolumeBounds>(m_outerShieldRadius,
645  aLVC.m_outerBarrelRadius,
646  bigWheelZHalfSize);
647 
648  Trk::Volume negBWVol(makeTransform(Amg::getTranslateZ3D(-aLVC.m_innerEndcapZ -
649  bigWheelZHalfSize)),
650  negativeBigWheelBounds.release());
651  if (aLVC.m_adjustStatic && aLVC.m_static3d) {
652  negativeMuonBigWheel = processVolume(negBWVol, 3, "Detectors::NegativeBigWheel",
653  aLVC, hasStations);
654  } else if (aLVC.m_adjustStatic) {
655  negativeMuonBigWheel = processVolume(negBWVol, -1, "Detectors::NegativeBigWheel",
656  aLVC, hasStations);
657  } else {
658  negativeMuonBigWheel = processVolume(negBWVol, m_outerEndcapEtaPartition,
659  m_phiPartition, "Detectors::NegativeBigWheel",
660  aLVC, hasStations);
661  }
662  //
663  Trk::Volume posBWVol(negBWVol,
664  Amg::getTranslateZ3D(2 * (aLVC.m_innerEndcapZ + bigWheelZHalfSize)));
665  if (aLVC.m_adjustStatic && aLVC.m_static3d) {
666  positiveMuonBigWheel = processVolume(posBWVol, 3, "Detectors::PositiveBigWheel",
667  aLVC, hasStations);
668  } else if (aLVC.m_adjustStatic) {
669  positiveMuonBigWheel = processVolume(posBWVol, -1, "Detectors::PositiveBigWheel",
670  aLVC, hasStations);
671  } else {
672  positiveMuonBigWheel = processVolume(posBWVol, m_outerEndcapEtaPartition,
673  m_phiPartition, "Detectors::PositiveBigWheel",
674  aLVC, hasStations);
675  }
676  // glue
677  negNavOEndcap = m_trackingVolumeHelper->glueTrackingVolumeArrays(std::move(negativeMuonOuterWheel),
679  std::move(negativeMuonOuterBuffer),
681  "Container::NegOEndcap");
682 
683  posNavOEndcap = m_trackingVolumeHelper->glueTrackingVolumeArrays(std::move(positiveMuonOuterBuffer),
685  std::move(positiveMuonOuterWheel),
687  "Container::PosOEndcap");
688 
689 
690  negativeMuonOuterEndcap = m_trackingVolumeHelper->glueTrackingVolumeArrays(std::move(negNavOEndcap),
692  std::move(negativeMuonBigWheel),
694  "Container::NegOuterEndcap");
695 
696  positiveMuonOuterEndcap = m_trackingVolumeHelper->glueTrackingVolumeArrays(std::move(positiveMuonBigWheel),
698  std::move(posNavOEndcap),
700  "Container::PosOuterEndcap");
701 
702  // outer shields
703  double outerEndcapZHalfSize = 0.5 * (aLVC.m_outerEndcapZ - aLVC.m_innerEndcapZ);
704  double outerEndcapPosition = 0.5 * (aLVC.m_outerEndcapZ + aLVC.m_innerEndcapZ);
705  auto negOuterShieldBounds = std::make_unique<Trk::CylinderVolumeBounds>(m_beamPipeRadius,
707  outerEndcapZHalfSize);
708  Trk::Volume negosVol(makeTransform(Amg::getTranslateZ3D(-outerEndcapPosition)),
709  negOuterShieldBounds.release());
710  negOuterShield = processShield(negosVol, 0, "Muons::Detectors::NegativeOuterShield",
711  aLVC, hasStations);
712 
713  auto posOuterShieldBounds = std::make_unique<Trk::CylinderVolumeBounds>(
714  m_beamPipeRadius, m_outerShieldRadius, outerEndcapZHalfSize);
715  Trk::Volume pososVol(makeTransform(Amg::getTranslateZ3D(outerEndcapPosition)),
716  posOuterShieldBounds.release());
717  posOuterShield = processShield(pososVol, 0, "Muons::Detectors::PositiveOuterShield",
718  aLVC, hasStations);
719 
720  // beamPipe
721  auto negBeamPipeBounds = std::make_unique<Trk::CylinderVolumeBounds>(m_beamPipeRadius,
722  outerEndcapZHalfSize + innerEndcapZHalfSize);
723  auto posBeamPipeBounds = std::make_unique<Trk::CylinderVolumeBounds>(m_beamPipeRadius,
724  outerEndcapZHalfSize + innerEndcapZHalfSize);
725  Trk::Volume negbpVol(makeTransform(Amg::getTranslateZ3D(-aLVC.m_outerEndcapZ + innerEndcapZHalfSize + outerEndcapZHalfSize)),
726  negBeamPipeBounds.release());
727  negBeamPipe = processVolume(negbpVol, 1, 1, "Muons::Gaps::NegativeBeamPipe",
728  aLVC, hasStations);
729  Trk::Volume posbpVol(makeTransform(Amg::getTranslateZ3D(aLVC.m_outerEndcapZ - innerEndcapZHalfSize - outerEndcapZHalfSize)),
730  posBeamPipeBounds.release());
731  posBeamPipe = processVolume(posbpVol, 1, 1, "Muons::Gaps::PositiveBeamPipe",
732  aLVC, hasStations);
733 
734  negBeamPipe->registerColorCode(0);
735  posBeamPipe->registerColorCode(0);
736 
737  ATH_MSG_DEBUG( " volumes defined ");
738  //
739  // glue volumes at navigation level, create enveloping volume
740  // radially
741  // central + barrel
742  ATH_MSG_DEBUG( "glue barrel+enclosed volumes");
743  barrel = m_trackingVolumeHelper->glueTrackingVolumeArrays(std::move(muonBarrel),
745  std::move(central),
747  "All::Container::Barrel");
748  // shield+outerEndcap
749  ATH_MSG_DEBUG( "glue shield+outerEndcap");
750  negOuterEndcap = m_trackingVolumeHelper->glueTrackingVolumeArrays(std::move(negativeMuonOuterEndcap),
752  std::move(negOuterShield),
754  "Container::NegativeOuterEndcap");
755 
756  posOuterEndcap = m_trackingVolumeHelper->glueTrackingVolumeArrays(std::move(positiveMuonOuterEndcap),
758  std::move(posOuterShield),
760  "Container::PositiveOuterEndcap");
761 
762  // shield+innerEndcap
763  ATH_MSG_DEBUG( "glue shield+innerEndcap");
764  negInnerEndcap = m_trackingVolumeHelper->glueTrackingVolumeArrays(std::move(negativeMuonInnerEndcap),
766  std::move(negInnerShield),
768  "Container::NegativeInnerEndcap");
769  // checkVolume(negInnerEndcap);
770  posInnerEndcap = m_trackingVolumeHelper->glueTrackingVolumeArrays(std::move(positiveMuonInnerEndcap),
772  std::move(posInnerShield),
774  "Container::PositiveInnerEndcap");
775  // checkVolume(posInnerEndcap);
776  // inner+outerEndcap
777  ATH_MSG_DEBUG( "glue inner+outerEndcap");
778  negNavEndcap = m_trackingVolumeHelper->glueTrackingVolumeArrays(std::move(negOuterEndcap),
780  std::move(negInnerEndcap),
782  "Container::NegativeEndcap");
783 
784  posNavEndcap = m_trackingVolumeHelper->glueTrackingVolumeArrays(std::move(posInnerEndcap),
786  std::move(posOuterEndcap),
788  "Container::PositiveEndcap");
789 
790  // beam pipe + endcaps
791  ATH_MSG_DEBUG( "glue beamPipe+endcaps");
792  negEndcap = (m_trackingVolumeHelper->glueTrackingVolumeArrays(std::move(negNavEndcap),
794  std::move(negBeamPipe),
796  "All::Container::NegativeEndcap"));
797  posEndcap = (m_trackingVolumeHelper->glueTrackingVolumeArrays(std::move(posNavEndcap),
799  std::move(posBeamPipe),
801  "All::Container::PositiveEndcap"));
802  // checkVolume(negEndcap);
803  // checkVolume(posEndcap);
804  // barrel + endcaps
805  ATH_MSG_DEBUG( "glue barrel+endcaps");
806 
807  negDet = m_trackingVolumeHelper->glueTrackingVolumeArrays(std::move(negEndcap),
809  std::move(barrel),
811  "All::Container::NegDet");
812  detector = m_trackingVolumeHelper->glueTrackingVolumeArrays(std::move(posEndcap),
814  std::move(negDet),
816  m_exitVolume);
817  // blend material
819  blendMaterial(aLVC);
820 
821  // tracking geometry
822  auto trackingGeometry = std::make_unique<Trk::TrackingGeometry>(detector.release(), Trk::globalSearch);
823 
824 
825  trackingGeometry->addToGarbage(std::move(stations));
826  trackingGeometry->addToGarbage(std::move(inertObjs));
827 
828  volumeGarbage.push_back(std::move(negativeMuonOuterWheel));
829  volumeGarbage.push_back(std::move(negativeMuonBigWheel));
830  volumeGarbage.push_back(std::move(negativeMuonOuterBuffer));
831  volumeGarbage.push_back(std::move(positiveMuonOuterWheel));
832 
833  volumeGarbage.push_back(std::move(negativeMuonSmallWheel));
834  volumeGarbage.push_back(std::move(positiveMuonSmallWheel));
835  volumeGarbage.push_back(std::move(negativeECT));
836  volumeGarbage.push_back(std::move(positiveECT));
837  volumeGarbage.push_back(std::move(positiveMuonBigWheel));
838 
839  volumeGarbage.push_back(std::move(positiveMuonOuterBuffer));
840  volumeGarbage.push_back(std::move(negDiskShield));
841  volumeGarbage.push_back(std::move(posDiskShield));
842 
843  trackingGeometry->addToGarbage(std::move(volumeGarbage));
844  ATH_MSG_DEBUG( " returning tracking geometry ");
845  ATH_MSG_DEBUG( " with " << aLVC.m_frameNum << " subvolumes at navigation level");
846  ATH_MSG_DEBUG( "( mean number of enclosed detached volumes:" << float(aLVC.m_frameStat) / aLVC.m_frameNum << ")");
847  return trackingGeometry;
848 }

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

Gaudi::Property<int> Muon::MuonTrackingGeometryBuilderImpl::m_activeAdjustLevel {this, "ActiveAdjustLevel", 2}
protected

Definition at line 217 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_adjustStatic

Gaudi::Property<bool> Muon::MuonTrackingGeometryBuilderImpl::m_adjustStatic {this, "AdjustStatic", true}
protected

Definition at line 207 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_alignTolerance

Gaudi::Property<double> Muon::MuonTrackingGeometryBuilderImpl::m_alignTolerance
protected
Initial value:
{this, "AlignmentPositionTolerance",
0.}

Definition at line 214 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_barrelEtaPartition

Gaudi::Property<int> Muon::MuonTrackingGeometryBuilderImpl::m_barrelEtaPartition {this, "EtaBarrelPartitions", 9}
protected

Definition at line 200 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_barrelZ

Gaudi::Property<double> Muon::MuonTrackingGeometryBuilderImpl::m_barrelZ {this, "BarrelZ", 6785.}
protected

maximal extend in z of the inner part of muon endcap

Definition at line 186 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_beamPipeRadius

constexpr double Muon::MuonTrackingGeometryBuilderImpl::m_beamPipeRadius {70.}
staticconstexprprotected

Definition at line 195 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_bigWheel

constexpr double Muon::MuonTrackingGeometryBuilderImpl::m_bigWheel {15600.}
staticconstexprprotected

maximal extend in z of the big wheel

Definition at line 192 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_blendInertMaterial

Gaudi::Property<bool> Muon::MuonTrackingGeometryBuilderImpl::m_blendInertMaterial
protected
Initial value:
{this, "BlendInertMaterial",
false}

Definition at line 210 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_colorCode

Gaudi::Property<int> Muon::MuonTrackingGeometryBuilderImpl::m_colorCode {this, "ColorCode", 0}
protected

Definition at line 216 of file MuonTrackingGeometryBuilderImpl.h.

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

constexpr double Muon::MuonTrackingGeometryBuilderImpl::m_diskShieldZ {6915.}
staticconstexprprotected

Definition at line 198 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_ectZ

constexpr double Muon::MuonTrackingGeometryBuilderImpl::m_ectZ {7920.}
staticconstexprprotected

minimal extent in z of the ECT

Definition at line 194 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_enclosingEnvelopeSvc

ServiceHandle<IEnvelopeDefSvc> Muon::MuonTrackingGeometryBuilderImpl::m_enclosingEnvelopeSvc
protected
Initial value:
{
this, "EnvelopeDefinitionSvc", "AtlasEnvelopeDefSvc",
"n"}

service to provide input volume size

Definition at line 169 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_entryVolume

Gaudi::Property<std::string> Muon::MuonTrackingGeometryBuilderImpl::m_entryVolume
protected
Initial value:
{this, "EntryVolumeName",
"MuonSpectrometerEntrance"}

Definition at line 220 of file MuonTrackingGeometryBuilderImpl.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_exitVolume

Gaudi::Property<std::string> Muon::MuonTrackingGeometryBuilderImpl::m_exitVolume
protected
Initial value:
{
this, "ExitVolumeName", "All::Container::CompleteDetector"}

Definition at line 222 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_inertAdjustLevel

Gaudi::Property<int> Muon::MuonTrackingGeometryBuilderImpl::m_inertAdjustLevel {this, "InertAdjustLevel", 1}
protected

Definition at line 218 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_innerBarrelRadius

Gaudi::Property<double> Muon::MuonTrackingGeometryBuilderImpl::m_innerBarrelRadius
protected
Initial value:
{this, "InnerBarrelRadius",
4255.}

< minimal extend in radial dimension of the muon barrel

maximal extend in radial dimension of the muon barrel

Definition at line 180 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_innerEndcapEtaPartition

Gaudi::Property<int> Muon::MuonTrackingGeometryBuilderImpl::m_innerEndcapEtaPartition
protected
Initial value:
{
this, "EtaInnerEndcapPartitions", 3}

Definition at line 201 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_innerEndcapZ

Gaudi::Property<double> Muon::MuonTrackingGeometryBuilderImpl::m_innerEndcapZ {this, "InnerEndcapZ", 12900.}
protected

maximal extend in z of the outer part of muon endcap

Definition at line 188 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_innerShieldRadius

constexpr double Muon::MuonTrackingGeometryBuilderImpl::m_innerShieldRadius {850.}
staticconstexprprotected

Definition at line 196 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_loadMSentry

Gaudi::Property<bool> Muon::MuonTrackingGeometryBuilderImpl::m_loadMSentry {this, "LoadMSEntry", false}
protected

Definition at line 174 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_muonActive

Gaudi::Property<bool> Muon::MuonTrackingGeometryBuilderImpl::m_muonActive {this, "BuildActiveMaterial", true}
protected

Definition at line 175 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_muonInert

Gaudi::Property<bool> Muon::MuonTrackingGeometryBuilderImpl::m_muonInert {this, "BuildInertMaterial", true}
protected

Definition at line 176 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_muonSimple

Gaudi::Property<bool> Muon::MuonTrackingGeometryBuilderImpl::m_muonSimple {this, "SimpleMuonGeometry", false}
protected

Definition at line 173 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_outerBarrelRadius

Gaudi::Property<double> Muon::MuonTrackingGeometryBuilderImpl::m_outerBarrelRadius
protected
Initial value:
{this, "OuterBarrelRadius",
13910.}

maximal extend in z of the muon barrel

Definition at line 183 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_outerEndcapEtaPartition

Gaudi::Property<int> Muon::MuonTrackingGeometryBuilderImpl::m_outerEndcapEtaPartition
protected
Initial value:
{
this, "EtaOuterEndcapPartitions", 3}

Definition at line 203 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_outerEndcapZ

Gaudi::Property<double> Muon::MuonTrackingGeometryBuilderImpl::m_outerEndcapZ {this, "OuterEndcapZ", 26046.}
protected

Definition at line 190 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_outerShieldRadius

constexpr double Muon::MuonTrackingGeometryBuilderImpl::m_outerShieldRadius {1500.}
staticconstexprprotected

Definition at line 197 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_outerWheel

constexpr double Muon::MuonTrackingGeometryBuilderImpl::m_outerWheel {21000.}
staticconstexprprotected

minimal extend in z of the outer wheel (EO)

Definition at line 193 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_phiPartition

Gaudi::Property<int> Muon::MuonTrackingGeometryBuilderImpl::m_phiPartition {this, "PhiPartitions", 16}
protected

Definition at line 205 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_removeBlended

Gaudi::Property<bool> Muon::MuonTrackingGeometryBuilderImpl::m_removeBlended
protected
Initial value:
{this, "RemoveBlendedMaterialObjects",
false}

Definition at line 212 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_static3d

Gaudi::Property<bool> Muon::MuonTrackingGeometryBuilderImpl::m_static3d {this, "StaticPartition3D", true}
protected

Definition at line 208 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_trackingVolumeArrayCreator

ToolHandle<Trk::ITrackingVolumeArrayCreator> Muon::MuonTrackingGeometryBuilderImpl::m_trackingVolumeArrayCreator
protected
Initial value:
{
this, "TrackingVolumeArrayCreator",
"Trk::TrackingVolumeArrayCreator/"
"TrackingVolumeArrayCreator"}

Helper Tool to create TrackingVolume Arrays.

Definition at line 154 of file MuonTrackingGeometryBuilderImpl.h.

◆ m_trackingVolumeHelper

ToolHandle<Trk::ITrackingVolumeHelper> Muon::MuonTrackingGeometryBuilderImpl::m_trackingVolumeHelper
protected
Initial value:
{
this, "TrackingVolumeHelper",
"Trk::TrackingVolumeHelper/TrackingVolumeHelper"}

Helper Tool to create TrackingVolumes.

Definition at line 163 of file MuonTrackingGeometryBuilderImpl.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.

◆ m_volumeConverter

Trk::VolumeConverter Muon::MuonTrackingGeometryBuilderImpl::m_volumeConverter
protected

Volume helper to find geometrical span of enclosed volumes.

Definition at line 113 of file MuonTrackingGeometryBuilderImpl.h.


The documentation for this class was generated from the following files:
PlotCalibFromCool.il
il
Definition: PlotCalibFromCool.py:381
Trk::TrackingVolume::glueVolumesDescriptor
GlueVolumesDescriptor & glueVolumesDescriptor()
Definition: TrackingVolume.cxx:1205
Muon::makeTransform
Amg::Transform3D * makeTransform(const Amg::Transform3D &trf)
Definition: MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/MuonTrackingGeometry/Utils.h:14
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
Muon::MuonTrackingGeometryBuilderImpl::processVolume
TrackingVolumePtr processVolume(const Trk::Volume &, int, int, const std::string &, LocalVariablesContainer &aLVC, bool hasStations) const
Private methods to define subvolumes and fill them with detached volumes.
Definition: MuonTrackingGeometryBuilderImpl.cxx:931
Muon::MuonTrackingGeometryBuilderImpl::m_alignTolerance
Gaudi::Property< double > m_alignTolerance
Definition: MuonTrackingGeometryBuilderImpl.h:214
CxxUtils::span
span(T *ptr, std::size_t sz) -> span< T >
A couple needed deduction guides.
Muon::MuonTrackingGeometryBuilderImpl::m_colorCode
Gaudi::Property< int > m_colorCode
Definition: MuonTrackingGeometryBuilderImpl.h:216
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
Trk::TrackingVolume::addMaterial
void addMaterial(const Material &mat, float fact=1.)
add Material
Definition: TrackingVolume.cxx:911
Muon::MuonTrackingGeometryBuilderImpl::VolumeSpanArray
std::array< std::vector< DetachedVolSpanPair >, 9 > VolumeSpanArray
Definition: MuonTrackingGeometryBuilderImpl.h:66
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
max
#define max(a, b)
Definition: cfImp.cxx:41
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
Trk::BevelledCylinderVolumeBounds
Definition: BevelledCylinderVolumeBounds.h:100
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Trk::VolumeConverter::calculateVolume
double calculateVolume(const Volume &vol, bool nonBooleanOnly=false, double precision=1.e-3) const
Volume calculation : by default return analytical solution only.
Definition: VolumeConverter.cxx:927
Muon::MuonTrackingGeometryBuilderImpl::m_blendInertMaterial
Gaudi::Property< bool > m_blendInertMaterial
Definition: MuonTrackingGeometryBuilderImpl.h:210
RZPairVector
std::vector< RZPair > RZPairVector
Definition: RZPair.h:18
Muon::MuonTrackingGeometryBuilderImpl::m_outerWheel
static constexpr double m_outerWheel
minimal extend in z of the outer wheel (EO)
Definition: MuonTrackingGeometryBuilderImpl.h:193
Trk::binZ
@ binZ
Definition: BinningType.h:49
DetectorZone::posEndcap
@ posEndcap
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Muon::MuonTrackingGeometryBuilderImpl::m_loadMSentry
Gaudi::Property< bool > m_loadMSentry
Definition: MuonTrackingGeometryBuilderImpl.h:174
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:53
Amg::getTranslateZ3D
Amg::Transform3D getTranslateZ3D(const double Z)
: Returns a shift transformation along the z-axis
Definition: GeoPrimitivesHelpers.h:285
Trk::globalSearch
@ globalSearch
Definition: TrackingGeometry.h:45
Trk::VolumeConverter::findVolumeSpan
std::unique_ptr< VolumeSpan > findVolumeSpan(const VolumeBounds &volBounds, const Amg::Transform3D &transform, double zTol, double phiTol) const
Estimation of the geometrical volume span.
Definition: VolumeConverter.cxx:424
M_PI
#define M_PI
Definition: ActiveFraction.h:11
Muon::MuonTrackingGeometryBuilderImpl::m_entryVolume
Gaudi::Property< std::string > m_entryVolume
Definition: MuonTrackingGeometryBuilderImpl.h:220
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
Muon::MuonTrackingGeometryBuilderImpl::m_exitVolume
Gaudi::Property< std::string > m_exitVolume
Definition: MuonTrackingGeometryBuilderImpl.h:222
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
deg
#define deg
Definition: SbPolyhedron.cxx:17
Trk::closed
@ closed
Definition: BinningType.h:41
Muon::MuonTrackingGeometryBuilderImpl::blendMaterial
void blendMaterial(LocalVariablesContainer &aLVC) const
Private method to blend the inert material.
Definition: MuonTrackingGeometryBuilderImpl.cxx:2731
ReadBchFromCool.barrel
barrel
Definition: ReadBchFromCool.py:405
Trk::positiveFaceXY
@ positiveFaceXY
Definition: BoundarySurfaceFace.h:33
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
Muon::MuonTrackingGeometryBuilderImpl::m_activeAdjustLevel
Gaudi::Property< int > m_activeAdjustLevel
Definition: MuonTrackingGeometryBuilderImpl.h:217
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Muon::MuonTrackingGeometryBuilderImpl::m_removeBlended
Gaudi::Property< bool > m_removeBlended
Definition: MuonTrackingGeometryBuilderImpl.h:212
Muon::MuonTrackingGeometryBuilderImpl::m_diskShieldZ
static constexpr double m_diskShieldZ
Definition: MuonTrackingGeometryBuilderImpl.h:198
Trk::TrackingVolume::registerColorCode
void registerColorCode(unsigned int icolor)
Register the color code.
Muon::MuonTrackingGeometryBuilderImpl::getHParts
void getHParts(LocalVariablesContainer &aLVC) const
Private method to retrieve h partition.
Definition: MuonTrackingGeometryBuilderImpl.cxx:2396
Muon::MuonTrackingGeometryBuilderImpl::m_innerEndcapEtaPartition
Gaudi::Property< int > m_innerEndcapEtaPartition
Definition: MuonTrackingGeometryBuilderImpl.h:201
Muon::MuonTrackingGeometryBuilderImpl::getZParts
void getZParts(LocalVariablesContainer &aLVC) const
Private method to retrieve z partition.
Definition: MuonTrackingGeometryBuilderImpl.cxx:2083
Trk::BeamPipe
@ BeamPipe
Definition: GeometrySignature.h:27
Muon::MuonTrackingGeometryBuilderImpl::m_adjustStatic
Gaudi::Property< bool > m_adjustStatic
Definition: MuonTrackingGeometryBuilderImpl.h:207
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::detector
@ detector
Definition: HitInfo.h:78
Trk::MS
@ MS
Definition: GeometrySignature.h:29
Muon::MuonTrackingGeometryBuilderImpl::getDetachedObjects
std::vector< Trk::DetachedTrackingVolume * > getDetachedObjects(const Trk::Volume &trkVol, std::vector< Trk::DetachedTrackingVolume * > &, LocalVariablesContainer &aLVC, int mode=0) const
Private method to find detached volumes.
Definition: MuonTrackingGeometryBuilderImpl.cxx:1806
Muon::MuonTrackingGeometryBuilderImpl::m_barrelEtaPartition
Gaudi::Property< int > m_barrelEtaPartition
Definition: MuonTrackingGeometryBuilderImpl.h:200
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Muon::MuonTrackingGeometryBuilderImpl::m_barrelZ
Gaudi::Property< double > m_barrelZ
maximal extend in z of the inner part of muon endcap
Definition: MuonTrackingGeometryBuilderImpl.h:186
lumiFormat.i
int i
Definition: lumiFormat.py:92
Muon::MuonTrackingGeometryBuilderImpl::m_muonSimple
Gaudi::Property< bool > m_muonSimple
Definition: MuonTrackingGeometryBuilderImpl.h:173
Trk::tubeSectorNegativePhi
@ tubeSectorNegativePhi
Definition: BoundarySurfaceFace.h:41
Muon::MuonTrackingGeometryBuilderImpl::getPhiParts
void getPhiParts(int, LocalVariablesContainer &aLVC) const
Private method to retrieve phi partition.
Definition: MuonTrackingGeometryBuilderImpl.cxx:2319
beamspotman.n
n
Definition: beamspotman.py:731
Trk::GlueVolumesDescriptor::registerGlueVolumes
void registerGlueVolumes(BoundarySurfaceFace, std::vector< TrackingVolume * > &)
register the volumes
Definition: GlueVolumesDescriptor.cxx:28
beamspotman.posZ
posZ
Definition: beamspotman.py:1624
Muon::MuonTrackingGeometryBuilderImpl::m_outerEndcapEtaPartition
Gaudi::Property< int > m_outerEndcapEtaPartition
Definition: MuonTrackingGeometryBuilderImpl.h:203
extractSporadic.h
list h
Definition: extractSporadic.py:97
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
checkFileSG.objs
list objs
Definition: checkFileSG.py:93
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
PixelAthClusterMonAlgCfg.zmax
zmax
Definition: PixelAthClusterMonAlgCfg.py:176
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Preparation.mode
mode
Definition: Preparation.py:95
Trk::negativeFaceXY
@ negativeFaceXY
Definition: BoundarySurfaceFace.h:32
Trk::Volume::center
const Amg::Vector3D & center() const
returns the center of the volume
Definition: Volume.h:86
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Muon::MuonTrackingGeometryBuilderImpl::m_phiPartition
Gaudi::Property< int > m_phiPartition
Definition: MuonTrackingGeometryBuilderImpl.h:205
Muon::MuonTrackingGeometryBuilderImpl::findVolumesSpan
VolumeSpanArray findVolumesSpan(const DetachedVolVec &objs, double zTol, double phiTol, const LocalVariablesContainer &aLVC) const
Private method to filter detached volumes in z span.
Definition: MuonTrackingGeometryBuilderImpl.cxx:851
Muon::MuonTrackingGeometryBuilderImpl::VolumeSpanPtr
std::shared_ptr< const Trk::VolumeSpan > VolumeSpanPtr
Definition: MuonTrackingGeometryBuilderImpl.h:64
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
Muon::MuonTrackingGeometryBuilderImpl::m_muonInert
Gaudi::Property< bool > m_muonInert
Definition: MuonTrackingGeometryBuilderImpl.h:176
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
Trk::BinUtility
Definition: BinUtility.h:39
grepfile.ic
int ic
Definition: grepfile.py:33
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Trk::Cavern
@ Cavern
Definition: GeometrySignature.h:30
Trk::CylinderVolumeBounds
Definition: CylinderVolumeBounds.h:70
Muon::MuonTrackingGeometryBuilderImpl::m_trackingVolumeArrayCreator
ToolHandle< Trk::ITrackingVolumeArrayCreator > m_trackingVolumeArrayCreator
Helper Tool to create TrackingVolume Arrays.
Definition: MuonTrackingGeometryBuilderImpl.h:154
Trk::TrackingVolume::volumeName
const std::string & volumeName() const
Returns the VolumeName - for debug reason, might be depreciated later.
Muon::MuonTrackingGeometryBuilderImpl::m_ectZ
static constexpr double m_ectZ
minimal extent in z of the ECT
Definition: MuonTrackingGeometryBuilderImpl.h:194
Trk::GlueVolumesDescriptor::glueVolumes
const std::vector< TrackingVolume * > & glueVolumes(BoundarySurfaceFace)
retrieve them again
Definition: GlueVolumesDescriptor.cxx:40
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
Muon::MuonTrackingGeometryBuilderImpl::m_outerEndcapZ
Gaudi::Property< double > m_outerEndcapZ
Definition: MuonTrackingGeometryBuilderImpl.h:190
Muon::MuonTrackingGeometryBuilderImpl::m_innerShieldRadius
static constexpr double m_innerShieldRadius
Definition: MuonTrackingGeometryBuilderImpl.h:196
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
Muon::MuonTrackingGeometryBuilderImpl::m_innerEndcapZ
Gaudi::Property< double > m_innerEndcapZ
maximal extend in z of the outer part of muon endcap
Definition: MuonTrackingGeometryBuilderImpl.h:188
Trk::CylinderVolumeBounds::outerRadius
double outerRadius() const
This method returns the outer radius.
Definition: CylinderVolumeBounds.h:191
Trk::Volume::transform
const Amg::Transform3D & transform() const
Return methods for geometry transform.
Definition: Volume.h:81
Muon::MuonTrackingGeometryBuilderImpl::m_static3d
Gaudi::Property< bool > m_static3d
Definition: MuonTrackingGeometryBuilderImpl.h:208
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::tubeSectorOuterCover
@ tubeSectorOuterCover
Definition: BoundarySurfaceFace.h:44
Trk::GlueVolumesDescriptor
Definition: GlueVolumesDescriptor.h:40
Muon::MuonTrackingGeometryBuilderImpl::m_beamPipeRadius
static constexpr double m_beamPipeRadius
Definition: MuonTrackingGeometryBuilderImpl.h:195
Trk::open
@ open
Definition: BinningType.h:40
Muon::MuonTrackingGeometryBuilderImpl::m_bigWheel
static constexpr double m_bigWheel
maximal extend in z of the big wheel
Definition: MuonTrackingGeometryBuilderImpl.h:192
DetectorZone::negEndcap
@ negEndcap
a
TList * a
Definition: liststreamerinfos.cxx:10
h
Muon::MuonTrackingGeometryBuilderImpl::processShield
TrackingVolumePtr processShield(const Trk::Volume &, int, const std::string &, LocalVariablesContainer &aLVC, bool hasStations) const
Definition: MuonTrackingGeometryBuilderImpl.cxx:1614
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DeMoScan.first
bool first
Definition: DeMoScan.py:534
Trk::Volume::volumeBounds
const VolumeBounds & volumeBounds() const
returns the volumeBounds()
Definition: Volume.h:97
Trk::cylinderCover
@ cylinderCover
Definition: BoundarySurfaceFace.h:38
Muon::MuonTrackingGeometryBuilderImpl::m_volumeConverter
Trk::VolumeConverter m_volumeConverter
Volume helper to find geometrical span of enclosed volumes.
Definition: MuonTrackingGeometryBuilderImpl.h:113
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
ReadCellNoiseFromCoolCompare.l0
l0
Definition: ReadCellNoiseFromCoolCompare.py:359
Trk::tubeSectorPositivePhi
@ tubeSectorPositivePhi
Definition: BoundarySurfaceFace.h:42
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
Trk::tubeOuterCover
@ tubeOuterCover
Definition: BoundarySurfaceFace.h:40
Muon::MuonTrackingGeometryBuilderImpl::m_inertAdjustLevel
Gaudi::Property< int > m_inertAdjustLevel
Definition: MuonTrackingGeometryBuilderImpl.h:218
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
Muon::MuonTrackingGeometryBuilderImpl::m_outerBarrelRadius
Gaudi::Property< double > m_outerBarrelRadius
maximal extend in z of the muon barrel
Definition: MuonTrackingGeometryBuilderImpl.h:183
Trk::Material
Definition: Material.h:116
Trk::tubeInnerCover
@ tubeInnerCover
Definition: BoundarySurfaceFace.h:39
Muon::MuonTrackingGeometryBuilderImpl::TrackingVolumePtr
std::unique_ptr< Trk::TrackingVolume > TrackingVolumePtr
Definition: MuonTrackingGeometryBuilderImpl.h:67
fitman.hz
def hz
Definition: fitman.py:516
python.PyAthena.obj
obj
Definition: PyAthena.py:135
Trk::Volume
Definition: Volume.h:35
MuonGM::buildString
std::string buildString(int i, int ncha)
Definition: GlobalUtilities.cxx:23
PlotCalibFromCool.vv
vv
Definition: PlotCalibFromCool.py:716
Trk::TrackingVolume
Definition: TrackingVolume.h:121
Material
@ Material
Definition: MaterialTypes.h:8
Muon::MuonTrackingGeometryBuilderImpl::m_innerBarrelRadius
Gaudi::Property< double > m_innerBarrelRadius
< minimal extend in radial dimension of the muon barrel
Definition: MuonTrackingGeometryBuilderImpl.h:180
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Muon::MuonTrackingGeometryBuilderImpl::getShieldParts
void getShieldParts(LocalVariablesContainer &aLVC) const
Private method to retrieve shield partition.
Definition: MuonTrackingGeometryBuilderImpl.cxx:2690
Trk::tubeSectorInnerCover
@ tubeSectorInnerCover
Definition: BoundarySurfaceFace.h:43
Muon::release
std::vector< ObjType * > release(std::vector< std::unique_ptr< ObjType >> &objVec)
Definition: MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/MuonTrackingGeometry/Utils.h:18
Muon::MuonTrackingGeometryBuilderImpl::m_enclosingEnvelopeSvc
ServiceHandle< IEnvelopeDefSvc > m_enclosingEnvelopeSvc
service to provide input volume size
Definition: MuonTrackingGeometryBuilderImpl.h:169
Muon::MuonTrackingGeometryBuilderImpl::m_outerShieldRadius
static constexpr double m_outerShieldRadius
Definition: MuonTrackingGeometryBuilderImpl.h:197
fitman.k
k
Definition: fitman.py:528
Muon::MuonTrackingGeometryBuilderImpl::enclosed
bool enclosed(const Trk::Volume &volume, const Trk::VolumeSpan &span, LocalVariablesContainer &aLVC) const
Private method to check if constituent enclosed.
Definition: MuonTrackingGeometryBuilderImpl.cxx:2006
Muon::MuonTrackingGeometryBuilderImpl::m_trackingVolumeHelper
ToolHandle< Trk::ITrackingVolumeHelper > m_trackingVolumeHelper
Helper Tool to create TrackingVolumes.
Definition: MuonTrackingGeometryBuilderImpl.h:163
Trk::binPhi
@ binPhi
Definition: BinningType.h:51