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
ParticleTrackingAction.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file ParticleTrackingAction.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2021 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/EventData/SimHit.hpp
"
13
#include "
ActsExamples/EventData/SimParticle.hpp
"
14
#include "
ActsExamples/Geant4/EventStore.hpp
"
15
16
#include <memory>
17
#include <optional>
18
#include <string>
19
20
#include <G4Track.hh>
21
#include <G4UserTrackingAction.hh>
22
23
class
G4Track;
24
25
namespace
ActsExamples {
26
31
class
ParticleTrackingAction
:
public
G4UserTrackingAction {
32
public
:
33
struct
Config
{
34
std::shared_ptr<EventStore>
eventStore
;
35
36
bool
keepParticlesWithoutHits
=
true
;
37
};
38
43
ParticleTrackingAction
(
const
Config
&
cfg
,
44
std::unique_ptr<const Acts::Logger>
logger
=
45
Acts::getDefaultLogger
(
"ParticleTrackingAction"
,
46
Acts::Logging::INFO
));
47
~ParticleTrackingAction
()
override
=
default
;
48
53
void
PreUserTrackingAction
(
const
G4Track* aTrack)
final
;
54
59
void
PostUserTrackingAction
(
const
G4Track* aTrack)
final
;
60
61
protected
:
62
Config
m_cfg
;
63
64
private
:
69
SimParticle
convert
(
const
G4Track& aTrack,
SimBarcode
particleId)
const
;
70
72
std::optional<SimBarcode>
makeParticleId
(G4int trackId, G4int parentId)
const
;
73
75
const
Acts::Logger
&
logger
()
const
{
return
*
m_logger
; }
76
78
EventStore
&
eventStore
()
const
{
return
*
m_cfg
.
eventStore
; }
79
81
std::unique_ptr<const Acts::Logger>
m_logger
;
82
};
83
84
}
// namespace ActsExamples
acts
blob
sPHENIX
Examples
Algorithms
Geant4
include
ActsExamples
Geant4
ParticleTrackingAction.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:36
using
1.8.2 with
sPHENIX GitHub integration