CMS 3D CMS Logo

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__ (self, options, process=None, with_output=False, with_input=False)
 
def addCommon (self)
 
def addConditions (self)
 
def addCustomise (self, unsch=0)
 
def addCustomiseCmdLine (self)
 
def addExtraStream (self, name, stream, workflow='full')
 
def addMaxEvents (self)
 
def addOutput (self)
 
def addSource (self)
 
def addStandardSequences (self)
 
def build_production_info (self, evt_type, evtnumber)
 
def completeInputCommand (self)
 
def create_process (self)
 
def define_Configs (self)
 
def executeAndRemember (self, command)
 
def expandMapping (self, seqList, mapping, index=None)
 
def finalizeFastSimHLT (self)
 
def load (self, includeFile)
 
def loadAndRemember (self, includeFile)
 
def loadDefaultOrSpecifiedCFF (self, stepSpec, defaultCFF, defaultSEQ='')
 
def prepare (self, doChecking=False)
 
def prepare_ALCA (self, stepSpec=None, workflow='full')
 
def prepare_ALCAHARVEST (self, stepSpec=None)
 
def prepare_ALCAOUTPUT (self, stepSpec=None)
 
def prepare_ALCAPRODUCER (self, stepSpec=None)
 
def prepare_CFWRITER (self, stepSpec=None)
 
def prepare_DATAMIX (self, stepSpec=None)
 
def prepare_DIGI (self, stepSpec=None)
 
def prepare_DIGI2RAW (self, stepSpec=None)
 
def prepare_DQM (self, stepSpec='DQMOffline')
 
def prepare_ENDJOB (self, stepSpec='endOfProcess')
 
def prepare_FILTER (self, stepSpec=None)
 
def prepare_GEN (self, stepSpec=None)
 
def prepare_HARVESTING (self, stepSpec=None)
 
def prepare_HLT (self, stepSpec=None)
 
def prepare_L1 (self, stepSpec=None)
 
def prepare_L1HwVal (self, stepSpec='L1HwVal')
 
def prepare_L1Reco (self, stepSpec="L1Reco")
 
def prepare_L1REPACK (self, stepSpec=None)
 
def prepare_L1TrackTrigger (self, stepSpec="L1TrackTrigger")
 
def prepare_LHE (self, stepSpec=None)
 
def prepare_NANO (self, stepSpec='')
 
def prepare_NANOGEN (self, stepSpec="nanoAOD")
 
def prepare_PAT (self, stepSpec="miniAOD")
 
def prepare_PATFILTER (self, stepSpec=None)
 
def prepare_PATGEN (self, stepSpec="miniGEN")
 
def prepare_POSTRECO (self, stepSpec=None)
 
def prepare_RAW2DIGI (self, stepSpec="RawToDigi")
 
def prepare_RAW2RECO (self, stepSpec=None)
 
def prepare_RECO (self, stepSpec="reconstruction")
 
def prepare_RECOBEFMIX (self, stepSpec="reconstruction")
 
def prepare_RECOSIM (self, stepSpec="recosim")
 
def prepare_REPACK (self, stepSpec=None)
 
def prepare_SIM (self, stepSpec=None)
 
def prepare_SKIM (self, stepSpec="all")
 
def prepare_USER (self, stepSpec=None)
 
def prepare_VALIDATION (self, stepSpec='validation')
 
def profileOptions (self)
 
def renameHLTprocessInSequence (self, sequence, proc=None, HLTprocess='HLT')
 
def renameInputTagsInSequence (self, sequence, oldT="rawDataCollector", newT="rawDataRepacker")
 
def scheduleSequence (self, seq, prefix, what='Path')
 
def scheduleSequenceAtEnd (self, seq, prefix)
 

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
 
 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 198 of file ConfigBuilder.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 201 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_FILTER().

201  def __init__(self, options, process = None, with_output = False, with_input = False ):
202  """options taken from old cmsDriver and optparse """
203 
204  options.outfile_name = options.dirout+options.fileout
205 
206  self._options = options
207 
208  if self._options.isData and options.isMC:
209  raise Exception("ERROR: You may specify only --data or --mc, not both")
210  #if not self._options.conditions:
211  # raise Exception("ERROR: No conditions given!\nPlease specify conditions. E.g. via --conditions=IDEAL_30X::All")
212 
213  # check that MEtoEDMConverter (running in ENDJOB) and DQMIO don't run in the same job
214  if 'ENDJOB' in self._options.step:
215  if (hasattr(self._options,"outputDefinition") and \
216  self._options.outputDefinition != '' and \
217  any(anyOf(['t','tier','dataTier'],outdic) == 'DQMIO' for outdic in eval(self._options.outputDefinition))) or \
218  (hasattr(self._options,"datatier") and \
219  self._options.datatier and \
220  'DQMIO' in self._options.datatier):
221  print("removing ENDJOB from steps since not compatible with DQMIO dataTier")
222  self._options.step=self._options.step.replace(',ENDJOB','')
223 
224 
225 
226  # what steps are provided by this class?
227  stepList = [re.sub(r'^prepare_', '', methodName) for methodName in ConfigBuilder.__dict__ if methodName.startswith('prepare_')]
228  self.stepMap={}
229  self.stepKeys=[]
230  for step in self._options.step.split(","):
231  if step=='': continue
232  stepParts = step.split(":")
233  stepName = stepParts[0]
234  if stepName not in stepList and not stepName.startswith('re'):
235  raise ValueError("Step {} unknown. Available are {}".format( stepName , sorted(stepList)))
236  if len(stepParts)==1:
237  self.stepMap[stepName]=""
238  elif len(stepParts)==2:
239  self.stepMap[stepName]=stepParts[1].split('+')
240  elif len(stepParts)==3:
241  self.stepMap[stepName]=(stepParts[2].split('+'),stepParts[1])
242  else:
243  raise ValueError(f"Step definition {step} invalid")
244  self.stepKeys.append(stepName)
245 
246  #print(f"map of steps is: {self.stepMap}")
247 
248  self.with_output = with_output
249  self.process=process
250 
251  if hasattr(self._options,"no_output_flag") and self._options.no_output_flag:
252  self.with_output = False
253  self.with_input = with_input
254  self.imports = []
255  self.create_process()
256  self.define_Configs()
257  self.schedule = list()
258  self.scheduleIndexOfFirstHLTPath = None
259 
260  # we are doing three things here:
261  # creating a process to catch errors
262  # building the code to re-create the process
263 
264  self.additionalCommands = []
265  # TODO: maybe a list of to be dumped objects would help as well
266  self.blacklist_paths = []
267  self.addedObjects = []
268  self.additionalOutputs = {}
269 
270  self.productionFilterSequence = None
271  self.labelsToAssociate=[]
272  self.nextScheduleIsConditional=False
273  self.conditionalPaths=[]
274  self.excludedPaths=[]
275 
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:37
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)
def anyOf(listOfKeys, dict, opt=None)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

Member Function Documentation

◆ addCommon()

def ConfigBuilder.ConfigBuilder.addCommon (   self)

Definition at line 343 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder._options, ConfigBuilder.ConfigBuilder.addedObjects, mps_setup.append, relativeConstraints.keys, DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, ConfigBuilder.ConfigBuilder.process, ConfigBuilder.ConfigBuilder.profileOptions(), and ConfigBuilder.ConfigBuilder.stepMap.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

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

◆ addConditions()

def ConfigBuilder.ConfigBuilder.addConditions (   self)
Add conditions to the process

Definition at line 839 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder._options, ConfigBuilder.ConfigBuilder.addCustomise(), ConfigBuilder.ConfigBuilder.additionalCommands, mps_setup.append, ConfigBuilder.ConfigBuilder.ConditionsDefaultCFF, ConfigBuilder.ConfigBuilder.loadAndRemember(), print(), DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, and ConfigBuilder.ConfigBuilder.process.

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

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

◆ addCustomise()

def ConfigBuilder.ConfigBuilder.addCustomise (   self,
  unsch = 0 
)
Include the customise code 

Definition at line 854 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder._options, ConfigBuilder.ConfigBuilder.addCustomiseCmdLine(), geometryDiff.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.addConditions(), and ConfigBuilder.ConfigBuilder.prepare().

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

◆ addCustomiseCmdLine()

def ConfigBuilder.ConfigBuilder.addCustomiseCmdLine (   self)

Definition at line 927 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder._options, ConfigBuilder.ConfigBuilder.define_Configs(), and ConfigBuilder.ConfigBuilder.executeAndRemember().

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

927  def addCustomiseCmdLine(self):
928  final_snippet='\n# Customisation from command line\n'
929  if self._options.customise_commands:
930  import string
931  for com in self._options.customise_commands.split('\\n'):
932  com=com.lstrip()
933  self.executeAndRemember(com)
934  final_snippet +='\n'+com
935 
936  return final_snippet
937 

◆ addExtraStream()

def ConfigBuilder.ConfigBuilder.addExtraStream (   self,
  name,
  stream,
  workflow = 'full' 
)

Definition at line 1156 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
1215 

◆ addMaxEvents()

def ConfigBuilder.ConfigBuilder.addMaxEvents (   self)
Here we decide how many evts will be processed

Definition at line 371 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder._options, ConfigBuilder.ConfigBuilder.addedObjects, mps_setup.append, createfilelist.int, DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, and ConfigBuilder.ConfigBuilder.process.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

371  def addMaxEvents(self):
372  """Here we decide how many evts will be processed"""
373  self.process.maxEvents.input = int(self._options.number)
374  if self._options.number_out:
375  self.process.maxEvents.output = int(self._options.number_out)
376  self.addedObjects.append(("","maxEvents"))
377 

◆ addOutput()

def ConfigBuilder.ConfigBuilder.addOutput (   self)
Add output module to the process 

Definition at line 530 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder._options, ConfigBuilder.ConfigBuilder.addStandardSequences(), ConfigBuilder.ConfigBuilder.AlCaPaths, ConfigBuilder.anyOf(), mps_setup.append, 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(), ConfigBuilder.ConfigBuilder.schedule, submitPVValidationJobs.split(), and ComparisonHelper.zip().

Referenced by ConfigBuilder.ConfigBuilder.prepare().

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

◆ addSource()

def ConfigBuilder.ConfigBuilder.addSource (   self)
Here the source is built. Priority: file, generator

Definition at line 378 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder._options, ConfigBuilder.ConfigBuilder.addedObjects, mps_setup.append, ConfigBuilder.filesFromDASQuery(), ConfigBuilder.filesFromList(), createfilelist.int, relativeConstraints.keys, print(), DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, ConfigBuilder.ConfigBuilder.process, submitPVValidationJobs.split(), and ConfigBuilder.ConfigBuilder.stepMap.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

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

◆ addStandardSequences()

def ConfigBuilder.ConfigBuilder.addStandardSequences (   self)
Add selected standard sequences to the process

Definition at line 712 of file ConfigBuilder.py.

References TriggerAnalyzer.__str__(), ConfigBuilder.ConfigBuilder._options, ConfigBuilder.ConfigBuilder.completeInputCommand(), Mixing.defineMixing(), ConfigBuilder.ConfigBuilder.executeAndRemember(), ConfigBuilder.filesFromDASQuery(), ConfigBuilder.filesFromList(), ConfigBuilder.ConfigBuilder.GeometryCFF, ConfigBuilder.ConfigBuilder.geometryDBLabel, join(), relativeConstraints.keys, ConfigBuilder.ConfigBuilder.load(), ConfigBuilder.ConfigBuilder.loadAndRemember(), ConfigBuilder.ConfigBuilder.magFieldCFF, print(), DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, ConfigBuilder.ConfigBuilder.process, ConfigBuilder.ConfigBuilder.SimGeometryCFF, ConfigBuilder.ConfigBuilder.stepKeys, and ConfigBuilder.ConfigBuilder.stepMap.

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

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

