ECCE @ 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 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 
15 #include <functional>
16 #include <memory>
17 #include <utility>
18 #include <vector>
19 
25 
26 namespace FW {
27 
33 class EventGenerator final : public FW::IReader {
34  public:
47  using MultiplicityGenerator = std::function<size_t(RandomEngine&)>;
48  using VertexGenerator =
49  std::function<Acts::ActsVector<double, 4>(RandomEngine&)>;
50  using ProcessGenerator = std::function<std::vector<SimVertex>(RandomEngine&)>;
51  struct Generator {
55  };
56 
57  struct Config {
59  std::string output;
61  std::vector<Generator> generators;
63  bool shuffle = false;
65  std::shared_ptr<const RandomNumbers> randomNumbers;
66  };
67 
69 
71  std::string name() const override final;
73  std::pair<size_t, size_t> availableEvents() const final override;
75  ProcessCode read(const AlgorithmContext& context) override final;
76 
77  private:
78  const Acts::Logger& logger() const { return *m_logger; }
79 
81  std::unique_ptr<const Acts::Logger> m_logger;
82 };
83 
84 } // namespace FW