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 343 of file confdb.py.

344  def _fix_parameter(self, **args):
345  """arguments:
346  name: parameter name (optional)
347  type: parameter type (look for tracked and untracked variants)
348  value: original value
349  replace: replacement value
350  """
351  if 'name' in args:
352  self.data = re.sub(
353  r'%(name)s = cms(?P<tracked>(?:\.untracked)?)\.%(type)s\( (?P<quote>["\']?)%(value)s(?P=quote)' % args,
354  r'%(name)s = cms\g<tracked>.%(type)s( \g<quote>%(replace)s\g<quote>' % args,
355  self.data)
356  else:
357  self.data = re.sub(
358  r'cms(?P<tracked>(?:\.untracked)?)\.%(type)s\( (?P<quote>["\']?)%(value)s(?P=quote)' % args,
359  r'cms\g<tracked>.%(type)s( \g<quote>%(replace)s\g<quote>' % args,
360  self.data)
361 
def _fix_parameter
Definition: confdb.py:343
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 ) """

Definition at line 325 of file confdb.py.

326  def addGlobalOptions(self):
327  # add global options
328  self.data += """
329 # limit the number of events to be processed
330 %%(process)smaxEvents = cms.untracked.PSet(
331  input = cms.untracked.int32( %d )
332 )
333 """ % self.config.events
334 
335  if not self.config.profiling:
336  self.data += """
337 # enable the TrigReport and TimeReport
338 %(process)soptions = cms.untracked.PSet(
339  wantSummary = cms.untracked.bool( True )
340 )
341 """
342 
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:325
def confdb.append_filenames (   self,
  name,
  filenames 
)

Definition at line 991 of file confdb.py.

992  def append_filenames(self, name, filenames):
993  if len(filenames) > 255:
994  token_open = "( *("
995  token_close = ") )"
996  else:
997  token_open = "("
998  token_close = ")"
999 
1000  self.data += " %s = cms.untracked.vstring%s\n" % (name, token_open)
1001  for line in filenames:
1002  self.data += " '%s',\n" % line
1003  self.data += " %s,\n" % (token_close)
1004 
def append_filenames
Definition: confdb.py:991
def confdb.build_source (   self)

Definition at line 1017 of file confdb.py.

1018  def build_source(self):
1019  if self.config.input:
1020  # if a dataset or a list of input files was given, use it
1021  self.source = self.expand_filenames(self.config.input)
1022  elif self.config.online:
1023  # online we always run on data
1024  self.source = [ "file:/tmp/InputCollection.root" ]
1025  elif self.config.data:
1026  # offline we can run on data...
1027  self.source = [ "file:RelVal_Raw_%s_DATA.root" % self.config.type ]
1028  else:
1029  # ...or on mc
1030  self.source = [ "file:RelVal_Raw_%s_MC.root" % self.config.type ]
1031 
1032  if self.config.parent:
1033  # if a dataset or a list of input files was given for the parent data, use it
1034  self.parent = self.expand_filenames(self.config.parent)
1035 
1036  self.data += """
1037 %(process)ssource = cms.Source( "PoolSource",
1038 """
1039  self.append_filenames("fileNames", self.source)
1040  if (self.parent):
1041  self.append_filenames("secondaryFileNames", self.parent)
1042  self.data += """\
1043  inputCommands = cms.untracked.vstring(
1044  'keep *'
1045  )
1046 )
1047 """
def build_source
Definition: confdb.py:1017
def confdb.buildOptions (   self)

Definition at line 899 of file confdb.py.

References python.multivaluedict.append().

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

Definition at line 846 of file confdb.py.

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

Definition at line 840 of file confdb.py.

841  def dumppaths(paths):
842  sys.stderr.write('Path selection:\n')
843  for path in paths:
844  sys.stderr.write('\t%s\n' % path)
845  sys.stderr.write('\n\n')
def dumppaths
Definition: confdb.py:840
def confdb.expand_filenames (   self,
  input 
)

Definition at line 1005 of file confdb.py.

1006  def expand_filenames(self, input):
1007  # check if the input is a dataset or a list of files
1008  if input[0:8] == 'dataset:':
1009  from dasFileQuery import dasFileQuery
1010  # extract the dataset name, and use DAS to fine the list of LFNs
1011  dataset = input[8:]
1012  files = dasFileQuery(dataset)
1013  else:
1014  # assume a comma-separated list of input files
1015  files = self.config.input.split(',')
1016  return files
def expand_filenames
Definition: confdb.py:1005
def confdb.fixPrescales (   self)

Definition at line 362 of file confdb.py.

363  def fixPrescales(self):
364  # update the PrescaleService to match the new list of paths
365  if self.options['paths']:
366  if self.options['paths'][0][0] == '-':
367  # drop requested paths
368  for minuspath in self.options['paths']:
369  path = minuspath[1:]
370  self.data = re.sub(r' cms.PSet\( pathName = cms.string\( "%s" \),\n prescales = cms.vuint32\( .* \)\n \),?\n' % path, '', self.data)
371  else:
372  # keep requested paths
373  for path in self.all_paths:
374  if path not in self.options['paths']:
375  self.data = re.sub(r' cms.PSet\( pathName = cms.string\( "%s" \),\n prescales = cms.vuint32\( .* \)\n \),?\n' % path, '', self.data)
376 
377  if self.config.prescale and (self.config.prescale.lower() != 'none'):
378  # TO DO: check that the requested prescale column is valid
379  self.data += """
380 # force the use of a specific HLT prescale column
381 if 'PrescaleService' in %(dict)s:
382  %(process)sPrescaleService.forceDefault = True
383  %(process)sPrescaleService.lvl1DefaultLabel = '%(prescale)s'
384 """
385 
def fixPrescales
Definition: confdb.py:362
def confdb.instrumentDQM (   self)

Definition at line 807 of file confdb.py.

808  def instrumentDQM(self):
809  if not self.config.hilton:
810  # remove any reference to the hltDQMFileSaver
811  if 'hltDQMFileSaver' in self.data:
812  self.data = re.sub(r'\b(process\.)?hltDQMFileSaver \+ ', '', self.data)
813  self.data = re.sub(r' \+ \b(process\.)?hltDQMFileSaver', '', self.data)
814  self.data = re.sub(r'\b(process\.)?hltDQMFileSaver', '', self.data)
815 
816  # instrument the HLT menu with DQMStore and DQMRootOutputModule suitable for running offline
817  dqmstore = "\n# load the DQMStore and DQMRootOutputModule\n"
818  dqmstore += self.loadCffCommand('DQMServices.Core.DQMStore_cfi')
819  dqmstore += "%(process)sDQMStore.enableMultiThread = True\n"
820  dqmstore += """
821 %(process)sdqmOutput = cms.OutputModule("DQMRootOutputModule",
822  fileName = cms.untracked.string("DQMIO.root")
823 )
824 """
825 
826  empty_path = re.compile(r'.*\b(process\.)?DQMOutput = cms\.EndPath\( *\).*')
827  other_path = re.compile(r'(.*\b(process\.)?DQMOutput = cms\.EndPath\()(.*)')
828  if empty_path.search(self.data):
829  # replace an empty DQMOutput path
830  self.data = empty_path.sub(dqmstore + '\n%(process)sDQMOutput = cms.EndPath( %(process)sdqmOutput )\n', self.data)
831  elif other_path.search(self.data):
832  # prepend the dqmOutput to the DQMOutput path
833  self.data = other_path.sub(dqmstore + r'\g<1> %(process)sdqmOutput +\g<3>', self.data)
834  else:
835  # ceate a new DQMOutput path with the dqmOutput module
836  self.data += dqmstore
837  self.data += '\n%(process)sDQMOutput = cms.EndPath( %(process)sdqmOutput )\n'
838 
def instrumentDQM
Definition: confdb.py:807
def confdb.instrumentErrorEventType (   self)

Definition at line 400 of file confdb.py.

401  def instrumentErrorEventType(self):
402  if self.config.errortype:
403  # change all HLTTriggerTypeFilter EDFilters to accept only error events (SelectedTriggerType = 0)
404  self._fix_parameter(name = 'SelectedTriggerType', type ='int32', value = '1', replace = '0')
405  self._fix_parameter(name = 'SelectedTriggerType', type ='int32', value = '2', replace = '0')
406  self._fix_parameter(name = 'SelectedTriggerType', type ='int32', value = '3', replace = '0')
407 
def instrumentErrorEventType
Definition: confdb.py:400
def confdb.instrumentOpenMode (   self)

Definition at line 386 of file confdb.py.

References join().

387  def instrumentOpenMode(self):
388  if self.config.open:
389  # find all EDfilters
390  filters = [ match[1] for match in re.findall(r'(process\.)?\b(\w+) = cms.EDFilter', self.data) ]
391  re_sequence = re.compile( r'cms\.(Path|Sequence)\((.*)\)' )
392  # remove existing 'cms.ignore' and '~' modifiers
393  self.data = re_sequence.sub( lambda line: re.sub( r'cms\.ignore *\( *((process\.)?\b(\w+)) *\)', r'\1', line.group(0) ), self.data )
394  self.data = re_sequence.sub( lambda line: re.sub( r'~', '', line.group(0) ), self.data )
395  # wrap all EDfilters with "cms.ignore( ... )", 1000 at a time (python 2.6 complains for too-big regular expressions)
396  for some in splitter(filters, 1000):
397  re_filters = re.compile( r'\b((process\.)?(' + r'|'.join(some) + r'))\b' )
398  self.data = re_sequence.sub( lambda line: re_filters.sub( r'cms.ignore( \1 )', line.group(0) ), self.data )
399 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def instrumentOpenMode
Definition: confdb.py:386
def confdb.instrumentTiming (   self)

Definition at line 716 of file confdb.py.

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

Definition at line 679 of file confdb.py.

680  def loadAdditionalConditions(self, comment, *conditions):
681  # load additional conditions
682  self.data += """
683 # %s
684 if 'GlobalTag' in %%(dict)s:
685 """ % comment
686  for condition in conditions:
687  self.data += """ %%(process)sGlobalTag.toGet.append(
688  cms.PSet(
689  record = cms.string( '%(record)s' ),
690  tag = cms.string( '%(tag)s' ),
691  label = cms.untracked.string( '%(label)s' ),
692  connect = cms.untracked.string( '%(connect)s' )
693  )
694  )
695 """ % condition
696 
def loadAdditionalConditions
Definition: confdb.py:679
def confdb.loadCff (   self,
  module 
)

Definition at line 704 of file confdb.py.

705  def loadCff(self, module):
706  self.data += self.loadCffCommand(module)
707 
def loadCff
Definition: confdb.py:704
def confdb.loadCffCommand (   self,
  module 
)

Definition at line 697 of file confdb.py.

698  def loadCffCommand(self, module):
699  # load a cfi or cff module
700  if self.config.fragment:
701  return 'from %s import *\n' % module
702  else:
703  return 'process.load( "%s" )\n' % module
def loadCffCommand
Definition: confdb.py:697
def confdb.overrideGlobalTag (   self)

Definition at line 408 of file confdb.py.

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

Definition at line 462 of file confdb.py.

463  def overrideL1MenuXml(self):
464  # if requested, override the L1 menu from the GlobalTag (Xml file)
465  if self.config.l1Xml.XmlFile:
466  text = """
467 # override the L1 menu from an Xml file
468 %%(process)sl1GtTriggerMenuXml = cms.ESProducer("L1GtTriggerMenuXmlProducer",
469  TriggerMenuLuminosity = cms.string('%(LumiDir)s'),
470  DefXmlFile = cms.string('%(XmlFile)s'),
471  VmeXmlFile = cms.string('')
472 )
473 %%(process)sL1GtTriggerMenuRcdSource = cms.ESSource("EmptyESSource",
474  recordName = cms.string('L1GtTriggerMenuRcd'),
475  iovIsRunNotTime = cms.bool(True),
476  firstValid = cms.vuint32(1)
477 )
478 %%(process)ses_prefer_l1GtParameters = cms.ESPrefer('L1GtTriggerMenuXmlProducer','l1GtTriggerMenuXml')
479 """
480  self.data += text % self.config.l1Xml.__dict__
def overrideL1MenuXml
Definition: confdb.py:462
def confdb.overrideOutput (   self)

Definition at line 596 of file confdb.py.

597  def overrideOutput(self):
598  # override the "online" ShmStreamConsumer output modules with "offline" PoolOutputModule's
599  self.data = re.sub(
600  r'\b(process\.)?hltOutput(\w+) *= *cms\.OutputModule\( *"ShmStreamConsumer" *,',
601  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 ),',
602  self.data
603  )
604 
605  if not self.config.fragment and self.config.output == 'full':
606  # add a single "keep *" output
607  self.data += """
608 # add a single "keep *" output
609 %(process)shltOutputFULL = cms.OutputModule( "PoolOutputModule",
610  fileName = cms.untracked.string( "outputFULL.root" ),
611  fastCloning = cms.untracked.bool( False ),
612  dataset = cms.untracked.PSet(
613  dataTier = cms.untracked.string( 'RECO' ),
614  filterName = cms.untracked.string( '' )
615  ),
616  outputCommands = cms.untracked.vstring( 'keep *' )
617 )
618 %(process)sFULLOutput = cms.EndPath( %(process)shltOutputFULL )
619 """
620 
def overrideOutput
Definition: confdb.py:596
def confdb.overrideParameters (   self,
  module,
  parameters 
)

Definition at line 708 of file confdb.py.

709  def overrideParameters(self, module, parameters):
710  # override a module's parameter if the module is present in the configuration
711  self.data += "if '%s' in %%(dict)s:\n" % module
712  for (parameter, value) in parameters:
713  self.data += " %%(process)s%s.%s = %s\n" % (module, parameter, value)
714  self.data += "\n"
715 
def overrideParameters
Definition: confdb.py:708
def confdb.overrideProcessName (   self)

Definition at line 622 of file confdb.py.

623  def overrideProcessName(self):
624  if self.config.name is None:
625  return
626 
627  # sanitise process name
628  self.config.name = self.config.name.replace("_","")
629  # override the process name
630  quote = '[\'\"]'
631  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)
632 
633  # the following was stolen and adapted from HLTrigger.Configuration.customL1THLT_Options
634  self.data += """
635 # adapt HLT modules to the correct process name
636 if 'hltTrigReport' in %%(dict)s:
637  %%(process)shltTrigReport.HLTriggerResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
638 
639 if 'hltPreExpressCosmicsOutputSmart' in %%(dict)s:
640  %%(process)shltPreExpressCosmicsOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
641 
642 if 'hltPreExpressOutputSmart' in %%(dict)s:
643  %%(process)shltPreExpressOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
644 
645 if 'hltPreDQMForHIOutputSmart' in %%(dict)s:
646  %%(process)shltPreDQMForHIOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
647 
648 if 'hltPreDQMForPPOutputSmart' in %%(dict)s:
649  %%(process)shltPreDQMForPPOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
650 
651 if 'hltPreHLTDQMResultsOutputSmart' in %%(dict)s:
652  %%(process)shltPreHLTDQMResultsOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
653 
654 if 'hltPreHLTDQMOutputSmart' in %%(dict)s:
655  %%(process)shltPreHLTDQMOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
656 
657 if 'hltPreHLTMONOutputSmart' in %%(dict)s:
658  %%(process)shltPreHLTMONOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
659 
660 if 'hltDQMHLTScalers' in %%(dict)s:
661  %%(process)shltDQMHLTScalers.triggerResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
662  %%(process)shltDQMHLTScalers.processname = '%(name)s'
663 
664 if 'hltDQML1SeedLogicScalers' in %%(dict)s:
665  %%(process)shltDQML1SeedLogicScalers.processname = '%(name)s'
666 """ % self.config.__dict__
667 
def overrideProcessName
Definition: confdb.py:622
def confdb.runL1Emulator (   self)

Definition at line 512 of file confdb.py.

References spr.find().

513  def runL1Emulator(self):
514  # if requested, run (part of) the L1 emulator
515  if self.config.emulator:
516  # FIXME this fragment used "process" explicitly
517  emulator = {
518  'RawToDigi': '',
519  'CustomL1T': '',
520  'CustomHLT': ''
521  }
522 
523  if self.config.data:
524  emulator['RawToDigi'] = 'RawToDigi_Data_cff'
525  else:
526  emulator['RawToDigi'] = 'RawToDigi_cff'
527 
528  if self.config.emulator == 'gt':
529  emulator['CustomL1T'] = 'customiseL1GtEmulatorFromRaw'
530  emulator['CustomHLT'] = 'switchToSimGtDigis'
531  elif self.config.emulator == 'gct,gt':
532  emulator['CustomL1T'] = 'customiseL1CaloAndGtEmulatorsFromRaw'
533  emulator['CustomHLT'] = 'switchToSimGctGtDigis'
534  elif self.config.emulator == 'gmt,gt':
535  # XXX currently unsupported
536  emulator['CustomL1T'] = 'customiseL1MuonAndGtEmulatorsFromRaw'
537  emulator['CustomHLT'] = 'switchToSimGmtGtDigis'
538  elif self.config.emulator in ('gmt,gct,gt', 'gct,gmt,gt', 'all'):
539  emulator['CustomL1T'] = 'customiseL1EmulatorFromRaw'
540  emulator['CustomHLT'] = 'switchToSimGmtGctGtDigis'
541  elif self.config.emulator in ('stage1,gt'):
542  emulator['CustomL1T'] = 'customiseL1EmulatorFromRaw'
543  emulator['CustomHLT'] = 'switchToSimStage1Digis'
544  else:
545  # unsupported argument, default to running the whole emulator
546  emulator['CustomL1T'] = 'customiseL1EmulatorFromRaw'
547  emulator['CustomHLT'] = 'switchToSimGmtGctGtDigis'
548 
549  self.data += """
550 # customize the L1 emulator to run %(CustomL1T)s with HLT to %(CustomHLT)s
551 process.load( 'Configuration.StandardSequences.%(RawToDigi)s' )
552 process.load( 'Configuration.StandardSequences.SimL1Emulator_cff' )
553 import L1Trigger.Configuration.L1Trigger_custom
554 #
555 """ % emulator
556 
557  if (self.config.emulator).find("stage1")>-1:
558  self.data += """
559 # 2015 Run2 emulator
560 import L1Trigger.L1TCalorimeter.L1TCaloStage1_customForHLT
561 process = L1Trigger.L1TCalorimeter.L1TCaloStage1_customForHLT.%(CustomL1T)s( process )
562 """ % emulator
563  else:
564  self.data += """
565 # Run1 Emulator
566 process = L1Trigger.Configuration.L1Trigger_custom.%(CustomL1T)s( process )
567 """ % emulator
568 
569  self.data += """
570 #
571 process = L1Trigger.Configuration.L1Trigger_custom.customiseResetPrescalesAndMasks( process )
572 # customize the HLT to use the emulated results
573 import HLTrigger.Configuration.customizeHLTforL1Emulator
574 process = HLTrigger.Configuration.customizeHLTforL1Emulator.switchToL1Emulator( process )
575 process = HLTrigger.Configuration.customizeHLTforL1Emulator.%(CustomHLT)s( process )
576 """ % emulator
def runL1Emulator
Definition: confdb.py:512
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 481 of file confdb.py.

482  def runL1EmulatorGT(self):
483  # if requested, run (part of) the L1 emulator, then repack the data into a new RAW collection, to be used by the HLT
484  if not self.config.emulator:
485  return
486 
487  if self.config.emulator != 'gt':
488  # only the GT emulator is currently supported
489  return
490 
491  # run the L1 GT emulator, then repack the data into a new RAW collection, to be used by the HLT
492  text = """
493 # run the L1 GT emulator, then repack the data into a new RAW collection, to be used by the HLT
494 """
495  if self.config.fragment:
496  # FIXME in a cff, should also update the HLTSchedule
497  text += "import Configuration.StandardSequences.SimL1EmulatorRepack_GT_cff\n"
498  else:
499  text += "process.load( 'Configuration.StandardSequences.SimL1EmulatorRepack_GT_cff' )\n"
500 
501  if not 'hltBoolFalse' in self.data:
502  # add hltBoolFalse
503  text += """
504 %(process)shltBoolFalse = cms.EDFilter( "HLTBool",
505  result = cms.bool( False )
506 )
507 """
508  text += "process.L1Emulator = cms.Path( process.SimL1Emulator + process.hltBoolFalse )\n\n"
509 
510  self.data = re.sub(r'.*cms\.(End)?Path.*', text + r'\g<0>', self.data, 1)
511 
def runL1EmulatorGT
Definition: confdb.py:481
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 577 of file confdb.py.

578  def switchToNewL1Skim(self):
579  # add snippet to switch to new L1 skim files
580  if self.config.l1skim:
581  self.data += """
582 # Customize the menu to use information from new L1 emulator in the L1 skim files
583 process.hltL2MuonSeeds.GMTReadoutCollection = cms.InputTag("simGmtDigis::L1SKIM" )
584 process.hltL1extraParticles.muonSource = cms.InputTag("simGmtDigis::L1SKIM" )
585 for module in process.__dict__.itervalues():
586  if isinstance(module, cms._Module):
587  for parameter in module.__dict__.itervalues():
588  if isinstance(parameter, cms.InputTag):
589  if parameter.moduleLabel == 'hltGtDigis':
590  parameter.moduleLabel = "gtDigisFromSkim"
591  elif parameter.moduleLabel == 'hltL1GtObjectMap':
592  parameter.moduleLabel = "gtDigisFromSkim"
593  elif parameter.moduleLabel == 'hltGctDigis':
594  parameter.moduleLabel ="simCaloStage1LegacyFormatDigis"
595 """
def switchToNewL1Skim
Definition: confdb.py:577
def confdb.updateMessageLogger (   self)

Definition at line 668 of file confdb.py.

669  def updateMessageLogger(self):
670  # request summary informations from the MessageLogger
671  self.data += """
672 if 'MessageLogger' in %(dict)s:
673  %(process)sMessageLogger.categories.append('TriggerSummaryProducerAOD')
674  %(process)sMessageLogger.categories.append('L1GtTrigReport')
675  %(process)sMessageLogger.categories.append('HLTrigReport')
676  %(process)sMessageLogger.categories.append('FastReport')
677 """
678 
def updateMessageLogger
Definition: confdb.py:668

Variable Documentation

confdb.all_paths

Definition at line 847 of file confdb.py.

confdb.data

Definition at line 351 of file confdb.py.

confdb.parent

Definition at line 1033 of file confdb.py.

confdb.source

Definition at line 1020 of file confdb.py.