◆ build_production_info()

def ConfigBuilder.ConfigBuilder.build_production_info (   self,
  evt_type,
  evtnumber 
)
Add useful info for the production. 

Definition at line 2098 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.addedObjects, mps_setup.append, ConfigBuilder.ConfigBuilder.create_process(), DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, ConfigBuilder.ConfigBuilder.process, and str.

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

2098  def build_production_info(self, evt_type, evtnumber):
2099  """ Add useful info for the production. """
2100  self.process.configurationMetadata=cms.untracked.PSet\
2101  (version=cms.untracked.string("$Revision: 1.19 $"),
2102  name=cms.untracked.string("Applications"),
2103  annotation=cms.untracked.string(evt_type+ " nevts:"+str(evtnumber))
2104  )
2105 
2106  self.addedObjects.append(("Production Info","configurationMetadata"))
2107 
2108 
#define str(s)

◆ completeInputCommand()

def ConfigBuilder.ConfigBuilder.completeInputCommand (   self)

Definition at line 809 of file ConfigBuilder.py.

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

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

809  def completeInputCommand(self):
810  if self._options.inputEventContent:
811  import copy
812  def dropSecondDropStar(iec):
813  #drop occurence of 'drop *' in the list
814  count=0
815  for item in iec:
816  if item=='drop *':
817  if count!=0:
818  iec.remove(item)
819  count+=1
820 
821 
822  if not hasattr(self.process.source,'inputCommands'): self.process.source.inputCommands=cms.untracked.vstring()
823  for evct in self._options.inputEventContent.split(','):
824  if evct=='': continue
825  theEventContent = getattr(self.process, evct+"EventContent")
826  if hasattr(theEventContent,'outputCommands'):
827  self.process.source.inputCommands.extend(copy.copy(theEventContent.outputCommands))
828  if hasattr(theEventContent,'inputCommands'):
829  self.process.source.inputCommands.extend(copy.copy(theEventContent.inputCommands))
830 
831  dropSecondDropStar(self.process.source.inputCommands)
832 
833  if not self._options.dropDescendant:
834  self.process.source.dropDescendantsOfDroppedBranches = cms.untracked.bool(False)
835 
836 
837  return
838 

◆ create_process()

def ConfigBuilder.ConfigBuilder.create_process (   self)

Definition at line 2109 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.pythonCfgCode.

Referenced by ConfigBuilder.ConfigBuilder.build_production_info().

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

◆ define_Configs()

def ConfigBuilder.ConfigBuilder.define_Configs (   self)

Definition at line 942 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.addCustomiseCmdLine().

942  def define_Configs(self):
943  if len(self.stepMap):
944  self.loadAndRemember('Configuration/StandardSequences/Services_cff')
945  if self._options.particleTable not in defaultOptions.particleTableList:
946  print('Invalid particle table provided. Options are:')
947  print(defaultOptions.particleTable)
948  sys.exit(-1)
949  else:
950  if len(self.stepMap):
951  self.loadAndRemember('SimGeneral.HepPDTESSource.'+self._options.particleTable+'_cfi')
952 
953  self.loadAndRemember('FWCore/MessageService/MessageLogger_cfi')
954 
955  self.ALCADefaultCFF="Configuration/StandardSequences/AlCaRecoStreams_cff"
956  self.GENDefaultCFF="Configuration/StandardSequences/Generator_cff"
957  self.SIMDefaultCFF="Configuration/StandardSequences/Sim_cff"
958  self.DIGIDefaultCFF="Configuration/StandardSequences/Digi_cff"
959  self.DIGI2RAWDefaultCFF="Configuration/StandardSequences/DigiToRaw_cff"
960  self.L1EMDefaultCFF='Configuration/StandardSequences/SimL1Emulator_cff'
961  self.L1MENUDefaultCFF="Configuration/StandardSequences/L1TriggerDefaultMenu_cff"
962  self.HLTDefaultCFF="Configuration/StandardSequences/HLTtable_cff"
963  self.RAW2DIGIDefaultCFF="Configuration/StandardSequences/RawToDigi_Data_cff"
964  if self._options.isRepacked: self.RAW2DIGIDefaultCFF="Configuration/StandardSequences/RawToDigi_DataMapper_cff"
965  self.L1RecoDefaultCFF="Configuration/StandardSequences/L1Reco_cff"
966  self.L1TrackTriggerDefaultCFF="Configuration/StandardSequences/L1TrackTrigger_cff"
967  self.RECODefaultCFF="Configuration/StandardSequences/Reconstruction_Data_cff"
968  self.RECOSIMDefaultCFF="Configuration/StandardSequences/RecoSim_cff"
969  self.PATDefaultCFF="Configuration/StandardSequences/PAT_cff"
970  self.NANODefaultCFF="PhysicsTools/NanoAOD/nano_cff"
971  self.NANOGENDefaultCFF="PhysicsTools/NanoAOD/nanogen_cff"
972  self.SKIMDefaultCFF="Configuration/StandardSequences/Skims_cff"
973  self.POSTRECODefaultCFF="Configuration/StandardSequences/PostRecoGenerator_cff"
974  self.VALIDATIONDefaultCFF="Configuration/StandardSequences/Validation_cff"
975  self.L1HwValDefaultCFF = "Configuration/StandardSequences/L1HwVal_cff"
976  self.DQMOFFLINEDefaultCFF="DQMOffline/Configuration/DQMOffline_cff"
977  self.HARVESTINGDefaultCFF="Configuration/StandardSequences/Harvesting_cff"
978  self.ALCAHARVESTDefaultCFF="Configuration/StandardSequences/AlCaHarvesting_cff"
979  self.ENDJOBDefaultCFF="Configuration/StandardSequences/EndOfProcess_cff"
980  self.ConditionsDefaultCFF = "Configuration/StandardSequences/FrontierConditions_GlobalTag_cff"
981  self.CFWRITERDefaultCFF = "Configuration/StandardSequences/CrossingFrameWriter_cff"
982  self.REPACKDefaultCFF="Configuration/StandardSequences/DigiToRaw_Repack_cff"
983 
984  if "DATAMIX" in self.stepMap.keys():
985  self.DATAMIXDefaultCFF="Configuration/StandardSequences/DataMixer"+self._options.datamix+"_cff"
986  self.DIGIDefaultCFF="Configuration/StandardSequences/DigiDM_cff"
987  self.DIGI2RAWDefaultCFF="Configuration/StandardSequences/DigiToRawDM_cff"
988  self.L1EMDefaultCFF='Configuration/StandardSequences/SimL1EmulatorDM_cff'
989 
990  self.ALCADefaultSeq=None
991  self.LHEDefaultSeq='externalLHEProducer'
992  self.GENDefaultSeq='pgen'
993  self.SIMDefaultSeq='psim'
994  self.DIGIDefaultSeq='pdigi'
995  self.DATAMIXDefaultSeq=None
996  self.DIGI2RAWDefaultSeq='DigiToRaw'
997  self.HLTDefaultSeq='GRun'
998  self.L1DefaultSeq=None
999  self.L1REPACKDefaultSeq='GT'
1000  self.HARVESTINGDefaultSeq=None
1001  self.ALCAHARVESTDefaultSeq=None
1002  self.CFWRITERDefaultSeq=None
1003  self.RAW2DIGIDefaultSeq='RawToDigi'
1004  self.L1RecoDefaultSeq='L1Reco'
1005  self.L1TrackTriggerDefaultSeq='L1TrackTrigger'
1006  if self._options.fast or ('RAW2DIGI' in self.stepMap and 'RECO' in self.stepMap):
1007  self.RECODefaultSeq='reconstruction'
1008  else:
1009  self.RECODefaultSeq='reconstruction_fromRECO'
1010  self.RECOSIMDefaultSeq='recosim'
1011  self.POSTRECODefaultSeq=None
1012  self.L1HwValDefaultSeq='L1HwVal'
1013  self.DQMDefaultSeq='DQMOffline'
1014  self.VALIDATIONDefaultSeq=''
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'
1022 
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 
1075 
1076  self.RAW2RECODefaultSeq=','.join([self.RAW2DIGIDefaultSeq,self.RECODefaultSeq])
1077 
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 
1152 
1153  self.REDIGIDefaultSeq=self.DIGIDefaultSeq
1154 
def replace(string, replacements)
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

◆ executeAndRemember()

def ConfigBuilder.ConfigBuilder.executeAndRemember (   self,
  command 
)
helper routine to remember replace statements

Definition at line 334 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.additionalCommands, and mps_setup.append.

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

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

◆ expandMapping()

def ConfigBuilder.ConfigBuilder.expandMapping (   self,
  seqList,
  mapping,
  index = None 
)

Definition at line 1954 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.prepare_DQM().

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

1954  def expandMapping(self,seqList,mapping,index=None):
1955  maxLevel=30
1956  level=0
1957  while '@' in repr(seqList) and level<maxLevel:
1958  level+=1
1959  for specifiedCommand in seqList:
1960  if specifiedCommand.startswith('@'):
1961  location=specifiedCommand[1:]
1962  if not location in mapping:
1963  raise Exception("Impossible to map "+location+" from "+repr(mapping))
1964  mappedTo=mapping[location]
1965  if index!=None:
1966  mappedTo=mappedTo[index]
1967  seqList.remove(specifiedCommand)
1968  seqList.extend(mappedTo.split('+'))
1969  break;
1970  if level==maxLevel:
1971  raise Exception("Could not fully expand "+repr(seqList)+" from "+repr(mapping))
1972 

◆ finalizeFastSimHLT()

def ConfigBuilder.ConfigBuilder.finalizeFastSimHLT (   self)

Definition at line 2093 of file ConfigBuilder.py.

References mps_setup.append, ConfigBuilder.ConfigBuilder.build_production_info(), DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, ConfigBuilder.ConfigBuilder.process, and ConfigBuilder.ConfigBuilder.schedule.

Referenced by ConfigBuilder.ConfigBuilder.prepare_ENDJOB().

2093  def finalizeFastSimHLT(self):
2094  self.process.reconstruction = cms.Path(self.process.reconstructionWithFamos)
2095  self.schedule.append(self.process.reconstruction)
2096 
2097 

◆ load()

◆ loadAndRemember()

def ConfigBuilder.ConfigBuilder.loadAndRemember (   self,
  includeFile 
)
helper routine to load am memorize imports

Definition at line 325 of file ConfigBuilder.py.

References mps_setup.append, ConfigBuilder.ConfigBuilder.imports, ConfigBuilder.ConfigBuilder.load(), DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, and ConfigBuilder.ConfigBuilder.process.

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

325  def loadAndRemember(self, includeFile):
326  """helper routine to load am memorize imports"""
327  # we could make the imports a on-the-fly data method of the process instance itself
328  # not sure if the latter is a good idea
329  includeFile = includeFile.replace('/','.')
330  self.imports.append(includeFile)
331  self.process.load(includeFile)
332  return sys.modules[includeFile]
333 
def load(fileName)
Definition: svgfig.py:547

