ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::GeometryBuilderCond Class Reference

The Trk::TrackingGeometry Builder for ATLAS Geometry. More...

#include <GeometryBuilderCond.h>

Inheritance diagram for Trk::GeometryBuilderCond:
Collaboration diagram for Trk::GeometryBuilderCond:

Public Member Functions

 GeometryBuilderCond (const std::string &, const std::string &, const IInterface *)
 Constructor.
virtual StatusCode initialize () override
 AlgTool initialize method.
virtual std::unique_ptr< Trk::TrackingGeometrytrackingGeometry (const EventContext &ctx, Trk::TrackingVolume *tVol, SG::WriteCondHandle< TrackingGeometry > &whandle) const override
 TrackingGeometry Interface method - optionally a pointer to Bounds Interface marked as not thread safe.
virtual GeometrySignature geometrySignature () const override
 The unique signature.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
 DeclareInterfaceID (IGeometryBuilderCond, 1, 0)
 Creates the InterfaceID and interfaceID() method.

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
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.
void glueVolumes (TrackingVolume &firstVol, BoundarySurfaceFace firstFace, TrackingVolume &secondVol, BoundarySurfaceFace secondFace) const
 protected method to glue two Volumes together input:

Static Protected Member Functions

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

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

std::unique_ptr< Trk::TrackingGeometryatlasTrackingGeometry (const EventContext &ctx, SG::WriteCondHandle< TrackingGeometry > &whandle) const
 TrackingGeometry for ATLAS setup.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< bool > m_createWorld
Gaudi::Property< int > m_navigationLevel {this, "NavigationLevel", 2}
Gaudi::Property< std::vector< double > > m_worldDimension {this, "WorldDimension", {}, "The dimensions of the manually created world"}
Gaudi::Property< std::vector< double > > m_worldMaterialProperties {this, "WorldMaterialProperties", {}, "The material properties of the created world"}
Material m_worldMaterial {}
 the world material
ToolHandle< ITrackingVolumeArrayCreatorm_trackingVolumeArrayCreator
ToolHandle< ITrackingVolumeHelperm_trackingVolumeHelper
ToolHandle< IGeometryBuilderCondm_inDetGeometryBuilderCond
ToolHandle< IGeometryBuilderCondm_caloGeometryBuilderCond
ToolHandle< IGeometryBuilderCondm_hgtdGeometryBuilderCond {this, "HGTD_TrackingGeometryBuilder", "", "GeometryBuilder for the HGTD"}
ToolHandle< IGeometryBuilderCondm_muonGeometryBuilderCond
Gaudi::Property< bool > m_compactify
Gaudi::Property< bool > m_synchronizeLayers
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

The Trk::TrackingGeometry Builder for ATLAS Geometry.

It retrieves Trk::TrackingGeometry builders for the subdetectors and joins them together to a single Trk::TrackingGeometry.

Author
Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch
Christos Anastopoulos MT fixes

Definition at line 46 of file GeometryBuilderCond.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

◆ GeometryBuilderCond()

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

Constructor.

Definition at line 32 of file GeometryBuilderCond.cxx.

33: AthAlgTool(t,n,p),
35{
36 declareInterface<IGeometryBuilderCond>(this);
37}
AthAlgTool()
Default constructor:

Member Function Documentation

◆ atlasTrackingGeometry()

std::unique_ptr< Trk::TrackingGeometry > Trk::GeometryBuilderCond::atlasTrackingGeometry ( const EventContext & ctx,
SG::WriteCondHandle< TrackingGeometry > & whandle ) const
private

TrackingGeometry for ATLAS setup.

Definition at line 124 of file GeometryBuilderCond.cxx.

126{
127 // the return geometry
128 std::unique_ptr<Trk::TrackingGeometry> atlasTrackingGeometry;
129
130 // A ------------- INNER DETECTOR SECTION --------------------------------------------------------------------------------
131 // get the Inner Detector and/or HGTD and/or Calorimeter trackingGeometry
132
133 // the volumes to be given to higher level tracking geometry builders
134 Trk::TrackingVolume* inDetVolume = nullptr;
135 Trk::TrackingVolume* hgtdVolume = nullptr;
136 Trk::TrackingVolume* caloVolume = nullptr;
137
138 // mark the highest volume
139 Trk::TrackingVolume* highestVolume = nullptr;
140
141#ifdef TRKDETDESCR_MEMUSAGE
142 m_memoryLogger.refresh(getpid());
143 ATH_MSG_INFO( "[ memory usage ] Start of TrackingGeometry building: " );
144 ATH_MSG_INFO( m_memoryLogger );
145#endif
146
147 // ========================== INNER DETECTOR PART =================================================
148 if (!m_inDetGeometryBuilderCond.empty()) {
149 // debug output
150 ATH_MSG_VERBOSE( "ID Tracking Geometry is going to be built." );
151 // build the geometry
152 std::unique_ptr<Trk::TrackingGeometry> inDetTrackingGeometry =
153 m_inDetGeometryBuilderCond->trackingGeometry(ctx, nullptr, whandle);
154 // check
155 if (inDetTrackingGeometry) {
156 // sign it
157 inDetTrackingGeometry->sign(m_inDetGeometryBuilderCond->geometrySignature());
158 // check whether the world has to be created or not
159 if (m_createWorld) {
160 // checkout the highest InDet volume
161 inDetVolume = inDetTrackingGeometry->checkoutHighestTrackingVolume();
162 // assign it as the highest volume
163 highestVolume = inDetVolume;
164 } else // -> Take the exit and return ID stand alone
165 atlasTrackingGeometry = std::move(inDetTrackingGeometry);
166 }
167
168#ifdef TRKDETDESCR_MEMUSAGE
169 m_memoryLogger.refresh(getpid());
170 ATH_MSG_INFO( "[ memory usage ] After InDet TrackingGeometry building: " );
171 ATH_MSG_INFO( m_memoryLogger );
172#endif
173
174 }
175
176 // ========================== HGTD PART =================================================
177 // if a HGTD Geometry Builder is present -> wrap it around the ID
178 if (!m_hgtdGeometryBuilderCond.empty()) {
179 if (inDetVolume)
180 ATH_MSG_VERBOSE( "HGTD Tracking Geometry is going to be built with enclosed ID." );
181 else
182 ATH_MSG_VERBOSE( "HGTD Tracking Geometry is going to be built stand-alone." );
183 // get the InnerDetector TrackingGeometry
184 std::unique_ptr<Trk::TrackingGeometry> hgtdTrackingGeometry =
185 m_hgtdGeometryBuilderCond->trackingGeometry(ctx, inDetVolume, whandle);
186 // if you have to create world or there is a Calo/Muon geometry builder ...
187 if (hgtdTrackingGeometry) {
188 // sign it
189 hgtdTrackingGeometry->sign(m_hgtdGeometryBuilderCond->geometrySignature());
190 if (m_createWorld){
191 // check out the highest Calo volume
192 hgtdVolume = hgtdTrackingGeometry->checkoutHighestTrackingVolume();
193 // assign it as the highest volume (overwrite ID)
194 highestVolume = hgtdVolume;
195 } else // -> Take the exit and return HGTD back
196 atlasTrackingGeometry = std::move(hgtdTrackingGeometry);
197 }
198
199#ifdef TRKDETDESCR_MEMUSAGE
200 m_memoryLogger.refresh(getpid());
201 ATH_MSG_INFO( "[ memory usage ] After Calo TrackingGeometry building: " );
202 ATH_MSG_INFO( m_memoryLogger );
203#endif
204
205 }
206
207 // ========================== CALORIMETER PART =================================================
208 // if a Calo Geometry Builder is present -> wrap it around the ID or HGTD
209 if (!m_caloGeometryBuilderCond.empty()) {
210 std::string enclosed = "stand-alone.";
211 if (inDetVolume and hgtdVolume)
212 enclosed = "with encloded ID/HGTD.";
213 else if (inDetVolume or hgtdVolume)
214 enclosed = (inDetVolume) ? "with encloded ID." : "with encloded HGTD.";
215 ATH_MSG_VERBOSE( "Calorimeter Tracking Geometry is going to be built "<< enclosed );
216
217 // get the InnerDetector TrackingGeometry or the HGTD tracking geometry
218 std::unique_ptr<Trk::TrackingGeometry> caloTrackingGeometry;
219 if (inDetVolume and not hgtdVolume)
220 caloTrackingGeometry = m_caloGeometryBuilderCond->trackingGeometry(ctx, inDetVolume, whandle);
221 else
222 caloTrackingGeometry = m_caloGeometryBuilderCond->trackingGeometry(ctx, hgtdVolume, whandle);
223 // if you have to create world or there is a Muon geometry builder ...
224 if (caloTrackingGeometry) {
225 // sign it
226 caloTrackingGeometry->sign(m_caloGeometryBuilderCond->geometrySignature());
227 if (m_createWorld){
228 // check out the highest Calo volume
229 caloVolume = caloTrackingGeometry->checkoutHighestTrackingVolume();
230 // assign it as the highest volume (overwrite ID)
231 highestVolume = caloVolume;
232 } else // -> Take the exit and return Calo back
233 atlasTrackingGeometry = std::move(caloTrackingGeometry);
234 }
235
236#ifdef TRKDETDESCR_MEMUSAGE
237 m_memoryLogger.refresh(getpid());
238 ATH_MSG_INFO( "[ memory usage ] After Calo TrackingGeometry building: " );
239 ATH_MSG_INFO( m_memoryLogger );
240#endif
241
242 }
243
244 // ========================== MUON SYSTEM PART =================================================
245 // if Muon Geometry Builder is present -> wrap either ID or Calo
246 if (!m_muonGeometryBuilderCond.empty()) {
247 std::string enclosed = "stand-alone.";
248 if (inDetVolume and hgtdVolume and caloVolume )
249 enclosed = "with encloded ID/HGTD/Calo.";
250 else if (inDetVolume or hgtdVolume or caloVolume) {
251 if (inDetVolume) {
252 if (hgtdVolume)
253 enclosed = "with encloded ID/HGTD";
254 else if (caloVolume)
255 enclosed = "with encloded ID/Calo";
256 else
257 enclosed = "with encloded ID";
258 } else if (hgtdVolume) {
259 if (caloVolume)
260 enclosed = "with encloded HGTD/Calo";
261 else
262 enclosed = "with encloded HGTD";
263 } else {
264 enclosed = "with encloded Calo";
265 }
266 }
267 ATH_MSG_VERBOSE( "Muon System Tracking Geometry is going to be built "<< enclosed );
268
269 // there's nothing outside the muons -- wrap the calo or the HGTD if one or both of them exist
270 if (inDetVolume and not hgtdVolume and not caloVolume)
271 atlasTrackingGeometry = m_muonGeometryBuilderCond->trackingGeometry(ctx, inDetVolume, whandle);
272 else if (hgtdVolume and not caloVolume)
273 atlasTrackingGeometry = m_muonGeometryBuilderCond->trackingGeometry(ctx, hgtdVolume, whandle);
274 else
275 atlasTrackingGeometry = m_muonGeometryBuilderCond->trackingGeometry(ctx, caloVolume, whandle);
276
277 // sign it
279 atlasTrackingGeometry->sign(m_muonGeometryBuilderCond->geometrySignature());
280
281#ifdef TRKDETDESCR_MEMUSAGE
282 m_memoryLogger.refresh(getpid());
283 ATH_MSG_INFO( "[ memory usage ] After Muon TrackingGeometry building: " );
284 ATH_MSG_INFO( m_memoryLogger );
285#endif
286
287 // ========================== WRAPPING SECTION FOR ID/CALO ====================================
288 } else if (m_createWorld && highestVolume) {
289 // wrapping and world creation has been switched on
290 ATH_MSG_VERBOSE( "Enclosing world is going to be built for: " << highestVolume->volumeName() );
291 // get the glue volumes
292 Trk::GlueVolumesDescriptor& innerGlueVolumes = highestVolume->glueVolumesDescriptor();
293 // some screen output
294 ATH_MSG_VERBOSE( "Retrieved with following glue volumes: " << innerGlueVolumes );
295 // at negative face
296 const std::vector<Trk::TrackingVolume*>& innerNegativeFaceVolumes = innerGlueVolumes.glueVolumes(Trk::negativeFaceXY);
297 // at cylinder cover
298 const std::vector<Trk::TrackingVolume*>& innerCentralFaceVolumes = innerGlueVolumes.glueVolumes(Trk::cylinderCover);
299 // at positive face
300 const std::vector<Trk::TrackingVolume*>& innerPositiveFaceVolumes = innerGlueVolumes.glueVolumes(Trk::positiveFaceXY);
301
302 // get the dimensions
303 // cast them to CylinderVolumeBounds
304 const Trk::CylinderVolumeBounds* innerVolumeBounds = dynamic_cast<const Trk::CylinderVolumeBounds*>(&(highestVolume->volumeBounds()));
305 if (!innerVolumeBounds) ATH_MSG_WARNING( "atlasTrackingGeometry() ... dynamic cast to innerVolumeBounds failed!" );
306 double innerVolumeOuterR = innerVolumeBounds ? innerVolumeBounds->outerRadius() : 0;
307 double innerVolumeHalflengthZ = innerVolumeBounds ? innerVolumeBounds->halflengthZ() : 0;
308 // Hierarchy after enclosing
309 //
310 // AtlasWorldVolume:
311 // AtlasInnerCylinder
312 // AtlasInnerNegativeSector
313 // InnerEnclosedVolume (can be ID/Calo)
314 // AtlasOuterNegativeSector
315 // AtlasOuterTube
316 // B -------------- BUILD WORLD AROUND for ID stand alone applications
317
318 double innerCylinderSectorHalflengthZ = 0.5*(m_worldDimension[2] - innerVolumeHalflengthZ);
319 auto innerCylinderSectorBounds = std::make_shared<Trk::CylinderVolumeBounds>(0., innerVolumeOuterR, innerCylinderSectorHalflengthZ);
320
321 double innerCylinderSectorPositionZ = fabs(m_worldDimension[2]-innerCylinderSectorHalflengthZ);
322
323 // the AtlasInnerNegativeSector
324 auto atlasInnerNegativeSectorTransf = std::make_unique<Amg::Transform3D>(Amg::Translation3D(0.,0.,-innerCylinderSectorPositionZ));
325 Trk::TrackingVolume* atlasInnerNegativeSector = new Trk::TrackingVolume(
326 std::move(atlasInnerNegativeSectorTransf),
327 innerCylinderSectorBounds,
329 nullptr,
330 nullptr,
331 "AtlasInnerNegativeSector");
332
333 // the AtlasInnerPositiveSector
334 auto atlasInnerPositiveSectorTransf = std::make_unique<Amg::Transform3D>(Amg::Translation3D(0.,0.,innerCylinderSectorPositionZ));
335 Trk::TrackingVolume* atlasInnerPositiveSector = new Trk::TrackingVolume(
336 std::move(atlasInnerPositiveSectorTransf),
337 std::make_shared<Trk::CylinderVolumeBounds>(*innerCylinderSectorBounds),
339 nullptr,
340 nullptr,
341 "AtlasInnerPositiveSector");
342
343 ATH_MSG_VERBOSE( "Inner Negative/Positive Sectors built successfully." );
344
345 // create the subvolume Array
346 auto atlasInnerSectorVolumes = std::vector<Trk::TrackingVolume*>{atlasInnerNegativeSector,highestVolume,atlasInnerPositiveSector};
347
348 ATH_MSG_VERBOSE( "Create the Atlas Inner Sector volumes. " );
349 std::unique_ptr<Trk::BinnedArray<Trk::TrackingVolume>> atlasInnerSectorVolumeArray = m_trackingVolumeArrayCreator ?
350 m_trackingVolumeArrayCreator->cylinderVolumesArrayInZ(atlasInnerSectorVolumes) : nullptr;
351
352
353 // Atlas inner Sector bounds
354 auto innerSectorBounds =
355 std::make_shared<Trk::CylinderVolumeBounds>(0., innerVolumeOuterR, m_worldDimension[2]);
356 // build the Tracking volumes
357 Trk::TrackingVolume* atlasInnerSector = new Trk::TrackingVolume(nullptr,
358 innerSectorBounds,
360 nullptr,
361 std::move(atlasInnerSectorVolumeArray),
362 "AtlasInnerSector");
363
364 // Atlas outer Sector
365 auto outerSectorBounds =
366 std::make_shared<Trk::CylinderVolumeBounds>(innerVolumeOuterR, m_worldDimension[1], m_worldDimension[2]);
367 Trk::TrackingVolume* atlasOuterSector = new Trk::TrackingVolume(nullptr,
368 outerSectorBounds,
370 nullptr,
371 nullptr,
372 "AtlasOuterSector");
373
374 ATH_MSG_VERBOSE( "Atlas Inner/Outer Sectors built successfully." );
375
376 // create the array of Inner and Outer sector
377 auto atlasVolumes = std::vector<Trk::TrackingVolume*>{atlasInnerSector, atlasOuterSector};
378
379 std::unique_ptr<Trk::BinnedArray<Trk::TrackingVolume>> atlasVolumeArray = m_trackingVolumeArrayCreator ?
380 m_trackingVolumeArrayCreator->cylinderVolumesArrayInR(atlasVolumes) : nullptr;
381
382 // create the Atlas volume bounds
383 auto atlasBounds = std::make_shared<Trk::CylinderVolumeBounds>(0., m_worldDimension[1], m_worldDimension[2]);
384
385 // create the Atlas TrackingVolume
386 Trk::TrackingVolume* atlasVolume = new Trk::TrackingVolume(nullptr,
387 atlasBounds,
389 nullptr,
390 std::move(atlasVolumeArray),
391 "Atlas");
392
393 ATH_MSG_VERBOSE( "Atlas Tracking World volume built successfully." );
394
395
396 // glue the inner sector to be complete
397 m_trackingVolumeHelper->glueTrackingVolumes( *atlasInnerNegativeSector, Trk::positiveFaceXY,
398 innerNegativeFaceVolumes, Trk::negativeFaceXY );
399
400 m_trackingVolumeHelper->glueTrackingVolumes( *atlasInnerPositiveSector, Trk::negativeFaceXY,
401 innerPositiveFaceVolumes, Trk::positiveFaceXY );
402
403 ATH_MSG_VERBOSE( "Atlas Inner Sector glued successfully together." );
404
405 // iterators to the face volumes
406 auto volIter = innerCentralFaceVolumes.begin();
407 auto volIterEnd = innerCentralFaceVolumes.end();
408
409 // glue outer and inner sector together
410 std::vector<Trk::TrackingVolume*> atlasInnerOuterVolumes;
411 atlasInnerOuterVolumes.push_back(atlasInnerNegativeSector);
412 for ( ; volIter != volIterEnd; ++volIter)
413 if (*volIter) atlasInnerOuterVolumes.push_back(*volIter);
414 atlasInnerOuterVolumes.push_back(atlasInnerPositiveSector);
415
416 m_trackingVolumeHelper->glueTrackingVolumes(*atlasOuterSector, Trk::tubeInnerCover,
417 atlasInnerOuterVolumes, Trk::tubeOuterCover);
418
419 ATH_MSG_VERBOSE( "Atlas Inner/Outer Sector glued successfully together." );
420
421 // job done -> create the TrackingGeometry
422 atlasTrackingGeometry = std::make_unique<Trk::TrackingGeometry>(atlasVolume);
423
424 // detailed information about this tracking geometry
425 ATH_MSG_VERBOSE( "Atlas TrackingGeometry built with following parameters : ");
426 //ATH_MSG_VERBOSE( " - TrackingVolume containers : " << atlasTrackingGeometry->numberOfContainerVolumes() );
427 //ATH_MSG_VERBOSE( " - TrackingVolume at navigation level : " << atlasTrackingGeometry->numberOfContainerVolumes() );
428 //ATH_MSG_VERBOSE( " - Contained static layers : " << atlasTrackingGeometry->boundaryLayers().size());
429 ATH_MSG_VERBOSE( " - Unique material layers on boundaries : " << atlasTrackingGeometry->boundaryLayers().size());
430
431#ifdef TRKDETDESCR_MEMUSAGE
432 m_memoryLogger.refresh(getpid());
433 ATH_MSG_INFO( "[ memory usage ] After Outer Sector TrackingGeometry building: " );
434 ATH_MSG_INFO( m_memoryLogger );
435#endif
436
437 }
438
440 if (m_navigationLevel < 3)
441 atlasTrackingGeometry->registerNavigationLevel( Trk::NavigationLevel(m_navigationLevel.value()));
442 }
443 else ATH_MSG_WARNING( "atlasTrackingGeometry() ... atlasTrackingGeometry = 0, could not call registerNavigationLevel and propagateMagneticFieldProperties" );
444
445#ifdef TRKDETDESCR_MEMUSAGE
446 m_memoryLogger.refresh(getpid());
447 ATH_MSG_INFO( "[ memory usage ] End of TrackingGeometry building: " );
448 ATH_MSG_INFO( m_memoryLogger );
449#endif
450
451 // synchronize the layers
453 if (m_synchronizeLayers) atlasTrackingGeometry->synchronizeLayers(msg());
454
455 // compactify if configured to do so
456 if (m_compactify) atlasTrackingGeometry->compactify(msg());
457 }
459}
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
MsgStream & msg() const
double halflengthZ() const
This method returns the halflengthZ.
double outerRadius() const
This method returns the outer radius.
Gaudi::Property< bool > m_createWorld
ToolHandle< IGeometryBuilderCond > m_muonGeometryBuilderCond
ToolHandle< ITrackingVolumeHelper > m_trackingVolumeHelper
Material m_worldMaterial
the world material
Gaudi::Property< bool > m_synchronizeLayers
ToolHandle< IGeometryBuilderCond > m_caloGeometryBuilderCond
ToolHandle< IGeometryBuilderCond > m_inDetGeometryBuilderCond
Gaudi::Property< std::vector< double > > m_worldDimension
Gaudi::Property< int > m_navigationLevel
ToolHandle< IGeometryBuilderCond > m_hgtdGeometryBuilderCond
std::unique_ptr< Trk::TrackingGeometry > atlasTrackingGeometry(const EventContext &ctx, SG::WriteCondHandle< TrackingGeometry > &whandle) const
TrackingGeometry for ATLAS setup.
Gaudi::Property< bool > m_compactify
ToolHandle< ITrackingVolumeArrayCreator > m_trackingVolumeArrayCreator
const std::vector< TrackingVolume * > & glueVolumes(BoundarySurfaceFace)
retrieve them again
const std::string & volumeName() const
Returns the VolumeName - for debug reason, might be depreciated later.
GlueVolumesDescriptor & glueVolumesDescriptor()
const VolumeBounds & volumeBounds() const
returns the volumeBounds()
Definition Volume.h:96
Eigen::Translation< double, 3 > Translation3D
NavigationLevel
destinguishes an association TrackingGeometry with one for global search

