CMS 3D CMS Logo

Classes | Functions | Variables

ConfigBuilder Namespace Reference

Classes

class  ConfigBuilder
class  Options

Functions

def addALCAPaths
def addOutputModule
def dumpPython
def getConfigsForScenario
def getDefaultTrigger
def getHelp
def installFilteredStream
def installPromptReco

Variables

string __default = 'GRun'
string __source__ = "$Source: /cvs/CMSSW/CMSSW/Configuration/PyReleaseValidation/python/ConfigBuilder.py,v $"
dictionary __triggerTable
string __version__ = "$Revision: 1.284.2.5 $"
tuple defaultOptions = Options()
 promptReco = installPromptReco

Function Documentation

def ConfigBuilder::addALCAPaths (   process,
  listOfALCANames,
  definitionFile = "Configuration/StandardSequences/AlCaRecoStreams_cff" 
)
_addALCAPaths_

Function to add alignment&calibration sequences to an existing process

Definition at line 1557 of file ConfigBuilder.py.

01558                                                                                                                   :
01559     """
01560     _addALCAPaths_
01561 
01562     Function to add alignment&calibration sequences to an existing process
01563     """
01564     __import__(definitionFile)
01565     definitionModule = sys.modules[definitionFile]
01566     process.extend(definitionModule)
01567 
01568     for alca in listOfALCANames:
01569        streamName = "ALCARECOStream%s" % alca
01570        stream = getattr(definitionModule, streamName)
01571        for path in stream.paths:
01572             schedule.append(path)
01573 
01574     return
def ConfigBuilder::addOutputModule (   process,
  tier,
  content 
)
_addOutputModule_

Function to add an output module to a given process with given data tier and event content

Definition at line 1528 of file ConfigBuilder.py.

01529                                            :
01530     """
01531     _addOutputModule_
01532 
01533     Function to add an output module to a given process with given data tier and event content
01534     """
01535     print "WARNING. this method will not be supported any more SOON, please use --eventcontent --datatier field to drive the output module definitions"
01536 
01537     moduleName = "output%s%s" % (tier, content)
01538     pathName = "%sPath" % moduleName
01539     contentName = "%sEventContent" % content
01540     contentAttr = getattr(process, contentName)
01541     setattr(process, moduleName,
01542             cms.OutputModule("PoolOutputModule",
01543                              contentAttr,
01544                              fileName = cms.untracked.string('%s.root' % moduleName),
01545                              dataset = cms.untracked.PSet(
01546                                dataTier = cms.untracked.string(tier),
01547                                ),
01548                            )
01549             )
01550     print getattr(process,moduleName)
01551     # put it in an EndPath and put the EndPath into the schedule
01552     setattr(process, pathName, cms.EndPath(getattr(process,moduleName)) )
01553     process.schedule.append(getattr(process, pathName))
01554 
01555     return
01556 

def ConfigBuilder::dumpPython (   process,
  name 
)

Definition at line 49 of file ConfigBuilder.py.

00050                             :
00051         theObject = getattr(process,name)
00052         if isinstance(theObject,cms.Path) or isinstance(theObject,cms.EndPath) or isinstance(theObject,cms.Sequence):
00053                 return "process."+name+" = " + theObject.dumpPython("process")
00054         elif isinstance(theObject,_Module) or isinstance(theObject,cms.ESProducer):
00055                 return "process."+name+" = " + theObject.dumpPython()+"\n"
00056         else:
00057                 return "process."+name+" = " + theObject.dumpPython()+"\n"
00058 

def ConfigBuilder::getConfigsForScenario (   sequence = None)
Retrieves the list of files needed to run a given trigger menu.
If no trigger or an invalid trigger is given, use the default one. 

Definition at line 38 of file ConfigBuilder.py.

00039                                           :
00040     """
00041     Retrieves the list of files needed to run a given trigger menu.
00042     If no trigger or an invalid trigger is given, use the default one. 
00043     """
00044 
00045     if not sequence:
00046         # no trigger was specified, use the default one
00047         trigger = __default
00048     else:
00049         # check if the specified trigger is valid
00050         trigger = sequence
00051         if trigger not in __triggerTable:
00052             print 'An unsupported trigger has been requested: %s' % sequence
00053             print 'The default one will be used instead: %s' % __default
00054             print 'The supported triggers are:'
00055             for key in __triggerTable.iterkeys():
00056                 print '\t%s' % key
00057             print
00058             trigger = __default
00059 
00060     return __triggerTable[trigger]
00061 
def ConfigBuilder::getDefaultTrigger ( )
Retrieves the default trigger name