◆ loadDefaultOrSpecifiedCFF()

def ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF (   self,
  stepSpec,
  defaultCFF,
  defaultSEQ = '' 
)

Definition at line 1221 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_ALCA(), ConfigBuilder.ConfigBuilder.prepare_DIGI(), ConfigBuilder.ConfigBuilder.prepare_DIGI2RAW(), ConfigBuilder.ConfigBuilder.prepare_DQM(), 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, stepSpec, defaultCFF, defaultSEQ=''):
1222  _dotsplit = stepSpec.split('.')
1223  if ( len(_dotsplit)==1 ):
1224  if '/' in _dotsplit[0]:
1225  _sequence = defaultSEQ if defaultSEQ else stepSpec
1226  _cff = _dotsplit[0]
1227  else:
1228  _sequence = stepSpec
1229  _cff = defaultCFF
1230  elif ( len(_dotsplit)==2 ):
1231  _cff,_sequence = _dotsplit
1232  else:
1233  print("sub sequence configuration must be of the form dir/subdir/cff.a+b+c or cff.a")
1234  print(stepSpec,"not recognized")
1235  raise
1236  l=self.loadAndRemember(_cff)
1237  return l,_sequence,_cff
1238 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

◆ prepare()

def ConfigBuilder.ConfigBuilder.prepare (   self,
  doChecking = False 
)
Prepare the configuration string and add missing pieces.

Definition at line 2158 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder._options, 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(), mps_setup.append, 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, spr.find(), ConfigBuilder.ConfigBuilder.imports, edm::eventsetup::heterocontainer.insert(), createfilelist.int, mps_monitormerge.items, join(), relativeConstraints.keys, ConfigBuilder.ConfigBuilder.labelsToAssociate, ConfigBuilder.ConfigBuilder.load(), 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, ConfigBuilder.ConfigBuilder.stepMap, str, ConfigBuilder.ConfigBuilder.with_input, and ConfigBuilder.ConfigBuilder.with_output.

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

◆ prepare_ALCA()

def ConfigBuilder.ConfigBuilder.prepare_ALCA (   self,
  stepSpec = None,
  workflow = 'full' 
)
Enrich the process with alca streams 

Definition at line 1278 of file ConfigBuilder.py.

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

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

1278  def prepare_ALCA(self, stepSpec = None, workflow = 'full'):
1279  """ Enrich the process with alca streams """
1280  alcaConfig,sequence,_=self.loadDefaultOrSpecifiedCFF(stepSpec,self.ALCADefaultCFF)
1281 
1282  MAXLEN=31 #the alca producer name should be shorter than 31 chars as per https://cms-talk.web.cern.ch/t/alcaprompt-datasets-not-loaded-in-dbs/11146/2
1283  # decide which ALCA paths to use
1284  alcaList = sequence.split("+")
1285  for alca in alcaList:
1286  if (len(alca)>MAXLEN):
1287  raise Exception("The following alca "+str(alca)+" name (with length "+str(len(alca))+" chars) cannot be accepted because it exceeds the DBS constraints on the length of the name of the ALCARECOs producers ("+str(MAXLEN)+")!")
1288 
1289  maxLevel=0
1290  from Configuration.AlCa.autoAlca import autoAlca, AlCaNoConcurrentLumis
1291  # support @X from autoAlca.py, and recursion support: i.e T0:@Mu+@EG+...
1292  self.expandMapping(alcaList,autoAlca)
1293  self.AlCaPaths=[]
1294  for name in alcaConfig.__dict__:
1295  alcastream = getattr(alcaConfig,name)
1296  shortName = name.replace('ALCARECOStream','')
1297  if shortName in alcaList and isinstance(alcastream,cms.FilteredStream):
1298  if shortName in AlCaNoConcurrentLumis:
1299  print("Setting numberOfConcurrentLuminosityBlocks=1 because of AlCa sequence {}".format(shortName))
1300  self._options.nConcurrentLumis = "1"
1301  self._options.nConcurrentIOVs = "1"
1302  output = self.addExtraStream(name,alcastream, workflow = workflow)
1303  self.executeAndRemember('process.ALCARECOEventContent.outputCommands.extend(process.OutALCARECO'+shortName+'_noDrop.outputCommands)')
1304  self.AlCaPaths.append(shortName)
1305  if 'DQM' in alcaList:
1306  if not self._options.inlineEventContent and hasattr(self.process,name):
1307  self.executeAndRemember('process.' + name + '.outputCommands.append("keep *_MEtoEDMConverter_*_*")')
1308  else:
1309  output.outputCommands.append("keep *_MEtoEDMConverter_*_*")
1310 
1311  #rename the HLT process name in the alca modules
1312  if self._options.hltProcess or 'HLT' in self.stepMap:
1313  if isinstance(alcastream.paths,tuple):
1314  for path in alcastream.paths:
1315  self.renameHLTprocessInSequence(path.label())
1316  else:
1317  self.renameHLTprocessInSequence(alcastream.paths.label())
1318 
1319  for i in range(alcaList.count(shortName)):
1320  alcaList.remove(shortName)
1321 
1322  # DQM needs a special handling
1323  elif name == 'pathALCARECODQM' and 'DQM' in alcaList:
1324  path = getattr(alcaConfig,name)
1325  self.schedule.append(path)
1326  alcaList.remove('DQM')
1327 
1328  if isinstance(alcastream,cms.Path):
1329  #black list the alca path so that they do not appear in the cfg
1330  self.blacklist_paths.append(alcastream)
1331 
1332 
1333  if len(alcaList) != 0:
1334  available=[]
1335  for name in alcaConfig.__dict__:
1336  alcastream = getattr(alcaConfig,name)
1337  if isinstance(alcastream,cms.FilteredStream):
1338  available.append(name.replace('ALCARECOStream',''))
1339  print("The following alcas could not be found "+str(alcaList))
1340  print("available ",available)
1341  #print "verify your configuration, ignoring for now"
1342  raise Exception("The following alcas could not be found "+str(alcaList))
1343 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
#define str(s)

◆ prepare_ALCAHARVEST()

def ConfigBuilder.ConfigBuilder.prepare_ALCAHARVEST (   self,
  stepSpec = None 
)
Enrich the process with AlCaHarvesting step 

Definition at line 2053 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.ALCAHARVESTDefaultCFF, mps_setup.append, ConfigBuilder.ConfigBuilder.executeAndRemember(), ConfigBuilder.ConfigBuilder.expandMapping(), ConfigBuilder.ConfigBuilder.loadAndRemember(), ConfigBuilder.ConfigBuilder.prepare_ENDJOB(), print(), ConfigBuilder.ConfigBuilder.schedule, and str.

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

◆ prepare_ALCAOUTPUT()

def ConfigBuilder.ConfigBuilder.prepare_ALCAOUTPUT (   self,
  stepSpec = None 
)

Definition at line 1275 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.prepare_ALCA().

Referenced by ConfigBuilder.ConfigBuilder.prepare_ALCAPRODUCER().

1275  def prepare_ALCAOUTPUT(self, stepSpec = None):
1276  self.prepare_ALCA(stepSpec, workflow = "output")
1277 

◆ prepare_ALCAPRODUCER()

def ConfigBuilder.ConfigBuilder.prepare_ALCAPRODUCER (   self,
  stepSpec = None 
)

Definition at line 1272 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.prepare_ALCA(), and ConfigBuilder.ConfigBuilder.prepare_ALCAOUTPUT().

Referenced by ConfigBuilder.ConfigBuilder.scheduleSequenceAtEnd().

1272  def prepare_ALCAPRODUCER(self, stepSpec = None):
1273  self.prepare_ALCA(stepSpec, workflow = "producers")
1274 

◆ prepare_CFWRITER()

def ConfigBuilder.ConfigBuilder.prepare_CFWRITER (   self,
  stepSpec = None 
)
Enrich the schedule with the crossing frame writer step

Definition at line 1486 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_DIGI().

1486  def prepare_CFWRITER(self, stepSpec = None):
1487  """ Enrich the schedule with the crossing frame writer step"""
1488  self.loadAndRemember(self.CFWRITERDefaultCFF)
1489  self.scheduleSequence('pcfw','cfwriter_step')
1490  return
1491 

◆ prepare_DATAMIX()

def ConfigBuilder.ConfigBuilder.prepare_DATAMIX (   self,
  stepSpec = None 
)
Enrich the schedule with the digitisation step

Definition at line 1492 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_CFWRITER().

1492  def prepare_DATAMIX(self, stepSpec = None):
1493  """ Enrich the schedule with the digitisation step"""
1494  self.loadAndRemember(self.DATAMIXDefaultCFF)
1495  self.scheduleSequence('pdatamix','datamixing_step')
1496 
1497  if self._options.pileup_input:
1498  theFiles=''
1499  if self._options.pileup_input.startswith('dbs:') or self._options.pileup_input.startswith('das:'):
1500  theFiles=filesFromDASQuery('file dataset = %s'%(self._options.pileup_input[4:],),self._options.pileup_dasoption)[0]
1501  elif self._options.pileup_input.startswith("filelist:"):
1502  theFiles= (filesFromList(self._options.pileup_input[9:]))[0]
1503  else:
1504  theFiles=self._options.pileup_input.split(',')
1505  #print theFiles
1506  self.executeAndRemember( "process.mixData.input.fileNames = cms.untracked.vstring(%s)"%( theFiles ) )
1507 
1508  return
1509 
def filesFromDASQuery(query, option="", s=None)
def filesFromList(fileName, s=None)

◆ prepare_DIGI()

def ConfigBuilder.ConfigBuilder.prepare_DIGI (   self,
  stepSpec = None 
)
Enrich the schedule with the digitisation step

Definition at line 1466 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder._options, ConfigBuilder.ConfigBuilder.DIGIDefaultCFF, ConfigBuilder.ConfigBuilder.executeAndRemember(), ConfigBuilder.ConfigBuilder.loadAndRemember(), ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), ConfigBuilder.ConfigBuilder.prepare_CFWRITER(), DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, ConfigBuilder.ConfigBuilder.process, and ConfigBuilder.ConfigBuilder.scheduleSequence().

Referenced by ConfigBuilder.ConfigBuilder.prepare_SIM().

1466  def prepare_DIGI(self, stepSpec = None):
1467  """ Enrich the schedule with the digitisation step"""
1468  _,_digiSeq,_ = self.loadDefaultOrSpecifiedCFF(stepSpec,self.DIGIDefaultCFF)
1469 
1470  if self._options.gflash==True:
1471  self.loadAndRemember("Configuration/StandardSequences/GFlashDIGI_cff")
1472 
1473  if _digiSeq == 'pdigi_valid' or _digiSeq == 'pdigi_hi':
1474  self.executeAndRemember("process.mix.digitizers = cms.PSet(process.theDigitizersValid)")
1475 
1476  if _digiSeq != 'pdigi_nogen' and _digiSeq != 'pdigi_valid_nogen' and _digiSeq != 'pdigi_hi_nogen' and not self.process.source.type_()=='EmptySource' and not self._options.filetype == "LHE":
1477  if self._options.inputEventContent=='':
1478  self._options.inputEventContent='REGEN'
1479  else:
1480  self._options.inputEventContent=self._options.inputEventContent+',REGEN'
1481 
1482 
1483  self.scheduleSequence(_digiSeq,'digitisation_step')
1484  return
1485 

◆ prepare_DIGI2RAW()

