Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
reconstruction_benchmarks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
EIC
benchmarks
reconstruction_benchmarks
Merge requests
!268
chore: black on ecal options before merge into vgawas branch
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
chore: black on ecal options before merge into vgawas branch
black-ecal-options
into
master
Overview
0
Commits
1
Pipelines
0
Changes
3
Merged
Wouter Deconinck
requested to merge
black-ecal-options
into
master
2 years ago
Overview
0
Commits
1
Pipelines
0
Changes
3
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
fd33b147
1 commit,
2 years ago
3 files
+
216
−
160
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
benchmarks/ecal/options/barrel.py
+
74
−
53
Options
'''
"""
An example script to digitize/reconstruct/clustering endcap ecal hits
'''
"""
from
Gaudi.Configuration
import
*
import
json
import
os
@@ -13,23 +13,30 @@ detector_name = str(os.environ.get("DETECTOR", "epic"))
detector_config
=
str
(
os
.
environ
.
get
(
"
DETECTOR_CONFIG
"
,
detector_name
))
detector_version
=
str
(
os
.
environ
.
get
(
"
DETECTOR_VERSION
"
,
"
main
"
))
detector_path
=
str
(
os
.
environ
.
get
(
"
DETECTOR_PATH
"
,
"
.
"
))
compact_path
=
str
(
os
.
environ
.
get
(
"
JUGGLER_COMPACT_PATH
"
,
"
{}.xml
"
.
format
(
os
.
path
.
join
(
detector_path
,
detector_name
))))
compact_path
=
str
(
os
.
environ
.
get
(
"
JUGGLER_COMPACT_PATH
"
,
"
{}.xml
"
.
format
(
os
.
path
.
join
(
detector_path
,
detector_name
)),
)
)
# Detector features that affect reconstruction
has_ecal_barrel_scfi
=
False
if
'
epic
'
in
detector_name
and
'
imaging
'
in
detector_config
:
if
"
epic
"
in
detector_name
and
"
imaging
"
in
detector_config
:
has_ecal_barrel_scfi
=
True
# input and output
input_sims
=
[
f
.
strip
()
for
f
in
str
.
split
(
os
.
environ
[
"
JUGGLER_SIM_FILE
"
],
"
,
"
)
if
f
.
strip
()]
input_sims
=
[
f
.
strip
()
for
f
in
str
.
split
(
os
.
environ
[
"
JUGGLER_SIM_FILE
"
],
"
,
"
)
if
f
.
strip
()
]
output_rec
=
str
(
os
.
environ
[
"
JUGGLER_REC_FILE
"
])
n_events
=
int
(
os
.
environ
[
"
JUGGLER_N_EVENTS
"
])
# input arguments from calibration file
with
open
(
f
'
{
detector_path
}
/calibrations/emcal_barrel_calibration.json
'
)
as
f
:
calib_data
=
json
.
load
(
f
)[
'
electron
'
]
with
open
(
f
"
{
detector_path
}
/calibrations/emcal_barrel_calibration.json
"
)
as
f
:
calib_data
=
json
.
load
(
f
)[
"
electron
"
]
cb_ecal_sf
=
float
(
calib_data
[
'
sampling_fraction_img
'
])
cb_ecal_sf
=
float
(
calib_data
[
"
sampling_fraction_img
"
])
# geometry service
geo_service
=
GeoSvc
(
"
GeoSvc
"
,
detectors
=
[
compact_path
],
OutputLevel
=
INFO
)
@@ -65,96 +72,110 @@ algorithms.append(podout)
if
has_ecal_barrel_scfi
:
# Central Barrel Ecal (Imaging Cal.)
cb_ecal_daq
=
dict
(
dynamicRangeADC
=
3
*
MeV
,
capacityADC
=
8192
,
pedestalMean
=
400
,
pedestalSigma
=
20
)
# about 6 keV
dynamicRangeADC
=
3
*
MeV
,
capacityADC
=
8192
,
pedestalMean
=
400
,
pedestalSigma
=
20
)
# about 6 keV
cb_ecal_digi
=
CalHitDigi
(
"
cb_ecal_digi
"
,
cb_ecal_digi
=
CalHitDigi
(
"
cb_ecal_digi
"
,
inputHitCollection
=
"
EcalBarrelHits
"
,
outputHitCollection
=
"
EcalBarrelImagingHitsDigi
"
,
energyResolutions
=
[
0.
,
0.02
,
0.
],
# 2% flat resolution
**
cb_ecal_daq
)
energyResolutions
=
[
0.0
,
0.02
,
0.0
],
# 2% flat resolution
**
cb_ecal_daq
,
)
algorithms
.
append
(
cb_ecal_digi
)
cb_ecal_reco
=
ImCalPixelReco
(
"
cb_ecal_reco
"
,
cb_ecal_reco
=
ImCalPixelReco
(
"
cb_ecal_reco
"
,
inputHitCollection
=
cb_ecal_digi
.
outputHitCollection
,
outputHitCollection
=
"
EcalBarrelImagingHitsReco
"
,
samplingFraction
=
cb_ecal_sf
,
thresholdFactor
=
3
,
# about 20 keV
readoutClass
=
"
EcalBarrelHits
"
,
# readout class
layerField
=
"
layer
"
,
# field to get layer id
sectorField
=
"
module
"
,
# field to get sector id
**
cb_ecal_daq
)
layerField
=
"
layer
"
,
# field to get layer id
sectorField
=
"
module
"
,
# field to get sector id
**
cb_ecal_daq
,
)
algorithms
.
append
(
cb_ecal_reco
)
cb_ecal_cl
=
ImagingCluster
(
"
cb_ecal_cl
"
,
cb_ecal_cl
=
ImagingCluster
(
"
cb_ecal_cl
"
,
inputHitCollection
=
cb_ecal_reco
.
outputHitCollection
,
outputProtoClusterCollection
=
"
EcalBarrelImagingProtoClusters
"
,
localDistXY
=
[
2.
*
mm
,
2
*
mm
],
# same layer
layerDistEtaPhi
=
[
10
*
mrad
,
10
*
mrad
],
# adjacent layer
neighbourLayersRange
=
2
,
# id diff for adjacent layer
sectorDist
=
3.
*
cm
)
# different sector
localDistXY
=
[
2.0
*
mm
,
2
*
mm
],
# same layer
layerDistEtaPhi
=
[
10
*
mrad
,
10
*
mrad
],
# adjacent layer
neighbourLayersRange
=
2
,
# id diff for adjacent layer
sectorDist
=
3.0
*
cm
,
)
# different sector
algorithms
.
append
(
cb_ecal_cl
)
cb_ecal_clreco
=
ImagingClusterReco
(
"
cb_ecal_clreco
"
,
cb_ecal_clreco
=
ImagingClusterReco
(
"
cb_ecal_clreco
"
,
inputProtoClusters
=
cb_ecal_cl
.
outputProtoClusterCollection
,
outputClusters
=
"
EcalBarrelImagingClusters
"
,
outputLayers
=
"
EcalBarrelImagingLayers
"
,
mcHits
=
"
EcalBarrelHits
"
)
mcHits
=
"
EcalBarrelHits
"
,
)
algorithms
.
append
(
cb_ecal_clreco
)
else
:
# SciGlass calorimeter
sciglass_ecal_daq
=
dict
(
dynamicRangeADC
=
5.
*
GeV
,
capacityADC
=
32768
,
pedestalMean
=
400
,
pedestalSigma
=
3
)
dynamicRangeADC
=
5.0
*
GeV
,
capacityADC
=
32768
,
pedestalMean
=
400
,
pedestalSigma
=
3
)
sciglass_ecal_digi
=
CalHitDigi
(
"
sciglass_ecal_digi
"
,
sciglass_ecal_digi
=
CalHitDigi
(
"
sciglass_ecal_digi
"
,
inputHitCollection
=
"
EcalBarrelHits
"
,
outputHitCollection
=
"
EcalBarrelHitsDigi
"
,
energyResolutions
=
[
0.
,
0.02
,
0.
],
# 2% flat resolution
**
sciglass_ecal_daq
)
energyResolutions
=
[
0.0
,
0.02
,
0.0
],
# 2% flat resolution
**
sciglass_ecal_daq
,
)
algorithms
.
append
(
sciglass_ecal_digi
)
sciglass_ecal_reco
=
CalHitReco
(
"
sciglass_ecal_reco
"
,
sciglass_ecal_reco
=
CalHitReco
(
"
sciglass_ecal_reco
"
,
inputHitCollection
=
sciglass_ecal_digi
.
outputHitCollection
,
outputHitCollection
=
"
EcalBarrelHitsReco
"
,
thresholdFactor
=
3
,
# about 20 keV
readoutClass
=
"
EcalBarrelHits
"
,
# readout class
sectorField
=
"
sector
"
,
# field to get sector id
samplingFraction
=
0.998
,
# this accounts for a small fraction of leakage
**
sciglass_ecal_daq
)
sectorField
=
"
sector
"
,
# field to get sector id
samplingFraction
=
0.998
,
# this accounts for a small fraction of leakage
**
sciglass_ecal_daq
,
)
algorithms
.
append
(
sciglass_ecal_reco
)
sciglass_ecal_cl
=
IslandCluster
(
"
sciglass_ecal_cl
"
,
sciglass_ecal_cl
=
IslandCluster
(
"
sciglass_ecal_cl
"
,
inputHitCollection
=
sciglass_ecal_reco
.
outputHitCollection
,
outputProtoClusterCollection
=
"
EcalBarrelProtoClusters
"
,
splitCluster
=
False
,
minClusterHitEdep
=
1.0
*
MeV
,
# discard low energy hits
minClusterCenterEdep
=
30
*
MeV
,
sectorDist
=
5.0
*
cm
)
minClusterHitEdep
=
1.0
*
MeV
,
# discard low energy hits
minClusterCenterEdep
=
30
*
MeV
,
sectorDist
=
5.0
*
cm
,
)
algorithms
.
append
(
sciglass_ecal_cl
)
sciglass_ecal_clreco
=
ImagingClusterReco
(
"
sciglass_ecal_clreco
"
,
sciglass_ecal_clreco
=
ImagingClusterReco
(
"
sciglass_ecal_clreco
"
,
inputProtoClusters
=
sciglass_ecal_cl
.
outputProtoClusterCollection
,
mcHits
=
"
EcalBarrelHits
"
,
outputClusters
=
"
EcalBarrelClusters
"
,
outputLayers
=
"
EcalBarrelLayers
"
)
outputLayers
=
"
EcalBarrelLayers
"
,
)
algorithms
.
append
(
sciglass_ecal_clreco
)
podout
.
outputCommands
=
[
'
drop *
'
,
'
keep MCParticles
'
,
'
keep *HitsReco
'
,
'
keep *HitsDigi
'
,
'
keep *Cluster*
'
]
podout
.
outputCommands
=
[
"
drop *
"
,
"
keep MCParticles
"
,
"
keep *HitsReco
"
,
"
keep *HitsDigi
"
,
"
keep *Cluster*
"
,
]
ApplicationMgr
(
TopAlg
=
algorithms
,
EvtSel
=
'
NONE
'
,
EvtMax
=
n_events
,
ExtSvc
=
[
podioevent
],
OutputLevel
=
DEBUG
TopAlg
=
algorithms
,
EvtSel
=
"
NONE
"
,
EvtMax
=
n_events
,
ExtSvc
=
[
podioevent
],
OutputLevel
=
DEBUG
,
)
Loading