◆ 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 90 of file TrackingVolumeManipulator.cxx.

92{
93
94 const auto& bounds = tvol.boundarySurfaces();
95 for (const auto & bound : bounds) {
96 if (bound->outsideVolume() == nullptr) {
97 bound->setOutsideVolume(outsideVol);
98 }
99 if (bound->insideVolume() == nullptr) {
100 bound->setInsideVolume(outsideVol);
101 }
102 }
103}

◆ declareGaudiProperty()

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

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

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ DeclareInterfaceID()

Trk::IGeometryBuilderCond::DeclareInterfaceID ( IGeometryBuilderCond ,
1 ,
0  )
inherited

Creates the InterfaceID and interfaceID() method.

◆ declareProperty()

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

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

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

◆ evtStore()

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.

◆ 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

◆ geometrySignature()

virtual GeometrySignature Trk::GeometryBuilderCond::geometrySignature ( ) const
inlineoverridevirtual

The unique signature.

Implements Trk::IGeometryBuilderCond.

Definition at line 69 of file GeometryBuilderCond.h.

69{ return Trk::Global; }

◆ 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}
void glueVolumes(TrackingVolume &firstVol, BoundarySurfaceFace firstFace, TrackingVolume &secondVol, BoundarySurfaceFace secondFace) const
protected method to glue two Volumes together input:
static void setOutsideVolume(TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *outsidevol)
protected method to set outside Volume of a BoundarySurface: input:
static void setInsideVolume(TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *insidevol)
protected method to set inside Volume of a BoundarySurface: input:
std::vector< std::shared_ptr< BoundarySurface< TrackingVolume > > > m_boundarySurfaces

