CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Public Attributes | Private Attributes
ConfigBuilder.ConfigBuilder Class Reference
Inheritance diagram for ConfigBuilder.ConfigBuilder:

Classes

class  MassSearchReplaceProcessNameVisitor
 

Public Member Functions

def __init__
 
def addCommon
 
def addConditions
 
def addCustomise
 
def addCustomiseCmdLine
 
def addExtraStream
 
def addMaxEvents
 
def addOutput
 
def addSource
 
def addStandardSequences
 
def build_production_info
 
def completeInputCommand
 
def create_process
 
def define_Configs
 
def executeAndRemember
 
def expandMapping
 
def finalizeFastSimHLT
 
def load
 
def loadAndRemember
 
def loadDefaultOrSpecifiedCFF
 
def prepare
 
def prepare_ALCA
 
def prepare_ALCAHARVEST
 
def prepare_ALCAOUTPUT
 
def prepare_ALCAPRODUCER
 
def prepare_CFWRITER
 
def prepare_DATAMIX
 
def prepare_DIGI
 
def prepare_DIGI2RAW
 
def prepare_DQM
 
def prepare_EI
 
def prepare_ENDJOB
 
def prepare_FILTER
 
def prepare_GEN
 
def prepare_HARVESTING
 
def prepare_HLT
 
def prepare_L1
 
def prepare_L1HwVal
 
def prepare_L1Reco
 
def prepare_L1REPACK
 
def prepare_L1TrackTrigger
 
def prepare_LHE
 
def prepare_NANO
 
def prepare_NANOGEN
 
def prepare_PAT
 
def prepare_PATFILTER
 
def prepare_PATGEN
 
def prepare_POSTRECO
 
def prepare_RAW2DIGI
 
def prepare_RAW2RECO
 
def prepare_RECO
 
def prepare_RECOBEFMIX
 
def prepare_RECOSIM
 
def prepare_REPACK
 
def prepare_SIM
 
def prepare_SKIM
 
def prepare_USER
 
def prepare_VALIDATION
 
def profileOptions
 
def renameHLTprocessInSequence
 
def renameInputTagsInSequence
 
def scheduleSequence
 
def scheduleSequenceAtEnd
 

Public Attributes

 addedObjects
 
 additionalCommands
 
 additionalOutputs
 
 ALCADefaultCFF
 
 ALCADefaultSeq
 
 ALCAHARVESTDefaultCFF
 
 ALCAHARVESTDefaultSeq
 
 AlCaPaths
 
 blacklist_paths
 
 CFWRITERDefaultCFF
 
 CFWRITERDefaultSeq
 
 conditionalPaths
 
 ConditionsDefaultCFF
 
 DATAMIXDefaultCFF
 
 DATAMIXDefaultSeq
 
 DIGI2RAWDefaultCFF
 
 DIGI2RAWDefaultSeq
 
 DIGIDefaultCFF
 
 DIGIDefaultSeq
 
 DQMDefaultSeq
 
 DQMOFFLINEDefaultCFF
 
 DQMSaverCFF
 
 EIDefaultCFF
 
 EIDefaultSeq
 
 ENDJOBDefaultCFF
 
 ENDJOBDefaultSeq
 
 EVTCONTDefaultCFF
 
 excludedPaths
 
 GENDefaultCFF
 
 GENDefaultSeq
 
 GeometryCFF
 
 geometryDBLabel
 
 HARVESTINGDefaultCFF
 
 HARVESTINGDefaultSeq
 
 HLTDefaultCFF
 
 HLTDefaultSeq
 
 imports
 
 inliner
 load the relevant part More...
 
 L1DefaultSeq
 
 L1EMDefaultCFF
 
 L1HwValDefaultCFF
 
 L1HwValDefaultSeq
 
 L1MENUDefaultCFF
 
 L1RecoDefaultCFF
 
 L1RecoDefaultSeq
 
 L1REPACKDefaultSeq
 
 L1TrackTriggerDefaultCFF
 
 L1TrackTriggerDefaultSeq
 
 labelsToAssociate
 
 LHEDefaultSeq
 
 magFieldCFF
 
 NANODefaultCFF
 
 NANODefaultSeq
 
 NANOGENDefaultCFF
 
 NANOGENDefaultSeq
 
 nextScheduleIsConditional
 put the filtering path in the schedule More...
 
 PATDefaultCFF
 
 PATDefaultSeq
 
 PATGENDefaultCFF
 
 PATGENDefaultSeq
 
 POSTRECODefaultCFF
 
 POSTRECODefaultSeq
 
 process
 adding standard sequences might change the inputEventContent option and therefore needs to be finalized after More...
 
 productionFilterSequence
 put it before all the other paths More...
 
 pythonCfgCode
 
 RAW2DIGIDefaultCFF
 
 RAW2DIGIDefaultSeq
 
 RAW2RECODefaultSeq
 
 RECOBEFMIXDefaultCFF
 
 RECOBEFMIXDefaultSeq
 
 RECODefaultCFF
 
 RECODefaultSeq
 
 RECOSIMDefaultCFF
 
 RECOSIMDefaultSeq
 
 REDIGIDefaultSeq
 
 REPACKDefaultCFF
 
 REPACKDefaultSeq
 
 runsAndWeights
 drop LHEXMLStringProduct on input to save memory if appropriate More...
 
 runsAndWeightsInt
 
 schedule
 
 scheduleIndexOfFirstHLTPath
 
 SIMDefaultCFF
 
 SIMDefaultSeq
 
 SimGeometryCFF
 
 SKIMDefaultCFF
 
 stepKeys
 
 stepMap
 
 USERDefaultCFF
 
 USERDefaultSeq
 
 VALIDATIONDefaultCFF
 
 VALIDATIONDefaultSeq
 
 with_input
 
 with_output
 

Private Attributes

 _options
 

Detailed Description

The main building routines 

Definition at line 195 of file ConfigBuilder.py.

Constructor & Destructor Documentation

def ConfigBuilder.ConfigBuilder.__init__ (   self,
  options,
  process = None,
  with_output = False,
  with_input = False 
)
options taken from old cmsDriver and optparse 

Definition at line 198 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_FILTER().

199  def __init__(self, options, process = None, with_output = False, with_input = False ):
200  """options taken from old cmsDriver and optparse """
201 
202  options.outfile_name = options.dirout+options.fileout
204  self._options = options
205 
206  if self._options.isData and options.isMC:
207  raise Exception("ERROR: You may specify only --data or --mc, not both")
208  #if not self._options.conditions:
209  # raise Exception("ERROR: No conditions given!\nPlease specify conditions. E.g. via --conditions=IDEAL_30X::All")
210 
211  # check that MEtoEDMConverter (running in ENDJOB) and DQMIO don't run in the same job
212  if 'ENDJOB' in self._options.step:
213  if (hasattr(self._options,"outputDefinition") and \
214  self._options.outputDefinition != '' and \
215  any(anyOf(['t','tier','dataTier'],outdic) == 'DQMIO' for outdic in eval(self._options.outputDefinition))) or \
216  (hasattr(self._options,"datatier") and \
217  self._options.datatier and \
218  'DQMIO' in self._options.datatier):
219  print("removing ENDJOB from steps since not compatible with DQMIO dataTier")
220  self._options.step=self._options.step.replace(',ENDJOB','')
221 
222 
223 
224  # what steps are provided by this class?
225  stepList = [re.sub(r'^prepare_', '', methodName) for methodName in ConfigBuilder.__dict__ if methodName.startswith('prepare_')]
226  self.stepMap={}
227  self.stepKeys=[]
228  for step in self._options.step.split(","):
229  if step=='': continue
230  stepParts = step.split(":")
231  stepName = stepParts[0]
232  if stepName not in stepList and not stepName.startswith('re'):
233  raise ValueError("Step "+stepName+" unknown")
234  if len(stepParts)==1:
235  self.stepMap[stepName]=""
236  elif len(stepParts)==2:
237  self.stepMap[stepName]=stepParts[1].split('+')
238  elif len(stepParts)==3:
239  self.stepMap[stepName]=(stepParts[2].split('+'),stepParts[1])
240  else:
241  raise ValueError("Step definition "+step+" invalid")
242  self.stepKeys.append(stepName)
243 
244  #print "map of steps is:",self.stepMap
246  self.with_output = with_output
247  self.process=process
248 
249  if hasattr(self._options,"no_output_flag") and self._options.no_output_flag:
250  self.with_output = False
251  self.with_input = with_input
252  self.imports = []
253  self.create_process()
255  self.schedule = list()
256  self.scheduleIndexOfFirstHLTPath = None
257 
258  # we are doing three things here:
259  # creating a process to catch errors
260  # building the code to re-create the process
262  self.additionalCommands = []
263  # TODO: maybe a list of to be dumped objects would help as well
264  self.blacklist_paths = []
265  self.addedObjects = []
266  self.additionalOutputs = {}
272  self.excludedPaths=[]
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:37
process
adding standard sequences might change the inputEventContent option and therefore needs to be finaliz...
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
productionFilterSequence
put it before all the other paths
nextScheduleIsConditional
put the filtering path in the schedule

Member Function Documentation

def ConfigBuilder.ConfigBuilder.addCommon (   self)

Definition at line 340 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.profileOptions().

Referenced by ConfigBuilder.ConfigBuilder.prepare().

341  def addCommon(self):
342  if 'HARVESTING' in self.stepMap.keys() or 'ALCAHARVEST' in self.stepMap.keys():
343  self.process.options.Rethrow = ['ProductNotFound']
344  self.process.options.fileMode = 'FULLMERGE'
345 
346  self.addedObjects.append(("","options"))
347 
348  if self._options.lazy_download:
349  self.process.AdaptorConfig = cms.Service("AdaptorConfig",
350  stats = cms.untracked.bool(True),
351  enable = cms.untracked.bool(True),
352  cacheHint = cms.untracked.string("lazy-download"),
353  readHint = cms.untracked.string("read-ahead-buffered")
354  )
355  self.addedObjects.append(("Setup lazy download","AdaptorConfig"))
356 
357  #self.process.cmsDriverCommand = cms.untracked.PSet( command=cms.untracked.string('cmsDriver.py '+self._options.arguments) )
358  #self.addedObjects.append(("what cmsDriver command was used","cmsDriverCommand"))
359 
360  if self._options.profile:
361  (start, interval, eventFormat, jobFormat)=self.profileOptions()
362  self.process.IgProfService = cms.Service("IgProfService",
363  reportFirstEvent = cms.untracked.int32(start),
364  reportEventInterval = cms.untracked.int32(interval),
365  reportToFileAtPostEvent = cms.untracked.string("| gzip -c > %s"%(eventFormat)),
366  reportToFileAtPostEndJob = cms.untracked.string("| gzip -c > %s"%(jobFormat)))
367  self.addedObjects.append(("Setup IGProf Service for profiling","IgProfService"))
def ConfigBuilder.ConfigBuilder.addConditions (   self)
Add conditions to the process

Definition at line 836 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.ConditionsDefaultCFF, ConfigBuilder.ConfigBuilder.loadAndRemember(), and print().

Referenced by ConfigBuilder.ConfigBuilder.prepare().

837  def addConditions(self):
838  """Add conditions to the process"""
839  if not self._options.conditions: return
840 
841  if 'FrontierConditions_GlobalTag' in self._options.conditions:
842  print('using FrontierConditions_GlobalTag in --conditions is not necessary anymore and will be deprecated soon. please update your command line')
843  self._options.conditions = self._options.conditions.replace("FrontierConditions_GlobalTag,",'')
844 
846  from Configuration.AlCa.GlobalTag import GlobalTag
847  self.process.GlobalTag = GlobalTag(self.process.GlobalTag, self._options.conditions, self._options.custom_conditions)
848  self.additionalCommands.append('from Configuration.AlCa.GlobalTag import GlobalTag')
849  self.additionalCommands.append('process.GlobalTag = GlobalTag(process.GlobalTag, %s, %s)' % (repr(self._options.conditions), repr(self._options.custom_conditions)))
850 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def ConfigBuilder.ConfigBuilder.addCustomise (   self,
  unsch = 0 
)
Include the customise code 

Definition at line 851 of file ConfigBuilder.py.

References mergeVDriftHistosByStation.file, join(), print(), DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, ConfigBuilder.ConfigBuilder.process, and python.rootplot.root2matplotlib.replace().

Referenced by ConfigBuilder.ConfigBuilder.prepare().

852  def addCustomise(self,unsch=0):
853  """Include the customise code """
854 
855  custOpt=[]
856  if unsch==0:
857  for c in self._options.customisation_file:
858  custOpt.extend(c.split(","))
859  else:
860  for c in self._options.customisation_file_unsch:
861  custOpt.extend(c.split(","))
862 
863  custMap=DictTypes.SortedKeysDict()
864  for opt in custOpt:
865  if opt=='': continue
866  if opt.count('.')>1:
867  raise Exception("more than . in the specification:"+opt)
868  fileName=opt.split('.')[0]
869  if opt.count('.')==0: rest='customise'
870  else:
871  rest=opt.split('.')[1]
872  if rest=='py': rest='customise' #catch the case of --customise file.py
873 
874  if fileName in custMap:
875  custMap[fileName].extend(rest.split('+'))
876  else:
877  custMap[fileName]=rest.split('+')
878 
879  if len(custMap)==0:
880  final_snippet='\n'
881  else:
882  final_snippet='\n# customisation of the process.\n'
883 
884  allFcn=[]
885  for opt in custMap:
886  allFcn.extend(custMap[opt])
887  for fcn in allFcn:
888  if allFcn.count(fcn)!=1:
889  raise Exception("cannot specify twice "+fcn+" as a customisation method")
890 
891  for f in custMap:
892  # let python search for that package and do syntax checking at the same time
893  packageName = f.replace(".py","").replace("/",".")
894  __import__(packageName)
895  package = sys.modules[packageName]
896 
897  # now ask the package for its definition and pick .py instead of .pyc
898  customiseFile = re.sub(r'\.pyc$', '.py', package.__file__)
899 
900  final_snippet+='\n# Automatic addition of the customisation function from '+packageName+'\n'
901  if self._options.inline_custom:
902  for line in file(customiseFile,'r'):
903  if "import FWCore.ParameterSet.Config" in line:
904  continue
905  final_snippet += line
906  else:
907  final_snippet += 'from %s import %s \n'%(packageName,','.join(custMap[f]))
908  for fcn in custMap[f]:
909  print("customising the process with",fcn,"from",f)
910  if not hasattr(package,fcn):
911  #bound to fail at run time
912  raise Exception("config "+f+" has no function "+fcn)
913  #execute the command
914  self.process=getattr(package,fcn)(self.process)
915  #and print it in the configuration
916  final_snippet += "\n#call to customisation function "+fcn+" imported from "+packageName
917  final_snippet += "\nprocess = %s(process)\n"%(fcn,)
918 
919  if len(custMap)!=0:
920  final_snippet += '\n# End of customisation functions\n'
921 
922  ### now for a useful command
923  return final_snippet
process
adding standard sequences might change the inputEventContent option and therefore needs to be finaliz...
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def ConfigBuilder.ConfigBuilder.addCustomiseCmdLine (   self)

Definition at line 924 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.executeAndRemember().

Referenced by ConfigBuilder.ConfigBuilder.prepare().

925  def addCustomiseCmdLine(self):
926  final_snippet='\n# Customisation from command line\n'
927  if self._options.customise_commands:
928  import string
929  for com in self._options.customise_commands.split('\\n'):
930  com=com.lstrip()
931  self.executeAndRemember(com)
932  final_snippet +='\n'+com
933 
934  return final_snippet
def ConfigBuilder.ConfigBuilder.addExtraStream (   self,
  name,
  stream,
  workflow = 'full' 
)

Definition at line 1155 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_SKIM().

1156  def addExtraStream(self, name, stream, workflow='full'):
1157  # define output module and go from there
1158  output = cms.OutputModule("PoolOutputModule")
1159  if stream.selectEvents.parameters_().__len__()!=0:
1160  output.SelectEvents = stream.selectEvents
1161  else:
1162  output.SelectEvents = cms.untracked.PSet()
1163  output.SelectEvents.SelectEvents=cms.vstring()
1164  if isinstance(stream.paths,tuple):
1165  for path in stream.paths:
1166  output.SelectEvents.SelectEvents.append(path.label())
1167  else:
1168  output.SelectEvents.SelectEvents.append(stream.paths.label())
1169 
1170 
1171 
1172  if isinstance(stream.content,str):
1173  evtPset=getattr(self.process,stream.content)
1174  for p in evtPset.parameters_():
1175  setattr(output,p,getattr(evtPset,p))
1176  if not self._options.inlineEventContent:
1177  def doNotInlineEventContent(instance,label = "process."+stream.content+".outputCommands"):
1178  return label
1179  output.outputCommands.__dict__["dumpPython"] = doNotInlineEventContent
1180  else:
1181  output.outputCommands = stream.content
1182 
1183 
1184  output.fileName = cms.untracked.string(self._options.dirout+stream.name+'.root')
1185 
1186  output.dataset = cms.untracked.PSet( dataTier = stream.dataTier,
1187  filterName = cms.untracked.string(stream.name))
1188 
1189  if self._options.filtername:
1190  output.dataset.filterName= cms.untracked.string(self._options.filtername+"_"+stream.name)
1191 
1192  #add an automatic flushing to limit memory consumption
1193  output.eventAutoFlushCompressedSize=cms.untracked.int32(5*1024*1024)
1194 
1195  if workflow in ("producers,full"):
1196  if isinstance(stream.paths,tuple):
1197  for path in stream.paths:
1198  self.schedule.append(path)
1199  else:
1200  self.schedule.append(stream.paths)
1201 
1202 
1203  # in case of relvals we don't want to have additional outputs
1204  if (not self._options.relval) and workflow in ("full","output"):
1205  self.additionalOutputs[name] = output
1206  setattr(self.process,name,output)
1207 
1208  if workflow == 'output':
1209  # adjust the select events to the proper trigger results from previous process
1210  filterList = output.SelectEvents.SelectEvents
1211  for i, filter in enumerate(filterList):
1212  filterList[i] = filter+":"+self._options.triggerResultsProcess
1213 
1214  return output
def ConfigBuilder.ConfigBuilder.addMaxEvents (   self)
Here we decide how many evts will be processed

Definition at line 368 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

369  def addMaxEvents(self):
370  """Here we decide how many evts will be processed"""
371  self.process.maxEvents.input = int(self._options.number)
372  if self._options.number_out:
373  self.process.maxEvents.output = int(self._options.number_out)
374  self.addedObjects.append(("","maxEvents"))
def ConfigBuilder.ConfigBuilder.addOutput (   self)
Add output module to the process 

Definition at line 527 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.AlCaPaths, ConfigBuilder.anyOf(), ConfigBuilder.ConfigBuilder.executeAndRemember(), join(), miniAOD_tools.miniAOD_customizeOutput(), print(), DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, ConfigBuilder.ConfigBuilder.process, python.rootplot.root2matplotlib.replace(), submitPVValidationJobs.split(), and ComparisonHelper.zip().

Referenced by ConfigBuilder.ConfigBuilder.prepare().

