ATLAS Offline Software
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Trk::TrackingVolumeHelper Class Reference

#include <TrackingVolumeHelper.h>

Inheritance diagram for Trk::TrackingVolumeHelper:
Collaboration diagram for Trk::TrackingVolumeHelper:

Public Member Functions

 TrackingVolumeHelper (const std::string &, const std::string &, const IInterface *)
 Constructor. More...
 
virtual ~TrackingVolumeHelper ()
 Destructor. More...
 
StatusCode initialize () override
 AlgTool initialize method. More...
 
void glueTrackingVolumes (TrackingVolume &firstVol, BoundarySurfaceFace firstFace, TrackingVolume &secondVol, BoundarySurfaceFace secondFace, bool buildBoundaryLayer=false) const override
 Method to glue two Volumes together input: More...
 
void glueTrackingVolumes (TrackingVolume &firstVol, BoundarySurfaceFace firstFace, const std::vector< TrackingVolume * > &secondVolumes, BoundarySurfaceFace secondFace, bool buildBoundaryLayer=false, bool boundaryFaceExchange=false) const override
 Method to glue two Volumes together input: More...
 
void glueTrackingVolumes (const std::vector< TrackingVolume * > &firstVolumes, BoundarySurfaceFace firstFace, const std::vector< TrackingVolume * > &secondVolumes, BoundarySurfaceFace secondFace, bool buildBoundaryLayer=false, bool boundaryFaceExchange=false) const override
 Method to glue two VolumeArrays together (at navigation level) - without output. More...
 
Trk::TrackingVolumeglueTrackingVolumeArrays (TrackingVolume &firstVol, BoundarySurfaceFace firstFace, TrackingVolume &secondVol, BoundarySurfaceFace secondFace, std::string name) const override
 Method to glue two VolumeArrays together (at navigation level) More...
 
std::unique_ptr< Trk::TrackingVolumeglueTrackingVolumeArrays (std::shared_ptr< TrackingVolume > firstVol, BoundarySurfaceFace firstFace, std::shared_ptr< TrackingVolume > secondVol, BoundarySurfaceFace secondFace, const std::string &name) const override
 
void setInsideTrackingVolume (TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *insidevol) const override
 protected method to set inside Volume of a BoundarySurface: input: More...
 
void setInsideTrackingVolumeArray (TrackingVolume &tvol, BoundarySurfaceFace face, BinnedArray< TrackingVolume > *insidevolarray) const override
 protected method to set inside VolumeArray of a BoundarySurface: input: More...
 
void setInsideTrackingVolumeArray (TrackingVolume &tvol, BoundarySurfaceFace face, SharedObject< BinnedArray< TrackingVolume >> insidevolarray) const override
 
void setOutsideTrackingVolume (TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *outsidevol) const override
 protected method to set outside Volume of a BoundarySurface: input: More...
 
void setOutsideTrackingVolumeArray (TrackingVolume &tvol, BoundarySurfaceFace face, BinnedArray< TrackingVolume > *outsidevolarray) const override
 protected method to set outside VolumeArray of a BoundarySurface: input: More...
 
void setOutsideTrackingVolumeArray (TrackingVolume &tvol, BoundarySurfaceFace face, SharedObject< BinnedArray< TrackingVolume >> outsidevolarray) const override
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 
 DeclareInterfaceID (ITrackingVolumeHelper, 1, 0)
 Creates the InterfaceID and interfaceID() method. More...
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 
void glueVolumes (TrackingVolume &firstVol, BoundarySurfaceFace firstFace, TrackingVolume &secondVol, BoundarySurfaceFace secondFace) const
 protected method to glue two Volumes together input: More...
 
void associateLayer (const Layer &lay, Surface &sf) const
 Protected method to register the Layer to the Surface. More...
 

Static Protected Member Functions

static void setBoundarySurface (TrackingVolume &tvol, SharedObject< BoundarySurface< TrackingVolume >> bsurf, BoundarySurfaceFace face)
 protected method to set the boundary surface of a tracking volume More...
 
static void setInsideVolume (TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *insidevol)
 protected method to set inside Volume of a BoundarySurface: input: More...
 
static void setInsideVolumeArray (TrackingVolume &tvol, BoundarySurfaceFace face, BinnedArray< TrackingVolume > *insidevolarray)
 protected method to set inside VolumeArray of a BoundarySurface: input: More...
 
static void setInsideVolumeArray (TrackingVolume &tvol, BoundarySurfaceFace face, const SharedObject< BinnedArray< TrackingVolume >> &insidevolarray)
 protected method to set inside VolumeArray of a BoundarySurface: input: More...
 
static void setOutsideVolume (TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *outsidevol)
 protected method to set outside Volume of a BoundarySurface: input: More...
 
static void setOutsideVolumeArray (TrackingVolume &tvol, BoundarySurfaceFace face, BinnedArray< TrackingVolume > *outsidevolarray)
 protected method to set outside VolumeArray of a BoundarySurface: input: More...
 
static void setOutsideVolumeArray (TrackingVolume &tvol, BoundarySurfaceFace face, const SharedObject< BinnedArray< TrackingVolume >> &outsidevolarray)
 protected method to set outside VolumeArray of a BoundarySurface: input: More...
 
static void confineVolume (TrackingVolume &tvol, TrackingVolume *outsidevol)
 protected method to confine (dense) volumes: input: More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

std::unique_ptr< Trk::LayerMaterialPropertieslayerMaterialProperties (const Trk::Surface &sf) const
 < helper method to construct barrel material More...
 
void glueTrackingVolumes (const std::vector< std::shared_ptr< TrackingVolume >> &glueVols, BoundarySurfaceFace glueFace, BoundarySurfaceFace secondFace) const
 Execute the glueing - the input volumes are all on navigation level. More...
 
void glueTrackingVolumes (const std::vector< TrackingVolume * > &glueVols, BoundarySurfaceFace glueFace, BoundarySurfaceFace secondFace) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Static Private Member Functions

static void fillGlueVolumes (const std::vector< TrackingVolume * > &topLevelVolumes, const std::vector< TrackingVolume * > &envelopeFaceVolumes, BoundarySurfaceFace glueFace, std::vector< Trk::TrackingVolume * > &glueVols)
 Private method - it takes the full vector of given volumes to create the supervolume,. More...
 
static void fillGlueVolumes (const std::vector< std::shared_ptr< TrackingVolume >> &topLevelVolumes, const std::vector< std::shared_ptr< TrackingVolume >> &envelopeFaceVolumes, BoundarySurfaceFace glueFace, std::vector< Trk::TrackingVolume * > &glueVols)
 

Private Attributes

PublicToolHandle< ILayerArrayCreatorm_layerArrayCreator {this, "LayerArrayCreator", "Trk::LayerArrayCreator/LayerArrayCreator"}
 A Tool for coherent LayerArray creation. More...
 
ToolHandle< ITrackingVolumeArrayCreatorm_trackingVolumeArrayCreator {this, "TrackingVolumeArrayCreator", "Trk::TrackingVolumeArrayCreator/TrackingVolumeArrayCreator"}
 Helper Tool to create TrackingVolume. More...
 
Gaudi::Property< int > m_barrelLayerBinsZ {this, "BarrelLayerBinsZ", 1}
 material bins in Z More...
 
Gaudi::Property< int > m_barrelLayerBinsPhi {this, "BarrelLayerBinsPhi", 1}
 material bins in Phi More...
 
Gaudi::Property< int > m_endcapLayerBinsR {this, "EndcapLayerBinsR", 1}
 material bins in R More...
 
Gaudi::Property< int > m_endcapLayerBinsPhi {this, "EndcapLayerBinsPhi", 1}
 material bins in Phi More...
 
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
 

Static Private Attributes

static constexpr double s_layerThickness
 standard layer thickness More...
 

Detailed Description

The TrackingVolumeHelper is a simple Tool that helps to construct volumes mainly for gap regions in the fully connective geometry.

Author
Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch

Definition at line 53 of file TrackingVolumeHelper.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TrackingVolumeHelper()

Trk::TrackingVolumeHelper::TrackingVolumeHelper ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Constructor.

Definition at line 50 of file TrackingVolumeHelper.cxx.

51 : AthAlgTool(t,n,p),
53  declareInterface<ITrackingVolumeHelper>(this);
54 }

◆ ~TrackingVolumeHelper()

Trk::TrackingVolumeHelper::~TrackingVolumeHelper ( )
virtualdefault

Destructor.

Member Function Documentation

◆ associateLayer()

void Trk::ITrackingVolumeHelper::associateLayer ( const Layer lay,
Surface sf 
) const
inlineprotectedinherited

Protected method to register the Layer to the Surface.

Definition at line 142 of file ITrackingVolumeHelper.h.

143  {
144  sf.associateLayer(lay);
145  }

◆ confineVolume()

void Trk::TrackingVolumeManipulator::confineVolume ( TrackingVolume tvol,
TrackingVolume outsidevol 
)
staticprotectedinherited

protected method to confine (dense) volumes: input:

  • the volume that holdes the BoundarySurfaces (embedded)
  • the volume to be set as outside volume

Definition at line 112 of file TrackingVolumeManipulator.cxx.

114 {
115 
116  const auto& bounds = tvol.boundarySurfaces();
117  for (const auto & bound : bounds) {
118  if (bound->outsideVolume() == nullptr) {
119  bound->setOutsideVolume(outsideVol);
120  }
121  if (bound->insideVolume() == nullptr) {
122  bound->setInsideVolume(outsideVol);
123  }
124  }
125 }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [4/4]

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

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

Definition at line 199 of file AthCommonDataStore.h.

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

◆ DeclareInterfaceID()

Trk::ITrackingVolumeHelper::DeclareInterfaceID ( ITrackingVolumeHelper  ,
,
 
)
inherited

Creates the InterfaceID and interfaceID() method.

◆ declareProperty() [1/6]

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

