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
SvtxTrackEval.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file SvtxTrackEval.h
1
#ifndef G4EVAL_SVTXTRACKEVAL_H
2
#define G4EVAL_SVTXTRACKEVAL_H
3
4
#include "
SvtxClusterEval.h
"
5
6
#include <
trackbase/TrkrDefs.h
>
7
8
#include <map>
9
#include <set>
10
#include <string>
// for string
11
#include <utility>
12
13
class
PHCompositeNode
;
14
15
class
PHG4Hit
;
16
class
PHG4Particle
;
17
18
class
SvtxHitEval
;
19
class
SvtxTrack
;
20
class
SvtxTrackMap
;
21
class
SvtxTruthEval
;
22
class
PHG4ParticleSvtxMap
;
23
class
SvtxPHG4ParticleMap
;
24
class
PHG4TruthInfoContainer
;
25
26
class
SvtxTrackEval
27
{
28
public
:
29
SvtxTrackEval
(
PHCompositeNode
* topNode);
30
virtual
~SvtxTrackEval
();
31
32
void
next_event
(
PHCompositeNode
* topNode);
33
void
do_caching
(
bool
do_cache)
34
{
35
_do_cache
= do_cache;
36
_clustereval
.
do_caching
(do_cache);
37
}
38
void
set_strict
(
bool
strict)
39
{
40
_strict
= strict;
41
_clustereval
.
set_strict
(strict);
42
}
43
void
set_verbosity
(
int
verbosity
)
44
{
45
_verbosity
=
verbosity
;
46
_clustereval
.
set_verbosity
(verbosity);
47
}
48
49
// access the clustereval (and its cached values)
50
SvtxClusterEval
*
get_cluster_eval
() {
return
&
_clustereval
; }
51
SvtxHitEval
*
get_hit_eval
() {
return
_clustereval
.
get_hit_eval
(); }
52
SvtxTruthEval
*
get_truth_eval
() {
return
_clustereval
.
get_truth_eval
(); }
53
54
// backtrace through to PHG4Hits
55
std::set<PHG4Hit*>
all_truth_hits
(
SvtxTrack
* track);
56
57
// backtrace through to PHG4Particles
58
std::set<PHG4Particle*>
all_truth_particles
(
SvtxTrack
* track);
59
PHG4Particle
*
max_truth_particle_by_nclusters
(
SvtxTrack
* track);
60
61
// forwardtrace through to SvtxTracks
62
std::set<SvtxTrack*>
all_tracks_from
(
PHG4Particle
* truthparticle);
63
SvtxTrack
*
best_track_from
(
PHG4Particle
* truthparticle);
64
std::set<SvtxTrack*>
all_tracks_from
(
PHG4Hit
* truthhit);
65
std::set<SvtxTrack*>
all_tracks_from
(
TrkrDefs::cluskey
cluster_key);
66
SvtxTrack
*
best_track_from
(
TrkrDefs::cluskey
cluster_key);
67
void
create_cache_track_from_cluster
();
68
69
// overlap calculations
70
void
calc_cluster_contribution
(
SvtxTrack
* svtxtrack,
PHG4Particle
* truthparticle);
71
unsigned
int
get_nclusters_contribution
(
SvtxTrack
* svtxtrack,
PHG4Particle
* truthparticle);
72
std::pair<unsigned int, unsigned int>
get_layer_range_contribution
(
SvtxTrack
* track,
PHG4Particle
*
particle
,
unsigned
int
start_layer,
unsigned
int
end_layer);
73
unsigned
int
get_nclusters_contribution_by_layer
(
SvtxTrack
* svtxtrack,
PHG4Particle
* truthparticle);
74
unsigned
int
get_nwrongclusters_contribution
(
SvtxTrack
* svtxtrack,
PHG4Particle
* truthparticle);
75
unsigned
int
get_errors
() {
return
_errors
+
_clustereval
.
get_errors
(); }
76
77
void
set_track_nodename
(
const
std::string
&
name
) {
m_TrackNodeName
=
name
; }
78
79
private
:
80
void
get_node_pointers
(
PHCompositeNode
* topNode);
81
bool
has_node_pointers
();
82
83
std::vector<TrkrDefs::cluskey>
get_track_ckeys
(
SvtxTrack
* track);
84
85
SvtxClusterEval
_clustereval
;
86
SvtxTrackMap
*
_trackmap
=
nullptr
;
87
PHG4TruthInfoContainer
*
_truthinfo
=
nullptr
;
88
const
PHG4ParticleSvtxMap
*
_truthRecoMap
=
nullptr
;
89
const
SvtxPHG4ParticleMap
*
_recoTruthMap
=
nullptr
;
90
91
bool
_strict
=
false
;
92
int
_verbosity
= 0;
93
unsigned
int
_errors
= 0;
94
95
bool
_do_cache
=
true
;
96
bool
_cache_track_from_cluster_exists
=
false
;
97
std::map<SvtxTrack*, std::set<PHG4Hit*> >
_cache_all_truth_hits
;
98
std::map<SvtxTrack*, std::set<PHG4Particle*> >
_cache_all_truth_particles
;
99
std::map<SvtxTrack*, PHG4Particle*>
_cache_max_truth_particle_by_nclusters
;
100
std::map<PHG4Particle*, std::set<SvtxTrack*> >
_cache_all_tracks_from_particle
;
101
std::map<PHG4Particle*, SvtxTrack*>
_cache_best_track_from_particle
;
102
std::map<PHG4Hit*, std::set<SvtxTrack*> >
_cache_all_tracks_from_g4hit
;
103
std::map<TrkrDefs::cluskey, std::set<SvtxTrack*> >
_cache_all_tracks_from_cluster
;
104
std::map<TrkrDefs::cluskey, SvtxTrack*>
_cache_best_track_from_cluster
;
105
std::map<std::pair<SvtxTrack*, PHG4Particle*>,
unsigned
int
>
_cache_get_nclusters_contribution
;
106
std::map<std::pair<SvtxTrack*, PHG4Particle*>,
unsigned
int
>
_cache_get_nclusters_contribution_by_layer
;
107
std::map<std::pair<SvtxTrack*, PHG4Particle*>,
unsigned
int
>
_cache_get_nwrongclusters_contribution
;
108
std::string
m_TrackNodeName
=
"SvtxTrackMap"
;
109
};
110
111
#endif // G4EVAL_SVTXTRACKEVAL_H
coresoftware
blob
master
simulation
g4simulation
g4eval
SvtxTrackEval.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:14
using
1.8.2 with
sPHENIX GitHub integration