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.prescale and (self.config.prescale.lower() != 'none'):
49  self.labels['prescale'] = self.config.prescale
50 
51  # get the configuration from ConfdB
52  from confdbOfflineConverter import OfflineConverter
53  self.converter = OfflineConverter(version = self.config.menu.version, database = self.config.menu.database)
54  self.buildPathList()
55  self.buildOptions()
58  self.customize()
59 
def __init__(self, configuration)
Definition: confdb.py:23
def getSetupConfigurationFromDB(self)
Definition: confdb.py:60
def buildOptions(self)
Definition: confdb.py:728
def customize(self)
Definition: confdb.py:232
def getRawConfigurationFromDB(self)
Definition: confdb.py:82
def buildPathList(self)
Definition: confdb.py:663

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 329 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().

329  def _fix_parameter(self, **args):
330  """arguments:
331  name: parameter name (optional)
332  type: parameter type (look for tracked and untracked variants)
333  value: original value
334  replace: replacement value
335  """
336  if 'name' in args:
337  self.data = re.sub(
338  r'%(name)s = cms(?P<tracked>(?:\.untracked)?)\.%(type)s\( (?P<quote>["\']?)%(value)s(?P=quote)' % args,
339  r'%(name)s = cms\g<tracked>.%(type)s( \g<quote>%(replace)s\g<quote>' % args,
340  self.data)
341  else:
342  self.data = re.sub(
343  r'cms(?P<tracked>(?:\.untracked)?)\.%(type)s\( (?P<quote>["\']?)%(value)s(?P=quote)' % args,
344  r'cms\g<tracked>.%(type)s( \g<quote>%(replace)s\g<quote>' % args,
345  self.data)
346 
347 
def _fix_parameter(self, args)
Definition: confdb.py:329
def confdb.HLTProcess.addEras (   self)
def confdb.HLTProcess.addGlobalOptions (   self)

Definition at line 310 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().

310  def addGlobalOptions(self):
311  # add global options
312  self.data += """
313 # limit the number of events to be processed
314 %%(process)s.maxEvents = cms.untracked.PSet(
315  input = cms.untracked.int32( %d )
316 )
317 """ % self.config.events
318 
319  self.data += """
320 # enable TrigReport, TimeReport and MultiThreading
321 %(process)s.options = cms.untracked.PSet(
322  wantSummary = cms.untracked.bool( True ),
323  numberOfThreads = cms.untracked.uint32( 4 ),
324  numberOfStreams = cms.untracked.uint32( 0 ),
325  sizeOfStackForThreadsInKB = cms.untracked.uint32( 10*1024 )
326 )
327 """
328 
def addGlobalOptions(self)
Definition: confdb.py:310
def confdb.HLTProcess.append_filenames (   self,
  name,
  filenames 
)
def confdb.HLTProcess.build_source (   self)

Definition at line 850 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().

850  def build_source(self):
851  if self.config.input:
852  # if a dataset or a list of input files was given, use it
853  self.source = self.expand_filenames(self.config.input)
854  elif self.config.data:
855  # offline we can run on data...
856  self.source = [ "file:RelVal_Raw_%s_DATA.root" % self.config.type ]
857  else:
858  # ...or on mc
859  self.source = [ "file:RelVal_Raw_%s_MC.root" % self.config.type ]
860 
861  if self.config.parent:
862  # if a dataset or a list of input files was given for the parent data, use it
863  self.parent = self.expand_filenames(self.config.parent)
864 
865  self.data += """
866 %(process)s.source = cms.Source( "PoolSource",
867 """
868  self.append_filenames("fileNames", self.source)
869  if (self.parent):
870  self.append_filenames("secondaryFileNames", self.parent)
871  self.data += """\
872  inputCommands = cms.untracked.vstring(
873  'keep *'
874  )
875 )
876 """
877 
def expand_filenames(self, input)
Definition: confdb.py:838
def build_source(self)
Definition: confdb.py:850
def append_filenames(self, name, filenames)
Definition: confdb.py:824
def confdb.HLTProcess.buildOptions (   self)

Definition at line 728 of file confdb.py.

References mps_setup.append, FileExportPlugin.FileExportPlugin.options, DTCalibrationWorker.DTCalibrationWorker.options, DTWorkflow.DTWorkflow.options, DOTExport.DotProducer.options, and confdb.HLTProcess.options.