528  def addOutput(self):
529  """ Add output module to the process """
530  result=""
531  if self._options.outputDefinition:
532  if self._options.datatier:
533  print("--datatier & --eventcontent options ignored")
534 
535  #new output convention with a list of dict
536  outList = eval(self._options.outputDefinition)
537  for (id,outDefDict) in enumerate(outList):
538  outDefDictStr=outDefDict.__str__()
539  if not isinstance(outDefDict,dict):
540  raise Exception("--output needs to be passed a list of dict"+self._options.outputDefinition+" is invalid")
541  #requires option: tier
542  theTier=anyOf(['t','tier','dataTier'],outDefDict)
543  #optional option: eventcontent, filtername, selectEvents, moduleLabel, filename
544  ## event content
545  theStreamType=anyOf(['e','ec','eventContent','streamType'],outDefDict,theTier)
546  theFilterName=anyOf(['f','ftN','filterName'],outDefDict,'')
547  theSelectEvent=anyOf(['s','sE','selectEvents'],outDefDict,'')
548  theModuleLabel=anyOf(['l','mL','moduleLabel'],outDefDict,'')
549  theExtraOutputCommands=anyOf(['o','oC','outputCommands'],outDefDict,'')
550  # module label has a particular role
551  if not theModuleLabel:
552  tryNames=[theStreamType.replace(theTier.replace('-',''),'')+theTier.replace('-','')+'output',
553  theStreamType.replace(theTier.replace('-',''),'')+theTier.replace('-','')+theFilterName+'output',
554  theStreamType.replace(theTier.replace('-',''),'')+theTier.replace('-','')+theFilterName+theSelectEvent.split(',')[0].replace(':','for').replace(' ','')+'output'
555  ]
556  for name in tryNames:
557  if not hasattr(self.process,name):
558  theModuleLabel=name
559  break
560  if not theModuleLabel:
561  raise Exception("cannot find a module label for specification: "+outDefDictStr)
562  if id==0:
563  defaultFileName=self._options.outfile_name
564  else:
565  defaultFileName=self._options.outfile_name.replace('.root','_in'+theTier+'.root')
566 
567  theFileName=self._options.dirout+anyOf(['fn','fileName'],outDefDict,defaultFileName)
568  if not theFileName.endswith('.root'):
569  theFileName+='.root'
570 
571  if len(outDefDict):
572  raise Exception("unused keys from --output options: "+','.join(outDefDict.keys()))
573  if theStreamType=='DQMIO': theStreamType='DQM'
574  if theStreamType=='ALL':
575  theEventContent = cms.PSet(outputCommands = cms.untracked.vstring('keep *'))
576  else:
577  theEventContent = getattr(self.process, theStreamType+"EventContent")
578 
579 
580  addAlCaSelects=False
581  if theStreamType=='ALCARECO' and not theFilterName:
582  theFilterName='StreamALCACombined'
583  addAlCaSelects=True
584 
585  CppType='PoolOutputModule'
586  if self._options.timeoutOutput:
587  CppType='TimeoutPoolOutputModule'
588  if theStreamType=='DQM' and theTier=='DQMIO': CppType='DQMRootOutputModule'
589  output = cms.OutputModule(CppType,
590  theEventContent.clone(),
591  fileName = cms.untracked.string(theFileName),
592  dataset = cms.untracked.PSet(
593  dataTier = cms.untracked.string(theTier),
594  filterName = cms.untracked.string(theFilterName))
595  )
596  if not theSelectEvent and hasattr(self.process,'generation_step') and theStreamType!='LHE':
597  output.SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring('generation_step'))
598  if not theSelectEvent and hasattr(self.process,'filtering_step'):
599  output.SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring('filtering_step'))
600  if theSelectEvent:
601  output.SelectEvents =cms.untracked.PSet(SelectEvents = cms.vstring(theSelectEvent))
602 
603  if addAlCaSelects:
604  if not hasattr(output,'SelectEvents'):
605  output.SelectEvents=cms.untracked.PSet(SelectEvents=cms.vstring())
606  for alca in self.AlCaPaths:
607  output.SelectEvents.SelectEvents.extend(getattr(self.process,'OutALCARECO'+alca).SelectEvents.SelectEvents)
608 
609 
610  if hasattr(self.process,theModuleLabel):
611  raise Exception("the current process already has a module "+theModuleLabel+" defined")
612  #print "creating output module ",theModuleLabel
613  setattr(self.process,theModuleLabel,output)
614  outputModule=getattr(self.process,theModuleLabel)
615  setattr(self.process,theModuleLabel+'_step',cms.EndPath(outputModule))
616  path=getattr(self.process,theModuleLabel+'_step')
617  self.schedule.append(path)
618 
619  if not self._options.inlineEventContent and hasattr(self.process,theStreamType+"EventContent"):
620  def doNotInlineEventContent(instance,label = "cms.untracked.vstring(process."+theStreamType+"EventContent.outputCommands)"):
621  return label
622  outputModule.outputCommands.__dict__["dumpPython"] = doNotInlineEventContent
623  if theExtraOutputCommands:
624  if not isinstance(theExtraOutputCommands,list):
625  raise Exception("extra ouput command in --option must be a list of strings")
626  if hasattr(self.process,theStreamType+"EventContent"):
627  self.executeAndRemember('process.%s.outputCommands.extend(%s)'%(theModuleLabel,theExtraOutputCommands))
628  else:
629  outputModule.outputCommands.extend(theExtraOutputCommands)
630 
631  result+="\nprocess."+theModuleLabel+" = "+outputModule.dumpPython()
632 
633  ##ends the --output options model
634  return result
635 
636  streamTypes=self._options.eventcontent.split(',')
637  tiers=self._options.datatier.split(',')
638  if not self._options.outputDefinition and len(streamTypes)!=len(tiers):
639  raise Exception("number of event content arguments does not match number of datatier arguments")
640 
641  # if the only step is alca we don't need to put in an output
642  if self._options.step.split(',')[0].split(':')[0] == 'ALCA':
643  return "\n"
644 
645  for i,(streamType,tier) in enumerate(zip(streamTypes,tiers)):
646  if streamType=='': continue
647  if streamType == 'ALCARECO' and not 'ALCAPRODUCER' in self._options.step: continue
648  if streamType=='DQMIO': streamType='DQM'
649  eventContent=streamType
650  ## override streamType to eventContent in case NANOEDM
651  if streamType == "NANOEDMAOD" :
652  eventContent = "NANOAOD"
653  elif streamType == "NANOEDMAODSIM" :
654  eventContent = "NANOAODSIM"
655  theEventContent = getattr(self.process, eventContent+"EventContent")
656  if i==0:
657  theFileName=self._options.outfile_name
658  theFilterName=self._options.filtername
659  else:
660  theFileName=self._options.outfile_name.replace('.root','_in'+streamType+'.root')
661  theFilterName=self._options.filtername
662  CppType='PoolOutputModule'
663  if self._options.timeoutOutput:
664  CppType='TimeoutPoolOutputModule'
665  if streamType=='DQM' and tier=='DQMIO': CppType='DQMRootOutputModule'
666  if "NANOAOD" in streamType : CppType='NanoAODOutputModule'
667  output = cms.OutputModule(CppType,
668  theEventContent,
669  fileName = cms.untracked.string(theFileName),
670  dataset = cms.untracked.PSet(dataTier = cms.untracked.string(tier),
671  filterName = cms.untracked.string(theFilterName)
672  )
673  )
674  if hasattr(self.process,"generation_step") and streamType!='LHE':
675  output.SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring('generation_step'))
676  if hasattr(self.process,"filtering_step"):
677  output.SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring('filtering_step'))
678 
679  if streamType=='ALCARECO':
680  output.dataset.filterName = cms.untracked.string('StreamALCACombined')
681 
682  if "MINIAOD" in streamType:
683  from PhysicsTools.PatAlgos.slimming.miniAOD_tools import miniAOD_customizeOutput
685 
686  outputModuleName=streamType+'output'
687  setattr(self.process,outputModuleName,output)
688  outputModule=getattr(self.process,outputModuleName)
689  setattr(self.process,outputModuleName+'_step',cms.EndPath(outputModule))
690  path=getattr(self.process,outputModuleName+'_step')
691  self.schedule.append(path)
692 
693  if self._options.outputCommands and streamType!='DQM':
694  for evct in self._options.outputCommands.split(','):
695  if not evct: continue
696  self.executeAndRemember("process.%s.outputCommands.append('%s')"%(outputModuleName,evct.strip()))
697 
698  if not self._options.inlineEventContent:
699  tmpstreamType=streamType
700  if "NANOEDM" in tmpstreamType :
701  tmpstreamType=tmpstreamType.replace("NANOEDM","NANO")
702  def doNotInlineEventContent(instance,label = "process."+tmpstreamType+"EventContent.outputCommands"):
703  return label
704  outputModule.outputCommands.__dict__["dumpPython"] = doNotInlineEventContent
705 
706  result+="\nprocess."+outputModuleName+" = "+outputModule.dumpPython()
707 
708  return result
process
adding standard sequences might change the inputEventContent option and therefore needs to be finaliz...
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def miniAOD_customizeOutput
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def ConfigBuilder.ConfigBuilder.addSource (   self)
Here the source is built. Priority: file, generator

Definition at line 375 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder._options, ConfigBuilder.filesFromDASQuery(), ConfigBuilder.filesFromList(), print(), submitPVValidationJobs.split(), and ConfigBuilder.ConfigBuilder.stepMap.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

376  def addSource(self):
377  """Here the source is built. Priority: file, generator"""
378  self.addedObjects.append(("Input source","source"))
379 
380  def filesFromOption(self):
381  for entry in self._options.filein.split(','):
382  print("entry",entry)
383  if entry.startswith("filelist:"):
384  filesFromList(entry[9:],self.process.source)
385  elif entry.startswith("dbs:") or entry.startswith("das:"):
386  filesFromDASQuery('file dataset = %s'%(entry[4:]),self._options.dasoption,self.process.source)
387  else:
388  self.process.source.fileNames.append(self._options.dirin+entry)
389  if self._options.secondfilein:
390  if not hasattr(self.process.source,"secondaryFileNames"):
391  raise Exception("--secondfilein not compatible with "+self._options.filetype+"input type")
392  for entry in self._options.secondfilein.split(','):
393  print("entry",entry)
394  if entry.startswith("filelist:"):
395  self.process.source.secondaryFileNames.extend((filesFromList(entry[9:]))[0])
396  elif entry.startswith("dbs:") or entry.startswith("das:"):
397  self.process.source.secondaryFileNames.extend((filesFromDASQuery('file dataset = %s'%(entry[4:]),self._options.dasoption))[0])
398  else:
399  self.process.source.secondaryFileNames.append(self._options.dirin+entry)
400 
401  if self._options.filein or self._options.dasquery:
402  if self._options.filetype == "EDM":
403  self.process.source=cms.Source("PoolSource",
404  fileNames = cms.untracked.vstring(),
405  secondaryFileNames= cms.untracked.vstring())
406  filesFromOption(self)
407  elif self._options.filetype == "DAT":
408  self.process.source=cms.Source("NewEventStreamFileReader",fileNames = cms.untracked.vstring())
409  filesFromOption(self)
410  elif self._options.filetype == "LHE":
411  self.process.source=cms.Source("LHESource", fileNames = cms.untracked.vstring())
412  if self._options.filein.startswith("lhe:"):
413  #list the article directory automatically
414  args=self._options.filein.split(':')
415  article=args[1]
416  print('LHE input from article ',article)
417  location='/store/lhe/'
418  import os
419  textOfFiles=os.popen('cmsLHEtoEOSManager.py -l '+article)
420  for line in textOfFiles:
421  for fileName in [x for x in line.split() if '.lhe' in x]:
422  self.process.source.fileNames.append(location+article+'/'+fileName)
423  #check first if list of LHE files is loaded (not empty)
424  if len(line)<2:
425  print('Issue to load LHE files, please check and try again.')
426  sys.exit(-1)
427  #Additional check to protect empty fileNames in process.source
428  if len(self.process.source.fileNames)==0:
429  print('Issue with empty filename, but can pass line check')
430  sys.exit(-1)
431  if len(args)>2:
432  self.process.source.skipEvents = cms.untracked.uint32(int(args[2]))
433  else:
434  filesFromOption(self)
435 
436  elif self._options.filetype == "DQM":
437  self.process.source=cms.Source("DQMRootSource",
438  fileNames = cms.untracked.vstring())
439  filesFromOption(self)
440 
441  elif self._options.filetype == "DQMDAQ":
442  # FIXME: how to configure it if there are no input files specified?
443  self.process.source=cms.Source("DQMStreamerReader")
444 
445 
446  if ('HARVESTING' in self.stepMap.keys() or 'ALCAHARVEST' in self.stepMap.keys()) and (not self._options.filetype == "DQM"):
447  self.process.source.processingMode = cms.untracked.string("RunsAndLumis")
448 
449  if self._options.dasquery!='':
450  self.process.source=cms.Source("PoolSource", fileNames = cms.untracked.vstring(),secondaryFileNames = cms.untracked.vstring())
451  filesFromDASQuery(self._options.dasquery,self._options.dasoption,self.process.source)
452 
453  if ('HARVESTING' in self.stepMap.keys() or 'ALCAHARVEST' in self.stepMap.keys()) and (not self._options.filetype == "DQM"):
454  self.process.source.processingMode = cms.untracked.string("RunsAndLumis")
455 
456  ##drop LHEXMLStringProduct on input to save memory if appropriate
457  if 'GEN' in self.stepMap.keys() and not self._options.filetype == "LHE":
458  if self._options.inputCommands:
459  self._options.inputCommands+=',drop LHEXMLStringProduct_*_*_*,'
460  else:
461  self._options.inputCommands='keep *, drop LHEXMLStringProduct_*_*_*,'
462 
463  if self.process.source and self._options.inputCommands and not self._options.filetype == "LHE":
464  if not hasattr(self.process.source,'inputCommands'): self.process.source.inputCommands=cms.untracked.vstring()
465  for command in self._options.inputCommands.split(','):
466  # remove whitespace around the keep/drop statements
467  command = command.strip()
468  if command=='': continue
469  self.process.source.inputCommands.append(command)
470  if not self._options.dropDescendant:
471  self.process.source.dropDescendantsOfDroppedBranches = cms.untracked.bool(False)
472 
473  if self._options.lumiToProcess:
474  import FWCore.PythonUtilities.LumiList as LumiList
475  self.process.source.lumisToProcess = cms.untracked.VLuminosityBlockRange( LumiList.LumiList(self._options.lumiToProcess).getCMSSWString().split(',') )
476 
477  if 'GEN' in self.stepMap.keys() or 'LHE' in self.stepMap or (not self._options.filein and hasattr(self._options, "evt_type")):
478  if self.process.source is None:
479  self.process.source=cms.Source("EmptySource")
480 
481  # modify source in case of run-dependent MC
482  self.runsAndWeights=None
483  if self._options.runsAndWeightsForMC or self._options.runsScenarioForMC :
484  if not self._options.isMC :
485  raise Exception("options --runsAndWeightsForMC and --runsScenarioForMC are only valid for MC")
486  if self._options.runsAndWeightsForMC:
487  self.runsAndWeights = eval(self._options.runsAndWeightsForMC)
488  else:
489  from Configuration.StandardSequences.RunsAndWeights import RunsAndWeights
490  if isinstance(RunsAndWeights[self._options.runsScenarioForMC], str):
491  __import__(RunsAndWeights[self._options.runsScenarioForMC])
492  self.runsAndWeights = sys.modules[RunsAndWeights[self._options.runsScenarioForMC]].runProbabilityDistribution
493  else:
494  self.runsAndWeights = RunsAndWeights[self._options.runsScenarioForMC]
495 
496  if self.runsAndWeights:
497  import SimGeneral.Configuration.ThrowAndSetRandomRun as ThrowAndSetRandomRun
499  self.additionalCommands.append('import SimGeneral.Configuration.ThrowAndSetRandomRun as ThrowAndSetRandomRun')
500  self.additionalCommands.append('ThrowAndSetRandomRun.throwAndSetRandomRun(process.source,%s)'%(self.runsAndWeights))
501 
502  # modify source in case of run-dependent MC (Run-3 method)
503  self.runsAndWeightsInt=None
504  if self._options.runsAndWeightsForMCIntegerWeights or self._options.runsScenarioForMCIntegerWeights:
505  if not self._options.isMC :
506  raise Exception("options --runsAndWeightsForMCIntegerWeights and --runsScenarioForMCIntegerWeights are only valid for MC")
507  if self._options.runsAndWeightsForMCIntegerWeights:
508  self.runsAndWeightsInt = eval(self._options.runsAndWeightsForMCIntegerWeights)
509  else:
510  from Configuration.StandardSequences.RunsAndWeights import RunsAndWeights
511  if isinstance(RunsAndWeights[self._options.runsScenarioForMCIntegerWeights], str):
512  __import__(RunsAndWeights[self._options.runsScenarioForMCIntegerWeights])
513  self.runsAndWeightsInt = sys.modules[RunsAndWeights[self._options.runsScenarioForMCIntegerWeights]].runProbabilityDistribution
514  else:
515  self.runsAndWeightsInt = RunsAndWeights[self._options.runsScenarioForMCIntegerWeights]
516 
517  if self.runsAndWeightsInt:
518  if not self._options.relval:
519  raise Exception("--relval option required when using --runsAndWeightsInt")
520  if 'DATAMIX' in self._options.step:
521  from SimGeneral.Configuration.LumiToRun import lumi_to_run
522  total_events, events_per_job = self._options.relval.split(',')
523  lumi_to_run_mapping = lumi_to_run(self.runsAndWeightsInt, int(total_events), int(events_per_job))
524  self.additionalCommands.append("process.source.firstLuminosityBlockForEachRun = cms.untracked.VLuminosityBlockID(*[cms.LuminosityBlockID(x,y) for x,y in " + str(lumi_to_run_mapping) + "])")
525 
526  return
def lumi_to_run
Definition: LumiToRun.py:1
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
runsAndWeights
drop LHEXMLStringProduct on input to save memory if appropriate
#define str(s)
def ConfigBuilder.ConfigBuilder.addStandardSequences (   self)
Add selected standard sequences to the process

Definition at line 709 of file ConfigBuilder.py.

References TriggerAnalyzer.__str__(), Mixing.defineMixing(), ConfigBuilder.ConfigBuilder.executeAndRemember(), ConfigBuilder.filesFromDASQuery(), ConfigBuilder.filesFromList(), ConfigBuilder.ConfigBuilder.GeometryCFF, ConfigBuilder.ConfigBuilder.geometryDBLabel, join(), ConfigBuilder.ConfigBuilder.loadAndRemember(), ConfigBuilder.ConfigBuilder.magFieldCFF, print(), ConfigBuilder.ConfigBuilder.SimGeometryCFF, ConfigBuilder.ConfigBuilder.stepKeys, and ConfigBuilder.ConfigBuilder.stepMap.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

