CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions
confdb.HLTProcess Class Reference
Inheritance diagram for confdb.HLTProcess:

Public Member Functions

def __init__ (self, configuration)
 
def addEras (self)
 
def addGlobalOptions (self)
 
def append_filenames (self, name, filenames)
 
def build_source (self)
 
def buildOptions (self)
 
def buildPathList (self)
 
def customize (self)
 
def dump (self)
 
def expand_filenames (self, input)
 
def fixPrescales (self)
 
def getPathList (self)
 
def getRawConfigurationFromDB (self)
 
def getSetupConfigurationFromDB (self)
 
def instrumentDQM (self)
 
def instrumentErrorEventType (self)
 
def instrumentOpenMode (self)
 
def instrumentTiming (self)
 
def loadAdditionalConditions (self, comment, conditions)
 
def loadCff (self, module)
 
def loadCffCommand (self, module)
 
def loadSetupCff (self)
 
def overrideGlobalTag (self)
 
def overrideL1MenuXml (self)
 
def overrideOutput (self)
 
def overrideParameters (self, module, parameters)
 
def overrideProcessName (self)
 
def runL1Emulator (self)
 
def specificCustomize (self)
 
def updateMessageLogger (self)
 

Static Public Member Functions

def consolidateNegativeList (elements)
 
def consolidatePositiveList (elements)
 
def dumppaths (paths)
 
def expandWildcards (globs, collection)
 

Public Attributes

 all_paths
 
 config
 
 converter
 
 data
 
 labels
 
 options
 
 parent
 
 source
 

Private Member Functions

def _fix_parameter (self, args)
 

Detailed Description

Definition at line 21 of file confdb.py.

Constructor & Destructor Documentation

def confdb.HLTProcess.__init__ (   self,
  configuration 
)

Definition at line 23 of file confdb.py.

23  def __init__(self, configuration):
24  self.config = configuration
25  self.data = None
26  self.source = []
27  self.parent = []
28 
29  self.options = {
30  'essources' : [],
31  'esmodules' : [],
32  'modules' : [],
33  'sequences' : [],
34  'services' : [],
35  'paths' : [],
36  'psets' : [],
37  'blocks' : [],
38  }
39 
40  self.labels = {}
41  if self.config.fragment:
42  self.labels['process'] = 'fragment'
43  self.labels['dict'] = 'fragment.__dict__'
44  else:
45  self.labels['process'] = 'process'
46  self.labels['dict'] = 'process.__dict__'
47 
48  if self.config.online:
49  self.labels['connect'] = 'frontier://FrontierProd'
50  else:
51  self.labels['connect'] = 'frontier://FrontierProd'
52 
53  if self.config.prescale and (self.config.prescale.lower() != 'none'):
54  self.labels['prescale'] = self.config.prescale
55 
56  # get the configuration from ConfdB
57  from confdbOfflineConverter import OfflineConverter
58  self.converter = OfflineConverter(version = self.config.menu.version, database = self.config.menu.database)
59  self.buildPathList()
60  self.buildOptions()
63  self.customize()
64 
def __init__(self, configuration)
Definition: confdb.py:23
def getSetupConfigurationFromDB(self)
Definition: confdb.py:65
def buildOptions(self)
Definition: confdb.py:755
def customize(self)
Definition: confdb.py:237
def getRawConfigurationFromDB(self)
Definition: confdb.py:87
def buildPathList(self)
Definition: confdb.py:699

Member Function Documentation

def confdb.HLTProcess._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 346 of file confdb.py.

References CombinedSVCalibration.data, CombinedTauTagCalibration.data, DOTExport.DotProducer.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, SimpleVFATFrameCollection.data, classes.PlotData.data, dqm::DQMFileSaverOnline::SnapshotFiles.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, QGLikelihoodSystematicsObject.data, TkLasBeam.data, GeometryComparisonPlotter.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, VFATFrame.data, and edmStreamStallGrapher.Stack.data.

Referenced by confdb.HLTProcess.customize(), and confdb.HLTProcess.instrumentErrorEventType().

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

Definition at line 327 of file confdb.py.

References CombinedSVCalibration.data, CombinedTauTagCalibration.data, DOTExport.DotProducer.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, SimpleVFATFrameCollection.data, classes.PlotData.data, dqm::DQMFileSaverOnline::SnapshotFiles.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, QGLikelihoodSystematicsObject.data, TkLasBeam.data, GeometryComparisonPlotter.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, VFATFrame.data, and edmStreamStallGrapher.Stack.data.

Referenced by confdb.HLTProcess.customize().

327  def addGlobalOptions(self):
328  # add global options
329  self.data += """
330 # limit the number of events to be processed
331 %%(process)s.maxEvents = cms.untracked.PSet(
332  input = cms.untracked.int32( %d )
333 )
334 """ % self.config.events
335 
336  self.data += """
337 # enable TrigReport, TimeReport and MultiThreading
338 %(process)s.options = cms.untracked.PSet(
339  wantSummary = cms.untracked.bool( True ),
340  numberOfThreads = cms.untracked.uint32( 4 ),
341  numberOfStreams = cms.untracked.uint32( 0 ),
342  sizeOfStackForThreadsInKB = cms.untracked.uint32( 10*1024 )
343 )
344 """
345 
def addGlobalOptions(self)
Definition: confdb.py:327
def confdb.HLTProcess.append_filenames (   self,
  name,
  filenames 
)
def confdb.HLTProcess.build_source (   self)

Definition at line 873 of file confdb.py.

References confdb.HLTProcess.append_filenames(), CombinedSVCalibration.data, DOTExport.DotProducer.data, CombinedTauTagCalibration.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, SimpleVFATFrameCollection.data, classes.PlotData.data, QGLikelihoodObject.data, dqm::DQMFileSaverOnline::SnapshotFiles.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, QGLikelihoodSystematicsObject.data, TkLasBeam.data, GeometryComparisonPlotter.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, VFATFrame.data, edmStreamStallGrapher.Stack.data, confdb.HLTProcess.expand_filenames(), confdb.HLTProcess.parent, FWPSetTableManager::PSetData.parent, BeautifulSoup.PageElement.parent, confdb.HLTProcess.source, lhef::XMLDocument.source, DQMNet::Peer.source, Config.Process.source, gen::Hydjet2Hadronizer.source, and BeautifulSoup.ResultSet.source.

Referenced by confdb.HLTProcess.customize().