Declare a new Gaudi property.

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

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

Definition at line 245 of file AthCommonDataStore.h.

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

◆ declareProperty() [2/6]

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

Declare a new Gaudi property.

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

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

Definition at line 221 of file AthCommonDataStore.h.

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

◆ declareProperty() [3/6]

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

Definition at line 259 of file AthCommonDataStore.h.

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

◆ declareProperty() [4/6]

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

Declare a new Gaudi property.

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

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

Definition at line 333 of file AthCommonDataStore.h.

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

◆ declareProperty() [5/6]

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

Declare a new Gaudi property.

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

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

Definition at line 352 of file AthCommonDataStore.h.

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

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

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

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

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ fillGlueVolumes() [1/2]

void Trk::TrackingVolumeHelper::fillGlueVolumes ( const std::vector< std::shared_ptr< TrackingVolume >> &  topLevelVolumes,
const std::vector< std::shared_ptr< TrackingVolume >> &  envelopeFaceVolumes,
BoundarySurfaceFace  glueFace,
std::vector< Trk::TrackingVolume * > &  glueVols 
)
staticprivate

Definition at line 697 of file TrackingVolumeHelper.cxx.

700  {
701  std::vector<std::shared_ptr<TrackingVolume>> sharedTops{}, sharedFaces{};
702  return fillGlueVolumes(::toRawVec(topLevelVolumes),
703  ::toRawVec(envelopeFaceVolumes),
704  glueFace, glueVols);
705 
706 }

◆ fillGlueVolumes() [2/2]

void Trk::TrackingVolumeHelper::fillGlueVolumes ( const std::vector< TrackingVolume * > &  topLevelVolumes,
const std::vector< TrackingVolume * > &  envelopeFaceVolumes,
BoundarySurfaceFace  glueFace,
std::vector< Trk::TrackingVolume * > &  glueVols 
)
staticprivate

Private method - it takes the full vector of given volumes to create the supervolume,.

  • it compares the volumes with the ones scheduled to build the face (could probably be done at once)
  • it checks whether there is a sub-structure (i.e. GlueVolumeDescriptor exists) and adds either the volume itself or the associated subvolume
  • volumes on glueVols level are all on navigation level

Definition at line 707 of file TrackingVolumeHelper.cxx.

710  {
711  // loop over the topLevel Volumes
712  auto refVolIter = topLevelVolumes.begin();
713  for ( ; refVolIter != topLevelVolumes.end(); ++refVolIter ) {
714  // loop over the faceVolumes
715  for (auto *envelopeFaceVolume : envelopeFaceVolumes){
716  // check whether this volume was assigned to on this face
717  if (envelopeFaceVolume==(*refVolIter)) {
718  // get the GlueVolumesDescriptor
719  GlueVolumesDescriptor& glueVolDescriptor = (*refVolIter)->glueVolumesDescriptor();
720  // if the size of glue volumes is 0 -> the referenceVolume is at navigation level
721  if ( (glueVolDescriptor.glueVolumes(glueFace)).empty()) {
722  glueVols.push_back(*refVolIter);
723  } else {
724  // fill all the sub-volumes described by the glueVolumeDescriptor
725  for (auto *isubNavVol : glueVolDescriptor.glueVolumes(glueFace))
726  glueVols.push_back( isubNavVol );
727  }
728  }
729  }// loop over envelopeFaceVolumes
730  } // loop over reference Volumes
731 }

◆ glueTrackingVolumeArrays() [1/2]

std::unique_ptr< TrackingVolume > Trk::TrackingVolumeHelper::glueTrackingVolumeArrays ( std::shared_ptr< TrackingVolume firstVol,
BoundarySurfaceFace  firstFace,
std::shared_ptr< TrackingVolume secondVol,
BoundarySurfaceFace  secondFace,
const std::string &  name 
) const
overridevirtual

Implements Trk::ITrackingVolumeHelper.

Definition at line 555 of file TrackingVolumeHelper.cxx.

559  {
560  std::unique_ptr<TrackingVolume> enclosingVolume{};
561 
562  const auto *cyl1 = dynamic_cast<const CylinderVolumeBounds*>(&(firstVol->volumeBounds()));
563  const auto *cyl2 = dynamic_cast<const CylinderVolumeBounds*>(&(secondVol->volumeBounds()));
564 
565  if (!cyl1 || !cyl2) {
566  ATH_MSG_ERROR( "TrackingVolumeHelper::glueTrackingVolumeArrays: input volumes not cylinders, return 0" );
567  return enclosingVolume;
568  }
569  if (cyl1->halfPhiSector()!= M_PI || cyl2->halfPhiSector()!= M_PI ) {
570  ATH_MSG_ERROR( "TrackingVolumeHelper::glueTrackingVolumeArrays: not coded for cylinder Phi sectors yet, return 0" );
571  return enclosingVolume;
572  }
573 
574  // if the swap is required
575  BoundarySurfaceFace firstFaceCorr = firstFace;
576  BoundarySurfaceFace secondFaceCorr = secondFace;
577 
578 
579  // build volume envelope
580  std::vector<std::shared_ptr<TrackingVolume>> vols;
581  std::unique_ptr<CylinderVolumeBounds> envBounds{};
582  std::unique_ptr<Amg::Transform3D> envTransf{};
583  std::unique_ptr<BinnedArray<TrackingVolume>> subVols{};
584  vols.push_back(firstVol);
585  vols.push_back(secondVol);
586  std::vector<std::shared_ptr<TrackingVolume>> envGlueNegXY{}, envGluePosXY{}, envGlueOuter, envGlueInner{};
587 
588  if (firstFace==positiveFaceXY) {
589  envBounds = std::make_unique<CylinderVolumeBounds>(cyl1->innerRadius(),
590  cyl1->outerRadius(),
591  cyl1->halflengthZ() + cyl2->halflengthZ());
592 
593  const Amg::Vector3D center{firstVol->center()};
594  envTransf = std::make_unique<Amg::Transform3D>(Amg::getTranslate3D(center.x(),
595  center.y(),
596  center.z() + cyl2->halflengthZ()));
597 
598  subVols = m_trackingVolumeArrayCreator->cylinderVolumesArrayInZ(vols, false);
599  envGlueNegXY.push_back(firstVol);
600  envGluePosXY.push_back(secondVol);
601  envGlueOuter = vols;
602  envGlueInner = vols;
603  } else if (firstFace==negativeFaceXY) {
604  envBounds = std::make_unique<CylinderVolumeBounds>(cyl1->innerRadius(),
605  cyl1->outerRadius(),
606  cyl1->halflengthZ()+cyl2->halflengthZ());
607  const Amg::Vector3D center{firstVol->center()};
608  envTransf = std::make_unique<Amg::Transform3D>(Amg::getTranslate3D(center.x(),
609  center.y(),
610  center.z() - cyl2->halflengthZ()));
611  envGlueNegXY.push_back(secondVol);
612  envGluePosXY.push_back(firstVol);
613  // revert vols
614  vols.clear();
615  vols.push_back(secondVol);
616  vols.push_back(firstVol);
617  // --- account for the swapping
618  firstFaceCorr = secondFace;
619  secondFaceCorr = firstFace;
620  //
621  subVols = m_trackingVolumeArrayCreator->cylinderVolumesArrayInZ(vols,false);
622  envGlueOuter = vols;
623  envGlueInner = vols;
624  } else if (firstFace==tubeInnerCover) {
625  if (secondFace==tubeOuterCover){
626  envBounds = std::make_unique<CylinderVolumeBounds>(cyl2->innerRadius(),
627  cyl1->outerRadius(),
628  cyl1->halflengthZ());
629  } else {
630  envBounds = std::make_unique<CylinderVolumeBounds>(cyl1->outerRadius(),
631  cyl1->halflengthZ());
632  }
633  if (!firstVol->transform().isApprox(Amg::Transform3D::Identity())) {
634  envTransf = std::make_unique<Amg::Transform3D>(Amg::getTranslate3D(firstVol->center()));
635  }
636  // revert vols
637  vols.clear();
638  vols.push_back(secondVol);
639  vols.push_back(firstVol);
640  // account for the swapping
641  firstFaceCorr = secondFace;
642  secondFaceCorr = firstFace;
643  //
644  subVols = m_trackingVolumeArrayCreator->cylinderVolumesArrayInR(vols,false);
645  envGlueNegXY = vols;
646  envGluePosXY = vols;
647  envGlueOuter.push_back(firstVol);
648  envGlueInner.push_back(secondVol);
649  } else {
650  envBounds = std::make_unique<CylinderVolumeBounds>(cyl1->innerRadius(),
651  cyl2->outerRadius(),
652  cyl1->halflengthZ());
653  if(!firstVol->transform().isApprox(Amg::Transform3D::Identity())){
654  envTransf = std::make_unique<Amg::Transform3D>(Amg::getTranslate3D(firstVol->center()));
655  }
656  subVols = m_trackingVolumeArrayCreator->cylinderVolumesArrayInR(vols, false);
657  envGlueNegXY = vols;
658  envGluePosXY = vols;
659  envGlueOuter.push_back(secondVol);
660  envGlueInner.push_back(firstVol);
661  // account for the swapping
662  firstFaceCorr = secondFace;
663  secondFaceCorr = firstFace;
664  }
665 
666  // create the enveloping volume
667  enclosingVolume = std::make_unique<TrackingVolume>(envTransf.release(),
668  envBounds.release(),
669  *firstVol,
670  nullptr, subVols.release(), name);
671 
672  // ENVELOPE GLUE DESCRIPTION -----------------------------------------------------------------
673  // glue descriptors ---- they jump to the first one
674  GlueVolumesDescriptor& glueDescr = enclosingVolume->glueVolumesDescriptor();
675 
676  // for the outside volumes, could be done in a loop as well, but will only save 4 lines
677  std::vector<TrackingVolume*> glueNegXY{}, gluePosXY{}, glueInner{},glueOuter{};
678  fillGlueVolumes(vols, envGlueNegXY, negativeFaceXY,glueNegXY);
679  fillGlueVolumes(vols, envGluePosXY, positiveFaceXY,gluePosXY);
680  fillGlueVolumes(vols, envGlueInner, tubeInnerCover,glueInner);
681  fillGlueVolumes(vols, envGlueOuter, tubeOuterCover,glueOuter);
682  // set them to the envelopGlueDescriptor
683  glueDescr.registerGlueVolumes(negativeFaceXY, glueNegXY);
684  glueDescr.registerGlueVolumes(positiveFaceXY, gluePosXY);
685  glueDescr.registerGlueVolumes(tubeInnerCover, glueInner);
686  glueDescr.registerGlueVolumes(tubeOuterCover, glueOuter);
687  glueDescr.registerGlueVolumes(cylinderCover, glueOuter);
688 
689  // INTERNAL GLUEING ---------------------------------------------------------------------------
690  glueTrackingVolumes(vols, firstFaceCorr, secondFaceCorr);
691 
692  return enclosingVolume;
693 }

