CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions | Variables
confdb Namespace Reference

Classes

class  HLTProcess
 

Functions

def _fix_parameter
 
def addGlobalOptions
 Disable HF Noise filters in HIon menu if 'hltHfreco' in %(dict)s: %(process)shltHfreco.setNoiseFlags = cms.bool( False ) """ else: self.data += """ Enable HF Noise filters in non-HIon menu if 'hltHfreco' in %(dict)s: %(process)shltHfreco.setNoiseFlags = cms.bool( True ) """. More...
 
def append_filenames
 
def build_source
 
def buildOptions
 
def buildPathList
 
def dumppaths
 
def expand_filenames
 
def fixPrescales
 
def instrumentDQM
 
def instrumentErrorEventType
 
def instrumentOpenMode
 
def instrumentTiming
 
def loadAdditionalConditions
 
def loadCff
 
def loadCffCommand
 
def overrideGlobalTag
 
def overrideL1MenuXml
 
def overrideOutput
 
def overrideParameters
 
def overrideProcessName
 
def runL1Emulator
 
def runL1EmulatorGT
 
def splitter
 
def switchToNewL1Skim
 
def updateMessageLogger
 

Variables

 all_paths
 
 data
 
 parent
 
 source
 

Function Documentation

def confdb._fix_parameter (   self,
  args 
)
private
arguments:
    name:     parameter name (optional)
    type:     parameter type (look for tracked and untracked variants)
    value:    original value
    replace:  replacement value

Definition at line 358 of file confdb.py.

359  def _fix_parameter(self, **args):
360  """arguments:
361  name: parameter name (optional)
362  type: parameter type (look for tracked and untracked variants)
363  value: original value
364  replace: replacement value
365  """
366  if 'name' in args:
367  self.data = re.sub(
368  r'%(name)s = cms(?P<tracked>(?:\.untracked)?)\.%(type)s\( (?P<quote>["\']?)%(value)s(?P=quote)' % args,
369  r'%(name)s = cms\g<tracked>.%(type)s( \g<quote>%(replace)s\g<quote>' % args,
370  self.data)
371  else:
372  self.data = re.sub(
373  r'cms(?P<tracked>(?:\.untracked)?)\.%(type)s\( (?P<quote>["\']?)%(value)s(?P=quote)' % args,
374  r'cms\g<tracked>.%(type)s( \g<quote>%(replace)s\g<quote>' % args,
375  self.data)
376 
def _fix_parameter
Definition: confdb.py:358
def confdb.addGlobalOptions (   self)

Disable HF Noise filters in HIon menu if 'hltHfreco' in %(dict)s: %(process)shltHfreco.setNoiseFlags = cms.bool( False ) """ else: self.data += """ Enable HF Noise filters in non-HIon menu if 'hltHfreco' in %(dict)s: %(process)shltHfreco.setNoiseFlags = cms.bool( True ) """.

untracked parameters with NO default in the code if 'hltHcalDataIntegrityMonitor' in %(dict)s: %(process)shltHcalDataIntegrityMonitor.RawDataLabel = cms.untracked.InputTag("rawDataCollector") if 'hltDt4DSegments' in %(dict)s: %(process)shltDt4DSegments.debug = cms.untracked.bool( False ) """ load 2015 Run-2 L1 Menu for 50ns from L1Trigger.Configuration.customise_overwriteL1Menu import L1Menu_Collisions2015_50ns_v1 as loadL1Menu s = loadL1Menu(s) """ %(procfrag,procfrag) elif '25ns14e33_v1' in self.config.type : self.data += """ load 2015 Run-2 L1 Menu for 25ns from L1Trigger.Configuration.customise_overwriteL1Menu import L1Menu_Collisions2015_25ns_v2 as loadL1menu s = loadL1menu(s) """ %(procfrag,procfrag) elif '50ns' in self.config.type : self.data += """ load 2015 Run-2 L1 Menu for 50ns from L1Trigger.Configuration.customise_overwriteL1Menu import L1Menu_Collisions2015_50ns_v4 as loadL1Menu s = loadL1Menu(s) """ %(procfrag,procfrag) elif 'HIon' in self.config.type : self.data += """ load 2015 Run-2 L1 Menu for HIon from L1Trigger.Configuration.customise_overwriteL1Menu import L1Menu_CollisionsHeavyIons2015_v0 as loadL1Menu s = loadL1Menu(s) """ %(procfrag,procfrag) elif 'LowPU' in self.config.type : self.data += """ load 2015 Run-2 L1 Menu for LowPU from L1Trigger.Configuration.customise_overwriteL1Menu import L1Menu_Collisions2015_lowPU_v4 as loadL1Menu s = loadL1Menu(s) """ %(procfrag,procfrag) else : self.data += """ load 2015 Run-2 L1 Menu for 25ns (default for GRun, PIon) from L1Trigger.Configuration.customise_overwriteL1Menu import L1Menu_Collisions2015_25ns_v2 as loadL1menu s = loadL1menu(s) """ %(procfrag,procfrag)

Definition at line 340 of file confdb.py.