873  def build_source(self):
874  if self.config.input:
875  # if a dataset or a list of input files was given, use it
876  self.source = self.expand_filenames(self.config.input)
877  elif self.config.online:
878  # online we always run on data
879  self.source = [ "file:/tmp/InputCollection.root" ]
880  elif self.config.data:
881  # offline we can run on data...
882  self.source = [ "file:RelVal_Raw_%s_DATA.root" % self.config.type ]
883  else:
884  # ...or on mc
885  self.source = [ "file:RelVal_Raw_%s_MC.root" % self.config.type ]
886 
887  if self.config.parent:
888  # if a dataset or a list of input files was given for the parent data, use it
889  self.parent = self.expand_filenames(self.config.parent)
890 
891  self.data += """
892 %(process)s.source = cms.Source( "PoolSource",
893 """
894  self.append_filenames("fileNames", self.source)
895  if (self.parent):
896  self.append_filenames("secondaryFileNames", self.parent)
897  self.data += """\
898  inputCommands = cms.untracked.vstring(
899  'keep *'
900  )
901 )
902 """
903 
def expand_filenames(self, input)
Definition: confdb.py:861
def build_source(self)
Definition: confdb.py:873
def append_filenames(self, name, filenames)
Definition: confdb.py:847
def confdb.HLTProcess.buildOptions (   self)

Definition at line 755 of file confdb.py.

References mps_alisetup.append, FileExportPlugin.FileExportPlugin.options, DOTExport.DotProducer.options, and confdb.HLTProcess.options.

755  def buildOptions(self):
756  # common configuration for all scenarios
757  self.options['services'].append( "-DQM" )
758  self.options['services'].append( "-FUShmDQMOutputService" )
759  self.options['services'].append( "-MicroStateService" )
760  self.options['services'].append( "-ModuleWebRegistry" )
761  self.options['services'].append( "-TimeProfilerService" )
762 
763  # remove the DAQ modules and the online definition of the DQMStore and DQMFileSaver
764  # unless a hilton-like configuration has been requested
765  if not self.config.hilton:
766  self.options['services'].append( "-EvFDaqDirector" )
767  self.options['services'].append( "-FastMonitoringService" )
768  self.options['services'].append( "-DQMStore" )
769  self.options['modules'].append( "-hltDQMFileSaver" )
770 
771  if self.config.fragment:
772  # extract a configuration file fragment
773  self.options['essources'].append( "-GlobalTag" )
774  self.options['essources'].append( "-HepPDTESSource" )
775  self.options['essources'].append( "-XMLIdealGeometryESSource" )
776  self.options['essources'].append( "-eegeom" )
777  self.options['essources'].append( "-es_hardcode" )
778  self.options['essources'].append( "-magfield" )
779 
780  self.options['esmodules'].append( "-AutoMagneticFieldESProducer" )
781  self.options['esmodules'].append( "-SlaveField0" )
782  self.options['esmodules'].append( "-SlaveField20" )
783  self.options['esmodules'].append( "-SlaveField30" )
784  self.options['esmodules'].append( "-SlaveField35" )
785  self.options['esmodules'].append( "-SlaveField38" )
786  self.options['esmodules'].append( "-SlaveField40" )
787  self.options['esmodules'].append( "-VBF0" )
788  self.options['esmodules'].append( "-VBF20" )
789  self.options['esmodules'].append( "-VBF30" )
790  self.options['esmodules'].append( "-VBF35" )
791  self.options['esmodules'].append( "-VBF38" )
792  self.options['esmodules'].append( "-VBF40" )
793  self.options['esmodules'].append( "-CSCGeometryESModule" )
794  self.options['esmodules'].append( "-CaloGeometryBuilder" )
795  self.options['esmodules'].append( "-CaloTowerHardcodeGeometryEP" )
796  self.options['esmodules'].append( "-CastorHardcodeGeometryEP" )
797  self.options['esmodules'].append( "-DTGeometryESModule" )
798  self.options['esmodules'].append( "-EcalBarrelGeometryEP" )
799  self.options['esmodules'].append( "-EcalElectronicsMappingBuilder" )
800  self.options['esmodules'].append( "-EcalEndcapGeometryEP" )
801  self.options['esmodules'].append( "-EcalLaserCorrectionService" )
802  self.options['esmodules'].append( "-EcalPreshowerGeometryEP" )
803  self.options['esmodules'].append( "-HcalHardcodeGeometryEP" )
804  self.options['esmodules'].append( "-HcalTopologyIdealEP" )
805  self.options['esmodules'].append( "-MuonNumberingInitialization" )
806  self.options['esmodules'].append( "-ParametrizedMagneticFieldProducer" )
807  self.options['esmodules'].append( "-RPCGeometryESModule" )
808  self.options['esmodules'].append( "-SiStripGainESProducer" )
809  self.options['esmodules'].append( "-SiStripRecHitMatcherESProducer" )
810  self.options['esmodules'].append( "-SiStripQualityESProducer" )
811  self.options['esmodules'].append( "-StripCPEfromTrackAngleESProducer" )
812  self.options['esmodules'].append( "-TrackerDigiGeometryESModule" )
813  self.options['esmodules'].append( "-TrackerGeometricDetESModule" )
814  self.options['esmodules'].append( "-VolumeBasedMagneticFieldESProducer" )
815  self.options['esmodules'].append( "-ZdcHardcodeGeometryEP" )
816  self.options['esmodules'].append( "-hcal_db_producer" )
817  self.options['esmodules'].append( "-L1GtTriggerMaskAlgoTrigTrivialProducer" )
818  self.options['esmodules'].append( "-L1GtTriggerMaskTechTrigTrivialProducer" )
819  self.options['esmodules'].append( "-hltESPEcalTrigTowerConstituentsMapBuilder" )
820  self.options['esmodules'].append( "-hltESPGlobalTrackingGeometryESProducer" )
821  self.options['esmodules'].append( "-hltESPMuonDetLayerGeometryESProducer" )
822  self.options['esmodules'].append( "-hltESPTrackerRecoGeometryESProducer" )
823  self.options['esmodules'].append( "-trackerTopology" )
824 
825  self.options['esmodules'].append( "-CaloTowerGeometryFromDBEP" )
826  self.options['esmodules'].append( "-CastorGeometryFromDBEP" )
827  self.options['esmodules'].append( "-EcalBarrelGeometryFromDBEP" )
828  self.options['esmodules'].append( "-EcalEndcapGeometryFromDBEP" )
829  self.options['esmodules'].append( "-EcalPreshowerGeometryFromDBEP" )
830  self.options['esmodules'].append( "-HcalGeometryFromDBEP" )
831  self.options['esmodules'].append( "-ZdcGeometryFromDBEP" )
832  self.options['esmodules'].append( "-XMLFromDBSource" )
833  self.options['esmodules'].append( "-sistripconn" )
834 
835  self.options['services'].append( "-MessageLogger" )
836 
837  self.options['psets'].append( "-maxEvents" )
838  self.options['psets'].append( "-options" )
839 
840  if self.config.fragment or (self.config.prescale and (self.config.prescale.lower() == 'none')):
841  self.options['services'].append( "-PrescaleService" )
842 
843  if self.config.fragment or self.config.timing:
844  self.options['services'].append( "-FastTimerService" )
845 
846 
def buildOptions(self)
Definition: confdb.py:755
def confdb.HLTProcess.buildPathList (   self)