◆ glueTrackingVolumeArrays() [2/2]

TrackingVolume * Trk::TrackingVolumeHelper::glueTrackingVolumeArrays ( TrackingVolume firstVol,
BoundarySurfaceFace  firstFace,
TrackingVolume secondVol,
BoundarySurfaceFace  secondFace,
std::string  name 
) const
overridevirtual

Method to glue two VolumeArrays together (at navigation level)

  • relies on information from glueDescriptor input:
  • first TrackingVolume
  • face of the BoundarySurface of the first volume
  • second volume that gets glued to the first volume
  • face of the BoundarySurface of the second volume output:
    • returns enveloping TrackingVolume with glueDescription set for consequent gluing

— Necessary as friendship cannot be inherited: your father's friend isn't necessary yours —

Implements Trk::ITrackingVolumeHelper.

Definition at line 409 of file TrackingVolumeHelper.cxx.

414 {
415  TrackingVolume* enclosingVolume = nullptr;
416 
417  const auto *cyl1 = dynamic_cast<const CylinderVolumeBounds*> (&(firstVol.volumeBounds()));
418  const auto *cyl2 = dynamic_cast<const CylinderVolumeBounds*> (&(secondVol.volumeBounds()));
419 
420  if (!cyl1 || !cyl2) {
421  ATH_MSG_ERROR( "TrackingVolumeHelper::glueTrackingVolumeArrays: input volumes not cylinders, return 0" );
422  return enclosingVolume;
423  }
424  if (cyl1->halfPhiSector()!= M_PI || cyl2->halfPhiSector()!= M_PI ) {
425  ATH_MSG_ERROR( "TrackingVolumeHelper::glueTrackingVolumeArrays: not coded for cylinder Phi sectors yet, return 0" );
426  return enclosingVolume;
427  }
428 
429  // if the swap is required
430  BoundarySurfaceFace firstFaceCorr = firstFace;
431  BoundarySurfaceFace secondFaceCorr = secondFace;
432 
433 
434  // build volume envelope
435  std::vector<TrackingVolume*> vols;
436  CylinderVolumeBounds* envBounds = nullptr;
437  Amg::Transform3D* envTransf = nullptr;
438  BinnedArray<TrackingVolume>* subVols = nullptr;
439  vols.push_back(&firstVol);
440  vols.push_back(&secondVol);
441  std::vector<TrackingVolume*> envGlueNegXY;
442  std::vector<TrackingVolume*> envGluePosXY;
443  std::vector<TrackingVolume*> envGlueOuter;
444  std::vector<TrackingVolume*> envGlueInner;
445 
446  if (firstFace==positiveFaceXY) {
447  envBounds = new CylinderVolumeBounds(cyl1->innerRadius(),
448  cyl1->outerRadius(),
449  cyl1->halflengthZ()+cyl2->halflengthZ());
450  envTransf = new Amg::Transform3D;
451  (*envTransf) = Amg::Translation3D(firstVol.center().x(),
452  firstVol.center().y(),
453  firstVol.center().z()+cyl2->halflengthZ());
454  subVols = m_trackingVolumeArrayCreator->cylinderVolumesArrayInZ(vols,false);
455  envGlueNegXY.push_back(&firstVol);
456  envGluePosXY.push_back(&secondVol);
457  envGlueOuter = vols;
458  envGlueInner = vols;
459  } else if (firstFace==negativeFaceXY) {
460  envBounds = new CylinderVolumeBounds(cyl1->innerRadius(),
461  cyl1->outerRadius(),
462  cyl1->halflengthZ()+cyl2->halflengthZ());
463  envTransf = new Amg::Transform3D;
464  (*envTransf) = Amg::Translation3D(firstVol.center().x(),
465  firstVol.center().y(),
466  firstVol.center().z()-cyl2->halflengthZ());
467  envGlueNegXY.push_back(&secondVol);
468  envGluePosXY.push_back(&firstVol);
469  // revert vols
470  vols.clear();
471  vols.push_back(&secondVol);
472  vols.push_back(&firstVol);
473  // --- account for the swapping
474  firstFaceCorr = secondFace;
475  secondFaceCorr = firstFace;
476  //
477  subVols = m_trackingVolumeArrayCreator->cylinderVolumesArrayInZ(vols,false);
478  envGlueOuter = vols;
479  envGlueInner = vols;
480  } else if (firstFace==tubeInnerCover) {
481  if (secondFace==tubeOuterCover){
482  envBounds = new CylinderVolumeBounds(cyl2->innerRadius(),
483  cyl1->outerRadius(),
484  cyl1->halflengthZ());
485  } else {
486  envBounds = new CylinderVolumeBounds(cyl1->outerRadius(),
487  cyl1->halflengthZ());
488  }
489  envTransf = firstVol.transform().isApprox(Amg::Transform3D::Identity()) ? nullptr : new Amg::Transform3D;
490  if (envTransf)
491  (*envTransf) = Amg::Translation3D(firstVol.center());
492  // revert vols
493  vols.clear();
494  vols.push_back(&secondVol);
495  vols.push_back(&firstVol);
496  // account for the swapping
497  firstFaceCorr = secondFace;
498  secondFaceCorr = firstFace;
499  //
500  subVols = m_trackingVolumeArrayCreator->cylinderVolumesArrayInR(vols,false);
501  envGlueNegXY = vols;
502  envGluePosXY = vols;
503  envGlueOuter.push_back(&firstVol);
504  envGlueInner.push_back(&secondVol);
505  } else {
506  envBounds = new CylinderVolumeBounds(cyl1->innerRadius(),
507  cyl2->outerRadius(),
508  cyl1->halflengthZ());
509  envTransf = firstVol.transform().isApprox(Amg::Transform3D::Identity()) ? nullptr : new Amg::Transform3D;
510  if (envTransf)
511  (*envTransf) = Amg::Translation3D(firstVol.center());
512  subVols = m_trackingVolumeArrayCreator->cylinderVolumesArrayInR(vols,false);
513  envGlueNegXY = vols;
514  envGluePosXY = vols;
515  envGlueOuter.push_back(&secondVol);
516  envGlueInner.push_back(&firstVol);
517  // account for the swapping
518  firstFaceCorr = secondFace;
519  secondFaceCorr = firstFace;
520  }
521 
522  // create the enveloping volume
523  enclosingVolume = new TrackingVolume(envTransf,
524  envBounds,
525  firstVol,
526  nullptr,subVols,
527  name);
528 
529  // ENVELOPE GLUE DESCRIPTION -----------------------------------------------------------------
530  // glue descriptors ---- they jump to the first one
531  GlueVolumesDescriptor& glueDescr = enclosingVolume->glueVolumesDescriptor();
532 
533  // for the outside volumes, could be done in a loop as well, but will only save 4 lines
534  std::vector<TrackingVolume*> glueNegXY;
535  std::vector<TrackingVolume*> gluePosXY;
536  std::vector<TrackingVolume*> glueInner;
537  std::vector<TrackingVolume*> glueOuter;
538  fillGlueVolumes(vols,envGlueNegXY,negativeFaceXY,glueNegXY);
539  fillGlueVolumes(vols,envGluePosXY,positiveFaceXY,gluePosXY);
540  fillGlueVolumes(vols,envGlueInner,tubeInnerCover,glueInner);
541  fillGlueVolumes(vols,envGlueOuter,tubeOuterCover,glueOuter);
542  // set them to the envelopGlueDescriptor
543  glueDescr.registerGlueVolumes(negativeFaceXY, glueNegXY);
544  glueDescr.registerGlueVolumes(positiveFaceXY, gluePosXY);
545  glueDescr.registerGlueVolumes(tubeInnerCover, glueInner);
546  glueDescr.registerGlueVolumes(tubeOuterCover, glueOuter);
547  glueDescr.registerGlueVolumes(cylinderCover, glueOuter);
548 
549  // INTERNAL GLUEING ---------------------------------------------------------------------------
550  glueTrackingVolumes(vols,firstFaceCorr,secondFaceCorr);
551 
552  return enclosingVolume;
553 }

◆ glueTrackingVolumes() [1/5]

void Trk::TrackingVolumeHelper::glueTrackingVolumes ( const std::vector< std::shared_ptr< TrackingVolume >> &  glueVols,
BoundarySurfaceFace  glueFace,
BoundarySurfaceFace  secondFace 
) const
private

Execute the glueing - the input volumes are all on navigation level.

Definition at line 735 of file TrackingVolumeHelper.cxx.

737  {
738  glueTrackingVolumes(::toRawVec(glueVols), firstFace, secondFace);
739 
740 }

◆ glueTrackingVolumes() [2/5]

