File indexing completed on 2025-01-18 09:11:37
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 struct Pythia8RandomEngineWrapper;
0031
0032 class Pythia8Generator : public EventGenerator::ParticlesGenerator {
0033 public:
0034 struct Config {
0035
0036 Acts::PdgParticle pdgBeam0 = Acts::PdgParticle::eProton;
0037
0038 Acts::PdgParticle pdgBeam1 = Acts::PdgParticle::eProton;
0039
0040 double cmsEnergy = 14 * Acts::UnitConstants::TeV;
0041
0042 std::vector<std::string> settings = {{"HardQCD:all = on"}};
0043
0044 bool printShortEventListing = false;
0045
0046 bool printLongEventListing = false;
0047
0048
0049
0050 bool labelSecondaries = true;
0051
0052 double spatialVertexThreshold = 1.0 * Acts::UnitConstants::um;
0053
0054 unsigned int initializationSeed = 42;
0055 };
0056
0057 Pythia8Generator(const Config& cfg, Acts::Logging::Level lvl);
0058 ~Pythia8Generator() override;
0059
0060 Pythia8Generator() = delete;
0061 Pythia8Generator(const Pythia8Generator&) = delete;
0062 Pythia8Generator(Pythia8Generator&&) = delete;
0063 Pythia8Generator& operator=(const Pythia8Generator&) = delete;
0064 Pythia8Generator& operator=(Pythia8Generator&& other) = delete;
0065
0066 std::pair<SimVertexContainer, SimParticleContainer> operator()(
0067 RandomEngine& rng) override;
0068
0069 private:
0070
0071 const Acts::Logger& logger() const { return (*m_logger); }
0072
0073 Config m_cfg;
0074 std::unique_ptr<const Acts::Logger> m_logger;
0075 std::unique_ptr<::Pythia8::Pythia> m_pythia8;
0076 std::shared_ptr<Pythia8RandomEngineWrapper> m_pythia8RndmEngine;
0077 std::mutex m_pythia8Mutex;
0078 };
0079
0080 }