CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions | Variables
CustomConfigs Namespace Reference

Functions

def Base
 
def HLTDropPrevious
 
def L1REPACK
 
def L1T
 
def L1THLT
 
def L1XML
 
def MassReplaceInputTag
 
def MassReplaceParameter
 
def ProcessName
 

Variables

tuple process = ProcessName(process)
 override the GlobalTag, connection string and pfnPrefix if 'GlobalTag' in process.__dict__: process.GlobalTag.connect = 'frontier://FrontierProd/CMS_CONDITIONS' process.GlobalTag.pfnPrefix = cms.untracked.string('frontier://Frontie#rProd/') More...
 

Function Documentation

def CustomConfigs.Base (   process)

Definition at line 18 of file CustomConfigs.py.

Referenced by gen::DataCardFileWriter.DataCardFileWriter(), models.generate(), HLTDropPrevious(), L1T(), and L1THLT().

18 
19 def Base(process):
20 # default modifications
21 
22  process.options.wantSummary = cms.untracked.bool(True)
23  process.options.numberOfThreads = cms.untracked.uint32( 4 )
24  process.options.numberOfStreams = cms.untracked.uint32( 0 )
25  process.options.sizeOfStackForThreadsInKB = cms.untracked.uint32( 10*1024 )
26 
27  process.MessageLogger.categories.append('TriggerSummaryProducerAOD')
28  process.MessageLogger.categories.append('L1GtTrigReport')
29  process.MessageLogger.categories.append('L1TGlobalSummary')
30  process.MessageLogger.categories.append('HLTrigReport')
31 
# No longer override - instead use GT config as provided via cmsDriver
def CustomConfigs.HLTDropPrevious (   process)

Definition at line 98 of file CustomConfigs.py.

References Base(), and reco.return().

98 
99 def HLTDropPrevious(process):
100 # drop on input the previous HLT results
101  process.source.inputCommands = cms.untracked.vstring (
102  'keep *',
103  'drop *_hltL1GtObjectMap_*_*',
104  'drop *_TriggerResults_*_*',
105  'drop *_hltTriggerSummaryAOD_*_*',
106  )
107 
108  process=Base(process)
109 
110  return(process)
111 
return(e1-e2)*(e1-e2)+dp *dp
def CustomConfigs.L1REPACK (   process,
  sequence = "Full" 
)

Definition at line 130 of file CustomConfigs.py.

References edm::eventsetup::heterocontainer.insert().

131 def L1REPACK(process,sequence="Full"):
132 
133  from Configuration.StandardSequences.Eras import eras
134 
135  l1repack = cms.Process('L1REPACK',eras.Run2_2016)
136  l1repack.load('Configuration.StandardSequences.SimL1EmulatorRepack_'+sequence+'_cff')
137 
138  for module in l1repack.es_sources_():
139  if (not hasattr(process,module)):
140  setattr(process,module,getattr(l1repack,module))
141  for module in l1repack.es_producers_():
142  if (not hasattr(process,module)):
143  setattr(process,module,getattr(l1repack,module))
144 
145  for module in l1repack.SimL1Emulator.expandAndClone().moduleNames():
146  setattr(process,module,getattr(l1repack,module))
147  process.SimL1Emulator = l1repack.SimL1Emulator
148 
149  for path in process.paths_():
150  getattr(process,path).insert(0,process.SimL1Emulator)
151  for path in process.endpaths_():
152  getattr(process,path).insert(0,process.SimL1Emulator)
153 
154  return process
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:49
def CustomConfigs.L1T (   process)

Definition at line 44 of file CustomConfigs.py.

References Base(), and reco.return().

44 
45 def L1T(process):
46 # modifications when running L1T only
47 
48  labels = ['gtDigis','simGtDigis','newGtDigis','hltGtDigis']
49  for label in labels:
50  if label in process.__dict__:
51  process.load('L1Trigger.GlobalTriggerAnalyzer.l1GtTrigReport_cfi')
52  process.l1GtTrigReport.L1GtRecordInputTag = cms.InputTag( label )
53  process.L1AnalyzerEndpath = cms.EndPath( process.l1GtTrigReport )
54  process.schedule.append(process.L1AnalyzerEndpath)
55 
56  labels = ['gtStage2Digis','simGtStage2Digis','newGtStage2Digis','hltGtStage2Digis']
57  for label in labels:
58  if label in process.__dict__:
59  process.load('L1Trigger.L1TGlobal.L1TGlobalSummary_cfi')
60  process.L1TGlobalSummary.AlgInputTag = cms.InputTag( label )
61  process.L1TGlobalSummary.ExtInputTag = cms.InputTag( label )
62  process.L1TAnalyzerEndpath = cms.EndPath(process.L1TGlobalSummary )
63  process.schedule.append(process.L1TAnalyzerEndpath)
64 
65  if hasattr(process,'TriggerMenu'):
66  delattr(process,'TriggerMenu')
67 
68  process=Base(process)
69 
70  return(process)
71 
return(e1-e2)*(e1-e2)+dp *dp
def CustomConfigs.L1THLT (   process)

Definition at line 72 of file CustomConfigs.py.

References Base(), and reco.return().

