CMS 3D CMS Logo

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

Classes

class  MassSearchReplaceProcessNameVisitor
 

Public Member Functions

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

Public Attributes

 addedObjects
 
 additionalCommands
 
 additionalOutputs
 
 ALCADefaultCFF
 
 ALCADefaultSeq
 
 ALCAHARVESTDefaultCFF
 
 ALCAHARVESTDefaultSeq
 
 AlCaPaths
 
 blacklist_paths
 
 CFWRITERDefaultCFF
 
 CFWRITERDefaultSeq
 
 conditionalPaths
 
 ConditionsDefaultCFF
 
 DATAMIXDefaultCFF
 
 DATAMIXDefaultSeq
 
 DIGI2RAWDefaultCFF
 
 DIGI2RAWDefaultSeq
 
 DIGIDefaultCFF
 
 DIGIDefaultSeq
 
 DQMDefaultSeq
 
 DQMOFFLINEDefaultCFF
 
 DQMSaverCFF
 
 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

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

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

Member Function Documentation

def ConfigBuilder.ConfigBuilder.addCommon (   self)

Definition at line 343 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.profileOptions().

Referenced by ConfigBuilder.ConfigBuilder.prepare().

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

Definition at line 839 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare().

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

Definition at line 854 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare().

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

Definition at line 927 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.executeAndRemember().

Referenced by ConfigBuilder.ConfigBuilder.prepare().

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

Definition at line 1156 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_SKIM().

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

Definition at line 371 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

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

Definition at line 530 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare().

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

Definition at line 378 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare().

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

Definition at line 712 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare().

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

Definition at line 2095 of file ConfigBuilder.py.

References str.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

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

Definition at line 809 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare().

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

Definition at line 2106 of file ConfigBuilder.py.

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

Definition at line 942 of file ConfigBuilder.py.

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

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

Definition at line 334 of file ConfigBuilder.py.

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

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

Definition at line 1950 of file ConfigBuilder.py.

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

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

Definition at line 2090 of file ConfigBuilder.py.

2091  def finalizeFastSimHLT(self):
2092  self.process.reconstruction = cms.Path(self.process.reconstructionWithFamos)
2093  self.schedule.append(self.process.reconstruction)
2094 
def ConfigBuilder.ConfigBuilder.load (   self,
  includeFile 
)

Definition at line 320 of file ConfigBuilder.py.

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

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

Definition at line 325 of file ConfigBuilder.py.

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

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

Definition at line 1221 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_ALCA(), ConfigBuilder.ConfigBuilder.prepare_DIGI(), ConfigBuilder.ConfigBuilder.prepare_DIGI2RAW(), ConfigBuilder.ConfigBuilder.prepare_DQM(), ConfigBuilder.ConfigBuilder.prepare_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().

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

Definition at line 2155 of file ConfigBuilder.py.

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

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

Definition at line 1272 of file ConfigBuilder.py.

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

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

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

Definition at line 2050 of file ConfigBuilder.py.

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

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

Definition at line 1269 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.prepare_ALCA().

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

Definition at line 1266 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.prepare_ALCA().

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

Definition at line 1477 of file ConfigBuilder.py.

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

1478  def prepare_CFWRITER(self, sequence = None):
1479  """ Enrich the schedule with the crossing frame writer step"""
1481  self.scheduleSequence('pcfw','cfwriter_step')
1482  return
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.DATAMIXDefaultCFF, ConfigBuilder.ConfigBuilder.executeAndRemember(), ConfigBuilder.filesFromDASQuery(), ConfigBuilder.filesFromList(), ConfigBuilder.ConfigBuilder.loadAndRemember(), and ConfigBuilder.ConfigBuilder.scheduleSequence().

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