341  def addGlobalOptions(self):
342  # add global options
343  self.data += """
344 # limit the number of events to be processed
345 %%(process)smaxEvents = cms.untracked.PSet(
346  input = cms.untracked.int32( %d )
347 )
348 """ % self.config.events
349 
350  if not self.config.profiling:
351  self.data += """
352 # enable the TrigReport and TimeReport
353 %(process)soptions = cms.untracked.PSet(
354  wantSummary = cms.untracked.bool( True )
355 )
356 """
357 
def addGlobalOptions
Disable HF Noise filters in HIon menu if &#39;hltHfreco&#39; in %(dict)s: %(process)shltHfreco.setNoiseFlags = cms.bool( False ) &quot;&quot;" else: self.data += &quot;&quot;" Enable HF Noise filters in non-HIon menu if &#39;hltHfreco&#39; in %(dict)s: %(process)shltHfreco.setNoiseFlags = cms.bool( True ) &quot;&quot;".
Definition: confdb.py:340
def confdb.append_filenames (   self,
  name,
  filenames 
)

Definition at line 1006 of file confdb.py.

1007  def append_filenames(self, name, filenames):
1008  if len(filenames) > 255:
1009  token_open = "( *("
1010  token_close = ") )"
1011  else:
1012  token_open = "("
1013  token_close = ")"
1014 
1015  self.data += " %s = cms.untracked.vstring%s\n" % (name, token_open)
1016  for line in filenames:
1017  self.data += " '%s',\n" % line
1018  self.data += " %s,\n" % (token_close)
1019 
def append_filenames
Definition: confdb.py:1006
def confdb.build_source (   self)

Definition at line 1032 of file confdb.py.

1033  def build_source(self):
1034  if self.config.input:
1035  # if a dataset or a list of input files was given, use it
1036  self.source = self.expand_filenames(self.config.input)
1037  elif self.config.online:
1038  # online we always run on data
1039  self.source = [ "file:/tmp/InputCollection.root" ]
1040  elif self.config.data:
1041  # offline we can run on data...
1042  self.source = [ "file:RelVal_Raw_%s_DATA.root" % self.config.type ]
1043  else:
1044  # ...or on mc
1045  self.source = [ "file:RelVal_Raw_%s_MC.root" % self.config.type ]
1046 
1047  if self.config.parent:
1048  # if a dataset or a list of input files was given for the parent data, use it
1049  self.parent = self.expand_filenames(self.config.parent)
1050 
1051  self.data += """
1052 %(process)ssource = cms.Source( "PoolSource",
1053 """
1054  self.append_filenames("fileNames", self.source)
1055  if (self.parent):
1056  self.append_filenames("secondaryFileNames", self.parent)
1057  self.data += """\
1058  inputCommands = cms.untracked.vstring(
1059  'keep *'
1060  )
1061 )
1062 """
def build_source
Definition: confdb.py:1032
def confdb.buildOptions (   self)

Definition at line 914 of file confdb.py.

References python.multivaluedict.append().

915  def buildOptions(self):
916  # common configuration for all scenarios
917  self.options['services'].append( "-DQM" )
918  self.options['services'].append( "-FUShmDQMOutputService" )
919  self.options['services'].append( "-MicroStateService" )
920  self.options['services'].append( "-ModuleWebRegistry" )
921  self.options['services'].append( "-TimeProfilerService" )
922 
923  # remove the DAQ modules and the online definition of the DQMStore and DQMFileSaver
924  # unless a hilton-like configuration has been requested
925  if not self.config.hilton:
926  self.options['services'].append( "-EvFDaqDirector" )
927  self.options['services'].append( "-FastMonitoringService" )
928  self.options['services'].append( "-DQMStore" )
929  self.options['modules'].append( "-hltDQMFileSaver" )
930 
931  if self.config.fragment:
932  # extract a configuration file fragment
933  self.options['essources'].append( "-GlobalTag" )
934  self.options['essources'].append( "-HepPDTESSource" )
935  self.options['essources'].append( "-XMLIdealGeometryESSource" )
936  self.options['essources'].append( "-eegeom" )
937  self.options['essources'].append( "-es_hardcode" )
938  self.options['essources'].append( "-magfield" )
939 
940  self.options['esmodules'].append( "-AutoMagneticFieldESProducer" )
941  self.options['esmodules'].append( "-SlaveField0" )
942  self.options['esmodules'].append( "-SlaveField20" )
943  self.options['esmodules'].append( "-SlaveField30" )
944  self.options['esmodules'].append( "-SlaveField35" )
945  self.options['esmodules'].append( "-SlaveField38" )
946  self.options['esmodules'].append( "-SlaveField40" )
947  self.options['esmodules'].append( "-VBF0" )
948  self.options['esmodules'].append( "-VBF20" )
949  self.options['esmodules'].append( "-VBF30" )
950  self.options['esmodules'].append( "-VBF35" )
951  self.options['esmodules'].append( "-VBF38" )
952  self.options['esmodules'].append( "-VBF40" )
953  self.options['esmodules'].append( "-CSCGeometryESModule" )
954  self.options['esmodules'].append( "-CaloGeometryBuilder" )
955  self.options['esmodules'].append( "-CaloTowerHardcodeGeometryEP" )
956  self.options['esmodules'].append( "-CastorHardcodeGeometryEP" )
957  self.options['esmodules'].append( "-DTGeometryESModule" )
958  self.options['esmodules'].append( "-EcalBarrelGeometryEP" )
959  self.options['esmodules'].append( "-EcalElectronicsMappingBuilder" )
960  self.options['esmodules'].append( "-EcalEndcapGeometryEP" )
961  self.options['esmodules'].append( "-EcalLaserCorrectionService" )
962  self.options['esmodules'].append( "-EcalPreshowerGeometryEP" )
963  self.options['esmodules'].append( "-HcalHardcodeGeometryEP" )
964  self.options['esmodules'].append( "-HcalTopologyIdealEP" )
965  self.options['esmodules'].append( "-MuonNumberingInitialization" )
966  self.options['esmodules'].append( "-ParametrizedMagneticFieldProducer" )
967  self.options['esmodules'].append( "-RPCGeometryESModule" )
968  self.options['esmodules'].append( "-SiStripGainESProducer" )
969  self.options['esmodules'].append( "-SiStripRecHitMatcherESProducer" )
970  self.options['esmodules'].append( "-SiStripQualityESProducer" )
971  self.options['esmodules'].append( "-StripCPEfromTrackAngleESProducer" )
972  self.options['esmodules'].append( "-TrackerDigiGeometryESModule" )
973  self.options['esmodules'].append( "-TrackerGeometricDetESModule" )
974  self.options['esmodules'].append( "-VolumeBasedMagneticFieldESProducer" )
975  self.options['esmodules'].append( "-ZdcHardcodeGeometryEP" )
976  self.options['esmodules'].append( "-hcal_db_producer" )
977  self.options['esmodules'].append( "-L1GtTriggerMaskAlgoTrigTrivialProducer" )
978  self.options['esmodules'].append( "-L1GtTriggerMaskTechTrigTrivialProducer" )
979  self.options['esmodules'].append( "-hltESPEcalTrigTowerConstituentsMapBuilder" )
980  self.options['esmodules'].append( "-hltESPGlobalTrackingGeometryESProducer" )
981  self.options['esmodules'].append( "-hltESPMuonDetLayerGeometryESProducer" )
982  self.options['esmodules'].append( "-hltESPTrackerRecoGeometryESProducer" )
983  self.options['esmodules'].append( "-trackerTopology" )
984 
985  self.options['esmodules'].append( "-CaloTowerGeometryFromDBEP" )
986  self.options['esmodules'].append( "-CastorGeometryFromDBEP" )
987  self.options['esmodules'].append( "-EcalBarrelGeometryFromDBEP" )
988  self.options['esmodules'].append( "-EcalEndcapGeometryFromDBEP" )
989  self.options['esmodules'].append( "-EcalPreshowerGeometryFromDBEP" )
990  self.options['esmodules'].append( "-HcalGeometryFromDBEP" )
991  self.options['esmodules'].append( "-ZdcGeometryFromDBEP" )
992  self.options['esmodules'].append( "-XMLFromDBSource" )
993  self.options['esmodules'].append( "-sistripconn" )
994 
995  self.options['services'].append( "-MessageLogger" )
996 
997  self.options['psets'].append( "-maxEvents" )
998  self.options['psets'].append( "-options" )
999 
1000  if self.config.fragment or (self.config.prescale and (self.config.prescale.lower() == 'none')):
1001  self.options['services'].append( "-PrescaleService" )
1002 
1003  if self.config.fragment or self.config.timing:
1004  self.options['services'].append( "-FastTimerService" )
1005 
def buildOptions
Definition: confdb.py:914
def confdb.buildPathList (   self)

