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
HepMC3HistogramExample.cpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file HepMC3HistogramExample.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 "
ActsExamples/HepMC/HepMCProcessExtractor.hpp
"
10
#include "
ActsExamples/Io/HepMC3/HepMC3Reader.hpp
"
11
#include "
ActsExamples/Io/NuclearInteractions/RootNuclearInteractionParametersWriter.hpp
"
12
#include "
ActsExamples/Options/CommonOptions.hpp
"
13
#include "
ActsExamples/Options/HepMC3Options.hpp
"
14
18
int
main
(
int
argc,
char
** argv) {
19
// Declare the supported program options.
20
// Setup and parse options
21
auto
desc =
ActsExamples::Options::makeDefaultOptions
();
22
ActsExamples::Options::addSequencerOptions
(desc);
23
ActsExamples::Options::addInputOptions
(desc);
24
ActsExamples::Options::addHepMC3ReaderOptions
(desc);
25
26
auto
vm =
ActsExamples::Options::parse
(desc, argc, argv);
27
if
(vm.empty()) {
28
return
EXIT_FAILURE;
29
}
30
31
auto
logLevel
=
ActsExamples::Options::readLogLevel
(vm);
32
33
ActsExamples::Sequencer
sequencer(
34
ActsExamples::Options::readSequencerConfig
(vm));
35
36
// Create the reader
37
auto
hepMC3ReaderConfig =
ActsExamples::Options::readHepMC3ReaderOptions
(vm);
38
hepMC3ReaderConfig.outputEvents =
"hepmc-events"
;
39
40
ActsExamples::HepMCProcessExtractor::Config
extractionConfig;
41
extractionConfig.
inputEvents
= hepMC3ReaderConfig.outputEvents;
42
extractionConfig.
extractionProcess
=
"Inelastic"
;
43
44
ActsExamples::RootNuclearInteractionParametersWriter::Config
writerCfg;
45
writerCfg.
inputSimulationProcesses
=
46
extractionConfig.
outputSimulationProcesses
;
47
48
// Add to the sequencer
49
sequencer.
addReader
(std::make_shared<ActsExamples::HepMC3AsciiReader>(
50
hepMC3ReaderConfig,
logLevel
));
51
sequencer.
addAlgorithm
(std::make_shared<ActsExamples::HepMCProcessExtractor>(
52
std::move
(extractionConfig),
logLevel
));
53
sequencer.
addWriter
(
54
std::make_shared<ActsExamples::RootNuclearInteractionParametersWriter>(
55
writerCfg,
logLevel
));
56
57
// Run
58
return
sequencer.
run
();
59
}
acts
blob
sPHENIX
Examples
Run
HepMC3
HepMC3HistogramExample.cpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:40
using
1.8.2 with
sPHENIX GitHub integration