Definition at line 699 of file confdb.py.

699  def buildPathList(self):
700  self.all_paths = self.getPathList()
701 
702  if self.config.paths:
703  # no path list was requested, dump the full table, minus unsupported / unwanted paths
704  paths = self.config.paths.split(',')
705  else:
706  # dump only the requested paths, plus the eventual output endpaths
707  paths = []
708 
709  if self.config.fragment or self.config.output in ('none', 'full'):
710  # 'full' removes all outputs (same as 'none') and then adds a single "keep *" output (see the overrideOutput method)
711  if self.config.paths:
712  # paths are removed by default
713  pass
714  else:
715  # drop all output endpaths
716  paths.append( "-*Output" )
717  paths.append( "-RatesMonitoring")
718  paths.append( "-DQMHistograms")
719  elif self.config.output == 'minimal':
720  # drop all output endpaths but HLTDQMResultsOutput
721  if self.config.paths:
722  paths.append( "HLTDQMResultsOutput" )
723  else:
724  paths.append( "-*Output" )
725  paths.append( "-RatesMonitoring")
726  paths.append( "-DQMHistograms")
727  paths.append( "HLTDQMResultsOutput" )
728  else:
729  # keep / add back all output endpaths
730  if self.config.paths:
731  paths.append( "*Output" )
732  else:
733  pass # paths are kepy by default
734 
735  # drop unwanted paths for profiling (and timing studies)
736  if self.config.profiling:
737  paths.append( "-HLTAnalyzerEndpath" )
738 
739  # this should never be in any dump (nor online menu)
740  paths.append( "-OfflineOutput" )
741 
742  # expand all wildcards
743  paths = self.expandWildcards(paths, self.all_paths)
744 
745  if self.config.paths:
746  # do an "additive" consolidation
747  self.options['paths'] = self.consolidatePositiveList(paths)
748  if not self.options['paths']:
749  raise RuntimeError('Error: option "--paths %s" does not select any valid paths' % self.config.paths)
750  else:
751  # do a "subtractive" consolidation
752  self.options['paths'] = self.consolidateNegativeList(paths)
753 
754 
def getPathList(self)
Definition: confdb.py:104
def consolidatePositiveList(elements)
Definition: confdb.py:157
def buildPathList(self)
Definition: confdb.py:699
def consolidateNegativeList(elements)
Definition: confdb.py:145
def expandWildcards(globs, collection)
Definition: confdb.py:129
def confdb.HLTProcess.consolidateNegativeList (   elements)
static

Definition at line 145 of file confdb.py.

145  def consolidateNegativeList(elements):
146  # consolidate a list of path exclusions and re-inclusions
147  # the result is the list of paths to be removed from the dump
148  result = set()
149  for element in elements:
150  if element[0] == '-':
151  result.add( element )
152  else:
153  result.discard( '-' + element )
154  return sorted( element for element in result )
155 
def consolidateNegativeList(elements)
Definition: confdb.py:145
def confdb.HLTProcess.consolidatePositiveList (   elements)
static

Definition at line 157 of file confdb.py.

157  def consolidatePositiveList(elements):
158  # consolidate a list of path selection and re-exclusions
159  # the result is the list of paths to be included in the dump
160  result = set()
161  for element in elements:
162  if element[0] == '-':
163  result.discard( element[1:] )
164  else:
165  result.add( element )
166  return sorted( element for element in result )
167 
168 
def consolidatePositiveList(elements)
Definition: confdb.py:157
def confdb.HLTProcess.customize (   self)

Definition at line 237 of file confdb.py.

References confdb.HLTProcess._fix_parameter(), confdb.HLTProcess.addEras(), confdb.HLTProcess.addGlobalOptions(), confdb.HLTProcess.build_source(), DOTExport.DotProducer.data, CombinedSVCalibration.data, CombinedTauTagCalibration.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, SimpleVFATFrameCollection.data, classes.PlotData.data, QGLikelihoodObject.data, dqm::DQMFileSaverOnline::SnapshotFiles.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, QGLikelihoodSystematicsObject.data, TkLasBeam.data, GeometryComparisonPlotter.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, VFATFrame.data, edmStreamStallGrapher.Stack.data, confdb.HLTProcess.fixPrescales(), confdb.HLTProcess.instrumentDQM(), confdb.HLTProcess.instrumentErrorEventType(), confdb.HLTProcess.instrumentOpenMode(), confdb.HLTProcess.instrumentTiming(), confdb.HLTProcess.loadSetupCff(), confdb.HLTProcess.overrideGlobalTag(), confdb.HLTProcess.overrideL1MenuXml(), confdb.HLTProcess.overrideOutput(), confdb.HLTProcess.overrideProcessName(), confdb.HLTProcess.runL1Emulator(), confdb.HLTProcess.specificCustomize(), and confdb.HLTProcess.updateMessageLogger().