Definition at line 861 of file confdb.py.

862  def buildPathList(self):
863  self.all_paths = self.getPathList()
864 
865  if self.config.paths:
866  # no path list was requested, dump the full table, minus unsupported / unwanted paths
867  paths = self.config.paths.split(',')
868  else:
869  # dump only the requested paths, plus the eventual output endpaths
870  paths = []
871 
872  if self.config.fragment or self.config.output in ('none', 'full'):
873  # 'full' removes all outputs (same as 'none') and then adds a single "keep *" output (see the overrideOutput method)
874  if self.config.paths:
875  # paths are removed by default
876  pass
877  else:
878  # drop all output endpaths
879  paths.append( "-*Output" )
880  elif self.config.output == 'minimal':
881  # drop all output endpaths but HLTDQMResultsOutput
882  if self.config.paths:
883  paths.append( "HLTDQMResultsOutput" )
884  else:
885  paths.append( "-*Output" )
886  paths.append( "HLTDQMResultsOutput" )
887  else:
888  # keep / add back all output endpaths
889  if self.config.paths:
890  paths.append( "*Output" )
891  else:
892  pass # paths are kepy by default
893 
894  # drop unwanted paths for profiling (and timing studies)
895  if self.config.profiling:
896  paths.append( "-HLTriggerFirstPath" )
897  paths.append( "-HLTAnalyzerEndpath" )
898 
899  # this should never be in any dump (nor online menu)
900  paths.append( "-OfflineOutput" )
901 
902  # expand all wildcards
903  paths = self.expandWildcards(paths, self.all_paths)
904 
905  if self.config.paths:
906  # do an "additive" consolidation
907  self.options['paths'] = self.consolidatePositiveList(paths)
908  if not self.options['paths']:
909  raise RuntimeError('Error: option "--paths %s" does not select any valid paths' % self.config.paths)
910  else:
911  # do a "subtractive" consolidation
912  self.options['paths'] = self.consolidateNegativeList(paths)
913 
def buildPathList
Definition: confdb.py:861
def confdb.dumppaths (   paths)
static

Definition at line 855 of file confdb.py.

856  def dumppaths(paths):
857  sys.stderr.write('Path selection:\n')
858  for path in paths:
859  sys.stderr.write('\t%s\n' % path)
860  sys.stderr.write('\n\n')
def dumppaths
Definition: confdb.py:855
def confdb.expand_filenames (   self,
  input 
)

Definition at line 1020 of file confdb.py.

