From c9916bdae691b9752165a7fc63650a8803862255 Mon Sep 17 00:00:00 2001 From: sesen Date: Mon, 24 Oct 2022 20:41:03 +0200 Subject: [PATCH 1/2] add unpack raw event to configuration for rich and calo --- Digi/Boole/python/Boole/Configuration.py | 46 +++++++++++++------ .../python/RichDigiSys/Configuration.py | 10 +++- 2 files changed, 41 insertions(+), 15 deletions(-) diff --git a/Digi/Boole/python/Boole/Configuration.py b/Digi/Boole/python/Boole/Configuration.py index a961555d6..dc3bd693a 100755 --- a/Digi/Boole/python/Boole/Configuration.py +++ b/Digi/Boole/python/Boole/Configuration.py @@ -37,6 +37,7 @@ from Configurables import ( HistogramPersistencySvc, OutputStream, RecordStream, + LHCb__UnpackRawEvent, ) from DDDB.CheckDD4Hep import UseDD4Hep @@ -443,7 +444,6 @@ class Boole(LHCbConfigurableUser): FTClusterCreator, FTRawBankEncoder, FTRawBankDecoder, - LHCb__UnpackRawEvent, ) unpacker = LHCb__UnpackRawEvent( @@ -582,18 +582,36 @@ class Boole(LHCbConfigurableUser): seq.Members += ["Rich::MC::MCRichDigitSummaryAlg"] if "Calo" in linkDets: + from Configurables import CaloFutureRawToDigits seq = GaudiSequencer("LinkCaloSeq") - from DAQSys.Decoders import DecoderDB as ddb - from DAQSys.DecoderClass import decodersForBank - decoders = [ - d.setup() for d in sorted( - decodersForBank(ddb, "Calo"), key=lambda d: d.FullName) - ] - if len(decoders) != 2: - raise RuntimeError("Too many decoders in decoder DB") - ecalDecoder, = [d for d in decoders if "Ecal" in d.name()] - hcalDecoder, = [d for d in decoders if "Hcal" in d.name()] - seq.Members += [ecalDecoder, hcalDecoder] + + unpacker_calo = LHCb__UnpackRawEvent( + 'UnpackRawEventCalo', + BankTypes=['Calo'], + RawEventLocation = "DAQ/RawEvent", + RawBankLocations=['/Event/DAQ/RawBanks/Calo']) + + unpacker_caloerr = LHCb__UnpackRawEvent( + 'UnpackRawEventCaloError', + BankTypes=['CaloError'], + RawEventLocation = "DAQ/RawEvent", + RawBankLocations=['/Event/DAQ/RawBanks/CaloError']) + + seq.Members += [unpacker_calo, unpacker_caloerr] + decoders = [] + for cal in ["Ecal", "Hcal"]: + det = '/world/DownstreamRegion/'+cal+':DetElement-Info-IOV' if UseDD4Hep else '/dd/Structure/LHCb/DownstreamRegion/'+cal + + decoder = CaloFutureRawToDigits( + name= "Future" + cal + "ZSup", + RawBanks="DAQ/RawBanks/Calo", + ErrorRawBanks="DAQ/RawBanks/CaloError", + OutputDigitData= "Raw/" + cal + "/CaloDigits", + OutputReadoutStatusData = "/Event/Transient/DAQ/Status"+ cal, + DetectorLocation=det) + + decoders += [decoder] + seq.Members += [decoder] from Configurables import CaloDigitLinker # Workaround for ROOT-10769 @@ -603,7 +621,7 @@ class Boole(LHCbConfigurableUser): from cppyy.gbl import DeCalorimeterLocation ecalDigitLinker = CaloDigitLinker("FutureEcalDigitLinker") - ecalDigitLinker.DigitLocation = ecalDecoder.OutputDigitData + ecalDigitLinker.DigitLocation = decoders[0].OutputDigitData ecalDigitLinker.MCDigitLocation = "MC/Ecal/Digits" ecalDigitLinker.DetectorLocation = DeCalorimeterLocation.Ecal ecalDigitLinker.HitLinkLocation = "/Event/Link/Raw/Ecal/Digits2MCHits" @@ -611,7 +629,7 @@ class Boole(LHCbConfigurableUser): seq.Members += [ecalDigitLinker] hcalDigitLinker = CaloDigitLinker("FutureHcalDigitLinker") - hcalDigitLinker.DigitLocation = hcalDecoder.OutputDigitData + hcalDigitLinker.DigitLocation = decoders[1].OutputDigitData hcalDigitLinker.MCDigitLocation = "MC/Hcal/Digits" hcalDigitLinker.DetectorLocation = DeCalorimeterLocation.Hcal hcalDigitLinker.HitLinkLocation = "/Event/Link/Raw/Hcal/Digits2MCHits" diff --git a/Rich/RichDigiSys/python/RichDigiSys/Configuration.py b/Rich/RichDigiSys/python/RichDigiSys/Configuration.py index 08953ca86..9e31b75c3 100755 --- a/Rich/RichDigiSys/python/RichDigiSys/Configuration.py +++ b/Rich/RichDigiSys/python/RichDigiSys/Configuration.py @@ -129,5 +129,13 @@ class RichDigiSysConf(LHCbConfigurableUser): if self.getProp("TestRawFormatDecoding"): from Configurables import Rich__Future__RawBankDecoder as RichDecoder + from Configurables import LHCb__UnpackRawEvent + unpacker = LHCb__UnpackRawEvent( + 'UnpackRawEvent', + BankTypes=['Rich'], + RawEventLocation='/Event/DAQ/RawEvent', + RawBankLocations=['/Event/DAQ/RawBanks/Rich']) + + testDecode = self.makeComponent(RichDecoder, "RichDecodeTest") - sequence.Members += [testDecode] + sequence.Members += [unpacker, testDecode] -- GitLab From 2d0fef143917591a3c8d2bd94650bfe6f75db011 Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Tue, 25 Oct 2022 09:01:23 +0000 Subject: [PATCH 2/2] Fixed formatting patch generated by https://gitlab.cern.ch/lhcb/Boole/-/jobs/25386072 --- Digi/Boole/python/Boole/Configuration.py | 15 ++++++++------- .../python/RichDigiSys/Configuration.py | 1 - 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Digi/Boole/python/Boole/Configuration.py b/Digi/Boole/python/Boole/Configuration.py index dc3bd693a..f1db6841d 100755 --- a/Digi/Boole/python/Boole/Configuration.py +++ b/Digi/Boole/python/Boole/Configuration.py @@ -588,26 +588,27 @@ class Boole(LHCbConfigurableUser): unpacker_calo = LHCb__UnpackRawEvent( 'UnpackRawEventCalo', BankTypes=['Calo'], - RawEventLocation = "DAQ/RawEvent", + RawEventLocation="DAQ/RawEvent", RawBankLocations=['/Event/DAQ/RawBanks/Calo']) unpacker_caloerr = LHCb__UnpackRawEvent( 'UnpackRawEventCaloError', BankTypes=['CaloError'], - RawEventLocation = "DAQ/RawEvent", + RawEventLocation="DAQ/RawEvent", RawBankLocations=['/Event/DAQ/RawBanks/CaloError']) seq.Members += [unpacker_calo, unpacker_caloerr] decoders = [] for cal in ["Ecal", "Hcal"]: - det = '/world/DownstreamRegion/'+cal+':DetElement-Info-IOV' if UseDD4Hep else '/dd/Structure/LHCb/DownstreamRegion/'+cal - + det = '/world/DownstreamRegion/' + cal + ':DetElement-Info-IOV' if UseDD4Hep else '/dd/Structure/LHCb/DownstreamRegion/' + cal + decoder = CaloFutureRawToDigits( - name= "Future" + cal + "ZSup", + name="Future" + cal + "ZSup", RawBanks="DAQ/RawBanks/Calo", ErrorRawBanks="DAQ/RawBanks/CaloError", - OutputDigitData= "Raw/" + cal + "/CaloDigits", - OutputReadoutStatusData = "/Event/Transient/DAQ/Status"+ cal, + OutputDigitData="Raw/" + cal + "/CaloDigits", + OutputReadoutStatusData="/Event/Transient/DAQ/Status" + + cal, DetectorLocation=det) decoders += [decoder] diff --git a/Rich/RichDigiSys/python/RichDigiSys/Configuration.py b/Rich/RichDigiSys/python/RichDigiSys/Configuration.py index 9e31b75c3..ec5aedcd1 100755 --- a/Rich/RichDigiSys/python/RichDigiSys/Configuration.py +++ b/Rich/RichDigiSys/python/RichDigiSys/Configuration.py @@ -136,6 +136,5 @@ class RichDigiSysConf(LHCbConfigurableUser): RawEventLocation='/Event/DAQ/RawEvent', RawBankLocations=['/Event/DAQ/RawBanks/Rich']) - testDecode = self.makeComponent(RichDecoder, "RichDecodeTest") sequence.Members += [unpacker, testDecode] -- GitLab