237  def customize(self):
238 
239  # adapt the source to the current scenario
240  if not self.config.fragment:
241  self.build_source()
242 
243  # manual override some parameters
244  if self.config.type in ('HIon', ):
245  if self.config.data:
246  if not self.config.fragment:
247  self._fix_parameter( type = 'InputTag', value = 'rawDataCollector', replace = 'rawDataRepacker')
248 
249  # if requested, remove the HLT prescales
250  self.fixPrescales()
251 
252  # if requested, override all ED/HLTfilters to always pass ("open" mode)
253  self.instrumentOpenMode()
254 
255  # if requested, change all HLTTriggerTypeFilter EDFilters to accept only error events (SelectedTriggerType = 0)
257 
258  # if requested, instrument the self with the modules and EndPath needed for timing studies
259  self.instrumentTiming()
260 
261  # if requested, override the L1 self from the GlobalTag (Xml)
262  self.overrideL1MenuXml()
263 
264  # if requested, run the L1 emulator
265  self.runL1Emulator()
266 
267  # add process.load("setup_cff")
268  self.loadSetupCff()
269 
270  if self.config.fragment:
271  self.data += """
272 # dummyfy hltGetConditions in cff's
273 if 'hltGetConditions' in %(dict)s and 'HLTriggerFirstPath' in %(dict)s :
274  %(process)s.hltDummyConditions = cms.EDFilter( "HLTBool",
275  result = cms.bool( True )
276  )
277  %(process)s.HLTriggerFirstPath.replace(%(process)s.hltGetConditions,%(process)s.hltDummyConditions)
278 """
279 
280  else:
281 
282  # override the process name and adapt the relevant filters
283  self.overrideProcessName()
284 
285  # select specific Eras
286  self.addEras()
287 
288  # override the output modules to output root files
289  self.overrideOutput()
290 
291  # add global options
292  self.addGlobalOptions()
293 
294  # if requested or necessary, override the GlobalTag and connection strings (incl. L1!)
295  self.overrideGlobalTag()
296 
297  # request summary informations from the MessageLogger
298  self.updateMessageLogger()
299 
300  # replace DQMStore and DQMRootOutputModule with a configuration suitable for running offline
301  self.instrumentDQM()
302 
303  # load 5.2.x JECs, until they are in the GlobalTag
304 # self.loadAdditionalConditions('load 5.2.x JECs',
305 # {
306 # 'record' : 'JetCorrectionsRecord',
307 # 'tag' : 'JetCorrectorParametersCollection_AK5Calo_2012_V8_hlt_mc',
308 # 'label' : 'AK5CaloHLT',
309 # 'connect' : '%(connect)s/CMS_CONDITIONS'
310 # }, {
311 # 'record' : 'JetCorrectionsRecord',
312 # 'tag' : 'JetCorrectorParametersCollection_AK5PF_2012_V8_hlt_mc',
313 # 'label' : 'AK5PFHLT',
314 # 'connect' : '%(connect)s/CMS_CONDITIONS'
315 # }, {
316 # 'record' : 'JetCorrectionsRecord',
317 # 'tag' : 'JetCorrectorParametersCollection_AK5PFchs_2012_V8_hlt_mc',
318 # 'label' : 'AK5PFchsHLT',
319 # 'connect' : '%(connect)s/CMS_CONDITIONS'
320 # }
321 # )
322 
323  # add specific customisations
324  self.specificCustomize()
325 
326 
def loadSetupCff(self)
Definition: confdb.py:516
def addGlobalOptions(self)
Definition: confdb.py:327
def overrideProcessName(self)
Definition: confdb.py:523
def runL1Emulator(self)
Definition: confdb.py:476
def instrumentErrorEventType(self)
Definition: confdb.py:403
def overrideOutput(self)
Definition: confdb.py:486
def customize(self)
Definition: confdb.py:237
def addEras(self)
Definition: confdb.py:510
def updateMessageLogger(self)
Definition: confdb.py:569
def overrideL1MenuXml(self)
Definition: confdb.py:466
def overrideGlobalTag(self)
Definition: confdb.py:411
def specificCustomize(self)
Definition: confdb.py:179
def instrumentOpenMode(self)
Definition: confdb.py:389
def build_source(self)
Definition: confdb.py:873
def instrumentDQM(self)
Definition: confdb.py:660
def fixPrescales(self)
Definition: confdb.py:365
def instrumentTiming(self)
Definition: confdb.py:618
def _fix_parameter(self, args)
Definition: confdb.py:346
def confdb.HLTProcess.dumppaths (   paths)
static

Definition at line 693 of file confdb.py.

693  def dumppaths(paths):
694  sys.stderr.write('Path selection:\n')
695  for path in paths:
696  sys.stderr.write('\t%s\n' % path)
697  sys.stderr.write('\n\n')
698 
def dumppaths(paths)
Definition: confdb.py:693
def confdb.HLTProcess.expand_filenames (   self,
  input 
)

Definition at line 861 of file confdb.py.

Referenced by confdb.HLTProcess.build_source().

861  def expand_filenames(self, input):
862  # check if the input is a dataset or a list of files
863  if input[0:8] == 'dataset:':
864  from dasFileQuery import dasFileQuery
865  # extract the dataset name, and use DAS to fine the list of LFNs
866  dataset = input[8:]
867  files = dasFileQuery(dataset)
868  else:
869  # assume a comma-separated list of input files
870  files = self.config.input.split(',')
871  return files
872 
def expand_filenames(self, input)
Definition: confdb.py:861
def confdb.HLTProcess.expandWildcards (   globs,
  collection 
)
static

Definition at line 129 of file confdb.py.

References python.rootplot.root2matplotlib.replace().

129  def expandWildcards(globs, collection):
130  # expand a list of unix-style wildcards matching a given collection
131  # wildcards with no matches are silently discarded
132  matches = []
133  for glob in globs:
134  negate = ''
135  if glob[0] == '-':
136  negate = '-'
137  glob = glob[1:]
138  # translate a unix-style glob expression into a regular expression
139  filter = re.compile(r'^' + glob.replace('?', '.').replace('*', '.*').replace('[!', '[^') + r'$')
140  matches.extend( negate + element for element in collection if filter.match(element) )
141  return matches
142 
143 
def replace(string, replacements)
def expandWildcards(globs, collection)
Definition: confdb.py:129
def confdb.HLTProcess.fixPrescales (   self)

Definition at line 365 of file confdb.py.

References confdb.HLTProcess.all_paths, CombinedTauTagCalibration.data, CombinedSVCalibration.data, DOTExport.DotProducer.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, SimpleVFATFrameCollection.data, classes.PlotData.data, dqm::DQMFileSaverOnline::SnapshotFiles.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, QGLikelihoodSystematicsObject.data, TkLasBeam.data, GeometryComparisonPlotter.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, VFATFrame.data, edmStreamStallGrapher.Stack.data, FileExportPlugin.FileExportPlugin.options, DOTExport.DotProducer.options, and confdb.HLTProcess.options.

Referenced by confdb.HLTProcess.customize().

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

Definition at line 104 of file confdb.py.

104  def getPathList(self):
105  if self.config.menu.run:
106  args = ['--runNumber', self.config.menu.run]
107  else:
108  args = ['--configName', self.config.menu.name]
109  args.extend( (
110  '--cff',
111  '--noedsources',
112  '--noes',
113  '--noservices',
114  '--nosequences',
115  '--nomodules'
116  ) )
117 
118  data, err = self.converter.query( *args )
119  if 'ERROR' in err or 'Exhausted Resultset' in err or 'CONFIG_NOT_FOUND' in err:
120  sys.stderr.write("%s: error while retrieving the list of paths from the HLT menu\n\n" % os.path.basename(sys.argv[0]))
121  sys.stderr.write(err + "\n\n")
122  sys.exit(1)
123  filter = re.compile(r' *= *cms.(End)?Path.*')
124  paths = [ filter.sub('', line) for line in data.splitlines() if filter.search(line) ]
125  return paths
126 
127 
def getPathList(self)
Definition: confdb.py:104
def confdb.HLTProcess.getRawConfigurationFromDB (   self)