710  def addStandardSequences(self):
711  """
712  Add selected standard sequences to the process
713  """
714  # load the pile up file
715  if self._options.pileup:
716  pileupSpec=self._options.pileup.split(',')[0]
717 
718  # Does the requested pile-up scenario exist?
719  from Configuration.StandardSequences.Mixing import Mixing,defineMixing
720  if not pileupSpec in Mixing and '.' not in pileupSpec and 'file:' not in pileupSpec:
721  message = pileupSpec+' is not a know mixing scenario:\n available are: '+'\n'.join(Mixing.keys())
722  raise Exception(message)
723 
724  # Put mixing parameters in a dictionary
725  if '.' in pileupSpec:
726  mixingDict={'file':pileupSpec}
727  elif pileupSpec.startswith('file:'):
728  mixingDict={'file':pileupSpec[5:]}
729  else:
730  import copy
731  mixingDict=copy.copy(Mixing[pileupSpec])
732  if len(self._options.pileup.split(','))>1:
733  mixingDict.update(eval(self._options.pileup[self._options.pileup.find(',')+1:]))
734 
735  # Load the pu cfg file corresponding to the requested pu scenario
736  if 'file:' in pileupSpec:
737  #the file is local
738  self.process.load(mixingDict['file'])
739  print("inlining mixing module configuration")
740  self._options.inlineObjets+=',mix'
741  else:
742  self.loadAndRemember(mixingDict['file'])
743 
744  mixingDict.pop('file')
745  if not "DATAMIX" in self.stepMap.keys(): # when DATAMIX is present, pileup_input refers to pre-mixed GEN-RAW
746  if self._options.pileup_input:
747  if self._options.pileup_input.startswith('dbs:') or self._options.pileup_input.startswith('das:'):
748  mixingDict['F']=filesFromDASQuery('file dataset = %s'%(self._options.pileup_input[4:],),self._options.pileup_dasoption)[0]
749  elif self._options.pileup_input.startswith("filelist:"):
750  mixingDict['F']=(filesFromList(self._options.pileup_input[9:]))[0]
751  else:
752  mixingDict['F']=self._options.pileup_input.split(',')
753  specialization=defineMixing(mixingDict)
754  for command in specialization:
755  self.executeAndRemember(command)
756  if len(mixingDict)!=0:
757  raise Exception('unused mixing specification: '+mixingDict.keys().__str__())
758 
759 
760  # load the geometry file
761  try:
762  if len(self.stepMap):
763  self.loadAndRemember(self.GeometryCFF)
764  if ('SIM' in self.stepMap or 'reSIM' in self.stepMap) and not self._options.fast:
766  if self.geometryDBLabel:
767  self.executeAndRemember('if hasattr(process, "XMLFromDBSource"): process.XMLFromDBSource.label="%s"'%(self.geometryDBLabel))
768  self.executeAndRemember('if hasattr(process, "DDDetectorESProducerFromDB"): process.DDDetectorESProducerFromDB.label="%s"'%(self.geometryDBLabel))
769 
770  except ImportError:
771  print("Geometry option",self._options.geometry,"unknown.")
772  raise
773 
774  if len(self.stepMap):
775  self.loadAndRemember(self.magFieldCFF)
776 
777  for stepName in self.stepKeys:
778  stepSpec = self.stepMap[stepName]
779  print("Step:", stepName,"Spec:",stepSpec)
780  if stepName.startswith('re'):
781  ##add the corresponding input content
782  if stepName[2:] not in self._options.donotDropOnInput:
783  self._options.inputEventContent='%s,%s'%(stepName.upper(),self._options.inputEventContent)
784  stepName=stepName[2:]
785  if stepSpec=="":
786  getattr(self,"prepare_"+stepName)(sequence = getattr(self,stepName+"DefaultSeq"))
787  elif isinstance(stepSpec, list):
788  getattr(self,"prepare_"+stepName)(sequence = '+'.join(stepSpec))
789  elif isinstance(stepSpec, tuple):
790  getattr(self,"prepare_"+stepName)(sequence = ','.join([stepSpec[1],'+'.join(stepSpec[0])]))
791  else:
792  raise ValueError("Invalid step definition")
793 
794  if self._options.restoreRNDSeeds!=False:
795  #it is either True, or a process name
796  if self._options.restoreRNDSeeds==True:
797  self.executeAndRemember('process.RandomNumberGeneratorService.restoreStateLabel=cms.untracked.string("randomEngineStateProducer")')
798  else:
799  self.executeAndRemember('process.RandomNumberGeneratorService.restoreStateTag=cms.untracked.InputTag("randomEngineStateProducer","","%s")'%(self._options.restoreRNDSeeds))
800  if self._options.inputEventContent or self._options.inputCommands:
801  if self._options.inputCommands:
802  self._options.inputCommands+='keep *_randomEngineStateProducer_*_*,'
803  else:
804  self._options.inputCommands='keep *_randomEngineStateProducer_*_*,'
805 
def defineMixing
Definition: Mixing.py:190
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def ConfigBuilder.ConfigBuilder.build_production_info (   self,
  evt_type,
  evtnumber 
)
Add useful info for the production. 

Definition at line 2106 of file ConfigBuilder.py.

References str.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

2107  def build_production_info(self, evt_type, evtnumber):
2108  """ Add useful info for the production. """
2109  self.process.configurationMetadata=cms.untracked.PSet\
2110  (version=cms.untracked.string("$Revision: 1.19 $"),
2111  name=cms.untracked.string("Applications"),
2112  annotation=cms.untracked.string(evt_type+ " nevts:"+str(evtnumber))
2113  )
2114 
2115  self.addedObjects.append(("Production Info","configurationMetadata"))
2116 
#define str(s)
def ConfigBuilder.ConfigBuilder.completeInputCommand (   self)

Definition at line 806 of file ConfigBuilder.py.

References DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, and ConfigBuilder.ConfigBuilder.process.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

807  def completeInputCommand(self):
808  if self._options.inputEventContent:
809  import copy
810  def dropSecondDropStar(iec):
811  #drop occurence of 'drop *' in the list
812  count=0
813  for item in iec:
814  if item=='drop *':
815  if count!=0:
816  iec.remove(item)
817  count+=1
818 
819  ## allow comma separated input eventcontent
820  if not hasattr(self.process.source,'inputCommands'): self.process.source.inputCommands=cms.untracked.vstring()
821  for evct in self._options.inputEventContent.split(','):
822  if evct=='': continue
823  theEventContent = getattr(self.process, evct+"EventContent")
824  if hasattr(theEventContent,'outputCommands'):
825  self.process.source.inputCommands.extend(copy.copy(theEventContent.outputCommands))
826  if hasattr(theEventContent,'inputCommands'):
827  self.process.source.inputCommands.extend(copy.copy(theEventContent.inputCommands))
828 
829  dropSecondDropStar(self.process.source.inputCommands)
830 
831  if not self._options.dropDescendant:
832  self.process.source.dropDescendantsOfDroppedBranches = cms.untracked.bool(False)
833 
834 
835  return
process
adding standard sequences might change the inputEventContent option and therefore needs to be finaliz...
def ConfigBuilder.ConfigBuilder.create_process (   self)

Definition at line 2117 of file ConfigBuilder.py.

2118  def create_process(self):
2119  self.pythonCfgCode = "# Auto generated configuration file\n"
2120  self.pythonCfgCode += "# using: \n# "+__version__[1:-1]+"\n# "+__source__[1:-1]+'\n'
2121  self.pythonCfgCode += "# with command line options: "+self._options.arguments+'\n'
2122  self.pythonCfgCode += "import FWCore.ParameterSet.Config as cms\n\n"
2123 
2124  # now set up the modifies
2125  modifiers=[]
2126  modifierStrings=[]
2127  modifierImports=[]
2128 
2129  if hasattr(self._options,"era") and self._options.era :
2130  # Multiple eras can be specified in a comma seperated list
2131  from Configuration.StandardSequences.Eras import eras
2132  for requestedEra in self._options.era.split(",") :
2133  modifierStrings.append(requestedEra)
2134  modifierImports.append(eras.pythonCfgLines[requestedEra])
2135  modifiers.append(getattr(eras,requestedEra))
2136 
2137 
2138  if hasattr(self._options,"procModifiers") and self._options.procModifiers:
2139  import importlib
2140  thingsImported=[]
2141  for c in self._options.procModifiers:
2142  thingsImported.extend(c.split(","))
2143  for pm in thingsImported:
2144  modifierStrings.append(pm)
2145  modifierImports.append('from Configuration.ProcessModifiers.'+pm+'_cff import '+pm)
2146  modifiers.append(getattr(importlib.import_module('Configuration.ProcessModifiers.'+pm+'_cff'),pm))
2147 
2148  self.pythonCfgCode += '\n'.join(modifierImports)+'\n\n'
2149  self.pythonCfgCode += "process = cms.Process('"+self._options.name+"'" # Start of the line, finished after the loop
2150 
2151 
2152  if len(modifierStrings)>0:
2153  self.pythonCfgCode+= ','+','.join(modifierStrings)
2154  self.pythonCfgCode+=')\n\n'
2155 
2156  #yes, the cfg code gets out of sync here if a process is passed in. That could be fixed in the future
2157  #assuming there is some way for the fwk to get the list of modifiers (and their stringified name)
2158  if self.process == None:
2159  if len(modifiers)>0:
2160  self.process = cms.Process(self._options.name,*modifiers)
2161  else:
2162  self.process = cms.Process(self._options.name)
2163 
2164 
2165 
process
adding standard sequences might change the inputEventContent option and therefore needs to be finaliz...
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def ConfigBuilder.ConfigBuilder.define_Configs (   self)

Definition at line 939 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.loadAndRemember(), print(), and ConfigBuilder.ConfigBuilder.stepMap.

940  def define_Configs(self):
941  if len(self.stepMap):
942  self.loadAndRemember('Configuration/StandardSequences/Services_cff')
943  if self._options.particleTable not in defaultOptions.particleTableList:
944  print('Invalid particle table provided. Options are:')
945  print(defaultOptions.particleTable)
946  sys.exit(-1)
947  else:
948  if len(self.stepMap):
949  self.loadAndRemember('SimGeneral.HepPDTESSource.'+self._options.particleTable+'_cfi')
950 
951  self.loadAndRemember('FWCore/MessageService/MessageLogger_cfi')
953  self.ALCADefaultCFF="Configuration/StandardSequences/AlCaRecoStreams_cff"
954  self.GENDefaultCFF="Configuration/StandardSequences/Generator_cff"
955  self.SIMDefaultCFF="Configuration/StandardSequences/Sim_cff"
956  self.DIGIDefaultCFF="Configuration/StandardSequences/Digi_cff"
957  self.DIGI2RAWDefaultCFF="Configuration/StandardSequences/DigiToRaw_cff"
958  self.L1EMDefaultCFF='Configuration/StandardSequences/SimL1Emulator_cff'
959  self.L1MENUDefaultCFF="Configuration/StandardSequences/L1TriggerDefaultMenu_cff"
960  self.HLTDefaultCFF="Configuration/StandardSequences/HLTtable_cff"
961  self.RAW2DIGIDefaultCFF="Configuration/StandardSequences/RawToDigi_Data_cff"
962  if self._options.isRepacked: self.RAW2DIGIDefaultCFF="Configuration/StandardSequences/RawToDigi_DataMapper_cff"
963  self.L1RecoDefaultCFF="Configuration/StandardSequences/L1Reco_cff"
964  self.L1TrackTriggerDefaultCFF="Configuration/StandardSequences/L1TrackTrigger_cff"
965  self.RECODefaultCFF="Configuration/StandardSequences/Reconstruction_Data_cff"
966  self.RECOSIMDefaultCFF="Configuration/StandardSequences/RecoSim_cff"
967  self.PATDefaultCFF="Configuration/StandardSequences/PAT_cff"
968  self.NANODefaultCFF="PhysicsTools/NanoAOD/nano_cff"
969  self.NANOGENDefaultCFF="PhysicsTools/NanoAOD/nanogen_cff"
970  self.EIDefaultCFF=None
971  self.SKIMDefaultCFF="Configuration/StandardSequences/Skims_cff"
972  self.POSTRECODefaultCFF="Configuration/StandardSequences/PostRecoGenerator_cff"
973  self.VALIDATIONDefaultCFF="Configuration/StandardSequences/Validation_cff"
974  self.L1HwValDefaultCFF = "Configuration/StandardSequences/L1HwVal_cff"
975  self.DQMOFFLINEDefaultCFF="DQMOffline/Configuration/DQMOffline_cff"
976  self.HARVESTINGDefaultCFF="Configuration/StandardSequences/Harvesting_cff"
977  self.ALCAHARVESTDefaultCFF="Configuration/StandardSequences/AlCaHarvesting_cff"
978  self.ENDJOBDefaultCFF="Configuration/StandardSequences/EndOfProcess_cff"
979  self.ConditionsDefaultCFF = "Configuration/StandardSequences/FrontierConditions_GlobalTag_cff"
980  self.CFWRITERDefaultCFF = "Configuration/StandardSequences/CrossingFrameWriter_cff"
981  self.REPACKDefaultCFF="Configuration/StandardSequences/DigiToRaw_Repack_cff"
982 
983  if "DATAMIX" in self.stepMap.keys():
984  self.DATAMIXDefaultCFF="Configuration/StandardSequences/DataMixer"+self._options.datamix+"_cff"
985  self.DIGIDefaultCFF="Configuration/StandardSequences/DigiDM_cff"
986  self.DIGI2RAWDefaultCFF="Configuration/StandardSequences/DigiToRawDM_cff"
987  self.L1EMDefaultCFF='Configuration/StandardSequences/SimL1EmulatorDM_cff'
989  self.ALCADefaultSeq=None
990  self.LHEDefaultSeq='externalLHEProducer'
991  self.GENDefaultSeq='pgen'
992  self.SIMDefaultSeq='psim'
993  self.DIGIDefaultSeq='pdigi'
995  self.DIGI2RAWDefaultSeq='DigiToRaw'
996  self.HLTDefaultSeq='GRun'
997  self.L1DefaultSeq=None
1002  self.RAW2DIGIDefaultSeq='RawToDigi'
1003  self.L1RecoDefaultSeq='L1Reco'
1004  self.L1TrackTriggerDefaultSeq='L1TrackTrigger'
1005  if self._options.fast or ('RAW2DIGI' in self.stepMap and 'RECO' in self.stepMap):
1006  self.RECODefaultSeq='reconstruction'
1007  else:
1008  self.RECODefaultSeq='reconstruction_fromRECO'
1009  self.RECOSIMDefaultSeq='recosim'
1010  self.EIDefaultSeq='top'
1012  self.L1HwValDefaultSeq='L1HwVal'
1013  self.DQMDefaultSeq='DQMOffline'
1015  self.ENDJOBDefaultSeq='endOfProcess'
1016  self.REPACKDefaultSeq='DigiToRawRepack'
1017  self.PATDefaultSeq='miniAOD'
1018  self.PATGENDefaultSeq='miniGEN'
1019  #TODO: Check based of file input
1020  self.NANOGENDefaultSeq='nanogenSequence'
1021  self.NANODefaultSeq='nanoSequence'
1023  self.EVTCONTDefaultCFF="Configuration/EventContent/EventContent_cff"
1024 
1025  if not self._options.beamspot:
1026  self._options.beamspot=VtxSmearedDefaultKey
1027 
1028  # if its MC then change the raw2digi
1029  if self._options.isMC==True:
1030  self.RAW2DIGIDefaultCFF="Configuration/StandardSequences/RawToDigi_cff"
1031  self.RECODefaultCFF="Configuration/StandardSequences/Reconstruction_cff"
1032  self.PATDefaultCFF="Configuration/StandardSequences/PATMC_cff"
1033  self.PATGENDefaultCFF="Configuration/StandardSequences/PATGEN_cff"
1034  self.DQMOFFLINEDefaultCFF="DQMOffline/Configuration/DQMOfflineMC_cff"
1035  self.ALCADefaultCFF="Configuration/StandardSequences/AlCaRecoStreamsMC_cff"
1036  self.NANODefaultSeq='nanoSequenceMC'
1037  else:
1038  self._options.beamspot = None
1039 
1040  #patch for gen, due to backward incompatibility
1041  if 'reGEN' in self.stepMap:
1042  self.GENDefaultSeq='fixGenInfo'
1043 
1044  if self._options.scenario=='cosmics':
1045  self._options.pileup='Cosmics'
1046  self.DIGIDefaultCFF="Configuration/StandardSequences/DigiCosmics_cff"
1047  self.RECODefaultCFF="Configuration/StandardSequences/ReconstructionCosmics_cff"
1048  self.SKIMDefaultCFF="Configuration/StandardSequences/SkimsCosmics_cff"
1049  self.EVTCONTDefaultCFF="Configuration/EventContent/EventContentCosmics_cff"
1050  self.VALIDATIONDefaultCFF="Configuration/StandardSequences/ValidationCosmics_cff"
1051  self.DQMOFFLINEDefaultCFF="DQMOffline/Configuration/DQMOfflineCosmics_cff"
1052  if self._options.isMC==True:
1053  self.DQMOFFLINEDefaultCFF="DQMOffline/Configuration/DQMOfflineCosmicsMC_cff"
1054  self.HARVESTINGDefaultCFF="Configuration/StandardSequences/HarvestingCosmics_cff"
1055  self.RECODefaultSeq='reconstructionCosmics'
1056  self.DQMDefaultSeq='DQMOfflineCosmics'
1057 
1058  if self._options.scenario=='HeavyIons':
1059  if not self._options.beamspot:
1060  self._options.beamspot=VtxSmearedHIDefaultKey
1061  self.HLTDefaultSeq = 'HIon'
1062  self.VALIDATIONDefaultCFF="Configuration/StandardSequences/ValidationHeavyIons_cff"
1063  self.VALIDATIONDefaultSeq=''
1064  self.EVTCONTDefaultCFF="Configuration/EventContent/EventContentHeavyIons_cff"
1065  self.RECODefaultCFF="Configuration/StandardSequences/ReconstructionHeavyIons_cff"
1066  self.RECODefaultSeq='reconstructionHeavyIons'
1067  self.ALCADefaultCFF = "Configuration/StandardSequences/AlCaRecoStreamsHeavyIons_cff"
1068  self.DQMOFFLINEDefaultCFF="DQMOffline/Configuration/DQMOfflineHeavyIons_cff"
1069  self.DQMDefaultSeq='DQMOfflineHeavyIons'
1070  self.SKIMDefaultCFF="Configuration/StandardSequences/SkimsHeavyIons_cff"
1071  self.HARVESTINGDefaultCFF="Configuration/StandardSequences/HarvestingHeavyIons_cff"
1072  if self._options.isMC==True:
1073  self.DQMOFFLINEDefaultCFF="DQMOffline/Configuration/DQMOfflineHeavyIonsMC_cff"
1074 
1078  self.USERDefaultSeq='user'
1079  self.USERDefaultCFF=None
1080 
1081  # the magnetic field
1082  self.magFieldCFF = 'Configuration/StandardSequences/MagneticField_'+self._options.magField.replace('.','')+'_cff'
1083  self.magFieldCFF = self.magFieldCFF.replace("__",'_')
1084 
1085  # the geometry
1086  self.GeometryCFF='Configuration/StandardSequences/GeometryRecoDB_cff'
1087  self.geometryDBLabel=None
1088  simGeometry=''
1089  if self._options.fast:
1090  if 'start' in self._options.conditions.lower():
1091  self.GeometryCFF='FastSimulation/Configuration/Geometries_START_cff'
1092  else:
1093  self.GeometryCFF='FastSimulation/Configuration/Geometries_MC_cff'
1094  else:
1095  def inGeometryKeys(opt):
1096  from Configuration.StandardSequences.GeometryConf import GeometryConf
1097  if opt in GeometryConf:
1098  return GeometryConf[opt]
1099  else:
1100  return opt
1101 
1102  geoms=self._options.geometry.split(',')
1103  if len(geoms)==1: geoms=inGeometryKeys(geoms[0]).split(',')
1104  if len(geoms)==2:
1105  #may specify the reco geometry
1106  if '/' in geoms[1] or '_cff' in geoms[1]:
1107  self.GeometryCFF=geoms[1]
1108  else:
1109  self.GeometryCFF='Configuration/Geometry/Geometry'+geoms[1]+'_cff'
1110 
1111  if (geoms[0].startswith('DB:')):
1112  self.SimGeometryCFF='Configuration/StandardSequences/GeometrySimDB_cff'
1113  self.geometryDBLabel=geoms[0][3:]
1114  print("with DB:")
1115  else:
1116  if '/' in geoms[0] or '_cff' in geoms[0]:
1117  self.SimGeometryCFF=geoms[0]
1118  else:
1119  simGeometry=geoms[0]
1120  if self._options.gflash==True:
1121  self.SimGeometryCFF='Configuration/Geometry/Geometry'+geoms[0]+'GFlash_cff'
1122  else:
1123  self.SimGeometryCFF='Configuration/Geometry/Geometry'+geoms[0]+'_cff'
1124 
1125  # synchronize the geometry configuration and the FullSimulation sequence to be used
1126  if simGeometry not in defaultOptions.geometryExtendedOptions:
1127  self.SIMDefaultCFF="Configuration/StandardSequences/SimIdeal_cff"
1128 
1129  if self._options.scenario=='nocoll' or self._options.scenario=='cosmics':
1130  self.SIMDefaultCFF="Configuration/StandardSequences/SimNOBEAM_cff"
1131  self._options.beamspot='NoSmear'
1132 
1133  # fastsim requires some changes to the default cff files and sequences
1134  if self._options.fast:
1135  self.SIMDefaultCFF = 'FastSimulation.Configuration.SimIdeal_cff'
1136  self.RECODefaultCFF= 'FastSimulation.Configuration.Reconstruction_AftMix_cff'
1137  self.RECOBEFMIXDefaultCFF = 'FastSimulation.Configuration.Reconstruction_BefMix_cff'
1138  self.RECOBEFMIXDefaultSeq = 'reconstruction_befmix'
1139  self.NANODefaultSeq = 'nanoSequenceFS'
1140  self.DQMOFFLINEDefaultCFF="DQMOffline.Configuration.DQMOfflineFS_cff"
1141 
1142  # Mixing
1143  if self._options.pileup=='default':
1144  from Configuration.StandardSequences.Mixing import MixingDefaultKey
1145  self._options.pileup=MixingDefaultKey
1146 
1147 
1148  #not driven by a default cff anymore
1149  if self._options.isData:
1150  self._options.pileup=None
1151 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def ConfigBuilder.ConfigBuilder.executeAndRemember (   self,
  command 
)
helper routine to remember replace statements