1458  def prepare_DIGI(self, sequence = None):
1459  """ Enrich the schedule with the digitisation step"""
1460  self.loadDefaultOrSpecifiedCFF(sequence,self.DIGIDefaultCFF)
1461 
1462  if self._options.gflash==True:
1463  self.loadAndRemember("Configuration/StandardSequences/GFlashDIGI_cff")
1464 
1465  if sequence == 'pdigi_valid' or sequence == 'pdigi_hi':
1466  self.executeAndRemember("process.mix.digitizers = cms.PSet(process.theDigitizersValid)")
1467 
1468  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":
1469  if self._options.inputEventContent=='':
1470  self._options.inputEventContent='REGEN'
1471  else:
1472  self._options.inputEventContent=self._options.inputEventContent+',REGEN'
1473 
1474 
1475  self.scheduleSequence(sequence.split('.')[-1],'digitisation_step')
1476  return
def ConfigBuilder.ConfigBuilder.prepare_DIGI2RAW (   self,
  sequence = None 
)

Definition at line 1501 of file ConfigBuilder.py.

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

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

Definition at line 1969 of file ConfigBuilder.py.

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

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

Definition at line 2085 of file ConfigBuilder.py.

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

2086  def prepare_ENDJOB(self, sequence = 'endOfProcess'):
2087  self.loadDefaultOrSpecifiedCFF(sequence,self.ENDJOBDefaultCFF)
2088  self.scheduleSequenceAtEnd(sequence.split('.')[-1],'endjob_step')
2089  return
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__(), VisualizationOptions.load(), BTagCalibrationReader::BTagCalibrationReaderImpl.load(), BTagCalibrationReader.load(), CSCL1TPLookupTableEP.load(), cond::persistency::GTEditor.load(), L1MuDTPtaLut.load(), L1MuDTPhiLut.load(), cond::persistency::IOVEditor.load(), L1MuDTEtaPatternLut.load(), L1MuDTQualPatternLut.load(), PiecewiseScalingPolynomial.load(), L1MuDTExtLut.load(), HBHENegativeEFilter.load(), HBHEChannelGroups.load(), cond::persistency::RunInfoProxy.load(), HcalIndexLookup.load(), cond::persistency::GTProxy.load(), cond::persistency::IOVProxy.load(), OOTPileupCorrData.load(), TrackerMap.load(), ConfigBuilder.ConfigBuilder.load(), and tkal_create_file_lists._DasCache.load().

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

Definition at line 1351 of file ConfigBuilder.py.

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

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

Definition at line 2012 of file ConfigBuilder.py.

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

Definition at line 1530 of file ConfigBuilder.py.

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

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

Definition at line 1511 of file ConfigBuilder.py.

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

1512  def prepare_L1(self, sequence = None):
1513  """ Enrich the schedule with the L1 simulation step"""
1514  assert(sequence == None)
1515  self.loadAndRemember(self.L1EMDefaultCFF)
1516  self.scheduleSequence('SimL1Emulator','L1simulation_step')
1517  return
assert(be >=bs)
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(), and print().

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

Definition at line 1619 of file ConfigBuilder.py.

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

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

Definition at line 1518 of file ConfigBuilder.py.

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

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

Definition at line 1625 of file ConfigBuilder.py.

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

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

Definition at line 1334 of file ConfigBuilder.py.

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

Definition at line 1716 of file ConfigBuilder.py.

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

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

Definition at line 1727 of file ConfigBuilder.py.

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

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

Definition at line 1684 of file ConfigBuilder.py.

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

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

Definition at line 1606 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_PAT().

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

Definition at line 1708 of file ConfigBuilder.py.

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

1709  def prepare_PATGEN(self, sequence = "miniGEN"):
1710  ''' Enrich the schedule with PATGEN '''
1711  self.loadDefaultOrSpecifiedCFF(sequence,self.PATGENDefaultCFF) #this is unscheduled
1712  self.labelsToAssociate.append('patGENTask')
1713  if self._options.isData:
1714  raise Exception("PATGEN step can only run on MC")
1715  return
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, and ConfigBuilder.ConfigBuilder.scheduleSequence().

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

Definition at line 1599 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_RAW2RECO().

