CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CustomConfigs.py
Go to the documentation of this file.
2 
3 def ProcessName(process):
4 # processname modifications
5 
6  if 'hltTrigReport' in process.__dict__:
7  process.hltTrigReport.HLTriggerResults = cms.InputTag( 'TriggerResults','',process.name_() )
8 
9  if 'hltDQMHLTScalers' in process.__dict__:
10  process.hltDQMHLTScalers.triggerResults = cms.InputTag( 'TriggerResults','',process.name_() )
11 
12  if 'hltDQML1SeedLogicScalers' in process.__dict__:
13  process.hltDQML1SeedLogicScalers.processname = process.name_()
14 
15  return(process)
16 
17 
18 def Base(process):
19 # default modifications
20 
21  process.options.wantSummary = cms.untracked.bool(True)
22 
23  process.MessageLogger.categories.append('TriggerSummaryProducerAOD')
24  process.MessageLogger.categories.append('L1GtTrigReport')
25  process.MessageLogger.categories.append('HLTrigReport')
26 
27 #
28 # No longer override - instead use GT config as provided via cmsDriver
29 ## override the GlobalTag, connection string and pfnPrefix
30 # if 'GlobalTag' in process.__dict__:
31 # process.GlobalTag.connect = 'frontier://FrontierProd/CMS_CONDITIONS'
32 # process.GlobalTag.pfnPrefix = cms.untracked.string('frontier://Frontie#rProd/')
33 #
34  process=ProcessName(process)
35 
36  return(process)
37 
38 
39 def L1T(process):
40 # modifications when running L1T only
41 
42  process.load('L1Trigger.GlobalTriggerAnalyzer.l1GtTrigReport_cfi')
43  labels = ['gtDigis','simGtDigis','newGtDigis','hltGtDigis']
44  for label in labels:
45  if label in process.__dict__:
46  process.l1GtTrigReport.L1GtRecordInputTag = cms.InputTag( label )
47 
48  process.L1AnalyzerEndpath = cms.EndPath( process.l1GtTrigReport )
49  process.schedule.append(process.L1AnalyzerEndpath)
50 
51  process=Base(process)
52 
53  return(process)
54 
55 
56 def L1THLT(process):
57 # modifications when running L1T+HLT
58 
59  if not ('HLTAnalyzerEndpath' in process.__dict__) :
60  from HLTrigger.Configuration.HLT_FULL_cff import hltL1GtTrigReport,hltTrigReport
61  process.hltL1GtTrigReport = hltL1GtTrigReport
62  process.hltTrigReport = hltTrigReport
63  process.HLTAnalyzerEndpath = cms.EndPath(process.hltL1GtTrigReport + process.hltTrigReport)
64  process.schedule.append(process.HLTAnalyzerEndpath)
65 
66  process=Base(process)
67 
68  return(process)
69 
70 
71 def FASTSIM(process):
72 # modifications when running L1T+HLT
73 
74  process=L1THLT(process)
75  process.hltL1GtTrigReport.L1GtRecordInputTag = cms.InputTag("simGtDigis")
76 
77  return(process)
78 
79 
80 def HLTDropPrevious(process):
81 # drop on input the previous HLT results
82  process.source.inputCommands = cms.untracked.vstring (
83  'keep *',
84  'drop *_hltL1GtObjectMap_*_*',
85  'drop *_TriggerResults_*_*',
86  'drop *_hltTriggerSummaryAOD_*_*',
87  )
88 
89  process=Base(process)
90 
91  return(process)
92 
93 
94 def MassReplaceInputTag(process,old="rawDataCollector",new="rawDataRepacker"):
95 # replace InputTag values (adapted from Configuration/Applications/python/ConfigBuilder.py)
96  from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceAnyInputTag
97  for s in process.paths_().keys():
98  massSearchReplaceAnyInputTag(getattr(process,s),old,new)
99  return(process)
100 
101 
102 def L1REPACK(process):
103 # Replace only the L1 parts and keep the rest
104  if 'DigiToRaw' in process.__dict__:
105  process.DigiToRaw = cms.Sequence(process.l1tDigiToRawSeq + process.l1GtPack + process.l1GtEvmPack + process.rawDataCollector)
106  if 'rawDataCollector' in process.__dict__:
107  process.rawDataCollector.RawCollectionList = cms.VInputTag(
108  cms.InputTag('gctDigiToRaw'),
109  cms.InputTag('l1tDigiToRaw'),
110  cms.InputTag('l1GtPack'),
111  cms.InputTag('l1GtEvmPack'),
112  cms.InputTag('rawDataCollector', processName=cms.InputTag.skipCurrentProcess())
113  )
114 
115  process=L1T(process)
116 
117  return process
return((rh^lh)&mask)
def massSearchReplaceAnyInputTag
Definition: helpers.py:262
def MassReplaceInputTag