Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
calypso
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Savannah Rose Shively
calypso
Commits
647b386d
Commit
647b386d
authored
2 years ago
by
Savannah Rose Shively
Browse files
Options
Downloads
Patches
Plain Diff
finding counts?
parent
a6db2db9
No related branches found
No related tags found
No related merge requests found
Pipeline
#5024222
passed
2 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Tracker/TrackerRecAlgs/PairVertex/scripts/PairVertexReader.py
+16
-4
16 additions, 4 deletions
...ker/TrackerRecAlgs/PairVertex/scripts/PairVertexReader.py
Tracker/TrackerRecAlgs/PairVertex/src/PairVertexAlg.cxx
+14
-10
14 additions, 10 deletions
Tracker/TrackerRecAlgs/PairVertex/src/PairVertexAlg.cxx
with
30 additions
and
14 deletions
Tracker/TrackerRecAlgs/PairVertex/scripts/PairVertexReader.py
+
16
−
4
View file @
647b386d
...
...
@@ -140,9 +140,13 @@ def VertexZCompare(event):
def
ClusterLocation
(
event
):
starr
=
[]
for
loc
in
event
.
clusterLocation
:
starr
+=
[
int
(
str
(
loc
).
split
()[
0
])]
if
event
.
clusterIsDaughter
:
starr
+=
[
int
(
str
(
loc
).
split
()[
0
])]
return
starr
def
ClusterLocation2
(
event
):
for
loc
in
event
.
clusterLocation
:
print
(
loc
)
def
MakeCompareArray
(
event
,
getvaluelambda
,
filters
):
val
=
getvaluelambda
(
event
)
countarr
=
[
0
for
i
in
range
(
len
(
filters
))]
...
...
@@ -317,10 +321,17 @@ MainArrDict={
'
array
'
:[],
'
lambda
'
:
ClusterLocation
,
'
plotterfunc
'
:
configBasicHist
,
'
plotkwargs
'
:{
'
bins
'
:
5
,
'
kwargs
'
:{
'
range
'
:[
0
,
5
]}},
'
plotkwargs
'
:{},
#'bins':5,'kwargs':{'range':[0,5]}
},
'
NumClusters
'
:{
'
array
'
:[],
'
lambda
'
:
lambda
event
:
len
(
event
.
clusterLocation
),
'
plotterfunc
'
:
configBasicHist
,
'
plotkwargs
'
:{},
},
}
#energy deposited hist
#frac of energy deposited hist
#
...
...
@@ -328,7 +339,7 @@ MainArrDict={
TestArrDict
=
dict
()
testname
=
'
DPDecayVertexZ_Compare
'
#Any key from MainArrDict
testname
=
'
AllClusterLocations
'
#Any key from MainArrDict
TestArrDict
[
testname
]
=
MainArrDict
[
testname
]
# for k in MainArrDict.keys():
# if 'Check' in k:
...
...
@@ -338,6 +349,7 @@ def GeneralPlotter(arrDict,dcuts=[],lcuts=[],showplot=True,savefig=False):
nans
=
0
for
event
in
t
:
#ClusterLocation2(event)
if
ApplyAllCuts
(
event
,
dcuts
,
lcuts
):
for
name
in
arrDict
.
keys
():
value
=
nan
...
...
@@ -381,7 +393,7 @@ def GeneralPlotter(arrDict,dcuts=[],lcuts=[],showplot=True,savefig=False):
#EXECUTE
if
__name__
==
"
__main__
"
:
DP_fnames
=
[
'
Ntuple_Aee_10MeV_1Em
4
_
'
]
# Ntuple_Aee_10MeV_1Em5_ Ntuple_A
ee_100
MeV_
1
Em
5
_ Ntuple_A
mm_316
MeV_
2
Em
6
_
DP_fnames
=
[
'
Ntuple_Aee_10
0
MeV_1Em
5
_
'
]
# Ntuple_Aee_10MeV_1Em5_
Ntuple_A
mm_316
MeV_
2
Em
6
_ Ntuple_A
ee_10
MeV_
1
Em
4
_
for
f
in
DP_fnames
:
user_input
=
f
t
=
TChain
(
"
events
"
)
...
...
This diff is collapsed.
Click to expand it.
Tracker/TrackerRecAlgs/PairVertex/src/PairVertexAlg.cxx
+
14
−
10
View file @
647b386d
...
...
@@ -443,6 +443,7 @@ StatusCode PairVertexAlg::execute(const EventContext &ctx) const
ATH_CHECK
(
clusterContainer
.
isValid
());
ATH_CHECK
(
h_collectionMap
.
isValid
());
int
clustercount
=
0
;
std
::
vector
<
Identifier
>
clustersSofar
;
//loop over all clusters
if
(
clusterContainer
->
size
()
>
0
)
...
...
@@ -450,11 +451,13 @@ StatusCode PairVertexAlg::execute(const EventContext &ctx) const
for
(
auto
collection
:
*
clusterContainer
)
//
{
Identifier
id
=
collection
->
identify
();
int
station
=
m_idHelper
->
station
(
id
);
int
clustercollection
station
=
m_idHelper
->
station
(
id
);
for
(
auto
cluster
:
*
collection
)
{
Identifier
clusterID
=
cluster
->
identify
();
if
(
std
::
any_of
(
std
::
begin
(
clustersSofar
),
std
::
end
(
clustersSofar
),
[
&
](
Identifier
i
){
return
i
==
clusterID
;})){
continue
;}
clustersSofar
.
push_back
(
clusterID
);
auto
clusterRDOList
=
cluster
->
rdoList
();
float
TotalEnergyDeposited
=
0
;
float
TotalEnergyDeposited_daughterPos
=
0
;
...
...
@@ -472,13 +475,14 @@ StatusCode PairVertexAlg::execute(const EventContext &ctx) const
const
auto
&
simdata
=
h_collectionMap
->
find
(
rdoID
)
->
second
;
const
auto
&
deposits
=
simdata
.
getdeposits
();
int
barcode
=
0
;
int
pdgID
=
0
;
float
edeposit
=
0
;
HepMcParticleLink
primary
{};
for
(
const
auto
&
depositPair
:
deposits
)
{
barcode
=
depositPair
.
first
->
barcode
();
int
pdgID
=
depositPair
.
first
->
pdg_id
();
float
edeposit
=
depositPair
.
second
;
pdgID
=
depositPair
.
first
->
pdg_id
();
edeposit
=
depositPair
.
second
;
TotalEnergyDeposited
+=
edeposit
;
//sum all deposited energies in RDO for each cluster
...
...
@@ -488,10 +492,10 @@ StatusCode PairVertexAlg::execute(const EventContext &ctx) const
if
(
pdgID
>
0
){
TotalEnergyDeposited_daughterNeg
+=
edeposit
;}
if
(
pdgID
<
0
){
TotalEnergyDeposited_daughterPos
+=
edeposit
;}
}
}
}
}
}
//End DepositPair loop
}
//End CollectionMap if
}
//End RDO loop
m_clusterETotPos
.
push_back
(
TotalEnergyDeposited_daughterPos
);
m_clusterETotNeg
.
push_back
(
TotalEnergyDeposited_daughterNeg
);
m_clusterETot
.
push_back
(
TotalEnergyDeposited
);
...
...
@@ -511,8 +515,8 @@ StatusCode PairVertexAlg::execute(const EventContext &ctx) const
}
m_clusterCount
=
clustercount
;
}
}
}
//end loop iterating over clusters
}
//end loop iterating over cluster collections
m_tree
->
Fill
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment