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
d897d5d9
Commit
d897d5d9
authored
1 year ago
by
Frank Winklmeier
Browse files
Options
Downloads
Patches
Plain Diff
MagFieldServices: migrate CondAlg unit test to CA
parent
d0b7f2ac
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MagneticField/MagFieldServices/CMakeLists.txt
+3
-5
3 additions, 5 deletions
MagneticField/MagFieldServices/CMakeLists.txt
MagneticField/MagFieldServices/share/test_magFieldCondAlg.py
+31
-37
31 additions, 37 deletions
MagneticField/MagFieldServices/share/test_magFieldCondAlg.py
with
34 additions
and
42 deletions
MagneticField/MagFieldServices/CMakeLists.txt
+
3
−
5
View file @
d897d5d9
# Copyright (C) 2002-202
2
CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-202
4
CERN for the benefit of the ATLAS collaboration
# Declare the package name:
atlas_subdir
(
MagFieldServices
)
...
...
@@ -20,11 +20,9 @@ atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
if
(
NOT SIMULATIONBASE
)
atlas_add_test
(
MagFieldServicesConfig
SCRIPT python -m MagFieldServices.MagFieldServicesConfig
PROPERTIES TIMEOUT 300
POST_EXEC_SCRIPT nopost.sh
)
POST_EXEC_SCRIPT noerror.sh
)
atlas_add_test
(
MagFieldCondAlg
SCRIPT athena --threads=1
${
CMAKE_CURRENT_SOURCE_DIR
}
/share/test_magFieldCondAlg.py
PROPERTIES TIMEOUT 300
SCRIPT
${
CMAKE_CURRENT_SOURCE_DIR
}
/share/test_magFieldCondAlg.py
LOG_SELECT_PATTERN
"MagFieldCondReader"
)
endif
()
This diff is collapsed.
Click to expand it.
MagneticField/MagFieldServices/share/test_magFieldCondAlg.py
100644 → 100755
+
31
−
37
View file @
d897d5d9
#
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaborati
on
#
!/usr/bin/env pyth
on
#
# Job options to test magnetic field conditions algs with varying currents.
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
#
# Test magnetic field conditions algs with varying currents.
#
# Testing IOVs and currents: (since LB, solenoid, toroids)
...
...
@@ -23,6 +25,7 @@ currents = [(0, 7730, 20400),
# Folder name
folder
=
'
/EXT/DCS/MAGNETS/SENSORDATA
'
sqlite
=
'
magfield.db
'
def
createDB
():
"""
Create sqlite file with DCS currents
"""
...
...
@@ -32,11 +35,10 @@ def createDB():
from
CoolConvUtilities
import
AtlCoolLib
,
AtlCoolTool
# Cleanup previous file
import
os
if
os
.
path
.
isfile
(
"
magfield.db
"
):
os
.
remove
(
"
magfield.db
"
)
if
os
.
path
.
isfile
(
sqlite
):
os
.
remove
(
sqlite
)
db
=
cool
.
DatabaseSvcFactory
.
databaseService
().
createDatabase
(
'
sqlite://;schema=
magfield.db
;dbname=CONDBR2
'
)
db
=
cool
.
DatabaseSvcFactory
.
databaseService
().
createDatabase
(
f
'
sqlite://;schema=
{
sqlite
}
;dbname=CONDBR2
'
)
spec
=
cool
.
RecordSpecification
()
spec
.
extend
(
"
value
"
,
cool
.
StorageType
.
Float
)
spec
.
extend
(
"
quality_invalid
"
,
cool
.
StorageType
.
Bool
)
...
...
@@ -60,34 +62,26 @@ def createDB():
# Create sqlite file with DCS currents
createDB
()
# basic job configuration
import
AthenaCommon.AtlasUnixGeneratorJob
# noqa: F401
from
AthenaCommon.AppMgr
import
theApp
,
ServiceMgr
as
svcMgr
from
AthenaCommon.AlgSequence
import
AthSequencer
,
AlgSequence
# Increment LBN every event
from
McEventSelector
import
McEventSelectorConf
svcMgr
+=
McEventSelectorConf
.
McEventSelector
(
'
EventSelector
'
,
EventsPerLB
=
1
)
# Conditions folder setup
from
AthenaCommon.GlobalFlags
import
globalflags
globalflags
.
DataSource
=
'
data
'
globalflags
.
ConditionsTag
=
'
CONDBR2-BLKPA-RUN2-01
'
from
IOVDbSvc.CondDB
import
conddb
conddb
.
setGlobalTag
(
globalflags
.
ConditionsTag
())
conddb
.
addFolder
(
'
GLOBAL
'
,
'
/GLOBAL/BField/Maps <noover/>
'
,
className
=
"
CondAttrListCollection
"
)
conddb
.
addFolder
(
'
magfield.db
'
,
folder
,
className
=
'
CondAttrListCollection
'
)
# Magnetic field algorithm setup
from
AthenaCommon.CfgGetter
import
getAlgorithm
condSeq
=
AthSequencer
(
"
AthCondSeq
"
)
condSeq
+=
getAlgorithm
(
"
AtlasFieldMapCondAlg
"
)
condSeq
+=
getAlgorithm
(
"
AtlasFieldCacheCondAlg
"
)
condSeq
.
AtlasFieldCacheCondAlg
.
LockMapCurrents
=
False
import
AthenaCommon.CfgMgr
as
CfgMgr
topSequence
=
AlgSequence
()
topSequence
+=
CfgMgr
.
MagField__CondReader
(
"
MagFieldCondReader
"
)
theApp
.
EvtMax
=
currents
[
-
1
][
0
]
+
5
# 5 events per IOV
from
AthenaConfiguration.AllConfigFlags
import
initConfigFlags
from
AthenaConfiguration.ComponentFactory
import
CompFactory
from
AthenaConfiguration.MainServicesConfig
import
MainEvgenServicesCfg
flags
=
initConfigFlags
()
flags
.
Input
.
Files
=
[]
flags
.
Concurrency
.
NumThreads
=
1
flags
.
Exec
.
MaxEvents
=
currents
[
-
1
][
0
]
+
5
# 5 events per IOV
flags
.
IOVDb
.
GlobalTag
=
'
CONDBR2-BLKPA-RUN2-01
'
flags
.
IOVDb
.
SqliteInput
=
sqlite
flags
.
IOVDb
.
SqliteFolders
=
(
folder
,)
flags
.
lock
()
acc
=
MainEvgenServicesCfg
(
flags
)
acc
.
getService
(
'
EventSelector
'
).
EventsPerLB
=
1
from
MagFieldServices.MagFieldServicesConfig
import
AtlasFieldCacheCondAlgCfg
acc
.
merge
(
AtlasFieldCacheCondAlgCfg
(
flags
,
LockMapCurrents
=
False
)
)
acc
.
addEventAlgo
(
CompFactory
.
MagField
.
CondReader
(
'
MagFieldCondReader
'
)
)
import
sys
sys
.
exit
(
acc
.
run
().
isFailure
())
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