Definition at line 87 of file confdb.py.

References CombinedSVCalibration.data, CombinedTauTagCalibration.data, DOTExport.DotProducer.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, SimpleVFATFrameCollection.data, classes.PlotData.data, dqm::DQMFileSaverOnline::SnapshotFiles.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, QGLikelihoodSystematicsObject.data, TkLasBeam.data, GeometryComparisonPlotter.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, VFATFrame.data, edmStreamStallGrapher.Stack.data, and join().

88  if self.config.menu.run:
89  args = ['--runNumber', self.config.menu.run]
90  else:
91  args = ['--configName', self.config.menu.name ]
92  args.append('--noedsources')
93  for key, vals in self.options.iteritems():
94  if vals:
95  args.extend(('--'+key, ','.join(vals)))
96 
97  data, err = self.converter.query( *args )
98  if 'ERROR' in err or 'Exhausted Resultset' in err or 'CONFIG_NOT_FOUND' in err:
99  sys.stderr.write("%s: error while retrieving the HLT menu\n\n" % os.path.basename(sys.argv[0]))
100  sys.stderr.write(err + "\n\n")
101  sys.exit(1)
102  self.data = data
103 
def getRawConfigurationFromDB(self)
Definition: confdb.py:87
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def confdb.HLTProcess.getSetupConfigurationFromDB (   self)

Definition at line 65 of file confdb.py.

References FrontierConditions_GlobalTag_cff.file, join(), python.rootplot.root2matplotlib.replace(), and TriggerAnalyzer.write().

66  if not self.config.setup:
67  return
68  ## if --setup is a python file, use directly that file as setup_cff.py
69  if ".py" in self.config.setup:
70  self.config.setupFile = self.config.setup.split(".py")[0]
71  return
72  args = ['--configName', self.config.setup ]
73  args.append('--noedsources')
74  args.append('--nopaths')
75  for key, vals in self.options.iteritems():
76  if vals:
77  args.extend(('--'+key, ','.join(vals)))
78  args.append('--cff')
79  data, err = self.converter.query( *args )
80  if 'ERROR' in err or 'Exhausted Resultset' in err or 'CONFIG_NOT_FOUND' in err:
81  sys.stderr.write("%s: error while retrieving the HLT setup menu\n\n" % os.path.basename(sys.argv[0]))
82  sys.stderr.write(err + "\n\n")
83  sys.exit(1)
84  self.config.setupFile = "setup_"+self.config.setup[1:].replace("/","_")+"_cff"
85  file(self.config.setupFile+".py","w+").write("# This file is automatically generated by hltGetConfiguration.\n" + data)
86 
def getSetupConfigurationFromDB(self)
Definition: confdb.py:65
def replace(string, replacements)
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def write(self, setup)
def confdb.HLTProcess.instrumentDQM (   self)

Definition at line 660 of file confdb.py.

References CombinedSVCalibration.data, CombinedTauTagCalibration.data, DOTExport.DotProducer.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, SimpleVFATFrameCollection.data, classes.PlotData.data, dqm::DQMFileSaverOnline::SnapshotFiles.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, QGLikelihoodSystematicsObject.data, TkLasBeam.data, GeometryComparisonPlotter.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, VFATFrame.data, edmStreamStallGrapher.Stack.data, and confdb.HLTProcess.loadCffCommand().

Referenced by confdb.HLTProcess.customize().

660  def instrumentDQM(self):
661  if not self.config.hilton:
662  # remove any reference to the hltDQMFileSaver
663  if 'hltDQMFileSaver' in self.data:
664  self.data = re.sub(r'\b(process\.)?hltDQMFileSaver \+ ', '', self.data)
665  self.data = re.sub(r' \+ \b(process\.)?hltDQMFileSaver', '', self.data)
666  self.data = re.sub(r'\b(process\.)?hltDQMFileSaver', '', self.data)
667 
668  # instrument the HLT menu with DQMStore and DQMRootOutputModule suitable for running offline
669  dqmstore = "\n# load the DQMStore and DQMRootOutputModule\n"
670  dqmstore += self.loadCffCommand('DQMServices.Core.DQMStore_cfi')
671  dqmstore += "%(process)s.DQMStore.enableMultiThread = True\n"
672  dqmstore += """
673 %(process)s.dqmOutput = cms.OutputModule("DQMRootOutputModule",
674  fileName = cms.untracked.string("DQMIO.root")
675 )
676 """
677 
678  empty_path = re.compile(r'.*\b(process\.)?DQMOutput = cms\.EndPath\( *\).*')
679  other_path = re.compile(r'(.*\b(process\.)?DQMOutput = cms\.EndPath\()(.*)')
680  if empty_path.search(self.data):
681  # replace an empty DQMOutput path
682  self.data = empty_path.sub(dqmstore + '\n%(process)s.DQMOutput = cms.EndPath( %(process)s.dqmOutput )\n', self.data)
683  elif other_path.search(self.data):
684  # prepend the dqmOutput to the DQMOutput path
685  self.data = other_path.sub(dqmstore + r'\g<1> %(process)s.dqmOutput +\g<3>', self.data)
686  else:
687  # ceate a new DQMOutput path with the dqmOutput module
688  self.data += dqmstore
689  self.data += '\n%(process)s.DQMOutput = cms.EndPath( %(process)s.dqmOutput )\n'
690 
691 
def loadCffCommand(self, module)
Definition: confdb.py:599
def instrumentDQM(self)
Definition: confdb.py:660
def confdb.HLTProcess.instrumentErrorEventType (   self)

Definition at line 403 of file confdb.py.

References confdb.HLTProcess._fix_parameter().

Referenced by confdb.HLTProcess.customize().

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

Definition at line 389 of file confdb.py.

References CombinedSVCalibration.data, CombinedTauTagCalibration.data, DOTExport.DotProducer.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, SimpleVFATFrameCollection.data, classes.PlotData.data, dqm::DQMFileSaverOnline::SnapshotFiles.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, QGLikelihoodSystematicsObject.data, TkLasBeam.data, GeometryComparisonPlotter.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, VFATFrame.data, edmStreamStallGrapher.Stack.data, and join().

Referenced by confdb.HLTProcess.customize().

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

