def configure(self, configuration): from Configurables import Moore moore = Moore() for (attr, value) in configuration.items(): if attr in moore.__slots__: setattr(moore, attr, value) self._config[attr] = value hlt1Lines = self._config['Hlt1Lines'] hlt2Lines = self._config['Hlt2Lines'] #if 'L0' in self._config and self._config[ 'L0' ]: #from Configurables import L0MuonAlg #L0MuonAlg( "L0Muon" ).L0DUConfigProviderType = "L0DUConfigProvider" if 'Dataset' in self._config: from PRConfig import TestFileDB TestFileDB.test_file_db[self._config['Dataset']].run( configurable=Moore()) else: EventSelector().Input = self._config['Input'] EventSelector().PrintFreq = 100 FileCatalog().Catalogs = self._config['Catalogs'] config = Config(hlt1Lines, hlt2Lines) appendPostConfigAction(config.postConfigAction)
def __apply_configuration__(self): GaudiKernel.ProcessJobOptions.PrintOff() from functools import partial propagator = None if self.getProp("RunOnline"): #check and reconfigure own properties self._onlineMode() #in online mode, force certain Moore properties! propagator = partial(self.forceOtherProps, force=True) else: #in offline mode don't force, but set them if not set propagator = partial(self.forceOtherProps, force=False) #pass certain properties to Moore propagator(Moore(), [ "RunOnline", "UseTCK", 'EnableTimer', 'Simulation', 'DataType', 'CheckOdin' ]) # Use the online output algorithm from Configurables import HltOutputConf HltOutputConf().setProp("OutputAlgProperties", self.rawEventMergerProperties) from Configurables import LoKiSvc, LoKi__Reporter LoKiSvc().addTool(LoKi__Reporter, 'REPORT') LoKiSvc().REPORT.OutputLevel = 5 if self.getProp("UseDBSnapshot"): self._configureDBSnapshot() self._configureOnline()
def execute(polarity): option_files = "$APPCONFIGOPTS/Moore/MooreSimProductionForSeparateL0AppStep2015.py;$APPCONFIGOPTS/Conditions/TCK-0x40b10033.py;$APPCONFIGOPTS/Moore/DataType-2012.py" option_files = option_files.split(";") for option in option_files: importOptions(option) LHCbApp().Simulation = True LHCbApp().DDDBtag = "dddb-20140729" LHCbApp().CondDBtag = "sim-20140730-vc-m%s100" % polarity #inputFiles = ["/tmp/thead/EarlyEvents-Extended-L0.xdst"] #IOHelper('ROOT').inputFiles(inputFiles) #Moore().EvtMax = 20 Moore().outputFile = "EarlyEvents-Extended-L0-TurboMoore.xdst" # path to private TCK ConfigTarFileAccessSvc().File = 'config.tar' Moore().TCKData = '.' Moore().InitialTCK = "0x40b20033" # your chosen TCK Moore().UseTCK = True
def _onlineMode(self): """ Check and set various things if runOnline is True """ import OnlineEnv #don't allow these to be overwritten self._checkSetDefault('EnableTimer') self._checkSetDefault('UseTCK') self._checkSetDefault('Simulation') self._checkSetDefault('DataType') self._checkSetDefault('UseDBSnapshot') ### TODO: see if 'OnlineEnv' has InitialTCK attibute. If so, set it ## in case of LHCb or FEST, _REQUIRE_ it exists... if hasattr(OnlineEnv, 'InitialTCK'): Moore().setProp('InitialTCK', OnlineEnv.InitialTCK) if not self._setIfNotSet( 'CheckOdin', True) and self.getProp('HltLevel') != "Hlt2": print 'WARNING ' * 10 print( 'WARNING: you are running HLT1 or HLT1HLT2 online, using a TCK, but ignoring ODIN. ' 'Are you sure this is really what you want???') print 'WARNING ' * 10
from Configurables import Moore, HltConf HltConf().ThresholdSettings="Hlt1_IncLinesOnly" Moore().UseTCK = False
from Gaudi.Configuration import * from Configurables import Moore Moore().ThresholdSettings = "Physics_pp_Draft2016" Moore().UseTCK = False Moore().ForceSingleL0Configuration = False Moore().Split = '' Moore().EnableTimer = True Moore().OutputLevel = INFO from Configurables import LHCbTimingAuditor, LHCbSequencerTimerTool LHCbTimingAuditor("TIMING").addTool(LHCbSequencerTimerTool, "TIMING") #normalize the timing table in tests LHCbTimingAuditor("TIMING").TIMING.Normalised = True from PRConfig import TestFileDB TestFileDB.test_file_db["2015NB_25ns_L0Filt0x0050"].run(configurable=Moore()) Moore().RemoveInputHltRawBanks = True Moore().EvtMax = 1200 from Configurables import EventSelector EventSelector().PrintFreq = 100 # Add your new HLT2 lines here to run them # from Configurables import HltConf # HltConf().AdditionalHlt2Lines = ['Hlt2MyNewLineA', 'Hlt2MyNewLineB']
from Gaudi.Configuration import * from Configurables import Moore Moore().Simulation= True; from Configurables import LHCbApp; LHCbApp().DDDBtag="dddb-20120831"; LHCbApp().CondDBtag="sim-20121025-vc-md100"; ############# "input data" ############ from PRConfig import TestFileDB TestFileDB.test_file_db["Sim08_2012_ForMoore"].run(withDB=False,configurable=Moore())
Gah, can't guess what the original number is... """ from Moore import Funcs trans = {} trans[".*Hlt1CharmCalibrationNoBiasPreScaler"] = { "AcceptFraction": { "^.*$": str(mult) } } trans[".*Hlt1MBNoBiasPreScaler"] = { "AcceptFraction": { "^.*$": str(mult * mult) } } trans[".*Hlt2TransparentPreScaler"] = { "AcceptFraction": { "^.*$": str(0.0) } } Funcs._mergeTransform(trans) from Configurables import Moore if Moore().getProp("generateConfig"): pass else: if Moore().getProp("UseTCK"): resetTransform() else: appendPostConfigAction(resetAction)
from Configurables import Moore ### # Configure Moore to run from TCK. # MAKE SURE THE TCK FITS THE MOORE VERSION YOU USE. # Moore().UseTCK = True Moore().InitialTCK = '0x0023002b' Moore().L0 = True Moore().ReplaceL0BanksWithEmulated = True Moore().UseDBSnapshot = False Moore().EnableRunChangeHandler = False Moore().CheckOdin = False Moore().Simulation = True Moore().DataType = '2010' Moore().EvtMax = 100 ### # what to write and where? everything? # Moore().WriterRequires = [] #Moore().WriterRequires = ['Hlt1MuTrackPostScaler'] Moore().outputFile = 'tmp.dst' ### # this shrinks the FOI of the L0 muon emulation # use it only if you know what you are doing !! #
from Configurables import Moore from Configurables import RecombineRawEvent RecombineRawEvent() Moore().ForceSingleL0Configuration = False evtmax=3000 Moore().EvtMax = evtmax Moore().OutputLevel =3 Moore().UseTCK = False Moore().ThresholdSettings="Commissioning_Physics_2015" Moore().DataType = "2012" Moore().Split = '' Moore().Simulation = True Moore().CheckOdin = False Moore().EnableDataOnDemand = True Moore().WriterRequires = [] Moore().RemoveInputHltRawBanks=True Moore().DDDBtag = "dddb-20130929-1" Moore().CondDBtag = "sim-20131023-vc-md100" from GaudiConf import IOHelper IOHelper().inputFiles( [ "PFN:root://castorlhcb.cern.ch//castor/cern.ch/user/s/sbenson/TempTestFiles/00026133_00000013_1.allstreams.dst" ] ) from Configurables import Hlt__Service Hlt__Service().Pedantic = False from Configurables import DataOnDemandSvc from Configurables import DstConf, CaloDstUnPackConf CaloDstUnPackConf().Enable=True DstConf().EnableUnpack= ["Reconstruction","Stripping"]
from Configurables import Moore Moore().ThresholdSettings = "Commissioning_AllHlt2Lines_2015" Moore().UseTCK = False
from Configurables import Moore from PRConfig import TestFileDB TestFileDB.test_file_db["2015NB_25ns_L0Filt0x0050"].run(configurable=Moore())
from Gaudi.Configuration import * from Configurables import Moore ############# Moore config taken from printout at the top of the sequence ############ Moore().outputFile= 'SwimmingTest.dst'; Moore().DataType= '2012'; Moore().DDDBtag= 'head-20120413'; #from RunDB Moore().WriterRequires= []; Moore().EnableDataOnDemand= True; Moore().CheckOdin= False; Moore().InitialTCK= '0x00790038'; Moore().CondDBtag= 'head-20120420'; #from RunDB from Configurables import L0Conf, HltConf L0Conf().EnsureKnownTCK=False Moore().ForceSingleL0Configuration = False #from Configurables import L0MuonAlg #L0MuonAlg( "L0Muon" ).L0DUConfigProviderType = "L0DUConfigProvider" ############# prepend a "killHltSeq" ############ #copied from Swimming/Configuration.py line 214 from Configurables import Swimming, GaudiSequencer, EventNodeKiller nodes=Swimming.__slots__["HltNodesToKill"] mykiller = EventNodeKiller("killHlt") mykiller.Nodes = nodes deathstar = GaudiSequencer("killHltSeq") deathstar.Members = [mykiller] class Deathstar(object):
if len(missingdocs): raise KeyError("You are missing documentation for the properties "+missingdocs.__str__()) if len(extradocs): raise KeyError("You have documented non-existant properties "+extra.__str__()) if len(emptydocs): raise KeyError("You have not provided enough documentation for a property "+emptydocss.__str__()) #check the deprecation warnings depd=[p for p in Moore._propertyDocDct if "DEPRECATED" in Moore._propertyDocDct[p]] if depd : for prop in depd: try: Moore().setProp(prop,"deprecated") except: Moore().setProp(prop,314159) try: Moore().__apply_configuration__() raise RuntimeError("No deprecation warnings were printed!") except DeprecationWarning as dw: pass #search for tests and options setting deprecated properties! import commands found="" for prop in depd: cmd="grep -e '\."+prop+"\(=\|[ \\t]\)' $MOOREROOT/options/*.{py,opts} ${MOOREROOT}/tests/*/*.{py,opts} ${MOOREROOT}/tests/qmtest/*/*/*.qmt ${MOOREROOT}/tests/qmtest/*/*.qmt ${MOOREROOT}/tests/qmtest/*/*/*/*.qmt" #print cmd
# Configure Moore to run from TCK and write a DST. # MAKE SURE THE TCK FITS THE MOORE VERSION YOU USE. # # For running from threshold settings or to run from # a TCK without making a DST see RunMoore.py # This works for Moore v9rX OR Moore v10rX # tck = '0x00760037' nEvents = 50 dddbTag = 'head-20110302' condDBTag = 'head-20110622' from Configurables import Moore Moore().UseTCK = True Moore().InitialTCK = tck Moore().L0 = False Moore().ReplaceL0BanksWithEmulated = False Moore().UseDBSnapshot = False Moore().EnableRunChangeHandler = False Moore().CheckOdin = False Moore().Simulation = False Moore().DataType = '2011' Moore().EvtMax = nEvents ### # what to write and where? everything? #
#!/usr/bin/env gaudirun.py # # Minimal file for running Moore from python prompt # Syntax is: # gaudirun.py ../options/Moore.py # or just # ../options/Moore.py # import Gaudi.Configuration from Configurables import Moore #new splitting of Hlt1 Moore().Split = 'Hlt2' #Moore().ThresholdSettings='Hlt2_'+Moore().ThresholdSettings
from Configurables import Moore Moore().TCKData = '../../../../InstallArea/$CMTCONFIG'
from Configurables import Moore Moore().ThresholdSettings = "Physics_25ns_October2015" Moore().UseTCK = False
from Configurables import Moore Moore().ThresholdSettings = "Physics_pp_Draft2016" Moore().UseTCK = False
from Gaudi.Configuration import * from Configurables import Moore from Configurables import L0Conf, HltConf from Gaudi.Configuration import * from Configurables import Moore ############# Moore config taken from printout at the top of the sequence ############ Moore().outputFile = 'Test.dst' Moore().DataType = '2012' Moore().DDDBtag = 'dddb-20120831' #from RunDB Moore().EnableDataOnDemand = True Moore().CheckOdin = False Moore().InitialTCK = '0x00790038' Moore().CondDBtag = 'cond-20120831' #from RunDB Moore().EnableTimer = "timerdefault.csv" ########### L0-related things ####################### from Configurables import L0Conf L0Conf().EnsureKnownTCK = False Moore().ForceSingleL0Configuration = False ############# prepend a "killHltSeq" ############ #copied from Swimming/Configuration.py line 214 from Configurables import Swimming, GaudiSequencer, EventNodeKiller nodes = Swimming.__slots__["HltNodesToKill"] mykiller = EventNodeKiller("killHlt")
# get the basic configuration from here #import GaudiPython from LHCbKernel.Configuration import * from Configurables import (LHCbConfigurableUser, LHCbApp, DstConf, CaloDstUnPackConf) from Configurables import Moore, HltConfigSvc from Configurables import ConfigTarFileAccessSvc ConfigTarFileAccessSvc().File = 'config.tar' Moore().TCKData = '/afs/cern.ch/work/s/sbenson/public/forTeslaExtendedReps' Moore().InitialTCK = "0x45b10044" Moore().UseTCK = True Moore().ForceSingleL0Configuration = False Moore().CheckOdin = False Moore().EvtMax = -1 Moore().EnableDataOnDemand = False Moore().DDDBtag = "dddb-20130929-1" Moore().CondDBtag = "sim-20131023-vc-md100" Moore().DataType = '2012' Moore().Simulation = True from GaudiConf import IOHelper IOHelper().inputFiles(["/tmp/ikomarov/With_new_L0.dst"]) Moore().outputFile = '/tmp/ikomarov/With_new_HLT.dst' from Configurables import L0MuonAlg L0MuonAlg("L0Muon").L0DUConfigProviderType = "L0DUConfigProvider"
EventSelector().Input = [ "DATAFILE='PFN:castor:/castor/cern.ch/user/r/raaij/test/SwimTrigDST.dst'" ] else: from Configurables import HltMoveVerticesForSwimming from Configurables import Moore, HltConfigSvc from Configurables import CondDB CondDB(UseOracle=True) #Global configuration mykiller = EventNodeKiller("killHlt") mykiller.Nodes = ["Hlt", "Hlt1", "Hlt2", "Trig", "Raw"] deathstar = GaudiSequencer("killHltSeq") deathstar.Members = [mykiller] from Swimming import MooreSetup # Moore().InitialTCK = options.TCKid Moore().Simulation = options.forMC Moore().DataType = options.datatype Moore().DDDBtag = options.dddb Moore().CondDBtag = options.conddb Moore().outputFile = options.outfilename Moore().WriteFSR = False Moore().WriterRequires = [] # Add extra locations to writer from Configurables import InputCopyStream writer = InputCopyStream('Writer') writer.ItemList = [ offCands + '/P2TPRelations#1', options.swimRepLoc + '#1' ] if options.interactiveTest:
from Configurables import Moore from PRConfig.TestFileDB import test_file_db input = test_file_db['MC2015_digi_nu2.6_B2Kstmumu_L0'] input.run(configurable=Moore())
from Gaudi.Configuration import * from Configurables import Moore ## Adapt these to your local environment Moore().TCKData = '/tmp/thead/' Moore().ThresholdSettings = 'Physics_draftEM2015' Moore().generateConfig = True Moore().configLabel = "Tim's early2015 turbo TCK" ## Make sure these are correct Moore().DataType = "2015" Moore().DDDBtag = "dddb-20140729" Moore().CondDBtag = "sim-20140730-vc-md100" ## Specify input, generally a DST Moore().inputFiles = ["PFN:Early2015-Juggled.dst"] ## General Moore settings, these shouldn't need to be touched Moore().Simulation = True Moore().ForceSingleL0Configuration = True Moore().CheckOdin = True Moore().EvtMax = 10000 #Moore().UseDBSnapshot = False #Moore().EnableRunChangeHandler = False #Moore().Verbose = True
#Moore without data or database flags, prepare for running offline from Gaudi.Configuration import * from Configurables import Moore from Configurables import L0Conf, HltConf ############# Moore config taken from printout at the top of the sequence ############ Moore().outputFile = 'Test.dst' Moore().WriterRequires = [] Moore().EnableDataOnDemand = True Moore().CheckOdin = False Moore().InitialTCK = '0x00790038' Moore().ThresholdSettings = "Commissioning_PassThrough" ########### L0-related things ####################### Moore().ForceSingleL0Configuration = False from Configurables import L0Conf L0Conf().EnsureKnownTCK = False #from Configurables import L0MuonAlg; L0MuonAlg( "L0Muon" ).L0DUConfigProviderType = "L0DUConfigProvider" ############# prepend a "killHltSeq" ############ #copied from Swimming/Configuration.py line 214 from Configurables import Swimming, GaudiSequencer, EventNodeKiller nodes = Swimming.__slots__["HltNodesToKill"] mykiller = EventNodeKiller("killHlt") mykiller.Nodes = nodes
from Configurables import Moore, HltConf ## Configure the tarfile access from Configurables import ConfigCDBAccessSvc ConfigCDBAccessSvc().File = 'config.cdb' Moore().TCKData = '$MOOREROOT/tests/options/TCKData/' Moore().InitialTCK = '0x50000001' Moore().UseTCK = True Moore().CheckOdin = False
def _minSetFileTypes(): from GaudiConf import IOExtension from Gaudi.Configuration import EventSelector from Configurables import Moore files = Moore().inputFiles + EventSelector().Input return IOExtension().detectMinType(files)
def ConfigureMoore(): config = Swimming() from Swimming.HltTransforms import getTransform thisTransform = getTransform( config.getProp('TransformName'), config.getProp('Hlt1Triggers') + config.getProp('Hlt2Triggers')) from Configurables import (HltConfigSvc, EventNodeKiller, HltMoveVerticesForSwimming, Moore) #Global configuration mykiller = EventNodeKiller("killHlt") mykiller.Nodes = config.getProp('HltNodesToKill') deathstar = GaudiSequencer("killHltSeq") deathstar.Members = [mykiller] from Swimming import MooreSetup # dddb = config.getProp('DDDBtag') conddb = config.getProp('CondDBtag') tck = config.getProp('TCK') run = config.getProp('RunNumber') if not dddb and not conddb and not tck and run: import shelve tag_db = os.path.expandvars(config.getProp('TagDatabase')) if not os.path.exists(tag_db): raise OSError, "Tag database file %s does not exist" % config.getProp( 'TagDatabase') tag_db = shelve.open(tag_db, 'r') info = tag_db['info'] tags = info[run] Moore().DDDBtag = tags['DDDBtag'] Moore().CondDBtag = tags['CondDBtag'] Moore().InitialTCK = tags['TCK'] Swimming().TCK = tags['TCK'] elif dddb and conddb and tck and not run: Moore().DDDBtag = dddb Moore().CondDBtag = conddb Moore().InitialTCK = tck else: raise TypeError, 'You must specify either the CondDB tag, DDDB tag and TCK and _not_ the run number' + \ ' or only the run number.' Moore().Simulation = config.getProp('Simulation') Moore().DataType = config.getProp('DataType') Moore().outputFile = config.getProp('OutputFile') Moore().WriteFSR = config.getProp('WriteFSR') Moore().Persistency = config.getProp('Persistency') Moore().WriterRequires = [] # Add extra locations to writer from Configurables import InputCopyStream writer = InputCopyStream('Writer') writer.ItemList = [config.getProp('SwimmingPrefix') + '/Reports#1'] writer.OptItemList = list( set([ l + '/P2TPRelations#1' for l in config.getProp('OffCands').values() ])) # # Define the TCK transformation # HltConfigSvc().ApplyTransformation = thisTransform from pprint import pprint pprint(HltConfigSvc().ApplyTransformation) # # Define the swimming algorithm # myswimmer = HltMoveVerticesForSwimming("HltMovePVs4Swimming") myswimmer.SwimmingDistance = 0.0 loc = config.getProp( 'SwimmingPrefix') # TODO check differences with trunk more carefully myswimmer.Bcontainer = loc myswimmer.InputSelection = config.getProp('OnlinePV') myswimmer.OutputSelection = config.getProp('OutPVSel') myswimmer.OutputLevel = 4 # Configure an extra TisTos Tool and some decoder algos to debug TisTos issues prefix = config.getProp('SwimmingPrefix') from Configurables import HltDecReportsDecoder, HltSelReportsDecoder decoders = [(HltDecReportsDecoder, [('OutputHltDecReportsLocation', 'Hlt/DecReports')]), (HltSelReportsDecoder, [('OutputHltSelReportsLocation', 'Hlt/SelReports'), ('HltDecReportsLocation', 'Hlt/DecReports')])] from Configurables import TriggerTisTos ToolSvc().addTool(TriggerTisTos, 'SwimmingDebugTisTos') ToolSvc().SwimmingDebugTisTos.TOSFracMuon = 0.0 ToolSvc().SwimmingDebugTisTos.TOSFracTT = 0.0 for conf, d in decoders: configurable = conf('Swimming' + d[0][1].split('/')[-1]) print configurable try: configurable.InputRawEventLocation = 'PrevTrig/RawEvent' except: configurable.RawEventLocations = [ 'PrevTrig/RawEvent' ] + configurable.RawEventLocations output = None for prop, loc in d: if not output: output = prefix + '/' + loc setattr(configurable, prop, prefix + '/' + loc) DataOnDemandSvc().AlgMap[output] = configurable prop = d[0][0][6:] print prop, output setattr(ToolSvc().SwimmingDebugTisTos, prop, output) class Deathstar(object): def __init__(self, seq): self._seq = seq def insert(self): ApplicationMgr().TopAlg.insert(0, self._seq) d = Deathstar(deathstar) appendPostConfigAction(d.insert)
from Gaudi.Configuration import * from Configurables import Moore ## Create a local TCK Moore().TCKData = '$MOOREROOT/tests/options/TCKData/' Moore().generateConfig = True Moore().configLabel = 'Test TCK' ## Extra settings required to make things work from Configurables import L0MuonAlg L0MuonAlg("L0Muon").L0DUConfigProviderType = "L0DUConfigProvider"