728  def buildOptions(self):
729  # common configuration for all scenarios
730  self.options['services'].append( "-DQM" )
731  self.options['services'].append( "-FUShmDQMOutputService" )
732  self.options['services'].append( "-MicroStateService" )
733  self.options['services'].append( "-ModuleWebRegistry" )
734  self.options['services'].append( "-TimeProfilerService" )
735 
736  # remove the DAQ modules and the online definition of the DQMStore and DQMFileSaver
737  # unless a hilton-like configuration has been requested
738  if not self.config.hilton:
739  self.options['services'].append( "-EvFDaqDirector" )
740  self.options['services'].append( "-FastMonitoringService" )
741  self.options['services'].append( "-DQMStore" )
742  self.options['modules'].append( "-hltDQMFileSaver" )
743 
744  if self.config.fragment:
745  # extract a configuration file fragment
746  self.options['essources'].append( "-GlobalTag" )
747  self.options['essources'].append( "-HepPDTESSource" )
748  self.options['essources'].append( "-XMLIdealGeometryESSource" )
749  self.options['essources'].append( "-eegeom" )
750  self.options['essources'].append( "-es_hardcode" )
751  self.options['essources'].append( "-magfield" )
752 
753  self.options['esmodules'].append( "-AutoMagneticFieldESProducer" )
754  self.options['esmodules'].append( "-SlaveField0" )
755  self.options['esmodules'].append( "-SlaveField20" )
756  self.options['esmodules'].append( "-SlaveField30" )
757  self.options['esmodules'].append( "-SlaveField35" )
758  self.options['esmodules'].append( "-SlaveField38" )
759  self.options['esmodules'].append( "-SlaveField40" )
760  self.options['esmodules'].append( "-VBF0" )
761  self.options['esmodules'].append( "-VBF20" )
762  self.options['esmodules'].append( "-VBF30" )
763  self.options['esmodules'].append( "-VBF35" )
764  self.options['esmodules'].append( "-VBF38" )
765  self.options['esmodules'].append( "-VBF40" )
766  self.options['esmodules'].append( "-CSCGeometryESModule" )
767  self.options['esmodules'].append( "-CaloGeometryBuilder" )
768  self.options['esmodules'].append( "-CaloTowerHardcodeGeometryEP" )
769  self.options['esmodules'].append( "-CastorHardcodeGeometryEP" )
770  self.options['esmodules'].append( "-DTGeometryESModule" )
771  self.options['esmodules'].append( "-EcalBarrelGeometryEP" )
772  self.options['esmodules'].append( "-EcalElectronicsMappingBuilder" )
773  self.options['esmodules'].append( "-EcalEndcapGeometryEP" )
774  self.options['esmodules'].append( "-EcalLaserCorrectionService" )
775  self.options['esmodules'].append( "-EcalPreshowerGeometryEP" )
776  self.options['esmodules'].append( "-HcalHardcodeGeometryEP" )
777  self.options['esmodules'].append( "-HcalTopologyIdealEP" )
778  self.options['esmodules'].append( "-MuonNumberingInitialization" )
779  self.options['esmodules'].append( "-ParametrizedMagneticFieldProducer" )
780  self.options['esmodules'].append( "-RPCGeometryESModule" )
781  self.options['esmodules'].append( "-SiStripGainESProducer" )
782  self.options['esmodules'].append( "-SiStripRecHitMatcherESProducer" )
783  self.options['esmodules'].append( "-SiStripQualityESProducer" )
784  self.options['esmodules'].append( "-StripCPEfromTrackAngleESProducer" )
785  self.options['esmodules'].append( "-TrackerDigiGeometryESModule" )
786  self.options['esmodules'].append( "-TrackerGeometricDetESModule" )
787  self.options['esmodules'].append( "-VolumeBasedMagneticFieldESProducer" )
788  self.options['esmodules'].append( "-ZdcHardcodeGeometryEP" )
789  self.options['esmodules'].append( "-hcal_db_producer" )
790  self.options['esmodules'].append( "-L1GtTriggerMaskAlgoTrigTrivialProducer" )
791  self.options['esmodules'].append( "-L1GtTriggerMaskTechTrigTrivialProducer" )
792  self.options['esmodules'].append( "-hltESPEcalTrigTowerConstituentsMapBuilder" )
793  self.options['esmodules'].append( "-hltESPGlobalTrackingGeometryESProducer" )
794  self.options['esmodules'].append( "-hltESPMuonDetLayerGeometryESProducer" )
795  self.options['esmodules'].append( "-hltESPTrackerRecoGeometryESProducer" )
796  self.options['esmodules'].append( "-trackerTopology" )
797 
798  self.options['esmodules'].append( "-CaloTowerGeometryFromDBEP" )
799  self.options['esmodules'].append( "-CastorGeometryFromDBEP" )
800  self.options['esmodules'].append( "-EcalBarrelGeometryFromDBEP" )
801  self.options['esmodules'].append( "-EcalEndcapGeometryFromDBEP" )
802  self.options['esmodules'].append( "-EcalPreshowerGeometryFromDBEP" )
803  self.options['esmodules'].append( "-HcalGeometryFromDBEP" )
804  self.options['esmodules'].append( "-ZdcGeometryFromDBEP" )
805  self.options['esmodules'].append( "-XMLFromDBSource" )
806  self.options['esmodules'].append( "-sistripconn" )
807 
808  self.options['services'].append( "-MessageLogger" )
809 
810  self.options['psets'].append( "-maxEvents" )
811  self.options['psets'].append( "-options" )
812 
813  # remove Scouting OutputModules even though the EndPaths are kept
814  self.options['modules'].append( "-hltOutputScoutingCaloMuon" )
815  self.options['modules'].append( "-hltOutputScoutingPF" )
816 
817  if self.config.fragment or (self.config.prescale and (self.config.prescale.lower() == 'none')):
818  self.options['services'].append( "-PrescaleService" )
819 
820  if self.config.fragment or self.config.timing:
821  self.options['services'].append( "-FastTimerService" )
822 
823 
def buildOptions(self)
Definition: confdb.py:728
def confdb.HLTProcess.buildPathList (   self)