Definition at line 618 of file confdb.py.

References CombinedSVCalibration.data, CombinedTauTagCalibration.data, DOTExport.DotProducer.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, SimpleVFATFrameCollection.data, classes.PlotData.data, dqm::DQMFileSaverOnline::SnapshotFiles.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, QGLikelihoodSystematicsObject.data, TkLasBeam.data, GeometryComparisonPlotter.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, VFATFrame.data, edmStreamStallGrapher.Stack.data, and confdb.HLTProcess.loadCff().

Referenced by confdb.HLTProcess.customize().

618  def instrumentTiming(self):
619 
620  if self.config.timing:
621  self.data += """
622 # instrument the menu with the modules and EndPath needed for timing studies
623 """
624 
625  self.data += '\n# configure the FastTimerService\n'
626  self.loadCff('HLTrigger.Timer.FastTimerService_cfi')
627 
628  self.data += """# print a text summary at the end of the job
629 %(process)s.FastTimerService.printEventSummary = False
630 %(process)s.FastTimerService.printRunSummary = False
631 %(process)s.FastTimerService.printJobSummary = True
632 
633 # enable DQM plots
634 %(process)s.FastTimerService.enableDQM = True
635 
636 # enable per-path DQM plots (starting with CMSSW 9.2.3-patch2)
637 %(process)s.FastTimerService.enableDQMbyPath = True
638 
639 # enable per-module DQM plots
640 %(process)s.FastTimerService.enableDQMbyModule = True
641 
642 # enable per-event DQM plots vs lumisection
643 %(process)s.FastTimerService.enableDQMbyLumiSection = True
644 %(process)s.FastTimerService.dqmLumiSectionsRange = 2500
645 
646 # set the time resolution of the DQM plots
647 %(process)s.FastTimerService.dqmTimeRange = 2000.
648 %(process)s.FastTimerService.dqmTimeResolution = 10.
649 %(process)s.FastTimerService.dqmPathTimeRange = 1000.
650 %(process)s.FastTimerService.dqmPathTimeResolution = 5.
651 %(process)s.FastTimerService.dqmModuleTimeRange = 200.
652 %(process)s.FastTimerService.dqmModuleTimeResolution = 1.
653 
654 # set the base DQM folder for the plots
655 %(process)s.FastTimerService.dqmPath = 'HLT/TimerService'
656 %(process)s.FastTimerService.enableDQMbyProcesses = False
657 """
658 
659 
def loadCff(self, module)
Definition: confdb.py:606
def instrumentTiming(self)
Definition: confdb.py:618
def confdb.HLTProcess.loadAdditionalConditions (   self,
  comment,
  conditions 
)

Definition at line 581 of file confdb.py.

References CombinedSVCalibration.data, CombinedTauTagCalibration.data, DOTExport.DotProducer.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, SimpleVFATFrameCollection.data, classes.PlotData.data, dqm::DQMFileSaverOnline::SnapshotFiles.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, QGLikelihoodSystematicsObject.data, TkLasBeam.data, GeometryComparisonPlotter.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, VFATFrame.data, and edmStreamStallGrapher.Stack.data.

581  def loadAdditionalConditions(self, comment, *conditions):
582  # load additional conditions
583  self.data += """
584 # %s
585 if 'GlobalTag' in %%(dict)s:
586 """ % comment
587  for condition in conditions:
588  self.data += """ %%(process)s.GlobalTag.toGet.append(
589  cms.PSet(
590  record = cms.string( '%(record)s' ),
591  tag = cms.string( '%(tag)s' ),
592  label = cms.untracked.string( '%(label)s' ),
593  connect = cms.untracked.string( '%(connect)s' )
594  )
595  )
596 """ % condition
597 
598 
def loadAdditionalConditions(self, comment, conditions)
Definition: confdb.py:581
def confdb.HLTProcess.loadCffCommand (   self,
  module 
)

Definition at line 599 of file confdb.py.

Referenced by confdb.HLTProcess.instrumentDQM(), and confdb.HLTProcess.loadCff().

599  def loadCffCommand(self, module):
600  # load a cfi or cff module
601  if self.config.fragment:
602  return 'from %s import *\n' % module
603  else:
604  return 'process.load( "%s" )\n' % module
605 
def loadCffCommand(self, module)
Definition: confdb.py:599
def confdb.HLTProcess.overrideGlobalTag (   self)

Definition at line 411 of file confdb.py.

References CombinedSVCalibration.data, CombinedTauTagCalibration.data, DOTExport.DotProducer.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, SimpleVFATFrameCollection.data, classes.PlotData.data, dqm::DQMFileSaverOnline::SnapshotFiles.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, QGLikelihoodSystematicsObject.data, TkLasBeam.data, GeometryComparisonPlotter.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, VFATFrame.data, and edmStreamStallGrapher.Stack.data.

Referenced by confdb.HLTProcess.customize().

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

Definition at line 486 of file confdb.py.

References CombinedSVCalibration.data, CombinedTauTagCalibration.data, DOTExport.DotProducer.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, SimpleVFATFrameCollection.data, classes.PlotData.data, dqm::DQMFileSaverOnline::SnapshotFiles.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, QGLikelihoodSystematicsObject.data, TkLasBeam.data, GeometryComparisonPlotter.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, VFATFrame.data, and edmStreamStallGrapher.Stack.data.

Referenced by confdb.HLTProcess.customize().

486  def overrideOutput(self):
487  # override the "online" ShmStreamConsumer output modules with "offline" PoolOutputModule's
488  self.data = re.sub(
489  r'\b(process\.)?hltOutput(\w+) *= *cms\.OutputModule\( *"ShmStreamConsumer" *,',
490  r'%(process)s.hltOutput\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 ),',
491  self.data
492  )
493 
494  if not self.config.fragment and self.config.output == 'full':
495  # add a single "keep *" output
496  self.data += """
497 # add a single "keep *" output
498 %(process)s.hltOutputFULL = cms.OutputModule( "PoolOutputModule",
499  fileName = cms.untracked.string( "outputFULL.root" ),
500  fastCloning = cms.untracked.bool( False ),
501  dataset = cms.untracked.PSet(
502  dataTier = cms.untracked.string( 'RECO' ),
503  filterName = cms.untracked.string( '' )
504  ),
505  outputCommands = cms.untracked.vstring( 'keep *' )
506 )
507 %(process)s.FULLOutput = cms.EndPath( %(process)s.hltOutputFULL )
508 """
def overrideOutput(self)
Definition: confdb.py:486
def confdb.HLTProcess.overrideParameters (   self,
  module,
  parameters 
)
def confdb.HLTProcess.overrideProcessName (   self)

