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 
24  process.MessageLogger.categories.append('TriggerSummaryProducerAOD')
25  process.MessageLogger.categories.append('L1GtTrigReport')
26  process.MessageLogger.categories.append('L1TGlobalSummary')
27  process.MessageLogger.categories.append('HLTrigReport')
28 
# No longer override - instead use GT config as provided via cmsDriver
def CustomConfigs.HLTDropPrevious (   process)

Definition at line 95 of file CustomConfigs.py.

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

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

Definition at line 127 of file CustomConfigs.py.

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

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

Definition at line 41 of file CustomConfigs.py.

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

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

Definition at line 69 of file CustomConfigs.py.

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

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

Definition at line 152 of file CustomConfigs.py.

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

Definition at line 109 of file CustomConfigs.py.

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

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

Definition at line 118 of file CustomConfigs.py.

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

Referenced by customizeHLTforMC.customizeHLTforMC().

119 def MassReplaceParameter(process,name="label",old="rawDataCollector",new="rawDataRepacker",verbose=False):
120 # replace values of named parameters
121  from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceParam
122  for s in process.paths_().keys():
123  massSearchReplaceParam(getattr(process,s),name,old,new,verbose)
124  for s in process.endpaths_().keys():
125  massSearchReplaceParam(getattr(process,s),name,old,new,verbose)
126  return(process)
def massSearchReplaceParam
Definition: helpers.py:249
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 36 of file CustomConfigs.py.