Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LHCbPR2HD
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
LHCb Core Software
LHCbPR2HD
Merge requests
!208
PrCheckerSummary handler without UT
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
PrCheckerSummary handler without UT
msaur_summary_withoutUT
into
master
Overview
1
Commits
2
Pipelines
0
Changes
1
Merged
Miroslav Saur
requested to merge
msaur_summary_withoutUT
into
master
3 years ago
Overview
1
Commits
2
Pipelines
0
Changes
1
Expand
A separate version of PrCheckerSummary handler without UT related tracks.
FYI
@sklaver
Edited
3 years ago
by
Miroslav Saur
0
0
Merge request reports
Compare
master
version 1
25c7c89f
3 years ago
master (base)
and
latest version
latest version
5f2664c3
2 commits,
3 years ago
version 1
25c7c89f
1 commit,
3 years ago
1 file
+
276
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
handlers/PrCheckerSummaryHandler_withoutUT.py
0 → 100644
+
276
−
0
Options
# Handler for summarizing the output of PrChecker2.
#
# It extracts the most interesting histograms and also
# produces efficiency histograms of reconstructed vs
# reconstructible tracks for different tracking categories.
#
# The 1D efficiencies are calculated usig TGraphAsymmErrors
# and Bayesian error bars
# Aim is to check reconstruction without UT
#
# Based on: PrCheckerSummaryhandler
# author: Miroslav Saur (miroslav.saur@cern.ch) & Suzanne Klaver (suzanne.klaver@cern.ch)
# Version:
# - 0.1 (2021/12): version of PrCheckerSummaryhandler without downstream and forward tracks
import
os
,
sys
import
argparse
import
ROOT
from
ROOT
import
gStyle
from
ROOT
import
gROOT
from
ROOT
import
TStyle
from
ROOT
import
gPad
from
.BaseHandler
import
BaseHandler
from
.gaussValidation
import
grepPattern
from
collectRunResults
import
urlopen
import
logging
import
subprocess
from
collections
import
defaultdict
def
effPlotsDict_long
():
basedict
=
{
"
Pt
"
:
{},
"
P
"
:
{},
"
Eta
"
:
{},
"
nPV
"
:
{},
"
docaz
"
:
{},
}
basedict
[
"
Pt
"
][
"
path
"
]
=
"
Track/BestLongTrackChecker/BestLong/01_long_Pt
"
basedict
[
"
P
"
][
"
path
"
]
=
"
Track/BestLongTrackChecker/BestLong/01_long_P
"
basedict
[
"
Eta
"
][
"
path
"
]
=
"
Track/BestLongTrackChecker/BestLong/01_long_Eta
"
basedict
[
"
nPV
"
][
"
path
"
]
=
"
Track/BestLongTrackChecker/BestLong/01_long_nPV
"
basedict
[
"
docaz
"
][
"
path
"
]
=
"
Track/BestLongTrackChecker/BestLong/01_long_docaz
"
basedict
[
"
Pt
"
][
"
unit
"
]
=
"
pT [MeV]
"
basedict
[
"
P
"
][
"
unit
"
]
=
"
p [MeV]
"
basedict
[
"
Eta
"
][
"
unit
"
]
=
"
#eta [-]
"
basedict
[
"
nPV
"
][
"
unit
"
]
=
"
nPV [-]
"
basedict
[
"
docaz
"
][
"
unit
"
]
=
"
docaz [mm]
"
basedict
[
"
Pt
"
][
"
unit_y
"
]
=
"
Effciency [-]
"
basedict
[
"
P
"
][
"
unit_y
"
]
=
"
Effciency [-]
"
basedict
[
"
Eta
"
][
"
unit_y
"
]
=
"
Effciency [-]
"
basedict
[
"
nPV
"
][
"
unit_y
"
]
=
"
Effciency [-]
"
basedict
[
"
docaz
"
][
"
unit_y
"
]
=
"
Effciency [-]
"
return
basedict
def
getEffPlots_long
():
return
[
"
Pt
"
,
"
P
"
,
"
Eta
"
,
"
nPV
"
,
"
docaz
"
]
def
effPlotsDict_velo
():
basedict
=
{
"
Pt
"
:
{},
"
P
"
:
{},
"
Eta
"
:
{},
"
nPV
"
:
{},
"
docaz
"
:
{},
}
basedict
[
"
Pt
"
][
"
path
"
]
=
"
Track/VeloFullTrackChecker/VeloFull/01_notElectron_Velo_Pt
"
basedict
[
"
P
"
][
"
path
"
]
=
"
Track/VeloFullTrackChecker/VeloFull/01_notElectron_Velo_P
"
basedict
[
"
Eta
"
][
"
path
"
]
=
"
Track/VeloFullTrackChecker/VeloFull/01_notElectron_Velo_Eta
"
basedict
[
"
nPV
"
][
"
path
"
]
=
"
Track/VeloFullTrackChecker/VeloFull/01_notElectron_Velo_nPV
"
basedict
[
"
docaz
"
][
"
path
"
]
=
"
Track/VeloFullTrackChecker/VeloFull/01_notElectron_Velo_docaz
"
basedict
[
"
Pt
"
][
"
unit
"
]
=
"
pT [MeV]
"
basedict
[
"
P
"
][
"
unit
"
]
=
"
p [MeV]
"
basedict
[
"
Eta
"
][
"
unit
"
]
=
"
#eta [-]
"
basedict
[
"
nPV
"
][
"
unit
"
]
=
"
nPV [-]
"
basedict
[
"
docaz
"
][
"
unit
"
]
=
"
docaz [mm]
"
basedict
[
"
Pt
"
][
"
unit_y
"
]
=
"
Effciency [-]
"
basedict
[
"
P
"
][
"
unit_y
"
]
=
"
Effciency [-]
"
basedict
[
"
Eta
"
][
"
unit_y
"
]
=
"
Effciency [-]
"
basedict
[
"
nPV
"
][
"
unit_y
"
]
=
"
Effciency [-]
"
basedict
[
"
docaz
"
][
"
unit_y
"
]
=
"
Effciency [-]
"
return
basedict
def
getEffPlots_velo
():
return
[
"
Pt
"
,
"
P
"
,
"
Eta
"
,
"
nPV
"
,
"
docaz
"
]
def
effPlotsDict_ttrack
():
basedict
=
{
"
Pt
"
:
{},
"
P
"
:
{},
"
Eta
"
:
{},
"
nPV
"
:
{},
"
docaz
"
:
{},
}
basedict
[
"
Pt
"
][
"
path
"
]
=
"
Track/SeedTrackChecker/Seed/01_hasT_Pt
"
basedict
[
"
P
"
][
"
path
"
]
=
"
Track/SeedTrackChecker/Seed/01_hasT_P
"
basedict
[
"
Eta
"
][
"
path
"
]
=
"
Track/SeedTrackChecker/Seed/01_hasT_Eta
"
basedict
[
"
nPV
"
][
"
path
"
]
=
"
Track/SeedTrackChecker/Seed/01_hasT_nPV
"
basedict
[
"
docaz
"
][
"
path
"
]
=
"
Track/SeedTrackChecker/Seed/01_hasT_docaz
"
basedict
[
"
Pt
"
][
"
unit
"
]
=
"
pT [MeV]
"
basedict
[
"
P
"
][
"
unit
"
]
=
"
p [MeV]
"
basedict
[
"
Eta
"
][
"
unit
"
]
=
"
#eta [-]
"
basedict
[
"
nPV
"
][
"
unit
"
]
=
"
nPV [-]
"
basedict
[
"
docaz
"
][
"
unit
"
]
=
"
docaz [mm]
"
basedict
[
"
Pt
"
][
"
unit_y
"
]
=
"
Effciency [-]
"
basedict
[
"
P
"
][
"
unit_y
"
]
=
"
Effciency [-]
"
basedict
[
"
Eta
"
][
"
unit_y
"
]
=
"
Effciency [-]
"
basedict
[
"
nPV
"
][
"
unit_y
"
]
=
"
Effciency [-]
"
basedict
[
"
docaz
"
][
"
unit_y
"
]
=
"
Effciency [-]
"
return
basedict
def
getEffPlots_ttrack
():
return
[
"
Pt
"
,
"
P
"
,
"
Eta
"
,
"
nPV
"
,
"
docaz
"
]
class
PrCheckerSummaryHandler
(
BaseHandler
):
def
__init__
(
self
):
super
(
self
.
__class__
,
self
).
__init__
()
def
collectResultsExt
(
self
,
directory
,
project
,
version
,
platform
,
hostname
,
cpu_info
,
memoryinfo
,
startTime
,
endTime
,
options
):
logfile
=
os
.
path
.
join
(
directory
,
'
run.log
'
)
rootfile
=
grepPattern
(
'
INFO Writing ROOT histograms to: (\S+)
'
,
open
(
logfile
,
'
r
'
,
encoding
=
'
ISO-8859-1
'
).
read
())
inputfile
=
ROOT
.
TFile
.
Open
(
os
.
path
.
join
(
directory
,
rootfile
),
'
read
'
)
outputfile
=
ROOT
.
TFile
(
"
PrCheckerSummary.root
"
,
"
recreate
"
)
from
.utils.LHCbStyle
import
setLHCbStyle
from
.utils.Legend
import
place_legend
setLHCbStyle
()
latex
=
ROOT
.
TLatex
()
latex
.
SetNDC
()
latex
.
SetTextSize
(
0.03
)
outputfile
.
mkdir
(
'
long
'
)
outputfile
.
mkdir
(
'
velo
'
)
outputfile
.
mkdir
(
'
ttrack
'
)
effPlots_long
=
getEffPlots_long
()
eff_dict_long
=
effPlotsDict_long
()
effPlots_velo
=
getEffPlots_velo
()
eff_dict_velo
=
effPlotsDict_velo
()
effPlots_ttrack
=
getEffPlots_ttrack
()
eff_dict_ttrack
=
effPlotsDict_ttrack
()
for
effPlot
in
effPlots_long
:
outputfile
.
cd
(
"
long
"
)
effNom
=
inputfile
.
Get
(
eff_dict_long
[
effPlot
][
"
path
"
]
+
"
_reconstructed
"
)
effDenom
=
inputfile
.
Get
(
eff_dict_long
[
effPlot
][
"
path
"
]
+
"
_reconstructible
"
)
canvas_eff
=
ROOT
.
TCanvas
(
effPlot
,
effPlot
)
efficiency
=
ROOT
.
TGraphAsymmErrors
()
efficiency
.
SetName
(
effPlot
+
"
_tracking_efficiency
"
)
efficiency
.
Divide
(
effNom
,
effDenom
,
"
w
"
)
efficiency
.
SetMarkerSize
(
0.5
)
efficiency
.
SetLineWidth
(
1
)
efficiency
.
SetMarkerColor
(
ROOT
.
kBlack
)
efficiency
.
SetMarkerStyle
(
5
)
efficiency
.
GetXaxis
().
SetLabelFont
(
132
)
efficiency
.
GetXaxis
().
SetLabelSize
(
0.04
)
efficiency
.
GetXaxis
().
SetTitleFont
(
132
)
efficiency
.
GetXaxis
().
SetTitleSize
(
0.06
)
efficiency
.
GetXaxis
().
SetTitleOffset
(
0.8
)
efficiency
.
GetYaxis
().
SetLabelFont
(
132
)
efficiency
.
GetYaxis
().
SetLabelSize
(
0.04
)
efficiency
.
GetYaxis
().
SetTitleFont
(
132
)
efficiency
.
GetYaxis
().
SetTitleSize
(
0.06
)
efficiency
.
GetYaxis
().
SetDecimals
()
efficiency
.
GetYaxis
().
SetTitleOffset
(
0.7
)
efficiency
.
GetXaxis
().
SetTitle
(
eff_dict_long
[
effPlot
][
"
unit
"
])
efficiency
.
GetYaxis
().
SetTitle
(
eff_dict_long
[
effPlot
][
"
unit_y
"
])
efficiency
.
SetTitle
(
"
{path} reconstructed / reconstructible
"
.
format
(
path
=
eff_dict_long
[
effPlot
][
"
path
"
]))
efficiency
.
Draw
(
"
AP
"
)
efficiency
.
Write
(
effPlot
+
"
_tgraph
"
)
canvas_eff
.
Write
(
effPlot
+
"
_canvas
"
)
for
effPlot
in
effPlots_velo
:
outputfile
.
cd
(
"
velo
"
)
effNom
=
inputfile
.
Get
(
eff_dict_velo
[
effPlot
][
"
path
"
]
+
"
_reconstructed
"
)
effDenom
=
inputfile
.
Get
(
eff_dict_velo
[
effPlot
][
"
path
"
]
+
"
_reconstructible
"
)
canvas_eff
=
ROOT
.
TCanvas
(
effPlot
,
effPlot
)
efficiency
=
ROOT
.
TGraphAsymmErrors
()
efficiency
.
SetName
(
effPlot
+
"
_tracking_efficiency
"
)
efficiency
.
Divide
(
effNom
,
effDenom
,
"
w
"
)
efficiency
.
SetMarkerSize
(
0.5
)
efficiency
.
SetLineWidth
(
1
)
efficiency
.
SetMarkerColor
(
ROOT
.
kBlack
)
efficiency
.
SetMarkerStyle
(
5
)
efficiency
.
GetXaxis
().
SetLabelFont
(
132
)
efficiency
.
GetXaxis
().
SetLabelSize
(
0.04
)
efficiency
.
GetXaxis
().
SetTitleFont
(
132
)
efficiency
.
GetXaxis
().
SetTitleSize
(
0.06
)
efficiency
.
GetXaxis
().
SetTitleOffset
(
0.8
)
efficiency
.
GetYaxis
().
SetLabelFont
(
132
)
efficiency
.
GetYaxis
().
SetLabelSize
(
0.04
)
efficiency
.
GetYaxis
().
SetTitleFont
(
132
)
efficiency
.
GetYaxis
().
SetTitleSize
(
0.06
)
efficiency
.
GetYaxis
().
SetDecimals
()
efficiency
.
GetYaxis
().
SetTitleOffset
(
0.7
)
efficiency
.
GetXaxis
().
SetTitle
(
eff_dict_velo
[
effPlot
][
"
unit
"
])
efficiency
.
GetYaxis
().
SetTitle
(
eff_dict_velo
[
effPlot
][
"
unit_y
"
])
efficiency
.
SetTitle
(
"
{path} reconstructed / reconstructible
"
.
format
(
path
=
eff_dict_velo
[
effPlot
][
"
path
"
]))
efficiency
.
Draw
(
"
AP
"
)
efficiency
.
Write
(
effPlot
+
"
_tgraph
"
)
canvas_eff
.
Write
(
effPlot
+
"
_canvas
"
)
for
effPlot
in
effPlots_ttrack
:
outputfile
.
cd
(
"
ttrack
"
)
effNom
=
inputfile
.
Get
(
eff_dict_ttrack
[
effPlot
][
"
path
"
]
+
"
_reconstructed
"
)
effDenom
=
inputfile
.
Get
(
eff_dict_ttrack
[
effPlot
][
"
path
"
]
+
"
_reconstructible
"
)
canvas_eff
=
ROOT
.
TCanvas
(
effPlot
,
effPlot
)
efficiency
=
ROOT
.
TGraphAsymmErrors
()
efficiency
.
SetName
(
effPlot
+
"
_tracking_efficiency
"
)
efficiency
.
Divide
(
effNom
,
effDenom
,
"
w
"
)
efficiency
.
SetMarkerSize
(
0.5
)
efficiency
.
SetLineWidth
(
1
)
efficiency
.
SetMarkerColor
(
ROOT
.
kBlack
)
efficiency
.
SetMarkerStyle
(
5
)
efficiency
.
GetXaxis
().
SetLabelFont
(
132
)
efficiency
.
GetXaxis
().
SetLabelSize
(
0.04
)
efficiency
.
GetXaxis
().
SetTitleFont
(
132
)
efficiency
.
GetXaxis
().
SetTitleSize
(
0.06
)
efficiency
.
GetXaxis
().
SetTitleOffset
(
0.8
)
efficiency
.
GetYaxis
().
SetLabelFont
(
132
)
efficiency
.
GetYaxis
().
SetLabelSize
(
0.04
)
efficiency
.
GetYaxis
().
SetTitleFont
(
132
)
efficiency
.
GetYaxis
().
SetTitleSize
(
0.06
)
efficiency
.
GetYaxis
().
SetDecimals
()
efficiency
.
GetYaxis
().
SetTitleOffset
(
0.7
)
efficiency
.
GetXaxis
().
SetTitle
(
eff_dict_ttrack
[
effPlot
][
"
unit
"
])
efficiency
.
GetYaxis
().
SetTitle
(
eff_dict_ttrack
[
effPlot
][
"
unit_y
"
])
efficiency
.
SetTitle
(
"
{path} reconstructed / reconstructible
"
.
format
(
path
=
eff_dict_ttrack
[
effPlot
][
"
path
"
]))
efficiency
.
Draw
(
"
AP
"
)
efficiency
.
Write
(
effPlot
+
"
_tgraph
"
)
canvas_eff
.
Write
(
effPlot
+
"
_canvas
"
)
outputfile
.
Write
()
outputfile
.
Close
()
inputfile
.
Close
()
self
.
saveFile
(
'
PrCheckerSummary
'
,
'
PrCheckerSummary.root
'
)
Loading