void Trk::TrackingVolumeHelper::glueTrackingVolumes ( const std::vector< TrackingVolume * > &  firstVolumes,
BoundarySurfaceFace  firstFace,
const std::vector< TrackingVolume * > &  secondVolumes,
BoundarySurfaceFace  secondFace,
bool  buildBoundaryLayer = false,
bool  boundaryFaceExchange = false 
) const
overridevirtual

Method to glue two VolumeArrays together (at navigation level) - without output.

Simply forward to base class method to enhance friendship relation.

— Necessary as friendship cannot be inherited: your father's friend isn't necessary yours —

Implements Trk::ITrackingVolumeHelper.

Definition at line 188 of file TrackingVolumeHelper.cxx.

194 {
195 
196 
197  BinnedArray<TrackingVolume>* navArrayOne = nullptr;
198  BinnedArray<TrackingVolume>* navArrayTwo = nullptr;
199 
200  std::unique_ptr<Surface> mLayerSurface;
201  std::shared_ptr<Layer> mLayer;
202 
203  ATH_MSG_VERBOSE("Glue configuration firstFace | secondFace = " << firstFace << " | " << secondFace );
204 
205  // create the Arrays - assuming cylindrical TrackingVolumes
206  if (firstFace < 2 && secondFace < 2 ) {
207  ATH_MSG_VERBOSE( "The glueing is done along z axis" );
208  navArrayOne = m_trackingVolumeArrayCreator->cylinderVolumesArrayInR(firstVolumes, true);
209  navArrayTwo = m_trackingVolumeArrayCreator->cylinderVolumesArrayInR(secondVolumes, true);
210  // build a disc to separate the two
211  if (buildBoundaryLayer || boundaryFaceExchange){
212  double rmin = 10e10; double rmax = 0; double boundaryz = 0.; double centerzOne = 0.;
213  for (const auto & volIter : firstVolumes ){
214  const CylinderVolumeBounds* cb = dynamic_cast<const CylinderVolumeBounds*>(&(volIter->volumeBounds()));
215  if (cb) {
216  takeSmaller(rmin,cb->innerRadius());
217  takeBigger(rmax,cb->outerRadius());
218  // get the z of the surface
219  boundaryz = volIter->boundarySurfaces()[firstFace]->surfaceRepresentation().center().z();
220  }
221  centerzOne = volIter->center().z();
222  }
223  if (buildBoundaryLayer){
224  Amg::Transform3D mLayerTransform =
225  Amg::Transform3D(Amg::Translation3D(0., 0., boundaryz));
226  // layer surface
227  mLayerSurface = std::make_unique<DiscSurface>(mLayerTransform, rmin, rmax);
228  // create a MaterialLayer
229  std::unique_ptr<LayerMaterialProperties> lmps = layerMaterialProperties(*mLayerSurface);
230  // MaterialLayer clones the LayerMaterialPropteries.
231 
232  if (lmps) {
233  mLayer = std::make_unique<MaterialLayer>(std::move(mLayerSurface), *lmps);
234  }
235  }
236  if (boundaryFaceExchange){
237  // creating only one boundary surface
238  ATH_MSG_VERBOSE("Creating a joint boundary surface for n-to-n glueing case.");
239  // check if the seconf volumes have a bigger z value or a smaller one
240  double centerzTwo = secondVolumes[secondVolumes.size()-1]->center().z();
241  // thi sboundary surface is having a z-axix along the global z-axis
242  Amg::Transform3D boundaryTransform = Amg::getTranslateZ3D(boundaryz);
243  // disc surfaces
244  DiscSurface dSurface(boundaryTransform, rmin, rmax);
245  // swap if needed
246  if (centerzTwo < centerzOne){
247  std::swap(navArrayTwo, navArrayOne);
248  }
249  // create the new boudnary surface which spans over the entire volume border
250  SharedObject< BinnedArray<TrackingVolume> > navArrayInside(navArrayOne);
251  SharedObject< BinnedArray<TrackingVolume> > navArrayOutside(navArrayTwo);
252  BoundaryDiscSurface<TrackingVolume>* boundarySurface = new BoundaryDiscSurface<TrackingVolume>(navArrayInside,navArrayOutside,dSurface);
253  SharedObject<BoundarySurface<TrackingVolume> > sharedBoundarySurface(boundarySurface);
254  // attach the material layer to the shared boundary if existing
255  if (mLayer) {
256  ATH_MSG_VERBOSE( "Set MaterialLayer to the BoundarySurface of volume from second array." );
257  boundarySurface->surfaceRepresentation().setMaterialLayer(mLayer);
258  }
259  // set the boundary surface to the volumes of both sides
260  for (const auto & volIter : firstVolumes){
261  ATH_MSG_VERBOSE(" -> first array : setting a newly created boundary surface to " << volIter->volumeName());
262  setBoundarySurface(*volIter,sharedBoundarySurface,firstFace);
263  }
264  for (const auto & volIter : secondVolumes){
265  ATH_MSG_VERBOSE(" -> second array : setting a newly created boundary surface to " << volIter->volumeName());
266  setBoundarySurface(*volIter,sharedBoundarySurface,secondFace);
267  }
268  // we are done here
269  return;
270  }
271  }
272  } else {
273  ATH_MSG_VERBOSE( "The glueing is done along the radius." );
274  navArrayOne = m_trackingVolumeArrayCreator->cylinderVolumesArrayInZ(firstVolumes, true);
275  navArrayTwo = m_trackingVolumeArrayCreator->cylinderVolumesArrayInZ(secondVolumes, true);
276  // check if the boundary layer was configured to be built
277  if (buildBoundaryLayer || boundaryFaceExchange){
278  // build a cylinder to separate the two
279  double zmin = 10e10; double zmax = -10e10; double boundaryr = 0.; double volumerOne = 0.; double volumerTwo = 10e10;
280  for (const auto & volIter : firstVolumes ){
281  const CylinderVolumeBounds* cb = dynamic_cast<const CylinderVolumeBounds*>(&(volIter->volumeBounds()));
282  if (cb) {
283  takeSmaller(zmin,volIter->center().z()-cb->halflengthZ());
284  takeBigger(zmax,volIter->center().z()+cb->halflengthZ());
285  // get the z of the surface
286  boundaryr = volIter->boundarySurfaces()[firstFace]->surfaceRepresentation().bounds().r();
287  // get the volume radius
288  volumerOne = cb->outerRadius();
289  }
290  }
291  // check if boundary layer should be built
292  if (buildBoundaryLayer){
293  std::unique_ptr<Amg::Transform3D> mLayerTransform =
294  ((zmin + zmax) * (zmin + zmax) < 10e-4)
295  ? nullptr
296  : std::make_unique < Amg::Transform3D>();
297 
298  if (mLayerTransform) (*mLayerTransform) = Amg::Translation3D(0.,0.,0.5*(zmin+zmax));
299  mLayerSurface.reset( mLayerTransform ? new CylinderSurface(*mLayerTransform,boundaryr,0.5*(zmax-zmin)) :
300  new CylinderSurface(boundaryr,0.5*(zmax-zmin)) );
301  // create a MaterialLayer
302  std::unique_ptr<LayerMaterialProperties> lmps = layerMaterialProperties(*mLayerSurface);
303  // LayerMaterialProperties will be cloned in MaterialLayer
304  if (lmps) mLayer = std::make_unique<MaterialLayer>(
305  std::shared_ptr<Surface>(std::move(mLayerSurface)),
306  *lmps );
307  }
308  // check if boundary face should be exchanged
309  if (boundaryFaceExchange) {
310  // creating only one boundary surface
311  ATH_MSG_VERBOSE("Creating a joint boundary surface for n-to-n glueing case.");
312  // the boundary transform can be 0 for cylinder surfaces
313  std::unique_ptr<Amg::Transform3D> boundaryTransform =
314  ((zmin + zmax) * (zmin + zmax) < 10e-4)
315  ? nullptr
316  : std::make_unique<Amg::Transform3D>();
317 
318  if (boundaryTransform) (*boundaryTransform) = Amg::getTranslateZ3D(0.5*(zmin+zmax));
319  // create the cylinder surface for the shared boundary
320  CylinderSurface cSurface = boundaryTransform ? CylinderSurface(*boundaryTransform,boundaryr,0.5*(zmax-zmin)) :
321  CylinderSurface(boundaryr,0.5*(zmax-zmin));
322  // get the volume outer radius of the sconf volumes
323  const CylinderVolumeBounds* cbTwo = dynamic_cast<const CylinderVolumeBounds*>(&(secondVolumes[secondVolumes.size()-1]->volumeBounds()));
324  if (cbTwo){
325  volumerTwo = cbTwo->outerRadius();
326  }
327  // swap if needed
328  if (volumerTwo < volumerOne){
329  BinnedArray<TrackingVolume>* navArraySwap = navArrayOne;
330  navArrayTwo = navArrayOne;
331  navArrayOne = navArraySwap;
332  }
333  // create the new boudnary surface which spans over the entire volume border
334  SharedObject< BinnedArray<TrackingVolume> > navArrayInside(navArrayOne);
335  SharedObject< BinnedArray<TrackingVolume> > navArrayOutside(navArrayTwo);
336  BoundaryCylinderSurface<TrackingVolume>* boundarySurface = new BoundaryCylinderSurface<TrackingVolume>(navArrayInside,navArrayOutside,cSurface);
337  SharedObject<BoundarySurface<TrackingVolume> > sharedBoundarySurface(boundarySurface);
338  // attach the material layer to the shared boundary if existing
339  if (mLayer) {
340  ATH_MSG_VERBOSE("Set MaterialLayer to the BoundarySurface of volume from second array.");
341  // assume that now the mlayer onwership goes over to the TrackingVolume
342  boundarySurface->surfaceRepresentation().setMaterialLayer(mLayer);
343  }
344  // set the boundary surface to the volumes of both sides
345  for (const auto & volIter : firstVolumes){
346  ATH_MSG_VERBOSE(" -> first array : setting a newly created boundary surface to " << volIter->volumeName());
347  setBoundarySurface(*volIter,sharedBoundarySurface,firstFace);
348  }
349  for (const auto & volIter : secondVolumes){
350  ATH_MSG_VERBOSE(" -> second array : setting a newly created boundary surface to " << volIter->volumeName());
351  setBoundarySurface(*volIter,sharedBoundarySurface,secondFace);
352  }
353  // we are done here
354  return;
355 
356  }
357  } // build either boundary layer or exchange the face
358  } // radial glueing
359 
360 
361  // create the boundary faces - not creating a joint one
362  ATH_MSG_VERBOSE("Leaving individual boundary surfaces for n-to-n glueing case.");
363 
364  // assign the navigation arrays
365  SharedObject< BinnedArray< TrackingVolume> > navArrayOneShared(navArrayOne);
366  SharedObject< BinnedArray< TrackingVolume> > navArrayTwoShared(navArrayTwo);
367 
368  // (a) to the first set of volumes
369  for (const auto & tVolIter: firstVolumes) {
370  // take care of the orientation of the normal vector
371  if (firstFace != tubeInnerCover) {
372  setOutsideTrackingVolumeArray(*tVolIter,firstFace,navArrayTwoShared);
373  ATH_MSG_VERBOSE( "Set outsideTrackingVolumeArray at face " << firstFace << " to " << (*tVolIter).volumeName() );
374  } else {
375  setInsideTrackingVolumeArray(*tVolIter,firstFace,navArrayTwoShared);
376  ATH_MSG_VERBOSE( "Set insideTrackingVolumeArray at face " << firstFace << " to " << (*tVolIter).volumeName() );
377  }
378  // set the boundary layer if it exists
379  if (mLayer) {
380  ATH_MSG_VERBOSE( "Set MaterialLayer to the BoundarySurface of volume from first array." );
381  Surface& firstFaceSurface = tVolIter->boundarySurfaces()[firstFace]->surfaceRepresentation();
382  // assume that now the mlayer onwership goes over to the TrackingVolume
383  //cppcheck-suppress ignoredReturnValue
384  firstFaceSurface.setMaterialLayer(mLayer);
385  }
386 
387  }
388  // (b) to the second set of volumes
389  for (const auto & tVolIter : secondVolumes) {
390  // take care of the orientation of the normal vector
391  if (secondFace != tubeInnerCover) {
392  ATH_MSG_VERBOSE( "Set outsideTrackingVolumeArray at face " << secondFace << " to " << (*tVolIter).volumeName() );
393  setOutsideTrackingVolumeArray(*tVolIter,secondFace,navArrayOneShared);
394  } else {
395  ATH_MSG_VERBOSE( "Set insideTrackingVolumeArray at face " << secondFace << " to " << (*tVolIter).volumeName() );
396  setInsideTrackingVolumeArray(*tVolIter,secondFace,navArrayOneShared);
397  }
398  if (mLayer) {
399  ATH_MSG_VERBOSE( "Set MaterialLayer to the BoundarySurface of volume from second array." );
400  Surface& secondFaceSurface = tVolIter->boundarySurfaces()[secondFace]->surfaceRepresentation();
401  // assume that now the mlayer onwership goes over to the TrackingVolume
402  //cppcheck-suppress ignoredReturnValue
403  secondFaceSurface.setMaterialLayer(mLayer);
404  }
405  }
406  // coverity will report a bug here for mLayer running out of scope, but the memory management is done later in the TrackingVolume
407 }

