Skip to content
Snippets Groups Projects

changes for running online

Merged Rosen Matev requested to merge rm-align-online into master
Compare and Show latest version
17 files
+ 2476
2370
Compare changes
  • Side-by-side
  • Inline
Files
17
###############################################################################
# (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". #
# #
# In applying this licence, CERN does not waive the privileges and immunities #
# 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 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())
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 = 10000
# options.n_event_slots = 10
# options.n_threads = 10
options.event_store = 'EvtStoreSvc'
# options.ntuple_file = "testmonitoring.root"
# set options above this line!
configure_input(options)
from Humboldt.utils import runAlignment
from Humboldt.alignment_tracking import make_scifi_tracks_and_particles_prkf
alignmentTracks, alignmentPVs, particles, odin, monitors = make_scifi_tracks_and_particles_prkf(
)
#define elements and degrees of freedom to be aligned
from TAlignment.Alignables import Alignables
elements = Alignables()
elements.FTHalfModules("TxRxRz")
# add survey constraints
from Configurables import SurveyConstraints
from PyConf.Tools import AlignChisqConstraintTool
surveyconstraints = SurveyConstraints()
surveyconstraints.FT(addHalfModuleJoints=True)
constraints = ["Tx", "Tz", "Rz"]
constraints.append("BackFramesFixed : FT/T3V.*M. : Tz")
if UseDD4Hep:
xml_writer_list = []
else:
from Humboldt.utils import getXMLWriterList
xml_writer_list = getXMLWriterList('FT')
from Humboldt.utils import createAlignUpdateTool, createAlignAlgorithm, getXMLWriterList
with createAlignAlgorithm.bind(xmlWriters=xml_writer_list,
outputDataFile="humb-ft-modules-derivs",
updateInFinalize=False, \
onlineMode=True):
runAlignment(
options,
surveyConstraints=surveyconstraints,
lagrangeConstraints=constraints,
alignmentTracks=alignmentTracks,
alignmentPVs=alignmentPVs,
elementsToAlign=elements)
Loading