Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena_MET
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
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
Alberto Plebani
athena_MET
Commits
4c6e7695
Commit
4c6e7695
authored
1 year ago
by
Walter Lampl
Committed by
Melissa Yexley
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
auto-config BField flags based on DCS database
parent
db4f9f70
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MagneticField/MagFieldConfig/python/BFieldConfigFlags.py
+31
-6
31 additions, 6 deletions
MagneticField/MagFieldConfig/python/BFieldConfigFlags.py
with
31 additions
and
6 deletions
MagneticField/MagFieldConfig/python/BFieldConfigFlags.py
+
31
−
6
View file @
4c6e7695
# Copyright (C) 2002-202
0
CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-202
4
CERN for the benefit of the ATLAS collaboration
from
AthenaConfiguration.AthConfigFlags
import
AthConfigFlags
from
CoolConvUtilities.MagFieldUtils
import
getFieldForRun
#So far no attempt to auto-config field for MC or online-running
#
#The old-style config did auto-config the field for online based on IS
#(see https://gitlab.cern.ch/atlas/athena/-/blame/1802605a4ab69cab7ee3e53d75f162c7da99a944/Reconstruction/RecExample/RecExOnline/python/OnlineISConfiguration.py#L52)
#
#The old-sytle config tried to auto-config the field based on in-file metadata, falling back to Geometry and Conditions tags. See
#(see https://gitlab.cern.ch/atlas/athena/-/blame/1802605a4ab69cab7ee3e53d75f162c7da99a944/Reconstruction/RecExample/RecExConfig/python/AutoConfiguration.py#L181
def
_toroidFieldAutoCfg
(
prevFlags
):
if
prevFlags
.
Input
.
isMC
or
prevFlags
.
Common
.
isOnline
:
return
True
lbs
=
prevFlags
.
Input
.
LumiBlockNumbers
fieldStat
=
getFieldForRun
(
run
=
prevFlags
.
Input
.
RunNumbers
[
0
],
lumiblock
=
0
if
len
(
lbs
)
==
0
else
lbs
[
0
],
quiet
=
True
)
return
(
fieldStat
.
toroidCurrent
()
>
1
)
def
_solenoidFieldAutoCfg
(
prevFlags
):
if
prevFlags
.
Input
.
isMC
or
prevFlags
.
Common
.
isOnline
:
return
True
lbs
=
prevFlags
.
Input
.
LumiBlockNumbers
fieldStat
=
getFieldForRun
(
run
=
prevFlags
.
Input
.
RunNumbers
[
0
],
lumiblock
=
0
if
len
(
lbs
)
==
0
else
lbs
[
0
],
quiet
=
True
)
return
(
fieldStat
.
solenoidCurrent
()
>
1
)
def
createBFieldConfigFlags
():
bcf
=
AthConfigFlags
()
# True when magnetic filed is taken from these flags rather than cond db (when available)
bcf
.
addFlag
(
"
BField.override
"
,
True
)
# True when solenoid is on
bcf
.
addFlag
(
"
BField.solenoidOn
"
,
True
)
bcf
.
addFlag
(
"
BField.solenoidOn
"
,
_solenoidFieldAutoCfg
)
# True when barrel toroid is on
bcf
.
addFlag
(
"
BField.barrelToroidOn
"
,
True
)
bcf
.
addFlag
(
"
BField.barrelToroidOn
"
,
_toroidFieldAutoCfg
)
# True when endcap toroid is on
bcf
.
addFlag
(
"
BField.endcapToroidOn
"
,
True
)
bcf
.
addFlag
(
"
BField.endcapToroidOn
"
,
_toroidFieldAutoCfg
)
return
bcf
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