◆ glueTrackingVolumes() [3/5]

void Trk::TrackingVolumeHelper::glueTrackingVolumes ( const std::vector< TrackingVolume * > &  glueVols,
BoundarySurfaceFace  glueFace,
BoundarySurfaceFace  secondFace 
) const
private

Definition at line 741 of file TrackingVolumeHelper.cxx.

743  {
744 
745  if (glueVols.size()<2) {
746  ATH_MSG_VERBOSE( "Nothing to do in glueVolumes() " );
747  return;
748  }
749 
750 
751  ATH_MSG_VERBOSE( " glueTrackingVolumes() called with boundary faces " << static_cast<int>(firstFace)
752  << " and " << static_cast<int>(secondFace) << "." );
753 
754  // the iterators through the volumes
755  std::vector<TrackingVolume*>::const_iterator firstVol = glueVols.begin();
756  std::vector<TrackingVolume*>::const_iterator secondVol = firstVol + 1;
757  for ( ; secondVol != glueVols.end(); ++firstVol, ++secondVol) {
758 
759  if (msgLvl(MSG::VERBOSE))
760  ATH_MSG_VERBOSE( "Processing '" << (*firstVol)->volumeName() << "' and '" << (*secondVol)->volumeName() << "'." );
761 
762  // get the glue volume descriptors to see that we have all subvolumes
763  GlueVolumesDescriptor& glueDescr1 = (*firstVol)->glueVolumesDescriptor();
764  GlueVolumesDescriptor& glueDescr2 = (*secondVol)->glueVolumesDescriptor();
765 
766  // glue volumes at navigation level
767  std::vector<TrackingVolume*> glueVols1{}, glueVols2{};
768  glueVols1 = glueDescr1.glueVolumes(firstFace);
769  glueVols2 = glueDescr2.glueVolumes(secondFace);
770 
771  // trivial cases
772  // (glue one to the other)
773  if (glueVols1.empty() && glueVols2.empty()) {
774  glueTrackingVolumes(**firstVol,firstFace,**secondVol,secondFace);
775  continue;
776  // (glue one to many)
777  } else if (glueVols1.empty() && !glueVols2.empty()) {
778  glueVols1.push_back(*firstVol);
779  // (glue the other one to many)
780  } else if (!glueVols1.empty() && glueVols2.empty()) {
781  glueVols2.push_back(*secondVol);
782  }
783 
784  // non-trivial case :: array against array
785  // in Z : assume 2dim R/Phi
786  if (firstFace==negativeFaceXY || firstFace==positiveFaceXY ) {
787  // turn both vectors into R/Phi 2dim binnedArrays; assume equidistant binning in Phi
788  SharedObject<BinnedArray<TrackingVolume>> sgv1{m_trackingVolumeArrayCreator->cylinderVolumesArrayInPhiR(glueVols1,true)};
789  SharedObject<BinnedArray<TrackingVolume>> sgv2{m_trackingVolumeArrayCreator->cylinderVolumesArrayInPhiR(glueVols2,true)};
790 
791  // array vs. array in Z
792  if (glueVols2.size()>1)
793  for (auto & vol : glueVols1) setOutsideTrackingVolumeArray( *vol, firstFace, sgv2 );
794  else
795  for (auto & vol : glueVols1) setOutsideTrackingVolume( *vol, firstFace, glueVols2[0] );
796 
797  if (glueVols1.size()>1)
798  for (auto & vol : glueVols2) setOutsideTrackingVolumeArray( *vol, secondFace, sgv1 );
799  else
800  for (auto & vol : glueVols2) setOutsideTrackingVolume( *vol, secondFace, glueVols1[0] );
801 
802 
803  } else {
804  // turn both vectors into Z/Phi 2dim binnedArrays; assume equidistant binning in Phi
805  SharedObject<BinnedArray<TrackingVolume>> sgv1{m_trackingVolumeArrayCreator->cylinderVolumesArrayInPhiZ(glueVols1,true)};
806  SharedObject<BinnedArray<TrackingVolume>> sgv2{m_trackingVolumeArrayCreator->cylinderVolumesArrayInPhiZ(glueVols2,true)};
807 
808  // the glue cases -----------------------------------------------------------------------------------
809  // handle the tube with care !
810  // first vol
811  for (auto & vol : glueVols1) {
812  // set the array as the outside array of the firstVol
813  if (firstFace != tubeInnerCover) {
814  if (glueVols2.size()>1)
815  setOutsideTrackingVolumeArray( *vol, firstFace, sgv2 );
816  else
817  setOutsideTrackingVolume( *vol, firstFace, glueVols2[0] );
818  } else {
819  if (glueVols2.size()>1){
820  setInsideTrackingVolumeArray( *vol, firstFace, sgv2 );
821  setOutsideTrackingVolume( *vol, firstFace, vol );
822  } else {
823  setInsideTrackingVolume( *vol, firstFace, glueVols2[0] );
824  setOutsideTrackingVolume( *vol, firstFace, vol );
825  }
826  }
827  }
828  // second
829  for (auto & vol : glueVols2) {
830  // set the array as the outside array of the secondVol
831  if (secondFace != tubeInnerCover)
832  setOutsideTrackingVolumeArray( *vol, secondFace, sgv1 );
833  else {
834  setInsideTrackingVolumeArray( *vol, secondFace, sgv1 );
835  setOutsideTrackingVolume( *vol, secondFace, vol );
836  }
837  }
838  }
839  }
840 }

◆ glueTrackingVolumes() [4/5]

void Trk::TrackingVolumeHelper::glueTrackingVolumes ( TrackingVolume firstVol,
BoundarySurfaceFace  firstFace,
const std::vector< TrackingVolume * > &  secondVolumes,
BoundarySurfaceFace  secondFace,
bool  buildBoundaryLayer = false,
bool  boundaryFaceExchange = false 
) const
overridevirtual

Method to glue two Volumes together input:

Simply forward to base class method to enhance friendship relation.

— Necessary as friendship cannot be inherited: your father's friend isn't necessary yours —

Implements Trk::ITrackingVolumeHelper.

Definition at line 102 of file TrackingVolumeHelper.cxx.

