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
VertexGenerators.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file VertexGenerators.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 "
ActsExamples/Framework/RandomNumbers.hpp
"
17
#include "
ActsExamples/Generators/EventGenerator.hpp
"
18
19
#include <random>
20
21
namespace
ActsExamples {
22
23
struct
FixedVertexGenerator
:
public
EventGenerator::VertexGenerator
{
25
Acts::Vector4
fixed
= Acts::Vector4::Zero();
26
27
Acts::Vector4
operator()
(
RandomEngine
&
/* unused */
)
const override
{
28
return
fixed
;
29
}
30
};
31
32
struct
GaussianVertexGenerator
:
public
EventGenerator::VertexGenerator
{
33
// standard deviation comes first, since it is more likely to be modified
35
Acts::Vector4
stddev
= {0.0, 0.0, 0.0, 0.0};
37
Acts::Vector4
mean
= {0.0, 0.0, 0.0, 0.0};
38
39
Acts::Vector4
operator()
(
RandomEngine
&
rng
)
const override
{
40
auto
normal = std::normal_distribution<double>(0.0, 1.0);
41
Acts::Vector4
rndNormal = {
42
normal(rng),
43
normal(rng),
44
normal(rng),
45
normal(rng),
46
};
47
return
mean
+ rndNormal.cwiseProduct(
stddev
);
48
}
49
};
50
51
}
// namespace ActsExamples
acts
blob
sPHENIX
Examples
Algorithms
Generators
ActsExamples
Generators
VertexGenerators.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:37
using
1.8.2 with
sPHENIX GitHub integration