ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
ECCE @ EIC Software
Deprecated List
Modules
Namespaces
Classes
Files
File List
acts
blob
master
CI
Core
doc
Examples
Algorithms
Detectors
Framework
Io
Run
Common
EventGenerator
Fatras
Geometry
HelloWorld
HepMC3
MagneticField
MaterialMapping
Misc
Propagation
ReadCsv
Reconstruction
Vertexing
VertexAndTracksReaderAndFinderExample.cpp
VertexAndTracksWriterExample.cpp
VertexFinderExample.cpp
VertexFitterExample.cpp
Scripts
Fatras
Plugins
Tests
thirdparty
analysis
coresoftware
Doxygen_Assist
ecce-detectors
fun4all_eicdetectors
geant4
macros
online_distribution
tutorials
doxygen_mainpage.h
File Members
External Links
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
VertexFitterExample.cpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file VertexFitterExample.cpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2016-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
#include <
Acts/EventData/TrackParameters.hpp
>
10
#include <boost/program_options.hpp>
11
#include <memory>
12
13
#include "
ACTFW/Framework/Sequencer.hpp
"
14
#include "
ACTFW/Generators/MultiplicityGenerators.hpp
"
15
#include "
ACTFW/Generators/Pythia8ProcessGenerator.hpp
"
16
#include "
ACTFW/Generators/VertexGenerators.hpp
"
17
#include "
ACTFW/Io/Csv/CsvParticleWriter.hpp
"
18
#include "
ACTFW/Io/Root/RootParticleWriter.hpp
"
19
#include "
ACTFW/Options/CommonOptions.hpp
"
20
#include "
ACTFW/Options/Pythia8Options.hpp
"
21
#include "
ACTFW/TruthTracking/TrackSelector.hpp
"
22
#include "
ACTFW/TruthTracking/TruthVerticesToTracks.hpp
"
23
#include "
ACTFW/Utilities/Paths.hpp
"
24
#include "
ACTFW/Vertexing/VertexFitAlgorithm.hpp
"
25
26
using namespace
FW;
27
32
int
main
(
int
argc,
char
* argv[]) {
33
// setup and parse options
34
auto
desc
=
Options::makeDefaultOptions
();
35
Options::addSequencerOptions
(
desc
);
36
Options::addRandomNumbersOptions
(
desc
);
37
Options::addPythia8Options
(
desc
);
38
Options::addOutputOptions
(
desc
);
39
auto
vm =
Options::parse
(
desc
, argc, argv);
40
if
(vm.empty()) {
41
return
EXIT_FAILURE;
42
}
43
44
// basic setup
45
auto
logLevel =
Options::readLogLevel
(vm);
46
auto
rnd =
47
std::make_shared<RandomNumbers>(
Options::readRandomNumbersConfig
(vm));
48
Sequencer
sequencer(
Options::readSequencerConfig
(vm));
49
50
// Set up event generator
51
EventGenerator::Config
evgen =
Options::readPythia8Options
(vm, logLevel);
52
evgen.
output
=
"generated_event"
;
53
evgen.
randomNumbers
= rnd;
54
sequencer.addReader(std::make_shared<EventGenerator>(evgen, logLevel));
55
56
// Set up TruthVerticesToTracks converter algorithm
57
TruthVerticesToTracksAlgorithm::Config
trkConvConfig;
58
trkConvConfig.
input
= evgen.
output
;
59
trkConvConfig.
output
=
"all_tracks"
;
60
trkConvConfig.
randomNumberSvc
= rnd;
61
trkConvConfig.
bField
= {0
_T
, 0
_T
, 2_T};
62
sequencer.addAlgorithm(std::make_shared<TruthVerticesToTracksAlgorithm>(
63
trkConvConfig, logLevel));
64
65
// Set up track selector
66
TrackSelector::Config
selectorConfig;
67
selectorConfig.
input
= trkConvConfig.
output
;
68
selectorConfig.
output
=
"selected_tracks"
;
69
selectorConfig.
absEtaMax
= 2.5;
70
selectorConfig.
rhoMax
= 4
_mm
;
71
selectorConfig.
ptMin
= 400
_MeV
;
72
selectorConfig.
keepNeutral
=
false
;
73
sequencer.addAlgorithm(
74
std::make_shared<TrackSelector>(selectorConfig, logLevel));
75
76
// Add the fit algorithm with Billoir fitter
77
FWE::VertexFitAlgorithm::Config
vertexFitCfg;
78
vertexFitCfg.
trackCollection
= selectorConfig.
output
;
79
vertexFitCfg.
bField
= trkConvConfig.
bField
;
80
sequencer.addAlgorithm(
81
std::make_shared<FWE::VertexFitAlgorithm>(vertexFitCfg, logLevel));
82
83
return
sequencer.run();
84
}
acts
blob
master
Examples
Run
Vertexing
VertexFitterExample.cpp
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:24
using
1.8.2 with
ECCE GitHub integration