◆ initialize()

StatusCode Trk::GeometryBuilderCond::initialize ( )
overridevirtual

AlgTool initialize method.

Definition at line 42 of file GeometryBuilderCond.cxx.

43{
44
45 // Retrieve the volume array creator ----------------------------------------------------
47
48 // Retrieve the tracking volume helper --------------------------------------------------
50 // Geometries =============================================================================
51 // (I) Inner Detector ---------------------------------------------------------------------
52 if (!m_inDetGeometryBuilderCond.empty()) {
54 }
55 // (H) High Granularity Timing Detector ----------------------------------------------------
56 if(!m_hgtdGeometryBuilderCond.empty()) {
57 if (m_hgtdGeometryBuilderCond.retrieve().isFailure()) {
58 ATH_MSG_FATAL("Failed to retrieve tool " << m_hgtdGeometryBuilderCond );
59 return StatusCode::FAILURE;
60 } else
61 ATH_MSG_INFO( "Retrieved tool " << m_hgtdGeometryBuilderCond );
62 }
63 // (C) Calorimeter --------------------------------------------------------------------------
64 if (!m_caloGeometryBuilderCond.empty()) {
66 }
67 // (M) Muon System -------------------------------------------------------------------------
68 if (!m_muonGeometryBuilderCond.empty()) {
70 }
71
72 // if no world dimensions are declared, take default ones
73 if (m_worldDimension.empty())
74 m_worldDimension = std::vector<double>{0.*Gaudi::Units::meter, 10.*Gaudi::Units::meter, 15.*Gaudi::Units::meter};
75
76 // if no world materials are declared, take default ones - set vacuum
77 if (m_worldMaterialProperties.size() < 5)
78 m_worldMaterialProperties = std::vector<double>{10.e10,10.e10,1e-10, 0., 0.};
79
85
86 ATH_MSG_DEBUG( " initialize() successful" );
87
88 return StatusCode::SUCCESS;
89}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_DEBUG(x)
Gaudi::Property< std::vector< double > > m_worldMaterialProperties

