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, sequence, defaultCFF)
 
def prepare (self, doChecking=False)
 
def prepare_ALCA (self, sequence=None, workflow='full')
 
def prepare_ALCAHARVEST (self, sequence=None)
 
def prepare_ALCAOUTPUT (self, sequence=None)
 
def prepare_ALCAPRODUCER (self, sequence=None)
 
def prepare_CFWRITER (self, sequence=None)
 
def prepare_DATAMIX (self, sequence=None)
 
def prepare_DIGI (self, sequence=None)
 
def prepare_DIGI2RAW (self, sequence=None)
 
def prepare_DQM (self, sequence='DQMOffline')
 
def prepare_ENDJOB (self, sequence='endOfProcess')
 
def prepare_FILTER (self, sequence=None)
 
def prepare_GEN (self, sequence=None)
 
def prepare_HARVESTING (self, sequence=None)
 
def prepare_HLT (self, sequence=None)
 
def prepare_L1 (self, sequence=None)
 
def prepare_L1HwVal (self, sequence='L1HwVal')
 
def prepare_L1Reco (self, sequence="L1Reco")
 
def prepare_L1REPACK (self, sequence=None)
 
def prepare_L1TrackTrigger (self, sequence="L1TrackTrigger")
 
def prepare_LHE (self, sequence=None)
 
def prepare_NANO (self, sequence="nanoAOD")
 
def prepare_NANOGEN (self, sequence="nanoAOD")
 
def prepare_PAT (self, sequence="miniAOD")
 
def prepare_PATFILTER (self, sequence=None)
 
def prepare_PATGEN (self, sequence="miniGEN")
 
def prepare_POSTRECO (self, sequence=None)
 
def prepare_RAW2DIGI (self, sequence="RawToDigi")
 
def prepare_RAW2RECO (self, sequence=None)
 
def prepare_RECO (self, sequence="reconstruction")
 
def prepare_RECOBEFMIX (self, sequence="reconstruction")
 
def prepare_RECOSIM (self, sequence="recosim")
 
def prepare_REPACK (self, sequence=None)
 
def prepare_SIM (self, sequence=None)
 
def prepare_SKIM (self, sequence="all")
 
def prepare_USER (self, sequence=None)
 
def prepare_VALIDATION (self, sequence='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 "+stepName+" unknown")
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("Step definition "+step+" invalid")
244  self.stepKeys.append(stepName)
245 
246  #print "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)(sequence = getattr(self,stepName+"DefaultSeq"))
789  elif isinstance(stepSpec, list):
790  getattr(self,"prepare_"+stepName)(sequence = '+'.join(stepSpec))
791  elif isinstance(stepSpec, tuple):
792  getattr(self,"prepare_"+stepName)(sequence = ','.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:191
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 2100 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().

2100  def build_production_info(self, evt_type, evtnumber):
2101  """ Add useful info for the production. """
2102  self.process.configurationMetadata=cms.untracked.PSet\
2103  (version=cms.untracked.string("$Revision: 1.19 $"),
2104  name=cms.untracked.string("Applications"),
2105  annotation=cms.untracked.string(evt_type+ " nevts:"+str(evtnumber))
2106  )
2107 
2108  self.addedObjects.append(("Production Info","configurationMetadata"))
2109 
2110 
#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 2111 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.pythonCfgCode.

Referenced by ConfigBuilder.ConfigBuilder.build_production_info().

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

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

◆ finalizeFastSimHLT()

def ConfigBuilder.ConfigBuilder.finalizeFastSimHLT (   self)

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

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

◆ 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,
  sequence,
  defaultCFF 
)

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, sequence,defaultCFF):
1222  if ( len(sequence.split('.'))==1 ):
1223  l=self.loadAndRemember(defaultCFF)
1224  elif ( len(sequence.split('.'))==2 ):
1225  l=self.loadAndRemember(sequence.split('.')[0])
1226  sequence=sequence.split('.')[1]
1227  else:
1228  print("sub sequence configuration must be of the form dir/subdir/cff.a+b+c or cff.a")
1229  print(sequence,"not recognized")
1230  raise
1231  return l
1232 
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 2160 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.

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

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

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

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

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