Definition at line 523 of file confdb.py.

References CombinedSVCalibration.data, CombinedTauTagCalibration.data, DOTExport.DotProducer.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, SimpleVFATFrameCollection.data, classes.PlotData.data, dqm::DQMFileSaverOnline::SnapshotFiles.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, QGLikelihoodSystematicsObject.data, TkLasBeam.data, GeometryComparisonPlotter.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, VFATFrame.data, and edmStreamStallGrapher.Stack.data.

Referenced by confdb.HLTProcess.customize().

524  if self.config.name is None:
525  return
526 
527  # sanitise process name
528  self.config.name = self.config.name.replace("_","")
529  # override the process name
530  quote = '[\'\"]'
531  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)
532 
533  # the following was stolen and adapted from HLTrigger.Configuration.customL1THLT_Options
534  self.data += """
535 # adapt HLT modules to the correct process name
536 if 'hltTrigReport' in %%(dict)s:
537  %%(process)s.hltTrigReport.HLTriggerResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
538 
539 if 'hltPreExpressCosmicsOutputSmart' in %%(dict)s:
540  %%(process)s.hltPreExpressCosmicsOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
541 
542 if 'hltPreExpressOutputSmart' in %%(dict)s:
543  %%(process)s.hltPreExpressOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
544 
545 if 'hltPreDQMForHIOutputSmart' in %%(dict)s:
546  %%(process)s.hltPreDQMForHIOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
547 
548 if 'hltPreDQMForPPOutputSmart' in %%(dict)s:
549  %%(process)s.hltPreDQMForPPOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
550 
551 if 'hltPreHLTDQMResultsOutputSmart' in %%(dict)s:
552  %%(process)s.hltPreHLTDQMResultsOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
553 
554 if 'hltPreHLTDQMOutputSmart' in %%(dict)s:
555  %%(process)s.hltPreHLTDQMOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
556 
557 if 'hltPreHLTMONOutputSmart' in %%(dict)s:
558  %%(process)s.hltPreHLTMONOutputSmart.hltResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
559 
560 if 'hltDQMHLTScalers' in %%(dict)s:
561  %%(process)s.hltDQMHLTScalers.triggerResults = cms.InputTag( 'TriggerResults', '', '%(name)s' )
562  %%(process)s.hltDQMHLTScalers.processname = '%(name)s'
563 
564 if 'hltDQML1SeedLogicScalers' in %%(dict)s:
565  %%(process)s.hltDQML1SeedLogicScalers.processname = '%(name)s'
566 """ % self.config.__dict__
567 
568 
def overrideProcessName(self)
Definition: confdb.py:523
def confdb.HLTProcess.runL1Emulator (   self)

Definition at line 476 of file confdb.py.

References CombinedSVCalibration.data, CombinedTauTagCalibration.data, DOTExport.DotProducer.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, SimpleVFATFrameCollection.data, classes.PlotData.data, dqm::DQMFileSaverOnline::SnapshotFiles.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, QGLikelihoodSystematicsObject.data, TkLasBeam.data, GeometryComparisonPlotter.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, VFATFrame.data, and edmStreamStallGrapher.Stack.data.

Referenced by confdb.HLTProcess.customize().

476  def runL1Emulator(self):
477  # if requested, run the Full L1T emulator, then repack the data into a new RAW collection, to be used by the HLT
478  if self.config.emulator:
479  text = """
480 # run the Full L1T emulator, then repack the data into a new RAW collection, to be used by the HLT
481 from HLTrigger.Configuration.CustomConfigs import L1REPACK
482 %%(process)s = L1REPACK(%%(process)s,"%s")
483 """ % (self.config.emulator)
484  self.data += text
485 
def runL1Emulator(self)
Definition: confdb.py:476
def confdb.HLTProcess.specificCustomize (   self)

Definition at line 179 of file confdb.py.

References CombinedSVCalibration.data, CombinedTauTagCalibration.data, DOTExport.DotProducer.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, SimpleVFATFrameCollection.data, classes.PlotData.data, dqm::DQMFileSaverOnline::SnapshotFiles.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, QGLikelihoodSystematicsObject.data, TkLasBeam.data, GeometryComparisonPlotter.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, VFATFrame.data, edmStreamStallGrapher.Stack.data, python.rootplot.root2matplotlib.replace(), confdb.HLTProcess.source, lhef::XMLDocument.source, DQMNet::Peer.source, Config.Process.source, gen::Hydjet2Hadronizer.source, and BeautifulSoup.ResultSet.source.

Referenced by confdb.HLTProcess.customize().

179  def specificCustomize(self):
180  # specific customizations now live in HLTrigger.Configuration.customizeHLTforALL.customizeHLTforAll(.,.)
181  if self.config.fragment:
182  self.data += """
183 # add specific customizations
184 from HLTrigger.Configuration.customizeHLTforALL import customizeHLTforAll
185 fragment = customizeHLTforAll(fragment,"%s")
186 """ % (self.config.type)
187  else:
188  if self.config.type=="Fake":
189  prefix = "run1"
190  else:
191  prefix = "run2"
192  _gtData = "auto:"+prefix+"_hlt_"+self.config.type
193  _gtMc = "auto:"+prefix+"_mc_" +self.config.type
194  self.data += """
195 # add specific customizations
196 _customInfo = {}
197 _customInfo['menuType' ]= "%s"
198 _customInfo['globalTags']= {}
199 _customInfo['globalTags'][True ] = "%s"
200 _customInfo['globalTags'][False] = "%s"
201 _customInfo['inputFiles']={}
202 _customInfo['inputFiles'][True] = "file:RelVal_Raw_%s_DATA.root"
203 _customInfo['inputFiles'][False] = "file:RelVal_Raw_%s_MC.root"
204 _customInfo['maxEvents' ]= %s
205 _customInfo['globalTag' ]= "%s"
206 _customInfo['inputFile' ]= %s
207 _customInfo['realData' ]= %s
208 from HLTrigger.Configuration.customizeHLTforALL import customizeHLTforAll
209 %%(process)s = customizeHLTforAll(%%(process)s,"%s",_customInfo)
210 """ % (self.config.type,_gtData,_gtMc,self.config.type,self.config.type,self.config.events,self.config.globaltag,self.source,self.config.data,self.config.type)
211 
212  self.data += """
213 from HLTrigger.Configuration.customizeHLTforCMSSW import customizeHLTforCMSSW
214 %%(process)s = customizeHLTforCMSSW(%%(process)s,"%s")
215 """ % (self.config.type)
216 
217  # Eras-based customisations
218  self.data += """
219 # Eras-based customisations
220 from HLTrigger.Configuration.Eras import modifyHLTforEras
221 modifyHLTforEras(%(process)s)
222 """
223  # add the user-defined customization functions, if any
224  if self.config.customise:
225  self.data += "\n"
226  self.data += "#User-defined customization functions\n"
227  for customise in self.config.customise.split(","):
228  customiseValues = customise.split(".")
229  if len(customiseValues)>=3: raise Exception("--customise option cannot contain more than one dot.")
230  if len(customiseValues)==1:
231  customiseValues.append("customise")
232  customiseValues[0] = customiseValues[0].replace("/",".")
233  self.data += "from "+customiseValues[0]+" import "+customiseValues[1]+"\n"
234  self.data += "process = "+customiseValues[1]+"(process)\n"
235 
def replace(string, replacements)
def specificCustomize(self)
Definition: confdb.py:179
def confdb.HLTProcess.updateMessageLogger (   self)