108 {
109 
110  if (msgLvl(MSG::VERBOSE)) {
111  ATH_MSG_VERBOSE( "Glue Volume '" << firstVol.volumeName() << "' to " << secondVolumes.size() << " volume(s): " );
112  for (const auto & volIter : secondVolumes)
113  ATH_MSG_VERBOSE( " -> " << (volIter)->volumeName() );
114  }
115  // prepare the material layer if needed
116  std::shared_ptr<Layer> mLayer{};
117  // ----------------------------------------------------------------------------------------
118  // create a MaterialLayer as a boundary
119  if (buildBoundaryLayer){
120  // the first face surface
121  Surface& firstFaceSurface = firstVol.boundarySurfaces()[firstFace]->surfaceRepresentation();
122  std::unique_ptr<LayerMaterialProperties> lmps = layerMaterialProperties(firstFaceSurface);
123  // LayerMaterialProperties are cloned by MaterialLayer
124 
125  // the material layer is ready - it can be assigned
126  mLayer = std::make_unique<MaterialLayer>(firstFaceSurface, *lmps);
127  ATH_MSG_VERBOSE( "Set MaterialLayer to the BoundarySurface of first volume (may be shared with second volume)." );
128  firstFaceSurface.setMaterialLayer(mLayer);
129  }
130  // if only one volume was given in the vector call the standard one-to-one glueing
131  // 1-to-1 case
132  if (secondVolumes.size() == 1) {
133  // self call for one-on-one
134  glueTrackingVolumes(firstVol, firstFace, *(secondVolumes[0]), secondFace);
135  } else {
136  // create the navigation bin array
137  BinnedArray<TrackingVolume>* navArray = nullptr;
138  // create the Array - either r-binned or z-binned
139  if (firstFace == negativeFaceXY || firstFace == positiveFaceXY )
140  navArray = m_trackingVolumeArrayCreator->cylinderVolumesArrayInR(secondVolumes, true);
141  else
142  navArray = m_trackingVolumeArrayCreator->cylinderVolumesArrayInZ(secondVolumes, true);
143 
144  // set the volume array to the first boundary surface - this must always happen
145  if (firstFace != tubeInnerCover)
146  setOutsideTrackingVolumeArray( firstVol, firstFace, navArray );
147  else
148  setInsideTrackingVolumeArray( firstVol, firstFace, navArray );
149  // the navigation arrays are completed now - check if the boundary face should be exchanged
150  // [1] the boundary face exchange ----------------------------------------------------------------------------------------
151  if (boundaryFaceExchange){
152  // creating only one boundary surface
153  ATH_MSG_VERBOSE("Creating a joint boundary surface for 1-to-n glueing case.");
154  // get the dimension of boundary surface of the first volume
155  SharedObject<BoundarySurface<TrackingVolume> > bSurface = firstVol.boundarySurfaces()[firstFace];
156  // replace the boundary surface
157  for ( const auto & volIter: secondVolumes )
158  setBoundarySurface(*volIter, bSurface, secondFace);
159  } else {
160  // [2] the traditional way, keeping two boundary surfaces
161  // now set the face to the volume array -------------------------------------------------------------------------------
162  for ( const auto & volIter: secondVolumes ) {
163  // the secondGlueFace
164  BoundarySurfaceFace secondGlueFace = secondFace;
165  if (secondFace == tubeOuterCover) {
166  //check for cylinder case
167  const CylinderVolumeBounds* currentVolBounds = dynamic_cast<const CylinderVolumeBounds*>(&((volIter)->volumeBounds()));
168  // protection : there may be a cylinder within the tube vector
169  if (currentVolBounds && currentVolBounds->innerRadius() < 10e-3)
170  secondGlueFace = cylinderCover;
171  setOutsideTrackingVolume(*volIter, secondGlueFace, (&(firstVol)));
172  } // for all surfaces except the tunbeInnerCover outside of the surface is identical to outside of the volume
173  else if (secondGlueFace != tubeInnerCover)
174  setOutsideTrackingVolume(*volIter, secondGlueFace, (&(firstVol)));
175  else
176  setInsideTrackingVolume(*volIter, secondGlueFace, (&(firstVol)));
177  // if existing, set the material Layer
178  // get the second face surface and set the new MaterialLayer
179  Surface& secondFaceSurface = volIter->boundarySurfaces()[secondFace]->surfaceRepresentation();
180  secondFaceSurface.setMaterialLayer(mLayer);
181  }
182  }
183  } // 1-to-n case
184 }

◆ glueTrackingVolumes() [5/5]

void Trk::TrackingVolumeHelper::glueTrackingVolumes ( TrackingVolume firstVol,
BoundarySurfaceFace  firstFace,
TrackingVolume secondVol,
BoundarySurfaceFace  secondFace,
bool  buildBoundaryLayer = false 
) const
overridevirtual

Method to glue two Volumes together input:

Simply forward to base class method to enhance friendship relation.

— Necessary as friendship cannot be inherited: your father's friend isn't necessary yours —

Implements Trk::ITrackingVolumeHelper.

Definition at line 70 of file TrackingVolumeHelper.cxx.

75 {
76  TrackingVolumeManipulator::glueVolumes( firstVol, firstFace, secondVol, secondFace );
77 
78  // ----------------------------------------------------------------------------------------
79  // create a MaterialLayer as a boundary
80  if (buildBoundaryLayer){
81  auto& bSurfacesFirst = firstVol.boundarySurfaces();
82  auto& bSurfacesSecond = secondVol.boundarySurfaces();
83  // get the boundary surfaces
84  Surface& firstFaceSurface = bSurfacesFirst[firstFace]->surfaceRepresentation();
85  Surface& secondFaceSurface = bSurfacesSecond[secondFace]->surfaceRepresentation();
86  // dynamic_cast to the right type
87  std::unique_ptr<LayerMaterialProperties> lmps = layerMaterialProperties(firstFaceSurface);
88  // LayerMaterialProperties will be cloned in MaterialLayer
89 
90  // set the layer to the two surfaces
91  if (lmps){
92  std::shared_ptr<Layer> mLayer = std::make_shared<MaterialLayer>(firstFaceSurface, *lmps);
93  ATH_MSG_VERBOSE( "Set MaterialLayer to the BoundarySurface of first volume." );
94  firstFaceSurface.setMaterialLayer(mLayer);
95  ATH_MSG_VERBOSE("Set MaterialLayer to the BoundarySurface of second volume.");
96  secondFaceSurface.setMaterialLayer(mLayer);
97  }
98  }
99 }

◆ glueVolumes()

void Trk::TrackingVolumeManipulator::glueVolumes ( Trk::TrackingVolume firstVol,
Trk::BoundarySurfaceFace  firstFace,
Trk::TrackingVolume secondVol,
Trk::BoundarySurfaceFace  secondFace 
) const
protectedinherited

protected method to glue two Volumes together input:

Definition at line 17 of file TrackingVolumeManipulator.cxx.

22 {
23  // check if it is a cylinder volume
24  const Trk::CylinderVolumeBounds* cylBounds =
25  dynamic_cast<const Trk::CylinderVolumeBounds*>(&(firstVol.volumeBounds()));
26 
27  if (firstFace == Trk::tubeOuterCover && secondFace == Trk::tubeInnerCover)
28  return glueVolumes(secondVol, secondFace, firstVol, firstFace);
29 
30  // the second volume gets the face of the first volume assigned
31  (secondVol.m_boundarySurfaces)[secondFace] =
32  (firstVol.m_boundarySurfaces)[firstFace];
33  // the face of the first volume has been an inner tube
34  if (cylBounds && firstFace == Trk::tubeInnerCover &&
35  secondFace == Trk::tubeOuterCover) {
36  (secondVol.m_boundarySurfaces)[secondFace]->setInsideVolume(&secondVol);
37  } else {
38  (secondVol.m_boundarySurfaces)[secondFace]->setOutsideVolume(&secondVol);
39  }
40 }

◆ initialize()

StatusCode Trk::TrackingVolumeHelper::initialize ( )
override

AlgTool initialize method.

Definition at line 60 of file TrackingVolumeHelper.cxx.

60  {
61 
62  ATH_MSG_DEBUG( "initialize() " );
63  ATH_CHECK(m_layerArrayCreator.retrieve());
65  return StatusCode::SUCCESS;
66 }

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

◆ layerMaterialProperties()

std::unique_ptr< LayerMaterialProperties > Trk::TrackingVolumeHelper::layerMaterialProperties ( const Trk::Surface sf) const
private

< helper method to construct barrel material

Definition at line 843 of file TrackingVolumeHelper.cxx.

843  {
844 
845  std::unique_ptr<LayerMaterialProperties> layerMaterial{};
846 
847  if (boundarySurface.type() == SurfaceType::Cylinder){
848  const CylinderBounds* cb = dynamic_cast<const CylinderBounds*>(&boundarySurface.bounds());
849  if (!cb) throw std::logic_error("Not CylinderBounds");
850  // --------------- material estimation ----------------------------------------------------------------
851  // -- material with 1D binning
852  double hz = cb->halflengthZ();
853  double r = cb->r();
854  BinUtility layerBinUtilityZ(m_barrelLayerBinsZ, -hz, hz, open, binZ);
855  if (m_barrelLayerBinsPhi==1){
856  layerMaterial = std::make_unique<BinnedLayerMaterial>(layerBinUtilityZ);
857  } else { // -- material with 2D binning
858  BinUtility layerBinUtilityRPhiZ(m_barrelLayerBinsPhi, -r*M_PI, r*M_PI, closed,binRPhi);
859  layerBinUtilityRPhiZ += layerBinUtilityZ;
860  layerMaterial = std::make_unique<BinnedLayerMaterial>(layerBinUtilityRPhiZ);
861  }
862  // --------------- material estimation ----------------------------------------------------------------
863  }
864  if (boundarySurface.type() == SurfaceType::Disc){
865  // --------------- material estimation ----------------------------------------------------------------
866  const DiscBounds* db = dynamic_cast<const DiscBounds*>(&boundarySurface.bounds());
867  if (!db) throw std::logic_error("Not DiscBounds");
868  double rMin = db->rMin();
869  double rMax = db->rMax();
870  BinUtility layerBinUtilityR(m_endcapLayerBinsR,rMin,rMax,open, binR);
871  // -- material with 1D binning
872  if (m_endcapLayerBinsPhi==1){
873  layerMaterial = std::make_unique<BinnedLayerMaterial>(layerBinUtilityR);
874  } else { // -- material with 2D binning
875  BinUtility layerBinUtilityPhi(m_endcapLayerBinsPhi,-M_PI,M_PI,closed,binPhi);
876  layerBinUtilityR += layerBinUtilityPhi;
877  layerMaterial = std::make_unique<BinnedLayerMaterial>(layerBinUtilityR);
878  }
879  // --------------- material estimation ----------------------------------------------------------------
880  }
881  // return what you have
882  return layerMaterial;
883 }

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

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

