Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review 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
atlas
athena
Merge requests
!71349
Revive the Muon effi SF tester macro
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Revive the Muon effi SF tester macro
jojungge/athena:SagarNeedsToBeHappy
into
main
Overview
13
Commits
7
Pipelines
0
Changes
2
All threads resolved!
Hide all comments
Merged
Johannes Junggeburth
requested to merge
jojungge/athena:SagarNeedsToBeHappy
into
main
10 months ago
Overview
13
Commits
7
Pipelines
0
Changes
2
All threads resolved!
Hide all comments
Expand
Revive the tester macro to compare the scale-factors per muon in different recommendation releases. Macro is now based on the MuonTesterTree package.
Delete obsolete tester algorithms
Introduce a CA config
Tagging
@sagara17
,
@goblirsc
,
@sagar
,
@vaustrup
,
@gproto
Edited
10 months ago
by
Johannes Junggeburth
1
0
Merge request reports
Viewing commit
e5d9fc28
Prev
Next
Show latest version
2 files
+
86
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
e5d9fc28
Add CA config
· e5d9fc28
Johannes Junggeburth
authored
10 months ago
PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/python/MuonEfficiencyCorrectionsCfg.py
0 → 100644
+
83
−
0
Options
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
from
AthenaConfiguration.ComponentFactory
import
CompFactory
def
MuonScaleFactorTestAlgCfg
(
flags
,
name
=
"
MuonScaleFactorTestAlg
"
,
**
kwargs
):
result
=
ComponentAccumulator
()
from
MuonSelectorTools.MuonSelectorToolsConfig
import
MuonSelectionToolCfg
kwargs
.
setdefault
(
"
MuonSelectionTool
"
,
result
.
popToolsAndMerge
(
MuonSelectionToolCfg
(
flags
)))
the_alg
=
CompFactory
.
CP
.
MuonScaleFactorTestAlg
(
name
,
**
kwargs
)
result
.
addEventAlgo
(
the_alg
,
primary
=
True
)
return
result
def
MuonEfficiencyCorrectionsCfg
(
flags
,
name
=
"
MuonEffiCorrections
"
,
**
kwargs
):
result
=
ComponentAccumulator
()
kwargs
.
setdefault
(
"
ApplyKinematicSystematic
"
,
False
)
eff_tool
=
CompFactory
.
CP
.
MuonEfficiencyScaleFactors
(
name
,
**
kwargs
)
result
.
setPrivateTools
(
eff_tool
)
return
result
def
setupHistSvcCfg
(
flags
,
out_file
=
"
EffTester.root
"
):
result
=
ComponentAccumulator
()
if
len
(
out_file
)
==
0
:
return
result
histSvc
=
CompFactory
.
THistSvc
(
Output
=
[
"
MUONEFFTESTER DATAFILE=
'
{out_file}
'
, OPT=
'
RECREATE
'"
.
format
(
out_file
=
out_file
)])
result
.
addService
(
histSvc
,
primary
=
True
)
return
result
def
setupArgParser
():
from
argparse
import
ArgumentParser
parser
=
ArgumentParser
()
parser
.
add_argument
(
"
--threads
"
,
type
=
int
,
help
=
"
number of threads
"
,
default
=
1
)
parser
.
add_argument
(
"
--inputFile
"
,
"
-i
"
,
default
=
[
"
/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc20_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.recon.AOD.e3601_s3681_r13167/AOD.27312826._000061.pool.root.1
"
],
help
=
"
Input file to run on
"
,
nargs
=
"
+
"
)
parser
.
add_argument
(
"
--outRootFile
"
,
default
=
"
EffiDump.root
"
,
help
=
"
Output ROOT file to dump the geomerty
"
)
parser
.
add_argument
(
"
--maxEvents
"
,
type
=
int
,
help
=
"
Maximum events to run on
"
,
default
=
-
1
)
return
parser
if
__name__
==
"
__main__
"
:
from
AthenaConfiguration.AllConfigFlags
import
initConfigFlags
args
=
setupArgParser
().
parse_args
()
flags
=
initConfigFlags
()
flags
.
Concurrency
.
NumThreads
=
args
.
threads
flags
.
Concurrency
.
NumConcurrentEvents
=
args
.
threads
# Might change this later, but good enough for the moment.
flags
.
Input
.
Files
=
args
.
inputFile
flags
.
Scheduler
.
ShowDataDeps
=
True
flags
.
Scheduler
.
ShowDataFlow
=
True
flags
.
lock
()
flags
.
dump
(
evaluate
=
True
)
from
AthenaConfiguration.MainServicesConfig
import
MainServicesCfg
cfg
=
MainServicesCfg
(
flags
)
### Setup the file reading
from
AthenaConfiguration.Enums
import
Format
if
flags
.
Input
.
Format
==
Format
.
POOL
:
from
AthenaPoolCnvSvc.PoolReadConfig
import
PoolReadCfg
cfg
.
merge
(
PoolReadCfg
(
flags
))
cfg
.
merge
(
setupHistSvcCfg
(
flags
,
out_file
=
args
.
outRootFile
))
cfg
.
merge
(
MuonScaleFactorTestAlgCfg
(
flags
))
cfg
.
printConfig
(
withDetails
=
True
,
summariseProps
=
True
)
sc
=
cfg
.
run
(
args
.
maxEvents
)
if
not
sc
.
isSuccess
():
import
sys
sys
.
exit
(
"
Execution failed
"
)
Loading