def ConfigBuilder.ConfigBuilder.prepare_DIGI2RAW (   self,
  stepSpec = None 
)

Definition at line 1510 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_DATAMIX().

1510  def prepare_DIGI2RAW(self, stepSpec = None):
1511  _,_digi2rawSeq,_ = self.loadDefaultOrSpecifiedCFF(stepSpec,self.DIGI2RAWDefaultCFF)
1512  self.scheduleSequence(_digi2rawSeq,'digi2raw_step')
1513  return
1514 

◆ prepare_DQM()

def ConfigBuilder.ConfigBuilder.prepare_DQM (   self,
  stepSpec = 'DQMOffline' 
)

Definition at line 1973 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder._options, mps_setup.append, ConfigBuilder.ConfigBuilder.DQMOFFLINEDefaultCFF, ConfigBuilder.ConfigBuilder.expandMapping(), edm::eventsetup::heterocontainer.insert(), relativeConstraints.keys, ConfigBuilder.ConfigBuilder.loadAndRemember(), ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), ConfigBuilder.ConfigBuilder.prepare_HARVESTING(), print(), DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, ConfigBuilder.ConfigBuilder.process, ConfigBuilder.ConfigBuilder.renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder.schedule, and ConfigBuilder.ConfigBuilder.stepMap.

Referenced by ConfigBuilder.ConfigBuilder.expandMapping().

1973  def prepare_DQM(self, stepSpec = 'DQMOffline'):
1974  # this one needs replacement
1975 
1976  # any 'DQM' job should use DQMStore in non-legacy mode (but not HARVESTING)
1977  self.loadAndRemember("DQMServices/Core/DQMStoreNonLegacy_cff")
1978  _,_dqmSeq,_ = self.loadDefaultOrSpecifiedCFF(stepSpec,self.DQMOFFLINEDefaultCFF)
1979  sequenceList=_dqmSeq.split('+')
1980  postSequenceList=_dqmSeq.split('+')
1981  from DQMOffline.Configuration.autoDQM import autoDQM
1982  self.expandMapping(sequenceList,autoDQM,index=0)
1983  self.expandMapping(postSequenceList,autoDQM,index=1)
1984 
1985  if len(set(sequenceList))!=len(sequenceList):
1986  sequenceList=list(set(sequenceList))
1987  print("Duplicate entries for DQM:, using",sequenceList)
1988 
1989  pathName='dqmoffline_step'
1990  for (i,_sequence) in enumerate(sequenceList):
1991  if (i!=0):
1992  pathName='dqmoffline_%d_step'%(i)
1993 
1994  if 'HLT' in self.stepMap.keys() or self._options.hltProcess:
1995  self.renameHLTprocessInSequence(_sequence)
1996 
1997  setattr(self.process,pathName, cms.EndPath( getattr(self.process,_sequence ) ) )
1998  self.schedule.append(getattr(self.process,pathName))
1999 
2000  if hasattr(self.process,"genstepfilter") and len(self.process.genstepfilter.triggerConditions):
2001  #will get in the schedule, smoothly
2002  getattr(self.process,pathName).insert(0,self.process.genstepfilter)
2003 
2004 
2005  pathName='dqmofflineOnPAT_step'
2006  for (i,_sequence) in enumerate(postSequenceList):
2007  #Fix needed to avoid duplication of sequences not defined in autoDQM or without a PostDQM
2008  if (sequenceList[i]==postSequenceList[i]):
2009  continue
2010  if (i!=0):
2011  pathName='dqmofflineOnPAT_%d_step'%(i)
2012 
2013  setattr(self.process,pathName, cms.EndPath( getattr(self.process, _sequence ) ) )
2014  self.schedule.append(getattr(self.process,pathName))
2015 
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

◆ prepare_ENDJOB()

def ConfigBuilder.ConfigBuilder.prepare_ENDJOB (   self,
  stepSpec = 'endOfProcess' 
)

Definition at line 2088 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_ALCAHARVEST().

2088  def prepare_ENDJOB(self, stepSpec = 'endOfProcess'):
2089  _,_endjobSeq,_=self.loadDefaultOrSpecifiedCFF(stepSpec,self.ENDJOBDefaultCFF)
2090  self.scheduleSequenceAtEnd(_endjobSeq,'endjob_step')
2091  return
2092 

◆ prepare_FILTER()

def ConfigBuilder.ConfigBuilder.prepare_FILTER (   self,
  stepSpec = None 
)
Enrich the schedule with a user defined filter sequence 

Definition at line 1636 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.__init__(), ConfigBuilder.ConfigBuilder.inliner, 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(), tkal_create_file_lists._DasCache.load(), and resolutioncreator_cfi.object.

Referenced by ConfigBuilder.ConfigBuilder.prepare_L1TrackTrigger().

1636  def prepare_FILTER(self, stepSpec = None):
1637  ''' Enrich the schedule with a user defined filter sequence '''
1638 
1639  filterConfig,filterSeq = stepSpec.split('.')
1640  filterConfig=self.load(filterConfig)
1641 
1642  class PrintAllModules(object):
1643  def __init__(self):
1644  self.inliner=''
1645  pass
1646  def enter(self,visitee):
1647  try:
1648  label=visitee.label()
1649 
1650  self.inliner=label+','+self.inliner
1651  except:
1652  pass
1653  def leave(self,v): pass
1654 
1655  expander=PrintAllModules()
1656  getattr(self.process,filterSeq).visit( expander )
1657  self._options.inlineObjets+=','+expander.inliner
1658  self._options.inlineObjets+=','+filterSeq
1659 
1660 
1661  self.scheduleSequence(filterSeq,'filtering_step')
1662  self.nextScheduleIsConditional=True
1663 
1664  self.productionFilterSequence = filterSeq
1665 
1666  return
1667 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

◆ prepare_GEN()

def ConfigBuilder.ConfigBuilder.prepare_GEN (   self,
  stepSpec = None 
)
load the fragment of generator configuration 

Definition at line 1361 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder._options, mps_setup.append, ConfigBuilder.ConfigBuilder.executeAndRemember(), ConfigBuilder.ConfigBuilder.GENDefaultCFF, ConfigBuilder.ConfigBuilder.GENDefaultSeq, ConfigBuilder.ConfigBuilder.LHEDefaultSeq, ConfigBuilder.ConfigBuilder.load(), ConfigBuilder.ConfigBuilder.loadAndRemember(), ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), ConfigBuilder.ConfigBuilder.prepare_SIM(), 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.schedule, ConfigBuilder.ConfigBuilder.scheduleSequenceAtEnd(), and ConfigBuilder.ConfigBuilder.stepMap.

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

◆ prepare_HARVESTING()

def ConfigBuilder.ConfigBuilder.prepare_HARVESTING (   self,
  stepSpec = None 
)
Enrich the process with harvesting step 

Definition at line 2016 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder._options, and ConfigBuilder.ConfigBuilder.DQMSaverCFF.

Referenced by ConfigBuilder.ConfigBuilder.prepare_DQM().

2016  def prepare_HARVESTING(self, stepSpec = None):
2017  """ Enrich the process with harvesting step """
2018  self.DQMSaverCFF='Configuration/StandardSequences/DQMSaver'+self._options.harvesting+'_cff'
2019  self.loadAndRemember(self.DQMSaverCFF)
2020 
2021  harvestingConfig,sequence,_ = self.loadDefaultOrSpecifiedCFF(stepSpec,self.HARVESTINGDefaultCFF)
2022 
2023  # decide which HARVESTING paths to use
2024  harvestingList = sequence.split("+")
2025  from DQMOffline.Configuration.autoDQM import autoDQM
2026  from Validation.Configuration.autoValidation import autoValidation
2027  import copy
2028  combined_mapping = copy.deepcopy( autoDQM )
2029  combined_mapping.update( autoValidation )
2030  self.expandMapping(harvestingList,combined_mapping,index=-1)
2031 
2032  if len(set(harvestingList))!=len(harvestingList):
2033  harvestingList=list(set(harvestingList))
2034  print("Duplicate entries for HARVESTING, using",harvestingList)
2035 
2036  for name in harvestingList:
2037  if not name in harvestingConfig.__dict__:
2038  print(name,"is not a possible harvesting type. Available are",harvestingConfig.__dict__.keys())
2039  # trigger hard error, like for other sequence types
2040  getattr(self.process, name)
2041  continue
2042  harvestingstream = getattr(harvestingConfig,name)
2043  if isinstance(harvestingstream,cms.Path):
2044  self.schedule.append(harvestingstream)
2045  self.blacklist_paths.append(harvestingstream)
2046  if isinstance(harvestingstream,cms.Sequence):
2047  setattr(self.process,name+"_step",cms.Path(harvestingstream))
2048  self.schedule.append(getattr(self.process,name+"_step"))
2049 
2050  self.scheduleSequence('DQMSaver','dqmsave_step')
2051  return
2052 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

◆ prepare_HLT()

def ConfigBuilder.ConfigBuilder.prepare_HLT (   self,
  stepSpec = None 
)
Enrich the schedule with the HLT simulation step

Definition at line 1539 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder._options, ConfigBuilder.ConfigBuilder.additionalCommands, mps_setup.append, ConfigBuilder.ConfigBuilder.blacklist_paths, ConfigBuilder.ConfigBuilder.executeAndRemember(), join(), ConfigBuilder.ConfigBuilder.loadAndRemember(), ConfigBuilder.ConfigBuilder.prepare_RAW2RECO(), 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.

Referenced by ConfigBuilder.ConfigBuilder.prepare_L1REPACK().

1539  def prepare_HLT(self, stepSpec = None):
1540  """ Enrich the schedule with the HLT simulation step"""
1541  if not stepSpec:
1542  print("no specification of the hlt menu has been given, should never happen")
1543  raise Exception('no HLT specifications provided')
1544 
1545  if '@' in stepSpec:
1546  # case where HLT:@something was provided
1547  from Configuration.HLT.autoHLT import autoHLT
1548  key = stepSpec[1:]
1549  if key in autoHLT:
1550  stepSpec = autoHLT[key]
1551  else:
1552  raise ValueError('no HLT mapping key "%s" found in autoHLT' % key)
1553 
1554  if ',' in stepSpec:
1555  #case where HLT:something:something was provided
1556  self.executeAndRemember('import HLTrigger.Configuration.Utilities')
1557  optionsForHLT = {}
1558  if self._options.scenario == 'HeavyIons':
1559  optionsForHLT['type'] = 'HIon'
1560  else:
1561  optionsForHLT['type'] = 'GRun'
1562  optionsForHLTConfig = ', '.join('%s=%s' % (key, repr(val)) for (key, val) in optionsForHLT.items())
1563  if stepSpec == 'run,fromSource':
1564  if hasattr(self.process.source,'firstRun'):
1565  self.executeAndRemember('process.loadHltConfiguration("run:%%d"%%(process.source.firstRun.value()),%s)'%(optionsForHLTConfig))
1566  elif hasattr(self.process.source,'setRunNumber'):
1567  self.executeAndRemember('process.loadHltConfiguration("run:%%d"%%(process.source.setRunNumber.value()),%s)'%(optionsForHLTConfig))
1568  else:
1569  raise Exception(f'Cannot replace menu to load {stepSpec}')
1570  else:
1571  self.executeAndRemember('process.loadHltConfiguration("%s",%s)'%(stepSpec.replace(',',':'),optionsForHLTConfig))
1572  else:
1573  self.loadAndRemember('HLTrigger/Configuration/HLT_%s_cff' % stepSpec)
1574 
1575  if self._options.isMC:
1576  self._options.customisation_file.append("HLTrigger/Configuration/customizeHLTforMC.customizeHLTforMC")
1577 
1578  if self._options.name != 'HLT':
1579  self.additionalCommands.append('from HLTrigger.Configuration.CustomConfigs import ProcessName')
1580  self.additionalCommands.append('process = ProcessName(process)')
1581  self.additionalCommands.append('')
1582  from HLTrigger.Configuration.CustomConfigs import ProcessName
1583  self.process = ProcessName(self.process)
1584 
1585  if self.process.schedule == None:
1586  raise Exception('the HLT step did not attach a valid schedule to the process')
1587 
1588  self.scheduleIndexOfFirstHLTPath = len(self.schedule)
1589  [self.blacklist_paths.append(path) for path in self.process.schedule if isinstance(path,(cms.Path,cms.EndPath))]
1590 
1591  # this is a fake, to be removed with fastim migration and HLT menu dump
1592  if self._options.fast:
1593  if not hasattr(self.process,'HLTEndSequence'):
1594  self.executeAndRemember("process.HLTEndSequence = cms.Sequence( process.dummyModule )")
1595 
1596 
def ProcessName(process)
Definition: CustomConfigs.py:6
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