1021  def expand_filenames(self, input):
1022  # check if the input is a dataset or a list of files
1023  if input[0:8] == 'dataset:':
1024  from dasFileQuery import dasFileQuery
1025  # extract the dataset name, and use DAS to fine the list of LFNs
1026  dataset = input[8:]
1027  files = dasFileQuery(dataset)
1028  else:
1029  # assume a comma-separated list of input files
1030  files = self.config.input.split(',')
1031  return files
def expand_filenames
Definition: confdb.py:1020
def confdb.fixPrescales (   self)

Definition at line 377 of file confdb.py.

378  def fixPrescales(self):
379  # update the PrescaleService to match the new list of paths
380  if self.options['paths']:
381  if self.options['paths'][0][0] == '-':
382  # drop requested paths
383  for minuspath in self.options['paths']:
384  path = minuspath[1:]
385  self.data = re.sub(r' cms.PSet\( pathName = cms.string\( "%s" \),\n prescales = cms.vuint32\( .* \)\n \),?\n' % path, '', self.data)
386  else:
387  # keep requested paths
388  for path in self.all_paths:
389  if path not in self.options['paths']:
390  self.data = re.sub(r' cms.PSet\( pathName = cms.string\( "%s" \),\n prescales = cms.vuint32\( .* \)\n \),?\n' % path, '', self.data)
391 
392  if self.config.prescale and (self.config.prescale.lower() != 'none'):
393  # TO DO: check that the requested prescale column is valid
394  self.data += """
395 # force the use of a specific HLT prescale column
396 if 'PrescaleService' in %(dict)s:
397  %(process)sPrescaleService.forceDefault = True
398  %(process)sPrescaleService.lvl1DefaultLabel = '%(prescale)s'
399 """
400 
def fixPrescales
Definition: confdb.py:377
def confdb.instrumentDQM (   self)

Definition at line 822 of file confdb.py.

823  def instrumentDQM(self):
824  if not self.config.hilton:
825  # remove any reference to the hltDQMFileSaver
826  if 'hltDQMFileSaver' in self.data:
827  self.data = re.sub(r'\b(process\.)?hltDQMFileSaver \+ ', '', self.data)
828  self.data = re.sub(r' \+ \b(process\.)?hltDQMFileSaver', '', self.data)
829  self.data = re.sub(r'\b(process\.)?hltDQMFileSaver', '', self.data)
830 
831  # instrument the HLT menu with DQMStore and DQMRootOutputModule suitable for running offline
832  dqmstore = "\n# load the DQMStore and DQMRootOutputModule\n"
833  dqmstore += self.loadCffCommand('DQMServices.Core.DQMStore_cfi')
834  dqmstore += "%(process)sDQMStore.enableMultiThread = True\n"
835  dqmstore += """
836 %(process)sdqmOutput = cms.OutputModule("DQMRootOutputModule",
837  fileName = cms.untracked.string("DQMIO.root")
838 )
839 """
840 
841  empty_path = re.compile(r'.*\b(process\.)?DQMOutput = cms\.EndPath\( *\).*')
842  other_path = re.compile(r'(.*\b(process\.)?DQMOutput = cms\.EndPath\()(.*)')
843  if empty_path.search(self.data):
844  # replace an empty DQMOutput path
845  self.data = empty_path.sub(dqmstore + '\n%(process)sDQMOutput = cms.EndPath( %(process)sdqmOutput )\n', self.data)
846  elif other_path.search(self.data):
847  # prepend the dqmOutput to the DQMOutput path
848  self.data = other_path.sub(dqmstore + r'\g<1> %(process)sdqmOutput +\g<3>', self.data)
849  else:
850  # ceate a new DQMOutput path with the dqmOutput module
851  self.data += dqmstore
852  self.data += '\n%(process)sDQMOutput = cms.EndPath( %(process)sdqmOutput )\n'
853 
def instrumentDQM
Definition: confdb.py:822
def confdb.instrumentErrorEventType (   self)

Definition at line 415 of file confdb.py.

416  def instrumentErrorEventType(self):
417  if self.config.errortype:
418  # change all HLTTriggerTypeFilter EDFilters to accept only error events (SelectedTriggerType = 0)
419  self._fix_parameter(name = 'SelectedTriggerType', type ='int32', value = '1', replace = '0')
420  self._fix_parameter(name = 'SelectedTriggerType', type ='int32', value = '2', replace = '0')
421  self._fix_parameter(name = 'SelectedTriggerType', type ='int32', value = '3', replace = '0')
422 
def instrumentErrorEventType
Definition: confdb.py:415
def confdb.instrumentOpenMode (   self)

Definition at line 401 of file confdb.py.

References join().

402  def instrumentOpenMode(self):
403  if self.config.open:
404  # find all EDfilters
405  filters = [ match[1] for match in re.findall(r'(process\.)?\b(\w+) = cms.EDFilter', self.data) ]
406  re_sequence = re.compile( r'cms\.(Path|Sequence)\((.*)\)' )
407  # remove existing 'cms.ignore' and '~' modifiers
408  self.data = re_sequence.sub( lambda line: re.sub( r'cms\.ignore *\( *((process\.)?\b(\w+)) *\)', r'\1', line.group(0) ), self.data )
409  self.data = re_sequence.sub( lambda line: re.sub( r'~', '', line.group(0) ), self.data )
410  # wrap all EDfilters with "cms.ignore( ... )", 1000 at a time (python 2.6 complains for too-big regular expressions)
411  for some in splitter(filters, 1000):
412  re_filters = re.compile( r'\b((process\.)?(' + r'|'.join(some) + r'))\b' )
413  self.data = re_sequence.sub( lambda line: re_filters.sub( r'cms.ignore( \1 )', line.group(0) ), self.data )
414 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def instrumentOpenMode
Definition: confdb.py:401
def confdb.instrumentTiming (   self)