Definition at line 331 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addCustomiseCmdLine(), ConfigBuilder.ConfigBuilder.addOutput(), ConfigBuilder.ConfigBuilder.addStandardSequences(), ConfigBuilder.ConfigBuilder.prepare_ALCAHARVEST(), ConfigBuilder.ConfigBuilder.prepare_DATAMIX(), ConfigBuilder.ConfigBuilder.prepare_DIGI(), ConfigBuilder.ConfigBuilder.prepare_GEN(), ConfigBuilder.ConfigBuilder.prepare_HLT(), ConfigBuilder.ConfigBuilder.prepare_SIM(), and ConfigBuilder.ConfigBuilder.prepare_VALIDATION().

332  def executeAndRemember(self, command):
333  """helper routine to remember replace statements"""
334  self.additionalCommands.append(command)
335  if not command.strip().startswith("#"):
336  # substitute: process.foo = process.bar -> self.process.foo = self.process.bar
337  import re
338  exec(re.sub(r"([^a-zA-Z_0-9]|^)(process)([^a-zA-Z_0-9])",r"\1self.process\3",command))
339  #exec(command.replace("process.","self.process."))
def ConfigBuilder.ConfigBuilder.expandMapping (   self,
  seqList,
  mapping,
  index = None 
)

Definition at line 1961 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_ALCA(), ConfigBuilder.ConfigBuilder.prepare_ALCAHARVEST(), ConfigBuilder.ConfigBuilder.prepare_DQM(), ConfigBuilder.ConfigBuilder.prepare_SKIM(), and ConfigBuilder.ConfigBuilder.prepare_VALIDATION().

1962  def expandMapping(self,seqList,mapping,index=None):
1963  maxLevel=30
1964  level=0
1965  while '@' in repr(seqList) and level<maxLevel:
1966  level+=1
1967  for specifiedCommand in seqList:
1968  if specifiedCommand.startswith('@'):
1969  location=specifiedCommand[1:]
1970  if not location in mapping:
1971  raise Exception("Impossible to map "+location+" from "+repr(mapping))
1972  mappedTo=mapping[location]
1973  if index!=None:
1974  mappedTo=mappedTo[index]
1975  seqList.remove(specifiedCommand)
1976  seqList.extend(mappedTo.split('+'))
1977  break;
1978  if level==maxLevel:
1979  raise Exception("Could not fully expand "+repr(seqList)+" from "+repr(mapping))
def ConfigBuilder.ConfigBuilder.finalizeFastSimHLT (   self)

Definition at line 2101 of file ConfigBuilder.py.

2102  def finalizeFastSimHLT(self):
2103  self.process.reconstruction = cms.Path(self.process.reconstructionWithFamos)
2104  self.schedule.append(self.process.reconstruction)
2105 
def ConfigBuilder.ConfigBuilder.load (   self,
  includeFile 
)

Definition at line 317 of file ConfigBuilder.py.

Referenced by MatrixToProcess.MatrixToProcess.getProcess(), MatrixToProcess.MatrixToProcess.listAll(), and ConfigBuilder.ConfigBuilder.prepare_FILTER().

318  def load(self,includeFile):
319  includeFile = includeFile.replace('/','.')
320  self.process.load(includeFile)
321  return sys.modules[includeFile]
def ConfigBuilder.ConfigBuilder.loadAndRemember (   self,
  includeFile 
)
helper routine to load am memorize imports

Definition at line 322 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addConditions(), ConfigBuilder.ConfigBuilder.addStandardSequences(), ConfigBuilder.ConfigBuilder.define_Configs(), ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), ConfigBuilder.ConfigBuilder.prepare(), ConfigBuilder.ConfigBuilder.prepare_ALCAHARVEST(), ConfigBuilder.ConfigBuilder.prepare_CFWRITER(), ConfigBuilder.ConfigBuilder.prepare_DATAMIX(), ConfigBuilder.ConfigBuilder.prepare_DIGI(), ConfigBuilder.ConfigBuilder.prepare_DQM(), ConfigBuilder.ConfigBuilder.prepare_GEN(), ConfigBuilder.ConfigBuilder.prepare_HLT(), ConfigBuilder.ConfigBuilder.prepare_L1(), ConfigBuilder.ConfigBuilder.prepare_L1REPACK(), ConfigBuilder.ConfigBuilder.prepare_PATFILTER(), ConfigBuilder.ConfigBuilder.prepare_POSTRECO(), and ConfigBuilder.ConfigBuilder.prepare_SIM().

323  def loadAndRemember(self, includeFile):
324  """helper routine to load am memorize imports"""
325  # we could make the imports a on-the-fly data method of the process instance itself
326  # not sure if the latter is a good idea
327  includeFile = includeFile.replace('/','.')
328  self.imports.append(includeFile)
329  self.process.load(includeFile)
330  return sys.modules[includeFile]
def ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF (   self,
  sequence,
  defaultCFF 
)

Definition at line 1220 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.loadAndRemember(), and print().

Referenced by ConfigBuilder.ConfigBuilder.prepare_ALCA(), ConfigBuilder.ConfigBuilder.prepare_DIGI(), ConfigBuilder.ConfigBuilder.prepare_DIGI2RAW(), ConfigBuilder.ConfigBuilder.prepare_DQM(), ConfigBuilder.ConfigBuilder.prepare_EI(), ConfigBuilder.ConfigBuilder.prepare_ENDJOB(), ConfigBuilder.ConfigBuilder.prepare_GEN(), ConfigBuilder.ConfigBuilder.prepare_L1HwVal(), ConfigBuilder.ConfigBuilder.prepare_L1Reco(), ConfigBuilder.ConfigBuilder.prepare_L1TrackTrigger(), ConfigBuilder.ConfigBuilder.prepare_NANO(), ConfigBuilder.ConfigBuilder.prepare_NANOGEN(), ConfigBuilder.ConfigBuilder.prepare_PAT(), ConfigBuilder.ConfigBuilder.prepare_PATGEN(), ConfigBuilder.ConfigBuilder.prepare_RAW2DIGI(), ConfigBuilder.ConfigBuilder.prepare_RECO(), ConfigBuilder.ConfigBuilder.prepare_RECOBEFMIX(), ConfigBuilder.ConfigBuilder.prepare_RECOSIM(), ConfigBuilder.ConfigBuilder.prepare_REPACK(), ConfigBuilder.ConfigBuilder.prepare_SIM(), ConfigBuilder.ConfigBuilder.prepare_SKIM(), ConfigBuilder.ConfigBuilder.prepare_USER(), and ConfigBuilder.ConfigBuilder.prepare_VALIDATION().

1221  def loadDefaultOrSpecifiedCFF(self, sequence,defaultCFF):
1222  if ( len(sequence.split('.'))==1 ):
1223  l=self.loadAndRemember(defaultCFF)
1224  elif ( len(sequence.split('.'))==2 ):
1225  l=self.loadAndRemember(sequence.split('.')[0])
1226  sequence=sequence.split('.')[1]
1227  else:
1228  print("sub sequence configuration must be of the form dir/subdir/cff.a+b+c or cff.a")
1229  print(sequence,"not recognized")
1230  raise
1231  return l
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def ConfigBuilder.ConfigBuilder.prepare (   self,
  doChecking = False 
)
Prepare the configuration string and add missing pieces.

Definition at line 2166 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.addCommon(), ConfigBuilder.ConfigBuilder.addConditions(), ConfigBuilder.ConfigBuilder.addCustomise(), ConfigBuilder.ConfigBuilder.addCustomiseCmdLine(), ConfigBuilder.ConfigBuilder.addedObjects, ConfigBuilder.ConfigBuilder.additionalCommands, ConfigBuilder.ConfigBuilder.additionalOutputs, ConfigBuilder.ConfigBuilder.addMaxEvents(), ConfigBuilder.ConfigBuilder.addOutput(), ConfigBuilder.ConfigBuilder.addSource(), ConfigBuilder.ConfigBuilder.addStandardSequences(), helpers.associatePatAlgosToolsTask(), ConfigBuilder.ConfigBuilder.blacklist_paths, ConfigBuilder.ConfigBuilder.build_production_info(), ConfigBuilder.ConfigBuilder.completeInputCommand(), ConfigBuilder.ConfigBuilder.conditionalPaths, earlyDeleteSettings_cff.customiseEarlyDelete(), logErrorHarvester_cff.customiseLogErrorHarvesterUsingOutputCommands(), ConfigBuilder.dumpPython(), ConfigBuilder.ConfigBuilder.EVTCONTDefaultCFF, ConfigBuilder.ConfigBuilder.excludedPaths, ConfigBuilder.ConfigBuilder.imports, edm::eventsetup::heterocontainer.insert(), mps_monitormerge.items, join(), ConfigBuilder.ConfigBuilder.labelsToAssociate, ConfigBuilder.ConfigBuilder.loadAndRemember(), print(), DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, ConfigBuilder.ConfigBuilder.process, ConfigBuilder.ConfigBuilder.productionFilterSequence, ConfigBuilder.ConfigBuilder.pythonCfgCode, ConfigBuilder.ConfigBuilder.schedule, ConfigBuilder.ConfigBuilder.scheduleIndexOfFirstHLTPath, str, ConfigBuilder.ConfigBuilder.with_input, and ConfigBuilder.ConfigBuilder.with_output.

2167  def prepare(self, doChecking = False):
2168  """ Prepare the configuration string and add missing pieces."""
2169 
2170  self.loadAndRemember(self.EVTCONTDefaultCFF) #load the event contents regardless
2171  self.addMaxEvents()
2172  if self.with_input:
2173  self.addSource()
2174  self.addStandardSequences()
2175  ##adding standard sequences might change the inputEventContent option and therefore needs to be finalized after
2176  self.completeInputCommand()
2177  self.addConditions()
2178 
2179 
2180  outputModuleCfgCode=""
2181  if not 'HARVESTING' in self.stepMap.keys() and not 'ALCAHARVEST' in self.stepMap.keys() and not 'ALCAOUTPUT' in self.stepMap.keys() and self.with_output:
2182  outputModuleCfgCode=self.addOutput()
2183 
2184  self.addCommon()
2185 
2186  self.pythonCfgCode += "# import of standard configurations\n"
2187  for module in self.imports:
2188  self.pythonCfgCode += ("process.load('"+module+"')\n")
2189 
2190  # production info
2191  if not hasattr(self.process,"configurationMetadata"):
2192  self.build_production_info(self._options.evt_type, self._options.number)
2193  else:
2194  #the PSet was added via a load
2195  self.addedObjects.append(("Production Info","configurationMetadata"))
2196 
2197  self.pythonCfgCode +="\n"
2198  for comment,object in self.addedObjects:
2199  if comment!="":
2200  self.pythonCfgCode += "\n# "+comment+"\n"
2201  self.pythonCfgCode += dumpPython(self.process,object)
2202 
2203  # dump the output definition
2204  self.pythonCfgCode += "\n# Output definition\n"
2205  self.pythonCfgCode += outputModuleCfgCode
2206 
2207  # dump all additional outputs (e.g. alca or skim streams)
2208  self.pythonCfgCode += "\n# Additional output definition\n"
2209  #I do not understand why the keys are not normally ordered.
2210  nl=sorted(self.additionalOutputs.keys())
2211  for name in nl:
2212  output = self.additionalOutputs[name]
2213  self.pythonCfgCode += "process.%s = %s" %(name, output.dumpPython())
2214  tmpOut = cms.EndPath(output)
2215  setattr(self.process,name+'OutPath',tmpOut)
2216  self.schedule.append(tmpOut)
2217 
2218  # dump all additional commands
2219  self.pythonCfgCode += "\n# Other statements\n"
2220  for command in self.additionalCommands:
2221  self.pythonCfgCode += command + "\n"
2222 
2223  #comma separated list of objects that deserve to be inlined in the configuration (typically from a modified config deep down)
2224  for object in self._options.inlineObjets.split(','):
2225  if not object:
2226  continue
2227  if not hasattr(self.process,object):
2228  print('cannot inline -'+object+'- : not known')
2229  else:
2230  self.pythonCfgCode +='\n'
2231  self.pythonCfgCode +=dumpPython(self.process,object)
2232 
2233  if self._options.pileup=='HiMixEmbGEN':
2234  self.pythonCfgCode += "\nprocess.generator.embeddingMode=cms.bool(True)\n"
2235 
2236  # dump all paths
2237  self.pythonCfgCode += "\n# Path and EndPath definitions\n"
2238  for path in self.process.paths:
2239  if getattr(self.process,path) not in self.blacklist_paths:
2240  self.pythonCfgCode += dumpPython(self.process,path)
2241 
2242  for endpath in self.process.endpaths:
2243  if getattr(self.process,endpath) not in self.blacklist_paths:
2244  self.pythonCfgCode += dumpPython(self.process,endpath)
2245 
2246  # dump the schedule
2247  self.pythonCfgCode += "\n# Schedule definition\n"
2248 
2249  # handling of the schedule
2250  pathNames = ['process.'+p.label_() for p in self.schedule]
2251  if self.process.schedule == None:
2252  self.process.schedule = cms.Schedule()
2253  for item in self.schedule:
2254  self.process.schedule.append(item)
2255  result = 'process.schedule = cms.Schedule('+','.join(pathNames)+')\n'
2256  else:
2257  if not isinstance(self.scheduleIndexOfFirstHLTPath, int):
2258  raise Exception('the schedule was imported from a cff in HLTrigger.Configuration, but the final index of the first HLT path is undefined')
2259 
2260  for index, item in enumerate(self.schedule):
2261  if index < self.scheduleIndexOfFirstHLTPath:
2262  self.process.schedule.insert(index, item)
2263  else:
2264  self.process.schedule.append(item)
2265 
2266  result = "# process.schedule imported from cff in HLTrigger.Configuration\n"
2267  for index, item in enumerate(pathNames[:self.scheduleIndexOfFirstHLTPath]):
2268  result += 'process.schedule.insert('+str(index)+', '+item+')\n'
2269  if self.scheduleIndexOfFirstHLTPath < len(pathNames):
2270  result += 'process.schedule.extend(['+','.join(pathNames[self.scheduleIndexOfFirstHLTPath:])+'])\n'
2271 
2272  self.pythonCfgCode += result
2273 
2274  for labelToAssociate in self.labelsToAssociate:
2275  self.process.schedule.associate(getattr(self.process, labelToAssociate))
2276  self.pythonCfgCode += 'process.schedule.associate(process.' + labelToAssociate + ')\n'
2277 
2278  from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask
2280  self.pythonCfgCode+="from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask\n"
2281  self.pythonCfgCode+="associatePatAlgosToolsTask(process)\n"
2282 
2283  if self._options.nThreads != "1":
2284  self.pythonCfgCode +="\n"
2285  self.pythonCfgCode +="#Setup FWK for multithreaded\n"
2286  self.pythonCfgCode +="process.options.numberOfThreads = "+self._options.nThreads+"\n"
2287  self.pythonCfgCode +="process.options.numberOfStreams = "+self._options.nStreams+"\n"
2288  self.pythonCfgCode +="process.options.numberOfConcurrentLuminosityBlocks = "+self._options.nConcurrentLumis+"\n"
2289  self.pythonCfgCode +="process.options.eventSetup.numberOfConcurrentIOVs = "+self._options.nConcurrentIOVs+"\n"
2290  if int(self._options.nConcurrentLumis) > 1:
2291  self.pythonCfgCode +="if hasattr(process, 'DQMStore'): process.DQMStore.assertLegacySafe=cms.untracked.bool(False)\n"
2292  self.process.options.numberOfThreads = int(self._options.nThreads)
2293  self.process.options.numberOfStreams = int(self._options.nStreams)
2294  self.process.options.numberOfConcurrentLuminosityBlocks = int(self._options.nConcurrentLumis)
2295  self.process.options.eventSetup.numberOfConcurrentIOVs = int(self._options.nConcurrentIOVs)
2296  #repacked version
2297  if self._options.isRepacked:
2298  self.pythonCfgCode +="\n"
2299  self.pythonCfgCode +="from Configuration.Applications.ConfigBuilder import MassReplaceInputTag\n"
2300  self.pythonCfgCode +="MassReplaceInputTag(process, new=\"rawDataMapperByLabel\", old=\"rawDataCollector\")\n"
2301  MassReplaceInputTag(self.process, new="rawDataMapperByLabel", old="rawDataCollector")
2302 
2303  # special treatment in case of production filter sequence 2/2
2304  if self.productionFilterSequence and not (self._options.pileup=='HiMixEmbGEN'):
2305  self.pythonCfgCode +='# filter all path with the production filter sequence\n'
2306  self.pythonCfgCode +='for path in process.paths:\n'
2307  if len(self.conditionalPaths):
2308  self.pythonCfgCode +='\tif not path in %s: continue\n'%str(self.conditionalPaths)
2309  if len(self.excludedPaths):
2310  self.pythonCfgCode +='\tif path in %s: continue\n'%str(self.excludedPaths)
2311  self.pythonCfgCode +='\tgetattr(process,path).insert(0, process.%s)\n'%(self.productionFilterSequence,)
2312  pfs = getattr(self.process,self.productionFilterSequence)
2313  for path in self.process.paths:
2314  if not path in self.conditionalPaths: continue
2315  if path in self.excludedPaths: continue
2316  getattr(self.process,path).insert(0, pfs)
2317 
2318 
2319  # dump customise fragment
2320  self.pythonCfgCode += self.addCustomise()
2321 
2322  if self._options.runUnscheduled:
2323  print("--runUnscheduled is deprecated and not necessary anymore, and will be removed soon. Please update your command line.")
2324  # Keep the "unscheduled customise functions" separate for now,
2325  # there are customize functions given by users (in our unit
2326  # tests) that need to be run before the "unscheduled customise
2327  # functions"
2328  self.pythonCfgCode += self.addCustomise(1)
2329 
2330  self.pythonCfgCode += self.addCustomiseCmdLine()
2331 
2332  if hasattr(self.process,"logErrorHarvester"):
2333  #configure logErrorHarvester to wait for same EDProducers to finish as the OutputModules
2334  self.pythonCfgCode +="\n#Have logErrorHarvester wait for the same EDProducers to finish as those providing data for the OutputModule\n"
2335  self.pythonCfgCode +="from FWCore.Modules.logErrorHarvester_cff import customiseLogErrorHarvesterUsingOutputCommands\n"
2336  self.pythonCfgCode +="process = customiseLogErrorHarvesterUsingOutputCommands(process)\n"
2337  from FWCore.Modules.logErrorHarvester_cff import customiseLogErrorHarvesterUsingOutputCommands
2339 
2340  # Temporary hack to put the early delete customization after
2341  # everything else
2342  #
2343  # FIXME: remove when no longer needed
2344  self.pythonCfgCode += "\n# Add early deletion of temporary data products to reduce peak memory need\n"
2345  self.pythonCfgCode += "from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete\n"
2346  self.pythonCfgCode += "process = customiseEarlyDelete(process)\n"
2347  self.pythonCfgCode += "# End adding early deletion\n"
2348  from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete
2349  self.process = customiseEarlyDelete(self.process)
2350 
2351  imports = cms.specialImportRegistry.getSpecialImports()
2352  if len(imports) > 0:
2353  #need to inject this at the top
2354  index = self.pythonCfgCode.find("import FWCore.ParameterSet.Config")
2355  #now find the end of line
2356  index = self.pythonCfgCode.find("\n",index)
2357  self.pythonCfgCode = self.pythonCfgCode[:index]+ "\n" + "\n".join(imports)+"\n" +self.pythonCfgCode[index:]
2358 
2359 
2360  # make the .io file
2361 
2362  if self._options.io:
2363  #io=open(self._options.python_filename.replace('.py','.io'),'w')
2364  if not self._options.io.endswith('.io'): self._option.io+='.io'
2365  io=open(self._options.io,'w')
2366  ioJson={}
2367  if hasattr(self.process.source,"fileNames"):
2368  if len(self.process.source.fileNames.value()):
2369  ioJson['primary']=self.process.source.fileNames.value()
2370  if hasattr(self.process.source,"secondaryFileNames"):
2371  if len(self.process.source.secondaryFileNames.value()):
2372  ioJson['secondary']=self.process.source.secondaryFileNames.value()
2373  if self._options.pileup_input and (self._options.pileup_input.startswith('dbs:') or self._options.pileup_input.startswith('das:')):
2374  ioJson['pileup']=self._options.pileup_input[4:]
2375  for (o,om) in self.process.outputModules_().items():
2376  ioJson[o]=om.fileName.value()
2377  ioJson['GT']=self.process.GlobalTag.globaltag.value()
2378  if self.productionFilterSequence:
2379  ioJson['filter']=self.productionFilterSequence
2380  import json
2381  io.write(json.dumps(ioJson))
2382  return
2383 
process
adding standard sequences might change the inputEventContent option and therefore needs to be finaliz...
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
productionFilterSequence
put it before all the other paths
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:50
def associatePatAlgosToolsTask
Definition: helpers.py:24
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
#define str(s)
def ConfigBuilder.ConfigBuilder.prepare_ALCA (   self,
  sequence = None,
  workflow = 'full' 
)
Enrich the process with alca streams 