Definition at line 663 of file confdb.py.

663  def buildPathList(self):
664  self.all_paths = self.getPathList()
665 
666  if self.config.paths:
667  # no path list was requested, dump the full table, minus unsupported / unwanted paths
668  paths = self.config.paths.split(',')
669  else:
670  # dump only the requested paths, plus the eventual output endpaths
671  paths = []
672 
673  # 'none' should remove all outputs
674  # 'dqm' should remove all outputs but DQMHistograms
675  # 'minimal' should remove all outputs but DQMHistograms, and add a single output module to keep the TriggerResults and TriggerEvent
676  # 'full' should remove all outputs but DQMHistograms, and add a single output module to "keep *"
677  # See also the `overrideOutput` method
678  if self.config.fragment or self.config.output in ('none', ):
679  if self.config.paths:
680  # keep only the Paths and EndPaths requested explicitly
681  pass
682  else:
683  # drop all output EndPaths but the Scouting ones, and drop the RatesMonitoring and DQMHistograms
684  paths.append( "-*Output" )
685  paths.append( "Scouting*Output" )
686  paths.append( "-RatesMonitoring")
687  paths.append( "-DQMHistograms")
688 
689  elif self.config.output in ('dqm', 'minimal', 'full'):
690  if self.config.paths:
691  # keep only the Paths and EndPaths requested explicitly, and the DQMHistograms
692  paths.append( "DQMHistograms" )
693  else:
694  # drop all output EndPaths but the Scouting ones, and drop the RatesMonitoring
695  paths.append( "-*Output" )
696  paths.append( "Scouting*Output" )
697  paths.append( "-RatesMonitoring")
698 
699  else:
700  if self.config.paths:
701  # keep all output EndPaths, including the DQMHistograms
702  paths.append( "*Output" )
703  paths.append( "DQMHistograms" )
704  else:
705  # keep all Paths and EndPaths
706  pass
707 
708  # drop unwanted paths for profiling (and timing studies)
709  if self.config.profiling:
710  paths.append( "-HLTAnalyzerEndpath" )
711 
712  # this should never be in any dump (nor online menu)
713  paths.append( "-OfflineOutput" )
714 
715  # expand all wildcards
716  paths = self.expandWildcards(paths, self.all_paths)
717 
718  if self.config.paths:
719  # do an "additive" consolidation
720  paths = self.consolidatePositiveList(paths)
721  if not paths:
722  raise RuntimeError('Error: option "--paths %s" does not select any valid paths' % self.config.paths)
723  else:
724  # do a "subtractive" consolidation
725  paths = self.consolidateNegativeList(paths)
726  self.options['paths'] = paths
727 
def getPathList(self)
Definition: confdb.py:99
def consolidatePositiveList(elements)
Definition: confdb.py:152
def buildPathList(self)
Definition: confdb.py:663
def consolidateNegativeList(elements)
Definition: confdb.py:140
def expandWildcards(globs, collection)
Definition: confdb.py:124
def confdb.HLTProcess.consolidateNegativeList (   elements)
static

