diff --git a/Phys/DaVinci/python/DaVinci/Configuration.py b/Phys/DaVinci/python/DaVinci/Configuration.py index a21058e2586d8a58b48e9f2c5de05cf6f4e30f6c..c0d494944306ab040a80c420de47e24edfb9fa1d 100644 --- a/Phys/DaVinci/python/DaVinci/Configuration.py +++ b/Phys/DaVinci/python/DaVinci/Configuration.py @@ -16,7 +16,8 @@ from LHCbKernel.Configuration import * from Configurables import GaudiSequencer from Configurables import ( LHCbConfigurableUser, LHCbApp, PhysConf, AnalysisConf, - DstConf, LumiAlgsConf, TurboConf ) + DstConf, LumiAlgsConf, TurboConf, FlavourTaggingConf ) +from Configurables import ToolSvc, DataOnDemandSvc from LumiAlgs.LumiIntegratorConf import LumiIntegratorConf import GaudiKernel.ProcessJobOptions @@ -114,6 +115,7 @@ class DaVinci(LHCbConfigurableUser) : LumiAlgsConf , LumiIntegratorConf, TurboConf , + FlavourTaggingConf, LHCbApp ] __legacy_datatypes__ = [ "MC09", "2008", "2009", "2010", "2011", "2012", "2015", "2016", "2017", "2018", ] @@ -355,15 +357,61 @@ class DaVinci(LHCbConfigurableUser) : if ( (inputType != 'MDST' ) & (inputType != "MDF") & (inputType != "DIGI" )) : physinit = PhysConf().initSequence() # PhysConf initSequence # Analysis - AnalysisConf().RedoMCLinks = self.getProp("RedoMCLinks") - analysisinit = AnalysisConf().initSequence() + analysisinit = self.anaInitSequence() initSeqs = [physinit,analysisinit] return GaudiSequencer('DaVinciEventInitSeq', Members = initSeqs, IgnoreFilterPassed = True) -# LoKi service + # + # configure reconstruction to be redone + # + def anaInitSequence(self): + """ + Analysis init Sequence. + """ + # only one initialisiation do far + from Configurables import GaudiSequencer + init = GaudiSequencer("AnalysisInitSeq") + self.redoMCLinks(init) + return init + + # + # Set MC + # + 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] + + # LoKi service def loki(self): """ Define the LoKi service. @@ -371,6 +419,23 @@ class DaVinci(LHCbConfigurableUser) : from Configurables import LoKiSvc lokiService = LoKiSvc() ApplicationMgr().ExtSvc += [lokiService] + + # + # BTaggingTool configuration + # + def tagging(self): + # Just create an instance. Nothing to configure as of yet + ftConf = FlavourTaggingConf() + + # + # Standard Particles + # + def standardParticles(self): + """ + define standard particles on DoD service + """ + import CommonParticles.StandardBasic + import CommonParticles.StandardIntermediate ################################################################################ # Lumi setup @@ -432,8 +497,9 @@ class DaVinci(LHCbConfigurableUser) : from Configurables import (ApplicationMgr, AuditorSvc, SequencerTimerTool) + from Configurables import TimingAuditor, SequencerTimerTool - ApplicationMgr().ExtSvc += [ 'ToolSvc', 'AuditorSvc' ] + ApplicationMgr().ExtSvc += [ 'AuditorSvc' ] ApplicationMgr().AuditAlgorithms = True AuditorSvc().Auditors += [ 'TimingAuditor' ] SequencerTimerTool().OutputLevel = 4 @@ -445,7 +511,6 @@ class DaVinci(LHCbConfigurableUser) : EventSelector().PrintFreq = printfreq # Change the column size of Timing table - from Configurables import TimingAuditor, SequencerTimerTool TimingAuditor().addTool(SequencerTimerTool,name="TIMER") if not TimingAuditor().TIMER.isPropertySet("NameSize"): TimingAuditor().TIMER.NameSize = 50 @@ -743,18 +808,22 @@ class DaVinci(LHCbConfigurableUser) : verbosePrint = self.getProp("VerboseMessages") from Configurables import LoKiSvc LoKiSvc().Welcome = verbosePrint - from Configurables import DataOnDemandSvc DataOnDemandSvc().Dump = verbosePrint if not verbosePrint : msgSvc = getConfigurable("MessageSvc") msgSvc.setWarning += ['RFileCnv'] + # Setup DataOnDemand, and make sure ToolSvc is done before hand + ApplicationMgr().ExtSvc += [ToolSvc(), DataOnDemandSvc()] + self._defineMonitors() self.loki() self._defineEvents() self._defineInput() self._rootFiles() self._upgradeAction() + self.tagging() + self.standardParticles() # Add main sequence to TopAlg self._mainSequence ()