Definition at line 1271 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.ALCADefaultCFF, ConfigBuilder.ConfigBuilder.expandMapping(), and ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF().

Referenced by ConfigBuilder.ConfigBuilder.prepare_ALCAOUTPUT(), and ConfigBuilder.ConfigBuilder.prepare_ALCAPRODUCER().

1272  def prepare_ALCA(self, sequence = None, workflow = 'full'):
1273  """ Enrich the process with alca streams """
1274  alcaConfig=self.loadDefaultOrSpecifiedCFF(sequence,self.ALCADefaultCFF)
1275  sequence = sequence.split('.')[-1]
1276 
1277  # decide which ALCA paths to use
1278  alcaList = sequence.split("+")
1279  maxLevel=0
1280  from Configuration.AlCa.autoAlca import autoAlca, AlCaNoConcurrentLumis
1281  # support @X from autoAlca.py, and recursion support: i.e T0:@Mu+@EG+...
1282  self.expandMapping(alcaList,autoAlca)
1283  self.AlCaPaths=[]
1284  for name in alcaConfig.__dict__:
1285  alcastream = getattr(alcaConfig,name)
1286  shortName = name.replace('ALCARECOStream','')
1287  if shortName in alcaList and isinstance(alcastream,cms.FilteredStream):
1288  if shortName in AlCaNoConcurrentLumis:
1289  print("Setting numberOfConcurrentLuminosityBlocks=1 because of AlCa sequence {}".format(shortName))
1290  self._options.nConcurrentLumis = "1"
1291  self._options.nConcurrentIOVs = "1"
1292  output = self.addExtraStream(name,alcastream, workflow = workflow)
1293  self.executeAndRemember('process.ALCARECOEventContent.outputCommands.extend(process.OutALCARECO'+shortName+'_noDrop.outputCommands)')
1294  self.AlCaPaths.append(shortName)
1295  if 'DQM' in alcaList:
1296  if not self._options.inlineEventContent and hasattr(self.process,name):
1297  self.executeAndRemember('process.' + name + '.outputCommands.append("keep *_MEtoEDMConverter_*_*")')
1298  else:
1299  output.outputCommands.append("keep *_MEtoEDMConverter_*_*")
1300 
1301  #rename the HLT process name in the alca modules
1302  if self._options.hltProcess or 'HLT' in self.stepMap:
1303  if isinstance(alcastream.paths,tuple):
1304  for path in alcastream.paths:
1305  self.renameHLTprocessInSequence(path.label())
1306  else:
1307  self.renameHLTprocessInSequence(alcastream.paths.label())
1308 
1309  for i in range(alcaList.count(shortName)):
1310  alcaList.remove(shortName)
1311 
1312  # DQM needs a special handling
1313  elif name == 'pathALCARECODQM' and 'DQM' in alcaList:
1314  path = getattr(alcaConfig,name)
1315  self.schedule.append(path)
1316  alcaList.remove('DQM')
1317 
1318  if isinstance(alcastream,cms.Path):
1319  #black list the alca path so that they do not appear in the cfg
1320  self.blacklist_paths.append(alcastream)
1321 
1322 
1323  if len(alcaList) != 0:
1324  available=[]
1325  for name in alcaConfig.__dict__:
1326  alcastream = getattr(alcaConfig,name)
1327  if isinstance(alcastream,cms.FilteredStream):
1328  available.append(name.replace('ALCARECOStream',''))
1329  print("The following alcas could not be found "+str(alcaList))
1330  print("available ",available)
1331  #print "verify your configuration, ignoring for now"
1332  raise Exception("The following alcas could not be found "+str(alcaList))
process
adding standard sequences might change the inputEventContent option and therefore needs to be finaliz...
const uint16_t range(const Frame &aFrame)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
#define str(s)
def ConfigBuilder.ConfigBuilder.prepare_ALCAHARVEST (   self,
  sequence = None 
)
Enrich the process with AlCaHarvesting step 

Definition at line 2061 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.ALCAHARVESTDefaultCFF, ConfigBuilder.ConfigBuilder.executeAndRemember(), ConfigBuilder.ConfigBuilder.expandMapping(), ConfigBuilder.ConfigBuilder.loadAndRemember(), print(), and str.

2062  def prepare_ALCAHARVEST(self, sequence = None):
2063  """ Enrich the process with AlCaHarvesting step """
2064  harvestingConfig = self.loadAndRemember(self.ALCAHARVESTDefaultCFF)
2065  sequence=sequence.split(".")[-1]
2066 
2067  # decide which AlcaHARVESTING paths to use
2068  harvestingList = sequence.split("+")
2069 
2070 
2071 
2072  from Configuration.AlCa.autoPCL import autoPCL
2073  self.expandMapping(harvestingList,autoPCL)
2074 
2075  for name in harvestingConfig.__dict__:
2076  harvestingstream = getattr(harvestingConfig,name)
2077  if name in harvestingList and isinstance(harvestingstream,cms.Path):
2078  self.schedule.append(harvestingstream)
2079  if isinstance(getattr(harvestingConfig,"ALCAHARVEST" + name + "_dbOutput"), cms.VPSet) and \
2080  isinstance(getattr(harvestingConfig,"ALCAHARVEST" + name + "_metadata"), cms.VPSet):
2081  self.executeAndRemember("process.PoolDBOutputService.toPut.extend(process.ALCAHARVEST" + name + "_dbOutput)")
2082  self.executeAndRemember("process.pclMetadataWriter.recordsToMap.extend(process.ALCAHARVEST" + name + "_metadata)")
2083  else:
2084  self.executeAndRemember("process.PoolDBOutputService.toPut.append(process.ALCAHARVEST" + name + "_dbOutput)")
2085  self.executeAndRemember("process.pclMetadataWriter.recordsToMap.append(process.ALCAHARVEST" + name + "_metadata)")
2086  harvestingList.remove(name)
2087  # append the common part at the end of the sequence
2088  lastStep = getattr(harvestingConfig,"ALCAHARVESTDQMSaveAndMetadataWriter")
2089  self.schedule.append(lastStep)
2090 
2091  if len(harvestingList) != 0 and 'dummyHarvesting' not in harvestingList :
2092  print("The following harvesting could not be found : ", harvestingList)
2093  raise Exception("The following harvesting could not be found : "+str(harvestingList))
2094 
2095 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
#define str(s)
def ConfigBuilder.ConfigBuilder.prepare_ALCAOUTPUT (   self,
  sequence = None 
)

Definition at line 1268 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.prepare_ALCA().

1269  def prepare_ALCAOUTPUT(self, sequence = None):
1270  self.prepare_ALCA(sequence, workflow = "output")
def ConfigBuilder.ConfigBuilder.prepare_ALCAPRODUCER (   self,
  sequence = None 
)

Definition at line 1265 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.prepare_ALCA().

1266  def prepare_ALCAPRODUCER(self, sequence = None):
1267  self.prepare_ALCA(sequence, workflow = "producers")
def ConfigBuilder.ConfigBuilder.prepare_CFWRITER (   self,
  sequence = None 
)
Enrich the schedule with the crossing frame writer step

Definition at line 1476 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.CFWRITERDefaultCFF, ConfigBuilder.ConfigBuilder.loadAndRemember(), and ConfigBuilder.ConfigBuilder.scheduleSequence().

1477  def prepare_CFWRITER(self, sequence = None):
1478  """ Enrich the schedule with the crossing frame writer step"""
1480  self.scheduleSequence('pcfw','cfwriter_step')
1481  return
def ConfigBuilder.ConfigBuilder.prepare_DATAMIX (   self,
  sequence = None 
)
Enrich the schedule with the digitisation step

Definition at line 1482 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.DATAMIXDefaultCFF, ConfigBuilder.ConfigBuilder.executeAndRemember(), ConfigBuilder.filesFromDASQuery(), ConfigBuilder.filesFromList(), ConfigBuilder.ConfigBuilder.loadAndRemember(), and ConfigBuilder.ConfigBuilder.scheduleSequence().

1483  def prepare_DATAMIX(self, sequence = None):
1484  """ Enrich the schedule with the digitisation step"""
1486  self.scheduleSequence('pdatamix','datamixing_step')
1487 
1488  if self._options.pileup_input:
1489  theFiles=''
1490  if self._options.pileup_input.startswith('dbs:') or self._options.pileup_input.startswith('das:'):
1491  theFiles=filesFromDASQuery('file dataset = %s'%(self._options.pileup_input[4:],),self._options.pileup_dasoption)[0]
1492  elif self._options.pileup_input.startswith("filelist:"):
1493  theFiles= (filesFromList(self._options.pileup_input[9:]))[0]
1494  else:
1495  theFiles=self._options.pileup_input.split(',')
1496  #print theFiles
1497  self.executeAndRemember( "process.mixData.input.fileNames = cms.untracked.vstring(%s)"%( theFiles ) )
1498 
1499  return
def ConfigBuilder.ConfigBuilder.prepare_DIGI (   self,
  sequence = None 
)
Enrich the schedule with the digitisation step

Definition at line 1456 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.DIGIDefaultCFF, ConfigBuilder.ConfigBuilder.executeAndRemember(), ConfigBuilder.ConfigBuilder.loadAndRemember(), ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), and ConfigBuilder.ConfigBuilder.scheduleSequence().

1457  def prepare_DIGI(self, sequence = None):
1458  """ Enrich the schedule with the digitisation step"""
1459  self.loadDefaultOrSpecifiedCFF(sequence,self.DIGIDefaultCFF)
1460 
1461  if self._options.gflash==True:
1462  self.loadAndRemember("Configuration/StandardSequences/GFlashDIGI_cff")
1463 
1464  if sequence == 'pdigi_valid' or sequence == 'pdigi_hi':
1465  self.executeAndRemember("process.mix.digitizers = cms.PSet(process.theDigitizersValid)")
1466 
1467  if sequence != 'pdigi_nogen' and sequence != 'pdigi_valid_nogen' and sequence != 'pdigi_hi_nogen' and not self.process.source.type_()=='EmptySource' and not self._options.filetype == "LHE":
1468  if self._options.inputEventContent=='':
1469  self._options.inputEventContent='REGEN'
1470  else:
1471  self._options.inputEventContent=self._options.inputEventContent+',REGEN'
1472 
1473 
1474  self.scheduleSequence(sequence.split('.')[-1],'digitisation_step')
1475  return
def ConfigBuilder.ConfigBuilder.prepare_DIGI2RAW (   self,
  sequence = None 
)

Definition at line 1500 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.DIGI2RAWDefaultCFF, ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), and ConfigBuilder.ConfigBuilder.scheduleSequence().

1501  def prepare_DIGI2RAW(self, sequence = None):
1502  self.loadDefaultOrSpecifiedCFF(sequence,self.DIGI2RAWDefaultCFF)
1503  self.scheduleSequence(sequence.split('.')[-1],'digi2raw_step')
1504  return
def ConfigBuilder.ConfigBuilder.prepare_DQM (   self,
  sequence = 'DQMOffline' 
)

Definition at line 1980 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.DQMOFFLINEDefaultCFF, ConfigBuilder.ConfigBuilder.expandMapping(), edm::eventsetup::heterocontainer.insert(), ConfigBuilder.ConfigBuilder.loadAndRemember(), ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), print(), DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, ConfigBuilder.ConfigBuilder.process, ConfigBuilder.ConfigBuilder.renameHLTprocessInSequence(), and submitPVValidationJobs.split().

1981  def prepare_DQM(self, sequence = 'DQMOffline'):
1982  # this one needs replacement
1983 
1984  # any 'DQM' job should use DQMStore in non-legacy mode (but not HARVESTING)
1985  self.loadAndRemember("DQMServices/Core/DQMStoreNonLegacy_cff")
1987  sequenceList=sequence.split('.')[-1].split('+')
1988  postSequenceList=sequence.split('.')[-1].split('+')
1989  from DQMOffline.Configuration.autoDQM import autoDQM
1990  self.expandMapping(sequenceList,autoDQM,index=0)
1991  self.expandMapping(postSequenceList,autoDQM,index=1)
1992 
1993  if len(set(sequenceList))!=len(sequenceList):
1994  sequenceList=list(set(sequenceList))
1995  print("Duplicate entries for DQM:, using",sequenceList)
1996 
1997  pathName='dqmoffline_step'
1998  for (i,sequence) in enumerate(sequenceList):
1999  if (i!=0):
2000  pathName='dqmoffline_%d_step'%(i)
2001 
2002  if 'HLT' in self.stepMap.keys() or self._options.hltProcess:
2003  self.renameHLTprocessInSequence(sequence)
2004 
2005  setattr(self.process,pathName, cms.EndPath( getattr(self.process,sequence ) ) )
2006  self.schedule.append(getattr(self.process,pathName))
2007 
2008  if hasattr(self.process,"genstepfilter") and len(self.process.genstepfilter.triggerConditions):
2009  #will get in the schedule, smoothly
2010  getattr(self.process,pathName).insert(0,self.process.genstepfilter)
2011 
2012 
2013  pathName='dqmofflineOnPAT_step'
2014  for (i,sequence) in enumerate(postSequenceList):
2015  #Fix needed to avoid duplication of sequences not defined in autoDQM or without a PostDQM
2016  if (sequenceList[i]==postSequenceList[i]):
2017  continue
2018  if (i!=0):
2019  pathName='dqmofflineOnPAT_%d_step'%(i)
2020 
2021  setattr(self.process,pathName, cms.EndPath( getattr(self.process, sequence ) ) )
2022  self.schedule.append(getattr(self.process,pathName))
process
adding standard sequences might change the inputEventContent option and therefore needs to be finaliz...
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:50
def ConfigBuilder.ConfigBuilder.prepare_EI (   self,
  sequence = None 
)
Enrich the schedule with event interpretation 

Definition at line 1738 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.EIDefaultCFF, ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), and ConfigBuilder.ConfigBuilder.scheduleSequence().