Definition at line 140 of file confdb.py.

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

Definition at line 152 of file confdb.py.

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

Definition at line 232 of file confdb.py.

References confdb.HLTProcess._fix_parameter(), confdb.HLTProcess.addEras(), confdb.HLTProcess.addGlobalOptions(), confdb.HLTProcess.all_paths, 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().

232  def customize(self):
233 
234  # adapt the source to the current scenario
235  if not self.config.fragment:
236  self.build_source()
237 
238  # manual override some parameters
239  if self.config.type in ('HIon', ):
240  if self.config.data:
241  if not self.config.fragment:
242  self._fix_parameter( type = 'InputTag', value = 'rawDataCollector', replace = 'rawDataRepacker')
243 
244  # if requested, remove the HLT prescales
245  self.fixPrescales()
246 
247  # if requested, override all ED/HLTfilters to always pass ("open" mode)
248  self.instrumentOpenMode()
249 
250  # if requested, change all HLTTriggerTypeFilter EDFilters to accept only error events (SelectedTriggerType = 0)
252 
253  # if requested, instrument the self with the modules and EndPath needed for timing studies
254  self.instrumentTiming()
255 
256  # if requested, override the L1 self from the GlobalTag (Xml)
257  self.overrideL1MenuXml()
258 
259  # if requested, run the L1 emulator
260  self.runL1Emulator()
261 
262  # add process.load("setup_cff")
263  self.loadSetupCff()
264 
265  if self.config.fragment:
266  self.data += """
267 # dummyfy hltGetConditions in cff's
268 if 'hltGetConditions' in %(dict)s and 'HLTriggerFirstPath' in %(dict)s :
269  %(process)s.hltDummyConditions = cms.EDFilter( "HLTBool",
270  result = cms.bool( True )
271  )
272  %(process)s.HLTriggerFirstPath.replace(%(process)s.hltGetConditions,%(process)s.hltDummyConditions)
273 """
274 
275  # fix the Scouting EndPaths
276  for path in self.all_paths:
277  match = re.match(r'(Scouting\w+)Output$', path)
278  if match:
279  module = 'hltOutput' + match.group(1)
280  self.data = self.data.replace(path+' = cms.EndPath', path+' = cms.Path')
281  self.data = self.data.replace(' + process.'+module, '')
282 
283  else:
284 
285  # override the process name and adapt the relevant filters
286  self.overrideProcessName()
287 
288  # select specific Eras
289  self.addEras()
290 
291  # override the output modules to output root files
292  self.overrideOutput()
293 
294  # add global options
295  self.addGlobalOptions()
296 
297  # if requested or necessary, override the GlobalTag and connection strings (incl. L1!)
298  self.overrideGlobalTag()
299 
300  # request summary informations from the MessageLogger
301  self.updateMessageLogger()
302 
303  # replace DQMStore and DQMRootOutputModule with a configuration suitable for running offline
304  self.instrumentDQM()
305 
306  # add specific customisations
307  self.specificCustomize()
308 
309 
def loadSetupCff(self)
Definition: confdb.py:507
def addGlobalOptions(self)
Definition: confdb.py:310
def overrideProcessName(self)
Definition: confdb.py:514
def runL1Emulator(self)
Definition: confdb.py:448
def instrumentErrorEventType(self)
Definition: confdb.py:386
def overrideOutput(self)
Definition: confdb.py:458
def customize(self)
Definition: confdb.py:232
def addEras(self)
Definition: confdb.py:501
def updateMessageLogger(self)
Definition: confdb.py:534
def overrideL1MenuXml(self)
Definition: confdb.py:438
def overrideGlobalTag(self)
Definition: confdb.py:394
def specificCustomize(self)
Definition: confdb.py:174
def instrumentOpenMode(self)
Definition: confdb.py:372
def build_source(self)
Definition: confdb.py:850
def instrumentDQM(self)
Definition: confdb.py:624
def fixPrescales(self)
Definition: confdb.py:348
def instrumentTiming(self)
Definition: confdb.py:582
def _fix_parameter(self, args)
Definition: confdb.py:329
def confdb.HLTProcess.dumppaths (   paths)
static

Definition at line 657 of file confdb.py.

657  def dumppaths(paths):
658  sys.stderr.write('Path selection:\n')
659  for path in paths:
660  sys.stderr.write('\t%s\n' % path)
661  sys.stderr.write('\n\n')
662 
def dumppaths(paths)
Definition: confdb.py:657
def confdb.HLTProcess.expand_filenames (   self,
  input 
)

