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
HelloRandomAlgorithm.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file HelloRandomAlgorithm.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2017-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
9
#pragma once
10
11
#include "
ActsExamples/Framework/DataHandle.hpp
"
12
#include "
ActsExamples/Framework/IAlgorithm.hpp
"
13
#include "
ActsExamples/Framework/RandomNumbers.hpp
"
14
15
#include <array>
16
#include <memory>
17
#include <string>
18
19
#include "
HelloData.hpp
"
20
21
namespace
ActsExamples {
22
24
class
HelloRandomAlgorithm
:
public
ActsExamples::IAlgorithm
{
25
public
:
26
struct
Config
{
27
std::shared_ptr<ActsExamples::RandomNumbers>
randomNumbers
=
nullptr
;
29
std::array<double, 2>
gaussParameters
= {{0., 1.}};
30
std::array<double, 2>
uniformParameters
= {{0., 1.}};
31
std::array<double, 2>
gammaParameters
= {{0., 1.}};
32
int
poissonParameter
= 40;
33
size_t
drawsPerEvent
= 0;
35
std::string
output
;
36
};
37
38
HelloRandomAlgorithm
(
const
Config
&
cfg
,
39
Acts::Logging::Level
level
=
Acts::Logging::INFO
);
40
41
// Generate random numbers from various distributions.
42
ActsExamples::ProcessCode
execute
(
const
AlgorithmContext
& ctx)
const override
;
43
44
WriteDataHandle<HelloDataCollection>
m_writeHandle
{
this
,
"Output"
};
45
46
private
:
47
Config
m_cfg
;
48
};
49
50
}
// namespace ActsExamples
acts
blob
sPHENIX
Examples
Run
HelloWorld
HelloRandomAlgorithm.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:40
using
1.8.2 with
sPHENIX GitHub integration