◆ setBoundarySurface()

void Trk::TrackingVolumeManipulator::setBoundarySurface ( TrackingVolume tvol,
SharedObject< BoundarySurface< TrackingVolume >>  bsurf,
BoundarySurfaceFace  face 
)
staticprotectedinherited

protected method to set the boundary surface of a tracking volume

Definition at line 43 of file TrackingVolumeManipulator.cxx.

47 {
48  (tvol.m_boundarySurfaces)[face] = std::move(bsurf);
49 }

◆ setInsideTrackingVolume()

void Trk::TrackingVolumeHelper::setInsideTrackingVolume ( TrackingVolume tvol,
BoundarySurfaceFace  face,
TrackingVolume insidevol 
) const
overridevirtual

protected method to set inside Volume of a BoundarySurface: input:

Simply forward to base class method to enhance friendship relation.

  • the volume that holds the BoundarySurface
  • the face type of the boundary to be set
  • the volume to be set as inside volume

— Necessary as friendship cannot be inherited: your father's friend isn't necessary yours —

Implements Trk::ITrackingVolumeHelper.

Definition at line 888 of file TrackingVolumeHelper.cxx.

890  {
891  TrackingVolumeManipulator::setInsideVolume( tvol, face, insidevol );
892 }

◆ setInsideTrackingVolumeArray() [1/2]

void Trk::TrackingVolumeHelper::setInsideTrackingVolumeArray ( TrackingVolume tvol,
BoundarySurfaceFace  face,
BinnedArray< TrackingVolume > *  insidevolarray 
) const
overridevirtual

protected method to set inside VolumeArray of a BoundarySurface: input:

Simply forward to base class method to enhance friendship relation.

  • the volume that holds the BoundarySurface
  • the face type of the boundary to be set
  • the volume array to be set as inside volume array

— Necessary as friendship cannot be inherited: your father's friend isn't necessary yours —

Implements Trk::ITrackingVolumeHelper.

Definition at line 896 of file TrackingVolumeHelper.cxx.

898  {
899  TrackingVolumeManipulator::setInsideVolumeArray(tvol,face,insidevolarray);
900 }

◆ setInsideTrackingVolumeArray() [2/2]

void Trk::TrackingVolumeHelper::setInsideTrackingVolumeArray ( TrackingVolume tvol,
BoundarySurfaceFace  face,
SharedObject< BinnedArray< TrackingVolume >>  insidevolarray 
) const
overridevirtual

◆ setInsideVolume()

void Trk::TrackingVolumeManipulator::setInsideVolume ( Trk::TrackingVolume tvol,
Trk::BoundarySurfaceFace  face,
Trk::TrackingVolume insidevol 
)
staticprotectedinherited

protected method to set inside Volume of a BoundarySurface: input:

  • the volume that holdes the BoundarySurface
  • the face type of the boundary to be set
  • the volume to be set as inside volume

Definition at line 52 of file TrackingVolumeManipulator.cxx.

55 {
56 
57  (tvol.m_boundarySurfaces)[face]->setInsideVolume(insidevol);
58 }

◆ setInsideVolumeArray() [1/2]

void Trk::TrackingVolumeManipulator::setInsideVolumeArray ( Trk::TrackingVolume tvol,
Trk::BoundarySurfaceFace  face,
BinnedArray< TrackingVolume > *  insidevolarray 
)
staticprotectedinherited

protected method to set inside VolumeArray of a BoundarySurface: input:

  • ithe volume that holdes the BoundarySurface
  • the face type of the boundary to be set
  • the volume array to be set as inside volume array

Definition at line 61 of file TrackingVolumeManipulator.cxx.

65 {
66 
69 }

◆ setInsideVolumeArray() [2/2]

static void Trk::TrackingVolumeManipulator::setInsideVolumeArray ( TrackingVolume tvol,
BoundarySurfaceFace  face,
const SharedObject< BinnedArray< TrackingVolume >> &  insidevolarray 
)
staticprotectedinherited

protected method to set inside VolumeArray of a BoundarySurface: input:

  • ithe volume that holdes the BoundarySurface
  • the face type of the boundary to be set
  • the volume array to be set as inside volume array

◆ setOutsideTrackingVolume()

void Trk::TrackingVolumeHelper::setOutsideTrackingVolume ( TrackingVolume tvol,
BoundarySurfaceFace  face,
TrackingVolume outsidevol 
) const
overridevirtual

protected method to set outside Volume of a BoundarySurface: input:

Simply forward to base class method to enhance friendship relation.

  • the volume that holds the BoundarySurface
  • the face type of the boundary to be set
  • the volume to be set as outside volume

— Necessary as friendship cannot be inherited: your father's friend isn't necessary yours —

Implements Trk::ITrackingVolumeHelper.

Definition at line 912 of file TrackingVolumeHelper.cxx.

914  {
915  ATH_MSG_VERBOSE( " -> Glue '" << outsidevol->volumeName() << "' at face " << face << " to '" << tvol.volumeName() << "'.");
916  TrackingVolumeManipulator::setOutsideVolume( tvol, face, outsidevol );
917 }

◆ setOutsideTrackingVolumeArray() [1/2]

void Trk::TrackingVolumeHelper::setOutsideTrackingVolumeArray ( TrackingVolume tvol,
BoundarySurfaceFace  face,
BinnedArray< TrackingVolume > *  outsidevolarray 
) const
overridevirtual

protected method to set outside VolumeArray of a BoundarySurface: input:

Simply forward to base class method to enhance friendship relation.

  • the volume that holds the BoundarySurface
  • the face type of the boundary to be set
  • the volume array to be set as outside volume array

Implements Trk::ITrackingVolumeHelper.

Definition at line 921 of file TrackingVolumeHelper.cxx.

923  {
924  unsigned int numVols = outsidevolarray->arrayObjects().size() ;
925  ATH_MSG_VERBOSE( " -> Glue " << numVols << " volumes at face " << face << " to '" << tvol.volumeName() );
926  TrackingVolumeManipulator::setOutsideVolumeArray( tvol, face, outsidevolarray );
927 }

◆ setOutsideTrackingVolumeArray() [2/2]

void Trk::TrackingVolumeHelper::setOutsideTrackingVolumeArray ( TrackingVolume tvol,
BoundarySurfaceFace  face,
SharedObject< BinnedArray< TrackingVolume >>  outsidevolarray 
) const
overridevirtual

◆ setOutsideVolume()

void Trk::TrackingVolumeManipulator::setOutsideVolume ( Trk::TrackingVolume tvol,
Trk::BoundarySurfaceFace  face,
Trk::TrackingVolume outsidevol 
)
staticprotectedinherited

protected method to set outside Volume of a BoundarySurface: input:

  • the volume that holdes the BoundarySurface
  • the face type of the boundary to be set
  • the volume to be set as outside volume

Definition at line 82 of file TrackingVolumeManipulator.cxx.

86 {
87  (tvol.m_boundarySurfaces)[face]->setOutsideVolume(outsidevol);
88 }

◆ setOutsideVolumeArray() [1/2]

void Trk::TrackingVolumeManipulator::setOutsideVolumeArray ( Trk::TrackingVolume tvol,
Trk::BoundarySurfaceFace  face,
BinnedArray< TrackingVolume > *  outsidevolarray 
)
staticprotectedinherited

protected method to set outside VolumeArray of a BoundarySurface: input:

  • the volume that holdes the BoundarySurface
  • the face type of the boundary to be set
  • the volume array to be set as outside volume array

Definition at line 91 of file TrackingVolumeManipulator.cxx.

95 {
96 
99 }

◆ setOutsideVolumeArray() [2/2]

static void Trk::TrackingVolumeManipulator::setOutsideVolumeArray ( TrackingVolume tvol,
BoundarySurfaceFace  face,
const SharedObject< BinnedArray< TrackingVolume >> &  outsidevolarray 
)
staticprotectedinherited

protected method to set outside VolumeArray of a BoundarySurface: input:

  • the volume that holdes the BoundarySurface
  • the face type of the boundary to be set
  • the volume array to be set as outside volume array

◆ sysInitialize()

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

Perform system initialization for an algorithm.

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

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

◆ sysStart()

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

Handle START transition.

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

◆ updateVHKA()

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

Definition at line 308 of file AthCommonDataStore.h.

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

Member Data Documentation

◆ m_barrelLayerBinsPhi

Gaudi::Property<int> Trk::TrackingVolumeHelper::m_barrelLayerBinsPhi {this, "BarrelLayerBinsPhi", 1}
private

material bins in Phi

Definition at line 247 of file TrackingVolumeHelper.h.

◆ m_barrelLayerBinsZ

Gaudi::Property<int> Trk::TrackingVolumeHelper::m_barrelLayerBinsZ {this, "BarrelLayerBinsZ", 1}
private

material bins in Z

Definition at line 246 of file TrackingVolumeHelper.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_endcapLayerBinsPhi

Gaudi::Property<int> Trk::TrackingVolumeHelper::m_endcapLayerBinsPhi {this, "EndcapLayerBinsPhi", 1}
private

material bins in Phi

Definition at line 249 of file TrackingVolumeHelper.h.

◆ m_endcapLayerBinsR

Gaudi::Property<int> Trk::TrackingVolumeHelper::m_endcapLayerBinsR {this, "EndcapLayerBinsR", 1}
private

