Analysis Software
Documentation for sPHENIX simulation 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 <iosfwd>
19 #include <memory>
20 #include <string>
21 #include <vector>
22 
23 namespace Acts {
24 
25 class Layer;
26 class TrackingVolume;
27 class VolumeBounds;
28 class CylinderVolumeBounds;
29 class IVolumeMaterial;
30 class ILayerArrayCreator;
31 class ITrackingVolumeArrayCreator;
32 
39  public:
42  struct Config {
44  std::shared_ptr<const ILayerArrayCreator> layerArrayCreator = nullptr;
46  std::shared_ptr<const ITrackingVolumeArrayCreator>
53  int passiveLayerRzBins = 100;
54  };
55 
59  CylinderVolumeHelper(const Config& cvhConfig,
60  std::unique_ptr<const Logger> logger = getDefaultLogger(
61  "CylinderVolumeHelper", Logging::INFO));
62 
63  ~CylinderVolumeHelper() override = default;
64 
80  const GeometryContext& gctx, const LayerVector& layers,
81  std::shared_ptr<const IVolumeMaterial> volumeMaterial,
82  VolumeBoundsPtr volumeBounds, MutableTrackingVolumeVector mtvVector = {},
83  const Transform3& transform = Transform3::Identity(),
84  const std::string& volumeName = "UndefinedVolume",
85  BinningType bType = arbitrary) const override;
86 
104  const GeometryContext& gctx, const LayerVector& layers,
105  MutableTrackingVolumeVector mtvVector,
106  std::shared_ptr<const IVolumeMaterial> volumeMaterial, double rMin,
107  double rMax, double zMin, double zMax,
108  const std::string& volumeName = "UndefinedVolume",
109  BinningType bType = arbitrary) const override;
110 
127  const GeometryContext& gctx, MutableTrackingVolumeVector& mtvVector,
128  std::shared_ptr<const IVolumeMaterial> volumeMaterial, double rMin,
129  double rMax, double zMin, double zMax, unsigned int materialLayers,
130  bool cylinder = true,
131  const std::string& volumeName = "UndefinedVolume") const override;
132 
149  const GeometryContext& gctx, MutableTrackingVolumeVector& mtvVector,
150  std::shared_ptr<const IVolumeMaterial> volumeMaterial, double rMin,
151  double rMax, double zMin, double zMax,
152  const std::vector<double>& layerPositions, bool cylinder = true,
153  const std::string& volumeName = "UndefinedVolume",
154  BinningType bType = arbitrary) const override;
155 
165  const GeometryContext& gctx,
166  const TrackingVolumeVector& volumes) const override;
167 
171  void setConfiguration(const Config& cvhConfig);
172 
174  Config getConfiguration() const;
175 
179  void setLogger(std::unique_ptr<const Logger> newLogger);
180 
181  protected:
184 
185  private:
187  const Logger& logger() const { return *m_logger; }
188 
190  std::unique_ptr<const Logger> m_logger;
191 
206  const GeometryContext& gctx, const LayerVector& layers,
207  const CylinderVolumeBounds*& cylinderVolumeBounds,
208  const Transform3& transform, double& rMinClean, double& rMaxClean,
209  double& zMinClean, double& zMaxClean, BinningValue& bValue,
210  BinningType bType = arbitrary) const;
211 
223  bool interGlueTrackingVolume(const GeometryContext& gctx,
224  const MutableTrackingVolumePtr& tVolume,
225  bool rBinned, double rMin, double rGlueMin,
226  double rMax, double zMin, double zMax) const;
227 
240  void glueTrackingVolumes(const GeometryContext& gctx,
241  const MutableTrackingVolumePtr& tvolOne,
242  BoundarySurfaceFace faceOne,
243  const MutableTrackingVolumePtr& tvolTwo,
244  BoundarySurfaceFace faceTwo, double rMin,
245  double rGlueMin, double rMax, double zMin,
246  double zMax) const;
247 
253  void addFaceVolumes(const MutableTrackingVolumePtr& tvol,
254  BoundarySurfaceFace glueFace,
255  TrackingVolumeVector& vols) const;
256 
267  LayerPtr createCylinderLayer(double z, double r, double halflengthZ,
268  double thickness, int binsPhi, int binsZ) const;
269 
280  LayerPtr createDiscLayer(double z, double rMin, double rMax, double thickness,
281  int binsPhi, int binsR) const;
282 };
283 
285  const {
286  return m_cfg;
287 }
288 } // namespace Acts