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
AdaptiveMultiVertexFinderExample.cpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file AdaptiveMultiVertexFinderExample.cpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 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
9
#include "
Acts/Definitions/Units.hpp
"
10
#include "
ActsExamples/Framework/Sequencer.hpp
"
11
#include "
ActsExamples/Options/CommonOptions.hpp
"
12
#include "
ActsExamples/Options/MagneticFieldOptions.hpp
"
13
#include "
ActsExamples/Options/ParticleSelectorOptions.hpp
"
14
#include "
ActsExamples/Options/ParticleSmearingOptions.hpp
"
15
#include "
ActsExamples/Options/Pythia8Options.hpp
"
16
#include "
ActsExamples/Options/VertexingOptions.hpp
"
17
#include "
ActsExamples/Reconstruction/ReconstructionBase.hpp
"
18
#include "
ActsExamples/TruthTracking/ParticleSelector.hpp
"
19
#include "
ActsExamples/TruthTracking/ParticleSmearing.hpp
"
20
#include "
ActsExamples/Vertexing/AdaptiveMultiVertexFinderAlgorithm.hpp
"
21
22
#include <memory>
23
24
using namespace
Acts::UnitLiterals;
25
using namespace
ActsExamples;
26
27
int
main
(
int
argc,
char
* argv[]) {
28
// setup and parse options
29
auto
desc =
Options::makeDefaultOptions
();
30
Options::addSequencerOptions
(desc);
31
Options::addRandomNumbersOptions
(desc);
32
Options::addPythia8Options
(desc);
33
Options::addParticleSelectorOptions
(desc);
34
Options::addVertexingOptions
(desc);
35
Options::addMagneticFieldOptions
(desc);
36
Options::addOutputOptions
(desc, OutputFormat::DirectoryOnly);
37
Options::addParticleSmearingOptions
(desc);
38
auto
vars =
Options::parse
(desc, argc, argv);
39
if
(vars.empty()) {
40
return
EXIT_FAILURE;
41
}
42
43
// basic setup
44
auto
logLevel
=
Options::readLogLevel
(vars);
45
auto
rnd
=
46
std::make_shared<RandomNumbers>(
Options::readRandomNumbersConfig
(vars));
47
Sequencer
sequencer(
Options::readSequencerConfig
(vars));
48
49
// Setup the magnetic field
50
auto
magneticField
=
Options::readMagneticField
(vars);
51
52
// setup event generator
53
EventGenerator::Config
evgen =
Options::readPythia8Options
(vars,
logLevel
);
54
evgen.
outputParticles
=
"particles_generated"
;
55
evgen.
randomNumbers
=
rnd
;
56
sequencer.addReader(std::make_shared<EventGenerator>(evgen,
logLevel
));
57
58
// pre-select particles
59
ParticleSelector::Config
selectParticles =
60
Options::readParticleSelectorConfig
(vars);
61
selectParticles.
inputParticles
= evgen.
outputParticles
;
62
selectParticles.
outputParticles
=
"particles_selected"
;
63
// smearing only works with charge particles for now
64
selectParticles.
removeNeutral
=
true
;
65
selectParticles.
absEtaMax
= vars[
"vertexing-eta-max"
].as<
double
>();
66
selectParticles.
rhoMax
= vars[
"vertexing-rho-max"
].as<
double
>() * 1_mm;
67
selectParticles.
ptMin
= vars[
"vertexing-pt-min"
].as<
double
>() * 1_MeV;
68
sequencer.addAlgorithm(
69
std::make_shared<ParticleSelector>(selectParticles,
logLevel
));
70
71
// Run the particle smearing
72
auto
particleSmearingCfg =
setupParticleSmearing
(
73
vars, sequencer,
rnd
, selectParticles.
outputParticles
);
74
75
// find vertices
76
AdaptiveMultiVertexFinderAlgorithm::Config
findVertices;
77
findVertices.
bField
=
magneticField
;
78
findVertices.
inputTrackParameters
= particleSmearingCfg.outputTrackParameters;
79
findVertices.
outputProtoVertices
=
"protovertices"
;
80
sequencer.addAlgorithm(std::make_shared<AdaptiveMultiVertexFinderAlgorithm>(
81
findVertices,
logLevel
));
82
83
return
sequencer.run();
84
}
acts
blob
sPHENIX
Examples
Run
Vertexing
Pythia8
AdaptiveMultiVertexFinderExample.cpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:40
using
1.8.2 with
sPHENIX GitHub integration