Definition at line 731 of file confdb.py.

732  def instrumentTiming(self):
733  if self.config.profiling:
734  # instrument the menu for profiling: remove the HLTAnalyzerEndpath, add/override the HLTriggerFirstPath, with hltGetRaw and hltGetConditions
735  text = ''
736 
737  if not 'hltGetRaw' in self.data:
738  # add hltGetRaw
739  text += """
740 %(process)shltGetRaw = cms.EDAnalyzer( "HLTGetRaw",
741  RawDataCollection = cms.InputTag( "rawDataCollector" )
742 )
743 """
744 
745  if not 'hltGetConditions' in self.data:
746  # add hltGetConditions
747  text += """
748 %(process)shltGetConditions = cms.EDAnalyzer( 'EventSetupRecordDataGetter',
749  verbose = cms.untracked.bool( False ),
750  toGet = cms.VPSet( )
751 )
752 """
753 
754  if not 'hltBoolFalse' in self.data:
755  # add hltBoolFalse
756  text += """
757 %(process)shltBoolFalse = cms.EDFilter( "HLTBool",
758  result = cms.bool( False )
759 )
760 """
761 
762  # add the definition of HLTriggerFirstPath
763  # FIXME in a cff, should also update the HLTSchedule
764  text += """
765 %(process)sHLTriggerFirstPath = cms.Path( %(process)shltGetRaw + %(process)shltGetConditions + %(process)shltBoolFalse )
766 """
767  self.data = re.sub(r'.*cms\.(End)?Path.*', text + r'\g<0>', self.data, 1)
768 
769 
770  # instrument the menu with the Service, EDProducer and EndPath needed for timing studies
771  # FIXME in a cff, should also update the HLTSchedule
772  if self.config.timing:
773  self.data += """
774 # instrument the menu with the modules and EndPath needed for timing studies
775 """
776 
777  if not 'FastTimerService' in self.data:
778  self.data += '\n# configure the FastTimerService\n'
779  self.loadCff('HLTrigger.Timer.FastTimerService_cfi')
780  else:
781  self.data += '\n# configure the FastTimerService\n'
782 
783  self.data += """# this is currently ignored in CMSSW 7.x, always using the real time clock
784 %(process)sFastTimerService.useRealTimeClock = True
785 # enable specific features
786 %(process)sFastTimerService.enableTimingPaths = True
787 %(process)sFastTimerService.enableTimingModules = True
788 %(process)sFastTimerService.enableTimingExclusive = True
789 # print a text summary at the end of the job
790 %(process)sFastTimerService.enableTimingSummary = True
791 # skip the first path (disregard the time spent loading event and conditions data)
792 %(process)sFastTimerService.skipFirstPath = True
793 # enable DQM plots
794 %(process)sFastTimerService.enableDQM = True
795 # enable most per-path DQM plots
796 %(process)sFastTimerService.enableDQMbyPathActive = True
797 %(process)sFastTimerService.enableDQMbyPathTotal = True
798 %(process)sFastTimerService.enableDQMbyPathOverhead = False
799 %(process)sFastTimerService.enableDQMbyPathDetails = True
800 %(process)sFastTimerService.enableDQMbyPathCounters = True
801 %(process)sFastTimerService.enableDQMbyPathExclusive = True
802 # disable per-module DQM plots
803 %(process)sFastTimerService.enableDQMbyModule = False
804 %(process)sFastTimerService.enableDQMbyModuleType = False
805 # enable per-event DQM sumary plots
806 %(process)sFastTimerService.enableDQMSummary = True
807 # enable per-event DQM plots by lumisection
808 %(process)sFastTimerService.enableDQMbyLumiSection = True
809 %(process)sFastTimerService.dqmLumiSectionsRange = 2500
810 # set the time resolution of the DQM plots
811 %(process)sFastTimerService.dqmTimeRange = 1000.
812 %(process)sFastTimerService.dqmTimeResolution = 5.
813 %(process)sFastTimerService.dqmPathTimeRange = 100.
814 %(process)sFastTimerService.dqmPathTimeResolution = 0.5
815 %(process)sFastTimerService.dqmModuleTimeRange = 40.
816 %(process)sFastTimerService.dqmModuleTimeResolution = 0.2
817 # set the base DQM folder for the plots
818 %(process)sFastTimerService.dqmPath = 'HLT/TimerService'
819 %(process)sFastTimerService.enableDQMbyProcesses = True
820 """
821 
def instrumentTiming
Definition: confdb.py:731
def confdb.loadAdditionalConditions (   self,
  comment,
  conditions 
)

Definition at line 694 of file confdb.py.

695  def loadAdditionalConditions(self, comment, *conditions):
696  # load additional conditions
697  self.data += """
698 # %s
699 if 'GlobalTag' in %%(dict)s:
700 """ % comment
701  for condition in conditions:
702  self.data += """ %%(process)sGlobalTag.toGet.append(
703  cms.PSet(
704  record = cms.string( '%(record)s' ),
705  tag = cms.string( '%(tag)s' ),
706  label = cms.untracked.string( '%(label)s' ),
707  connect = cms.untracked.string( '%(connect)s' )
708  )
709  )
710 """ % condition
711 
def loadAdditionalConditions
Definition: confdb.py:694
def confdb.loadCff (   self,
  module 
)

Definition at line 719 of file confdb.py.

