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 ~GeometryBuilderCond ()
 Destructor.
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

bool m_createWorld
 Boolean Switch to create World manually.
int m_navigationLevel
 NavigationLevel.
std::vector< double > m_worldDimension
 The dimensions of the manually created world.
std::vector< double > m_worldMaterialProperties
 The material properties of the created world.
Material m_worldMaterial
 the world material
ToolHandle< ITrackingVolumeArrayCreatorm_trackingVolumeArrayCreator
 Helper Tool to create TrackingVolume Arrays.
ToolHandle< ITrackingVolumeHelperm_trackingVolumeHelper
 Helper Tool to create TrackingVolumes.
ToolHandle< IGeometryBuilderCondm_inDetGeometryBuilderCond
 GeometryBuilderCond for the InnerDetector.
bool m_caloGeometry
 switch on TrackingGeometry for the Calorimeters
ToolHandle< IGeometryBuilderCondm_caloGeometryBuilderCond
 GeometryBuilderCond for the Calorimeters.
bool m_hgtdGeometry
ToolHandle< IGeometryBuilderCondm_hgtdGeometryBuilderCond
 switch on TrackingGeometry for HGTD
bool m_muonGeometry
 GeometryBuilderCond for the Muon System.
ToolHandle< IGeometryBuilderCondm_muonGeometryBuilderCond
 GeometryBuilderCond for the Muon System.
bool m_compactify
 optimize event memory usage: register all surfaces with TG
bool m_synchronizeLayers
 synchronize contained layer dimensions to volumes
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 36 of file GeometryBuilderCond.cxx.

37: AthAlgTool(t,n,p),
39#ifdef TRKDETDESCR_MEMUSAGE
40 m_memoryLogger(),
41#endif
42 m_createWorld(true),
46 m_trackingVolumeArrayCreator("Trk::TrackingVolumeArrayCreator/TrackingVolumeArrayCreator"),
47 m_trackingVolumeHelper("Trk::TrackingVolumeHelper/TrackingVolumeHelper"),
55 m_compactify(true),
57{
58 declareInterface<IGeometryBuilderCond>(this);
59 // by hand declarations
60 declareProperty("CreateWorldManually", m_createWorld);
61 declareProperty("NavigationLevel", m_navigationLevel);
62 // (1) dimension & material
63 declareProperty("WorldDimension", m_worldDimension);
64 declareProperty("WorldMaterialProperties", m_worldMaterialProperties);
65 // tool declarations ----------------------------------------------------------------
66 declareProperty("TrackingVolumeArrayCreator", m_trackingVolumeArrayCreator);
67 declareProperty("TrackingVolumeHelper", m_trackingVolumeHelper);
68 declareProperty("InDetTrackingGeometryBuilder", m_inDetGeometryBuilderCond);
69 declareProperty("HGTD_TrackingGeometryBuilder", m_hgtdGeometryBuilderCond);
70 declareProperty("CaloTrackingGeometryBuilder", m_caloGeometryBuilderCond);
71 declareProperty("MuonTrackingGeometryBuilder", m_muonGeometryBuilderCond);
72 // optimize layer dimension & memory usage -------------------------------
73 declareProperty("Compactify", m_compactify );
74 declareProperty("SynchronizeLayers", m_synchronizeLayers );
75}
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
int m_navigationLevel
NavigationLevel.
ToolHandle< IGeometryBuilderCond > m_muonGeometryBuilderCond
GeometryBuilderCond for the Muon System.
ToolHandle< ITrackingVolumeHelper > m_trackingVolumeHelper
Helper Tool to create TrackingVolumes.
ToolHandle< IGeometryBuilderCond > m_caloGeometryBuilderCond
GeometryBuilderCond for the Calorimeters.
ToolHandle< IGeometryBuilderCond > m_inDetGeometryBuilderCond
GeometryBuilderCond for the InnerDetector.
bool m_muonGeometry
GeometryBuilderCond for the Muon System.
std::vector< double > m_worldMaterialProperties
The material properties of the created world.
ToolHandle< IGeometryBuilderCond > m_hgtdGeometryBuilderCond
switch on TrackingGeometry for HGTD
bool m_createWorld
Boolean Switch to create World manually.
std::vector< double > m_worldDimension
The dimensions of the manually created world.
ToolHandle< ITrackingVolumeArrayCreator > m_trackingVolumeArrayCreator
Helper Tool to create TrackingVolume Arrays.
bool m_synchronizeLayers
synchronize contained layer dimensions to volumes
bool m_compactify
optimize event memory usage: register all surfaces with TG
bool m_caloGeometry
switch on TrackingGeometry for the Calorimeters

◆ ~GeometryBuilderCond()

Trk::GeometryBuilderCond::~GeometryBuilderCond ( )
virtualdefault

Destructor.

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 166 of file GeometryBuilderCond.cxx.

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

◆ 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 72 of file GeometryBuilderCond.h.