1739  def prepare_EI(self, sequence = None):
1740  ''' Enrich the schedule with event interpretation '''
1741  from Configuration.StandardSequences.EventInterpretation import EventInterpretation
1742  if sequence in EventInterpretation:
1743  self.EIDefaultCFF = EventInterpretation[sequence]
1744  sequence = 'EIsequence'
1745  else:
1746  raise Exception('Cannot set %s event interpretation'%( sequence) )
1747  self.loadDefaultOrSpecifiedCFF(sequence,self.EIDefaultCFF)
1748  self.scheduleSequence(sequence.split('.')[-1],'eventinterpretaion_step')
1749  return
def ConfigBuilder.ConfigBuilder.prepare_ENDJOB (   self,
  sequence = 'endOfProcess' 
)

Definition at line 2096 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.ENDJOBDefaultCFF, ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), and ConfigBuilder.ConfigBuilder.scheduleSequenceAtEnd().

2097  def prepare_ENDJOB(self, sequence = 'endOfProcess'):
2098  self.loadDefaultOrSpecifiedCFF(sequence,self.ENDJOBDefaultCFF)
2099  self.scheduleSequenceAtEnd(sequence.split('.')[-1],'endjob_step')
2100  return
def ConfigBuilder.ConfigBuilder.prepare_FILTER (   self,
  sequence = None 
)
Enrich the schedule with a user defined filter sequence 

Definition at line 1630 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.__init__(), VisualizationOptions.load(), BTagCalibrationReader::BTagCalibrationReaderImpl.load(), BTagCalibrationReader.load(), CSCL1TPLookupTableEP.load(), cond::persistency::GTEditor.load(), L1MuDTPtaLut.load(), L1MuDTPhiLut.load(), cond::persistency::IOVEditor.load(), L1MuDTEtaPatternLut.load(), L1MuDTQualPatternLut.load(), PiecewiseScalingPolynomial.load(), L1MuDTExtLut.load(), HBHENegativeEFilter.load(), HBHEChannelGroups.load(), cond::persistency::RunInfoProxy.load(), HcalIndexLookup.load(), cond::persistency::GTProxy.load(), cond::persistency::IOVProxy.load(), OOTPileupCorrData.load(), TrackerMap.load(), ConfigBuilder.ConfigBuilder.load(), and tkal_create_file_lists._DasCache.load().

1631  def prepare_FILTER(self, sequence = None):
1632  ''' Enrich the schedule with a user defined filter sequence '''
1633  ## load the relevant part
1634  filterConfig=self.load(sequence.split('.')[0])
1635  filterSeq=sequence.split('.')[-1]
1636  ## print it in the configuration
1637  class PrintAllModules(object):
1638  def __init__(self):
1639  self.inliner=''
1640  pass
1641  def enter(self,visitee):
1642  try:
1643  label=visitee.label()
1644  ##needs to be in reverse order
1645  self.inliner=label+','+self.inliner
1646  except:
1647  pass
1648  def leave(self,v): pass
1649 
1650  expander=PrintAllModules()
1651  getattr(self.process,filterSeq).visit( expander )
1652  self._options.inlineObjets+=','+expander.inliner
1653  self._options.inlineObjets+=','+filterSeq
1654 
1655  ## put the filtering path in the schedule
1656  self.scheduleSequence(filterSeq,'filtering_step')
1657  self.nextScheduleIsConditional=True
1658  ## put it before all the other paths
1659  self.productionFilterSequence = filterSeq
1660 
1661  return
inliner
load the relevant part
process
adding standard sequences might change the inputEventContent option and therefore needs to be finaliz...
productionFilterSequence
put it before all the other paths
nextScheduleIsConditional
put the filtering path in the schedule
def ConfigBuilder.ConfigBuilder.prepare_GEN (   self,
  sequence = None 
)
load the fragment of generator configuration 

Definition at line 1350 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.executeAndRemember(), ConfigBuilder.ConfigBuilder.GENDefaultCFF, ConfigBuilder.ConfigBuilder.GENDefaultSeq, ConfigBuilder.ConfigBuilder.LHEDefaultSeq, ConfigBuilder.ConfigBuilder.loadAndRemember(), ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), print(), DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, ConfigBuilder.ConfigBuilder.process, ConfigBuilder.ConfigBuilder.productionFilterSequence, python.rootplot.root2matplotlib.replace(), ConfigBuilder.ConfigBuilder.scheduleSequenceAtEnd(), and ConfigBuilder.ConfigBuilder.stepMap.

1351  def prepare_GEN(self, sequence = None):
1352  """ load the fragment of generator configuration """
1353  loadFailure=False
1354  #remove trailing .py
1355  #support old style .cfi by changing into something.cfi into something_cfi
1356  #remove python/ from the name
1357  loadFragment = self._options.evt_type.replace('.py','',).replace('.','_').replace('python/','')
1358  #standard location of fragments
1359  if not '/' in loadFragment:
1360  loadFragment='Configuration.Generator.'+loadFragment
1361  else:
1362  loadFragment=loadFragment.replace('/','.')
1363  try:
1364  print("Loading generator fragment from",loadFragment)
1365  __import__(loadFragment)
1366  except:
1367  loadFailure=True
1368  #if self.process.source and self.process.source.type_()=='EmptySource':
1369  if not (self._options.filein or self._options.dasquery):
1370  raise Exception("Neither gen fragment of input files provided: this is an inconsistent GEN step configuration")
1371 
1372  if not loadFailure:
1373  from Configuration.Generator.concurrentLumisDisable import noConcurrentLumiGenerators
1374 
1375  generatorModule=sys.modules[loadFragment]
1376  genModules=generatorModule.__dict__
1377  #remove lhe producer module since this should have been
1378  #imported instead in the LHE step
1379  if self.LHEDefaultSeq in genModules:
1380  del genModules[self.LHEDefaultSeq]
1381 
1382  if self._options.hideGen:
1383  self.loadAndRemember(loadFragment)
1384  else:
1385  self.process.load(loadFragment)
1386  # expose the objects from that fragment to the configuration
1387  import FWCore.ParameterSet.Modules as cmstypes
1388  for name in genModules:
1389  theObject = getattr(generatorModule,name)
1390  if isinstance(theObject, cmstypes._Module):
1391  self._options.inlineObjets=name+','+self._options.inlineObjets
1392  if theObject.type_() in noConcurrentLumiGenerators:
1393  print("Setting numberOfConcurrentLuminosityBlocks=1 because of generator {}".format(theObject.type_()))
1394  self._options.nConcurrentLumis = "1"
1395  self._options.nConcurrentIOVs = "1"
1396  elif isinstance(theObject, cms.Sequence) or isinstance(theObject, cmstypes.ESProducer):
1397  self._options.inlineObjets+=','+name
1398 
1399  if sequence == self.GENDefaultSeq or sequence == 'pgen_genonly':
1400  if 'ProductionFilterSequence' in genModules and ('generator' in genModules):
1401  self.productionFilterSequence = 'ProductionFilterSequence'
1402  elif 'generator' in genModules:
1403  self.productionFilterSequence = 'generator'
1404 
1405  """ Enrich the schedule with the rest of the generation step """
1406  self.loadDefaultOrSpecifiedCFF(sequence,self.GENDefaultCFF)
1407  genSeqName=sequence.split('.')[-1]
1408 
1409  if True:
1410  try:
1411  from Configuration.StandardSequences.VtxSmeared import VtxSmeared
1412  cffToBeLoaded=VtxSmeared[self._options.beamspot]
1413  self.loadAndRemember(cffToBeLoaded)
1414  except ImportError:
1415  raise Exception("VertexSmearing type or beamspot "+self._options.beamspot+" unknown.")
1416 
1417  if self._options.scenario == 'HeavyIons':
1418  if self._options.pileup=='HiMixGEN':
1419  self.loadAndRemember("Configuration/StandardSequences/GeneratorMix_cff")
1420  elif self._options.pileup=='HiMixEmbGEN':
1421  self.loadAndRemember("Configuration/StandardSequences/GeneratorEmbMix_cff")
1422  else:
1423  self.loadAndRemember("Configuration/StandardSequences/GeneratorHI_cff")
1424 
1425  self.process.generation_step = cms.Path( getattr(self.process,genSeqName) )
1426  self.schedule.append(self.process.generation_step)
1427 
1428  #register to the genstepfilter the name of the path (static right now, but might evolve)
1429  self.executeAndRemember('process.genstepfilter.triggerConditions=cms.vstring("generation_step")')
1430 
1431  if 'reGEN' in self.stepMap:
1432  #stop here
1433  return
1434 
1435  """ Enrich the schedule with the summary of the filter step """
1436  #the gen filter in the endpath
1437  self.loadAndRemember("GeneratorInterface/Core/genFilterSummary_cff")
1438  self.scheduleSequenceAtEnd('genFilterSummary','genfiltersummary_step')
1439  return
process
adding standard sequences might change the inputEventContent option and therefore needs to be finaliz...
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
productionFilterSequence
put it before all the other paths
def ConfigBuilder.ConfigBuilder.prepare_HARVESTING (   self,
  sequence = None 
)
Enrich the process with harvesting step 

Definition at line 2023 of file ConfigBuilder.py.

2024  def prepare_HARVESTING(self, sequence = None):
2025  """ Enrich the process with harvesting step """
2026  self.DQMSaverCFF='Configuration/StandardSequences/DQMSaver'+self._options.harvesting+'_cff'
2027  self.loadAndRemember(self.DQMSaverCFF)
2028 
2029  harvestingConfig = self.loadDefaultOrSpecifiedCFF(sequence,self.HARVESTINGDefaultCFF)
2030  sequence = sequence.split('.')[-1]
2031 
2032  # decide which HARVESTING paths to use
2033  harvestingList = sequence.split("+")
2034  from DQMOffline.Configuration.autoDQM import autoDQM
2035  from Validation.Configuration.autoValidation import autoValidation
2036  import copy
2037  combined_mapping = copy.deepcopy( autoDQM )
2038  combined_mapping.update( autoValidation )
2039  self.expandMapping(harvestingList,combined_mapping,index=-1)
2040 
2041  if len(set(harvestingList))!=len(harvestingList):
2042  harvestingList=list(set(harvestingList))
2043  print("Duplicate entries for HARVESTING, using",harvestingList)
2044 
2045  for name in harvestingList:
2046  if not name in harvestingConfig.__dict__:
2047  print(name,"is not a possible harvesting type. Available are",harvestingConfig.__dict__.keys())
2048  # trigger hard error, like for other sequence types
2049  getattr(self.process, name)
2050  continue
2051  harvestingstream = getattr(harvestingConfig,name)
2052  if isinstance(harvestingstream,cms.Path):
2053  self.schedule.append(harvestingstream)
2054  self.blacklist_paths.append(harvestingstream)
2055  if isinstance(harvestingstream,cms.Sequence):
2056  setattr(self.process,name+"_step",cms.Path(harvestingstream))
2057  self.schedule.append(getattr(self.process,name+"_step"))
2058 
2059  self.scheduleSequence('DQMSaver','dqmsave_step')
2060  return
process
adding standard sequences might change the inputEventContent option and therefore needs to be finaliz...
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def ConfigBuilder.ConfigBuilder.prepare_HLT (   self,
  sequence = None 
)
Enrich the schedule with the HLT simulation step

Definition at line 1529 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.executeAndRemember(), join(), ConfigBuilder.ConfigBuilder.loadAndRemember(), print(), DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, ConfigBuilder.ConfigBuilder.process, CustomConfigs.ProcessName(), ConfigBuilder.ConfigBuilder.schedule, and ConfigBuilder.ConfigBuilder.scheduleIndexOfFirstHLTPath.

1530  def prepare_HLT(self, sequence = None):
1531  """ Enrich the schedule with the HLT simulation step"""
1532  if not sequence:
1533  print("no specification of the hlt menu has been given, should never happen")
1534  raise Exception('no HLT sequence provided')
1535 
1536  if '@' in sequence:
1537  # case where HLT:@something was provided
1538  from Configuration.HLT.autoHLT import autoHLT
1539  key = sequence[1:]
1540  if key in autoHLT:
1541  sequence = autoHLT[key]
1542  else:
1543  raise ValueError('no HLT mapping key "%s" found in autoHLT' % key)
1544 
1545  if ',' in sequence:
1546  #case where HLT:something:something was provided
1547  self.executeAndRemember('import HLTrigger.Configuration.Utilities')
1548  optionsForHLT = {}
1549  if self._options.scenario == 'HeavyIons':
1550  optionsForHLT['type'] = 'HIon'
1551  else:
1552  optionsForHLT['type'] = 'GRun'
1553  optionsForHLTConfig = ', '.join('%s=%s' % (key, repr(val)) for (key, val) in optionsForHLT.items())
1554  if sequence == 'run,fromSource':
1555  if hasattr(self.process.source,'firstRun'):
1556  self.executeAndRemember('process.loadHltConfiguration("run:%%d"%%(process.source.firstRun.value()),%s)'%(optionsForHLTConfig))
1557  elif hasattr(self.process.source,'setRunNumber'):
1558  self.executeAndRemember('process.loadHltConfiguration("run:%%d"%%(process.source.setRunNumber.value()),%s)'%(optionsForHLTConfig))
1559  else:
1560  raise Exception('Cannot replace menu to load %s'%(sequence))
1561  else:
1562  self.executeAndRemember('process.loadHltConfiguration("%s",%s)'%(sequence.replace(',',':'),optionsForHLTConfig))
1563  else:
1564  self.loadAndRemember('HLTrigger/Configuration/HLT_%s_cff' % sequence)
1565 
1566  if self._options.isMC:
1567  self._options.customisation_file.append("HLTrigger/Configuration/customizeHLTforMC.customizeHLTforMC")
1568 
1569  if self._options.name != 'HLT':
1570  self.additionalCommands.append('from HLTrigger.Configuration.CustomConfigs import ProcessName')
1571  self.additionalCommands.append('process = ProcessName(process)')
1572  self.additionalCommands.append('')
1573  from HLTrigger.Configuration.CustomConfigs import ProcessName
1574  self.process = ProcessName(self.process)
1575 
1576  if self.process.schedule == None:
1577  raise Exception('the HLT step did not attach a valid schedule to the process')
1578 
1579  self.scheduleIndexOfFirstHLTPath = len(self.schedule)
1580  [self.blacklist_paths.append(path) for path in self.process.schedule if isinstance(path,(cms.Path,cms.EndPath))]
1581 
1582  # this is a fake, to be removed with fastim migration and HLT menu dump
1583  if self._options.fast:
1584  if not hasattr(self.process,'HLTEndSequence'):
1585  self.executeAndRemember("process.HLTEndSequence = cms.Sequence( process.dummyModule )")
1586 
process
adding standard sequences might change the inputEventContent option and therefore needs to be finaliz...
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def ConfigBuilder.ConfigBuilder.prepare_L1 (   self,
  sequence = None 
)
Enrich the schedule with the L1 simulation step

Definition at line 1510 of file ConfigBuilder.py.

References cms::cuda.assert(), ConfigBuilder.ConfigBuilder.L1EMDefaultCFF, ConfigBuilder.ConfigBuilder.loadAndRemember(), and ConfigBuilder.ConfigBuilder.scheduleSequence().

1511  def prepare_L1(self, sequence = None):
1512  """ Enrich the schedule with the L1 simulation step"""
1513  assert(sequence == None)
1514  self.loadAndRemember(self.L1EMDefaultCFF)
1515  self.scheduleSequence('SimL1Emulator','L1simulation_step')
1516  return
assert(be >=bs)
def ConfigBuilder.ConfigBuilder.prepare_L1HwVal (   self,
  sequence = 'L1HwVal' 
)
Enrich the schedule with L1 HW validation 

Definition at line 1611 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.L1HwValDefaultCFF, ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), and print().

1612  def prepare_L1HwVal(self, sequence = 'L1HwVal'):
1613  ''' Enrich the schedule with L1 HW validation '''
1614  self.loadDefaultOrSpecifiedCFF(sequence,self.L1HwValDefaultCFF)
1615  #self.scheduleSequence(sequence.split('.')[-1],'l1hwval_step')
1616  print('\n\n\n DEPRECATED this has no action \n\n\n')
1617  return
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def ConfigBuilder.ConfigBuilder.prepare_L1Reco (   self,
  sequence = "L1Reco" 
)
Enrich the schedule with L1 reconstruction 

Definition at line 1618 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.L1RecoDefaultCFF, ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), and ConfigBuilder.ConfigBuilder.scheduleSequence().

1619  def prepare_L1Reco(self, sequence = "L1Reco"):
1620  ''' Enrich the schedule with L1 reconstruction '''
1621  self.loadDefaultOrSpecifiedCFF(sequence,self.L1RecoDefaultCFF)
1622  self.scheduleSequence(sequence.split('.')[-1],'L1Reco_step')
1623  return
def ConfigBuilder.ConfigBuilder.prepare_L1REPACK (   self,
  sequence = None 
)
Enrich the schedule with the L1 simulation step, running the L1 emulator on data unpacked from the RAW collection, and repacking the result in a new RAW collection

Definition at line 1517 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.loadAndRemember(), print(), ConfigBuilder.ConfigBuilder.renameInputTagsInSequence(), and ConfigBuilder.ConfigBuilder.scheduleSequence().

1518  def prepare_L1REPACK(self, sequence = None):
1519  """ Enrich the schedule with the L1 simulation step, running the L1 emulator on data unpacked from the RAW collection, and repacking the result in a new RAW collection"""
1520  supported = ['GT','GT1','GT2','GCTGT','Full','FullSimTP','FullMC','Full2015Data','uGT','CalouGT']
1521  if sequence in supported:
1522  self.loadAndRemember('Configuration/StandardSequences/SimL1EmulatorRepack_%s_cff'%sequence)
1523  if self._options.scenario == 'HeavyIons':
1524  self.renameInputTagsInSequence("SimL1Emulator","rawDataCollector","rawDataRepacker")
1525  self.scheduleSequence('SimL1Emulator','L1RePack_step')
1526  else:
1527  print("L1REPACK with '",sequence,"' is not supported! Supported choices are: ",supported)
1528  raise Exception('unsupported feature')
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def ConfigBuilder.ConfigBuilder.prepare_L1TrackTrigger (   self,
  sequence = "L1TrackTrigger" 
)
Enrich the schedule with L1 reconstruction 

Definition at line 1624 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.L1TrackTriggerDefaultCFF, ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), and ConfigBuilder.ConfigBuilder.scheduleSequence().

1625  def prepare_L1TrackTrigger(self, sequence = "L1TrackTrigger"):
1626  ''' Enrich the schedule with L1 reconstruction '''
1628  self.scheduleSequence(sequence.split('.')[-1],'L1TrackTrigger_step')
1629  return
def ConfigBuilder.ConfigBuilder.prepare_LHE (   self,
  sequence = None 
)

Definition at line 1333 of file ConfigBuilder.py.