720  def loadCff(self, module):
721  self.data += self.loadCffCommand(module)
722 
def loadCff
Definition: confdb.py:719
def confdb.loadCffCommand (   self,
  module 
)

Definition at line 712 of file confdb.py.

713  def loadCffCommand(self, module):
714  # load a cfi or cff module
715  if self.config.fragment:
716  return 'from %s import *\n' % module
717  else:
718  return 'process.load( "%s" )\n' % module
def loadCffCommand
Definition: confdb.py:712
def confdb.overrideGlobalTag (   self)

Definition at line 423 of file confdb.py.

424  def overrideGlobalTag(self):
425  # overwrite GlobalTag
426  # the logic is:
427  # - always set the correct connection string and pfnPrefix
428  # - if a GlobalTag is specified on the command line:
429  # - override the global tag
430  # - if the GT is "auto:...", insert the code to read it from Configuration.AlCa.autoCond
431  # - if a GlobalTag is NOT specified on the command line:
432  # - when running on data, do nothing, and keep the global tag in the menu
433  # - when running on mc, take the GT from the configuration.type
434 
435  # override the GlobalTag connection string and pfnPrefix
436  text = """
437 # override the GlobalTag, connection string and pfnPrefix
438 if 'GlobalTag' in %(dict)s:
439 """
440 
441  # when running on MC, override the global tag even if not specified on the command line
442  if not self.config.data and not self.config.globaltag:
443  if self.config.type in globalTag:
444  self.config.globaltag = globalTag[self.config.type]
445  else:
446  self.config.globaltag = globalTag['GRun']
447 
448  # if requested, override the L1 menu from the GlobalTag (using the same connect as the GlobalTag itself)
449  if self.config.l1.override:
450  self.config.l1.record = 'L1GtTriggerMenuRcd'
451  self.config.l1.label = ''
452  self.config.l1.tag = self.config.l1.override
453  if not self.config.l1.connect:
454  self.config.l1.connect = '%(connect)s/CMS_CONDITIONS'
455  self.config.l1cond = '%(tag)s,%(record)s,%(connect)s' % self.config.l1.__dict__
456  else:
457  self.config.l1cond = None
458 
459  if self.config.globaltag or self.config.l1cond:
460  text += " from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag as customiseGlobalTag\n"
461  text += " %(process)sGlobalTag = customiseGlobalTag(%(process)sGlobalTag"
462  if self.config.globaltag:
463  text += ", globaltag = %s" % repr(self.config.globaltag)
464  if self.config.l1cond:
465  text += ", conditions = %s" % repr(self.config.l1cond)
466  text += ")\n"
467 
468  text += """ %(process)sGlobalTag.connect = '%(connect)s/CMS_CONDITIONS'
469  %(process)sGlobalTag.pfnPrefix = cms.untracked.string('%(connect)s/')
470  for pset in process.GlobalTag.toGet.value():
471  pset.connect = pset.connect.value().replace('frontier://FrontierProd/', '%(connect)s/')
472  # fix for multi-run processing
473  %(process)sGlobalTag.RefreshEachRun = cms.untracked.bool( False )
474  %(process)sGlobalTag.ReconnectEachRun = cms.untracked.bool( False )
475 """
476  self.data += text
def overrideGlobalTag
Definition: confdb.py:423
def confdb.overrideL1MenuXml (   self)

Definition at line 477 of file confdb.py.

478  def overrideL1MenuXml(self):
479  # if requested, override the L1 menu from the GlobalTag (Xml file)
480  if self.config.l1Xml.XmlFile:
481  text = """
482 # override the L1 menu from an Xml file
483 %%(process)sl1GtTriggerMenuXml = cms.ESProducer("L1GtTriggerMenuXmlProducer",
484  TriggerMenuLuminosity = cms.string('%(LumiDir)s'),
485  DefXmlFile = cms.string('%(XmlFile)s'),
486  VmeXmlFile = cms.string('')
487 )
488 %%(process)sL1GtTriggerMenuRcdSource = cms.ESSource("EmptyESSource",
489  recordName = cms.string('L1GtTriggerMenuRcd'),
490  iovIsRunNotTime = cms.bool(True),
491  firstValid = cms.vuint32(1)
492 )
493 %%(process)ses_prefer_l1GtParameters = cms.ESPrefer('L1GtTriggerMenuXmlProducer','l1GtTriggerMenuXml')
494 """
495  self.data += text % self.config.l1Xml.__dict__
def overrideL1MenuXml
Definition: confdb.py:477
def confdb.overrideOutput (   self)

Definition at line 611 of file confdb.py.

612  def overrideOutput(self):
613  # override the "online" ShmStreamConsumer output modules with "offline" PoolOutputModule's
614  self.data = re.sub(
615  r'\b(process\.)?hltOutput(\w+) *= *cms\.OutputModule\( *"ShmStreamConsumer" *,',
616  r'%(process)shltOutput\2 = cms.OutputModule( "PoolOutputModule",\n fileName = cms.untracked.string( "output\2.root" ),\n fastCloning = cms.untracked.bool( False ),\n dataset = cms.untracked.PSet(\n filterName = cms.untracked.string( "" ),\n dataTier = cms.untracked.string( "RAW" )\n ),',
617  self.data
618  )
619 
620  if not self.config.fragment and self.config.output == 'full':
621  # add a single "keep *" output
622  self.data += """
623 # add a single "keep *" output
624 %(process)shltOutputFULL = cms.OutputModule( "PoolOutputModule",
625  fileName = cms.untracked.string( "outputFULL.root" ),
626  fastCloning = cms.untracked.bool( False ),
627  dataset = cms.untracked.PSet(
628  dataTier = cms.untracked.string( 'RECO' ),
629  filterName = cms.untracked.string( '' )
630  ),
631  outputCommands = cms.untracked.vstring( 'keep *' )
632 )
633 %(process)sFULLOutput = cms.EndPath( %(process)shltOutputFULL )
634 """
635 
def overrideOutput
Definition: confdb.py:611
def confdb.overrideParameters (   self,
  module,
  parameters 
)

