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:193
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 2095 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().

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

References ConfigBuilder.ConfigBuilder.pythonCfgCode.

Referenced by ConfigBuilder.ConfigBuilder.build_production_info().

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

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

◆ finalizeFastSimHLT()

def ConfigBuilder.ConfigBuilder.finalizeFastSimHLT (   self)

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

2090  def finalizeFastSimHLT(self):
2091  self.process.reconstruction = cms.Path(self.process.reconstructionWithFamos)
2092  self.schedule.append(self.process.reconstruction)
2093 
2094 

◆ 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 2155 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.

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

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

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

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

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

◆ prepare_DATAMIX()

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

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

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

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

◆ prepare_DIGI2RAW()

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

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

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

◆ prepare_DQM()

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

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

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

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_ALCAHARVEST().

2085  def prepare_ENDJOB(self, sequence = 'endOfProcess'):
2086  self.loadDefaultOrSpecifiedCFF(sequence,self.ENDJOBDefaultCFF)
2087  self.scheduleSequenceAtEnd(sequence.split('.')[-1],'endjob_step')
2088  return
2089 

◆ prepare_FILTER()

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

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

1631  def prepare_FILTER(self, sequence = None):
1632  ''' Enrich the schedule with a user defined filter sequence '''
1633 
1634  filterConfig=self.load(sequence.split('.')[0])
1635  filterSeq=sequence.split('.')[-1]
1636 
1637  class PrintAllModules(object):
1638  def __init__(self):
1639  self.inliner=''
1640  pass
1641  def enter(self,visitee):
1642  try:
1643  label=visitee.label()
1644 
1645  self.inliner=label+','+self.inliner
1646  except:
1647  pass
1648  def leave(self,v): pass
1649 
1650  expander=PrintAllModules()
1651  getattr(self.process,filterSeq).visit( expander )
1652  self._options.inlineObjets+=','+expander.inliner
1653  self._options.inlineObjets+=','+filterSeq
1654 
1655 
1656  self.scheduleSequence(filterSeq,'filtering_step')
1657  self.nextScheduleIsConditional=True
1658 
1659  self.productionFilterSequence = filterSeq
1660 
1661  return
1662 
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 1351 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.

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

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_DQM().

2012  def prepare_HARVESTING(self, sequence = None):
2013  """ Enrich the process with harvesting step """
2014  self.DQMSaverCFF='Configuration/StandardSequences/DQMSaver'+self._options.harvesting+'_cff'
2015  self.loadAndRemember(self.DQMSaverCFF)
2016 
2017  harvestingConfig = self.loadDefaultOrSpecifiedCFF(sequence,self.HARVESTINGDefaultCFF)
2018  sequence = sequence.split('.')[-1]
2019 
2020  # decide which HARVESTING paths to use
2021  harvestingList = sequence.split("+")
2022  from DQMOffline.Configuration.autoDQM import autoDQM
2023  from Validation.Configuration.autoValidation import autoValidation
2024  import copy
2025  combined_mapping = copy.deepcopy( autoDQM )
2026  combined_mapping.update( autoValidation )
2027  self.expandMapping(harvestingList,combined_mapping,index=-1)
2028 
2029  if len(set(harvestingList))!=len(harvestingList):
2030  harvestingList=list(set(harvestingList))
2031  print("Duplicate entries for HARVESTING, using",harvestingList)
2032 
2033  for name in harvestingList:
2034  if not name in harvestingConfig.__dict__:
2035  print(name,"is not a possible harvesting type. Available are",harvestingConfig.__dict__.keys())
2036  # trigger hard error, like for other sequence types
2037  getattr(self.process, name)
2038  continue
2039  harvestingstream = getattr(harvestingConfig,name)
2040  if isinstance(harvestingstream,cms.Path):
2041  self.schedule.append(harvestingstream)
2042  self.blacklist_paths.append(harvestingstream)
2043  if isinstance(harvestingstream,cms.Sequence):
2044  setattr(self.process,name+"_step",cms.Path(harvestingstream))
2045  self.schedule.append(getattr(self.process,name+"_step"))
2046 
2047  self.scheduleSequence('DQMSaver','dqmsave_step')
2048  return
2049 
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 1530 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().

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

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

◆ prepare_L1HwVal()

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

Definition at line 1612 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_PATFILTER().

1612  def prepare_L1HwVal(self, sequence = 'L1HwVal'):
1613  ''' Enrich the schedule with L1 HW validation '''
1614  self.loadDefaultOrSpecifiedCFF(sequence,self.L1HwValDefaultCFF)
1615  #self.scheduleSequence(sequence.split('.')[-1],'l1hwval_step')
1616  print('\n\n\n DEPRECATED this has no action \n\n\n')
1617  return
1618 
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 1619 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().