1600  def prepare_RAW2DIGI(self, sequence = "RawToDigi"):
1601  self.loadDefaultOrSpecifiedCFF(sequence,self.RAW2DIGIDefaultCFF)
1602  self.scheduleSequence(sequence,'raw2digi_step')
1603  # if self._options.isRepacked:
1604  #self.renameInputTagsInSequence(sequence)
1605  return
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().

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

Definition at line 1663 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_RAW2RECO().

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

Definition at line 1675 of file ConfigBuilder.py.

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

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

Definition at line 1669 of file ConfigBuilder.py.

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

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

Definition at line 1506 of file ConfigBuilder.py.

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

1507  def prepare_REPACK(self, sequence = None):
1508  self.loadDefaultOrSpecifiedCFF(sequence,self.REPACKDefaultCFF)
1509  self.scheduleSequence(sequence.split('.')[-1],'digi2repack_step')
1510  return
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.executeAndRemember(), ConfigBuilder.ConfigBuilder.loadAndRemember(), ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), ConfigBuilder.ConfigBuilder.scheduleSequence(), and ConfigBuilder.ConfigBuilder.SIMDefaultCFF.

1442  def prepare_SIM(self, sequence = None):
1443  """ Enrich the schedule with the simulation step"""
1444  self.loadDefaultOrSpecifiedCFF(sequence,self.SIMDefaultCFF)
1445  if not self._options.fast:
1446  if self._options.gflash==True:
1447  self.loadAndRemember("Configuration/StandardSequences/GFlashSIM_cff")
1448 
1449  if self._options.magField=='0T':
1450  self.executeAndRemember("process.g4SimHits.UseMagneticField = cms.bool(False)")
1451  else:
1452  if self._options.magField=='0T':
1453  self.executeAndRemember("process.fastSimProducer.detectorDefinition.magneticFieldZ = cms.untracked.double(0.)")
1454 
1455  self.scheduleSequence(sequence.split('.')[-1],'simulation_step')
1456  return
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.addExtraStream(), ConfigBuilder.ConfigBuilder.EVTCONTDefaultCFF, ConfigBuilder.ConfigBuilder.expandMapping(), join(), ConfigBuilder.ConfigBuilder.loadDefaultOrSpecifiedCFF(), print(), sistrip::SpyUtilities.range(), and ConfigBuilder.ConfigBuilder.SKIMDefaultCFF.

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

Definition at line 1783 of file ConfigBuilder.py.

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

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

Definition at line 1796 of file ConfigBuilder.py.

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

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

Definition at line 276 of file ConfigBuilder.py.

References alcaDQMUpload.encode(), and str.

Referenced by ConfigBuilder.ConfigBuilder.addCommon().

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

Definition at line 1936 of file ConfigBuilder.py.

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

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

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

Definition at line 1926 of file ConfigBuilder.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare_L1REPACK().

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

Definition at line 1233 of file ConfigBuilder.py.

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

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

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

Definition at line 1262 of file ConfigBuilder.py.

References ConfigBuilder.ConfigBuilder.scheduleSequence().

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

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

Member Data Documentation

ConfigBuilder.ConfigBuilder._options
private

Definition at line 206 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addSource().

ConfigBuilder.ConfigBuilder.addedObjects

Definition at line 267 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

ConfigBuilder.ConfigBuilder.additionalCommands

Definition at line 264 of file ConfigBuilder.py.

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

ConfigBuilder.ConfigBuilder.additionalOutputs

Definition at line 268 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

ConfigBuilder.ConfigBuilder.ALCADefaultCFF

Definition at line 955 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_ALCA().

ConfigBuilder.ConfigBuilder.ALCADefaultSeq

Definition at line 990 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.ALCAHARVESTDefaultCFF

Definition at line 978 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_ALCAHARVEST().

ConfigBuilder.ConfigBuilder.ALCAHARVESTDefaultSeq

Definition at line 1001 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.AlCaPaths

Definition at line 1283 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addOutput().

ConfigBuilder.ConfigBuilder.blacklist_paths