1334  def prepare_LHE(self, sequence = None):
1335  #load the fragment
1336  ##make it loadable
1337  loadFragment = self._options.evt_type.replace('.py','',).replace('.','_').replace('python/','').replace('/','.')
1338  print("Loading lhe fragment from",loadFragment)
1339  __import__(loadFragment)
1340  self.process.load(loadFragment)
1341  ##inline the modules
1342  self._options.inlineObjets+=','+sequence
1343 
1344  getattr(self.process,sequence).nEvents = int(self._options.number)
1345 
1346  #schedule it
1347  self.process.lhe_step = cms.Path( getattr( self.process,sequence) )
1348  self.excludedPaths.append("lhe_step")
1349  self.schedule.append( self.process.lhe_step )
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def ConfigBuilder.ConfigBuilder.prepare_NANO (   self,
  sequence = "nanoAOD" 
)
Enrich the schedule with NANO 

Definition at line 1715 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), ConfigBuilder.ConfigBuilder.NANODefaultCFF, and ConfigBuilder.ConfigBuilder.scheduleSequence().

1716  def prepare_NANO(self, sequence = "nanoAOD"):
1717  ''' Enrich the schedule with NANO '''
1718  self.loadDefaultOrSpecifiedCFF(sequence,self.NANODefaultCFF)
1719  self.scheduleSequence(sequence.split('.')[-1],'nanoAOD_step')
1720  custom = "nanoAOD_customizeData" if self._options.isData else "nanoAOD_customizeMC"
1721  self._options.customisation_file.insert(0,"PhysicsTools/NanoAOD/nano_cff."+custom)
1722  if self._options.hltProcess:
1723  if len(self._options.customise_commands) > 1:
1724  self._options.customise_commands = self._options.customise_commands + " \n"
1725  self._options.customise_commands = self._options.customise_commands + "process.unpackedPatTrigger.triggerResults= cms.InputTag( 'TriggerResults::"+self._options.hltProcess+"' )\n"
def ConfigBuilder.ConfigBuilder.prepare_NANOGEN (   self,
  sequence = "nanoAOD" 
)
Enrich the schedule with NANOGEN 

Definition at line 1726 of file ConfigBuilder.py.

References any(), join(), ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), ConfigBuilder.ConfigBuilder.NANOGENDefaultCFF, ConfigBuilder.ConfigBuilder.scheduleSequence(), and ConfigBuilder.ConfigBuilder.stepMap.

1727  def prepare_NANOGEN(self, sequence = "nanoAOD"):
1728  ''' Enrich the schedule with NANOGEN '''
1729  # TODO: Need to modify this based on the input file type
1730  fromGen = any([x in self.stepMap for x in ['LHE', 'GEN', 'AOD']])
1731  self.loadDefaultOrSpecifiedCFF(sequence,self.NANOGENDefaultCFF)
1732  self.scheduleSequence(sequence.split('.')[-1],'nanoAOD_step')
1733  custom = "customizeNanoGEN" if fromGen else "customizeNanoGENFromMini"
1734  if self._options.runUnscheduled:
1735  self._options.customisation_file_unsch.insert(0, '.'.join([self.NANOGENDefaultCFF, custom]))
1736  else:
1737  self._options.customisation_file.insert(0, '.'.join([self.NANOGENDefaultCFF, custom]))
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:37
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def ConfigBuilder.ConfigBuilder.prepare_PAT (   self,
  sequence = "miniAOD" 
)
Enrich the schedule with PAT 

Definition at line 1683 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), ConfigBuilder.ConfigBuilder.PATDefaultCFF, and ConfigBuilder.ConfigBuilder.prepare_PATFILTER().

1684  def prepare_PAT(self, sequence = "miniAOD"):
1685  ''' Enrich the schedule with PAT '''
1686  self.prepare_PATFILTER(self)
1687  self.loadDefaultOrSpecifiedCFF(sequence,self.PATDefaultCFF)
1688  self.labelsToAssociate.append('patTask')
1689  if self._options.isData:
1690  self._options.customisation_file_unsch.insert(0,"PhysicsTools/PatAlgos/slimming/miniAOD_tools.miniAOD_customizeAllData")
1691  else:
1692  if self._options.fast:
1693  self._options.customisation_file_unsch.insert(0,"PhysicsTools/PatAlgos/slimming/miniAOD_tools.miniAOD_customizeAllMCFastSim")
1694  else:
1695  self._options.customisation_file_unsch.insert(0,"PhysicsTools/PatAlgos/slimming/miniAOD_tools.miniAOD_customizeAllMC")
1696 
1697  if self._options.hltProcess:
1698  if len(self._options.customise_commands) > 1:
1699  self._options.customise_commands = self._options.customise_commands + " \n"
1700  self._options.customise_commands = self._options.customise_commands + "process.patTrigger.processName = \""+self._options.hltProcess+"\"\n"
1701  self._options.customise_commands = self._options.customise_commands + "process.slimmedPatTrigger.triggerResults= cms.InputTag( 'TriggerResults::"+self._options.hltProcess+"' )\n"
1702  self._options.customise_commands = self._options.customise_commands + "process.patMuons.triggerResults= cms.InputTag( 'TriggerResults::"+self._options.hltProcess+"' )\n"
1703 
1704 # self.renameHLTprocessInSequence(sequence)
1705 
1706  return
def ConfigBuilder.ConfigBuilder.prepare_PATFILTER (   self,
  sequence = None 
)

Definition at line 1605 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.loadAndRemember(), DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, and ConfigBuilder.ConfigBuilder.process.

Referenced by ConfigBuilder.ConfigBuilder.prepare_PAT().

1606  def prepare_PATFILTER(self, sequence=None):
1607  self.loadAndRemember("PhysicsTools/PatAlgos/slimming/metFilterPaths_cff")
1608  from PhysicsTools.PatAlgos.slimming.metFilterPaths_cff import allMetFilterPaths
1609  for filt in allMetFilterPaths:
1610  self.schedule.append(getattr(self.process,'Flag_'+filt))
process
adding standard sequences might change the inputEventContent option and therefore needs to be finaliz...
def ConfigBuilder.ConfigBuilder.prepare_PATGEN (   self,
  sequence = "miniGEN" 
)
Enrich the schedule with PATGEN 

Definition at line 1707 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), and ConfigBuilder.ConfigBuilder.PATGENDefaultCFF.

1708  def prepare_PATGEN(self, sequence = "miniGEN"):
1709  ''' Enrich the schedule with PATGEN '''
1710  self.loadDefaultOrSpecifiedCFF(sequence,self.PATGENDefaultCFF) #this is unscheduled
1711  self.labelsToAssociate.append('patGENTask')
1712  if self._options.isData:
1713  raise Exception("PATGEN step can only run on MC")
1714  return
def ConfigBuilder.ConfigBuilder.prepare_POSTRECO (   self,
  sequence = None 
)
Enrich the schedule with the postreco step 

Definition at line 1800 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.loadAndRemember(), ConfigBuilder.ConfigBuilder.POSTRECODefaultCFF, and ConfigBuilder.ConfigBuilder.scheduleSequence().

1801  def prepare_POSTRECO(self, sequence = None):
1802  """ Enrich the schedule with the postreco step """
1804  self.scheduleSequence('postreco_generator','postreco_step')
1805  return
1806 
def ConfigBuilder.ConfigBuilder.prepare_RAW2DIGI (   self,
  sequence = "RawToDigi" 
)

Definition at line 1598 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), ConfigBuilder.ConfigBuilder.RAW2DIGIDefaultCFF, and ConfigBuilder.ConfigBuilder.scheduleSequence().

Referenced by ConfigBuilder.ConfigBuilder.prepare_RAW2RECO().

1599  def prepare_RAW2DIGI(self, sequence = "RawToDigi"):
1600  self.loadDefaultOrSpecifiedCFF(sequence,self.RAW2DIGIDefaultCFF)
1601  self.scheduleSequence(sequence,'raw2digi_step')
1602  # if self._options.isRepacked:
1603  #self.renameInputTagsInSequence(sequence)
1604  return
def ConfigBuilder.ConfigBuilder.prepare_RAW2RECO (   self,
  sequence = None 
)

Definition at line 1587 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.prepare_RAW2DIGI(), ConfigBuilder.ConfigBuilder.prepare_RECO(), and print().

1588  def prepare_RAW2RECO(self, sequence = None):
1589  if ','in sequence:
1590  seqReco=sequence.split(',')[1]
1591  seqDigi=sequence.split(',')[0]
1592  else:
1593  print("RAW2RECO requires two specifications",sequence,"insufficient")
1594 
1595  self.prepare_RAW2DIGI(seqDigi)
1596  self.prepare_RECO(seqReco)
1597  return
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def ConfigBuilder.ConfigBuilder.prepare_RECO (   self,
  sequence = "reconstruction" 
)
Enrich the schedule with reconstruction 

Definition at line 1662 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), ConfigBuilder.ConfigBuilder.RECODefaultCFF, and ConfigBuilder.ConfigBuilder.scheduleSequence().

Referenced by ConfigBuilder.ConfigBuilder.prepare_RAW2RECO().

1663  def prepare_RECO(self, sequence = "reconstruction"):
1664  ''' Enrich the schedule with reconstruction '''
1665  self.loadDefaultOrSpecifiedCFF(sequence,self.RECODefaultCFF)
1666  self.scheduleSequence(sequence.split('.')[-1],'reconstruction_step')
1667  return
def ConfigBuilder.ConfigBuilder.prepare_RECOBEFMIX (   self,
  sequence = "reconstruction" 
)
Enrich the schedule with the part of reconstruction that is done before mixing in FastSim

Definition at line 1674 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), print(), ConfigBuilder.ConfigBuilder.RECOBEFMIXDefaultCFF, ConfigBuilder.ConfigBuilder.RECOBEFMIXDefaultSeq, and ConfigBuilder.ConfigBuilder.scheduleSequence().

1675  def prepare_RECOBEFMIX(self, sequence = "reconstruction"):
1676  ''' Enrich the schedule with the part of reconstruction that is done before mixing in FastSim'''
1677  if not self._options.fast:
1678  print("ERROR: this step is only implemented for FastSim")
1679  sys.exit()
1681  self.scheduleSequence(sequence.split('.')[-1],'reconstruction_befmix_step')
1682  return
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def ConfigBuilder.ConfigBuilder.prepare_RECOSIM (   self,
  sequence = "recosim" 
)
Enrich the schedule with reconstruction 

Definition at line 1668 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), ConfigBuilder.ConfigBuilder.RECOSIMDefaultCFF, and ConfigBuilder.ConfigBuilder.scheduleSequence().

1669  def prepare_RECOSIM(self, sequence = "recosim"):
1670  ''' Enrich the schedule with reconstruction '''
1671  self.loadDefaultOrSpecifiedCFF(sequence,self.RECOSIMDefaultCFF)
1672  self.scheduleSequence(sequence.split('.')[-1],'recosim_step')
1673  return
def ConfigBuilder.ConfigBuilder.prepare_REPACK (   self,
  sequence = None 
)

Definition at line 1505 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), ConfigBuilder.ConfigBuilder.REPACKDefaultCFF, and ConfigBuilder.ConfigBuilder.scheduleSequence().

1506  def prepare_REPACK(self, sequence = None):
1507  self.loadDefaultOrSpecifiedCFF(sequence,self.REPACKDefaultCFF)
1508  self.scheduleSequence(sequence.split('.')[-1],'digi2repack_step')
1509  return
def ConfigBuilder.ConfigBuilder.prepare_SIM (   self,
  sequence = None 
)
Enrich the schedule with the simulation step

Definition at line 1440 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.executeAndRemember(), ConfigBuilder.ConfigBuilder.loadAndRemember(), ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), ConfigBuilder.ConfigBuilder.scheduleSequence(), and ConfigBuilder.ConfigBuilder.SIMDefaultCFF.

1441  def prepare_SIM(self, sequence = None):
1442  """ Enrich the schedule with the simulation step"""
1443  self.loadDefaultOrSpecifiedCFF(sequence,self.SIMDefaultCFF)
1444  if not self._options.fast:
1445  if self._options.gflash==True:
1446  self.loadAndRemember("Configuration/StandardSequences/GFlashSIM_cff")
1447 
1448  if self._options.magField=='0T':
1449  self.executeAndRemember("process.g4SimHits.UseMagneticField = cms.bool(False)")
1450  else:
1451  if self._options.magField=='0T':
1452  self.executeAndRemember("process.fastSimProducer.detectorDefinition.magneticFieldZ = cms.untracked.double(0.)")
1453 
1454  self.scheduleSequence(sequence.split('.')[-1],'simulation_step')
1455  return
def ConfigBuilder.ConfigBuilder.prepare_SKIM (   self,
  sequence = "all" 
)
Enrich the schedule with skimming fragments

Definition at line 1750 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.addExtraStream(), ConfigBuilder.ConfigBuilder.EVTCONTDefaultCFF, ConfigBuilder.ConfigBuilder.expandMapping(), join(), ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), print(), sistrip::SpyUtilities.range(), and ConfigBuilder.ConfigBuilder.SKIMDefaultCFF.

1751  def prepare_SKIM(self, sequence = "all"):
1752  ''' Enrich the schedule with skimming fragments'''
1753  skimConfig = self.loadDefaultOrSpecifiedCFF(sequence,self.SKIMDefaultCFF)
1754  sequence = sequence.split('.')[-1]
1755 
1756  skimlist=sequence.split('+')
1757  ## support @Mu+DiJet+@Electron configuration via autoSkim.py
1758  from Configuration.Skimming.autoSkim import autoSkim
1759  self.expandMapping(skimlist,autoSkim)
1760 
1761  #print "dictionnary for skims:",skimConfig.__dict__
1762  for skim in skimConfig.__dict__:
1763  skimstream = getattr(skimConfig,skim)
1764  if isinstance(skimstream,cms.Path):
1765  #black list the alca path so that they do not appear in the cfg
1766  self.blacklist_paths.append(skimstream)
1767  if (not isinstance(skimstream,cms.FilteredStream)):
1768  continue
1769  shortname = skim.replace('SKIMStream','')
1770  if (sequence=="all"):
1771  self.addExtraStream(skim,skimstream)
1772  elif (shortname in skimlist):
1773  self.addExtraStream(skim,skimstream)
1774  #add a DQM eventcontent for this guy
1775  if self._options.datatier=='DQM':
1776  self.process.load(self.EVTCONTDefaultCFF)
1777  skimstreamDQM = cms.FilteredStream(
1778  responsible = skimstream.responsible,
1779  name = skimstream.name+'DQM',
1780  paths = skimstream.paths,
1781  selectEvents = skimstream.selectEvents,
1782  content = self._options.datatier+'EventContent',
1783  dataTier = cms.untracked.string(self._options.datatier)
1784  )
1785  self.addExtraStream(skim+'DQM',skimstreamDQM)
1786  for i in range(skimlist.count(shortname)):
1787  skimlist.remove(shortname)
1788 
1789 
1790 
1791  if (skimlist.__len__()!=0 and sequence!="all"):
1792  print('WARNING, possible typo with SKIM:'+'+'.join(skimlist))
1793  raise Exception('WARNING, possible typo with SKIM:'+'+'.join(skimlist))
const uint16_t range(const Frame &aFrame)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def ConfigBuilder.ConfigBuilder.prepare_USER (   self,
  sequence = None 
)
Enrich the schedule with a user defined sequence 

Definition at line 1794 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), ConfigBuilder.ConfigBuilder.scheduleSequence(), and ConfigBuilder.ConfigBuilder.USERDefaultCFF.

1795  def prepare_USER(self, sequence = None):
1796  ''' Enrich the schedule with a user defined sequence '''
1797  self.loadDefaultOrSpecifiedCFF(sequence,self.USERDefaultCFF)
1798  self.scheduleSequence(sequence.split('.')[-1],'user_step')
1799  return
def ConfigBuilder.ConfigBuilder.prepare_VALIDATION (   self,
  sequence = 'validation' 
)

Definition at line 1807 of file ConfigBuilder.py.

References any(), ConfigBuilder.ConfigBuilder.executeAndRemember(), ConfigBuilder.ConfigBuilder.expandMapping(), edm::eventsetup::heterocontainer.insert(), ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), print(), DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, ConfigBuilder.ConfigBuilder.process, ConfigBuilder.ConfigBuilder.renameHLTprocessInSequence(), submitPVValidationJobs.split(), ConfigBuilder.ConfigBuilder.stepMap, and ConfigBuilder.ConfigBuilder.VALIDATIONDefaultCFF.

1808  def prepare_VALIDATION(self, sequence = 'validation'):
1809  print(sequence,"in preparing validation")
1811  from Validation.Configuration.autoValidation import autoValidation
1812  #in case VALIDATION:something:somethingelse -> something,somethingelse
1813  sequence=sequence.split('.')[-1]
1814  if sequence.find(',')!=-1:
1815  prevalSeqName=sequence.split(',')[0].split('+')
1816  valSeqName=sequence.split(',')[1].split('+')
1817  self.expandMapping(prevalSeqName,autoValidation,index=0)
1818  self.expandMapping(valSeqName,autoValidation,index=1)
1819  else:
1820  if '@' in sequence:
1821  prevalSeqName=sequence.split('+')
1822  valSeqName=sequence.split('+')
1823  self.expandMapping(prevalSeqName,autoValidation,index=0)
1824  self.expandMapping(valSeqName,autoValidation,index=1)
1825  else:
1826  postfix=''
1827  if sequence:
1828  postfix='_'+sequence
1829  prevalSeqName=['prevalidation'+postfix]
1830  valSeqName=['validation'+postfix]
1831  if not hasattr(self.process,valSeqName[0]):
1832  prevalSeqName=['']
1833  valSeqName=[sequence]
1834 
1835  def NFI(index):
1836  ##name from index, required to keep backward compatibility
1837  if index==0:
1838  return ''
1839  else:
1840  return '%s'%index
1841 
1842 
1843  #rename the HLT process in validation steps
1844  if ('HLT' in self.stepMap and not self._options.fast) or self._options.hltProcess:
1845  for s in valSeqName+prevalSeqName:
1846  if s:
1848  for (i,s) in enumerate(prevalSeqName):
1849  if s:
1850  setattr(self.process,'prevalidation_step%s'%NFI(i), cms.Path( getattr(self.process, s)) )
1851  self.schedule.append(getattr(self.process,'prevalidation_step%s'%NFI(i)))
1852 
1853  for (i,s) in enumerate(valSeqName):
1854  setattr(self.process,'validation_step%s'%NFI(i), cms.EndPath( getattr(self.process, s)))
1855  self.schedule.append(getattr(self.process,'validation_step%s'%NFI(i)))
1856 
1857  #needed in case the miniAODValidation sequence is run starting from AODSIM
1858  if 'PAT' in self.stepMap and not 'RECO' in self.stepMap:
1859  return
1860 
1861  if not 'DIGI' in self.stepMap and not self._options.fast and not any(map( lambda s : s.startswith('genvalid'), valSeqName)):
1862  if self._options.restoreRNDSeeds==False and not self._options.restoreRNDSeeds==True:
1863  self._options.restoreRNDSeeds=True
1864 
1865  if not 'DIGI' in self.stepMap and not self._options.isData and not self._options.fast:
1866  self.executeAndRemember("process.mix.playback = True")
1867  self.executeAndRemember("process.mix.digitizers = cms.PSet()")
1868  self.executeAndRemember("for a in process.aliases: delattr(process, a)")
1869  self._options.customisation_file.append("SimGeneral/MixingModule/fullMixCustomize_cff.setCrossingFrameOn")
1870 
1871  if hasattr(self.process,"genstepfilter") and len(self.process.genstepfilter.triggerConditions):
1872  #will get in the schedule, smoothly
1873  for (i,s) in enumerate(valSeqName):
1874  getattr(self.process,'validation_step%s'%NFI(i)).insert(0, self.process.genstepfilter)
1875 
1876  return
1877 
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:37
process
adding standard sequences might change the inputEventContent option and therefore needs to be finaliz...
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:50
def ConfigBuilder.ConfigBuilder.profileOptions (   self)
addIgProfService
Function to add the igprof profile service so that you can dump in the middle
of the run.