Definition at line 723 of file confdb.py.

724  def overrideParameters(self, module, parameters):
725  # override a module's parameter if the module is present in the configuration
726  self.data += "if '%s' in %%(dict)s:\n" % module
727  for (parameter, value) in parameters:
728  self.data += " %%(process)s%s.%s = %s\n" % (module, parameter, value)
729  self.data += "\n"
730 
def overrideParameters
Definition: confdb.py:723
def confdb.overrideProcessName (   self)

Definition at line 637 of file confdb.py.

638  def overrideProcessName(self):
639  if self.config.name is None:
640  return
641 
642  # sanitise process name
643  self.config.name = self.config.name.replace("_","")
644  # override the process name
645  quote = '[\'\"]'
646  self.data = re.compile(r'^(process\s*=\s*cms\.Process\(\s*' + quote + r')\w+(' + quote + r'\s*\).*)$', re.MULTILINE).sub(r'\1%s\2' % self.config.name, self.data, 1)
647 
648  # the following was stolen and adapted from HLTrigger.Configuration.customL1THLT_Options
649  self.data += """
650 # adapt HLT modules to the correct process name
651 if 'hltTrigReport' in %%(dict)s:
652  %%(process)shltTrigReport.HLTriggerResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
653 
654 if 'hltPreExpressCosmicsOutputSmart' in %%(dict)s:
655  %%(process)shltPreExpressCosmicsOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
656 
657 if 'hltPreExpressOutputSmart' in %%(dict)s:
658  %%(process)shltPreExpressOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
659 
660 if 'hltPreDQMForHIOutputSmart' in %%(dict)s:
661  %%(process)shltPreDQMForHIOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
662 
663 if 'hltPreDQMForPPOutputSmart' in %%(dict)s:
664  %%(process)shltPreDQMForPPOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
665 
666 if 'hltPreHLTDQMResultsOutputSmart' in %%(dict)s:
667  %%(process)shltPreHLTDQMResultsOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
668 
669 if 'hltPreHLTDQMOutputSmart' in %%(dict)s:
670  %%(process)shltPreHLTDQMOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
671 
672 if 'hltPreHLTMONOutputSmart' in %%(dict)s:
673  %%(process)shltPreHLTMONOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
674 
675 if 'hltDQMHLTScalers' in %%(dict)s:
676  %%(process)shltDQMHLTScalers.triggerResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
677  %%(process)shltDQMHLTScalers.processname = '%(name)s'
678 
679 if 'hltDQML1SeedLogicScalers' in %%(dict)s:
680  %%(process)shltDQML1SeedLogicScalers.processname = '%(name)s'
681 """ % self.config.__dict__
682 
def overrideProcessName
Definition: confdb.py:637
def confdb.runL1Emulator (   self)

Definition at line 527 of file confdb.py.

References spr.find().

528  def runL1Emulator(self):
529  # if requested, run (part of) the L1 emulator
530  if self.config.emulator:
531  # FIXME this fragment used "process" explicitly
532  emulator = {
533  'RawToDigi': '',
534  'CustomL1T': '',
535  'CustomHLT': ''
536  }
537 
538  if self.config.data:
539  emulator['RawToDigi'] = 'RawToDigi_Data_cff'
540  else:
541  emulator['RawToDigi'] = 'RawToDigi_cff'
542 
543  if self.config.emulator == 'gt':
544  emulator['CustomL1T'] = 'customiseL1GtEmulatorFromRaw'
545  emulator['CustomHLT'] = 'switchToSimGtDigis'
546  elif self.config.emulator == 'gct,gt':
547  emulator['CustomL1T'] = 'customiseL1CaloAndGtEmulatorsFromRaw'
548  emulator['CustomHLT'] = 'switchToSimGctGtDigis'
549  elif self.config.emulator == 'gmt,gt':
550  # XXX currently unsupported
551  emulator['CustomL1T'] = 'customiseL1MuonAndGtEmulatorsFromRaw'
552  emulator['CustomHLT'] = 'switchToSimGmtGtDigis'
553  elif self.config.emulator in ('gmt,gct,gt', 'gct,gmt,gt', 'all'):
554  emulator['CustomL1T'] = 'customiseL1EmulatorFromRaw'
555  emulator['CustomHLT'] = 'switchToSimGmtGctGtDigis'
556  elif self.config.emulator in ('stage1,gt'):
557  emulator['CustomL1T'] = 'customiseL1EmulatorFromRaw'
558  emulator['CustomHLT'] = 'switchToSimStage1Digis'
559  else:
560  # unsupported argument, default to running the whole emulator
561  emulator['CustomL1T'] = 'customiseL1EmulatorFromRaw'
562  emulator['CustomHLT'] = 'switchToSimGmtGctGtDigis'
563 
564  self.data += """
565 # customize the L1 emulator to run %(CustomL1T)s with HLT to %(CustomHLT)s
566 process.load( 'Configuration.StandardSequences.%(RawToDigi)s' )
567 process.load( 'Configuration.StandardSequences.SimL1Emulator_cff' )
568 import L1Trigger.Configuration.L1Trigger_custom
569 #
570 """ % emulator
571 
572  if (self.config.emulator).find("stage1")>-1:
573  self.data += """
574 # 2015 Run2 emulator
575 import L1Trigger.L1TCalorimeter.L1TCaloStage1_customForHLT
576 process = L1Trigger.L1TCalorimeter.L1TCaloStage1_customForHLT.%(CustomL1T)s( process )
577 """ % emulator
578  else:
579  self.data += """
580 # Run1 Emulator
581 process = L1Trigger.Configuration.L1Trigger_custom.%(CustomL1T)s( process )
582 """ % emulator
583 
584  self.data += """
585 #
586 process = L1Trigger.Configuration.L1Trigger_custom.customiseResetPrescalesAndMasks( process )
587 # customize the HLT to use the emulated results
588 import HLTrigger.Configuration.customizeHLTforL1Emulator
589 process = HLTrigger.Configuration.customizeHLTforL1Emulator.switchToL1Emulator( process )
590 process = HLTrigger.Configuration.customizeHLTforL1Emulator.%(CustomHLT)s( process )
591 """ % emulator
def runL1Emulator
Definition: confdb.py:527
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
def confdb.runL1EmulatorGT (   self)

