diff --git a/MooreOnlineConf/options/align_analyzer_Tracker.py b/MooreOnlineConf/options/align_analyzer_Tracker.py new file mode 100644 index 0000000000000000000000000000000000000000..ba069efcc7650c18d67f4b833271679ead6ac088 --- /dev/null +++ b/MooreOnlineConf/options/align_analyzer_Tracker.py @@ -0,0 +1,102 @@ +############################################################################### +# (c) Copyright 2021 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. # +############################################################################### +import os +import GaudiOnline +import OnlineEnvBase as OnlineEnv +from Configurables import DummyRunable +from Configurables import Online__AlgFlowManager as AlgFlowManager +from Configurables import HLTControlFlowMgr, EventLoopMgr +from pathlib import Path +from MooreOnlineConf.utils import ( + alignment_options, + ensure_output_dir, + distribute_files, +) + +application = GaudiOnline.Passthrough( + outputLevel=OnlineEnv.OutputLevel, + partitionName=OnlineEnv.PartitionName, + partitionID=OnlineEnv.PartitionID, + classType=GaudiOnline.Class1) +application.setup_fifolog() + +online_options = alignment_options(OnlineEnv) + +ensure_output_dir(online_options.analyzer_output_path, online_options.tag) +ensure_output_dir(online_options.iterator_output_path, online_options.tag) +print(f"Will write analyzer output to {online_options.analyzer_output_path}") + +INPUT_DATA_PATH = Path("/calib/align/LHCb/Tracker") +files = [ + sorted((INPUT_DATA_PATH / run).iterdir()) for run in online_options.runs +] +files_per_node = distribute_files(online_options.nodes, files) + +utgid = os.environ["UTGID"] +worker_id = utgid.split("_")[1] +try: + input_files = files_per_node[worker_id] +except KeyError: + # When testing we run multiple instances on the same node + # TODO this should probably be done based on the partition name + # and also "nodes" should be renamed to workers everywhere. + worker_id = utgid + input_files = files_per_node[worker_id] + +# TODO handle case where input_files is empty (here and in iterator) + +derivfile = online_options.analyzer_output_path / f"derivatives-{worker_id}.out" +histofile = online_options.analyzer_output_path / f"histograms-{worker_id}.root" +input_files = [str(f) for f in input_files] + +from Configurables import Gaudi__Histograming__Sink__Root +from Configurables import HistogramPersistencySvc +from Configurables import AlignAlgorithm +from Configurables import LHCb__Det__LbDD4hep__DD4hepSvc as DD4hepSvc +Gaudi__Histograming__Sink__Root( + "Gaudi__Histograming__Sink__Root").FileName = str( + histofile.with_stem(histofile.stem + "_new")) +HistogramPersistencySvc().OutputFile = str(histofile) +AlignAlgorithm().OutputDataFile = str(derivfile) +DD4hepSvc().ConditionsOverlayInitPath = str( + online_options.iterator_output_path / "OverlayRoot") + +# input_files = ['/scratch/rmatev/aligninputfiles/00146082_00000001_1.mdf'] +# input_files = ['/scratch/rmatev/aligninputfiles2/Minbias_MagDown_Boole_lhcbhead3379_dddb-20220705_sim-20220705-vc-md100_lumi0.mdf'] +application.setup_file_access(input_files) + +# application.setup_hive(FlowManager("EventLoop"), 40) <- simple event loop +flow = AlgFlowManager("EventLoop") +application.app.EventLoop = flow +# application.setup_hive(flow, 44) + +# HACK: transfer options from HLTControlFlowMgr +cfm = HLTControlFlowMgr('HLTControlFlowMgr') +flow.CompositeCFNodes = cfm.CompositeCFNodes +flow.BarrierAlgNames = cfm.BarrierAlgNames + +application.setup_monitoring() +application.monSvc.DimUpdateInterval = 1 + +application.config.enablePause = True +# Use execMode = 1 for multi-threaded (async_queued) mode and +# use 0 (default) for single-threaded (sync) mode, i.e. debugging. +application.config.execMode = 1 +application.config.numEventThreads = 4 +application.config.numStatusThreads = 1 +application.config.FILE_maxEventsIn = 1000 +application.app.Runable = DummyRunable() +application.app.TopAlg.insert(0, application.updateAndReset) +application.app.EvtSel = 'NONE' +application.app.EvtMax = -1 +application.app.StopOnSignal = False # = default +application.app.StalledEventMonitoring = False # = default +EventLoopMgr().Warnings = False diff --git a/MooreScripts/job/SciFi/runAnalyzer.sh b/MooreScripts/job/SciFi/runAnalyzer.sh index 2642cbcb535b01f1575da876de9f6a724a04d8f6..3833127af730a093ce8d97745dfea4fe6a2492ed 100755 --- a/MooreScripts/job/SciFi/runAnalyzer.sh +++ b/MooreScripts/job/SciFi/runAnalyzer.sh @@ -17,5 +17,5 @@ setup_options_path MONITORING exec_gaudirun \ $MOOREONLINECONFROOT/options/verbosity.py \ $MOOREONLINECONFROOT/options/align_options.py \ - $HUMBOLDTROOT/options/AlignVPHalvesModules_OfflineAnalyzer.py \ - $MOOREONLINECONFROOT/options/align_analyzer.py + $HUMBOLDTROOT/options/AlignFTModules_Analyzer.py \ + $MOOREONLINECONFROOT/options/align_analyzer_Tracker.py diff --git a/MooreScripts/job/SciFi/runIterator.sh b/MooreScripts/job/SciFi/runIterator.sh index e98def48b1eeb06c38d4ddc2c27b6751dca49fc2..8e0c9804a9ea7d61ade9aef012f924465ae1ce1b 100755 --- a/MooreScripts/job/SciFi/runIterator.sh +++ b/MooreScripts/job/SciFi/runIterator.sh @@ -18,5 +18,5 @@ setup_options_path MONITORING exec_gaudirun --application=Online::OnlineApplication \ $MOOREONLINECONFROOT/options/verbosity.py \ $MOOREONLINECONFROOT/options/align_options.py \ - $HUMBOLDTROOT/options/AlignVPHalvesModules_Iterator.py \ + $HUMBOLDTROOT/options/AlignFTModules_Iterator.py \ $MOOREONLINECONFROOT/options/align_iterator.py diff --git a/MooreScripts/python/MooreScripts/testbench/scenarios/alignment.py b/MooreScripts/python/MooreScripts/testbench/scenarios/alignment.py index 52b7c2911d4e2fa6468fb10b816d02254cc84061..173ca6b7172f864f68bdb185805054d571cbb6c7 100644 --- a/MooreScripts/python/MooreScripts/testbench/scenarios/alignment.py +++ b/MooreScripts/python/MooreScripts/testbench/scenarios/alignment.py @@ -30,7 +30,7 @@ async def run(tasks, args): # Write the alignment-specific options with open("RunList.opts", "w") as f: # dump_opts({"DeferredRuns": {"0000230000"}}, f) - dump_opts({"DeferredRuns": {"0000255623"}}, f) + dump_opts({"DeferredRuns": {"0000256145"}}, f) with open("NodeList.opts", "w") as f: # usually the NodeList would contain only the node name # since we run one instance per node. When testing locally