Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Alignment
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
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
Alignment
Merge requests
!331
changes for running online
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
changes for running online
rm-align-online
into
master
Overview
18
Commits
6
Pipelines
36
Changes
9
Merged
Rosen Matev
requested to merge
rm-align-online
into
master
2 years ago
Overview
17
Commits
6
Pipelines
36
Changes
9
Expand
remove
AlignIterator
remove
gaudiupdate.py
update
AlignOnlineIterator
to work with DD4hep both in 'offline' and 'online' use case
update Analyzer and Iterator options files
required for
MooreOnline!207 (merged)
Edited
1 year ago
by
Florian Reiss
0
0
Merge request reports
Viewing commit
16490672
Show latest version
9 files
+
95
−
440
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
9
Search (e.g. *.vue) (Ctrl+P)
16490672
Working analyzer/iterator tests
· 16490672
Rosen Matev
authored
2 years ago
Alignment/Humboldt/options/AlignVPHalvesModules_Analyzer.py
+
54
−
110
Options
###############################################################################
# (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration
#
# (c) Copyright 2021
-2023
CERN for the benefit of the LHCb Collaboration #
# #
# This software is distributed under the terms of the GNU General Public #
# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". #
@@ -8,127 +8,71 @@
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
from
Moore
import
options
from
PyConf.application
import
configure_input
from
Humboldt.utils
import
runAlignment
import
OnlineEnvBase
as
OnlineEnv
#TODO: get these from Online
runNumber
=
9999
workerNumber
=
0
runType
=
"
VELO
"
if
OnlineEnv
.
PartitionName
.
startswith
(
"
TEST
"
):
derivfile
=
"
humb-vp-halves-modules-derivs
"
histofile
=
"
testmonitoringhist.root
"
else
:
from
pathlib
import
Path
onlineprefix
=
'
/group/online/dataflow/cmtuser/alignonlinetest
'
Path
(
f
"
{
onlineprefix
}
/
{
runType
}
/
{
runNumber
}
/analyzerOutput/
"
).
mkdir
(
parents
=
True
,
exist_ok
=
True
)
derivfile
=
f
"
{
onlineprefix
}
/
{
runType
}
/
{
runNumber
}
/analyzerOutput/
{
workerNumber
}
_humb-vp-halves-modules-derivs
"
histofile
=
f
"
{
onlineprefix
}
/
{
runType
}
/
{
runNumber
}
/analyzerOutput/
{
workerNumber
}
_testmonitoringhist.root
"
from
Humboldt.utils
import
createAlignAlgorithm
,
runAlignment
from
DDDB.CheckDD4Hep
import
UseDD4Hep
if
UseDD4Hep
:
# overlay_path = "./OverlayRoot"
from
Configurables
import
LHCb__Det__LbDD4hep__DD4hepSvc
as
DD4hepSvc
DD4hepSvc
().
UseConditionsOverlay
=
True
# DD4hepSvc(ConditionsOverlayInitPath=overlay_path)
# try:
# shutil.rmtree(overlay_path)
# except FileNotFoundError:
# pass
# os.mkdir(overlay_path)
# global_yml = overlay_path + "/Conditions/VP/Alignment/Global.yml"
# os.makedirs(os.path.dirname(global_yml), exist_ok=True)
# with open(global_yml, "w") as f:
# f.write("""
# VPSystem: !<!alignment>
# position: [0.0, 0.0, 0.0]
# rotation: [0.0, 0.0, 0.0]
# VPLeft: !<!alignment>
# position: [0.5 * mm, 0.5 * mm, 0.0 * mm]
# rotation: [0.0 * rad, 0.0 * rad, 0.0 * rad]
# VPRight: !<!alignment>
# position: [0.0 * mm, 0.0 * mm, 0.0 * mm]
# rotation: [0.0 * rad, 0.0 * rad, 0.0 * rad]
# """.strip())
options
.
histo_file
=
"
testmonitoringhist.root
"
if
UseDD4Hep
:
options
.
simulation
=
False
if
options
.
getProp
(
"
input_type
"
)
!=
"
Online
"
:
options
.
set_input_and_conds_from_testfiledb
(
'
upgrade_Sept2022_minbias_0fb_md_mdf
'
)
options
.
evt_max
=
100
options
.
n_event_slots
=
10
# options.n_threads = 10
options
.
event_store
=
'
EvtStoreSvc
'
options
.
ntuple_file
=
"
testmonitoring.root
"
# set options above this line!
options
.
histo_file
=
histofile
configure_input
(
options
)
# only configure data flow after this line !
# at the moment, define tracks and PVs by hand. Could be changed to centrally defined selection in the future
def
getAlignmentTracksAndPVs
():
from
RecoConf.reconstruction_objects
import
reconstruction
from
PyConf.Algorithms
import
VeloClusterTrackingSIMDFull
# note that the PVs reconstructed by TrackBeamLineVertexFinderSoA do not store the list of associated tracks. Use PatPV3DFuture instead
from
RecoConf.hlt1_tracking
import
make_reco_pvs
,
make_PatPV3DFuture_pvs
,
make_VeloClusterTrackingSIMD
from
RecoConf.hlt2_tracking
import
make_hlt2_tracks
#, make_reco_pvs.bind( make_pvs_from_velo_tracks=make_PatPV3DFuture_pvs)
#with reconstruction.bind(from_file=False), make_hlt2_tracks.bind(light_reco=True, use_pr_kf=True, fast_reco=False), make_reco_pvs.bind( make_pvs_from_velo_tracks=make_PatPV3DFuture_pvs):
from
RecoConf.hlt2_global_reco
import
make_legacy_reconstruction
,
reconstruction
as
reconstruction_from_reco
with
reconstruction
.
bind
(
from_file
=
False
),
\
reconstruction_from_reco
.
bind
(
make_reconstruction
=
make_legacy_reconstruction
),
\
make_hlt2_tracks
.
bind
(
light_reco
=
False
),
\
make_reco_pvs
.
bind
(
make_pvs_from_velo_tracks
=
make_PatPV3DFuture_pvs
),
\
make_VeloClusterTrackingSIMD
.
bind
(
algorithm
=
VeloClusterTrackingSIMDFull
):
#make tracks and PVs
# TODO: in principle the PVs should be an optional input for the alignment
reco
=
reconstruction
()
#hlt2_tracks = make_hlt2_tracks(light_reco=False)
#best_tracks = hlt2_tracks["Best"]['v1']
#pvs = make_pvs()
hlt2_tracks
=
reco
[
"
Tracks
"
]
best_tracks
=
hlt2_tracks
pvs
=
reco
[
"
PVs_v1
"
]
from
PyConf.application
import
default_raw_banks
,
createODIN
odin
=
createODIN
(
RawBanks
=
default_raw_banks
((
"
ODIN
"
))).
ODIN
#select tracks and PVs
from
Humboldt.TrackSelections
import
VPBackwardsTracks
,
VPLongTracks
,
VPOverlapTracks
from
Humboldt.VertexSelections
import
VPPrimaryVertices
from
PyConf.Algorithms
import
TrackSelectionMerger
selected_LongTracks
=
VPLongTracks
(
best_tracks
)
selected_BackwardTracks
=
VPBackwardsTracks
(
best_tracks
)
selected_OverlapTracks
=
VPOverlapTracks
(
best_tracks
)
alignmentTracks
=
TrackSelectionMerger
(
InputLocations
=
[
selected_LongTracks
,
selected_BackwardTracks
,
selected_OverlapTracks
]).
OutputLocation
selected_pvs
=
VPPrimaryVertices
(
pvs
)
# add track and vertex monitoring
from
PyConf.Algorithms
import
TrackMonitor
,
TrackVertexMonitor
,
TrackVPOverlapMonitor
from
RecoConf.hlt1_tracking
import
make_VPClus_hits
myTrackMonitor
=
TrackMonitor
(
TracksInContainer
=
alignmentTracks
)
myTrackVertexMonitor
=
TrackVertexMonitor
(
TrackContainer
=
alignmentTracks
,
PVContainer
=
pvs
)
myTrackVPOverlapMonitor
=
TrackVPOverlapMonitor
(
TrackContainer
=
best_tracks
,
ClusterContainer
=
make_VPClus_hits
())
monitorlist
=
[
myTrackMonitor
,
myTrackVertexMonitor
,
myTrackVPOverlapMonitor
]
return
alignmentTracks
,
selected_pvs
,
odin
,
monitorlist
alignmentTracks
,
alignmentPVs
,
odin
,
monitors
=
getAlignmentTracksAndPVs
()
from
Humboldt.options
import
usePrKalman
from
Humboldt.alignment_tracking
import
make_align_vp_input
alignmentTracks
,
alignmentPVs
=
make_align_vp_input
(
usePrKalman
=
usePrKalman
)
#define elements and degrees of freedom to be aligned
from
TAlignment.Alignables
import
Alignables
elements
=
Alignables
()
dofs
=
"
TxTyTzRxRyRz
"
dofsmodules
=
"
TxTyTzRxRyRz
"
elements
.
VPModules
(
dofsmodules
)
# add survey constraints
from
Configurables
import
SurveyConstraints
surveyconstraints
=
SurveyConstraints
()
surveyconstraints
.
VP
()
# define Lagrange constraints
constraints
=
[]
constraints
.
append
(
"
VPHalfAverage : VP/VP(Left|Right) : Tx Ty Tz Rx Ry Rz
"
)
constraints
.
append
(
"
VPInternalRight : VP/VPRight/Module..WithSupport: Tx Ty Tz Rx Ry Rz Szx Szy
"
)
constraints
.
append
(
"
VPInternalLeft : VP/VPLeft/Module..WithSupport: Tx Ty Tz Rx Ry Rz Szx Szy
"
)
from
Humboldt.AlignmentScenarios
import
configureVPModuleAlignment
config
=
configureVPModuleAlignment
()
from
Humboldt.utils
import
createAlignAlgorithm
with
createAlignAlgorithm
.
bind
(
onlineMode
=
True
,
# histoPrint=True,
outputDataFile
=
derivfile
,
updateInFinalize
=
False
):
outputDataFile
=
"
humb-vp-halves-modules-derivs
"
,
updateInFinalize
=
False
,
onlineMode
=
True
):
runAlignment
(
options
,
surveyConstraints
=
s
urvey
c
onstraints
,
lagrangeConstraints
=
constraints
,
surveyConstraints
=
config
.
S
urvey
C
onstraints
,
lagrangeConstraints
=
con
fig
.
LagrangeCon
straints
,
alignmentTracks
=
alignmentTracks
,
elementsToAlign
=
config
.
Elements
,
alignmentPVs
=
alignmentPVs
,
odin
=
odin
,
elementsToAlign
=
elements
,
monitorList
=
monitors
)
usePrKalman
=
usePrKalman
)
Loading