ECCE @ 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-2018 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 
10 // CylinderVolumeHelper.h, Acts project
12 
13 #pragma once
14 
15 #ifndef ACTS_TOOLS_TAKESMALLERBIGGER
16 #define ACTS_TOOLS_TAKESMALLERBIGGER
17 #define takeSmaller(current, test) current = current < test ? current : test
18 #define takeBigger(current, test) current = current > test ? current : test
19 #define takeSmallerBigger(cSmallest, cBiggest, test) \
20  takeSmaller(cSmallest, test); \
21  takeBigger(cBiggest, test)
22 #endif
23 
24 #include <memory>
25 #include <string>
26 #include <vector>
33 
34 namespace Acts {
35 
36 class Layer;
37 class TrackingVolume;
38 class VolumeBounds;
39 class CylinderVolumeBounds;
40 class IVolumeMaterial;
41 
48  public:
51  struct Config {
53  std::shared_ptr<const ILayerArrayCreator> layerArrayCreator = nullptr;
55  std::shared_ptr<const ITrackingVolumeArrayCreator>
62  int passiveLayerRzBins = 100;
63  };
64 
68  CylinderVolumeHelper(const Config& cvhConfig,
69  std::unique_ptr<const Logger> logger = getDefaultLogger(
70  "CylinderVolumeHelper", Logging::INFO));
71 
73  ~CylinderVolumeHelper() override = default;
74 
90  const GeometryContext& gctx, const LayerVector& layers,
91  std::shared_ptr<const IVolumeMaterial> volumeMaterial,
92  VolumeBoundsPtr volumeBounds, MutableTrackingVolumeVector mtvVector = {},
93  std::shared_ptr<const Transform3D> transform = nullptr,
94  const std::string& volumeName = "UndefinedVolume",
95  BinningType bType = arbitrary) const override;
96 
114  const GeometryContext& gctx, const LayerVector& layers,
115  MutableTrackingVolumeVector mtvVector,
116  std::shared_ptr<const IVolumeMaterial> volumeMaterial, double rMin,
117  double rMax, double zMin, double zMax,
118  const std::string& volumeName = "UndefinedVolume",
119  BinningType bType = arbitrary) const override;
120 
137  const GeometryContext& gctx, MutableTrackingVolumeVector& mtvVector,
138  std::shared_ptr<const IVolumeMaterial> volumeMaterial, double rMin,
139  double rMax, double zMin, double zMax, unsigned int materialLayers,
140  bool cylinder = true,
141  const std::string& volumeName = "UndefinedVolume") const override;
142 
159  const GeometryContext& gctx, MutableTrackingVolumeVector& mtvVector,
160  std::shared_ptr<const IVolumeMaterial> volumeMaterial, double rMin,
161  double rMax, double zMin, double zMax,
162  const std::vector<double>& layerPositions, bool cylinder = true,
163  const std::string& volumeName = "UndefinedVolume",
164  BinningType bType = arbitrary) const override;
165 
175  const GeometryContext& gctx,
176  const TrackingVolumeVector& volumes) const override;
177 
181  void setConfiguration(const Config& cvhConfig);
182 
184  Config getConfiguration() const;
185 
189  void setLogger(std::unique_ptr<const Logger> newLogger);
190 
191  protected:
194 
195  private:
197  const Logger& logger() const { return *m_logger; }
198 
200  std::unique_ptr<const Logger> m_logger;
201 
216  const GeometryContext& gctx, const LayerVector& layers,
217  const CylinderVolumeBounds*& cylinderVolumeBounds,
218  std::shared_ptr<const Transform3D>& transform, double& rMinClean,
219  double& rMaxClean, double& zMinClean, double& zMaxClean,
220  BinningValue& bValue, BinningType bType = arbitrary) const;
221 
233  bool interGlueTrackingVolume(const GeometryContext& gctx,
234  const MutableTrackingVolumePtr& tVolume,
235  bool rBinned, double rMin, double rGlueMin,
236  double rMax, double zMin, double zMax) const;
237 
250  void glueTrackingVolumes(const GeometryContext& gctx,
251  const MutableTrackingVolumePtr& tvolOne,
252  BoundarySurfaceFace faceOne,
253  const MutableTrackingVolumePtr& tvolTwo,
254  BoundarySurfaceFace faceTwo, double rMin,
255  double rGlueMin, double rMax, double zMin,
256  double zMax) const;
257 
263  void addFaceVolumes(const MutableTrackingVolumePtr& tvol,
264  BoundarySurfaceFace glueFace,
265  TrackingVolumeVector& vols) const;
266 
277  LayerPtr createCylinderLayer(double z, double r, double halflengthZ,
278  double thickness, int binsPhi, int binsZ) const;
279 
290  LayerPtr createDiscLayer(double z, double rMin, double rMax, double thickness,
291  int binsPhi, int binsR) const;
292 };
293 
295  const {
296  return m_cfg;
297 }
298 } // namespace Acts