Definition at line 838 of file confdb.py.

Referenced by confdb.HLTProcess.build_source().

838  def expand_filenames(self, input):
839  # check if the input is a dataset or a list of files
840  if input[0:8] == 'dataset:':
841  from dasFileQuery import dasFileQuery
842  # extract the dataset name, and use DAS to fine the list of LFNs
843  dataset = input[8:]
844  files = dasFileQuery(dataset)
845  else:
846  # assume a comma-separated list of input files
847  files = input.split(',')
848  return files
849 
def expand_filenames(self, input)
Definition: confdb.py:838
def confdb.HLTProcess.expandWildcards (   globs,
  collection 
)
static

Definition at line 124 of file confdb.py.

References python.rootplot.root2matplotlib.replace().

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

Definition at line 348 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, DTCalibrationWorker.DTCalibrationWorker.options, DTWorkflow.DTWorkflow.options, DOTExport.DotProducer.options, and confdb.HLTProcess.options.

Referenced by confdb.HLTProcess.customize().

348  def fixPrescales(self):
349  # update the PrescaleService to match the new list of paths
350  if self.options['paths']:
351  if self.options['paths'][0][0] == '-':
352  # drop requested paths
353  for minuspath in self.options['paths']:
354  path = minuspath[1:]
355  self.data = re.sub(r' cms.PSet\( pathName = cms.string\( "%s" \),\n prescales = cms.vuint32\( .* \)\n \),?\n' % path, '', self.data)
356  else:
357  # keep requested paths
358  for path in self.all_paths:
359  if path not in self.options['paths']:
360  self.data = re.sub(r' cms.PSet\( pathName = cms.string\( "%s" \),\n prescales = cms.vuint32\( .* \)\n \),?\n' % path, '', self.data)
361 
362  if self.config.prescale and (self.config.prescale.lower() != 'none'):
363  # TO DO: check that the requested prescale column is valid
364  self.data += """
365 # force the use of a specific HLT prescale column
366 if 'PrescaleService' in %(dict)s:
367  %(process)s.PrescaleService.forceDefault = True
368  %(process)s.PrescaleService.lvl1DefaultLabel = '%(prescale)s'
369 """
370 
371 
def fixPrescales(self)
Definition: confdb.py:348
def confdb.HLTProcess.getPathList (   self)

Definition at line 99 of file confdb.py.

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

Definition at line 82 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().

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

Definition at line 60 of file confdb.py.

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

61  if not self.config.setup:
62  return
63  ## if --setup is a python file, use directly that file as setup_cff.py
64  if ".py" in self.config.setup:
65  self.config.setupFile = self.config.setup.split(".py")[0]
66  return
67  args = ['--configName', self.config.setup ]
68  args.append('--noedsources')
69  args.append('--nopaths')
70  for key, vals in self.options.iteritems():
71  if vals:
72  args.extend(('--'+key, ','.join(vals)))
73  args.append('--cff')
74  data, err = self.converter.query( *args )
75  if 'ERROR' in err or 'Exhausted Resultset' in err or 'CONFIG_NOT_FOUND' in err:
76  sys.stderr.write("%s: error while retrieving the HLT setup menu\n\n" % os.path.basename(sys.argv[0]))
77  sys.stderr.write(err + "\n\n")
78  sys.exit(1)
79  self.config.setupFile = "setup_"+self.config.setup[1:].replace("/","_")+"_cff"
80  file(self.config.setupFile+".py","w+").write("# This file is automatically generated by hltGetConfiguration.\n" + data)
81 
def getSetupConfigurationFromDB(self)
Definition: confdb.py:60
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 624 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().

