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
ClusHitsVerbosev1.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file ClusHitsVerbosev1.cc
1
#include "
ClusHitsVerbosev1.h
"
2
3
#include <algorithm>
4
#include <iostream>
5
#include <
phool/phool.h
>
6
7
using
std::endl;
8
using
std::cout;
9
10
namespace
11
{
12
ClusHitsVerbose::Vector
dummy_vec;
13
ClusHitsVerbose::PairVector
dummy_pairvec;
14
}
15
16
void
ClusHitsVerbosev1::Reset
()
17
{
18
m_data
.clear();
19
m_stage_phi
.clear();
20
m_stage_z
.clear();
21
m_stage_phiCut
.clear();
22
m_stage_zCut
.clear();
23
}
24
25
bool
ClusHitsVerbosev1::hasClusKey
(
TrkrDefs::cluskey
key)
const
{
26
return
m_data
.find(key) !=
m_data
.end();
27
}
28
29
ClusHitsVerbose::Vector
&
ClusHitsVerbosev1::vecBins
(
TrkrDefs::cluskey
key,
int
which) {
30
if
(!
hasClusKey
(key))
return
dummy_vec;
31
else
return
m_data
[key][which];
32
}
33
34
ClusHitsVerbose::Vector
&
ClusHitsVerbosev1::phiBins
(
TrkrDefs::cluskey
key)
35
{
return
vecBins
(key, 0); }
36
37
ClusHitsVerbose::Vector
&
ClusHitsVerbosev1::zBins
(
TrkrDefs::cluskey
key)
38
{
return
vecBins
(key, 1); }
39
40
ClusHitsVerbose::Vector
&
ClusHitsVerbosev1::phiCutBins
(
TrkrDefs::cluskey
key)
41
{
return
vecBins
(key, 2); }
42
43
ClusHitsVerbose::Vector
&
ClusHitsVerbosev1::zCutBins
(
TrkrDefs::cluskey
key)
44
{
return
vecBins
(key, 3); }
45
46
ClusHitsVerbose::PairVector
ClusHitsVerbosev1::pvecIE
(
TrkrDefs::cluskey
key,
int
which)
47
{
48
if
(!
hasClusKey
(key))
return
dummy_pairvec;
49
50
// unzip the vector<pair<int,int>> into two vectors: vector<int> vector<int>
51
std::vector<int> vecI{};
52
std::vector<int> vecE {};
53
for
(
auto
&
entry
:
m_data
[key][which]) {
54
vecI.push_back(
entry
.first);
55
vecE.push_back(
entry
.second);
56
}
57
return
{vecI, vecE};
58
}
59
60
ClusHitsVerbose::PairVector
ClusHitsVerbosev1::phiBins_pvecIE
(
TrkrDefs::cluskey
key)
61
{
return
pvecIE
(key, 0); }
62
63
ClusHitsVerbose::PairVector
ClusHitsVerbosev1::zBins_pvecIE
(
TrkrDefs::cluskey
key)
64
{
return
pvecIE
(key, 1); }
65
66
ClusHitsVerbose::PairVector
ClusHitsVerbosev1::phiCutBins_pvecIE
(
TrkrDefs::cluskey
key)
67
{
return
pvecIE
(key, 2); }
68
69
ClusHitsVerbose::PairVector
ClusHitsVerbosev1::zCutBins_pvecIE
(
TrkrDefs::cluskey
key)
70
{
return
pvecIE
(key, 3); }
71
72
void
ClusHitsVerbosev1::push_hits
(
TrkrDefs::cluskey
key) {
73
m_data
[key] = {
m_stage_phi
,
m_stage_z
,
m_stage_phiCut
,
m_stage_zCut
};
74
m_stage_phi
.clear();
75
m_stage_z
.clear();
76
m_stage_phiCut
.clear();
77
m_stage_zCut
.clear();
78
}
coresoftware
blob
master
offline
packages
trackbase
ClusHitsVerbosev1.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:08
using
1.8.2 with
sPHENIX GitHub integration