def execute(): LHCbApp() tck = "0x40b10033" MySeq = GaudiSequencer("MoveTCKtoNewLocation") MyWriter = InputCopyStream("CopyToFile") RawEventJuggler().TCK = tck RawEventJuggler().Input = 4.0 #2.0 ? RawEventJuggler().Output = 0.0 RawEventJuggler().Sequencer = MySeq RawEventJuggler().WriterOptItemList = MyWriter RawEventJuggler().KillInputBanksAfter= " L0*|Hlt*" RawEventJuggler().KillExtraNodes = True ApplicationMgr().TopAlg = [MySeq] LHCbApp().EvtMax = -1 from GaudiConf import IOHelper IOHelper().outStream("Early2015-Juggled.dst", MyWriter)
# $Id: $ # Test your line(s) of the stripping # # NOTE: Please make a copy of this file for your testing, and do NOT change this one! # from Gaudi.Configuration import * from Configurables import DaVinci from StrippingConf.Configuration import StrippingConf # #Raw event juggler to split Other/RawEvent into Velo/RawEvent and Tracker/RawEvent # from Configurables import RawEventJuggler juggler = RawEventJuggler(DataOnDemand=True, Input=0.3, Output=4.2) # #Fix for TrackEff lines # from Configurables import DecodeRawEvent DecodeRawEvent().setProp("OverrideInputs", 4.2) # Specify the name of your configuration my_wg = 'B2CC' #FOR LIAISONS # NOTE: this will work only if you inserted correctly the # default_config dictionary in the code where your LineBuilder # is defined. from StrippingSelections import buildersConf
99.0: { "Bank_A": "FooBar", "Bank_B": ["FooBar", "Spam"], "Bank_C": "FooBar", "Bank_D": "Foo/#BAR#" } } test_versions = {"Spam": 0.0, "Eggs": 99.0} RawEventFormatConf().Locations = test_locations RawEventFormatConf().RecoDict = test_versions #test RawEventJuggler with all options RawEventJuggler().Input = 99.0 RawEventJuggler().Output = 0.0 RawEventJuggler().TCK = "Null" RawEventJuggler().GenericReplacePatterns = {"#BAR#": "Bar"} RawEventJuggler().DataOnDemand = True RawEventJuggler().__apply_configuration__() if [(node, dods().AlgMap[node].getFullName()) for node in dods().AlgMap ] != [('/Foo', 'RawEventMapCombiner/create_Foo'), ('/Bar', 'RawEventMapCombiner/create_Bar'), ('FooBar/Null/', 'RawEventMapCombiner/create_FooBar_Null')]: print[(node, dods().AlgMap[node].getFullName()) for node in dods().AlgMap] raise ValueError("Unexpected Node Map in DoD Svc") print "Pass"
@date 2020-04-20 """ #stripping version stripping = 'stripping29r2' #use CommonParticlesArchive from CommonParticlesArchive import CommonParticlesArchiveConf CommonParticlesArchiveConf().redirect(stripping) from Gaudi.Configuration import * MessageSvc().Format = "% F%30W%S%7W%R%T %0W%M" '''''' '''''' '' #Raw event juggler to split Other/RawEvent into Velo/RawEvent and Tracker/RawEvent # from Configurables import RawEventJuggler juggler = RawEventJuggler(DataOnDemand=True, Input=2.0, Output=4.0) '''''' '''''' '' ######################## # # Disable the cache in Tr/TrackExtrapolators # from Configurables import TrackStateProvider TrackStateProvider().CacheStatesOnDemand = False # #Fix for TrackEff lines # from Configurables import DecodeRawEvent DecodeRawEvent().setProp("OverrideInputs", 4.2)
def configureOutput(self, dstType, withMC, handleLumi): """ Set up output stream """ # Merge genFSRs if self.getProp("WriteFSR"): if self.getProp("MergeGenFSR"): GaudiSequencer("OutputDSTSeq").Members += ["GenFSRMerge"] if dstType in [ "XDST", "DST", "LDST", "RDST" ]: writerName = "DstWriter" packType = self.getProp( "PackType" ) # event output dstWriter = OutputStream( writerName ) dstWriter.AcceptAlgs += ["Reco"] # Write only if Rec phase completed if handleLumi and self.getProp( "WriteLumi" ): dstWriter.AcceptAlgs += ["LumiSeq"] # Write also if Lumi sequence completed # set verbosity if self.getProp( "ProductionMode" ): if not dstWriter.isPropertySet( "OutputLevel" ): dstWriter.OutputLevel = INFO if self.getProp("WriteFSR"): FSRWriter = RecordStream( "FSROutputStreamDstWriter") if not FSRWriter.isPropertySet( "OutputLevel" ): FSRWriter.OutputLevel = INFO # Suppress spurious error when reading POOL files without run records if self.getProp("WriteFSR"): if self.getProp( "InputType" ).upper() not in [ "MDF" ]: from Configurables import FileRecordDataSvc FileRecordDataSvc().OutputLevel = FATAL if dstType == "XDST": # Allow multiple files open at once (SIM,DST,DIGI etc.) IODataManager().AgeLimit += 1 if dstType in ["DST","XDST","LDST"] and packType not in ["MDF"]: jseq=GaudiSequencer("RawEventSplitSeq") ################################# # Split the Raw Event for the DST # Use the RawEventJuggler. # Not delegated to DSTConf. # Some information must be shared with DSTConf ################################# juggler=RawEventJuggler() juggler.Sequencer=jseq dstseq=GaudiSequencer("OutputDSTSeq") dstseq.Members.append(jseq) # Set the output version if not already overwritten if juggler.isPropertySet("Output") and juggler.getProp("Output") is not None: #it's already set pass else: juggler.setProp("Output",self.getProp("SplitRawEventOutput")) #set the input version, could come from several places if self.isPropertySet("SplitRawEventInput") and self.getProp("SplitRawEventInput") is not None: #if set, take it from Brunel() juggler.setProp("Input",self.getProp("SplitRawEventInput")) #otherwise use the setting of the juggler if it is set elif juggler.isPropertySet("Input") and juggler.getProp("Input") is not None: pass #else find it from DecodeRawEvent elif DecodeRawEvent().isPropertySet("OverrideInputs") and DecodeRawEvent().getProp("OverrideInputs") is not None: juggler.setProp("Input",DecodeRawEvent().getProp("OverrideInputs")) #else if I'm input with a DST, assume it is a Stripping20 type elif self._isReprocessing(self.getProp("InputType")): juggler.setProp("Input",2.0) else: #or set the default to whatever comes out of Moore by default juggler.setProp("Input","Moore") #share information from the Juggler with DSTConf #always write out to where the Juggler asked! DstConf().setProp("SplitRawEventOutput", juggler.getProp("Output")) #or else the default in the juggler is used, should be 0.0 #TODO, handle the turned off Calo, shouldn't actually be a problem... from RawEventCompat.Configuration import _checkv from Configurables import RawEventFormatConf RawEventFormatConf().loadIfRequired() if juggler.getProp("Input")!=juggler.getProp("Output"): if (juggler.getProp("Input") is None or juggler.getProp("Output")) is None or (_checkv(juggler.getProp("Input")))!=(_checkv(juggler.getProp("Output"))): juggler.KillExtraBanks=True juggler.KillExtraNodes=True #really kill /Event/DAQ to prevent it re-appearing! juggler.KillExtraDirectories=True from Configurables import TrackToDST # Filter Best Track States to be written trackFilter = TrackToDST("FilterBestTrackStates") from Configurables import ProcessPhase ProcessPhase("Output").DetectorList += [ "DST" ] GaudiSequencer("OutputDSTSeq").Members += [ trackFilter ] ### For Run 2, filter the fitted Velo tracks for PV if( self.getProp("DataType") in self.Run2DataTypes ): fittedVeloTracksFilter = TrackToDST("FilterFittedVeloTrackStates", veloStates = ["ClosestToBeam"]) fittedVeloTracksFilter.TracksInContainer = "Rec/Track/FittedHLT1VeloTracks" GaudiSequencer("OutputDSTSeq").Members += [ fittedVeloTracksFilter ] if "Muon" in self.getProp("Detectors"): # Filter Muon Track States muonTrackFilter = TrackToDST("FilterMuonTrackStates") muonTrackFilter.TracksInContainer = "/Event/Rec/Track/Muon" GaudiSequencer("OutputDSTSeq").Members += [ muonTrackFilter ] if packType != "NONE": # Add the sequence to pack the DST containers packSeq = GaudiSequencer("PackDST") DstConf().PackSequencer = packSeq DstConf().AlwaysCreate = True GaudiSequencer("OutputDSTSeq").Members += [ packSeq ] # Run the packers also on Lumi only events to write empty containers if handleLumi and self.getProp( "WriteLumi" ): notPhysSeq = GaudiSequencer("NotPhysicsSeq") notPhysSeq.Members += [ packSeq ] # Define the file content DstConf().Writer = writerName DstConf().DstType = dstType DstConf().PackType = packType #In case we didn't juggle the raw event, #We should write out the same as the input type! if not DstConf().isPropertySet("SplitRawEventOutput"): if self.isPropertySet("SplitRawEventInput") and self.getProp("SplitRawEventInput") is not None: DstConf().setProp("SplitRawEventOutput",self.getProp("SplitRawEventInput")) elif DecodeRawEvent().isPropertySet("OverrideInputs") and DecodeRawEvent().getProp("OverrideInputs") is not None: DstConf().setProp("SplitRawEventOutput",DecodeRawEvent().getProp("SplitRawEventInput")) if withMC: DstConf().SimType = "Full" elif self.getProp("DigiType").capitalize() == "Minimal": from Configurables import PackMCVertex GaudiSequencer("OutputDSTSeq").Members += [PackMCVertex()] DstConf().SimType = "Minimal" DstConf().OutputName = self.outputName() self.setOtherProps(DstConf(),["DataType","WriteFSR"])
def _configureForOnline(self): # DecodeRawEvent().DataOnDemand=False writer=InputCopyStream( self.writerName ) DstConf().setProp("SplitRawEventOutput", self.getProp("RawFormatVersion")) # Use RawEventJuggler to create the Turbo stream raw event format tck = "0x409f0045" # DUMMY TurboBanksSeq=GaudiSequencer("TurboBanksSeq") RawEventJuggler().TCK=tck RawEventJuggler().Input="Moore" RawEventJuggler().Output=self.getProp("RawFormatVersion") RawEventJuggler().Sequencer=TurboBanksSeq RawEventJuggler().WriterOptItemList=writer RawEventJuggler().KillExtraNodes=True RawEventJuggler().KillExtraBanks=True RawEventJuggler().KillExtraDirectories = True self.teslaSeq.Members += [TurboBanksSeq] # Begin Lumi configuration lumiSeq = GaudiSequencer("LumiSeq") # # Add ODIN decoder to LumiSeq *** from DAQSys.Decoders import DecoderDB CreateODIN=DecoderDB["createODIN"].setup() #******************************** # # Main algorithm config lumiCounters = GaudiSequencer("LumiCounters") lumiCounters.Members+=[CreateODIN] lumiSeq.Members += [ lumiCounters ] LumiAlgsConf().LumiSequencer = lumiCounters LumiAlgsConf().OutputLevel = self.getProp('OutputLevel') LumiAlgsConf().InputType = "MDF" # # Filter out Lumi only triggers from further processing, but still write to output # Trigger masks changed in 2016, see LHCBPS-1486 physFilterRequireMask = [] lumiFilterRequireMask = [] if self.getProp( "DataType" ) in ["2012","2015"]: # 2012 needed for nightlies tests. physFilterRequireMask = [ 0x0, 0x4, 0x0 ] lumiFilterRequireMask = [ 0x0, 0x2, 0x0 ] else: physFilterRequireMask = [ 0x0, 0x0, 0x80000000 ] lumiFilterRequireMask = [ 0x0, 0x0, 0x40000000 ] from Configurables import HltRoutingBitsFilter physFilter = HltRoutingBitsFilter( "PhysFilter", RequireMask = physFilterRequireMask ) lumiFilter = HltRoutingBitsFilter( "LumiFilter", RequireMask = lumiFilterRequireMask ) lumiSeq.Members += [ lumiFilter, physFilter ] lumiSeq.ModeOR = True # from Configurables import RecordStream FSRWriter = RecordStream( "FSROutputStreamDstWriter") FSRWriter.OutputLevel = INFO # # Sequence to be executed if physics sequence not called (nano events) notPhysSeq = GaudiSequencer("NotPhysicsSeq") notPhysSeq.ModeOR = True notPhysSeq.Members = [ physFilter ] writer.AcceptAlgs += ["LumiSeq","NotPhysicsSeq"] self.teslaSeq.Members += [lumiSeq, notPhysSeq]
expected_combiner = RawEventMapCombiner("resurectRawEventMap") if "DAQ/RawEvent" not in dods( ).AlgMap or dods().AlgMap["DAQ/RawEvent"] != expected_combiner: raise ValueError("Failed to add to DOD") if expected_combiner.RawBanksToCopy != { 'Bank_A': 'FooBar', 'Bank_B': "FooBar" }: print expected_combiner.RawBanksToCopy raise ValueError("MapCombiner misconfigured") #test RawEventJuggler with all options RawEventJuggler().Sequencer = GS("JuggleRawEvent") RawEventJuggler().Input = "Eggs" RawEventJuggler().Output = 0.0 RawEventJuggler().KillExtraNodes = True RawEventJuggler().KillExtraBanks = True RawEventJuggler().KillInputBanksBefore = ".*_C" RawEventJuggler().KillInputBanksAfter = ".*_C" RawEventJuggler().WriterOptItemList = ics("WriteAsOptItems") RawEventJuggler().WriterItemList = os("WriteAsItems") RawEventJuggler().TCK = "Null" RawEventJuggler().GenericReplacePatterns = {"#BAR#": "Bar"} RawEventJuggler().__apply_configuration__() if [ent.getFullName() for ent in GS("JuggleRawEvent").Members] != [ 'bankKiller/kill_FooBar_Before', 'RawEventMapCombiner/create_Foo', 'RawEventMapCombiner/create_Bar',
# ============ Auto-generated dummy options file ====== from Gaudi.Configuration import * from Configurables import LHCbApp LHCbApp() from Configurables import RawEventFormatConf, RecombineRawEvent, RawEventJuggler, RawEventMapCombiner; from Configurables import GaudiSequencer from Configurables import InputCopyStream as ics MySeq=GaudiSequencer("MoveRawEventAround") MyWriter=InputCopyStream("CopyToFile") #RawEventFormatConf().__apply_configuration__() RawEventJuggler().Input=0.0 #From original location RawEventJuggler().Output=2.0 #go to Stripping20 format RawEventJuggler().Sequencer=MySeq RawEventJuggler().KillExtraNodes=True #remove DAQ/RawEvent completely RawEventJuggler().KillExtraDirectories=True RawEventJuggler().WriterOptItemList=MyWriter ApplicationMgr().TopAlg=[MySeq] from Configurables import StoreExplorerAlg ApplicationMgr().TopAlg+=[StoreExplorerAlg()] from GaudiConf import IOHelper IOHelper().outStream("split-raw-event.dst",MyWriter)
from Gaudi.Configuration import * from LHCbKernel.Configuration import * from Configurables import GaudiSequencer, RawEventJuggler from Configurables import LHCbApp LHCbApp() tck = "0x409f0045" MySeq = GaudiSequencer("MoveTCKtoNewLocation") MyWriter = InputCopyStream("CopyToFile") RawEventJuggler().TCK = tck RawEventJuggler().Input = 2.0 RawEventJuggler().Output = 0.0 RawEventJuggler().Sequencer = MySeq RawEventJuggler().WriterOptItemList = MyWriter RawEventJuggler().KillInputBanksAfter = "L0*|Hlt*" RawEventJuggler().KillExtraNodes = True ApplicationMgr().TopAlg = [MySeq] LHCbApp().EvtMax = 1000 from GaudiConf import IOHelper IOHelper().outStream("/tmp/ikomarov/Rewrited.dst", MyWriter) IOHelper().inputFiles(["/tmp/ikomarov/00024923_00000001_1.allstreams.dst"], clear=True)
# # Raw event juggler to split DAQ/RawEvent into FULL.DST format # from Configurables import GaudiSequencer, RawEventJuggler jseq = GaudiSequencer("RawEventSplitSeq") juggler = RawEventJuggler("rdstJuggler") juggler.Sequencer = jseq juggler.Input = 0.3 # 2015 Online (Moore) format juggler.Output = 4.2 # Reco15 format from Configurables import DaVinci DaVinci().prependToMainSequence([jseq])