ATLAS Offline Software
Loading...
Searching...
No Matches
TrackingVolumeHelper.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6// TrackingVolumeHelper.h, (c) ATLAS Detector software
8
9#ifndef TRKDETDESCRTOOLS_TRACKINGVOLUMEHELPER_H
10#define TRKDETDESCRTOOLS_TRACKINGVOLUMEHELPER_H
11
12#ifndef TRKDETDESCR_TAKESMALLERBIGGER
13#define TRKDETDESCR_TAKESMALLERBIGGER
14#define takeSmaller(current, test) current = current < test ? current : test
15#define takeBigger(current, test) current = current > test ? current : test
16#define takeSmallerBigger(cSmallest, cBiggest, test) \
17 takeSmaller(cSmallest, test); \
18 takeBigger(cBiggest, test)
19#endif
20// Trk
23// Amg
25// Gaudi & Athena
27#include "GaudiKernel/SystemOfUnits.h"
28#include "GaudiKernel/ToolHandle.h"
29// STL
30#include <algorithm>
31#include <fstream>
32#include <string>
33
35namespace Trk {
36
37class ILayerArrayCreator;
38class ITrackingVolumeArrayCreator;
39class TrackingVolume;
40class VolumeBounds;
41class CylinderVolumeBounds;
42class Material;
43class LayerMaterialProperties;
44
52
54 : public AthAlgTool
56 , virtual public ITrackingVolumeHelper
57{
58
59public:
61 TrackingVolumeHelper(const std::string&,
62 const std::string&,
63 const IInterface*);
66
68 StatusCode initialize() override;
69
81 BoundarySurfaceFace firstFace,
82 TrackingVolume& secondVol,
83 BoundarySurfaceFace secondFace,
84 bool buildBoundaryLayer = false) const override;
85
97 BoundarySurfaceFace firstFace,
98 const std::vector<TrackingVolume*>& secondVolumes,
99 BoundarySurfaceFace secondFace,
100 bool buildBoundaryLayer = false,
101 bool boundaryFaceExchange = false) const override;
102
116 void glueTrackingVolumes(const std::vector<TrackingVolume*>& firstVolumes,
117 BoundarySurfaceFace firstFace,
118 const std::vector<TrackingVolume*>& secondVolumes,
119 BoundarySurfaceFace secondFace,
120 bool buildBoundaryLayer = false,
121 bool boundaryFaceExchange = false) const override;
122
137 std::unique_ptr<Trk::TrackingVolume> glueTrackingVolumeArrays(
138 std::shared_ptr<TrackingVolume> firstVol,
139 BoundarySurfaceFace firstFace,
140 std::shared_ptr<TrackingVolume> secondVol,
141 BoundarySurfaceFace secondFace,
142 const std::string& name) const override;
143
155 TrackingVolume* insidevol) const override;
156
167 TrackingVolume& tvol,
169 std::shared_ptr<BinnedArray<TrackingVolume>> insidevolarray) const override;
170
182 TrackingVolume* outsidevol) const override;
183
190 TrackingVolume& tvol,
192 std::shared_ptr<BinnedArray<TrackingVolume>> outsidevolarray) const override;
193
194private:
196 std::unique_ptr<Trk::LayerMaterialProperties> layerMaterialProperties(const Trk::Surface& sf) const;
197
206 static void fillGlueVolumes(const std::vector<TrackingVolume*>& topLevelVolumes,
207 const std::vector<TrackingVolume*>& envelopeFaceVolumes,
208 BoundarySurfaceFace glueFace,
209 std::vector<Trk::TrackingVolume*>& glueVols);
210
211 static void fillGlueVolumes(const std::vector<std::shared_ptr<TrackingVolume>>& topLevelVolumes,
212 const std::vector<std::shared_ptr<TrackingVolume>>& envelopeFaceVolumes,
213 BoundarySurfaceFace glueFace,
214 std::vector<Trk::TrackingVolume*>& glueVols);
215
216
218 void glueTrackingVolumes(const std::vector<std::shared_ptr<TrackingVolume>>& glueVols,
219 BoundarySurfaceFace glueFace,
220 BoundarySurfaceFace secondFace) const;
221
222 void glueTrackingVolumes(const std::vector<TrackingVolume*>& glueVols,
223 BoundarySurfaceFace glueFace,
224 BoundarySurfaceFace secondFace) const;
225 PublicToolHandle<ILayerArrayCreator>
226 m_layerArrayCreator{this, "LayerArrayCreator", "Trk::LayerArrayCreator/LayerArrayCreator"};
227 ToolHandle<ITrackingVolumeArrayCreator>
228 m_trackingVolumeArrayCreator{this, "TrackingVolumeArrayCreator", "Trk::TrackingVolumeArrayCreator/TrackingVolumeArrayCreator"};
230
231 Gaudi::Property<int> m_barrelLayerBinsZ{this, "BarrelLayerBinsZ", 1};
232 Gaudi::Property<int> m_barrelLayerBinsPhi{this, "BarrelLayerBinsPhi", 1};
233 Gaudi::Property<int> m_endcapLayerBinsR{this, "EndcapLayerBinsR", 1};
234 Gaudi::Property<int> m_endcapLayerBinsPhi{this, "EndcapLayerBinsPhi", 1};
235
236 static constexpr double s_layerThickness =
237 1. * Gaudi::Units::mm;
238};
239
240}
241
242#endif
243
@ Material
Define macros for attributes used to control the static checker.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Binned Array for avoiding map searches/.
Definition BinnedArray.h:36
Interface class ITrackingVolumeHelpers It inherits from IAlgTool.
Abstract Base Class for tracking surfaces.
void setOutsideTrackingVolume(TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *outsidevol) const override
protected method to set outside Volume of a BoundarySurface: input:
void setOutsideTrackingVolumeArray(TrackingVolume &tvol, BoundarySurfaceFace face, std::shared_ptr< BinnedArray< TrackingVolume > > outsidevolarray) const override
protected method to set outside VolumeArray of a BoundarySurface: input:
void glueTrackingVolumes(TrackingVolume &firstVol, BoundarySurfaceFace firstFace, TrackingVolume &secondVol, BoundarySurfaceFace secondFace, bool buildBoundaryLayer=false) const override
Method to glue two Volumes together input:
ToolHandle< ITrackingVolumeArrayCreator > m_trackingVolumeArrayCreator
Helper Tool to create TrackingVolume.
static constexpr double s_layerThickness
standard layer thickness
std::unique_ptr< Trk::TrackingVolume > glueTrackingVolumeArrays(std::shared_ptr< TrackingVolume > firstVol, BoundarySurfaceFace firstFace, std::shared_ptr< TrackingVolume > secondVol, BoundarySurfaceFace secondFace, const std::string &name) const override
Method to glue two VolumeArrays together (at navigation level)
Gaudi::Property< int > m_endcapLayerBinsR
material bins in R
void setInsideTrackingVolumeArray(TrackingVolume &tvol, BoundarySurfaceFace face, std::shared_ptr< BinnedArray< TrackingVolume > > insidevolarray) const override
protected method to set inside VolumeArray of a BoundarySurface: input:
virtual ~TrackingVolumeHelper()
Destructor.
std::unique_ptr< Trk::LayerMaterialProperties > layerMaterialProperties(const Trk::Surface &sf) const
< helper method to construct barrel material
TrackingVolumeHelper(const std::string &, const std::string &, const IInterface *)
Constructor.
Gaudi::Property< int > m_barrelLayerBinsPhi
material bins in Phi
Gaudi::Property< int > m_endcapLayerBinsPhi
material bins in Phi
StatusCode initialize() override
AlgTool initialize method.
Gaudi::Property< int > m_barrelLayerBinsZ
material bins in Z
void setInsideTrackingVolume(TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *insidevol) const override
protected method to set inside Volume of a BoundarySurface: input:
PublicToolHandle< ILayerArrayCreator > m_layerArrayCreator
A Tool for coherent LayerArray creation.
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,...
Full Volume description used in Tracking, it inherits from Volume to get the geometrical structure,...
Ensure that the ATLAS eigen extensions are properly loaded.
BoundarySurfaceFace
Enum to describe the position of the BoundarySurface respectively to the frame orientatin of the volu...