624  def instrumentDQM(self):
625  if not self.config.hilton:
626  # remove any reference to the hltDQMFileSaver
627  if 'hltDQMFileSaver' in self.data:
628  self.data = re.sub(r'\b(process\.)?hltDQMFileSaver \+ ', '', self.data)
629  self.data = re.sub(r' \+ \b(process\.)?hltDQMFileSaver', '', self.data)
630  self.data = re.sub(r'\b(process\.)?hltDQMFileSaver', '', self.data)
631 
632  # instrument the HLT menu with DQMStore and DQMRootOutputModule suitable for running offline
633  dqmstore = "\n# load the DQMStore and DQMRootOutputModule\n"
634  dqmstore += self.loadCffCommand('DQMServices.Core.DQMStore_cfi')
635  dqmstore += "%(process)s.DQMStore.enableMultiThread = True\n"
636  dqmstore += """
637 %(process)s.dqmOutput = cms.OutputModule("DQMRootOutputModule",
638  fileName = cms.untracked.string("DQMIO.root")
639 )
640 """
641 
642  empty_path = re.compile(r'.*\b(process\.)?DQMOutput = cms\.EndPath\( *\).*')
643  other_path = re.compile(r'(.*\b(process\.)?DQMOutput = cms\.EndPath\()(.*)')
644  if empty_path.search(self.data):
645  # replace an empty DQMOutput path
646  self.data = empty_path.sub(dqmstore + '\n%(process)s.DQMOutput = cms.EndPath( %(process)s.dqmOutput )\n', self.data)
647  elif other_path.search(self.data):
648  # prepend the dqmOutput to the DQMOutput path
649  self.data = other_path.sub(dqmstore + r'\g<1> %(process)s.dqmOutput +\g<3>', self.data)
650  else:
651  # ceate a new DQMOutput path with the dqmOutput module
652  self.data += dqmstore
653  self.data += '\n%(process)s.DQMOutput = cms.EndPath( %(process)s.dqmOutput )\n'
654 
655 
def loadCffCommand(self, module)
Definition: confdb.py:563
def instrumentDQM(self)
Definition: confdb.py:624
def confdb.HLTProcess.instrumentErrorEventType (   self)

Definition at line 386 of file confdb.py.

References confdb.HLTProcess._fix_parameter().

Referenced by confdb.HLTProcess.customize().

387  if self.config.errortype:
388  # change all HLTTriggerTypeFilter EDFilters to accept only error events (SelectedTriggerType = 0)
389  self._fix_parameter(name = 'SelectedTriggerType', type ='int32', value = '1', replace = '0')
390  self._fix_parameter(name = 'SelectedTriggerType', type ='int32', value = '2', replace = '0')
391  self._fix_parameter(name = 'SelectedTriggerType', type ='int32', value = '3', replace = '0')
392 
393 
def instrumentErrorEventType(self)
Definition: confdb.py:386
def _fix_parameter(self, args)
Definition: confdb.py:329
def confdb.HLTProcess.instrumentOpenMode (   self)

Definition at line 372 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().

373  if self.config.open:
374  # find all EDfilters
375  filters = [ match[1] for match in re.findall(r'(process\.)?\b(\w+) = cms.EDFilter', self.data) ]
376  re_sequence = re.compile( r'cms\.(Path|Sequence)\((.*)\)' )
377  # remove existing 'cms.ignore' and '~' modifiers
378  self.data = re_sequence.sub( lambda line: re.sub( r'cms\.ignore *\( *((process\.)?\b(\w+)) *\)', r'\1', line.group(0) ), self.data )
379  self.data = re_sequence.sub( lambda line: re.sub( r'~', '', line.group(0) ), self.data )
380  # wrap all EDfilters with "cms.ignore( ... )", 1000 at a time (python 2.6 complains for too-big regular expressions)
381  for some in splitter(filters, 1000):
382  re_filters = re.compile( r'\b((process\.)?(' + r'|'.join(some) + r'))\b' )
383  self.data = re_sequence.sub( lambda line: re_filters.sub( r'cms.ignore( \1 )', line.group(0) ), self.data )
384 
385 
def instrumentOpenMode(self)
Definition: confdb.py:372
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def confdb.HLTProcess.instrumentTiming (   self)

Definition at line 582 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().