◆ prepare_L1()

def ConfigBuilder.ConfigBuilder.prepare_L1 (   self,
  stepSpec = None 
)
Enrich the schedule with the L1 simulation step

Definition at line 1520 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_REPACK().

1520  def prepare_L1(self, stepSpec = None):
1521  """ Enrich the schedule with the L1 simulation step"""
1522  assert(stepSpec == None)
1523  self.loadAndRemember(self.L1EMDefaultCFF)
1524  self.scheduleSequence('SimL1Emulator','L1simulation_step')
1525  return
1526 
assert(be >=bs)

◆ prepare_L1HwVal()

def ConfigBuilder.ConfigBuilder.prepare_L1HwVal (   self,
  stepSpec = 'L1HwVal' 
)
Enrich the schedule with L1 HW validation 

Definition at line 1618 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_PATFILTER().

1618  def prepare_L1HwVal(self, stepSpec = 'L1HwVal'):
1619  ''' Enrich the schedule with L1 HW validation '''
1620  self.loadDefaultOrSpecifiedCFF(stepSpec,self.L1HwValDefaultCFF)
1621  print('\n\n\n DEPRECATED this has no action \n\n\n')
1622  return
1623 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

◆ prepare_L1Reco()

def ConfigBuilder.ConfigBuilder.prepare_L1Reco (   self,
  stepSpec = "L1Reco" 
)
Enrich the schedule with L1 reconstruction 

Definition at line 1624 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_L1HwVal().

1624  def prepare_L1Reco(self, stepSpec = "L1Reco"):
1625  ''' Enrich the schedule with L1 reconstruction '''
1626  _,_l1recoSeq,_ = self.loadDefaultOrSpecifiedCFF(stepSpec,self.L1RecoDefaultCFF)
1627  self.scheduleSequence(_l1recoSeq,'L1Reco_step')
1628  return
1629 

◆ prepare_L1REPACK()

def ConfigBuilder.ConfigBuilder.prepare_L1REPACK (   self,
  stepSpec = 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 1527 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_L1().

1527  def prepare_L1REPACK(self, stepSpec = None):
1528  """ 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"""
1529  supported = ['GT','GT1','GT2','GCTGT','Full','FullSimTP','FullMC','Full2015Data','uGT','CalouGT']
1530  if stepSpec in supported:
1531  self.loadAndRemember('Configuration/StandardSequences/SimL1EmulatorRepack_%s_cff'% stepSpec)
1532  if self._options.scenario == 'HeavyIons':
1533  self.renameInputTagsInSequence("SimL1Emulator","rawDataCollector","rawDataRepacker")
1534  self.scheduleSequence('SimL1Emulator','L1RePack_step')
1535  else:
1536  print("L1REPACK with '",stepSpec,"' is not supported! Supported choices are: ",supported)
1537  raise Exception('unsupported feature')
1538 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

◆ prepare_L1TrackTrigger()

def ConfigBuilder.ConfigBuilder.prepare_L1TrackTrigger (   self,
  stepSpec = "L1TrackTrigger" 
)
Enrich the schedule with L1 reconstruction 

Definition at line 1630 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_L1Reco().

1630  def prepare_L1TrackTrigger(self, stepSpec = "L1TrackTrigger"):
1631  ''' Enrich the schedule with L1 reconstruction '''
1632  _,_l1tracktriggerSeq,_ = self.loadDefaultOrSpecifiedCFF(stepSpec,self.L1TrackTriggerDefaultCFF)
1633  self.scheduleSequence(_l1tracktriggerSeq,'L1TrackTrigger_step')
1634  return
1635 

◆ prepare_LHE()

def ConfigBuilder.ConfigBuilder.prepare_LHE (   self,
  stepSpec = None 
)

Definition at line 1344 of file ConfigBuilder.py.

1344  def prepare_LHE(self, stepSpec = None):
1345  #load the fragment
1346 
1347  loadFragment = self._options.evt_type.replace('.py','',).replace('.','_').replace('python/','').replace('/','.')
1348  print("Loading lhe fragment from",loadFragment)
1349  __import__(loadFragment)
1350  self.process.load(loadFragment)
1351 
1352  self._options.inlineObjets+=','+stepSpec
1353 
1354  getattr(self.process,stepSpec).nEvents = int(self._options.number)
1355 
1356  #schedule it
1357  self.process.lhe_step = cms.Path( getattr( self.process,stepSpec) )
1358  self.excludedPaths.append("lhe_step")
1359  self.schedule.append( self.process.lhe_step )
1360 
def replace(string, replacements)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def load(fileName)
Definition: svgfig.py:547

◆ prepare_NANO()

def ConfigBuilder.ConfigBuilder.prepare_NANO (   self,
  stepSpec = '' 
)

Definition at line 1721 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder._options, join(), ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), ConfigBuilder.ConfigBuilder.NANODefaultCFF, ConfigBuilder.ConfigBuilder.NANODefaultSeq, ConfigBuilder.ConfigBuilder.prepare_NANOGEN(), print(), and ConfigBuilder.ConfigBuilder.scheduleSequence().

Referenced by ConfigBuilder.ConfigBuilder.prepare_PATGEN().

1721  def prepare_NANO(self, stepSpec = '' ):
1722  print(f"in prepare_nano {stepSpec}")
1723  ''' Enrich the schedule with NANO '''
1724  _,_nanoSeq,_nanoCff = self.loadDefaultOrSpecifiedCFF(stepSpec,self.NANODefaultCFF,self.NANODefaultSeq)
1725  self.scheduleSequence(_nanoSeq,'nanoAOD_step')
1726  custom = "nanoAOD_customizeData" if self._options.isData else "nanoAOD_customizeMC"
1727  self._options.customisation_file.insert(0,'.'.join([_nanoCff,custom]))
1728  if self._options.hltProcess:
1729  if len(self._options.customise_commands) > 1:
1730  self._options.customise_commands = self._options.customise_commands + " \n"
1731  self._options.customise_commands = self._options.customise_commands + "process.unpackedPatTrigger.triggerResults= cms.InputTag( 'TriggerResults::"+self._options.hltProcess+"' )\n"
1732 
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

◆ prepare_NANOGEN()

def ConfigBuilder.ConfigBuilder.prepare_NANOGEN (   self,
  stepSpec = "nanoAOD" 
)
Enrich the schedule with NANOGEN 

Definition at line 1733 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_NANO().

1733  def prepare_NANOGEN(self, stepSpec = "nanoAOD"):
1734  ''' Enrich the schedule with NANOGEN '''
1735  # TODO: Need to modify this based on the input file type
1736  fromGen = any([x in self.stepMap for x in ['LHE', 'GEN', 'AOD']])
1737  _,_nanogenSeq,_nanogenCff = self.loadDefaultOrSpecifiedCFF(stepSpec,self.NANOGENDefaultCFF)
1738  self.scheduleSequence(_nanogenSeq,'nanoAOD_step')
1739  custom = "customizeNanoGEN" if fromGen else "customizeNanoGENFromMini"
1740  if self._options.runUnscheduled:
1741  self._options.customisation_file_unsch.insert(0, '.'.join([_nanogenCff, custom]))
1742  else:
1743  self._options.customisation_file.insert(0, '.'.join([_nanogenCff, custom]))
1744 
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:37
static std::string join(char **cmd)
Definition: RemoteFile.cc:19

◆ prepare_PAT()

def ConfigBuilder.ConfigBuilder.prepare_PAT (   self,
  stepSpec = "miniAOD" 
)
Enrich the schedule with PAT 

Definition at line 1689 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder._options, mps_setup.append, ConfigBuilder.ConfigBuilder.labelsToAssociate, ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), ConfigBuilder.ConfigBuilder.PATDefaultCFF, ConfigBuilder.ConfigBuilder.prepare_PATFILTER(), and ConfigBuilder.ConfigBuilder.prepare_PATGEN().

Referenced by ConfigBuilder.ConfigBuilder.prepare_RECOBEFMIX().

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

◆ prepare_PATFILTER()

def ConfigBuilder.ConfigBuilder.prepare_PATFILTER (   self,
  stepSpec = None 
)

Definition at line 1612 of file ConfigBuilder.py.

References mps_setup.append, ConfigBuilder.ConfigBuilder.loadAndRemember(), ConfigBuilder.ConfigBuilder.prepare_L1HwVal(), DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, ConfigBuilder.ConfigBuilder.process, and ConfigBuilder.ConfigBuilder.schedule.

Referenced by ConfigBuilder.ConfigBuilder.prepare_PAT(), and ConfigBuilder.ConfigBuilder.prepare_RAW2DIGI().

1612  def prepare_PATFILTER(self, stepSpec = None):
1613  self.loadAndRemember("PhysicsTools/PatAlgos/slimming/metFilterPaths_cff")
1614  from PhysicsTools.PatAlgos.slimming.metFilterPaths_cff import allMetFilterPaths
1615  for filt in allMetFilterPaths:
1616  self.schedule.append(getattr(self.process,'Flag_'+filt))
1617 

◆ prepare_PATGEN()

def ConfigBuilder.ConfigBuilder.prepare_PATGEN (   self,
  stepSpec = "miniGEN" 
)
Enrich the schedule with PATGEN 

Definition at line 1713 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder._options, mps_setup.append, ConfigBuilder.ConfigBuilder.labelsToAssociate, ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), ConfigBuilder.ConfigBuilder.PATGENDefaultCFF, and ConfigBuilder.ConfigBuilder.prepare_NANO().

Referenced by ConfigBuilder.ConfigBuilder.prepare_PAT().

1713  def prepare_PATGEN(self, stepSpec = "miniGEN"):
1714  ''' Enrich the schedule with PATGEN '''
1715  self.loadDefaultOrSpecifiedCFF(stepSpec,self.PATGENDefaultCFF) #this is unscheduled
1716  self.labelsToAssociate.append('patGENTask')
1717  if self._options.isData:
1718  raise Exception("PATGEN step can only run on MC")
1719  return
1720 

◆ prepare_POSTRECO()