1619  def prepare_L1Reco(self, sequence = "L1Reco"):
1620  ''' Enrich the schedule with L1 reconstruction '''
1621  self.loadDefaultOrSpecifiedCFF(sequence,self.L1RecoDefaultCFF)
1622  self.scheduleSequence(sequence.split('.')[-1],'L1Reco_step')
1623  return
1624 

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

1518  def prepare_L1REPACK(self, sequence = None):
1519  """ Enrich the schedule with the L1 simulation step, running the L1 emulator on data unpacked from the RAW collection, and repacking the result in a new RAW collection"""
1520  supported = ['GT','GT1','GT2','GCTGT','Full','FullSimTP','FullMC','Full2015Data','uGT','CalouGT']
1521  if sequence in supported:
1522  self.loadAndRemember('Configuration/StandardSequences/SimL1EmulatorRepack_%s_cff'%sequence)
1523  if self._options.scenario == 'HeavyIons':
1524  self.renameInputTagsInSequence("SimL1Emulator","rawDataCollector","rawDataRepacker")
1525  self.scheduleSequence('SimL1Emulator','L1RePack_step')
1526  else:
1527  print("L1REPACK with '",sequence,"' is not supported! Supported choices are: ",supported)
1528  raise Exception('unsupported feature')
1529 
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 1625 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().

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

◆ prepare_LHE()

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

Definition at line 1334 of file ConfigBuilder.py.

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

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

◆ prepare_NANOGEN()

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

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

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

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

◆ prepare_PATFILTER()

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

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

1606  def prepare_PATFILTER(self, sequence=None):
1607  self.loadAndRemember("PhysicsTools/PatAlgos/slimming/metFilterPaths_cff")
1608  from PhysicsTools.PatAlgos.slimming.metFilterPaths_cff import allMetFilterPaths
1609  for filt in allMetFilterPaths:
1610  self.schedule.append(getattr(self.process,'Flag_'+filt))
1611 

◆ prepare_PATGEN()

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

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

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

◆ prepare_POSTRECO()

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

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

1789  def prepare_POSTRECO(self, sequence = None):
1790  """ Enrich the schedule with the postreco step """
1791  self.loadAndRemember(self.POSTRECODefaultCFF)
1792  self.scheduleSequence('postreco_generator','postreco_step')
1793  return
1794 
1795 

◆ prepare_RAW2DIGI()

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

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

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

◆ prepare_RAW2RECO()

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

Definition at line 1588 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_HLT().

1588  def prepare_RAW2RECO(self, sequence = None):
1589  if ','in sequence:
1590  seqReco=sequence.split(',')[1]
1591  seqDigi=sequence.split(',')[0]
1592  else:
1593  print("RAW2RECO requires two specifications",sequence,"insufficient")
1594 
1595  self.prepare_RAW2DIGI(seqDigi)
1596  self.prepare_RECO(seqReco)
1597  return
1598 
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 1663 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().

1663  def prepare_RECO(self, sequence = "reconstruction"):
1664  ''' Enrich the schedule with reconstruction '''
1665  self.loadDefaultOrSpecifiedCFF(sequence,self.RECODefaultCFF)
1666  self.scheduleSequence(sequence.split('.')[-1],'reconstruction_step')
1667  return
1668 

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

1675  def prepare_RECOBEFMIX(self, sequence = "reconstruction"):
1676  ''' Enrich the schedule with the part of reconstruction that is done before mixing in FastSim'''
1677  if not self._options.fast:
1678  print("ERROR: this step is only implemented for FastSim")
1679  sys.exit()
1680  self.loadDefaultOrSpecifiedCFF(self.RECOBEFMIXDefaultSeq,self.RECOBEFMIXDefaultCFF)
1681  self.scheduleSequence(sequence.split('.')[-1],'reconstruction_befmix_step')
1682  return
1683 
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 1669 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().

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

◆ prepare_REPACK()

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

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

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

◆ prepare_SIM()

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

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

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

◆ prepare_SKIM()

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

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

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

1783  def prepare_USER(self, sequence = None):
1784  ''' Enrich the schedule with a user defined sequence '''
1785  self.loadDefaultOrSpecifiedCFF(sequence,self.USERDefaultCFF)
1786  self.scheduleSequence(sequence.split('.')[-1],'user_step')
1787  return
1788 

◆ prepare_VALIDATION()

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

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

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

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

1926  def renameInputTagsInSequence(self,sequence,oldT="rawDataCollector",newT="rawDataRepacker"):
1927  print("Replacing all InputTag %s => %s"%(oldT,newT))
1928  from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceAnyInputTag
1929  massSearchReplaceAnyInputTag(getattr(self.process,sequence),oldT,newT)
1930  loadMe='from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceAnyInputTag'
1931  if not loadMe in self.additionalCommands:
1932  self.additionalCommands.append(loadMe)
1933  self.additionalCommands.append('massSearchReplaceAnyInputTag(process.%s,"%s","%s",False,True)'%(sequence,oldT,newT))
1934 
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 2014 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 1639 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().