Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TGeoITkModuleSplitter.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TGeoITkModuleSplitter.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 
14 
15 #include <map>
16 #include <memory>
17 #include <regex>
18 #include <string>
19 #include <tuple>
20 #include <utility>
21 #include <vector>
22 
23 class TGeoNode;
24 
25 namespace Acts {
26 class TGeoDetectorElement;
27 }
28 
29 namespace ActsExamples {
30 
35  public:
36  using SplitRange = std::pair<double, double>;
37 
39  struct Config {
40  // Map the nodes name to the splitting parameters
41  std::map<std::string, unsigned int> barrelMap = {};
42  std::map<std::string, std::vector<SplitRange>> discMap = {};
43  std::map<std::string, std::string> splitPatterns;
44  };
45 
51  std::unique_ptr<const Acts::Logger> logger =
52  Acts::getDefaultLogger("TGeoITkModuleSplitter",
54 
55  ~TGeoITkModuleSplitter() override = default;
56 
66  std::vector<std::shared_ptr<const Acts::TGeoDetectorElement>> split(
68  std::shared_ptr<const Acts::TGeoDetectorElement> detElement)
69  const override;
70 
71  private:
77  void initSplitCategories();
78 
89  std::vector<std::shared_ptr<const Acts::TGeoDetectorElement>>
92  const std::shared_ptr<const Acts::TGeoDetectorElement>& detElement,
93  unsigned int nSegments) const;
94 
105  std::vector<std::shared_ptr<const Acts::TGeoDetectorElement>> splitDiscModule(
107  const std::shared_ptr<const Acts::TGeoDetectorElement>& detElement,
108  const std::vector<SplitRange>& splitRanges) const;
109 
112 
114  std::vector<std::tuple<std::regex, std::string, bool>> m_splitCategories;
115 
117  const Acts::Logger& logger() const { return *m_logger; }
118 
120  std::unique_ptr<const Acts::Logger> m_logger;
121 };
122 
123 } // namespace ActsExamples