Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DD4hepGeant4Simulation.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DD4hepGeant4Simulation.cpp
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 
18 
19 #include <boost/program_options.hpp>
20 
21 int main(int argc, char* argv[]) {
22  using namespace ActsExamples;
23  using namespace ActsExamples::Simulation;
24 
25  // Setup and parse options
26  auto desc = Options::makeDefaultOptions();
29  Simulation::addInputOptions(desc); // These are specific to the simulation
32  Options::addOutputOptions(desc, OutputFormat::Root | OutputFormat::Csv);
34 
35  auto vars = Options::parse(desc, argc, argv);
36  if (vars.empty()) {
37  return EXIT_FAILURE;
38  }
39 
40  // Setup the DD4hep detector
41  auto dd4hepCfg = Options::readDD4hepConfig<po::variables_map>(vars);
42  auto geometrySvc = std::make_shared<DD4hep::DD4hepGeometryService>(dd4hepCfg);
43  auto detector = std::make_shared<DD4hep::DD4hepDetector>(geometrySvc);
45  auto trackingGeometry =
46  geometrySvc->trackingGeometry(Acts::GeometryContext());
47 
48  return runGeant4Simulation(
49  vars, std::make_unique<DDG4DetectorConstructionFactory>(detector),
51 }