Definition at line 273 of file ConfigBuilder.py.

References alcaDQMUpload.encode(), and str.

Referenced by ConfigBuilder.ConfigBuilder.addCommon().

274  def profileOptions(self):
275  """
276  addIgProfService
277  Function to add the igprof profile service so that you can dump in the middle
278  of the run.
279  """
280  profileOpts = self._options.profile.split(':')
281  profilerStart = 1
282  profilerInterval = 100
283  profilerFormat = None
284  profilerJobFormat = None
285 
286  if len(profileOpts):
287  #type, given as first argument is unused here
288  profileOpts.pop(0)
289  if len(profileOpts):
290  startEvent = profileOpts.pop(0)
291  if not startEvent.isdigit():
292  raise Exception("%s is not a number" % startEvent)
293  profilerStart = int(startEvent)
294  if len(profileOpts):
295  eventInterval = profileOpts.pop(0)
296  if not eventInterval.isdigit():
297  raise Exception("%s is not a number" % eventInterval)
298  profilerInterval = int(eventInterval)
299  if len(profileOpts):
300  profilerFormat = profileOpts.pop(0)
301 
302 
303  if not profilerFormat:
304  profilerFormat = "%s___%s___%%I.gz" % (
305  self._options.evt_type.replace("_cfi", ""),
306  hashlib.md5(
307  (str(self._options.step) + str(self._options.pileup) + str(self._options.conditions) +
308  str(self._options.datatier) + str(self._options.profileTypeLabel)).encode('utf-8')
309  ).hexdigest()
310  )
311  if not profilerJobFormat and profilerFormat.endswith(".gz"):
312  profilerJobFormat = profilerFormat.replace(".gz", "_EndOfJob.gz")
313  elif not profilerJobFormat:
314  profilerJobFormat = profilerFormat + "_EndOfJob.gz"
315 
316  return (profilerStart,profilerInterval,profilerFormat,profilerJobFormat)
#define str(s)
def ConfigBuilder.ConfigBuilder.renameHLTprocessInSequence (   self,
  sequence,
  proc = None,
  HLTprocess = 'HLT' 
)

Definition at line 1947 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.additionalCommands, print(), DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, and ConfigBuilder.ConfigBuilder.process.

Referenced by ConfigBuilder.ConfigBuilder.prepare_DQM(), and ConfigBuilder.ConfigBuilder.prepare_VALIDATION().

1948  def renameHLTprocessInSequence(self,sequence,proc=None,HLTprocess='HLT'):
1949  if self._options.hltProcess:
1950  proc=self._options.hltProcess
1951  else:
1952  proc=self.process.name_()
1953  if proc==HLTprocess: return
1954  # look up all module in dqm sequence
1955  print("replacing %s process name - sequence %s will use '%s'" % (HLTprocess,sequence, proc))
1956  getattr(self.process,sequence).visit(ConfigBuilder.MassSearchReplaceProcessNameVisitor(HLTprocess,proc,whitelist = ("subSystemFolder",)))
1957  if 'from Configuration.Applications.ConfigBuilder import ConfigBuilder' not in self.additionalCommands:
1958  self.additionalCommands.append('from Configuration.Applications.ConfigBuilder import ConfigBuilder')
1959  self.additionalCommands.append('process.%s.visit(ConfigBuilder.MassSearchReplaceProcessNameVisitor("%s", "%s", whitelist = ("subSystemFolder",)))'% (sequence,HLTprocess, proc))
1960 
process
adding standard sequences might change the inputEventContent option and therefore needs to be finaliz...
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def ConfigBuilder.ConfigBuilder.renameInputTagsInSequence (   self,
  sequence,
  oldT = "rawDataCollector",
  newT = "rawDataRepacker" 
)

Definition at line 1937 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.additionalCommands, MassReplace.massSearchReplaceAnyInputTag(), print(), DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, and ConfigBuilder.ConfigBuilder.process.

Referenced by ConfigBuilder.ConfigBuilder.prepare_L1REPACK().

1938  def renameInputTagsInSequence(self,sequence,oldT="rawDataCollector",newT="rawDataRepacker"):
1939  print("Replacing all InputTag %s => %s"%(oldT,newT))
1940  from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceAnyInputTag
1941  massSearchReplaceAnyInputTag(getattr(self.process,sequence),oldT,newT)
1942  loadMe='from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceAnyInputTag'
1943  if not loadMe in self.additionalCommands:
1944  self.additionalCommands.append(loadMe)
1945  self.additionalCommands.append('massSearchReplaceAnyInputTag(process.%s,"%s","%s",False,True)'%(sequence,oldT,newT))
process
adding standard sequences might change the inputEventContent option and therefore needs to be finaliz...
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def massSearchReplaceAnyInputTag
Definition: MassReplace.py:79
def ConfigBuilder.ConfigBuilder.scheduleSequence (   self,
  seq,
  prefix,
  what = 'Path' 
)

Definition at line 1232 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.nextScheduleIsConditional, DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, and ConfigBuilder.ConfigBuilder.process.

Referenced by ConfigBuilder.ConfigBuilder.prepare_CFWRITER(), ConfigBuilder.ConfigBuilder.prepare_DATAMIX(), ConfigBuilder.ConfigBuilder.prepare_DIGI(), ConfigBuilder.ConfigBuilder.prepare_DIGI2RAW(), ConfigBuilder.ConfigBuilder.prepare_EI(), ConfigBuilder.ConfigBuilder.prepare_L1(), ConfigBuilder.ConfigBuilder.prepare_L1Reco(), ConfigBuilder.ConfigBuilder.prepare_L1REPACK(), ConfigBuilder.ConfigBuilder.prepare_L1TrackTrigger(), ConfigBuilder.ConfigBuilder.prepare_NANO(), ConfigBuilder.ConfigBuilder.prepare_NANOGEN(), ConfigBuilder.ConfigBuilder.prepare_POSTRECO(), ConfigBuilder.ConfigBuilder.prepare_RAW2DIGI(), ConfigBuilder.ConfigBuilder.prepare_RECO(), ConfigBuilder.ConfigBuilder.prepare_RECOBEFMIX(), ConfigBuilder.ConfigBuilder.prepare_RECOSIM(), ConfigBuilder.ConfigBuilder.prepare_REPACK(), ConfigBuilder.ConfigBuilder.prepare_SIM(), ConfigBuilder.ConfigBuilder.prepare_USER(), and ConfigBuilder.ConfigBuilder.scheduleSequenceAtEnd().

1233  def scheduleSequence(self,seq,prefix,what='Path'):
1234  if '*' in seq:
1235  #create only one path with all sequences in it
1236  for i,s in enumerate(seq.split('*')):
1237  if i==0:
1238  setattr(self.process,prefix,getattr(cms,what)( getattr(self.process, s) ))
1239  else:
1240  p=getattr(self.process,prefix)
1241  tmp = getattr(self.process, s)
1242  if isinstance(tmp, cms.Task):
1243  p.associate(tmp)
1244  else:
1245  p+=tmp
1246  self.schedule.append(getattr(self.process,prefix))
1247  return
1248  else:
1249  #create as many path as many sequences
1250  if not '+' in seq:
1251  if self.nextScheduleIsConditional:
1252  self.conditionalPaths.append(prefix)
1253  setattr(self.process,prefix,getattr(cms,what)( getattr(self.process, seq) ))
1254  self.schedule.append(getattr(self.process,prefix))
1255  else:
1256  for i,s in enumerate(seq.split('+')):
1257  sn=prefix+'%d'%(i)
1258  setattr(self.process,sn,getattr(cms,what)( getattr(self.process, s) ))
1259  self.schedule.append(getattr(self.process,sn))
1260  return
process
adding standard sequences might change the inputEventContent option and therefore needs to be finaliz...
nextScheduleIsConditional
put the filtering path in the schedule
def ConfigBuilder.ConfigBuilder.scheduleSequenceAtEnd (   self,
  seq,
  prefix 
)

Definition at line 1261 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.scheduleSequence().

Referenced by ConfigBuilder.ConfigBuilder.prepare_ENDJOB(), and ConfigBuilder.ConfigBuilder.prepare_GEN().

1262  def scheduleSequenceAtEnd(self,seq,prefix):
1263  self.scheduleSequence(seq,prefix,what='EndPath')
1264  return

Member Data Documentation

ConfigBuilder.ConfigBuilder._options
private

Definition at line 203 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addSource().

ConfigBuilder.ConfigBuilder.addedObjects

Definition at line 264 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

ConfigBuilder.ConfigBuilder.additionalCommands

Definition at line 261 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare(), ConfigBuilder.ConfigBuilder.renameHLTprocessInSequence(), and ConfigBuilder.ConfigBuilder.renameInputTagsInSequence().

ConfigBuilder.ConfigBuilder.additionalOutputs

Definition at line 265 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

ConfigBuilder.ConfigBuilder.ALCADefaultCFF

Definition at line 952 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_ALCA().

ConfigBuilder.ConfigBuilder.ALCADefaultSeq

Definition at line 988 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.ALCAHARVESTDefaultCFF

Definition at line 976 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_ALCAHARVEST().

ConfigBuilder.ConfigBuilder.ALCAHARVESTDefaultSeq

Definition at line 999 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.AlCaPaths

Definition at line 1282 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addOutput().

ConfigBuilder.ConfigBuilder.blacklist_paths

Definition at line 263 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

ConfigBuilder.ConfigBuilder.CFWRITERDefaultCFF

Definition at line 979 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_CFWRITER().

ConfigBuilder.ConfigBuilder.CFWRITERDefaultSeq

Definition at line 1000 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.conditionalPaths

Definition at line 270 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

ConfigBuilder.ConfigBuilder.ConditionsDefaultCFF

Definition at line 978 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addConditions().

ConfigBuilder.ConfigBuilder.DATAMIXDefaultCFF

Definition at line 983 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_DATAMIX().

ConfigBuilder.ConfigBuilder.DATAMIXDefaultSeq

Definition at line 993 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.DIGI2RAWDefaultCFF

Definition at line 956 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_DIGI2RAW().

ConfigBuilder.ConfigBuilder.DIGI2RAWDefaultSeq

Definition at line 994 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.DIGIDefaultCFF

Definition at line 955 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_DIGI().

ConfigBuilder.ConfigBuilder.DIGIDefaultSeq

Definition at line 992 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.DQMDefaultSeq

Definition at line 1012 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.DQMOFFLINEDefaultCFF

Definition at line 974 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_DQM().

ConfigBuilder.ConfigBuilder.DQMSaverCFF

Definition at line 2025 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.EIDefaultCFF

Definition at line 969 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_EI().

ConfigBuilder.ConfigBuilder.EIDefaultSeq

Definition at line 1009 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.ENDJOBDefaultCFF

Definition at line 977 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_ENDJOB().

ConfigBuilder.ConfigBuilder.ENDJOBDefaultSeq

Definition at line 1014 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.EVTCONTDefaultCFF

Definition at line 1022 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare(), and ConfigBuilder.ConfigBuilder.prepare_SKIM().

ConfigBuilder.ConfigBuilder.excludedPaths

Definition at line 271 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

ConfigBuilder.ConfigBuilder.GENDefaultCFF

Definition at line 953 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_GEN().

ConfigBuilder.ConfigBuilder.GENDefaultSeq

Definition at line 990 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_GEN().

ConfigBuilder.ConfigBuilder.GeometryCFF

Definition at line 1085 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addStandardSequences().

ConfigBuilder.ConfigBuilder.geometryDBLabel

Definition at line 1086 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addStandardSequences().

ConfigBuilder.ConfigBuilder.HARVESTINGDefaultCFF

Definition at line 975 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.HARVESTINGDefaultSeq

Definition at line 998 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.HLTDefaultCFF

Definition at line 959 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.HLTDefaultSeq

Definition at line 995 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.imports

Definition at line 251 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

ConfigBuilder.ConfigBuilder.inliner

load the relevant part

needs to be in reverse order

print it in the configuration

Definition at line 1638 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.L1DefaultSeq

Definition at line 996 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.L1EMDefaultCFF

Definition at line 957 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_L1().

ConfigBuilder.ConfigBuilder.L1HwValDefaultCFF

Definition at line 973 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_L1HwVal().

ConfigBuilder.ConfigBuilder.L1HwValDefaultSeq

Definition at line 1011 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.L1MENUDefaultCFF

Definition at line 958 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.L1RecoDefaultCFF

Definition at line 962 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_L1Reco().

ConfigBuilder.ConfigBuilder.L1RecoDefaultSeq

Definition at line 1002 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.L1REPACKDefaultSeq

Definition at line 997 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.L1TrackTriggerDefaultCFF

Definition at line 963 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_L1TrackTrigger().

ConfigBuilder.ConfigBuilder.L1TrackTriggerDefaultSeq

Definition at line 1003 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.labelsToAssociate

Definition at line 268 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

ConfigBuilder.ConfigBuilder.LHEDefaultSeq

Definition at line 989 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_GEN().

ConfigBuilder.ConfigBuilder.magFieldCFF

Definition at line 1081 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addStandardSequences().

ConfigBuilder.ConfigBuilder.NANODefaultCFF

Definition at line 967 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_NANO().

ConfigBuilder.ConfigBuilder.NANODefaultSeq

Definition at line 1020 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.NANOGENDefaultCFF

Definition at line 968 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_NANOGEN().

ConfigBuilder.ConfigBuilder.NANOGENDefaultSeq

Definition at line 1019 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.nextScheduleIsConditional

put the filtering path in the schedule

Definition at line 269 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.scheduleSequence().

ConfigBuilder.ConfigBuilder.PATDefaultCFF

Definition at line 966 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_PAT().

ConfigBuilder.ConfigBuilder.PATDefaultSeq

Definition at line 1016 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.PATGENDefaultCFF

Definition at line 1032 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_PATGEN().

ConfigBuilder.ConfigBuilder.PATGENDefaultSeq

Definition at line 1017 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.POSTRECODefaultCFF

Definition at line 971 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_POSTRECO().

ConfigBuilder.ConfigBuilder.POSTRECODefaultSeq

Definition at line 1010 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.process

adding standard sequences might change the inputEventContent option and therefore needs to be finalized after

Definition at line 246 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addCustomise(), ConfigBuilder.ConfigBuilder.addOutput(), ConfigBuilder.ConfigBuilder.completeInputCommand(), adaptToRunAtMiniAOD.adaptToRunAtMiniAOD.convertModuleToMiniAODInput(), ConfigBuilder.ConfigBuilder.prepare(), ConfigBuilder.ConfigBuilder.prepare_DQM(), ConfigBuilder.ConfigBuilder.prepare_GEN(), ConfigBuilder.ConfigBuilder.prepare_HLT(), ConfigBuilder.ConfigBuilder.prepare_PATFILTER(), ConfigBuilder.ConfigBuilder.prepare_VALIDATION(), runTauIdMVA.TauIDEmbedder.processDeepProducer(), ConfigBuilder.ConfigBuilder.renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder.renameInputTagsInSequence(), runTauIdMVA.TauIDEmbedder.runTauID(), ConfigBuilder.ConfigBuilder.scheduleSequence(), and runTauIdMVA.TauIDEmbedder.tauIDMVAinputs().

ConfigBuilder.ConfigBuilder.productionFilterSequence

put it before all the other paths

Definition at line 267 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare(), and ConfigBuilder.ConfigBuilder.prepare_GEN().

ConfigBuilder.ConfigBuilder.pythonCfgCode

Definition at line 2118 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

ConfigBuilder.ConfigBuilder.RAW2DIGIDefaultCFF

Definition at line 960 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_RAW2DIGI().

ConfigBuilder.ConfigBuilder.RAW2DIGIDefaultSeq

Definition at line 1001 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.RAW2RECODefaultSeq

Definition at line 1075 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.RECOBEFMIXDefaultCFF

Definition at line 1136 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_RECOBEFMIX().

ConfigBuilder.ConfigBuilder.RECOBEFMIXDefaultSeq

Definition at line 1137 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_RECOBEFMIX().

ConfigBuilder.ConfigBuilder.RECODefaultCFF

Definition at line 964 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_RECO().

ConfigBuilder.ConfigBuilder.RECODefaultSeq

Definition at line 1005 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.RECOSIMDefaultCFF

Definition at line 965 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_RECOSIM().

ConfigBuilder.ConfigBuilder.RECOSIMDefaultSeq

Definition at line 1008 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.REDIGIDefaultSeq

Definition at line 1152 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.REPACKDefaultCFF

Definition at line 980 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_REPACK().

ConfigBuilder.ConfigBuilder.REPACKDefaultSeq

Definition at line 1015 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.runsAndWeights

drop LHEXMLStringProduct on input to save memory if appropriate

Definition at line 481 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.runsAndWeightsInt

Definition at line 502 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.schedule

Definition at line 254 of file ConfigBuilder.py.

Referenced by Config.Process.dumpConfig(), ConfigBuilder.ConfigBuilder.prepare(), and ConfigBuilder.ConfigBuilder.prepare_HLT().

ConfigBuilder.ConfigBuilder.scheduleIndexOfFirstHLTPath

Definition at line 255 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare(), and ConfigBuilder.ConfigBuilder.prepare_HLT().

ConfigBuilder.ConfigBuilder.SIMDefaultCFF

Definition at line 954 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_SIM().

ConfigBuilder.ConfigBuilder.SIMDefaultSeq

Definition at line 991 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.SimGeometryCFF

Definition at line 1111 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addStandardSequences().

ConfigBuilder.ConfigBuilder.SKIMDefaultCFF

Definition at line 970 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_SKIM().

ConfigBuilder.ConfigBuilder.stepKeys

Definition at line 226 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addStandardSequences().

ConfigBuilder.ConfigBuilder.stepMap

Definition at line 225 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addSource(), ConfigBuilder.ConfigBuilder.addStandardSequences(), ConfigBuilder.ConfigBuilder.define_Configs(), ConfigBuilder.ConfigBuilder.prepare_GEN(), ConfigBuilder.ConfigBuilder.prepare_NANOGEN(), and ConfigBuilder.ConfigBuilder.prepare_VALIDATION().

ConfigBuilder.ConfigBuilder.USERDefaultCFF

Definition at line 1078 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_USER().

ConfigBuilder.ConfigBuilder.USERDefaultSeq

Definition at line 1077 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.VALIDATIONDefaultCFF

Definition at line 972 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_VALIDATION().

ConfigBuilder.ConfigBuilder.VALIDATIONDefaultSeq

Definition at line 1013 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.with_input

Definition at line 250 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

ConfigBuilder.ConfigBuilder.with_output

Definition at line 245 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().