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
SvtxClusterEval.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file SvtxClusterEval.h
1
#ifndef G4EVAL_SVTXCLUSTEREVAL_H
2
#define G4EVAL_SVTXCLUSTEREVAL_H
3
4
#include "
SvtxHitEval.h
"
5
6
#include <
trackbase/ActsGeometry.h
>
7
#include <
trackbase/TrkrDefs.h
>
8
9
#include <map>
10
#include <memory>
// for shared_ptr, less
11
#include <set>
12
#include <utility>
13
14
class
PHCompositeNode
;
15
16
class
PHG4Hit
;
17
class
PHG4HitContainer
;
18
class
PHG4Particle
;
19
class
PHG4TruthInfoContainer
;
20
21
class
TrkrCluster
;
22
class
TrkrClusterContainer
;
23
class
TrkrClusterHitAssoc
;
24
class
TrkrHitTruthAssoc
;
25
class
SvtxTruthEval
;
26
27
typedef
std::multimap<float, TrkrDefs::cluskey>
innerMap
;
28
29
class
SvtxClusterEval
30
{
31
public
:
32
SvtxClusterEval
(
PHCompositeNode
* topNode);
33
virtual
~SvtxClusterEval
();
34
35
void
next_event
(
PHCompositeNode
* topNode);
36
void
do_caching
(
bool
do_cache)
37
{
38
_do_cache
= do_cache;
39
_hiteval
.
do_caching
(do_cache);
40
}
41
void
set_strict
(
bool
strict)
42
{
43
_strict
= strict;
44
_hiteval
.
set_strict
(strict);
45
}
46
void
set_verbosity
(
int
verbosity
)
47
{
48
_verbosity
=
verbosity
;
49
_hiteval
.
set_verbosity
(verbosity);
50
}
51
52
// access the clustereval (and its cached values)
53
SvtxHitEval
*
get_hit_eval
() {
return
&
_hiteval
; }
54
SvtxTruthEval
*
get_truth_eval
() {
return
_hiteval
.
get_truth_eval
(); }
55
56
// backtrace through to PHG4Hits
57
std::set<PHG4Hit*>
all_truth_hits
(
TrkrDefs::cluskey
cluster);
58
PHG4Hit
*
max_truth_hit_by_energy
(
TrkrDefs::cluskey
);
59
60
// get all truth clusters matching a given layer
61
std::map<TrkrDefs::cluskey, std::shared_ptr<TrkrCluster>>
all_truth_clusters
(
TrkrDefs::cluskey
cluster_key);
62
63
std::pair<TrkrDefs::cluskey, std::shared_ptr<TrkrCluster>>
max_truth_cluster_by_energy
(
TrkrDefs::cluskey
cluster_key);
64
65
PHG4Hit
*
all_truth_hits_by_nhit
(
TrkrDefs::cluskey
cluster);
66
std::pair<int, int>
gtrackid_and_layer_by_nhit
(
TrkrDefs::cluskey
cluster);
67
68
// backtrace through to PHG4Particles
69
std::set<PHG4Particle*>
all_truth_particles
(
TrkrDefs::cluskey
);
70
PHG4Particle
*
max_truth_particle_by_energy
(
TrkrDefs::cluskey
);
71
PHG4Particle
*
max_truth_particle_by_cluster_energy
(
TrkrDefs::cluskey
);
72
73
// forwardtrace through to SvtxClusters
74
std::set<TrkrDefs::cluskey>
all_clusters_from
(
PHG4Particle
* truthparticle);
75
std::set<TrkrDefs::cluskey>
all_clusters_from
(
PHG4Hit
* truthhit);
76
TrkrDefs::cluskey
best_cluster_from
(
PHG4Hit
* truthhit);
77
TrkrDefs::cluskey
best_cluster_by_nhit
(
int
gid
,
int
layer
);
78
void
FillRecoClusterFromG4HitCache
();
79
// overlap calculations
80
float
get_energy_contribution
(
TrkrDefs::cluskey
cluster_key,
PHG4Particle
* truthparticle);
81
float
get_energy_contribution
(
TrkrDefs::cluskey
cluster_key,
PHG4Hit
* truthhit);
82
83
std::pair<TrkrDefs::cluskey, TrkrCluster*>
reco_cluster_from_truth_cluster
(
TrkrDefs::cluskey
,
const
std::shared_ptr<TrkrCluster>& gclus);
84
85
unsigned
int
get_errors
() {
return
_errors
+
_hiteval
.
get_errors
(); }
86
87
private
:
88
void
get_node_pointers
(
PHCompositeNode
* topNode);
89
void
fill_cluster_layer_map
();
90
// void fill_g4hit_layer_map();
91
bool
has_node_pointers
();
92
95
float
fast_approx_atan2
(
float
y
,
float
x
);
96
float
fast_approx_atan2
(
float
y2x);
97
98
SvtxHitEval
_hiteval
;
99
TrkrClusterContainer
*
_clustermap
=
nullptr
;
100
TrkrClusterHitAssoc
*
_cluster_hit_map
=
nullptr
;
101
TrkrHitTruthAssoc
*
_hit_truth_map
=
nullptr
;
102
PHG4TruthInfoContainer
*
_truthinfo
=
nullptr
;
103
PHG4HitContainer
*
_g4hits_tpc
=
nullptr
;
104
PHG4HitContainer
*
_g4hits_intt
=
nullptr
;
105
PHG4HitContainer
*
_g4hits_mvtx
=
nullptr
;
106
PHG4HitContainer
*
_g4hits_mms
=
nullptr
;
107
ActsGeometry
*
_tgeometry
=
nullptr
;
108
109
bool
_strict
=
false
;
110
int
_verbosity
= 0;
111
unsigned
int
_errors
= 0;
112
113
Acts::Vector3
getGlobalPosition
(
TrkrDefs::cluskey
cluster_key,
TrkrCluster
* cluster);
114
115
bool
_do_cache
=
true
;
116
std::map<TrkrDefs::cluskey, std::set<PHG4Hit*>>
_cache_all_truth_hits
;
117
std::map<TrkrDefs::cluskey, std::map<TrkrDefs::cluskey, std::shared_ptr<TrkrCluster>>>
_cache_all_truth_clusters
;
118
std::map<TrkrDefs::cluskey, PHG4Hit*>
_cache_max_truth_hit_by_energy
;
119
std::map<TrkrDefs::cluskey, std::pair<TrkrDefs::cluskey, std::shared_ptr<TrkrCluster>>>
_cache_max_truth_cluster_by_energy
;
120
std::map<TrkrDefs::cluskey, std::set<PHG4Particle*>>
_cache_all_truth_particles
;
121
std::map<TrkrDefs::cluskey, PHG4Particle*>
_cache_max_truth_particle_by_energy
;
122
std::map<TrkrDefs::cluskey, PHG4Particle*>
_cache_max_truth_particle_by_cluster_energy
;
123
std::map<PHG4Particle*, std::set<TrkrDefs::cluskey>>
_cache_all_clusters_from_particle
;
124
std::map<PHG4Hit*, std::set<TrkrDefs::cluskey>>
_cache_all_clusters_from_g4hit
;
125
std::map<PHG4Hit*, TrkrDefs::cluskey>
_cache_best_cluster_from_g4hit
;
126
std::map<std::pair<int, int>,
TrkrDefs::cluskey
>
_cache_best_cluster_from_gtrackid_layer
;
127
std::map<std::pair<TrkrDefs::cluskey, PHG4Particle*>,
float
>
_cache_get_energy_contribution_g4particle
;
128
std::map<std::pair<TrkrDefs::cluskey, PHG4Hit*>,
float
>
_cache_get_energy_contribution_g4hit
;
129
std::map<std::shared_ptr<TrkrCluster>, std::pair<TrkrDefs::cluskey, TrkrCluster*>>
_cache_reco_cluster_from_truth_cluster
;
130
131
// measured for low occupancy events, all in cm
132
const
float
sig_tpc_rphi_inner
= 220
e
-04;
133
const
float
sig_tpc_rphi_mid
= 155
e
-04;
134
const
float
sig_tpc_rphi_outer
= 165
e
-04;
135
const
float
sig_tpc_z
= 750
e
-04;
136
const
float
sig_intt_rphi
= 17
e
-04;
137
const
float
range_intt_z
= 0.9;
138
const
float
sig_mvtx_rphi
= 4.0e-04;
139
const
float
sig_mvtx_z
= 4.7e-04;
140
const
float
sig_mms_rphi_55
= 100
e
-04;
141
const
float
sig_mms_z_56
= 200
e
-04;
142
144
static
constexpr
float
_clusters_searching_window
= 0.1f;
145
std::multimap<unsigned int, innerMap>
_clusters_per_layer
;
146
// std::multimap<unsigned int, PHG4Hit*> _g4hits_per_layer;
147
};
148
149
#endif // G4EVAL_SVTXCLUSTEREVAL_H
coresoftware
blob
master
simulation
g4simulation
g4eval
SvtxClusterEval.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:14
using
1.8.2 with
sPHENIX GitHub integration