EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EventGenerator.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EventGenerator.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2019-2020 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 
12 
13 #pragma once
14 
20 
21 #include <functional>
22 #include <memory>
23 #include <utility>
24 #include <vector>
25 
26 namespace ActsExamples {
27 
33 class EventGenerator final : public ActsExamples::IReader {
34  public:
47  using MultiplicityGenerator = std::function<size_t(RandomEngine&)>;
48  using VertexGenerator = std::function<Acts::Vector4D(RandomEngine&)>;
49  using ParticlesGenerator = std::function<SimParticleContainer(RandomEngine&)>;
50  struct Generator {
54  };
55 
56  struct Config {
58  std::string outputParticles;
60  std::vector<Generator> generators;
62  std::shared_ptr<const RandomNumbers> randomNumbers;
63  };
64 
66 
68  std::string name() const final;
70  std::pair<size_t, size_t> availableEvents() const final;
72  ProcessCode read(const AlgorithmContext& context) final;
73 
74  private:
75  const Acts::Logger& logger() const { return *m_logger; }
76 
78  std::unique_ptr<const Acts::Logger> m_logger;
79 };
80 
81 } // namespace ActsExamples