EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CylinderVolumeHelper.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file CylinderVolumeHelper.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-2020 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
17 
18 #include <memory>
19 #include <string>
20 #include <vector>
21 
22 namespace Acts {
23 
24 class Layer;
25 class TrackingVolume;
26 class VolumeBounds;
27 class CylinderVolumeBounds;
28 class IVolumeMaterial;
29 
36  public:
39  struct Config {
41  std::shared_ptr<const ILayerArrayCreator> layerArrayCreator = nullptr;
43  std::shared_ptr<const ITrackingVolumeArrayCreator>
50  int passiveLayerRzBins = 100;
51  };
52 
56  CylinderVolumeHelper(const Config& cvhConfig,
57  std::unique_ptr<const Logger> logger = getDefaultLogger(
58  "CylinderVolumeHelper", Logging::INFO));
59 
61  ~CylinderVolumeHelper() override = default;
62 
78  const GeometryContext& gctx, const LayerVector& layers,
79  std::shared_ptr<const IVolumeMaterial> volumeMaterial,
80  VolumeBoundsPtr volumeBounds, MutableTrackingVolumeVector mtvVector = {},
81  const Transform3D& transform = Transform3D::Identity(),
82  const std::string& volumeName = "UndefinedVolume",
83  BinningType bType = arbitrary) const override;
84 
102  const GeometryContext& gctx, const LayerVector& layers,
103  MutableTrackingVolumeVector mtvVector,
104  std::shared_ptr<const IVolumeMaterial> volumeMaterial, double rMin,
105  double rMax, double zMin, double zMax,
106  const std::string& volumeName = "UndefinedVolume",
107  BinningType bType = arbitrary) const override;
108 
125  const GeometryContext& gctx, MutableTrackingVolumeVector& mtvVector,
126  std::shared_ptr<const IVolumeMaterial> volumeMaterial, double rMin,
127  double rMax, double zMin, double zMax, unsigned int materialLayers,
128  bool cylinder = true,
129  const std::string& volumeName = "UndefinedVolume") const override;
130 
147  const GeometryContext& gctx, MutableTrackingVolumeVector& mtvVector,
148  std::shared_ptr<const IVolumeMaterial> volumeMaterial, double rMin,
149  double rMax, double zMin, double zMax,
150  const std::vector<double>& layerPositions, bool cylinder = true,
151  const std::string& volumeName = "UndefinedVolume",
152  BinningType bType = arbitrary) const override;
153 
163  const GeometryContext& gctx,
164  const TrackingVolumeVector& volumes) const override;
165 
169  void setConfiguration(const Config& cvhConfig);
170 
172  Config getConfiguration() const;
173 
177  void setLogger(std::unique_ptr<const Logger> newLogger);
178 
179  protected:
182 
183  private:
185  const Logger& logger() const { return *m_logger; }
186 
188  std::unique_ptr<const Logger> m_logger;
189 
204  const GeometryContext& gctx, const LayerVector& layers,
205  const CylinderVolumeBounds*& cylinderVolumeBounds,
206  const Transform3D& transform, double& rMinClean, double& rMaxClean,
207  double& zMinClean, double& zMaxClean, BinningValue& bValue,
208  BinningType bType = arbitrary) const;
209 
221  bool interGlueTrackingVolume(const GeometryContext& gctx,
222  const MutableTrackingVolumePtr& tVolume,
223  bool rBinned, double rMin, double rGlueMin,
224  double rMax, double zMin, double zMax) const;
225 
238  void glueTrackingVolumes(const GeometryContext& gctx,
239  const MutableTrackingVolumePtr& tvolOne,
240  BoundarySurfaceFace faceOne,
241  const MutableTrackingVolumePtr& tvolTwo,
242  BoundarySurfaceFace faceTwo, double rMin,
243  double rGlueMin, double rMax, double zMin,
244  double zMax) const;
245 
251  void addFaceVolumes(const MutableTrackingVolumePtr& tvol,
252  BoundarySurfaceFace glueFace,
253  TrackingVolumeVector& vols) const;
254 
265  LayerPtr createCylinderLayer(double z, double r, double halflengthZ,
266  double thickness, int binsPhi, int binsZ) const;
267 
278  LayerPtr createDiscLayer(double z, double rMin, double rMax, double thickness,
279  int binsPhi, int binsR) const;
280 };
281 
283  const {
284  return m_cfg;
285 }
286 } // namespace Acts