EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Pythia8ProcessGenerator.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Pythia8ProcessGenerator.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2017-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 
9 #pragma once
10 
13 #include "Acts/Utilities/Units.hpp"
16 
17 #include <memory>
18 #include <mutex>
19 #include <vector>
20 
21 namespace Pythia8 {
22 class Pythia;
23 }
24 namespace ActsExamples {
25 
27  public:
28  struct Config {
36  std::vector<std::string> settings = {{"HardQCD:all = on"}};
37  };
38 
39  static std::function<SimParticleContainer(RandomEngine&)> makeFunction(
40  const Config& cfg, Acts::Logging::Level lvl);
41 
44  // try to prevent pythia breakage by forbidding copying
45  Pythia8Generator() = delete;
46  Pythia8Generator(const Pythia8Generator&) = delete;
49  Pythia8Generator& operator=(Pythia8Generator&& other) = delete;
50 
52 
53  private:
55  const Acts::Logger& logger() const { return (*m_logger); }
56 
58  std::unique_ptr<const Acts::Logger> m_logger;
59  std::unique_ptr<::Pythia8::Pythia> m_pythia8;
60  std::mutex m_pythia8Mutex;
61 };
62 
63 } // namespace ActsExamples