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
HepMC3Reader.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file HepMC3Reader.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2018-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
#pragma once
10
11
#include "
Acts/Utilities/Logger.hpp
"
12
#include "
ActsExamples/Framework/DataHandle.hpp
"
13
#include "
ActsExamples/Framework/IReader.hpp
"
14
15
#include <HepMC3/GenEvent.h>
16
#include <HepMC3/ReaderAscii.h>
17
18
namespace
ActsExamples {
19
21
class
HepMC3AsciiReader
final :
public
IReader
{
22
public
:
23
struct
Config
{
24
// The input directory
25
std::string
inputDir
;
26
// The stem of input file names
27
std::string
inputStem
;
28
// The output collection
29
std::string
outputEvents
;
30
};
31
36
bool
readEvent
(HepMC3::ReaderAscii&
reader
, HepMC3::GenEvent&
event
);
37
41
bool
status
(HepMC3::ReaderAscii&
reader
);
42
47
HepMC3AsciiReader
(
const
Config
&
cfg
,
Acts::Logging::Level
lvl);
48
49
std::string
name
()
const override
;
50
52
std::pair<size_t, size_t>
availableEvents
()
const override
;
53
55
ProcessCode
read
(
const
ActsExamples::AlgorithmContext
& ctx)
override
;
56
58
const
Config
&
config
()
const
{
return
m_cfg
; }
59
60
private
:
62
Config
m_cfg
;
64
std::pair<size_t, size_t>
m_eventsRange
;
66
std::unique_ptr<const Acts::Logger>
m_logger
;
67
68
const
Acts::Logger
&
logger
()
const
{
return
*
m_logger
; }
69
70
WriteDataHandle<std::vector<HepMC3::GenEvent>
>
m_outputEvents
{
this
,
71
"OutputEvents"
};
72
};
73
74
}
// namespace ActsExamples
acts
blob
sPHENIX
Examples
Io
HepMC3
include
ActsExamples
Io
HepMC3
HepMC3Reader.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:38
using
1.8.2 with
sPHENIX GitHub integration