582  def instrumentTiming(self):
583 
584  if self.config.timing:
585  self.data += """
586 # instrument the menu with the modules and EndPath needed for timing studies
587 """
588 
589  self.data += '\n# configure the FastTimerService\n'
590  self.loadCff('HLTrigger.Timer.FastTimerService_cfi')
591 
592  self.data += """# print a text summary at the end of the job
593 %(process)s.FastTimerService.printEventSummary = False
594 %(process)s.FastTimerService.printRunSummary = False
595 %(process)s.FastTimerService.printJobSummary = True
596 
597 # enable DQM plots
598 %(process)s.FastTimerService.enableDQM = True
599 
600 # enable per-path DQM plots (starting with CMSSW 9.2.3-patch2)
601 %(process)s.FastTimerService.enableDQMbyPath = True
602 
603 # enable per-module DQM plots
604 %(process)s.FastTimerService.enableDQMbyModule = True
605 
606 # enable per-event DQM plots vs lumisection
607 %(process)s.FastTimerService.enableDQMbyLumiSection = True
608 %(process)s.FastTimerService.dqmLumiSectionsRange = 2500
609 
610 # set the time resolution of the DQM plots
611 %(process)s.FastTimerService.dqmTimeRange = 2000.
612 %(process)s.FastTimerService.dqmTimeResolution = 10.
613 %(process)s.FastTimerService.dqmPathTimeRange = 1000.
614 %(process)s.FastTimerService.dqmPathTimeResolution = 5.
615 %(process)s.FastTimerService.dqmModuleTimeRange = 200.
616 %(process)s.FastTimerService.dqmModuleTimeResolution = 1.
617 
618 # set the base DQM folder for the plots
619 %(process)s.FastTimerService.dqmPath = 'HLT/TimerService'
620 %(process)s.FastTimerService.enableDQMbyProcesses = False
621 """
622 
623 
def loadCff(self, module)
Definition: confdb.py:570
def instrumentTiming(self)
Definition: confdb.py:582
def confdb.HLTProcess.loadAdditionalConditions (   self,
  comment,
  conditions 
)

Definition at line 546 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.

546  def loadAdditionalConditions(self, comment, *conditions):
547  # load additional conditions
548  self.data += """
549 # %s
550 if 'GlobalTag' in %%(dict)s:
551 """ % comment
552  for condition in conditions:
553  self.data += """ %%(process)s.GlobalTag.toGet.append(
554  cms.PSet(
555  record = cms.string( '%(record)s' ),
556  tag = cms.string( '%(tag)s' ),
557  label = cms.untracked.string( '%(label)s' ),
558  )
559  )
560 """ % condition
561 
562 
def loadAdditionalConditions(self, comment, conditions)
Definition: confdb.py:546
def confdb.HLTProcess.loadCffCommand (   self,
  module 
)

Definition at line 563 of file confdb.py.

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

563  def loadCffCommand(self, module):
564  # load a cfi or cff module
565  if self.config.fragment:
566  return 'from %s import *\n' % module
567  else:
568  return 'process.load( "%s" )\n' % module
569 
def loadCffCommand(self, module)
Definition: confdb.py:563
def confdb.HLTProcess.overrideGlobalTag (   self)

Definition at line 394 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().

394  def overrideGlobalTag(self):
395  # overwrite GlobalTag
396  # the logic is:
397  # - if a GlobalTag is specified on the command line:
398  # - override the global tag
399  # - if the GT is "auto:...", insert the code to read it from Configuration.AlCa.autoCond
400  # - if a GlobalTag is NOT specified on the command line:
401  # - when running on data, do nothing, and keep the global tag in the menu
402  # - when running on mc, take the GT from the configuration.type
403 
404  # override the GlobalTag connection string and pfnPrefix
405 
406  # when running on MC, override the global tag even if not specified on the command line
407  if not self.config.data and not self.config.globaltag:
408  if self.config.type in globalTag:
409  self.config.globaltag = globalTag[self.config.type]
410  else:
411  self.config.globaltag = globalTag['GRun']
412 
413  # if requested, override the L1 menu from the GlobalTag
414  if self.config.l1.override:
415  self.config.l1.tag = self.config.l1.override
416  self.config.l1.record = 'L1TUtmTriggerMenuRcd'
417  self.config.l1.connect = ''
418  self.config.l1.label = ''
419  if not self.config.l1.snapshotTime:
420  self.config.l1.snapshotTime = '9999-12-31 23:59:59.000'
421  self.config.l1cond = '%(tag)s,%(record)s,%(connect)s,%(label)s,%(snapshotTime)s' % self.config.l1.__dict__
422  else:
423  self.config.l1cond = None
424 
425  if self.config.globaltag or self.config.l1cond:
426  text = """
427 # override the GlobalTag, connection string and pfnPrefix
428 if 'GlobalTag' in %(dict)s:
429  from Configuration.AlCa.GlobalTag import GlobalTag as customiseGlobalTag
430  %(process)s.GlobalTag = customiseGlobalTag(%(process)s.GlobalTag"""
431  if self.config.globaltag:
432  text += ", globaltag = %s" % repr(self.config.globaltag)
433  if self.config.l1cond:
434  text += ", conditions = %s" % repr(self.config.l1cond)
435  text += ")\n"
436  self.data += text
437 
def overrideGlobalTag(self)
Definition: confdb.py:394
def confdb.HLTProcess.overrideL1MenuXml (   self)
def confdb.HLTProcess.overrideOutput (   self)

