Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DigitizationConfig.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DigitizationConfig.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2020-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 
10 
14 
15 namespace {
16 
17 enum SmearingTypes : int {
18  eGauss = 0,
19  eGaussTruncated = 1,
20  eGaussClipped = 2,
21  eUniform = 3,
22  eDigital = 4,
23 };
24 
25 } // namespace
26 
28  bool merge, double sigma, bool commonCorner,
30  : doMerge(merge), mergeNsigma(sigma), mergeCommonCorner(commonCorner) {
31  digitizationConfigs = std::move(digiCfgs);
32 }
33 
36  : doMerge(false), mergeNsigma(1.0), mergeCommonCorner(false) {
37  digitizationConfigs = std::move(digiCfgs);
38 }
39 
40 std::vector<
41  std::pair<Acts::GeometryIdentifier, std::vector<Acts::BoundIndices>>>
43  std::vector<
44  std::pair<Acts::GeometryIdentifier, std::vector<Acts::BoundIndices>>>
45  bIndexInput;
46 
47  for (size_t ibi = 0; ibi < digitizationConfigs.size(); ++ibi) {
48  Acts::GeometryIdentifier geoID = digitizationConfigs.idAt(ibi);
49  const auto dCfg = digitizationConfigs.valueAt(ibi);
50  std::vector<Acts::BoundIndices> boundIndices;
51  boundIndices.insert(boundIndices.end(),
52  dCfg.geometricDigiConfig.indices.begin(),
53  dCfg.geometricDigiConfig.indices.end());
54  // we assume nobody will add multiple smearers to a single bound index
55  for (const auto& c : dCfg.smearingDigiConfig) {
56  boundIndices.push_back(c.index);
57  }
58  bIndexInput.push_back({geoID, boundIndices});
59  }
60  return bIndexInput;
61 }