Definition at line 569 of file confdb.py.

References CombinedSVCalibration.data, CombinedTauTagCalibration.data, DOTExport.DotProducer.data, TrackProbabilityCalibration.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, confdb.HLTProcess.data, SimpleVFATFrameCollection.data, classes.PlotData.data, dqm::DQMFileSaverOnline::SnapshotFiles.data, QGLikelihoodObject.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, QGLikelihoodSystematicsObject.data, TkLasBeam.data, GeometryComparisonPlotter.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, data, EcalShowerContainmentCorrections::Coefficients.data, cscdqm::Cache.data, DQMNet::Bucket.data, VFATFrame.data, and edmStreamStallGrapher.Stack.data.

Referenced by confdb.HLTProcess.customize().

570  # request summary informations from the MessageLogger
571  self.data += """
572 if 'MessageLogger' in %(dict)s:
573  %(process)s.MessageLogger.categories.append('TriggerSummaryProducerAOD')
574  %(process)s.MessageLogger.categories.append('L1GtTrigReport')
575  %(process)s.MessageLogger.categories.append('L1TGlobalSummary')
576  %(process)s.MessageLogger.categories.append('HLTrigReport')
577  %(process)s.MessageLogger.categories.append('FastReport')
578 """
579 
580 
def updateMessageLogger(self)
Definition: confdb.py:569

Member Data Documentation

confdb.HLTProcess.all_paths

Definition at line 700 of file confdb.py.

Referenced by confdb.HLTProcess.fixPrescales().

confdb.HLTProcess.config

Definition at line 24 of file confdb.py.

confdb.HLTProcess.converter

Definition at line 58 of file confdb.py.

confdb.HLTProcess.labels

Definition at line 40 of file confdb.py.

Referenced by confdb.HLTProcess.dump().

confdb.HLTProcess.parent

Definition at line 27 of file confdb.py.

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget.addMenuEntry(), Vispa.Views.LineDecayView.LineDecayContainer.applyFilter(), Vispa.Views.BoxDecayView.BoxDecayContainer.arrangeUsingRelations(), Vispa.Views.BoxDecayView.BoxDecayContainer.autolayoutAlgorithm(), Vispa.Gui.ZoomableScrollableWidgetOwner.ZoomableScrollableWidgetOwner.autosizeScrollArea(), Vispa.Views.BoxDecayView.BoxDecayContainer.autosizeScrollArea(), confdb.HLTProcess.build_source(), Vispa.Gui.PortWidget.PortWidget.connectionPoint(), Vispa.Main.StartupScreen.StartupScreen.createDescriptionWidget(), Vispa.Views.BoxDecayView.BoxDecayContainer.dataAccessor(), Vispa.Views.LineDecayView.LineDecayContainer.dataAccessor(), Vispa.Views.LineDecayView.DecayLine.dataAccessor(), Vispa.Views.LineDecayView.LineDecayContainer.delete(), Vispa.Views.LineDecayView.DecayNode.delete(), Vispa.Views.LineDecayView.DecayLine.delete(), Vispa.Gui.VispaWidget.VispaWidget.delete(), Vispa.Gui.VispaWidget.VispaWidget.dragWidget(), Vispa.Share.ImageExporter.ImageExporter.exportImageDialog(), Vispa.Views.LineDecayView.DecayLine.extendedSize(), argparse.HelpFormatter._Section.format_help(), python.rootplot.argparse.HelpFormatter._Section.format_help(), edmIntegrityCheck.PublishToFileSystem.get(), Vispa.Gui.VispaWidget.VispaWidget.keyPressEvent(), Vispa.Gui.MenuWidget.MenuWidget.leaveEvent(), Vispa.Gui.ConnectableWidget.ConnectableWidget.leaveEvent(), Vispa.Gui.PortWidget.PortWidget.moduleParent(), Vispa.Gui.WidgetContainer.WidgetContainer.mouseDoubleClickEvent(), Vispa.Gui.VispaWidget.VispaWidget.mouseDoubleClickEvent(), Vispa.Gui.PortConnection.PointToPointConnection.mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget.mousePressEvent(), Vispa.Views.LineDecayView.ParticleWidget.mousePressEvent(), Vispa.Views.LineDecayView.DecayNode.move(), Vispa.Views.LineDecayView.LineDecayContainer.noDecorationsMode(), Vispa.Views.LineDecayView.LineDecayContainer.operationId(), Vispa.Views.LineDecayView.DecayLine.paint(), Vispa.Gui.VispaWidget.VispaWidget.paintEvent(), Vispa.Gui.ConnectableWidget.ConnectableWidget.positionizeMenuWidget(), edmIntegrityCheck.PublishToFileSystem.publish(), Vispa.Views.LineDecayView.DecayLine.qtLineStyle(), Vispa.Views.WidgetView.WidgetView.restoreSelection(), Vispa.Views.WidgetView.WidgetView.select(), Vispa.Gui.PortConnection.PointToPointConnection.select(), Vispa.Gui.VispaWidget.VispaWidget.select(), Vispa.Views.LineDecayView.LineDecayContainer.select(), Vispa.Views.LineDecayView.LineDecayContainer.sizeHint(), Vispa.Views.LineDecayView.LineDecayContainer.tabController(), Vispa.Views.BoxDecayView.BoxDecayContainer.toggleCollapsed(), Vispa.Views.LineDecayView.DecayNode.unite(), Vispa.Views.PropertyView.PropertyView.valueChanged(), Vispa.Views.BoxDecayView.BoxDecayContainer.widgetByObject(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner.widgetDoubleClicked(), and Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner.widgetDragged().

confdb.HLTProcess.source