Definition at line 266 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

ConfigBuilder.ConfigBuilder.CFWRITERDefaultCFF

Definition at line 981 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_CFWRITER().

ConfigBuilder.ConfigBuilder.CFWRITERDefaultSeq

Definition at line 1002 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.conditionalPaths

Definition at line 273 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

ConfigBuilder.ConfigBuilder.ConditionsDefaultCFF

Definition at line 980 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addConditions().

ConfigBuilder.ConfigBuilder.DATAMIXDefaultCFF

Definition at line 985 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_DATAMIX().

ConfigBuilder.ConfigBuilder.DATAMIXDefaultSeq

Definition at line 995 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.DIGI2RAWDefaultCFF

Definition at line 959 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_DIGI2RAW().

ConfigBuilder.ConfigBuilder.DIGI2RAWDefaultSeq

Definition at line 996 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.DIGIDefaultCFF

Definition at line 958 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_DIGI().

ConfigBuilder.ConfigBuilder.DIGIDefaultSeq

Definition at line 994 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.DQMDefaultSeq

Definition at line 1013 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.DQMOFFLINEDefaultCFF

Definition at line 976 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_DQM().

ConfigBuilder.ConfigBuilder.DQMSaverCFF

Definition at line 2014 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.ENDJOBDefaultCFF

Definition at line 979 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_ENDJOB().

ConfigBuilder.ConfigBuilder.ENDJOBDefaultSeq

Definition at line 1015 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.EVTCONTDefaultCFF

Definition at line 1023 of file ConfigBuilder.py.

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

ConfigBuilder.ConfigBuilder.excludedPaths

Definition at line 274 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

ConfigBuilder.ConfigBuilder.GENDefaultCFF

Definition at line 956 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_GEN().

ConfigBuilder.ConfigBuilder.GENDefaultSeq

Definition at line 992 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_GEN().

ConfigBuilder.ConfigBuilder.GeometryCFF

Definition at line 1086 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addStandardSequences().

ConfigBuilder.ConfigBuilder.geometryDBLabel

Definition at line 1087 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addStandardSequences().

ConfigBuilder.ConfigBuilder.HARVESTINGDefaultCFF

Definition at line 977 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.HARVESTINGDefaultSeq

Definition at line 1000 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.HLTDefaultCFF

Definition at line 962 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.HLTDefaultSeq

Definition at line 997 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.imports

Definition at line 254 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

ConfigBuilder.ConfigBuilder.inliner

load the relevant part

needs to be in reverse order

print it in the configuration

Definition at line 1639 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.L1DefaultSeq

Definition at line 998 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.L1EMDefaultCFF

Definition at line 960 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_L1().

ConfigBuilder.ConfigBuilder.L1HwValDefaultCFF

Definition at line 975 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_L1HwVal().

ConfigBuilder.ConfigBuilder.L1HwValDefaultSeq

Definition at line 1012 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.L1MENUDefaultCFF

Definition at line 961 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.L1RecoDefaultCFF

Definition at line 965 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_L1Reco().

ConfigBuilder.ConfigBuilder.L1RecoDefaultSeq

Definition at line 1004 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.L1REPACKDefaultSeq

Definition at line 999 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.L1TrackTriggerDefaultCFF

Definition at line 966 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_L1TrackTrigger().

ConfigBuilder.ConfigBuilder.L1TrackTriggerDefaultSeq

Definition at line 1005 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.labelsToAssociate

Definition at line 271 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

ConfigBuilder.ConfigBuilder.LHEDefaultSeq

Definition at line 991 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_GEN().

ConfigBuilder.ConfigBuilder.magFieldCFF

Definition at line 1082 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addStandardSequences().

ConfigBuilder.ConfigBuilder.NANODefaultCFF

Definition at line 970 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_NANO().

ConfigBuilder.ConfigBuilder.NANODefaultSeq

Definition at line 1021 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.NANOGENDefaultCFF

Definition at line 971 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_NANOGEN().