def ConfigBuilder.ConfigBuilder.prepare_POSTRECO (   self,
  stepSpec = None 
)
Enrich the schedule with the postreco step 

Definition at line 1794 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_USER().

1794  def prepare_POSTRECO(self, stepSpec = None):
1795  """ Enrich the schedule with the postreco step """
1796  self.loadAndRemember(self.POSTRECODefaultCFF)
1797  self.scheduleSequence('postreco_generator','postreco_step')
1798  return
1799 
1800 

◆ prepare_RAW2DIGI()

def ConfigBuilder.ConfigBuilder.prepare_RAW2DIGI (   self,
  stepSpec = "RawToDigi" 
)

Definition at line 1607 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_RAW2RECO().

1607  def prepare_RAW2DIGI(self, stepSpec = "RawToDigi"):
1608  _,_raw2digiSeq,_ = self.loadDefaultOrSpecifiedCFF(stepSpec,self.RAW2DIGIDefaultCFF)
1609  self.scheduleSequence(_raw2digiSeq,'raw2digi_step')
1610  return
1611 

◆ prepare_RAW2RECO()

def ConfigBuilder.ConfigBuilder.prepare_RAW2RECO (   self,
  stepSpec = None 
)

Definition at line 1597 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_HLT().

1597  def prepare_RAW2RECO(self, stepSpec = None):
1598  if ','in stepSpec:
1599  seqReco,seqDigi=stepSpec.spli(',')
1600  else:
1601  print(f"RAW2RECO requires two specifications {stepSpec} insufficient")
1602 
1603  self.prepare_RAW2DIGI(seqDigi)
1604  self.prepare_RECO(seqReco)
1605  return
1606 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

◆ prepare_RECO()

def ConfigBuilder.ConfigBuilder.prepare_RECO (   self,
  stepSpec = "reconstruction" 
)
Enrich the schedule with reconstruction 

Definition at line 1668 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_RAW2RECO().

1668  def prepare_RECO(self, stepSpec = "reconstruction"):
1669  ''' Enrich the schedule with reconstruction '''
1670  _,_recoSeq,_ = self.loadDefaultOrSpecifiedCFF(stepSpec,self.RECODefaultCFF)
1671  self.scheduleSequence(_recoSeq,'reconstruction_step')
1672  return
1673 

◆ prepare_RECOBEFMIX()

def ConfigBuilder.ConfigBuilder.prepare_RECOBEFMIX (   self,
  stepSpec = "reconstruction" 
)
Enrich the schedule with the part of reconstruction that is done before mixing in FastSim

Definition at line 1680 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_RECOSIM().

1680  def prepare_RECOBEFMIX(self, stepSpec = "reconstruction"):
1681  ''' Enrich the schedule with the part of reconstruction that is done before mixing in FastSim'''
1682  if not self._options.fast:
1683  print("ERROR: this step is only implemented for FastSim")
1684  sys.exit()
1685  _,_recobefmixSeq,_ = self.loadDefaultOrSpecifiedCFF(self.RECOBEFMIXDefaultSeq,self.RECOBEFMIXDefaultCFF)
1686  self.scheduleSequence(_recobefmixSeq,'reconstruction_befmix_step')
1687  return
1688 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

◆ prepare_RECOSIM()

def ConfigBuilder.ConfigBuilder.prepare_RECOSIM (   self,
  stepSpec = "recosim" 
)
Enrich the schedule with reconstruction 

Definition at line 1674 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_RECO().

1674  def prepare_RECOSIM(self, stepSpec = "recosim"):
1675  ''' Enrich the schedule with reconstruction '''
1676  _,_recosimSeq,_ = self.loadDefaultOrSpecifiedCFF(stepSpec,self.RECOSIMDefaultCFF)
1677  self.scheduleSequence(_recosimSeq,'recosim_step')
1678  return
1679 

◆ prepare_REPACK()

def ConfigBuilder.ConfigBuilder.prepare_REPACK (   self,
  stepSpec = None 
)

Definition at line 1515 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_DIGI2RAW().

1515  def prepare_REPACK(self, stepSpec = None):
1516  _,_repackSeq,_ = self.loadDefaultOrSpecifiedCFF(stepSpec,self.REPACKDefaultCFF)
1517  self.scheduleSequence(_repackSeq,'digi2repack_step')
1518  return
1519 

◆ prepare_SIM()

def ConfigBuilder.ConfigBuilder.prepare_SIM (   self,
  stepSpec = None 
)
Enrich the schedule with the simulation step

Definition at line 1450 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_GEN().

1450  def prepare_SIM(self, stepSpec = None):
1451  """ Enrich the schedule with the simulation step"""
1452  _,_simSeq,_ = self.loadDefaultOrSpecifiedCFF(stepSpec,self.SIMDefaultCFF)
1453  if not self._options.fast:
1454  if self._options.gflash==True:
1455  self.loadAndRemember("Configuration/StandardSequences/GFlashSIM_cff")
1456 
1457  if self._options.magField=='0T':
1458  self.executeAndRemember("process.g4SimHits.UseMagneticField = cms.bool(False)")
1459  else:
1460  if self._options.magField=='0T':
1461  self.executeAndRemember("process.fastSimProducer.detectorDefinition.magneticFieldZ = cms.untracked.double(0.)")
1462 
1463  self.scheduleSequence(_simSeq,'simulation_step')
1464  return
1465 

◆ prepare_SKIM()

def ConfigBuilder.ConfigBuilder.prepare_SKIM (   self,
  stepSpec = "all" 
)
Enrich the schedule with skimming fragments

Definition at line 1745 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder._options, ConfigBuilder.ConfigBuilder.addExtraStream(), mps_setup.append, ConfigBuilder.ConfigBuilder.blacklist_paths, ConfigBuilder.ConfigBuilder.EVTCONTDefaultCFF, ConfigBuilder.ConfigBuilder.expandMapping(), join(), ConfigBuilder.ConfigBuilder.load(), ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), ConfigBuilder.ConfigBuilder.prepare_USER(), print(), DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, ConfigBuilder.ConfigBuilder.process, FastTimerService_cff.range, and ConfigBuilder.ConfigBuilder.SKIMDefaultCFF.

Referenced by ConfigBuilder.ConfigBuilder.prepare_NANOGEN().

1745  def prepare_SKIM(self, stepSpec = "all"):
1746  ''' Enrich the schedule with skimming fragments'''
1747  skimConfig,sequence,_ = self.loadDefaultOrSpecifiedCFF(stepSpec,self.SKIMDefaultCFF)
1748 
1749  skimlist=sequence.split('+')
1750 
1751  from Configuration.Skimming.autoSkim import autoSkim
1752  self.expandMapping(skimlist,autoSkim)
1753 
1754  #print "dictionnary for skims:",skimConfig.__dict__
1755  for skim in skimConfig.__dict__:
1756  skimstream = getattr(skimConfig,skim)
1757  if isinstance(skimstream,cms.Path):
1758  #black list the alca path so that they do not appear in the cfg
1759  self.blacklist_paths.append(skimstream)
1760  if (not isinstance(skimstream,cms.FilteredStream)):
1761  continue
1762  shortname = skim.replace('SKIMStream','')
1763  if (sequence=="all"):
1764  self.addExtraStream(skim,skimstream)
1765  elif (shortname in skimlist):
1766  self.addExtraStream(skim,skimstream)
1767  #add a DQM eventcontent for this guy
1768  if self._options.datatier=='DQM':
1769  self.process.load(self.EVTCONTDefaultCFF)
1770  skimstreamDQM = cms.FilteredStream(
1771  responsible = skimstream.responsible,
1772  name = skimstream.name+'DQM',
1773  paths = skimstream.paths,
1774  selectEvents = skimstream.selectEvents,
1775  content = self._options.datatier+'EventContent',
1776  dataTier = cms.untracked.string(self._options.datatier)
1777  )
1778  self.addExtraStream(skim+'DQM',skimstreamDQM)
1779  for i in range(skimlist.count(shortname)):
1780  skimlist.remove(shortname)
1781 
1782 
1783 
1784  if (skimlist.__len__()!=0 and sequence!="all"):
1785  print('WARNING, possible typo with SKIM:'+'+'.join(skimlist))
1786  raise Exception('WARNING, possible typo with SKIM:'+'+'.join(skimlist))
1787 
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 load(fileName)
Definition: svgfig.py:547

◆ prepare_USER()

def ConfigBuilder.ConfigBuilder.prepare_USER (   self,
  stepSpec = None 
)
Enrich the schedule with a user defined sequence 

Definition at line 1788 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_SKIM().

1788  def prepare_USER(self, stepSpec = None):
1789  ''' Enrich the schedule with a user defined sequence '''
1790  _,_userSeq,_ = self.loadDefaultOrSpecifiedCFF(stepSpec,self.USERDefaultCFF)
1791  self.scheduleSequence(_userSeq,'user_step')
1792  return
1793 

◆ prepare_VALIDATION()

def ConfigBuilder.ConfigBuilder.prepare_VALIDATION (   self,
  stepSpec = 'validation' 
)

Definition at line 1801 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder._options, any(), mps_setup.append, ConfigBuilder.ConfigBuilder.executeAndRemember(), ConfigBuilder.ConfigBuilder.expandMapping(), edm::eventsetup::heterocontainer.insert(), ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), genParticles_cff.map, resolutioncreator_cfi.object, print(), DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, ConfigBuilder.ConfigBuilder.process, ConfigBuilder.ConfigBuilder.renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder.schedule, submitPVValidationJobs.split(), ConfigBuilder.ConfigBuilder.stepMap, and ConfigBuilder.ConfigBuilder.VALIDATIONDefaultCFF.

Referenced by ConfigBuilder.ConfigBuilder.prepare_POSTRECO().

