EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GenericDetector.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file GenericDetector.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2019 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 
17 
18 #include <boost/program_options.hpp>
19 
21  boost::program_options::options_description& opt) const {
23 }
24 
26  const boost::program_options::variables_map& vm,
27  std::shared_ptr<const Acts::IMaterialDecorator> mdecorator)
28  -> std::pair<TrackingGeometryPtr, ContextDecorators> {
29  // --------------------------------------------------------------------------------
30  DetectorElement::ContextType nominalContext;
31 
32  auto buildLevel = vm["geo-generic-buildlevel"].template as<size_t>();
33  // set geometry building logging level
34  Acts::Logging::Level surfaceLogLevel =
35  Acts::Logging::Level(vm["geo-surface-loglevel"].template as<size_t>());
36  Acts::Logging::Level layerLogLevel =
37  Acts::Logging::Level(vm["geo-layer-loglevel"].template as<size_t>());
38  Acts::Logging::Level volumeLogLevel =
39  Acts::Logging::Level(vm["geo-volume-loglevel"].template as<size_t>());
40 
41  bool buildProto =
42  (vm["mat-input-type"].template as<std::string>() == "proto");
43 
45  TrackingGeometryPtr gGeometry =
46  ActsExamples::Generic::buildDetector<DetectorElement>(
47  nominalContext, detectorStore, buildLevel, std::move(mdecorator),
48  buildProto, surfaceLogLevel, layerLogLevel, volumeLogLevel);
49  ContextDecorators gContextDeocrators = {};
50  // return the pair of geometry and empty decorators
51  return std::make_pair<TrackingGeometryPtr, ContextDecorators>(
52  std::move(gGeometry), std::move(gContextDeocrators));
53 }