ConfigBuilder.ConfigBuilder.NANOGENDefaultSeq

Definition at line 1020 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.nextScheduleIsConditional

put the filtering path in the schedule

Definition at line 272 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.scheduleSequence().

ConfigBuilder.ConfigBuilder.PATDefaultCFF

Definition at line 969 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_PAT().

ConfigBuilder.ConfigBuilder.PATDefaultSeq

Definition at line 1017 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.PATGENDefaultCFF

Definition at line 1033 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_PATGEN().

ConfigBuilder.ConfigBuilder.PATGENDefaultSeq

Definition at line 1018 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.POSTRECODefaultCFF

Definition at line 973 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_POSTRECO().

ConfigBuilder.ConfigBuilder.POSTRECODefaultSeq

Definition at line 1011 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.process

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

Definition at line 249 of file ConfigBuilder.py.

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

ConfigBuilder.ConfigBuilder.productionFilterSequence

put it before all the other paths

Definition at line 270 of file ConfigBuilder.py.

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

ConfigBuilder.ConfigBuilder.pythonCfgCode

Definition at line 2107 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

ConfigBuilder.ConfigBuilder.RAW2DIGIDefaultCFF

Definition at line 963 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_RAW2DIGI().

ConfigBuilder.ConfigBuilder.RAW2DIGIDefaultSeq

Definition at line 1003 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.RAW2RECODefaultSeq

Definition at line 1076 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.RECOBEFMIXDefaultCFF

Definition at line 1137 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_RECOBEFMIX().

ConfigBuilder.ConfigBuilder.RECOBEFMIXDefaultSeq

Definition at line 1138 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_RECOBEFMIX().

ConfigBuilder.ConfigBuilder.RECODefaultCFF

Definition at line 967 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_RECO().

ConfigBuilder.ConfigBuilder.RECODefaultSeq

Definition at line 1007 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.RECOSIMDefaultCFF

Definition at line 968 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_RECOSIM().

ConfigBuilder.ConfigBuilder.RECOSIMDefaultSeq

Definition at line 1010 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.REDIGIDefaultSeq

Definition at line 1153 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.REPACKDefaultCFF

Definition at line 982 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_REPACK().

ConfigBuilder.ConfigBuilder.REPACKDefaultSeq

Definition at line 1016 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.runsAndWeights

drop LHEXMLStringProduct on input to save memory if appropriate

Definition at line 484 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.runsAndWeightsInt

Definition at line 505 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.schedule

Definition at line 257 of file ConfigBuilder.py.

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

ConfigBuilder.ConfigBuilder.scheduleIndexOfFirstHLTPath

Definition at line 258 of file ConfigBuilder.py.

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

ConfigBuilder.ConfigBuilder.SIMDefaultCFF

Definition at line 957 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_SIM().

ConfigBuilder.ConfigBuilder.SIMDefaultSeq

Definition at line 993 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.SimGeometryCFF

Definition at line 1112 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addStandardSequences().

ConfigBuilder.ConfigBuilder.SKIMDefaultCFF

Definition at line 972 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_SKIM().

ConfigBuilder.ConfigBuilder.stepKeys

Definition at line 229 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.addStandardSequences().

ConfigBuilder.ConfigBuilder.stepMap

Definition at line 228 of file ConfigBuilder.py.

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

ConfigBuilder.ConfigBuilder.USERDefaultCFF

Definition at line 1079 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_USER().

ConfigBuilder.ConfigBuilder.USERDefaultSeq

Definition at line 1078 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.VALIDATIONDefaultCFF

Definition at line 974 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare_VALIDATION().

ConfigBuilder.ConfigBuilder.VALIDATIONDefaultSeq

Definition at line 1014 of file ConfigBuilder.py.

ConfigBuilder.ConfigBuilder.with_input

Definition at line 253 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

ConfigBuilder.ConfigBuilder.with_output

Definition at line 248 of file ConfigBuilder.py.

Referenced by ConfigBuilder.ConfigBuilder.prepare().