Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
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
15
#include "
Acts/Definitions/Algebra.hpp
"
16
#include "
Acts/Utilities/Logger.hpp
"
17
#include "
ActsExamples/EventData/SimParticle.hpp
"
18
#include "
ActsExamples/Framework/DataHandle.hpp
"
19
#include "
ActsExamples/Framework/IReader.hpp
"
20
#include "
ActsExamples/Framework/ProcessCode.hpp
"
21
#include "
ActsExamples/Framework/RandomNumbers.hpp
"
22
23
#include <cstddef>
24
#include <functional>
25
#include <memory>
26
#include <string>
27
#include <utility>
28
#include <vector>
29
30
namespace
ActsExamples {
31
struct
AlgorithmContext;
32
38
class
EventGenerator
final :
public
ActsExamples::IReader
{
39
public
:
52
54
struct
MultiplicityGenerator
{
56
virtual
~MultiplicityGenerator
() =
default
;
61
virtual
size_t
operator()
(
RandomEngine
&
rng
)
const
= 0;
62
};
63
65
struct
VertexGenerator
{
67
virtual
~VertexGenerator
() =
default
;
72
virtual
Acts::Vector4
operator()
(
RandomEngine
&
rng
)
const
= 0;
73
};
74
76
struct
ParticlesGenerator
{
78
virtual
~ParticlesGenerator
() =
default
;
85
virtual
SimParticleContainer
operator()
(
RandomEngine
&
rng
) = 0;
86
};
87
89
struct
Generator
{
90
std::shared_ptr<MultiplicityGenerator>
multiplicity
=
nullptr
;
91
std::shared_ptr<VertexGenerator>
vertex
=
nullptr
;
92
std::shared_ptr<ParticlesGenerator>
particles
=
nullptr
;
93
};
94
95
struct
Config
{
97
std::string
outputParticles
;
99
std::vector<Generator>
generators
;
101
std::shared_ptr<const RandomNumbers>
randomNumbers
;
102
};
103
104
EventGenerator
(
const
Config
&
cfg
,
Acts::Logging::Level
lvl);
105
107
std::string
name
() const final;
109
std::pair<
size_t
,
size_t
>
availableEvents
() const final;
111
ProcessCode
read
(const
AlgorithmContext
& ctx) final;
112
114
const
Config
&
config
()
const
{
return
m_cfg
; }
115
116
private
:
117
const
Acts::Logger
&
logger
()
const
{
return
*
m_logger
; }
118
119
Config
m_cfg
;
120
std::unique_ptr<const Acts::Logger>
m_logger
;
121
122
WriteDataHandle<SimParticleContainer>
m_outputParticles
{
this
,
123
"OutputParticles"
};
124
};
125
126
}
// namespace ActsExamples
acts
blob
sPHENIX
Examples
Algorithms
Generators
ActsExamples
Generators
EventGenerator.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:37
using
1.8.2 with
sPHENIX GitHub integration