def redoMCLinks(self,init): """ Redo MC links. """ if ( self.getProp("Simulation") ): redo = self.getProp("RedoMCLinks") if ( redo ): from Configurables import (GaudiSequencer,TESCheck,EventNodeKiller,TrackAssociator) mcKillSeq = GaudiSequencer("KillMCLinks") # The sequence killing the node of it exists tescheck = TESCheck("DaVinciEvtCheck") # Check for presence of node ... tescheck.Inputs = ["Link/Rec/Track/Best"] # tescheck.Stop = False # But don't stop tescheck.OutputLevel = 5 # don't print warnings evtnodekiller = EventNodeKiller("DaVinciEvtNodeKiller") # kill nodes evtnodekiller.Nodes = ["Link/Rec/Track"] # Kill that mcKillSeq.Members = [ tescheck, evtnodekiller, TrackAssociator() ] mcLinkSeq = GaudiSequencer("RedoMCLinks") # The sequence redoing the links mcLinkSeq.IgnoreFilterPassed = True # Run it always mcLinkSeq.Members = [ mcKillSeq, TrackAssociator() ] init.Members += [ mcLinkSeq ]
'/Event/pRec/Vertex/Primary', '/Event/pRec/Vertex/V0', '/Event/pRec/Vertex' ] extraLoad = [ '/Event/Link/MC/Rich/Hits2MCRichOpticalPhotons', '/Event/Link/MC/Particles2MCRichTracks' ] from Configurables import (TESCheck, EventNodeKiller) initBoole = GaudiSequencer("InitBooleSeq") xdstLoader = TESCheck("XDSTLoader") xdstLoader.Inputs = xdstPaths + extraLoad xdstLoader.Stop = False # If not MC do not expect all of the entries xdstLoader.OutputLevel = ERROR xdstKiller = EventNodeKiller("XDSTKiller") xdstKiller.Nodes = xdstPaths xdstHandler = GaudiSequencer("XDSTLoverHandler") xdstHandler.Members += [xdstLoader, xdstKiller] xdstHandler.IgnoreFilterPassed = True # keep going initBoole.Members += [xdstHandler] from GaudiConf import IOHelper def patch(): OutputStream("DigiWriter").ItemList += ["/Event/Link/MC#1"] appendPostConfigAction(patch)
'/Event/Rich/RawEvent', '/Event/Rich', '/Event/Other/RawEvent' ] extraLoad = [ '/Event/Link/MC/Rich/Hits2MCRichOpticalPhotons', '/Event/Link/MC/Particles2MCRichTracks' ] from Configurables import (TESCheck, EventNodeKiller) initBoole = GaudiSequencer("InitBooleSeq") xdigiLoader = TESCheck("XDIGILoader") xdigiLoader.Inputs = xdigiPaths + extraLoad xdigiLoader.Stop = False # If not MC do not expect all of the entries xdigiLoader.OutputLevel = ERROR xdigiKiller = EventNodeKiller("XDIGIKiller") xdigiKiller.Nodes = xdigiPaths xdigiHandler = GaudiSequencer("XDIGILoverHandler") xdigiHandler.Members += [xdigiLoader, xdigiKiller] xdigiHandler.IgnoreFilterPassed = True # keep going initBoole.Members += [xdigiHandler] from GaudiConf import IOHelper def patch(): OutputStream("DigiWriter").ItemList += ["/Event/Link/MC#1"]
def configureInit(self, tae, initDets): """ Set up the initialization sequence """ # Start the DataOnDemandSvc ahead of ToolSvc ApplicationMgr().ExtSvc += ["DataOnDemandSvc"] ApplicationMgr().ExtSvc += ["ToolSvc"] ProcessPhase("Init").DetectorList.insert( 0, "Boole") # Always run Boole initialisation first! initBoole = GaudiSequencer("InitBooleSeq") initBoole.Members += ["BooleInit"] # Kept for Dirac backward compatibility if self.getProp("NoWarnings"): log.warning( "Boole().NoWarnings=True property is obsolete and maintained for Dirac compatibility. Please use Boole().ProductionMode=True instead" ) self.setProp("ProductionMode", True) # Special settings for production if self.getProp("ProductionMode"): self.setProp("OutputLevel", ERROR) if not LHCbApp().isPropertySet("TimeStamp"): LHCbApp().setProp("TimeStamp", True) # OutputLevel self.setOtherProp(LHCbApp(), "OutputLevel") if self.isPropertySet("OutputLevel"): level = self.getProp("OutputLevel") if level == ERROR or level == WARNING: # Suppress known warnings importOptions("$BOOLEOPTS/SuppressWarnings.opts") # Additional information to be kept getConfigurable("BooleInit").OutputLevel = INFO # Do not print event number at every event (done already by BooleInit) EventSelector().PrintFreq = -1 # Load the spillover branches, then kill those not required to prevent further access spillPaths = self.getProp("SpilloverPaths") killPaths = [] if len(spillPaths) == 0: spillPaths = self.KnownSpillPaths self.setProp("SpilloverPaths", spillPaths) if self.getProp("UseSpillover"): if tae: killPaths = self.KnownSpillPaths else: self.setOtherProp(SimConf(), "SpilloverPaths") # Kill any spillover paths not required for spill in self.KnownSpillPaths: if spill not in spillPaths: killPaths.append(spill) else: # Kill all spillover paths killPaths = self.KnownSpillPaths from Configurables import EventNodeKiller, TESCheck spillLoader = TESCheck("SpilloverLoader") spillLoader.Inputs = spillPaths spillLoader.Stop = False # In case no spillover on input file spillLoader.OutputLevel = ERROR spillKiller = EventNodeKiller("SpilloverKiller") spillKiller.Nodes = killPaths spillHandler = GaudiSequencer("SpilloverHandler") spillHandler.Members += [spillLoader, spillKiller] spillHandler.IgnoreFilterPassed = True # In case no spillover on input file initBoole.Members += [spillHandler] if "Muon" in initDets: # Muon Background from Configurables import MuonBackground GaudiSequencer("InitMuonSeq").Members += [ MuonBackground("MuonLowEnergy") ] importOptions("$MUONBACKGROUNDROOT/options/MuonLowEnergy-G4.opts") if not tae: flatSpillover = MuonBackground("MuonFlatSpillover") GaudiSequencer("InitMuonSeq").Members += [flatSpillover] if self.getProp("DataType") == "2010": flatSpillover.NBXFullFull = 344 if self.getProp("DataType") == "2009": flatSpillover.NBXFullFull = 4 importOptions( "$MUONBACKGROUNDROOT/options/MuonFlatSpillover-G4.opts")