Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DigitizationConfig.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DigitizationConfig.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2021 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 
25 
26 #include <algorithm>
27 #include <cstddef>
28 #include <functional>
29 #include <memory>
30 #include <stdexcept>
31 #include <string>
32 #include <system_error>
33 #include <utility>
34 #include <vector>
35 
36 namespace Acts {
37 class GeometryIdentifier;
38 class TrackingGeometry;
39 } // namespace Acts
40 
41 namespace ActsExamples {
42 
51  // The dimensions of the measurement
52  std::vector<Acts::BoundIndices> indices = {};
53 
54  // The (multidimensional) binning definition for the segmentation of the
55  // sensor
57 
58  // The thickness of the sensor
59  double thickness = 0.;
60 
64 
65  // The threshold below a cell activation is ignored
66  double threshold = 0.;
67 
68  // Whether to assume digital readout (activation is either 0 or 1)
69  bool digital = false;
70 
73  if (not chargeSmearer) {
74  return path;
75  }
76  auto res = chargeSmearer(path, rng);
77  if (res.ok()) {
78  return std::max(0.0, res->first);
79  } else {
80  throw std::runtime_error(res.error().message());
81  }
82  }
83 
87  std::vector<Acts::ActsScalar> variances(size_t /*size0*/, size_t /*size1*/,
88  RandomEngine & /*rng*/) const {
89  return {};
90  };
91 
95  Acts::Vector3 drift(const Acts::Vector3 & /*position*/,
96  RandomEngine & /*rng*/) const {
97  return Acts::Vector3(0., 0., 0.);
98  };
99 };
100 
109 };
110 
112  public:
113  DigitizationConfig(bool merge, double sigma, bool commonCorner)
114  : DigitizationConfig(merge, sigma, commonCorner,
115  Acts::GeometryHierarchyMap<DigiComponentsConfig>()) {
116  }
117 
119  bool doMerge, double mergeNsigma, bool mergeCommonCorner,
121 
124 
130  std::string outputMeasurements = "measurements";
134  std::string outputMeasurementParticlesMap = "measurement_particles_map";
136  std::string outputMeasurementSimHitsMap = "measurement_simhits_map";
138  std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry = nullptr;
140  std::shared_ptr<const RandomNumbers> randomNumbers = nullptr;
142  bool doMerge;
144  const double mergeNsigma;
146  const bool mergeCommonCorner;
152  double minEnergyDeposit = 0.0; // 1000 * 3.65 * Acts::UnitConstants::eV;
155 
156  std::vector<
157  std::pair<Acts::GeometryIdentifier, std::vector<Acts::BoundIndices>>>
158  getBoundIndices() const;
159 };
160 } // namespace ActsExamples