72 
73 def L1THLT(process):
74 # modifications when running L1T+HLT
75 
76  if not ('HLTAnalyzerEndpath' in process.__dict__) :
77  if 'hltGtDigis' in process.__dict__:
78  from HLTrigger.Configuration.HLT_Fake_cff import fragment
79  process.hltL1GtTrigReport = fragment.hltL1GtTrigReport
80  process.hltTrigReport = fragment.hltTrigReport
81  process.HLTAnalyzerEndpath = cms.EndPath(process.hltGtDigis + process.hltL1GtTrigReport + process.hltTrigReport)
82  process.schedule.append(process.HLTAnalyzerEndpath)
83 
84  if 'hltGtStage2ObjectMap' in process.__dict__:
85  from HLTrigger.Configuration.HLT_FULL_cff import fragment
86  process.hltL1TGlobalSummary = fragment.hltL1TGlobalSummary
87  process.hltTrigReport = fragment.hltTrigReport
88  process.HLTAnalyzerEndpath = cms.EndPath(process.hltGtStage2Digis + process.hltL1TGlobalSummary + process.hltTrigReport)
89  process.schedule.append(process.HLTAnalyzerEndpath)
90 
91  if hasattr(process,'TriggerMenu'):
92  delattr(process,'TriggerMenu')
93 
94  process=Base(process)
95 
96  return(process)
97 
return(e1-e2)*(e1-e2)+dp *dp
def CustomConfigs.L1XML (   process,
  xmlFile = None 
)

Definition at line 155 of file CustomConfigs.py.

156 def L1XML(process,xmlFile=None):
157 
158 # xmlFile="L1Menu_Collisions2016_dev_v3.xml"
159 
160  if ((xmlFile is None) or (xmlFile=="")):
161  return process
162 
163  process.L1TriggerMenu= cms.ESProducer("L1TUtmTriggerMenuESProducer",
164  L1TriggerMenuFile= cms.string(xmlFile)
165  )
166  process.ESPreferL1TXML = cms.ESPrefer("L1TUtmTriggerMenuESProducer","L1TriggerMenu")
167 
168  return process
def CustomConfigs.MassReplaceInputTag (   process,
  old = "rawDataCollector",
  new = "rawDataRepacker",
  verbose = False,
  moduleLabelOnly = False,
  skipLabelTest = False 
)

Definition at line 112 of file CustomConfigs.py.

References relativeConstraints.keys, helpers.massSearchReplaceAnyInputTag(), and reco.return().

113 def MassReplaceInputTag(process,old="rawDataCollector",new="rawDataRepacker",verbose=False,moduleLabelOnly=False,skipLabelTest=False):
114 # replace InputTag values (adapted from Configuration/Applications/python/ConfigBuilder.py)
115  from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceAnyInputTag
116  for s in process.paths_().keys():
117  massSearchReplaceAnyInputTag(getattr(process,s),old,new,verbose,moduleLabelOnly,skipLabelTest)
118  for s in process.endpaths_().keys():
119  massSearchReplaceAnyInputTag(getattr(process,s),old,new,verbose,moduleLabelOnly,skipLabelTest)
120  return(process)
def massSearchReplaceAnyInputTag
Definition: helpers.py:271
return(e1-e2)*(e1-e2)+dp *dp
def CustomConfigs.MassReplaceParameter (   process,
  name = "label",
  old = "rawDataCollector",
  new = "rawDataRepacker",
  verbose = False 
)

Definition at line 121 of file CustomConfigs.py.

References relativeConstraints.keys, helpers.massSearchReplaceParam(), and reco.return().

Referenced by customizeHLTforMC.customizeHLTforMC().

122 def MassReplaceParameter(process,name="label",old="rawDataCollector",new="rawDataRepacker",verbose=False):
123 # replace values of named parameters
124  from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceParam
125  for s in process.paths_().keys():
126  massSearchReplaceParam(getattr(process,s),name,old,new,verbose)
127  for s in process.endpaths_().keys():
128  massSearchReplaceParam(getattr(process,s),name,old,new,verbose)
129  return(process)
def massSearchReplaceParam
Definition: helpers.py:258
return(e1-e2)*(e1-e2)+dp *dp
def MassReplaceParameter
def CustomConfigs.ProcessName (   process)

Definition at line 3 of file CustomConfigs.py.

References reco.return().

Referenced by ConfigBuilder.ConfigBuilder.prepare_HLT().

3 
4 def ProcessName(process):
5 # processname modifications
6 
7  if 'hltTrigReport' in process.__dict__:
8  process.hltTrigReport.HLTriggerResults = cms.InputTag( 'TriggerResults','',process.name_() )
9 
10  if 'hltDQMHLTScalers' in process.__dict__:
11  process.hltDQMHLTScalers.triggerResults = cms.InputTag( 'TriggerResults','',process.name_() )
12 
13  if 'hltDQML1SeedLogicScalers' in process.__dict__:
14  process.hltDQML1SeedLogicScalers.processname = process.name_()
15 
16  return(process)
17 
return(e1-e2)*(e1-e2)+dp *dp

Variable Documentation

tuple CustomConfigs.process = ProcessName(process)

override the GlobalTag, connection string and pfnPrefix if 'GlobalTag' in process.__dict__: process.GlobalTag.connect = 'frontier://FrontierProd/CMS_CONDITIONS' process.GlobalTag.pfnPrefix = cms.untracked.string('frontier://Frontie#rProd/')

process.GlobalTag.snapshotTime = cms.string("9999-12-31 23:59:59.000")

Definition at line 39 of file CustomConfigs.py.