Definition at line 1269 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.prepare_ALCA().

Referenced by ConfigBuilder.ConfigBuilder.prepare_ALCAPRODUCER().

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

◆ prepare_ALCAPRODUCER()

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

Definition at line 1266 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.scheduleSequenceAtEnd().

1266  def prepare_ALCAPRODUCER(self, sequence = None):
1267  self.prepare_ALCA(sequence, workflow = "producers")
1268 

◆ prepare_CFWRITER()

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

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

1482  def prepare_CFWRITER(self, sequence = None):
1483  """ Enrich the schedule with the crossing frame writer step"""
1484  self.loadAndRemember(self.CFWRITERDefaultCFF)
1485  self.scheduleSequence('pcfw','cfwriter_step')
1486  return
1487 

◆ prepare_DATAMIX()

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

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

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

◆ prepare_DIGI()

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

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

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

◆ prepare_DIGI2RAW()

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

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

1506  def prepare_DIGI2RAW(self, sequence = None):
1507  self.loadDefaultOrSpecifiedCFF(sequence,self.DIGI2RAWDefaultCFF)
1508  self.scheduleSequence(sequence.split('.')[-1],'digi2raw_step')
1509  return
1510 

◆ prepare_DQM()

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

Definition at line 1974 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, submitPVValidationJobs.split(), and ConfigBuilder.ConfigBuilder.stepMap.

Referenced by ConfigBuilder.ConfigBuilder.expandMapping().

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

Definition at line 2090 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_ALCAHARVEST().

2090  def prepare_ENDJOB(self, sequence = 'endOfProcess'):
2091  self.loadDefaultOrSpecifiedCFF(sequence,self.ENDJOBDefaultCFF)
2092  self.scheduleSequenceAtEnd(sequence.split('.')[-1],'endjob_step')
2093  return
2094 

◆ prepare_FILTER()

def ConfigBuilder.ConfigBuilder.prepare_FILTER (   self,
  sequence = 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, sequence = None):
1637  ''' Enrich the schedule with a user defined filter sequence '''
1638 
1639  filterConfig=self.load(sequence.split('.')[0])
1640  filterSeq=sequence.split('.')[-1]
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,
  sequence = None 
)
load the fragment of generator configuration 

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

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

Definition at line 2017 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_DQM().

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

◆ prepare_HLT()

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

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

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

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

1516  def prepare_L1(self, sequence = None):
1517  """ Enrich the schedule with the L1 simulation step"""
1518  assert(sequence == None)
1519  self.loadAndRemember(self.L1EMDefaultCFF)
1520  self.scheduleSequence('SimL1Emulator','L1simulation_step')
1521  return
1522 
assert(be >=bs)

◆ prepare_L1HwVal()

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

Definition at line 1617 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_PATFILTER().

1617  def prepare_L1HwVal(self, sequence = 'L1HwVal'):
1618  ''' Enrich the schedule with L1 HW validation '''
1619  self.loadDefaultOrSpecifiedCFF(sequence,self.L1HwValDefaultCFF)
1620  #self.scheduleSequence(sequence.split('.')[-1],'l1hwval_step')
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,
  sequence = "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, sequence = "L1Reco"):
1625  ''' Enrich the schedule with L1 reconstruction '''
1626  self.loadDefaultOrSpecifiedCFF(sequence,self.L1RecoDefaultCFF)
1627  self.scheduleSequence(sequence.split('.')[-1],'L1Reco_step')
1628  return
1629 

◆ prepare_L1REPACK()

def ConfigBuilder.ConfigBuilder.prepare_L1REPACK (   self,
  sequence = None 
)
Enrich the schedule with the L1 simulation step, running the L1 emulator on data unpacked from the RAW collection, and repacking the result in a new RAW collection

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

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

