The main building routines
Definition at line 47 of file ConfigBuilder.py.
def ConfigBuilder::ConfigBuilder::__init__ | ( | self, | ||
options, | ||||
process = None | ||||
) |
options taken from old cmsDriver and optparse
Definition at line 50 of file ConfigBuilder.py.
00050 : 00051 """options taken from old cmsDriver and optparse """ 00052 00053 self._options = options 00054 self.define_Configs() 00055 00056 if process == None: 00057 self.process = cms.Process(self._options.name) 00058 else: 00059 self.process = process 00060 self.process.schedule = cms.Schedule() 00061 # we are doing three things here: 00062 # creating a process to catch errors 00063 # building the code to re-create the process 00064 00065 self.additionalCommands = [] 00066 # TODO: maybe a list of to be dumped objects would help as well 00067 self.blacklist_paths = [] 00068 self.additionalObjects = [] 00069 self.additionalOutputs = {} 00070 self.productionFilterSequence = None 00071 def loadAndRemember(self, includeFile):
def ConfigBuilder::ConfigBuilder::addCommon | ( | self | ) |
Definition at line 84 of file ConfigBuilder.py.
00084 : 00085 self.process.options = cms.untracked.PSet( Rethrow = cms.untracked.vstring('ProductNotFound') ) 00086 def addMaxEvents(self):
def ConfigBuilder::ConfigBuilder::addConditions | ( | self | ) |
Add conditions to the process
Definition at line 211 of file ConfigBuilder.py.
00211 : 00212 """Add conditions to the process""" 00213 conditionsSP=self._options.conditions.split(',') 00214 # FULL or FAST SIM ? 00215 if "FASTSIM" in self._options.step: 00216 # fake or real conditions? 00217 if len(conditionsSP)>1: 00218 self.loadAndRemember('FastSimulation/Configuration/CommonInputs_cff') 00219 00220 print conditionsSP 00221 if "STARTUP" in conditionsSP[1]: 00222 self.additionalCommands.append("# Apply ECAL/HCAL miscalibration") 00223 self.additionalCommands.append("process.caloRecHits.RecHitsFactory.doMiscalib = True") 00224 self.additionalCommands.append("# Apply Tracker misalignment") 00225 self.additionalCommands.append("process.famosSimHits.ApplyAlignment = True") 00226 self.additionalCommands.append("process.misalignedTrackerGeometry.applyAlignment = True\n") 00227 00228 else: 00229 self.loadAndRemember('FastSimulation/Configuration/CommonInputsFake_cff') 00230 self.additionalCommands.append('process.famosSimHits.SimulateCalorimetry = True') 00231 self.additionalCommands.append('process.famosSimHits.SimulateTracking = True') 00232 00233 else: 00234 self.loadAndRemember('Configuration/StandardSequences/'+conditionsSP[0]+'_cff') 00235 00236 # set non-default conditions 00237 if ( len(conditionsSP)>1 ): 00238 self.additionalCommands.append("process.GlobalTag.globaltag = '"+str(conditionsSP[1]+"'")) 00239 def addCustomise(self):
def ConfigBuilder::ConfigBuilder::addCustomise | ( | self | ) |
Include the customise code
Definition at line 240 of file ConfigBuilder.py.
00240 : 00241 """Include the customise code """ 00242 00243 # let python search for that package and do syntax checking at the same time 00244 packageName = self._options.customisation_file.replace(".py","") 00245 package = __import__(packageName) 00246 00247 # now ask the package for its definition and pick .py instead of .pyc 00248 customiseFile = package.__file__.rstrip("c") 00249 00250 final_snippet='\n\n# Automatic addition of the customisation function\n' 00251 for line in file(customiseFile,'r'): 00252 if "import FWCore.ParameterSet.Config" in line: 00253 continue 00254 final_snippet += line 00255 00256 final_snippet += '\n\n# End of customisation function definition' 00257 00258 return final_snippet + "\n\nprocess = customise(process)" 00259 00260 #---------------------------------------------------------------------------- 00261 # here the methods to define the python includes for each step or 00262 # conditions 00263 #---------------------------------------------------------------------------- def define_Configs(self):
def ConfigBuilder::ConfigBuilder::addExtraStream | ( | self, | ||
name, | ||||
stream | ||||
) |
Definition at line 350 of file ConfigBuilder.py.
00350 : 00351 # define output module and go from there 00352 output = cms.OutputModule("PoolOutputModule") 00353 output.SelectEvents = stream.selectEvents 00354 output.outputCommands = stream.content 00355 output.fileName = cms.untracked.string(stream.name+'.root') 00356 output.dataset = cms.untracked.PSet( dataTier = stream.dataTier, 00357 filterName = cms.untracked.string('Stream'+stream.name)) 00358 if isinstance(stream.paths,tuple): 00359 for path in stream.paths: 00360 self.process.schedule.append(path) 00361 else: 00362 self.process.schedule.append(stream.paths) 00363 # in case of relvals we don't want to have additional outputs 00364 if not self._options.relval: 00365 self.additionalOutputs[name] = output 00366 setattr(self.process,name,output) 00367 00368 00369 00370 #---------------------------------------------------------------------------- 00371 # here the methods to create the steps. Of course we are doing magic here ;) 00372 # prepare_STEPNAME modifies self.process and what else's needed. 00373 #---------------------------------------------------------------------------- 00374 def prepare_ALCA(self, sequence = None):
def ConfigBuilder::ConfigBuilder::addMaxEvents | ( | self | ) |
def ConfigBuilder::ConfigBuilder::addOutput | ( | self | ) |
Add output module to the process
Definition at line 114 of file ConfigBuilder.py.
00114 : 00115 """ Add output module to the process """ 00116 00117 self.loadAndRemember(self.EVTCONTDefaultCFF) 00118 theEventContent = getattr(self.process, self.eventcontent.split(',')[-1]+"EventContent") 00119 00120 output = cms.OutputModule("PoolOutputModule", 00121 theEventContent, 00122 fileName = cms.untracked.string(self._options.outfile_name), 00123 dataset = cms.untracked.PSet(dataTier = cms.untracked.string(self._options.datatier)) 00124 ) 00125 00126 # if there is a generation step in the process, that one should be used as filter decision 00127 if hasattr(self.process,"generation_step"): 00128 output.SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring('generation_step')) 00129 00130 # add the filtername 00131 output.dataset.filterName = cms.untracked.string(self._options.filtername) 00132 00133 # if the only step is alca we don't need to put in an output 00134 if not self._options.step.split(',')[0].split(':')[0] == 'ALCA': 00135 self.process.output = output 00136 self.process.out_step = cms.EndPath(self.process.output) 00137 self.process.schedule.append(self.process.out_step) 00138 00139 # ATTENTION: major tweaking to avoid inlining of event content 00140 # should we do that? 00141 def dummy(instance,label = "process."+self.eventcontent.split(',')[-1]+"EventContent.outputCommands"): 00142 return label 00143 00144 self.process.output.outputCommands.__dict__["dumpPython"] = dummy 00145 00146 return "\n"+self.process.output.dumpPython() 00147 00148 def addStandardSequences(self):
def ConfigBuilder::ConfigBuilder::addSource | ( | self | ) |
Here the source is built. Priority: file, generator
Definition at line 91 of file ConfigBuilder.py.
00091 : 00092 """Here the source is built. Priority: file, generator""" 00093 if self._options.filein: 00094 self.process.source=cms.Source("PoolSource", fileNames = cms.untracked.vstring(self._options.filein)) 00095 elif hasattr(self._options,'evt_type'): 00096 evt_type = self._options.evt_type.rstrip(".py").replace(".","_") 00097 if "/" in evt_type: 00098 evt_type = evt_type.replace("python/","") 00099 else: 00100 evt_type = 'Configuration/Generator/'+evt_type 00101 00102 sourceModule = __import__(evt_type) 00103 self.process.extend(sourceModule) 00104 # now add all modules and sequences to the process 00105 import FWCore.ParameterSet.Modules as cmstypes 00106 for name in sourceModule.__dict__: 00107 theObject = getattr(sourceModule,name) 00108 if isinstance(theObject, cmstypes._Module): 00109 self.additionalObjects.insert(0,name) 00110 if isinstance(theObject, cms.Sequence): 00111 self.additionalObjects.append(name) 00112 return 00113 def addOutput(self):
def ConfigBuilder::ConfigBuilder::addStandardSequences | ( | self | ) |
Add selected standard sequences to the process
Definition at line 149 of file ConfigBuilder.py.
00149 : 00150 """ 00151 Add selected standard sequences to the process 00152 """ 00153 conditionsSP=self._options.conditions.split(',') 00154 00155 # here we check if we have fastsim or fullsim 00156 if "FAST" in self._options.step: 00157 self.imports=['FastSimulation/Configuration/RandomServiceInitialization_cff'] 00158 00159 # pile up handling for fastsim 00160 # TODO - do we want a map config - number or actual values? 00161 self.loadAndRemember("FastSimulation.PileUpProducer.PileUpSimulator10TeV_cfi") 00162 self.additionalCommands.append('process.famosPileUp.PileUpSimulator = process.PileUpSimulatorBlock.PileUpSimulator') 00163 00164 if self._options.pileup not in pileupMap.keys(): 00165 print "Pile up option",self._options.pileup,"unknown." 00166 print "Possible options are:", pileupMap.keys() 00167 sys.exit(-1) 00168 else: 00169 self.additionalCommands.append("process.famosPileUp.PileUpSimulator.averageNumber = %s" %pileupMap[self._options.pileup]) 00170 00171 # no fast sim 00172 else: 00173 # load the pile up file 00174 try: 00175 self.loadAndRemember(self.PileupCFF) 00176 except ImportError: 00177 print "Pile up option",self._options.pileup,"unknown." 00178 raise 00179 00180 # load the geometry file 00181 try: 00182 self.loadAndRemember(self.GeometryCFF) 00183 except ImportError: 00184 print "Geometry option",self._options.geometry,"unknown." 00185 raise 00186 00187 self.imports.append(self.magFieldCFF) 00188 00189 00190 # what steps are provided by this class? 00191 stepList = [methodName.lstrip("prepare_") for methodName in ConfigBuilder.__dict__ if methodName.startswith('prepare_')] 00192 00193 # look which steps are requested and invoke the corresponding method 00194 for step in self._options.step.split(","): 00195 print step 00196 stepParts = step.split(":") # for format STEP:alternativeSequence 00197 stepName = stepParts[0] 00198 if stepName not in stepList: 00199 raise ValueError("Step "+stepName+" unknown") 00200 if len(stepParts)==1: 00201 getattr(self,"prepare_"+step)(sequence = getattr(self,step+"DefaultSeq")) 00202 elif len(stepParts)==2: 00203 getattr(self,"prepare_"+stepName)(sequence = stepParts[1]) 00204 elif len(stepParts)==3: 00205 getattr(self,"prepare_"+stepName)(sequence = stepParts[1]+','+stepParts[2]) 00206 00207 else: 00208 raise ValueError("Step definition "+step+" invalid") 00209 00210 def addConditions(self):
def ConfigBuilder::ConfigBuilder::build_production_info | ( | self, | ||
evt_type, | ||||
evtnumber | ||||
) |
Add useful info for the production.
Definition at line 591 of file ConfigBuilder.py.
00591 : 00592 """ Add useful info for the production. """ 00593 prod_info=cms.untracked.PSet\ 00594 (version=cms.untracked.string("$Revision: 1.99.2.8 $"), 00595 name=cms.untracked.string("PyReleaseValidation"), 00596 annotation=cms.untracked.string(evt_type+ " nevts:"+str(evtnumber)) 00597 ) 00598 00599 return prod_info 00600 00601 def prepare(self, doChecking = False):
def ConfigBuilder::ConfigBuilder::define_Configs | ( | self | ) |
Definition at line 264 of file ConfigBuilder.py.
00264 : 00265 if ( self._options.scenario not in defaultOptions.scenarioOptions): 00266 print 'Invalid scenario provided. Options are:' 00267 print defaultOptions.scenarioOptions 00268 sys.exit(-1) 00269 00270 self.imports=['Configuration/StandardSequences/Services_cff', 00271 'FWCore/MessageService/MessageLogger_cfi'] 00272 00273 self.ALCADefaultCFF="Configuration/StandardSequences/AlCaRecoStreams_cff" 00274 self.GENDefaultCFF="Configuration/StandardSequences/Generator_cff" 00275 self.SIMDefaultCFF="Configuration/StandardSequences/Sim_cff" 00276 self.DIGIDefaultCFF="Configuration/StandardSequences/Digi_cff" 00277 self.DIGI2RAWDefaultCFF="Configuration/StandardSequences/DigiToRaw_cff" 00278 self.RAW2DIGIDefaultCFF="Configuration/StandardSequences/RawToDigi_Data_cff" 00279 self.RECODefaultCFF="Configuration/StandardSequences/Reconstruction_cff" 00280 self.POSTRECODefaultCFF="Configuration/StandardSequences/PostRecoGenerator_cff" 00281 self.VALIDATIONDefaultCFF="Configuration/StandardSequences/Validation_cff" 00282 self.DQMOFFLINEDefaultCFF="DQMOffline/Configuration/DQMOffline_cff" 00283 self.ENDJOBDefaultCFF="Configuration/StandardSequences/EndOfProcess_cff" 00284 self.L1EMDefaultCFF=None 00285 self.L1MENUDefaultCFF=None 00286 self.HLTDefaultCFF=None 00287 self.HLTDefaultSeq=None 00288 self.L1DefaultSeq=None 00289 00290 self.ALCADefaultSeq=None 00291 self.SIMDefaultSeq=None 00292 self.GENDefaultSeq=None 00293 self.DIGIDefaultSeq=None 00294 self.DIGI2RAWDefaultSeq=None 00295 self.RAW2DIGIDefaultSeq='RawToDigi' 00296 self.RECODefaultSeq='reconstruction' 00297 self.POSTRECODefaultSeq=None 00298 self.DQMDefaultSeq='DQMOffline' 00299 self.FASTSIMDefaultSeq='all' 00300 self.VALIDATIONDefaultSeq='validation' 00301 self.PATLayer0DefaultSeq='all' 00302 self.ENDJOBDefaultSeq='endOfProcess' 00303 00304 self.EVTCONTDefaultCFF="Configuration/EventContent/EventContent_cff" 00305 self.defaultMagField='38T' 00306 self.defaultBeamSpot='Early10TeVCollision' 00307 00308 # if fastsim switch event content 00309 if "FASTSIM" in self._options.step: 00310 self.EVTCONTDefaultCFF = "FastSimulation/Configuration/EventContent_cff" 00311 00312 # if its MC then change the raw2digi 00313 if self._options.isMC==True: 00314 self.RAW2DIGIDefaultCFF="Configuration/StandardSequences/RawToDigi_cff" 00315 00316 # now for #%#$#! different scenarios 00317 00318 if self._options.scenario=='nocoll' or self._options.scenario=='cosmics': 00319 self.SIMDefaultCFF="Configuration/StandardSequences/SimNOBEAM_cff" 00320 self.defaultBeamSpot='NoSmear' 00321 00322 if self._options.scenario=='cosmics': 00323 self.DIGIDefaultCFF="Configuration/StandardSequences/DigiCosmics_cff" 00324 self.RECODefaultCFF="Configuration/StandardSequences/ReconstructionCosmics_cff" 00325 self.EVTCONTDefaultCFF="Configuration/EventContent/EventContentCosmics_cff" 00326 self.DQMOFFLINEDefaultCFF="DQMOffline/Configuration/DQMOfflineCosmics_cff" 00327 self.RECODefaultSeq='reconstructionCosmics' 00328 self.DQMDefaultSeq='DQMOfflineCosmics' 00329 self.eventcontent='FEVT' 00330 00331 # the magnetic field 00332 if self._options.magField=='Default': 00333 self._options.magField=self.defaultMagField 00334 self.magFieldCFF = 'Configuration/StandardSequences/MagneticField_'+self._options.magField.replace('.','')+'_cff' 00335 self.magFieldCFF = self.magFieldCFF.replace("__",'_') 00336 00337 self.GeometryCFF='Configuration/StandardSequences/Geometry'+self._options.geometry+'_cff' 00338 self.PileupCFF='Configuration/StandardSequences/Mixing'+self._options.pileup+'_cff' 00339 00340 #beamspot 00341 if self._options.beamspot != None: 00342 self.beamspot=self._options.beamspot 00343 else: 00344 self.beamspot=self.defaultBeamSpot 00345 00346 if self._options.eventcontent != None: 00347 self.eventcontent=self._options.eventcontent 00348 00349 # for alca, skims, etc def addExtraStream(self,name,stream):
def ConfigBuilder::ConfigBuilder::executeAndRemember | ( | self, | ||
command | ||||
) |
helper routine to remember replace statements
Definition at line 80 of file ConfigBuilder.py.
00080 : 00081 """helper routine to remember replace statements""" 00082 pass 00083 def addCommon(self):
def ConfigBuilder::ConfigBuilder::loadAndRemember | ( | self, | ||
includeFile | ||||
) |
helper routine to load am memorize imports
Definition at line 72 of file ConfigBuilder.py.
00072 : 00073 """helper routine to load am memorize imports""" 00074 # we could make the imports a on-the-fly data method of the process instance itself 00075 # not sure if the latter is a good idea 00076 self.imports.append(includeFile) 00077 self.process.load(includeFile) 00078 return __import__(includeFile) 00079 def executeAndRemember(self, command):
def ConfigBuilder::ConfigBuilder::prepare | ( | self, | ||
doChecking = False | ||||
) |
Prepare the configuration string and add missing pieces.
Definition at line 602 of file ConfigBuilder.py.
00602 : 00603 """ Prepare the configuration string and add missing pieces.""" 00604 00605 self.addMaxEvents() 00606 self.addSource() 00607 self.addStandardSequences() 00608 self.addConditions() 00609 self.addOutput() 00610 self.addCommon() 00611 00612 self.pythonCfgCode = "# Auto generated configuration file\n" 00613 self.pythonCfgCode += "# using: \n# "+__version__[1:-1]+"\n# "+__source__[1:-1]+'\n' 00614 self.pythonCfgCode += "# with command line options: "+self._options.arguments+'\n' 00615 self.pythonCfgCode += "import FWCore.ParameterSet.Config as cms\n\n" 00616 self.pythonCfgCode += "process = cms.Process('"+self._options.name+"')\n\n" 00617 00618 self.pythonCfgCode += "# import of standard configurations\n" 00619 for module in self.imports: 00620 self.pythonCfgCode += ("process.load('"+module+"')\n") 00621 00622 # dump production info 00623 if not hasattr(self.process,"configurationMetadata"): 00624 self.process.configurationMetadata=self.build_production_info(self._options.evt_type, self._options.number) 00625 self.pythonCfgCode += "\nprocess.configurationMetadata = "+self.process.configurationMetadata.dumpPython() 00626 00627 # dump max events block 00628 self.pythonCfgCode += "\nprocess.maxEvents = "+self.process.maxEvents.dumpPython() 00629 00630 # dump the job options 00631 self.pythonCfgCode += "\nprocess.options = "+self.process.options.dumpPython() 00632 00633 # dump the input definition 00634 self.pythonCfgCode += "\n# Input source\n" 00635 self.pythonCfgCode += "process.source = "+self.process.source.dumpPython() 00636 00637 # dump the output definition 00638 if hasattr(self.process,"output"): 00639 self.pythonCfgCode += "\n# Output definition\n" 00640 self.pythonCfgCode += "process.output = "+self.process.output.dumpPython() 00641 00642 # dump all additional outputs (e.g. alca or skim streams) 00643 self.pythonCfgCode += "\n# Additional output definition\n" 00644 for name, output in self.additionalOutputs.iteritems(): 00645 self.pythonCfgCode += "process.%s = %s" %(name, output.dumpPython()) 00646 tmpOut = cms.EndPath(output) 00647 setattr(self.process,name+'OutPath',tmpOut) 00648 self.process.schedule.append(tmpOut) 00649 00650 # dump all additional commands 00651 self.pythonCfgCode += "\n# Other statements\n" 00652 for command in self.additionalCommands: 00653 self.pythonCfgCode += command + "\n" 00654 00655 # special treatment for a production filter sequence 00656 if self.productionFilterSequence: 00657 # dump all additional definitions from the input definition file 00658 for name in self.additionalObjects: 00659 self.pythonCfgCode += dumpPython(self.process,name) 00660 # prepend the productionFilterSequence to all paths defined 00661 for path in self.process.paths: 00662 getattr(self.process,path)._seq = getattr(self.process,self.productionFilterSequence)*getattr(self.process,path)._seq 00663 # as HLT paths get modified as well, they have to be re-printed 00664 self.blacklist_paths = [] 00665 00666 # dump all paths 00667 self.pythonCfgCode += "\n# Path and EndPath definitions\n" 00668 for path in self.process.paths: 00669 if getattr(self.process,path) not in self.blacklist_paths: 00670 self.pythonCfgCode += dumpPython(self.process,path) 00671 for endpath in self.process.endpaths: 00672 if getattr(self.process,endpath) not in self.blacklist_paths: 00673 self.pythonCfgCode += dumpPython(self.process,endpath) 00674 00675 # dump the schedule 00676 self.pythonCfgCode += "\n# Schedule definition\n" 00677 pathNames = ['process.'+p.label_() for p in self.process.schedule] 00678 result ='process.schedule = cms.Schedule('+','.join(pathNames)+')\n' 00679 self.pythonCfgCode += result 00680 00681 # dump customise fragment 00682 if self._options.customisation_file: 00683 self.pythonCfgCode += self.addCustomise() 00684 return 00685 00686 def installFilteredStream(process, schedule, streamName, definitionFile = "Configuration/StandardSequences/AlCaRecoStreams_cff" ):
def ConfigBuilder::ConfigBuilder::prepare_ALCA | ( | self, | ||
sequence = None | ||||
) |
Enrich the process with alca streams
Definition at line 375 of file ConfigBuilder.py.
00375 : 00376 """ Enrich the process with alca streams """ 00377 if ( len(sequence.split(','))==1 ): 00378 alcaConfig = self.loadAndRemember(self.ALCADefaultCFF) 00379 else: 00380 alcaConfig = self.loadAndRemember(sequence.split(',')[0]) 00381 sequence = sequence.split(',')[1] 00382 # decide which ALCA paths to use 00383 alcaList = sequence.split("+") 00384 for name in alcaConfig.__dict__: 00385 alcastream = getattr(alcaConfig,name) 00386 shortName = name.replace('ALCARECOStream','') 00387 if shortName in alcaList and isinstance(alcastream,cms.FilteredStream): 00388 self.addExtraStream(name,alcastream) 00389 alcaList.remove(shortName) 00390 # DQM needs a special handling 00391 elif name == 'pathALCARECODQM' and 'DQM' in alcaList: 00392 path = getattr(alcaConfig,name) 00393 self.process.schedule.append(path) 00394 alcaList.remove('DQM') 00395 if len(alcaList) != 0: 00396 print "The following alcas could not be found", alcaList 00397 raise 00398 # TODO: blacklisting of al alca paths 00399 def prepare_GEN(self, sequence = None):
def ConfigBuilder::ConfigBuilder::prepare_DIGI | ( | self, | ||
sequence = None | ||||
) |
Enrich the schedule with the digitisation step
Definition at line 439 of file ConfigBuilder.py.
00439 : 00440 """ Enrich the schedule with the digitisation step""" 00441 self.loadAndRemember(self.DIGIDefaultCFF) 00442 self.process.digitisation_step = cms.Path(self.process.pdigi) 00443 self.process.schedule.append(self.process.digitisation_step) 00444 return 00445 def prepare_DIGI2RAW(self, sequence = None):
def ConfigBuilder::ConfigBuilder::prepare_DIGI2RAW | ( | self, | ||
sequence = None | ||||
) |
Definition at line 446 of file ConfigBuilder.py.
00446 : 00447 self.loadAndRemember(self.DIGI2RAWDefaultCFF) 00448 self.process.digi2raw_step = cms.Path( self.process.DigiToRaw ) 00449 self.process.schedule.append(self.process.digi2raw_step) 00450 return 00451 def prepare_L1(self, sequence = None):
def ConfigBuilder::ConfigBuilder::prepare_DQM | ( | self, | ||
sequence = 'DQMOffline' | ||||
) |
Definition at line 513 of file ConfigBuilder.py.
00513 : 00514 # this one needs replacement 00515 00516 if ( len(sequence.split(','))==1 ): 00517 self.loadAndRemember(self.DQMOFFLINEDefaultCFF) 00518 else: 00519 self.loadAndRemember(sequence.split(',')[0]) 00520 self.process.dqmoffline_step = cms.Path( getattr(self.process, sequence.split(',')[-1]) ) 00521 self.process.schedule.append(self.process.dqmoffline_step) 00522 def prepare_ENDJOB(self, sequence = 'endOfProcess'):
def ConfigBuilder::ConfigBuilder::prepare_ENDJOB | ( | self, | ||
sequence = 'endOfProcess' | ||||
) |
Definition at line 523 of file ConfigBuilder.py.
00523 : 00524 # this one needs replacement 00525 00526 if ( len(sequence.split(','))==1 ): 00527 self.loadAndRemember(self.ENDJOBDefaultCFF) 00528 else: 00529 self.loadAndRemember(sequence.split(',')[0]) 00530 self.process.endjob_step = cms.Path( getattr(self.process, sequence.split(',')[-1]) ) 00531 self.process.schedule.append(self.process.endjob_step) 00532 def prepare_FASTSIM(self, sequence = "all"):
def ConfigBuilder::ConfigBuilder::prepare_FASTSIM | ( | self, | ||
sequence = "all" | ||||
) |
Enrich the schedule with fastsim
Definition at line 533 of file ConfigBuilder.py.
00533 : 00534 """Enrich the schedule with fastsim""" 00535 self.loadAndRemember("FastSimulation/Configuration/FamosSequences_cff") 00536 00537 if sequence in ('all','allWithHLTFiltering',''): 00538 self.loadAndRemember("FastSimulation/Configuration/HLT_cff") 00539 00540 # no need to repeat the definition later on in the created file 00541 [self.blacklist_paths.append(path) for path in self.process.HLTSchedule if isinstance(path,(cms.Path,cms.EndPath))] 00542 00543 # endpaths do logging only which should be suppressed in production 00544 self.process.HLTSchedule.remove(self.process.HLTAnalyzerEndpath) 00545 00546 self.loadAndRemember("Configuration.StandardSequences.L1TriggerDefaultMenu_cff") 00547 self.additionalCommands.append("process.famosSimHits.SimulateCalorimetry = True") 00548 self.additionalCommands.append("process.famosSimHits.SimulateTracking = True") 00549 00550 # the settings have to be the same as for the generator to stay consistent 00551 print ' Set comEnergy to famos decay processing to 10 TeV. Please edit by hand if it needs to be different.' 00552 print ' The pile up is taken from 10 TeV files. To switch to other files remove the inclusion of "PileUpSimulator10TeV_cfi"' 00553 self.additionalCommands.append('process.famosSimHits.ActivateDecays.comEnergy = 10000') 00554 00555 self.additionalCommands.append("process.simulation = cms.Sequence(process.simulationWithFamos)") 00556 self.additionalCommands.append("process.HLTEndSequence = cms.Sequence(process.reconstructionWithFamos)") 00557 00558 # since we have HLT here, the process should be called HLT 00559 self._options.name = "HLT" 00560 00561 # if we don't want to filter after HLT but simulate everything regardless of what HLT tells, we have to add reconstruction explicitly 00562 if sequence == 'all': 00563 self.process.schedule.extend(self.process.HLTSchedule) 00564 self.process.reconstruction = cms.Path(self.process.reconstructionWithFamos) 00565 self.process.schedule.append(self.process.reconstruction) 00566 elif sequence == 'famosWithEverything': 00567 self.process.fastsim_step = cms.Path( getattr(self.process, "famosWithEverything") ) 00568 self.process.schedule.append(self.process.fastsim_step) 00569 00570 # now the additional commands we need to make the config work 00571 self.additionalCommands.append("process.VolumeBasedMagneticFieldESProducer.useParametrizedTrackerField = True") 00572 else: 00573 print "FastSim setting", sequence, "unknown." 00574 raise ValueError 00575 # the vertex smearing settings 00576 beamspotName = 'process.%sVtxSmearingParameters' %(self.beamspot) 00577 if 'Flat' in self.beamspot: 00578 beamspotType = 'Flat' 00579 elif 'Gauss' in self.beamspot: 00580 beamspotType = 'Gaussian' 00581 else: 00582 print " Assuming vertex smearing engine as BetaFunc" 00583 beamspotType = 'BetaFunc' 00584 self.loadAndRemember('IOMC.EventVertexGenerators.VtxSmearedParameters_cfi') 00585 beamspotName = 'process.%sVtxSmearingParameters' %(self.beamspot) 00586 self.additionalCommands.append('\n# set correct vertex smearing') 00587 self.additionalCommands.append(beamspotName+'.type = cms.string("%s")'%(beamspotType)) 00588 self.additionalCommands.append('process.famosSimHits.VertexGenerator = '+beamspotName) 00589 self.additionalCommands.append('process.famosPileUp.VertexGenerator = '+beamspotName) 00590 def build_production_info(self, evt_type, evtnumber):
def ConfigBuilder::ConfigBuilder::prepare_GEN | ( | self, | ||
sequence = None | ||||
) |
Enrich the schedule with the generation step
Definition at line 400 of file ConfigBuilder.py.
00400 : 00401 """ Enrich the schedule with the generation step """ 00402 self.loadAndRemember(self.GENDefaultCFF) 00403 00404 #check if we are dealing with fastsim -> no vtx smearing 00405 if "FASTSIM" in self._options.step: 00406 self.process.pgen.remove(self.process.VertexSmearing) 00407 self.process.generation_step = cms.Path( self.process.pgen) 00408 self.process.generation_step._seq = self.process.pgen._seq 00409 00410 # replace the VertexSmearing placeholder by a concrete beamspot definition 00411 else: 00412 try: 00413 self.loadAndRemember('Configuration/StandardSequences/VtxSmeared'+self.beamspot+'_cff') 00414 except ImportError: 00415 print "VertexSmearing type or beamspot",self.beamspot, "unknown." 00416 raise 00417 self.process.generation_step = cms.Path( self.process.pgen ) 00418 00419 self.process.schedule.append(self.process.generation_step) 00420 00421 # is there a production filter sequence given? 00422 if sequence: 00423 if sequence not in self.additionalObjects: 00424 raise AttributeError("There is no filter sequence '"+sequence+"' defined in "+self._options.evt_type) 00425 else: 00426 self.productionFilterSequence = sequence 00427 return 00428 def prepare_SIM(self, sequence = None):
def ConfigBuilder::ConfigBuilder::prepare_HLT | ( | self, | ||
sequence = None | ||||
) |
Enrich the schedule with the HLT simulation step
Definition at line 462 of file ConfigBuilder.py.
00462 : 00463 """ Enrich the schedule with the HLT simulation step""" 00464 # let the HLT package decide for the scenarios available 00465 from HLTrigger.Configuration.ConfigBuilder import getConfigsForScenario 00466 listOfImports = getConfigsForScenario(sequence) 00467 for file in listOfImports: 00468 self.loadAndRemember(file) 00469 self.process.schedule.extend(self.process.HLTSchedule) 00470 [self.blacklist_paths.append(path) for path in self.process.HLTSchedule if isinstance(path,(cms.Path,cms.EndPath))] 00471 def prepare_RAW2DIGI(self, sequence = "RawToDigi"):
def ConfigBuilder::ConfigBuilder::prepare_L1 | ( | self, | ||
sequence = None | ||||
) |
Enrich the schedule with the L1 simulation step
Definition at line 452 of file ConfigBuilder.py.
00452 : 00453 """ Enrich the schedule with the L1 simulation step""" 00454 # let the L1 package decide for the scenarios available 00455 from L1Trigger.Configuration.ConfigBuilder import getConfigsForScenario 00456 listOfImports = getConfigsForScenario(sequence) 00457 for file in listOfImports: 00458 self.loadAndRemember(file) 00459 self.process.L1simulation_step = cms.Path(self.process.SimL1Emulator) 00460 self.process.schedule.append(self.process.L1simulation_step) 00461 def prepare_HLT(self, sequence = None):
def ConfigBuilder::ConfigBuilder::prepare_PATLayer0 | ( | self, | ||
sequence = None | ||||
) |
In case people would like to have this
Definition at line 499 of file ConfigBuilder.py.
00499 : 00500 """ In case people would like to have this""" 00501 pass 00502 00503 def prepare_VALIDATION(self, sequence = 'validation'):
def ConfigBuilder::ConfigBuilder::prepare_POSTRECO | ( | self, | ||
sequence = None | ||||
) |
Enrich the schedule with the postreco step
Definition at line 491 of file ConfigBuilder.py.
00491 : 00492 """ Enrich the schedule with the postreco step """ 00493 self.loadAndRemember(self.POSTRECODefaultCFF) 00494 self.process.postreco_step = cms.Path( self.process.postreco_generator ) 00495 self.process.schedule.append(self.process.postreco_step) 00496 return 00497 00498 def prepare_PATLayer0(self, sequence = None):
def ConfigBuilder::ConfigBuilder::prepare_RAW2DIGI | ( | self, | ||
sequence = "RawToDigi" | ||||
) |
Definition at line 472 of file ConfigBuilder.py.
00472 : 00473 if ( len(sequence.split(','))==1 ): 00474 self.loadAndRemember(self.RAW2DIGIDefaultCFF) 00475 else: 00476 self.loadAndRemember(sequence.split(',')[0]) 00477 self.process.raw2digi_step = cms.Path( getattr(self.process, sequence.split(',')[-1]) ) 00478 self.process.schedule.append(self.process.raw2digi_step) 00479 return 00480 def prepare_RECO(self, sequence = "reconstruction"):
def ConfigBuilder::ConfigBuilder::prepare_RECO | ( | self, | ||
sequence = "reconstruction" | ||||
) |
Enrich the schedule with reconstruction
Definition at line 481 of file ConfigBuilder.py.
00481 : 00482 ''' Enrich the schedule with reconstruction ''' 00483 if ( len(sequence.split(','))==1 ): 00484 self.loadAndRemember(self.RECODefaultCFF) 00485 else: 00486 self.loadAndRemember(sequence.split(',')[0]) 00487 self.process.reconstruction_step = cms.Path( getattr(self.process, sequence.split(',')[-1]) ) 00488 self.process.schedule.append(self.process.reconstruction_step) 00489 return 00490 def prepare_POSTRECO(self, sequence = None):
def ConfigBuilder::ConfigBuilder::prepare_SIM | ( | self, | ||
sequence = None | ||||
) |
Enrich the schedule with the simulation step
Definition at line 429 of file ConfigBuilder.py.
00429 : 00430 """ Enrich the schedule with the simulation step""" 00431 self.loadAndRemember(self.SIMDefaultCFF) 00432 if self._options.magField=='0T': 00433 self.additionalCommands.append("process.g4SimHits.UseMagneticField = cms.bool(False)") 00434 00435 self.process.simulation_step = cms.Path( self.process.psim ) 00436 self.process.schedule.append(self.process.simulation_step) 00437 return 00438 def prepare_DIGI(self, sequence = None):
def ConfigBuilder::ConfigBuilder::prepare_VALIDATION | ( | self, | ||
sequence = 'validation' | ||||
) |
Definition at line 504 of file ConfigBuilder.py.
00504 : 00505 if ( len(sequence.split(','))==1 ): 00506 self.loadAndRemember(self.VALIDATIONDefaultCFF) 00507 else: 00508 self.loadAndRemember(sequence.split(',')[0]) 00509 self.process.validation_step = cms.Path( getattr(self.process, sequence.split(',')[-1]) ) 00510 self.process.schedule.append(self.process.validation_step) 00511 return 00512 def prepare_DQM(self, sequence = 'DQMOffline'):
ConfigBuilder::ConfigBuilder::_options [private] |
Definition at line 53 of file ConfigBuilder.py.
Definition at line 65 of file ConfigBuilder.py.
Definition at line 68 of file ConfigBuilder.py.
Definition at line 69 of file ConfigBuilder.py.
Definition at line 273 of file ConfigBuilder.py.
Definition at line 290 of file ConfigBuilder.py.
Definition at line 342 of file ConfigBuilder.py.
Definition at line 67 of file ConfigBuilder.py.
Definition at line 306 of file ConfigBuilder.py.
Definition at line 305 of file ConfigBuilder.py.
Definition at line 277 of file ConfigBuilder.py.
Definition at line 294 of file ConfigBuilder.py.
Definition at line 276 of file ConfigBuilder.py.
Definition at line 293 of file ConfigBuilder.py.
Definition at line 298 of file ConfigBuilder.py.
Definition at line 282 of file ConfigBuilder.py.
Definition at line 283 of file ConfigBuilder.py.
Definition at line 302 of file ConfigBuilder.py.
Definition at line 329 of file ConfigBuilder.py.
Definition at line 304 of file ConfigBuilder.py.
Definition at line 299 of file ConfigBuilder.py.
Definition at line 274 of file ConfigBuilder.py.
Definition at line 292 of file ConfigBuilder.py.
Definition at line 337 of file ConfigBuilder.py.
Definition at line 286 of file ConfigBuilder.py.
Definition at line 287 of file ConfigBuilder.py.
Definition at line 157 of file ConfigBuilder.py.
Definition at line 288 of file ConfigBuilder.py.
Definition at line 284 of file ConfigBuilder.py.
Definition at line 285 of file ConfigBuilder.py.
Definition at line 334 of file ConfigBuilder.py.
Definition at line 301 of file ConfigBuilder.py.
Definition at line 338 of file ConfigBuilder.py.
Definition at line 280 of file ConfigBuilder.py.
Definition at line 297 of file ConfigBuilder.py.
Definition at line 57 of file ConfigBuilder.py.
Definition at line 70 of file ConfigBuilder.py.
Definition at line 612 of file ConfigBuilder.py.
Definition at line 278 of file ConfigBuilder.py.
Definition at line 295 of file ConfigBuilder.py.
Definition at line 279 of file ConfigBuilder.py.
Definition at line 296 of file ConfigBuilder.py.
Definition at line 275 of file ConfigBuilder.py.
Definition at line 291 of file ConfigBuilder.py.
Definition at line 281 of file ConfigBuilder.py.
Definition at line 300 of file ConfigBuilder.py.