Definition at line 496 of file confdb.py.

497  def runL1EmulatorGT(self):
498  # if requested, run (part of) the L1 emulator, then repack the data into a new RAW collection, to be used by the HLT
499  if not self.config.emulator:
500  return
501 
502  if self.config.emulator != 'gt':
503  # only the GT emulator is currently supported
504  return
505 
506  # run the L1 GT emulator, then repack the data into a new RAW collection, to be used by the HLT
507  text = """
508 # run the L1 GT emulator, then repack the data into a new RAW collection, to be used by the HLT
509 """
510  if self.config.fragment:
511  # FIXME in a cff, should also update the HLTSchedule
512  text += "import Configuration.StandardSequences.SimL1EmulatorRepack_GT_cff\n"
513  else:
514  text += "process.load( 'Configuration.StandardSequences.SimL1EmulatorRepack_GT_cff' )\n"
515 
516  if not 'hltBoolFalse' in self.data:
517  # add hltBoolFalse
518  text += """
519 %(process)shltBoolFalse = cms.EDFilter( "HLTBool",
520  result = cms.bool( False )
521 )
522 """
523  text += "process.L1Emulator = cms.Path( process.SimL1Emulator + process.hltBoolFalse )\n\n"
524 
525  self.data = re.sub(r'.*cms\.(End)?Path.*', text + r'\g<0>', self.data, 1)
526 
def runL1EmulatorGT
Definition: confdb.py:496
def confdb.splitter (   iterator,
  n 
)

Definition at line 11 of file confdb.py.

References list().

Referenced by TotemT1Organization._FromUnitIDToData(), SplittingConfigurableHisto.fill(), HLTLogMonitorFilter.filter(), FWTriggerTableView.saveImageTo(), FWTableView.saveImageTo(), and SplittingConfigurableHisto.SplittingConfigurableHisto().

11 
12 def splitter(iterator, n):
13  i = iterator.__iter__()
14  while True:
15  l = list(islice(i, n))
16  if l:
17  yield l
18  else:
19  break
20 
def splitter
Definition: confdb.py:11
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
def confdb.switchToNewL1Skim (   self)

Definition at line 592 of file confdb.py.

593  def switchToNewL1Skim(self):
594  # add snippet to switch to new L1 skim files
595  if self.config.l1skim:
596  self.data += """
597 # Customize the menu to use information from new L1 emulator in the L1 skim files
598 process.hltL2MuonSeeds.GMTReadoutCollection = cms.InputTag("simGmtDigis::L1SKIM" )
599 process.hltL1extraParticles.muonSource = cms.InputTag("simGmtDigis::L1SKIM" )
600 for module in process.__dict__.itervalues():
601  if isinstance(module, cms._Module):
602  for parameter in module.__dict__.itervalues():
603  if isinstance(parameter, cms.InputTag):
604  if parameter.moduleLabel == 'hltGtDigis':
605  parameter.moduleLabel = "gtDigisFromSkim"
606  elif parameter.moduleLabel == 'hltL1GtObjectMap':
607  parameter.moduleLabel = "gtDigisFromSkim"
608  elif parameter.moduleLabel == 'hltGctDigis':
609  parameter.moduleLabel ="simCaloStage1LegacyFormatDigis"
610 """
def switchToNewL1Skim
Definition: confdb.py:592
def confdb.updateMessageLogger (   self)

Definition at line 683 of file confdb.py.

684  def updateMessageLogger(self):
685  # request summary informations from the MessageLogger
686  self.data += """
687 if 'MessageLogger' in %(dict)s:
688  %(process)sMessageLogger.categories.append('TriggerSummaryProducerAOD')
689  %(process)sMessageLogger.categories.append('L1GtTrigReport')
690  %(process)sMessageLogger.categories.append('HLTrigReport')
691  %(process)sMessageLogger.categories.append('FastReport')
692 """
693 
def updateMessageLogger
Definition: confdb.py:683

Variable Documentation

confdb.all_paths

Definition at line 862 of file confdb.py.

confdb.data

Definition at line 366 of file confdb.py.

confdb.parent

Definition at line 1048 of file confdb.py.

confdb.source

Definition at line 1035 of file confdb.py.