72{ 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 84 of file GeometryBuilderCond.cxx.

85{
86
87 // Retrieve the volume array creator ----------------------------------------------------
89
90 // Retrieve the tracking volume helper --------------------------------------------------
92 // Geometries =============================================================================
93 // (I) Inner Detector ---------------------------------------------------------------------
94 if (!m_inDetGeometryBuilderCond.empty()) {
96 }
97 // (H) High Granularity Timing Detector ----------------------------------------------------
98 if(!m_hgtdGeometryBuilderCond.empty()) {
99 if (m_hgtdGeometryBuilderCond.retrieve().isFailure()) {
100 ATH_MSG_FATAL("Failed to retrieve tool " << m_hgtdGeometryBuilderCond );
101 return StatusCode::FAILURE;
102 } else
103 ATH_MSG_INFO( "Retrieved tool " << m_hgtdGeometryBuilderCond );
104 }
105 // (C) Calorimeter --------------------------------------------------------------------------
106 if (!m_caloGeometryBuilderCond.empty()) {
108 }
109 // (M) Muon System -------------------------------------------------------------------------
110 if (!m_muonGeometryBuilderCond.empty()) {
112 }
113
114 // if no world dimensions are declared, take default ones
115 if (m_worldDimension.empty())
116 m_worldDimension = std::vector<double>{0.*Gaudi::Units::meter, 10.*Gaudi::Units::meter, 15.*Gaudi::Units::meter};
117
118 // if no world materials are declared, take default ones - set vacuum
119 if (m_worldMaterialProperties.size() < 5)
120 m_worldMaterialProperties = std::vector<double>{10.e10,10.e10,1e-10, 0., 0.};
121
127
128 ATH_MSG_DEBUG( " initialize() successful" );
129
130 return StatusCode::SUCCESS;
131}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_DEBUG(x)

◆ 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 >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ 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 134 of file GeometryBuilderCond.cxx.

137{
138
139 // the geometry to be constructed
140 std::unique_ptr<Trk::TrackingGeometry> tGeometry;
142
143 ATH_MSG_VERBOSE( "Configured to only create world TrackingVolume." );
144
145 auto worldBounds = std::make_shared<Trk::CylinderVolumeBounds>(m_worldDimension[0],
148
149 Trk::TrackingVolume* worldVolume = new Trk::TrackingVolume(nullptr,
150 worldBounds,
152 nullptr,
153 nullptr,
154 "EmptyWorldVolume");
155 // create a new geometry
156 tGeometry = std::make_unique<Trk::TrackingGeometry>(worldVolume);
157 } else
158 tGeometry = atlasTrackingGeometry(ctx, whandle);
159 // sign it before you return anything
160 tGeometry->sign(geometrySignature());
161 return tGeometry;
162}
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_caloGeometry

bool Trk::GeometryBuilderCond::m_caloGeometry
private

switch on TrackingGeometry for the Calorimeters

Definition at line 98 of file GeometryBuilderCond.h.

◆ m_caloGeometryBuilderCond

ToolHandle<IGeometryBuilderCond> Trk::GeometryBuilderCond::m_caloGeometryBuilderCond
private

GeometryBuilderCond for the Calorimeters.

Definition at line 99 of file GeometryBuilderCond.h.

◆ m_compactify

bool Trk::GeometryBuilderCond::m_compactify
private

optimize event memory usage: register all surfaces with TG

Definition at line 107 of file GeometryBuilderCond.h.

◆ m_createWorld

bool Trk::GeometryBuilderCond::m_createWorld
private

Boolean Switch to create World manually.

Definition at line 83 of file GeometryBuilderCond.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_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_hgtdGeometry

bool Trk::GeometryBuilderCond::m_hgtdGeometry
private

Definition at line 101 of file GeometryBuilderCond.h.

◆ m_hgtdGeometryBuilderCond

ToolHandle<IGeometryBuilderCond> Trk::GeometryBuilderCond::m_hgtdGeometryBuilderCond
private

switch on TrackingGeometry for HGTD

GeometryBuilder for the HGTD

Definition at line 102 of file GeometryBuilderCond.h.

◆ m_inDetGeometryBuilderCond

ToolHandle<IGeometryBuilderCond> Trk::GeometryBuilderCond::m_inDetGeometryBuilderCond
private

GeometryBuilderCond for the InnerDetector.

Definition at line 96 of file GeometryBuilderCond.h.

◆ m_muonGeometry

bool Trk::GeometryBuilderCond::m_muonGeometry
private

GeometryBuilderCond for the Muon System.

Definition at line 104 of file GeometryBuilderCond.h.

◆ m_muonGeometryBuilderCond

ToolHandle<IGeometryBuilderCond> Trk::GeometryBuilderCond::m_muonGeometryBuilderCond
private

GeometryBuilderCond for the Muon System.

Definition at line 105 of file GeometryBuilderCond.h.

◆ m_navigationLevel

int Trk::GeometryBuilderCond::m_navigationLevel
private

NavigationLevel.

Definition at line 84 of file GeometryBuilderCond.h.

◆ m_synchronizeLayers

bool Trk::GeometryBuilderCond::m_synchronizeLayers
private

synchronize contained layer dimensions to volumes

Definition at line 108 of file GeometryBuilderCond.h.

◆ m_trackingVolumeArrayCreator

ToolHandle<ITrackingVolumeArrayCreator> Trk::GeometryBuilderCond::m_trackingVolumeArrayCreator
private

Helper Tool to create TrackingVolume Arrays.

Definition at line 92 of file GeometryBuilderCond.h.

◆ m_trackingVolumeHelper

ToolHandle<ITrackingVolumeHelper> Trk::GeometryBuilderCond::m_trackingVolumeHelper
private

Helper Tool to create TrackingVolumes.

Definition at line 94 of file GeometryBuilderCond.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_worldDimension

std::vector<double> Trk::GeometryBuilderCond::m_worldDimension
private

The dimensions of the manually created world.

Definition at line 86 of file GeometryBuilderCond.h.

◆ m_worldMaterial

Material Trk::GeometryBuilderCond::m_worldMaterial
private

the world material

Definition at line 88 of file GeometryBuilderCond.h.

◆ m_worldMaterialProperties

std::vector<double> Trk::GeometryBuilderCond::m_worldMaterialProperties
private

The material properties of the created world.

Definition at line 87 of file GeometryBuilderCond.h.


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