def post_action_for_cpp(): """ Post-configh action to enforce initialization of DoD-algorithms """ from Gaudi.Configuration import log from Configurables import ApplicationMgr app = ApplicationMgr(OutputLevel=3) app.EvtMax = 0 app.EvtSel = 'NONE' from Configurables import LHCb__ParticlePropertySvc as PPSvc from Configurables import DetDataSvc from Configurables import LoKiSvc # ## some reshuffling of order of services is needed # in particular DOD should come after PPSVC, LoKiSvc and ToolSvc # services = app.ExtSvc app.ExtSvc = [ DetDataSvc('DetectorDataSvc'), PPSvc(), LoKiSvc(Welcome=False) ] + services # ## suppress some prints # from Configurables import TimingAuditor timer = TimingAuditor() from Configurables import SequencerTimerTool timer.addTool(SequencerTimerTool, 'TIMER') timer.TIMER.OutputLevel = 5 # suppress printout of various summaries from algorithms. from Gaudi.Configuration import allConfigurables for conf in allConfigurables.itervalues(): for opt in ('StatPrint', 'ErrorsPrint', 'HistoPrint'): if opt in conf.__slots__: setattr(conf, opt, False) # ensure that prints from the main tools/factories are not suppressed import Configurables from Configurables import LoKi__Hybrid__CoreFactory as CoreFactory from Configurables import LoKi__Hybrid__Tool as HybridFactory from Configurables import LoKi__Hybrid__HltFactory as HltFactory for Factory, names in { HltFactory: ("HltFactory", "Hlt1HltFactory", "Hlt2HltFactory"), CoreFactory: ("Hlt1CoreFactory", "Hlt2CoreFactory", "Hlt1Factory"), HybridFactory: ("Hlt1HybridFactory", "Hlt2HybridFactory") }.iteritems(): for name in names: f = Factory(name) f.OutputLevel = 2 f.StatPrint = True
def _defineMonitors(self): """ Define monitors """ from Configurables import (ApplicationMgr, AuditorSvc, SequencerTimerTool) ApplicationMgr().ExtSvc += ['ToolSvc', 'AuditorSvc'] ApplicationMgr().AuditAlgorithms = True AuditorSvc().Auditors += ['TimingAuditor'] SequencerTimerTool().OutputLevel = 4 # Do not print event number at every event printfreq = self.getProp("PrintFreq") if (printfreq == 0): log.warning("Print frequence cannot be 0") printfreq = 1000 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
SelectionSequences=sc.activeStreams()) # # Add stripping TCK # #from Configurables import StrippingTCK #stck = StrippingTCK(HDRLocation = '/Event/Strip/Phys/DecReports', TCK=0x36112100) # #Configure DaVinci # # Change the column size of Timing table from Configurables import TimingAuditor, SequencerTimerTool TimingAuditor().addTool(SequencerTimerTool, name="TIMER") TimingAuditor().TIMER.NameSize = 60 from Configurables import AuditorSvc, ChronoAuditor AuditorSvc().Auditors.append(ChronoAuditor("Chrono")) from Configurables import StrippingReport sr = StrippingReport(Selections=sc.selections()) from Configurables import AlgorithmCorrelationsAlg ac = AlgorithmCorrelationsAlg(Algorithms=list(set(sc.selections()))) DaVinci().HistogramFile = 'DV_stripping_histos_sels.root'
def post_action_for_cpp(): """ Post-configh action to enforce initialization of DoD-algorithms """ from Gaudi.Configuration import log log.info( '# VB: Post-action to enforce the initialization of DoD-algorithms') from Configurables import DataOnDemandSvc dod = DataOnDemandSvc() dod.PreInitialize = True ## this is the most important line here ## dod.AllowPreInitializeFailure = True ## dod.Dump = True removed = [] for key in dod.AlgMap: if 0 <= key.find('Raw/UT'): removed.append(key) log.warning('# VB: REMOVE UT decoding from DataOnDemand!') dct = dod.AlgMap for k in removed: del dct[k] dod.AlgMap = dct from Configurables import ApplicationMgr app = ApplicationMgr(OutputLevel=5) app.EvtMax = 0 app.EvtSel = 'NONE' from Configurables import LHCb__ParticlePropertySvc as PPSvc from Configurables import DetDataSvc from Configurables import LoKiSvc # ## some reshuffling of order of services is needed # in particular DOD should come after PPSVC, LoKiSvc and ToolSvc # services = app.ExtSvc app.ExtSvc = [ DetDataSvc('DetectorDataSvc'), PPSvc(), LoKiSvc(Welcome=False) ] + services + [dod] # ## suppress some prints # from Configurables import TimingAuditor timer = TimingAuditor() from Configurables import SequencerTimerTool timer.addTool(SequencerTimerTool, 'TIMER') timer.TIMER.OutputLevel = 5 # suppress printout of various summaries from algorithms. from Gaudi.Configuration import allConfigurables for conf in allConfigurables.itervalues(): for opt in ('StatPrint', 'ErrorsPrint', 'HistoPrint'): if opt in conf.__slots__: setattr(conf, opt, False) # ensure that prints from the main tools/factories are not suppressed import Configurables for factory in ('Tool', 'CoreFactory', 'TrackFunctorFactory', 'HltFactory', 'Hlt1HltFactory', 'Hlt2HltFactory'): factory = 'LoKi__Hybrid__%s' % factory try: factory = getattr(Configurables, factory) factory(OutputLevel=2, StatPrint=True) except AttributeError: # ignore unknown factories pass
from PRConfig import TestFileDB TestFileDB.test_file_db["2012_raw_default"].run() from Configurables import createODIN, EventCountAlg, PostScaler ApplicationMgr().TopAlg += [ createODIN(), EventCountAlg(), PostScaler(), GaudiSequencer("WAAAATUP") ] from Configurables import LHCbTimingAuditor, LHCbSequencerTimerTool, TimingAuditor, AuditorSvc LHCbTimingAuditor().addTool(LHCbSequencerTimerTool, name="TIMER") LHCbTimingAuditor().TIMER.SummaryFile = "timing.dat" LHCbTimingAuditor().TIMER.OutputLevel = DEBUG LHCbTimingAuditor().TIMER.NameSize = 2 ApplicationMgr().ExtSvc.append('AuditorSvc') AuditorSvc().Auditors.append(LHCbTimingAuditor()) LHCbTimingAuditor().Enable = True LHCbTimingAuditor().OutputLevel = VERBOSE AuditorSvc().Auditors.append(TimingAuditor()) TimingAuditor().Enable = True from Configurables import IODataManager IODataManager().DisablePFNWarning = True
############################################################### # Job options file #============================================================== from Gaudi.Configuration import * importOptions('AlgSequencer.py') #-------------------------------------------------------------- # Enable Timing Histograms #-------------------------------------------------------------- from Configurables import TimingAuditor, SequencerTimerTool TIMER = TimingAuditor("TIMER") TIMER.addTool(SequencerTimerTool, name="TIMER") TIMER.TIMER.HistoProduce = True #-------------------------------------------------------------- # Enable histograms output #-------------------------------------------------------------- RootHistSvc().OutputFile = 'timing_histos.root' ApplicationMgr(HistogramPersistency='ROOT')