material bins in R

Definition at line 248 of file TrackingVolumeHelper.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_layerArrayCreator

PublicToolHandle<ILayerArrayCreator> Trk::TrackingVolumeHelper::m_layerArrayCreator {this, "LayerArrayCreator", "Trk::LayerArrayCreator/LayerArrayCreator"}
private

A Tool for coherent LayerArray creation.

Definition at line 241 of file TrackingVolumeHelper.h.

◆ m_trackingVolumeArrayCreator

ToolHandle<ITrackingVolumeArrayCreator> Trk::TrackingVolumeHelper::m_trackingVolumeArrayCreator {this, "TrackingVolumeArrayCreator", "Trk::TrackingVolumeArrayCreator/TrackingVolumeArrayCreator"}
private

Helper Tool to create TrackingVolume.

Arrays

Definition at line 243 of file TrackingVolumeHelper.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.

◆ s_layerThickness

constexpr double Trk::TrackingVolumeHelper::s_layerThickness
staticconstexprprivate
Initial value:

standard layer thickness

Definition at line 251 of file TrackingVolumeHelper.h.


The documentation for this class was generated from the following files:
beamspotman.r
def r
Definition: beamspotman.py:676
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
Trk::binZ
@ binZ
Definition: BinningType.h:49
PixelAthClusterMonAlgCfg.zmin
zmin
Definition: PixelAthClusterMonAlgCfg.py:176
Trk::TrackingVolumeHelper::setOutsideTrackingVolumeArray
void setOutsideTrackingVolumeArray(TrackingVolume &tvol, BoundarySurfaceFace face, BinnedArray< TrackingVolume > *outsidevolarray) const override
protected method to set outside VolumeArray of a BoundarySurface: input:
Definition: TrackingVolumeHelper.cxx:921
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CaloCondBlobAlgs_fillNoiseFromASCII.db
db
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:43
Trk::TrackingVolumeHelper::m_barrelLayerBinsPhi
Gaudi::Property< int > m_barrelLayerBinsPhi
material bins in Phi
Definition: TrackingVolumeHelper.h:247
Amg::getTranslateZ3D
Amg::Transform3D getTranslateZ3D(const double Z)
: Returns a shift transformation along the z-axis
Definition: GeoPrimitivesHelpers.h:285
Trk::TrackingVolumeHelper::m_barrelLayerBinsZ
Gaudi::Property< int > m_barrelLayerBinsZ
material bins in Z
Definition: TrackingVolumeHelper.h:246
Trk::TrackingVolumeHelper::setOutsideTrackingVolume
void setOutsideTrackingVolume(TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *outsidevol) const override
protected method to set outside Volume of a BoundarySurface: input:
Definition: TrackingVolumeHelper.cxx:912
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:7
M_PI
#define M_PI
Definition: ActiveFraction.h:11
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
Trk::closed
@ closed
Definition: BinningType.h:41
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
bound
@ bound
Definition: L1CaloPprPlotManager.h:74
Trk::positiveFaceXY
@ positiveFaceXY
Definition: BoundarySurfaceFace.h:33
Trk::TrackingVolumeHelper::m_layerArrayCreator
PublicToolHandle< ILayerArrayCreator > m_layerArrayCreator
A Tool for coherent LayerArray creation.
Definition: TrackingVolumeHelper.h:241
Trk::TrackingVolumeManipulator::setOutsideVolume
static void setOutsideVolume(TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *outsidevol)
protected method to set outside Volume of a BoundarySurface: input:
Definition: TrackingVolumeManipulator.cxx:82
Trk::TrackingVolumeHelper::m_endcapLayerBinsPhi
Gaudi::Property< int > m_endcapLayerBinsPhi
material bins in Phi
Definition: TrackingVolumeHelper.h:249
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Trk::TrackingVolumeHelper::fillGlueVolumes
static void fillGlueVolumes(const std::vector< TrackingVolume * > &topLevelVolumes, const std::vector< TrackingVolume * > &envelopeFaceVolumes, BoundarySurfaceFace glueFace, std::vector< Trk::TrackingVolume * > &glueVols)
Private method - it takes the full vector of given volumes to create the supervolume,...
Definition: TrackingVolumeHelper.cxx:707
Trk::TrackingVolumeManipulator::setInsideVolumeArray
static void setInsideVolumeArray(TrackingVolume &tvol, BoundarySurfaceFace face, BinnedArray< TrackingVolume > *insidevolarray)
protected method to set inside VolumeArray of a BoundarySurface: input:
Definition: TrackingVolumeManipulator.cxx:61
Trk::BoundarySurfaceFace
BoundarySurfaceFace
Definition: BoundarySurfaceFace.h:31
Trk::TrackingVolumeManipulator::setOutsideVolumeArray
static void setOutsideVolumeArray(TrackingVolume &tvol, BoundarySurfaceFace face, BinnedArray< TrackingVolume > *outsidevolarray)
protected method to set outside VolumeArray of a BoundarySurface: input:
Definition: TrackingVolumeManipulator.cxx:91
SharedObject
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
takeBigger
#define takeBigger(current, test)
Definition: RobustTrackingGeometryBuilderImpl.h:44
Trk::TrackingVolumeHelper::setInsideTrackingVolumeArray
void setInsideTrackingVolumeArray(TrackingVolume &tvol, BoundarySurfaceFace face, BinnedArray< TrackingVolume > *insidevolarray) const override
protected method to set inside VolumeArray of a BoundarySurface: input:
Definition: TrackingVolumeHelper.cxx:896
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Trk::TrackingVolumeHelper::setInsideTrackingVolume
void setInsideTrackingVolume(TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *insidevol) const override
protected method to set inside Volume of a BoundarySurface: input:
Definition: TrackingVolumeHelper.cxx:888
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
PixelAthClusterMonAlgCfg.zmax
zmax
Definition: PixelAthClusterMonAlgCfg.py:176
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Trk::negativeFaceXY
@ negativeFaceXY
Definition: BoundarySurfaceFace.h:32
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Trk::CylinderVolumeBounds
Definition: CylinderVolumeBounds.h:70
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
takeSmaller
#define takeSmaller(current, test)
Definition: RobustTrackingGeometryBuilderImpl.h:43
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::TrackingVolumeManipulator::setInsideVolume
static void setInsideVolume(TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *insidevol)
protected method to set inside Volume of a BoundarySurface: input:
Definition: TrackingVolumeManipulator.cxx:52
Trk::open
@ open
Definition: BinningType.h:40
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
Trk::TrackingVolumeHelper::layerMaterialProperties
std::unique_ptr< Trk::LayerMaterialProperties > layerMaterialProperties(const Trk::Surface &sf) const
< helper method to construct barrel material
Definition: TrackingVolumeHelper.cxx:843
Trk::binR
@ binR
Definition: BinningType.h:50
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
Trk::SharedObject
std::shared_ptr< T > SharedObject
Definition: SharedObject.h:24
h
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
Trk::binRPhi
@ binRPhi
Definition: BinningType.h:52
Trk::TrackingVolumeManipulator::setBoundarySurface
static void setBoundarySurface(TrackingVolume &tvol, SharedObject< BoundarySurface< TrackingVolume >> bsurf, BoundarySurfaceFace face)
protected method to set the boundary surface of a tracking volume
Definition: TrackingVolumeManipulator.cxx:43
Trk::TrackingVolumeManipulator::glueVolumes
void glueVolumes(TrackingVolume &firstVol, BoundarySurfaceFace firstFace, TrackingVolume &secondVol, BoundarySurfaceFace secondFace) const
protected method to glue two Volumes together input:
Definition: TrackingVolumeManipulator.cxx:17
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
Trk::Volume::volumeBounds
const VolumeBounds & volumeBounds() const
returns the volumeBounds()
Definition: Volume.h:97
Trk::SurfaceType::Disc
@ Disc
Trk::cylinderCover
@ cylinderCover
Definition: BoundarySurfaceFace.h:38
Trk::SurfaceType::Cylinder
@ Cylinder
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
Trk::tubeOuterCover
@ tubeOuterCover
Definition: BoundarySurfaceFace.h:40
Trk::TrackingVolumeHelper::m_endcapLayerBinsR
Gaudi::Property< int > m_endcapLayerBinsR
material bins in R
Definition: TrackingVolumeHelper.h:248
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
Trk::tubeInnerCover
@ tubeInnerCover
Definition: BoundarySurfaceFace.h:39
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
fitman.hz
def hz
Definition: fitman.py:516
Trk::BinnedArray
Definition: BinnedArray.h:38
Trk::TrackingVolumeHelper::glueTrackingVolumes
void glueTrackingVolumes(TrackingVolume &firstVol, BoundarySurfaceFace firstFace, TrackingVolume &secondVol, BoundarySurfaceFace secondFace, bool buildBoundaryLayer=false) const override
Method to glue two Volumes together input:
Definition: TrackingVolumeHelper.cxx:70
Trk::TrackingVolume::m_boundarySurfaces
std::vector< SharedObject< BoundarySurface< TrackingVolume > > > m_boundarySurfaces
Definition: TrackingVolume.h:454
Trk::TrackingVolumeHelper::m_trackingVolumeArrayCreator
ToolHandle< ITrackingVolumeArrayCreator > m_trackingVolumeArrayCreator
Helper Tool to create TrackingVolume.
Definition: TrackingVolumeHelper.h:243
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Trk::TrackingVolumeManipulator::TrackingVolumeManipulator
TrackingVolumeManipulator()
constructor
Definition: TrackingVolumeManipulator.h:35
fitman.k
k
Definition: fitman.py:528
Amg::getTranslate3D
Amg::Transform3D getTranslate3D(const double X, const double Y, const double Z)
: Returns a shift transformation along an arbitrary axis
Definition: GeoPrimitivesHelpers.h:289
Trk::binPhi
@ binPhi
Definition: BinningType.h:51