◆ prepare_L1TrackTrigger()

def ConfigBuilder.ConfigBuilder.prepare_L1TrackTrigger (   self,
  sequence = "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, sequence = "L1TrackTrigger"):
1631  ''' Enrich the schedule with L1 reconstruction '''
1632  self.loadDefaultOrSpecifiedCFF(sequence,self.L1TrackTriggerDefaultCFF)
1633  self.scheduleSequence(sequence.split('.')[-1],'L1TrackTrigger_step')
1634  return
1635 

◆ prepare_LHE()

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

Definition at line 1339 of file ConfigBuilder.py.

1339  def prepare_LHE(self, sequence = None):
1340  #load the fragment
1341 
1342  loadFragment = self._options.evt_type.replace('.py','',).replace('.','_').replace('python/','').replace('/','.')
1343  print("Loading lhe fragment from",loadFragment)
1344  __import__(loadFragment)
1345  self.process.load(loadFragment)
1346 
1347  self._options.inlineObjets+=','+sequence
1348 
1349  getattr(self.process,sequence).nEvents = int(self._options.number)
1350 
1351  #schedule it
1352  self.process.lhe_step = cms.Path( getattr( self.process,sequence) )
1353  self.excludedPaths.append("lhe_step")
1354  self.schedule.append( self.process.lhe_step )
1355 
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,
  sequence = "nanoAOD" 
)
Enrich the schedule with NANO 

Definition at line 1721 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_PATGEN().

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

◆ prepare_NANOGEN()

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

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

1732  def prepare_NANOGEN(self, sequence = "nanoAOD"):
1733  ''' Enrich the schedule with NANOGEN '''
1734  # TODO: Need to modify this based on the input file type
1735  fromGen = any([x in self.stepMap for x in ['LHE', 'GEN', 'AOD']])
1736  self.loadDefaultOrSpecifiedCFF(sequence,self.NANOGENDefaultCFF)
1737  self.scheduleSequence(sequence.split('.')[-1],'nanoAOD_step')
1738  custom = "customizeNanoGEN" if fromGen else "customizeNanoGENFromMini"
1739  if self._options.runUnscheduled:
1740  self._options.customisation_file_unsch.insert(0, '.'.join([self.NANOGENDefaultCFF, custom]))
1741  else:
1742  self._options.customisation_file.insert(0, '.'.join([self.NANOGENDefaultCFF, custom]))
1743 
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,
  sequence = "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, sequence = "miniAOD"):
1690  ''' Enrich the schedule with PAT '''
1691  self.prepare_PATFILTER(self)
1692  self.loadDefaultOrSpecifiedCFF(sequence,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,
  sequence = None 
)

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

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

◆ prepare_PATGEN()

