Analysis Software
Documentation for sPHENIX simulation software
 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 
14 
18 int main(int argc, char** argv) {
19  // Declare the supported program options.
20  // Setup and parse options
25 
26  auto vm = ActsExamples::Options::parse(desc, argc, argv);
27  if (vm.empty()) {
28  return EXIT_FAILURE;
29  }
30 
32 
33  ActsExamples::Sequencer sequencer(
35 
36  // Create the reader
37  auto hepMC3ReaderConfig = ActsExamples::Options::readHepMC3ReaderOptions(vm);
38  hepMC3ReaderConfig.outputEvents = "hepmc-events";
39 
41  extractionConfig.inputEvents = hepMC3ReaderConfig.outputEvents;
42  extractionConfig.extractionProcess = "Inelastic";
43 
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 }