Definition at line 24 of file ConfigBuilder.py.

00025                        :
00026     """
00027     Retrieves the default trigger name
00028     """
00029     return __default
00030     

def ConfigBuilder::getHelp ( )
Retrieves the list of available triggers

Definition at line 31 of file ConfigBuilder.py.

00032              :
00033     """
00034     Retrieves the list of available triggers
00035     """
00036     return __triggerTable.iterkeys()
00037   

def ConfigBuilder::installFilteredStream (   process,
  schedule,
  streamName,
  definitionFile = "Configuration/StandardSequences/AlCaRecoStreams_cff" 
)

Definition at line 1483 of file ConfigBuilder.py.

01484                                                                                                                                  :
01485 
01486     __import__(definitionFile)
01487     definitionModule = sys.modules[definitionFile]
01488     process.extend(definitionModule)
01489     stream = getattr(definitionModule,streamName)
01490     output = cms.OutputModule("PoolOutputModule")
01491     output.SelectEvents = stream.selectEvents
01492     output.outputCommands = stream.content
01493     output.dataset  = cms.untracked.PSet( dataTier = stream.dataTier)
01494     setattr(process,streamName,output)
01495     for path in stream.paths:
01496         schedule.append(path)
01497 

def ConfigBuilder::installPromptReco (   process,
  recoOutputModule,
  aodOutputModule = None 
)
_promptReco_

Method to install the standard PromptReco configuration into
a basic process containing source and output modules.

process is the CMS Process instance to be populated

recoOutputModule is the output module used to write the
RECO data tier

aodOutputModule is the output module used to write
the AOD data tier, if this is not none, any AOD sequences
should be added.

Definition at line 1498 of file ConfigBuilder.py.

01499                                                                         :
01500     """
01501     _promptReco_
01502 
01503     Method to install the standard PromptReco configuration into
01504     a basic process containing source and output modules.
01505 
01506     process is the CMS Process instance to be populated
01507 
01508     recoOutputModule is the output module used to write the
01509     RECO data tier
01510 
01511     aodOutputModule is the output module used to write
01512     the AOD data tier, if this is not none, any AOD sequences
01513     should be added.
01514     """
01515     cb = ConfigBuilder(defaultOptions, process = process)
01516     cb._options.step = 'RAW2DIGI,RECO'
01517     cb.addStandardSequences()
01518     cb.addConditions()
01519     process.load(cb.EVTCONTDefault)
01520     recoOutputModule.eventContent = process.RECOEventContent
01521     if aodOutputModule != None:
01522         aodOutputModule.eventContent = process.AODEventContent
01523     return process
01524 


Variable Documentation

string ConfigBuilder::__default = 'GRun'

Definition at line 21 of file ConfigBuilder.py.

string ConfigBuilder::__source__ = "$Source: /cvs/CMSSW/CMSSW/Configuration/PyReleaseValidation/python/ConfigBuilder.py,v $"

Definition at line 4 of file ConfigBuilder.py.

Initial value:
00001 {
00002 
00003     # HLT trigger table for the 2009 STARTUP 8E29 menu
00004     '8E29': ( 
00005         'FastSimulation/Configuration/HLT_8E29_cff', 
00006     ),
00007 
00008     # HLT trigger table for the 2009 Global Run menu
00009     'GRun': (
00010         'FastSimulation/Configuration/HLT_GRun_cff',
00011     ),
00012 
00013     # HLT trigger table for the 2009 STARTUP 1E31 menu
00014     '1E31': ( 
00015         'FastSimulation/Configuration/HLT_1E31_cff', 
00016     )
00017 }

Definition at line 2 of file ConfigBuilder.py.

string ConfigBuilder::__version__ = "$Revision: 1.284.2.5 $"

Definition at line 3 of file ConfigBuilder.py.

Definition at line 15 of file ConfigBuilder.py.

ConfigBuilder::promptReco = installPromptReco

Definition at line 1525 of file ConfigBuilder.py.