def ConfigBuilder.ConfigBuilder.prepare_PATGEN (   self,
  sequence = "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, sequence = "miniGEN"):
1714  ''' Enrich the schedule with PATGEN '''
1715  self.loadDefaultOrSpecifiedCFF(sequence,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,
  sequence = 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, sequence = 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,
  sequence = "RawToDigi" 
)

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

1604  def prepare_RAW2DIGI(self, sequence = "RawToDigi"):
1605  self.loadDefaultOrSpecifiedCFF(sequence,self.RAW2DIGIDefaultCFF)
1606  self.scheduleSequence(sequence,'raw2digi_step')
1607  # if self._options.isRepacked:
1608  #self.renameInputTagsInSequence(sequence)
1609  return
1610 

◆ prepare_RAW2RECO()

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

Definition at line 1593 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_HLT().

1593  def prepare_RAW2RECO(self, sequence = None):
1594  if ','in sequence:
1595  seqReco=sequence.split(',')[1]
1596  seqDigi=sequence.split(',')[0]
1597  else:
1598  print("RAW2RECO requires two specifications",sequence,"insufficient")
1599 
1600  self.prepare_RAW2DIGI(seqDigi)
1601  self.prepare_RECO(seqReco)
1602  return
1603 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

◆ prepare_RECO()

def ConfigBuilder.ConfigBuilder.prepare_RECO (   self,
  sequence = "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, sequence = "reconstruction"):
1669  ''' Enrich the schedule with reconstruction '''
1670  self.loadDefaultOrSpecifiedCFF(sequence,self.RECODefaultCFF)
1671  self.scheduleSequence(sequence.split('.')[-1],'reconstruction_step')
1672  return
1673 

◆ prepare_RECOBEFMIX()

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

Definition at line 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, sequence = "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  self.loadDefaultOrSpecifiedCFF(self.RECOBEFMIXDefaultSeq,self.RECOBEFMIXDefaultCFF)
1686  self.scheduleSequence(sequence.split('.')[-1],'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,
  sequence = "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, sequence = "recosim"):
1675  ''' Enrich the schedule with reconstruction '''
1676  self.loadDefaultOrSpecifiedCFF(sequence,self.RECOSIMDefaultCFF)
1677  self.scheduleSequence(sequence.split('.')[-1],'recosim_step')
1678  return
1679 

◆ prepare_REPACK()

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

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

1511  def prepare_REPACK(self, sequence = None):
1512  self.loadDefaultOrSpecifiedCFF(sequence,self.REPACKDefaultCFF)
1513  self.scheduleSequence(sequence.split('.')[-1],'digi2repack_step')
1514  return
1515 

◆ prepare_SIM()

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

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

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

◆ prepare_SKIM()

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

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

1744  def prepare_SKIM(self, sequence = "all"):
1745  ''' Enrich the schedule with skimming fragments'''
1746  skimConfig = self.loadDefaultOrSpecifiedCFF(sequence,self.SKIMDefaultCFF)
1747  sequence = sequence.split('.')[-1]
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,
  sequence = 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, sequence = None):
1789  ''' Enrich the schedule with a user defined sequence '''
1790  self.loadDefaultOrSpecifiedCFF(sequence,self.USERDefaultCFF)
1791  self.scheduleSequence(sequence.split('.')[-1],'user_step')
1792  return
1793 

◆ prepare_VALIDATION()

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

1941  def renameHLTprocessInSequence(self,sequence,proc=None,HLTprocess='HLT'):
1942  if self._options.hltProcess:
1943  proc=self._options.hltProcess
1944  else:
1945  proc=self.process.name_()
1946  if proc==HLTprocess: return
1947  # look up all module in dqm sequence
1948  print("replacing %s process name - sequence %s will use '%s'" % (HLTprocess,sequence, proc))
1949  getattr(self.process,sequence).visit(ConfigBuilder.MassSearchReplaceProcessNameVisitor(HLTprocess,proc,whitelist = ("subSystemFolder",)))
1950  if 'from Configuration.Applications.ConfigBuilder import ConfigBuilder' not in self.additionalCommands:
1951  self.additionalCommands.append('from Configuration.Applications.ConfigBuilder import ConfigBuilder')
1952  self.additionalCommands.append('process.%s.visit(ConfigBuilder.MassSearchReplaceProcessNameVisitor("%s", "%s", whitelist = ("subSystemFolder",)))'% (sequence,HLTprocess, proc))
1953 
1954 
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 1931 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().

1931  def renameInputTagsInSequence(self,sequence,oldT="rawDataCollector",newT="rawDataRepacker"):
1932  print("Replacing all InputTag %s => %s"%(oldT,newT))
1933  from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceAnyInputTag
1934  massSearchReplaceAnyInputTag(getattr(self.process,sequence),oldT,newT)
1935  loadMe='from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceAnyInputTag'
1936  if not loadMe in self.additionalCommands:
1937  self.additionalCommands.append(loadMe)
1938  self.additionalCommands.append('massSearchReplaceAnyInputTag(process.%s,"%s","%s",False,True)'%(sequence,oldT,newT))
1939 
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 1233 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().

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

◆ scheduleSequenceAtEnd()

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

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

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

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 2019 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.

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