Definition at line 458 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().

458  def overrideOutput(self):
459  # override the "online" ShmStreamConsumer output modules with "offline" PoolOutputModule's
460  self.data = re.sub(
461  r'\b(process\.)?hltOutput(\w+) *= *cms\.OutputModule\( *"ShmStreamConsumer" *,',
462  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 ),',
463  self.data
464  )
465 
466  if not self.config.fragment and self.config.output == 'minimal':
467  # add a single output to keep the TriggerResults and TriggerEvent
468  self.data += """
469 # add a single "keep *" output
470 %(process)s.hltOutputMinimal = cms.OutputModule( "PoolOutputModule",
471  fileName = cms.untracked.string( "output.root" ),
472  fastCloning = cms.untracked.bool( False ),
473  dataset = cms.untracked.PSet(
474  dataTier = cms.untracked.string( 'AOD' ),
475  filterName = cms.untracked.string( '' )
476  ),
477  outputCommands = cms.untracked.vstring( 'drop *',
478  'keep edmTriggerResults_*_*_*',
479  'keep triggerTriggerEvent_*_*_*'
480  )
481 )
482 %(process)s.MinimalOutput = cms.EndPath( %(process)s.hltOutputMinimal )
483 """
484  elif not self.config.fragment and self.config.output == 'full':
485  # add a single "keep *" output
486  self.data += """
487 # add a single "keep *" output
488 %(process)s.hltOutputFull = cms.OutputModule( "PoolOutputModule",
489  fileName = cms.untracked.string( "output.root" ),
490  fastCloning = cms.untracked.bool( False ),
491  dataset = cms.untracked.PSet(
492  dataTier = cms.untracked.string( 'RECO' ),
493  filterName = cms.untracked.string( '' )
494  ),
495  outputCommands = cms.untracked.vstring( 'keep *' )
496 )
497 %(process)s.FullOutput = cms.EndPath( %(process)s.hltOutputFull )
498 """
499 
def overrideOutput(self)
Definition: confdb.py:458
def confdb.HLTProcess.overrideParameters (   self,
  module,
  parameters 
)
def confdb.HLTProcess.overrideProcessName (   self)

Definition at line 514 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().

515  if self.config.name is None:
516  return
517 
518  # sanitise process name
519  self.config.name = self.config.name.replace("_","")
520  # override the process name
521  quote = '[\'\"]'
522  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)
523 
524  # when --setup option is used, remove possible errors from PrescaleService due to missing HLT paths.
525  if self.config.setup: self.data += """
526 # avoid PrescaleService error due to missing HLT paths
527 if 'PrescaleService' in process.__dict__:
528  for pset in reversed(process.PrescaleService.prescaleTable):
529  if not hasattr(process,pset.pathName.value()):
530  process.PrescaleService.prescaleTable.remove(pset)
531 """
532 
533 
def overrideProcessName(self)
Definition: confdb.py:514
def confdb.HLTProcess.runL1Emulator (   self)

Definition at line 448 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().

448  def runL1Emulator(self):
449  # if requested, run the Full L1T emulator, then repack the data into a new RAW collection, to be used by the HLT
450  if self.config.emulator:
451  text = """
452 # run the Full L1T emulator, then repack the data into a new RAW collection, to be used by the HLT
453 from HLTrigger.Configuration.CustomConfigs import L1REPACK
454 %%(process)s = L1REPACK(%%(process)s,"%s")
455 """ % (self.config.emulator)
456  self.data += text
457 
def runL1Emulator(self)
Definition: confdb.py:448
def confdb.HLTProcess.specificCustomize (   self)

Definition at line 174 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().

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

Definition at line 534 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().

535  # request summary informations from the MessageLogger
536  self.data += """
537 if 'MessageLogger' in %(dict)s:
538  %(process)s.MessageLogger.categories.append('TriggerSummaryProducerAOD')
539  %(process)s.MessageLogger.categories.append('L1GtTrigReport')
540  %(process)s.MessageLogger.categories.append('L1TGlobalSummary')
541  %(process)s.MessageLogger.categories.append('HLTrigReport')
542  %(process)s.MessageLogger.categories.append('FastReport')
543 """
544 
545 
def updateMessageLogger(self)
Definition: confdb.py:534

Member Data Documentation

confdb.HLTProcess.all_paths

Definition at line 664 of file confdb.py.

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

confdb.HLTProcess.config

Definition at line 24 of file confdb.py.

confdb.HLTProcess.converter

Definition at line 53 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