1801  def prepare_VALIDATION(self, stepSpec = 'validation'):
1802  print(f"{stepSpec} in preparing validation")
1803  _,sequence,_ = self.loadDefaultOrSpecifiedCFF(stepSpec,self.VALIDATIONDefaultCFF)
1804  from Validation.Configuration.autoValidation import autoValidation
1805  #in case VALIDATION:something:somethingelse -> something,somethingelse
1806  if sequence.find(',')!=-1:
1807  prevalSeqName=sequence.split(',')[0].split('+')
1808  valSeqName=sequence.split(',')[1].split('+')
1809  self.expandMapping(prevalSeqName,autoValidation,index=0)
1810  self.expandMapping(valSeqName,autoValidation,index=1)
1811  else:
1812  if '@' in sequence:
1813  prevalSeqName=sequence.split('+')
1814  valSeqName=sequence.split('+')
1815  self.expandMapping(prevalSeqName,autoValidation,index=0)
1816  self.expandMapping(valSeqName,autoValidation,index=1)
1817  else:
1818  postfix=''
1819  if sequence:
1820  postfix='_'+sequence
1821  prevalSeqName=['prevalidation'+postfix]
1822  valSeqName=['validation'+postfix]
1823  if not hasattr(self.process,valSeqName[0]):
1824  prevalSeqName=['']
1825  valSeqName=[sequence]
1826 
1827  def NFI(index):
1828 
1829  if index==0:
1830  return ''
1831  else:
1832  return '%s'%index
1833 
1834 
1835  #rename the HLT process in validation steps
1836  if ('HLT' in self.stepMap and not self._options.fast) or self._options.hltProcess:
1837  for s in valSeqName+prevalSeqName:
1838  if s:
1839  self.renameHLTprocessInSequence(s)
1840  for (i,s) in enumerate(prevalSeqName):
1841  if s:
1842  setattr(self.process,'prevalidation_step%s'%NFI(i), cms.Path( getattr(self.process, s)) )
1843  self.schedule.append(getattr(self.process,'prevalidation_step%s'%NFI(i)))
1844 
1845  for (i,s) in enumerate(valSeqName):
1846  setattr(self.process,'validation_step%s'%NFI(i), cms.EndPath( getattr(self.process, s)))
1847  self.schedule.append(getattr(self.process,'validation_step%s'%NFI(i)))
1848 
1849  #needed in case the miniAODValidation sequence is run starting from AODSIM
1850  if 'PAT' in self.stepMap and not 'RECO' in self.stepMap:
1851  return
1852 
1853  if not 'DIGI' in self.stepMap and not self._options.fast and not any(map( lambda s : s.startswith('genvalid'), valSeqName)):
1854  if self._options.restoreRNDSeeds==False and not self._options.restoreRNDSeeds==True:
1855  self._options.restoreRNDSeeds=True
1856 
1857  if not 'DIGI' in self.stepMap and not self._options.isData and not self._options.fast:
1858  self.executeAndRemember("process.mix.playback = True")
1859  self.executeAndRemember("process.mix.digitizers = cms.PSet()")
1860  self.executeAndRemember("for a in process.aliases: delattr(process, a)")
1861  self._options.customisation_file.append("SimGeneral/MixingModule/fullMixCustomize_cff.setCrossingFrameOn")
1862 
1863  if hasattr(self.process,"genstepfilter") and len(self.process.genstepfilter.triggerConditions):
1864  #will get in the schedule, smoothly
1865  for (i,s) in enumerate(valSeqName):
1866  getattr(self.process,'validation_step%s'%NFI(i)).insert(0, self.process.genstepfilter)
1867 
1868  return
1869 
1870 
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:37
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

◆ profileOptions()

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 276 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder._options, alcaDQMUpload.encode(), createfilelist.int, and str.

Referenced by ConfigBuilder.ConfigBuilder.addCommon().

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

◆ renameHLTprocessInSequence()

def ConfigBuilder.ConfigBuilder.renameHLTprocessInSequence (   self,
  sequence,
  proc = None,
  HLTprocess = 'HLT' 
)

Definition at line 1940 of file ConfigBuilder.py.

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

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

1940  def renameHLTprocessInSequence(self,sequence,proc=None,HLTprocess='HLT'):
1941  if self._options.hltProcess:
1942  proc=self._options.hltProcess
1943  else:
1944  proc=self.process.name_()
1945  if proc==HLTprocess: return
1946  # look up all module in dqm sequence
1947  print("replacing %s process name - sequence %s will use '%s'" % (HLTprocess,sequence, proc))
1948  getattr(self.process,sequence).visit(ConfigBuilder.MassSearchReplaceProcessNameVisitor(HLTprocess,proc,whitelist = ("subSystemFolder",)))
1949  if 'from Configuration.Applications.ConfigBuilder import ConfigBuilder' not in self.additionalCommands:
1950  self.additionalCommands.append('from Configuration.Applications.ConfigBuilder import ConfigBuilder')
1951  self.additionalCommands.append('process.%s.visit(ConfigBuilder.MassSearchReplaceProcessNameVisitor("%s", "%s", whitelist = ("subSystemFolder",)))'% (sequence,HLTprocess, proc))
1952 
1953 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

◆ renameInputTagsInSequence()

def ConfigBuilder.ConfigBuilder.renameInputTagsInSequence (   self,
  sequence,
  oldT = "rawDataCollector",
  newT = "rawDataRepacker" 
)

Definition at line 1930 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_L1REPACK().

1930  def renameInputTagsInSequence(self,sequence,oldT="rawDataCollector",newT="rawDataRepacker"):
1931  print("Replacing all InputTag %s => %s"%(oldT,newT))
1932  from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceAnyInputTag
1933  massSearchReplaceAnyInputTag(getattr(self.process,sequence),oldT,newT)
1934  loadMe='from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceAnyInputTag'
1935  if not loadMe in self.additionalCommands:
1936  self.additionalCommands.append(loadMe)
1937  self.additionalCommands.append('massSearchReplaceAnyInputTag(process.%s,"%s","%s",False,True)'%(sequence,oldT,newT))
1938 
def massSearchReplaceAnyInputTag(sequence, oldInputTag, newInputTag, verbose=False, moduleLabelOnly=False, skipLabelTest=False)
Definition: MassReplace.py:79
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

◆ scheduleSequence()

def ConfigBuilder.ConfigBuilder.scheduleSequence (   self,
  seq,
  prefix,
  what = 'Path' 
)

Definition at line 1239 of file ConfigBuilder.py.

References mps_setup.append, ConfigBuilder.ConfigBuilder.conditionalPaths, ConfigBuilder.ConfigBuilder.nextScheduleIsConditional, DTT0WireWorkflow.DTT0WireWorkflow.process, DTVdriftWorkflow.DTvdriftWorkflow.process, DTTtrigWorkflow.DTttrigWorkflow.process, DTWorkflow.DTWorkflow.process, ConfigBuilder.ConfigBuilder.process, ConfigBuilder.ConfigBuilder.schedule, and ConfigBuilder.ConfigBuilder.scheduleSequenceAtEnd().

Referenced by ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), ConfigBuilder.ConfigBuilder.prepare_CFWRITER(), ConfigBuilder.ConfigBuilder.prepare_DATAMIX(), ConfigBuilder.ConfigBuilder.prepare_DIGI(), ConfigBuilder.ConfigBuilder.prepare_DIGI2RAW(), 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().

1239  def scheduleSequence(self,seq,prefix,what='Path'):
1240  if '*' in seq:
1241  #create only one path with all sequences in it
1242  for i,s in enumerate(seq.split('*')):
1243  if i==0:
1244  setattr(self.process,prefix,getattr(cms,what)( getattr(self.process, s) ))
1245  else:
1246  p=getattr(self.process,prefix)
1247  tmp = getattr(self.process, s)
1248  if isinstance(tmp, cms.Task):
1249  p.associate(tmp)
1250  else:
1251  p+=tmp
1252  self.schedule.append(getattr(self.process,prefix))
1253  return
1254  else:
1255  #create as many path as many sequences
1256  if not '+' in seq:
1257  if self.nextScheduleIsConditional:
1258  self.conditionalPaths.append(prefix)
1259  setattr(self.process,prefix,getattr(cms,what)( getattr(self.process, seq) ))
1260  self.schedule.append(getattr(self.process,prefix))
1261  else:
1262  for i,s in enumerate(seq.split('+')):
1263  sn=prefix+'%d'%(i)
1264  setattr(self.process,sn,getattr(cms,what)( getattr(self.process, s) ))
1265  self.schedule.append(getattr(self.process,sn))
1266  return
1267 

◆ scheduleSequenceAtEnd()

def ConfigBuilder.ConfigBuilder.scheduleSequenceAtEnd (   self,
  seq,
  prefix 
)

Definition at line 1268 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.prepare_ALCAPRODUCER(), and ConfigBuilder.ConfigBuilder.scheduleSequence().

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

1268  def scheduleSequenceAtEnd(self,seq,prefix):
1269  self.scheduleSequence(seq,prefix,what='EndPath')
1270  return
1271 

Member Data Documentation

◆ _options

◆ addedObjects

◆ additionalCommands

◆ additionalOutputs

ConfigBuilder.ConfigBuilder.additionalOutputs

Definition at line 268 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

◆ ALCADefaultCFF

ConfigBuilder.ConfigBuilder.ALCADefaultCFF

◆ ALCADefaultSeq

ConfigBuilder.ConfigBuilder.ALCADefaultSeq

Definition at line 990 of file ConfigBuilder.py.

◆ ALCAHARVESTDefaultCFF

ConfigBuilder.ConfigBuilder.ALCAHARVESTDefaultCFF

Definition at line 978 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_ALCAHARVEST().

◆ ALCAHARVESTDefaultSeq

ConfigBuilder.ConfigBuilder.ALCAHARVESTDefaultSeq

Definition at line 1001 of file ConfigBuilder.py.

◆ AlCaPaths

ConfigBuilder.ConfigBuilder.AlCaPaths

◆ blacklist_paths

ConfigBuilder.ConfigBuilder.blacklist_paths

◆ CFWRITERDefaultCFF

ConfigBuilder.ConfigBuilder.CFWRITERDefaultCFF

Definition at line 981 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_CFWRITER().

◆ CFWRITERDefaultSeq

ConfigBuilder.ConfigBuilder.CFWRITERDefaultSeq

Definition at line 1002 of file ConfigBuilder.py.

◆ conditionalPaths

ConfigBuilder.ConfigBuilder.conditionalPaths

◆ ConditionsDefaultCFF

ConfigBuilder.ConfigBuilder.ConditionsDefaultCFF

Definition at line 980 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addConditions().

◆ DATAMIXDefaultCFF

ConfigBuilder.ConfigBuilder.DATAMIXDefaultCFF

Definition at line 985 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_DATAMIX().

◆ DATAMIXDefaultSeq

ConfigBuilder.ConfigBuilder.DATAMIXDefaultSeq

Definition at line 995 of file ConfigBuilder.py.

◆ DIGI2RAWDefaultCFF

ConfigBuilder.ConfigBuilder.DIGI2RAWDefaultCFF

Definition at line 959 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_DIGI2RAW().

◆ DIGI2RAWDefaultSeq

ConfigBuilder.ConfigBuilder.DIGI2RAWDefaultSeq

Definition at line 996 of file ConfigBuilder.py.

◆ DIGIDefaultCFF

ConfigBuilder.ConfigBuilder.DIGIDefaultCFF

Definition at line 958 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_DIGI().

◆ DIGIDefaultSeq

ConfigBuilder.ConfigBuilder.DIGIDefaultSeq

Definition at line 994 of file ConfigBuilder.py.

◆ DQMDefaultSeq

ConfigBuilder.ConfigBuilder.DQMDefaultSeq

Definition at line 1013 of file ConfigBuilder.py.

◆ DQMOFFLINEDefaultCFF

ConfigBuilder.ConfigBuilder.DQMOFFLINEDefaultCFF

Definition at line 976 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_DQM().

◆ DQMSaverCFF

ConfigBuilder.ConfigBuilder.DQMSaverCFF

Definition at line 2018 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_HARVESTING().

◆ ENDJOBDefaultCFF

ConfigBuilder.ConfigBuilder.ENDJOBDefaultCFF

Definition at line 979 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_ENDJOB().

◆ ENDJOBDefaultSeq

ConfigBuilder.ConfigBuilder.ENDJOBDefaultSeq

Definition at line 1015 of file ConfigBuilder.py.

◆ EVTCONTDefaultCFF

ConfigBuilder.ConfigBuilder.EVTCONTDefaultCFF

◆ excludedPaths

ConfigBuilder.ConfigBuilder.excludedPaths

Definition at line 274 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

◆ GENDefaultCFF

ConfigBuilder.ConfigBuilder.GENDefaultCFF

Definition at line 956 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_GEN().

◆ GENDefaultSeq

ConfigBuilder.ConfigBuilder.GENDefaultSeq

Definition at line 992 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_GEN().

◆ GeometryCFF

ConfigBuilder.ConfigBuilder.GeometryCFF

