Analysis Software
Documentation for sPHENIX simulation software
 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 
18 
19 #include <random>
20 
21 namespace ActsExamples {
22 
25  Acts::Vector4 fixed = Acts::Vector4::Zero();
26 
27  Acts::Vector4 operator()(RandomEngine& /* unused */) const override {
28  return fixed;
29  }
30 };
31 
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 
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