File indexing completed on 2025-08-05 08:09:46
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/PdgParticle.hpp"
0012 #include "Acts/Definitions/Units.hpp"
0013 #include "Acts/Utilities/Logger.hpp"
0014 #include "ActsExamples/EventData/SimParticle.hpp"
0015 #include "ActsExamples/EventData/SimVertex.hpp"
0016 #include "ActsExamples/Framework/RandomNumbers.hpp"
0017 #include "ActsExamples/Generators/EventGenerator.hpp"
0018
0019 #include <memory>
0020 #include <mutex>
0021 #include <string>
0022 #include <vector>
0023
0024 namespace Pythia8 {
0025 class Pythia;
0026 }
0027
0028 namespace ActsExamples {
0029
0030 class Pythia8Generator : public EventGenerator::ParticlesGenerator {
0031 public:
0032 struct Config {
0033
0034 Acts::PdgParticle pdgBeam0 = Acts::PdgParticle::eProton;
0035
0036 Acts::PdgParticle pdgBeam1 = Acts::PdgParticle::eProton;
0037
0038 double cmsEnergy = 14 * Acts::UnitConstants::TeV;
0039
0040 std::vector<std::string> settings = {{"HardQCD:all = on"}};
0041
0042 bool printShortEventListing = false;
0043
0044 bool printLongEventListing = false;
0045
0046
0047
0048 bool labelSecondaries = true;
0049
0050 double spatialVertexThreshold = 1.0 * Acts::UnitConstants::um;
0051 };
0052
0053 Pythia8Generator(const Config& cfg, Acts::Logging::Level lvl);
0054 ~Pythia8Generator() override;
0055
0056 Pythia8Generator() = delete;
0057 Pythia8Generator(const Pythia8Generator&) = delete;
0058 Pythia8Generator(Pythia8Generator&&) = delete;
0059 Pythia8Generator& operator=(const Pythia8Generator&) = delete;
0060 Pythia8Generator& operator=(Pythia8Generator&& other) = delete;
0061
0062 std::pair<SimVertexContainer, SimParticleContainer> operator()(
0063 RandomEngine& rng) override;
0064
0065 private:
0066
0067 const Acts::Logger& logger() const { return (*m_logger); }
0068
0069 Config m_cfg;
0070 std::unique_ptr<const Acts::Logger> m_logger;
0071 std::unique_ptr<::Pythia8::Pythia> m_pythia8;
0072 std::mutex m_pythia8Mutex;
0073 };
0074
0075 }