Definition at line 1086 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addStandardSequences().

◆ geometryDBLabel

ConfigBuilder.ConfigBuilder.geometryDBLabel

Definition at line 1087 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addStandardSequences().

◆ HARVESTINGDefaultCFF

ConfigBuilder.ConfigBuilder.HARVESTINGDefaultCFF

Definition at line 977 of file ConfigBuilder.py.

◆ HARVESTINGDefaultSeq

ConfigBuilder.ConfigBuilder.HARVESTINGDefaultSeq

Definition at line 1000 of file ConfigBuilder.py.

◆ HLTDefaultCFF

ConfigBuilder.ConfigBuilder.HLTDefaultCFF

Definition at line 962 of file ConfigBuilder.py.

◆ HLTDefaultSeq

ConfigBuilder.ConfigBuilder.HLTDefaultSeq

Definition at line 997 of file ConfigBuilder.py.

◆ imports

ConfigBuilder.ConfigBuilder.imports

◆ inliner

ConfigBuilder.ConfigBuilder.inliner

load the relevant part

needs to be in reverse order

print it in the configuration

Definition at line 1644 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_FILTER().

◆ L1DefaultSeq

ConfigBuilder.ConfigBuilder.L1DefaultSeq

Definition at line 998 of file ConfigBuilder.py.

◆ L1EMDefaultCFF

ConfigBuilder.ConfigBuilder.L1EMDefaultCFF

Definition at line 960 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_L1().

◆ L1HwValDefaultCFF

ConfigBuilder.ConfigBuilder.L1HwValDefaultCFF

Definition at line 975 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_L1HwVal().

◆ L1HwValDefaultSeq

ConfigBuilder.ConfigBuilder.L1HwValDefaultSeq

Definition at line 1012 of file ConfigBuilder.py.

◆ L1MENUDefaultCFF

ConfigBuilder.ConfigBuilder.L1MENUDefaultCFF

Definition at line 961 of file ConfigBuilder.py.

◆ L1RecoDefaultCFF

ConfigBuilder.ConfigBuilder.L1RecoDefaultCFF

Definition at line 965 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_L1Reco().

◆ L1RecoDefaultSeq

ConfigBuilder.ConfigBuilder.L1RecoDefaultSeq

Definition at line 1004 of file ConfigBuilder.py.

◆ L1REPACKDefaultSeq

ConfigBuilder.ConfigBuilder.L1REPACKDefaultSeq

Definition at line 999 of file ConfigBuilder.py.

◆ L1TrackTriggerDefaultCFF

ConfigBuilder.ConfigBuilder.L1TrackTriggerDefaultCFF

◆ L1TrackTriggerDefaultSeq

ConfigBuilder.ConfigBuilder.L1TrackTriggerDefaultSeq

Definition at line 1005 of file ConfigBuilder.py.

◆ labelsToAssociate

ConfigBuilder.ConfigBuilder.labelsToAssociate

◆ LHEDefaultSeq

ConfigBuilder.ConfigBuilder.LHEDefaultSeq

Definition at line 991 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_GEN().

◆ magFieldCFF

ConfigBuilder.ConfigBuilder.magFieldCFF

Definition at line 1082 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addStandardSequences().

◆ NANODefaultCFF

ConfigBuilder.ConfigBuilder.NANODefaultCFF

Definition at line 970 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_NANO().

◆ NANODefaultSeq

ConfigBuilder.ConfigBuilder.NANODefaultSeq

Definition at line 1021 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_NANO().

◆ NANOGENDefaultCFF

ConfigBuilder.ConfigBuilder.NANOGENDefaultCFF

Definition at line 971 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_NANOGEN().

◆ NANOGENDefaultSeq

ConfigBuilder.ConfigBuilder.NANOGENDefaultSeq

Definition at line 1020 of file ConfigBuilder.py.

◆ nextScheduleIsConditional

ConfigBuilder.ConfigBuilder.nextScheduleIsConditional

put the filtering path in the schedule

Definition at line 272 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.scheduleSequence().

◆ PATDefaultCFF

ConfigBuilder.ConfigBuilder.PATDefaultCFF

Definition at line 969 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_PAT().

◆ PATDefaultSeq

ConfigBuilder.ConfigBuilder.PATDefaultSeq

Definition at line 1017 of file ConfigBuilder.py.

◆ PATGENDefaultCFF

ConfigBuilder.ConfigBuilder.PATGENDefaultCFF

Definition at line 1033 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_PATGEN().

◆ PATGENDefaultSeq

ConfigBuilder.ConfigBuilder.PATGENDefaultSeq

Definition at line 1018 of file ConfigBuilder.py.

◆ POSTRECODefaultCFF

ConfigBuilder.ConfigBuilder.POSTRECODefaultCFF

Definition at line 973 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_POSTRECO().

◆ POSTRECODefaultSeq

ConfigBuilder.ConfigBuilder.POSTRECODefaultSeq

Definition at line 1011 of file ConfigBuilder.py.

◆ process

ConfigBuilder.ConfigBuilder.process

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

Definition at line 249 of file ConfigBuilder.py.

Referenced by adaptToRunAtMiniAOD.adaptToRunAtMiniAOD.__init__(), ConfigBuilder.ConfigBuilder.addCommon(), ConfigBuilder.ConfigBuilder.addConditions(), ConfigBuilder.ConfigBuilder.addCustomise(), ConfigBuilder.ConfigBuilder.addMaxEvents(), ConfigBuilder.ConfigBuilder.addOutput(), ConfigBuilder.ConfigBuilder.addSource(), ConfigBuilder.ConfigBuilder.addStandardSequences(), ConfigBuilder.ConfigBuilder.build_production_info(), ConfigBuilder.ConfigBuilder.completeInputCommand(), adaptToRunAtMiniAOD.adaptToRunAtMiniAOD.convertModuleToMiniAODInput(), ConfigBuilder.ConfigBuilder.finalizeFastSimHLT(), ConfigBuilder.ConfigBuilder.load(), ConfigBuilder.ConfigBuilder.loadAndRemember(), runTauIdMVA.TauIDEmbedder.loadMVA_WPs_run2_2017(), ConfigBuilder.ConfigBuilder.prepare(), ConfigBuilder.ConfigBuilder.prepare_DIGI(), ConfigBuilder.ConfigBuilder.prepare_DQM(), ConfigBuilder.ConfigBuilder.prepare_GEN(), ConfigBuilder.ConfigBuilder.prepare_HLT(), ConfigBuilder.ConfigBuilder.prepare_PATFILTER(), ConfigBuilder.ConfigBuilder.prepare_SKIM(), ConfigBuilder.ConfigBuilder.prepare_VALIDATION(), runTauIdMVA.TauIDEmbedder.processDeepProducer(), ConfigBuilder.ConfigBuilder.renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder.renameInputTagsInSequence(), runTauIdMVA.TauIDEmbedder.runTauID(), ConfigBuilder.ConfigBuilder.scheduleSequence(), and runTauIdMVA.TauIDEmbedder.tauIDMVAinputs().

◆ productionFilterSequence

ConfigBuilder.ConfigBuilder.productionFilterSequence

put it before all the other paths

Definition at line 270 of file ConfigBuilder.py.

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

◆ pythonCfgCode

ConfigBuilder.ConfigBuilder.pythonCfgCode

◆ RAW2DIGIDefaultCFF

ConfigBuilder.ConfigBuilder.RAW2DIGIDefaultCFF

Definition at line 963 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_RAW2DIGI().

◆ RAW2DIGIDefaultSeq

ConfigBuilder.ConfigBuilder.RAW2DIGIDefaultSeq

Definition at line 1003 of file ConfigBuilder.py.

◆ RAW2RECODefaultSeq

ConfigBuilder.ConfigBuilder.RAW2RECODefaultSeq

Definition at line 1076 of file ConfigBuilder.py.

◆ RECOBEFMIXDefaultCFF

ConfigBuilder.ConfigBuilder.RECOBEFMIXDefaultCFF

Definition at line 1137 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_RECOBEFMIX().

◆ RECOBEFMIXDefaultSeq

ConfigBuilder.ConfigBuilder.RECOBEFMIXDefaultSeq

Definition at line 1138 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_RECOBEFMIX().

◆ RECODefaultCFF

ConfigBuilder.ConfigBuilder.RECODefaultCFF

Definition at line 967 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_RECO().

◆ RECODefaultSeq

ConfigBuilder.ConfigBuilder.RECODefaultSeq

Definition at line 1007 of file ConfigBuilder.py.

◆ RECOSIMDefaultCFF

ConfigBuilder.ConfigBuilder.RECOSIMDefaultCFF

Definition at line 968 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_RECOSIM().

◆ RECOSIMDefaultSeq

ConfigBuilder.ConfigBuilder.RECOSIMDefaultSeq

Definition at line 1010 of file ConfigBuilder.py.

◆ REDIGIDefaultSeq

ConfigBuilder.ConfigBuilder.REDIGIDefaultSeq

Definition at line 1153 of file ConfigBuilder.py.

◆ REPACKDefaultCFF

ConfigBuilder.ConfigBuilder.REPACKDefaultCFF

Definition at line 982 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_REPACK().

◆ REPACKDefaultSeq

ConfigBuilder.ConfigBuilder.REPACKDefaultSeq

Definition at line 1016 of file ConfigBuilder.py.

◆ runsAndWeights

ConfigBuilder.ConfigBuilder.runsAndWeights

drop LHEXMLStringProduct on input to save memory if appropriate

Definition at line 484 of file ConfigBuilder.py.

◆ runsAndWeightsInt

ConfigBuilder.ConfigBuilder.runsAndWeightsInt

Definition at line 505 of file ConfigBuilder.py.

◆ schedule

◆ scheduleIndexOfFirstHLTPath

ConfigBuilder.ConfigBuilder.scheduleIndexOfFirstHLTPath

◆ SIMDefaultCFF

ConfigBuilder.ConfigBuilder.SIMDefaultCFF

Definition at line 957 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_SIM().

◆ SIMDefaultSeq

ConfigBuilder.ConfigBuilder.SIMDefaultSeq

Definition at line 993 of file ConfigBuilder.py.

◆ SimGeometryCFF

ConfigBuilder.ConfigBuilder.SimGeometryCFF

Definition at line 1112 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addStandardSequences().

◆ SKIMDefaultCFF

ConfigBuilder.ConfigBuilder.SKIMDefaultCFF

Definition at line 972 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_SKIM().

◆ stepKeys

ConfigBuilder.ConfigBuilder.stepKeys

Definition at line 229 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addStandardSequences().

◆ stepMap

◆ USERDefaultCFF

ConfigBuilder.ConfigBuilder.USERDefaultCFF

Definition at line 1079 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_USER().

◆ USERDefaultSeq

ConfigBuilder.ConfigBuilder.USERDefaultSeq

Definition at line 1078 of file ConfigBuilder.py.

◆ VALIDATIONDefaultCFF

ConfigBuilder.ConfigBuilder.VALIDATIONDefaultCFF

Definition at line 974 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_VALIDATION().

◆ VALIDATIONDefaultSeq

ConfigBuilder.ConfigBuilder.VALIDATIONDefaultSeq

Definition at line 1014 of file ConfigBuilder.py.

◆ with_input

ConfigBuilder.ConfigBuilder.with_input

Definition at line 253 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

◆ with_output

ConfigBuilder.ConfigBuilder.with_output

Definition at line 248 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().