Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • lhcb/MooreOnline
1 result
Show changes
Commits on Source (11)
Showing
with 84 additions and 89 deletions
......@@ -42,8 +42,8 @@ mgr.ExtSvc += [configured_ann_svc('TCKANNSvc')]
def decoding():
ecal_raw = default_raw_banks("Calo", default_raw_event)
ecal_raw_error = default_raw_banks("CaloError", default_raw_event)
ecal_raw = default_raw_banks("Calo")
ecal_raw_error = default_raw_banks("CaloError")
decoders = [
loc.producer for loc in [
......
......@@ -12,24 +12,17 @@
"""
from GaudiConf import IOHelper
import GaudiPython as GP
from Configurables import (ApplicationMgr, LHCbApp)
from Configurables import GaudiSequencer
from Configurables import createODIN, IODataManager
from Configurables import LHCb__UnpackRawEvent as UnpackRawEvent
from Configurables import HltLumiWriter, HltLumiSummaryDecoder
from PyConf.Algorithms import VoidFilter, HltDecReportsDecoder
from PyConf.application import configured_ann_svc
from PyConf.application import default_raw_event, default_raw_banks
from PyConf.Algorithms import HltLumiWriter, HltLumiSummaryDecoder, VoidFilter, HltDecReportsDecoder
from PyConf.application import configure_input, configure, configured_ann_svc
from PyConf.application import default_raw_banks, make_odin
from Moore import options
from PyConf.control_flow import CompositeNode, NodeLogic
import Functors as F
import argparse
import json
import warnings
NEW_OUTPUT_RAW_EVENT = "/Event/DAQ/NewHltLumiEvent"
NEW_OUTPUT_VIEW = "/Event/DAQ/NewHltLumi/View"
NEW_LUMI_SUMMARY_LOC = "Hlt/NewLumiSummary"
defaultFile = "mep_lumi.mdf"
parser = argparse.ArgumentParser()
......@@ -43,107 +36,95 @@ parser.add_argument(
)
args = parser.parse_args()
schemaFile = args.schema_json_file
LHCbApp(DataType="Upgrade", Simulation=True)
IOHelper("MDF").inputFiles([args.input_mdf])
IODataManager().DisablePFNWarning = True
decKeys = {}
try:
with open(args.schema_json_file) as f:
j = json.load(f)
decKeys = {
int(k, 16): json.dumps(v)
for (k, v) in j["DecodingKeys"].items()
}
except FileNotFoundError:
pass
configured_ann_svc.global_bind(LumiOverrule=decKeys)
options.input_files = [args.input_mdf]
options.input_type = "MDF"
options.data_type = "Upgrade"
options.simulation = True
options.dddb_tag = "master"
options.conddb_tag = "master"
options.gaudipython_mode = True
seq = GaudiSequencer("Decode", Members=[])
config = configure_input(options)
# Workaround for ROOT-10769
with warnings.catch_warnings():
warnings.simplefilter("ignore")
import cppyy
unpack_raw = UnpackRawEvent(
"UnpackODINAndLumi",
RawEventLocation='DAQ/RawEvent',
RawBankLocations=['DAQ/RawBanks/ODIN', 'DAQ/RawBanks/HltLumiSummary'],
BankTypes=['ODIN', 'HltLumiSummary'])
createODIN = createODIN()
seq.Members = [unpack_raw, createODIN]
odin_handle = make_odin()
algs = [odin_handle]
with default_raw_event.bind(raw_event_format=0.0):
dec_decoder = HltDecReportsDecoder(
RawBanks=default_raw_banks("HltDecReports"), SourceID='Hlt1')
dec_decoder = HltDecReportsDecoder(
RawBanks=default_raw_banks("HltDecReports"), SourceID='Hlt1')
odinFilter = VoidFilter(
algs.append(
VoidFilter(
Cut=F.DECREPORTS_FILTER(
Lines=['Hlt1ODINLumiDecision'],
DecReports=dec_decoder.OutputHltDecReportsLocation))
# FIXME: move all configuration to PyConf
# Extract configurable from PyConf.Algorithm
config = odinFilter.configuration()
for k, v in config.items():
seq.Members.append(k[0](k[1], **v))
if k[1].startswith('VoidFilter'):
break
DecReports=dec_decoder.OutputHltDecReportsLocation)))
#Decode, re-encode and re-decode
lumi_decoder = HltLumiSummaryDecoder(
RawBanks=unpack_raw.RawBankLocations[1], SourceID='Hlt1')
RawBanks=default_raw_banks("HltLumiSummary"), SourceID='Hlt1')
writer = HltLumiWriter(
InputBank=lumi_decoder.OutputContainerName,
OutputRawEvent=NEW_OUTPUT_RAW_EVENT,
OutputView=NEW_OUTPUT_VIEW,
SourceID='Hlt1')
InputBank=lumi_decoder.OutputContainerName, SourceID='Hlt1')
redecoder = HltLumiSummaryDecoder(
name="HltLumiSummaryReDecoder",
RawBanks=writer.OutputView,
OutputContainerName=NEW_LUMI_SUMMARY_LOC)
name="HltLumiSummaryReDecoder", RawBanks=writer.OutputView)
seq.Members.append(lumi_decoder)
seq.Members.append(writer)
seq.Members.append(redecoder)
algs.append(redecoder)
app = ApplicationMgr(TopAlg=[seq])
decKeys = {}
try:
with open(schemaFile) as f:
j = json.load(f)
decKeys = {
int(k, 16): json.dumps(v)
for (k, v) in j["DecodingKeys"].items()
}
except FileNotFoundError:
pass
app.ExtSvc += [configured_ann_svc(name='HltANNSvc', LumiOverrule=decKeys)]
from Configurables import EventSelector
EventSelector().PrintFreq = 1000
cf_node = CompositeNode(
'Decode',
combine_logic=NodeLogic.NONLAZY_OR,
children=algs,
force_order=True)
config.update(configure(options, cf_node))
appMgr = GP.AppMgr()
TES = appMgr.evtSvc()
error = False
counters_dict = dict()
while True:
def events():
appMgr.run(1)
if not TES["/Event"]:
break
while TES["/Event"]:
yield TES
appMgr.run(1)
counters_dict = dict()
error = False
appMgr.run(1)
for TES in events():
dec_reports = TES[dec_decoder.OutputHltDecReportsLocation.location]
lumi_report = dec_reports.decReport("Hlt1ODINLumiDecision")
if not lumi_report.decision():
continue
odin = TES["DAQ/ODIN"]
odin = TES[odin_handle.location]
event_dict = dict()
summary = TES["Hlt/LumiSummary"]
summary = TES[lumi_decoder.OutputContainerName.location]
if not summary:
print("LumiSummary TES location not found")
error = True
continue
newSummary = TES[NEW_LUMI_SUMMARY_LOC]
newSummary = TES[redecoder.OutputContainerName.location]
if not newSummary:
print("LumiSummary new TES location not found")
error = True
......
......@@ -5,6 +5,8 @@ HLTControlFlowMgr INFO o Number of events slots: 1
HLTControlFlowMgr INFO o TBB thread pool size: 'ThreadPoolSize':1
ApplicationMgr INFO Application Manager Initialized successfully
ApplicationMgr INFO Application Manager Started successfully
HLTControlFlowMgr INFO Will measure time between events 0 and 0 (stop might be some events later)
HLTControlFlowMgr INFO Starting loop on events
DeviceFTGeometry INFO Conditions DB is compatible with FT bank version 7 and 8.
Starting timer for throughput measurement
Input complete
......
......@@ -11,6 +11,8 @@ ApplicationMgr INFO Application Manager Initialized succ
make_selreps
rate_validator
ApplicationMgr INFO Application Manager Started successfully
HLTControlFlowMgr INFO Will measure time between events 0 and 0 (stop might be some events later)
HLTControlFlowMgr INFO Starting loop on events
DeviceFTGeometry INFO Conditions DB is compatible with FT bank version 7 and 8.
Starting timer for throughput measurement
Input complete
......
......@@ -11,6 +11,8 @@ ApplicationMgr INFO Application Manager Initialized succ
make_selreps
rate_validator
ApplicationMgr INFO Application Manager Started successfully
HLTControlFlowMgr INFO Will measure time between events 0 and 0 (stop might be some events later)
HLTControlFlowMgr INFO Starting loop on events
DeviceFTGeometry INFO Conditions DB is compatible with FT bank version 7 and 8.
Starting timer for throughput measurement
Input complete
......
......@@ -6,6 +6,8 @@ HLTControlFlowMgr INFO o TBB thread pool size: 'ThreadPoo
ApplicationMgr INFO Application Manager Initialized successfully
Setting number of slices to 4
ApplicationMgr INFO Application Manager Started successfully
HLTControlFlowMgr INFO Will measure time between events 0 and 0 (stop might be some events later)
HLTControlFlowMgr INFO Starting loop on events
DeviceFTGeometry INFO Conditions DB is compatible with FT bank version 7 and 8.
Starting timer for throughput measurement
Input complete
......
......@@ -6,6 +6,8 @@ HLTControlFlowMgr INFO o TBB thread pool size: 'ThreadPoo
ApplicationMgr INFO Application Manager Initialized successfully
Setting number of slices to 4
ApplicationMgr INFO Application Manager Started successfully
HLTControlFlowMgr INFO Will measure time between events 0 and 0 (stop might be some events later)
HLTControlFlowMgr INFO Starting loop on events
DeviceFTGeometry INFO Conditions DB is compatible with FT bank version 7 and 8.
Starting timer for throughput measurement
Input complete
......
......@@ -5,6 +5,8 @@ HLTControlFlowMgr INFO o Number of events slots: 1
HLTControlFlowMgr INFO o TBB thread pool size: 'ThreadPoolSize':1
ApplicationMgr INFO Application Manager Initialized successfully
ApplicationMgr INFO Application Manager Started successfully
HLTControlFlowMgr INFO Will measure time between events 0 and 0 (stop might be some events later)
HLTControlFlowMgr INFO Starting loop on events
DeviceFTGeometry INFO Conditions DB is compatible with FT bank version 7 and 8.
Starting timer for throughput measurement
Input complete
......
......@@ -5,6 +5,8 @@ HLTControlFlowMgr INFO o Number of events slots: 1
HLTControlFlowMgr INFO o TBB thread pool size: 'ThreadPoolSize':1
ApplicationMgr INFO Application Manager Initialized successfully
ApplicationMgr INFO Application Manager Started successfully
HLTControlFlowMgr INFO Will measure time between events 0 and 0 (stop might be some events later)
HLTControlFlowMgr INFO Starting loop on events
DeviceFTGeometry INFO Conditions DB is compatible with FT bank version 7 and 8.
Starting timer for throughput measurement
Input complete
......
......@@ -8,7 +8,7 @@
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
#############################################################################
from PyConf.application import default_raw_banks, default_raw_event
from PyConf.application import default_raw_banks
from Moore import options, run_reconstruction
from PyConf.Algorithms import CaloFutureRawToDigits
from RecoConf.calorimeter_reconstruction import make_digits, make_clusters, make_digits
......@@ -29,10 +29,10 @@ def calo_moni():
from MooreOnlineConf.utils import update_and_reset
data.append(update_and_reset())
ecal_raw = default_raw_banks("Calo", default_raw_event)
ecal_raw_error = default_raw_banks("CaloError", default_raw_event)
hcal_raw = default_raw_banks("Calo", default_raw_event)
hcal_raw_error = default_raw_banks("CaloError", default_raw_event)
ecal_raw = default_raw_banks("Calo")
ecal_raw_error = default_raw_banks("CaloError")
hcal_raw = default_raw_banks("Calo")
hcal_raw_error = default_raw_banks("CaloError")
digits = make_digits(calo_raw_bank=True)
ecalClusters = make_clusters(digits["digitsEcal"])
......
......@@ -21,7 +21,7 @@ options.conddb_tag = 'upgrade/master'
def ft_mon():
raw_event = default_raw_event(["FTNZS"])
raw_event = default_raw_event("FTNZS")
raw_banks = default_raw_banks("FTGeneric")
odin = make_odin()
......
......@@ -19,7 +19,7 @@ options.conddb_tag = 'muon_cabling_run3_fix_M2R2'
def muon_mon():
raw = default_raw_event(["Muon"])
raw = default_raw_event("Muon")
odin = make_odin()
rawToHits = MuonRawInUpgradeToHits(RawEventLocation=raw)
......
......@@ -26,7 +26,7 @@ from Configurables import LHCb__Det__LbDD4hep__DD4hepSvc as DD4hepSvc
def ut_mon():
raw = default_raw_event(["UT"])
raw = default_raw_event("UT")
odin = make_odin()
#
......@@ -39,21 +39,21 @@ def ut_mon():
name="UTOnlineMonitor",
InputData=digits,
ODINLocation=odin,
RawEventLocation=default_raw_event(["UT"]))
RawEventLocation=default_raw_event("UT"))
#
decoderNZS = UTRawBankToUTNZSDigitsAlg(
name="UTRawToDigitsNZS",
Type="NZS",
RawEventLocation=default_raw_event(["UT"]))
RawEventLocation=default_raw_event("UT"))
digitsNZS = decoderNZS.OutputDigitData
ut_onlinemonitorNZS = UTOnlineMonitor(
name="UTOnlineMonitorNZS",
InputData=digitsNZS,
ODINLocation=odin,
RawEventLocation=default_raw_event(["UT"]))
RawEventLocation=default_raw_event("UT"))
#
#decoderERR = UTErrorBankToASICHeaderAlg(OutputLevel=INFO, name='UTErrorToASIC', Type="ErrorUTSpecial", RawEventLocation=default_raw_event(["UT"]))
#decoderERR = UTErrorBankToASICHeaderAlg(OutputLevel=INFO, name='UTErrorToASIC', Type="ErrorUTSpecial", RawEventLocation=default_raw_event("UT"))
#digitsERR = decoderERR.OutputDigitData
#ut_onlinemonitorERR = UTOnlineError( OutputLevel=INFO, name="UTOnlineERR", InputData=digitsERR )
......
......@@ -150,7 +150,7 @@ def decode_tae(make_data, half_window):
def update_and_reset():
from PyConf.Algorithms import Online__UpdateAndReset
odin = default_raw_event(["ODIN"])
odin = default_raw_event("ODIN")
rawdata = odin.producer.inputs["RawData"] # the evt_data_t object
return Online__UpdateAndReset(name='UpdateAndReset', RawData=rawdata)
......