ATLAS Offline Software
Loading...
Searching...
No Matches
TrackingVolumeHelper.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 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*);
64
66 StatusCode initialize() override;
67
79 BoundarySurfaceFace firstFace,
80 TrackingVolume& secondVol,
81 BoundarySurfaceFace secondFace,
82 bool buildBoundaryLayer = false) const override;
83
95 BoundarySurfaceFace firstFace,
96 const std::vector<TrackingVolume*>& secondVolumes,
97 BoundarySurfaceFace secondFace,
98 bool buildBoundaryLayer = false,
99 bool boundaryFaceExchange = false) const override;
100
114 void glueTrackingVolumes(const std::vector<TrackingVolume*>& firstVolumes,
115 BoundarySurfaceFace firstFace,
116 const std::vector<TrackingVolume*>& secondVolumes,
117 BoundarySurfaceFace secondFace,
118 bool buildBoundaryLayer = false,
119 bool boundaryFaceExchange = false) const override;
120
135 std::unique_ptr<Trk::TrackingVolume> glueTrackingVolumeArrays(
136 std::shared_ptr<TrackingVolume> firstVol,
137 BoundarySurfaceFace firstFace,
138 std::shared_ptr<TrackingVolume> secondVol,
139 BoundarySurfaceFace secondFace,
140 const std::string& name) const override;
141
153 TrackingVolume* insidevol) const override;
154
165 TrackingVolume& tvol,
167 std::shared_ptr<BinnedArray<TrackingVolume>> insidevolarray) const override;
168
180 TrackingVolume* outsidevol) const override;
181
188 TrackingVolume& tvol,
190 std::shared_ptr<BinnedArray<TrackingVolume>> outsidevolarray) const override;
191
192private:
194 std::unique_ptr<Trk::LayerMaterialProperties> layerMaterialProperties(const Trk::Surface& sf) const;
195
204 static void fillGlueVolumes(const std::vector<TrackingVolume*>& topLevelVolumes,
205 const std::vector<TrackingVolume*>& envelopeFaceVolumes,
206 BoundarySurfaceFace glueFace,
207 std::vector<Trk::TrackingVolume*>& glueVols);
208
209 static void fillGlueVolumes(const std::vector<std::shared_ptr<TrackingVolume>>& topLevelVolumes,
210 const std::vector<std::shared_ptr<TrackingVolume>>& envelopeFaceVolumes,
211 BoundarySurfaceFace glueFace,
212 std::vector<Trk::TrackingVolume*>& glueVols);
213
214
216 void glueTrackingVolumes(const std::vector<std::shared_ptr<TrackingVolume>>& glueVols,
217 BoundarySurfaceFace glueFace,
218 BoundarySurfaceFace secondFace) const;
219
220 void glueTrackingVolumes(const std::vector<TrackingVolume*>& glueVols,
221 BoundarySurfaceFace glueFace,
222 BoundarySurfaceFace secondFace) const;
223 PublicToolHandle<ILayerArrayCreator>
224 m_layerArrayCreator{this, "LayerArrayCreator", "Trk::LayerArrayCreator/LayerArrayCreator"};
225 ToolHandle<ITrackingVolumeArrayCreator>
226 m_trackingVolumeArrayCreator{this, "TrackingVolumeArrayCreator", "Trk::TrackingVolumeArrayCreator/TrackingVolumeArrayCreator"};
228
229 Gaudi::Property<int> m_barrelLayerBinsZ{this, "BarrelLayerBinsZ", 1};
230 Gaudi::Property<int> m_barrelLayerBinsPhi{this, "BarrelLayerBinsPhi", 1};
231 Gaudi::Property<int> m_endcapLayerBinsR{this, "EndcapLayerBinsR", 1};
232 Gaudi::Property<int> m_endcapLayerBinsPhi{this, "EndcapLayerBinsPhi", 1};
233
234 static constexpr double s_layerThickness =
235 1. * Gaudi::Units::mm;
236};
237
238}
239
240#endif
241
@ 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.
Definition Surface.h:79
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:
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...