◆ 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()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ 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();
384 }
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)

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

◆ setBoundarySurface()

void Trk::TrackingVolumeManipulator::setBoundarySurface ( Trk::TrackingVolume & tvol,
std::shared_ptr< BoundarySurface< TrackingVolume > > bsurf,
Trk::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}

◆ 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()

void Trk::TrackingVolumeManipulator::setInsideVolumeArray ( Trk::TrackingVolume & tvol,
Trk::BoundarySurfaceFace face,
const std::shared_ptr< 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.

66{
67 (tvol.m_boundarySurfaces)[face]->setInsideVolumeArray(insidevolarray);
68}
static void setInsideVolumeArray(TrackingVolume &tvol, BoundarySurfaceFace face, const std::shared_ptr< BinnedArray< TrackingVolume > > &insidevolarray)
protected method to set inside VolumeArray of a BoundarySurface: input:

◆ 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 71 of file TrackingVolumeManipulator.cxx.

75{
76 (tvol.m_boundarySurfaces)[face]->setOutsideVolume(outsidevol);
77}

◆ setOutsideVolumeArray()

void Trk::TrackingVolumeManipulator::setOutsideVolumeArray ( Trk::TrackingVolume & tvol,
Trk::BoundarySurfaceFace face,
const std::shared_ptr< 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 80 of file TrackingVolumeManipulator.cxx.

85{
86 (tvol.m_boundarySurfaces)[face]->setOutsideVolumeArray(outsidevolarray);
87}
static void setOutsideVolumeArray(TrackingVolume &tvol, BoundarySurfaceFace face, const std::shared_ptr< BinnedArray< TrackingVolume > > &outsidevolarray)
protected method to set outside VolumeArray of a BoundarySurface: input:

◆ 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 asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, and AthCheckedComponent<::AthAlgTool >.

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

◆ trackingGeometry()

std::unique_ptr< Trk::TrackingGeometry > Trk::GeometryBuilderCond::trackingGeometry ( const EventContext & ctx,
Trk::TrackingVolume * tVol,
SG::WriteCondHandle< TrackingGeometry > & whandle ) const
overridevirtual

TrackingGeometry Interface method - optionally a pointer to Bounds Interface marked as not thread safe.

Implements Trk::IGeometryBuilderCond.

Definition at line 92 of file GeometryBuilderCond.cxx.

95{
96
97 // the geometry to be constructed
98 std::unique_ptr<Trk::TrackingGeometry> tGeometry;
100
101 ATH_MSG_VERBOSE( "Configured to only create world TrackingVolume." );
102
103 auto worldBounds = std::make_shared<Trk::CylinderVolumeBounds>(m_worldDimension[0],
106
107 Trk::TrackingVolume* worldVolume = new Trk::TrackingVolume(nullptr,
108 worldBounds,
110 nullptr,
111 nullptr,
112 "EmptyWorldVolume");
113 // create a new geometry
114 tGeometry = std::make_unique<Trk::TrackingGeometry>(worldVolume);
115 } else
116 tGeometry = atlasTrackingGeometry(ctx, whandle);
117 // sign it before you return anything
118 tGeometry->sign(geometrySignature());
119 return tGeometry;
120}
virtual GeometrySignature geometrySignature() const override
The unique signature.

◆ 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) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_caloGeometryBuilderCond

ToolHandle<IGeometryBuilderCond> Trk::GeometryBuilderCond::m_caloGeometryBuilderCond
private
Initial value:
{this, "CaloTrackingGeometryBuilder", "",
"GeometryBuilderCond for the Calorimeters"}

Definition at line 106 of file GeometryBuilderCond.h.

107 {this, "CaloTrackingGeometryBuilder", "",
108 "GeometryBuilderCond for the Calorimeters"};

◆ m_compactify

Gaudi::Property<bool> Trk::GeometryBuilderCond::m_compactify
private
Initial value:
{this, "Compactify", true,
"optimize event memory usage: register all surfaces with TG"}

Definition at line 117 of file GeometryBuilderCond.h.

117 {this, "Compactify", true,
118 "optimize event memory usage: register all surfaces with TG"};

◆ m_createWorld

Gaudi::Property<bool> Trk::GeometryBuilderCond::m_createWorld
private
Initial value:
{this, "CreateWorldManually", true,
"Boolean Switch to create World manually"}

Definition at line 80 of file GeometryBuilderCond.h.

80 {this, "CreateWorldManually", true,
81 "Boolean Switch to create World manually"};

◆ m_detStore

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

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_hgtdGeometryBuilderCond

ToolHandle<IGeometryBuilderCond> Trk::GeometryBuilderCond::m_hgtdGeometryBuilderCond {this, "HGTD_TrackingGeometryBuilder", "", "GeometryBuilder for the HGTD"}
private

Definition at line 110 of file GeometryBuilderCond.h.

111{this, "HGTD_TrackingGeometryBuilder", "", "GeometryBuilder for the HGTD"};

◆ m_inDetGeometryBuilderCond

ToolHandle<IGeometryBuilderCond> Trk::GeometryBuilderCond::m_inDetGeometryBuilderCond
private
Initial value:
{this, "InDetTrackingGeometryBuilder", "",
"GeometryBuilderCond for the InnerDetector"}

Definition at line 102 of file GeometryBuilderCond.h.

103 {this, "InDetTrackingGeometryBuilder", "",
104 "GeometryBuilderCond for the InnerDetector"};

◆ m_muonGeometryBuilderCond

ToolHandle<IGeometryBuilderCond> Trk::GeometryBuilderCond::m_muonGeometryBuilderCond
private
Initial value:
{this, "MuonTrackingGeometryBuilder", "",
"GeometryBuilderCond for the Muon System"}

Definition at line 113 of file GeometryBuilderCond.h.

114 {this, "MuonTrackingGeometryBuilder", "",
115 "GeometryBuilderCond for the Muon System"};

◆ m_navigationLevel

Gaudi::Property<int> Trk::GeometryBuilderCond::m_navigationLevel {this, "NavigationLevel", 2}
private

Definition at line 82 of file GeometryBuilderCond.h.

82{this, "NavigationLevel", 2};

◆ m_synchronizeLayers

Gaudi::Property<bool> Trk::GeometryBuilderCond::m_synchronizeLayers
private
Initial value:
{this, "SynchronizeLayers", true,
"synchronize contained layer dimensions to volumes"}

Definition at line 119 of file GeometryBuilderCond.h.

119 {this, "SynchronizeLayers", true,
120 "synchronize contained layer dimensions to volumes"};

◆ m_trackingVolumeArrayCreator

ToolHandle<ITrackingVolumeArrayCreator> Trk::GeometryBuilderCond::m_trackingVolumeArrayCreator
private
Initial value:
{this, "TrackingVolumeArrayCreator",
"Trk::TrackingVolumeArrayCreator/TrackingVolumeArrayCreator",
"Helper Tool to create TrackingVolume Arrays"}

Definition at line 92 of file GeometryBuilderCond.h.

93 {this, "TrackingVolumeArrayCreator",
94 "Trk::TrackingVolumeArrayCreator/TrackingVolumeArrayCreator",
95 "Helper Tool to create TrackingVolume Arrays"};

◆ m_trackingVolumeHelper

ToolHandle<ITrackingVolumeHelper> Trk::GeometryBuilderCond::m_trackingVolumeHelper
private
Initial value:
{this, "TrackingVolumeHelper",
"Trk::TrackingVolumeHelper/TrackingVolumeHelper",
"Helper Tool to create TrackingVolumes"}

Definition at line 97 of file GeometryBuilderCond.h.

98 {this, "TrackingVolumeHelper",
99 "Trk::TrackingVolumeHelper/TrackingVolumeHelper",
100 "Helper Tool to create TrackingVolumes"};

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

Gaudi::Property<std::vector<double> > Trk::GeometryBuilderCond::m_worldDimension {this, "WorldDimension", {}, "The dimensions of the manually created world"}
private

Definition at line 84 of file GeometryBuilderCond.h.

85{this, "WorldDimension", {}, "The dimensions of the manually created world"};

◆ m_worldMaterial

Material Trk::GeometryBuilderCond::m_worldMaterial {}
private

the world material

Definition at line 88 of file GeometryBuilderCond.h.

88{};

◆ m_worldMaterialProperties

Gaudi::Property<std::vector<double> > Trk::GeometryBuilderCond::m_worldMaterialProperties {this, "WorldMaterialProperties", {}, "The material properties of the created world"}
private

Definition at line 86 of file GeometryBuilderCond.h.

87{this, "WorldMaterialProperties", {}, "The material properties of the created world"};

The documentation for this class was generated from the following files: