CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
customiseUtils.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 import FWCore.ParameterSet.VarParsing as VarParsing
3 import os
4 import sys
5 import commands
6 ##############################################################################
7 # customisations for L1T utilities
8 #
9 # customisations which add utilities features such as debugging of L1T,
10 # summary module, etc.
11 #
12 ##############################################################################
13 
14 # Unpack Stage-2 GT and GMT
16  cutlist=['simDtTriggerPrimitiveDigis','simCscTriggerPrimitiveDigis','simTwinMuxDigis','simBmtfDigis','simEmtfDigis','simOmtfDigis','simGmtCaloSumDigis','simMuonQualityAdjusterDigis','simGmtStage2Digis','simGtStage2Digis']
17  for b in cutlist:
18  process.SimL1Emulator.remove(getattr(process,b))
19  return process
20 
21 # Unpack Stage-2 GT and GMT
23  cutlist=['gtStage2Digis','gmtStage2Digis']
24  for b in cutlist:
25  process.L1TRawToDigi.remove(getattr(process,b))
26  return process
27 
28 # Unpack Stage-2 GT and GMT
30  cutlist=['gtStage2Digis','gmtStage2Digis','caloStage2Digis']
31  for b in cutlist:
32  process.L1TRawToDigi.remove(getattr(process,b))
33  return process
34 
35 def L1TStage1DigisSummary(process):
36  print "L1T INFO: will dump a summary of unpacked Stage1 content to screen."
37  process.load('L1Trigger.L1TCommon.l1tSummaryStage1Digis_cfi')
38  process.l1tstage1summary = cms.Path(process.l1tSummaryStage1Digis)
39  process.schedule.append(process.l1tstage1summary)
40  return process
41 
42 def L1TStage2DigisSummary(process):
43  print "L1T INFO: will dump a summary of unpacked Stage2 content to screen."
44  process.load('L1Trigger.L1TCommon.l1tSummaryStage2Digis_cfi')
45  process.l1tstage2summary = cms.Path(process.l1tSummaryStage2Digis)
46  process.schedule.append(process.l1tstage2summary)
47  return process
48 
50  print "L1T INFO: will dump a summary of simulated Stage1 content to screen."
51  process.load('L1Trigger.L1TCommon.l1tSummaryStage1SimDigis_cfi')
52  process.l1tsimstage1summary = cms.Path(process.l1tSummaryStage1SimDigis)
53  process.schedule.append(process.l1tsimstage1summary)
54  return process
55 
57  print "L1T INFO: will dump a summary of simulated Stage2 content to screen."
58  process.load('L1Trigger.L1TCommon.l1tSummaryStage2SimDigis_cfi')
59  process.l1tsimstage2summary = cms.Path(process.l1tSummaryStage2SimDigis)
60  process.schedule.append(process.l1tsimstage2summary)
61  return process
62 
63 def L1TGlobalDigisSummary(process):
64  print "L1T INFO: will dump a summary of unpacked L1T Global output to screen."
65  process.l1tGlobalSummary = cms.EDAnalyzer(
66  'L1TGlobalSummary',
67  AlgInputTag = cms.InputTag("gtStage2Digis"),
68  ExtInputTag = cms.InputTag("gtStage2Digis"),
69  DumpTrigResults = cms.bool(False), # per event dump of trig results
70  DumpTrigSummary = cms.bool(True), # pre run dump of trig results
71  )
72  process.l1tglobalsummary = cms.Path(process.l1tGlobalSummary)
73  process.schedule.append(process.l1tglobalsummary)
74  return process
75 
76 def L1TGlobalMenuXML(process):
77  process.load('L1Trigger.L1TGlobal.StableParameters_cff')
78  process.load('L1Trigger.L1TGlobal.TriggerMenu_cff')
79  process.TriggerMenu.L1TriggerMenuFile = cms.string('L1Menu_Collisions2016_v2c.xml')
80  return process
81 
83  print "L1T INFO: will dump a summary of simulated L1T Global output to screen."
84  process.l1tSimGlobalSummary = cms.EDAnalyzer(
85  'L1TGlobalSummary',
86  AlgInputTag = cms.InputTag("simGtStage2Digis"),
87  ExtInputTag = cms.InputTag("simGtStage2Digis"),
88  DumpTrigResults = cms.bool(False), # per event dump of trig results
89  DumpTrigSummary = cms.bool(True), # pre run dump of trig results
90  )
91  process.l1tsimglobalsummary = cms.Path(process.l1tSimGlobalSummary)
92  process.schedule.append(process.l1tsimglobalsummary)
93  return process
94 
95 def L1TAddInfoOutput(process):
96  process.MessageLogger = cms.Service(
97  "MessageLogger",
98  destinations = cms.untracked.vstring('cout','cerr'),
99  cout = cms.untracked.PSet(threshold = cms.untracked.string('INFO')),
100  cerr = cms.untracked.PSet(threshold = cms.untracked.string('WARNING')),
101  )
102  return process
103 
104 
105 def L1TAddDebugOutput(process):
106  print "L1T INFO: sending debugging ouput to file l1tdebug.log"
107  print "L1T INFO: add <flags CXXFLAGS=\"-g -D=EDM_ML_DEBUG\"/> in BuildFile.xml of any package you want to debug..."
108  process.MessageLogger = cms.Service(
109  "MessageLogger",
110  destinations = cms.untracked.vstring('l1tdebug','cerr'),
111  l1tdebug = cms.untracked.PSet(threshold = cms.untracked.string('DEBUG')),
112  #debugModules = cms.untracked.vstring('caloStage1Digis'))
113  cerr = cms.untracked.PSet(threshold = cms.untracked.string('WARNING')),
114  debugModules = cms.untracked.vstring('*'))
115  return process
116 
117 def L1TDumpEventData(process):
118  print "L1T INFO: adding EventContentAnalyzer to process schedule"
119  process.dumpED = cms.EDAnalyzer("EventContentAnalyzer")
120  process.l1tdumpevent = cms.Path(process.dumpED)
121  process.schedule.append(process.l1tdumpevent)
122  return process
123 
124 def L1TDumpEventSummary(process):
125  process.dumpES = cms.EDAnalyzer("PrintEventSetupContent")
126  process.l1tdumpeventsetup = cms.Path(process.dumpES)
127  process.schedule.append(process.l1tdumpeventsetup)
128  return process
129 
131  print "L1T INFO: will dump a comparison of unpacked vs emulated Stage2 content to screen."
132  process.load('L1Trigger.L1TCommon.l1tComparisonStage2RAWvsEMU_cfi')
133  process.l1tstage2comparison = cms.Path(process.l1tComparisonStage2RAWvsEMU)
134  process.schedule.append(process.l1tstage2comparison)
135  return process
136 
137 
139  print "L1T INFO: will dump a comparison of unpacked vs emulated GT Stage2 content to screen."
140  process.load('L1Trigger.L1TCommon.l1tComparisonGtStage2RAWvsEMU_cfi')
141  process.l1tgtstage2comparison = cms.Path(process.l1tComparisonGtStage2RAWvsEMU)
142  process.schedule.append(process.l1tgtstage2comparison)
143  return process
def L1TGtStage2ComparisonRAWvsEMU
def L1TTurnOffUnpackStage2GtAndGmt
def L1TTurnOffUnpackStage2GtGmtAndCalo
def L1TStage2ComparisonRAWvsEMU
def L1TStage1SimDigisSummary
def L1TTurnOffGtAndGmtEmulation
customisations for L1T utilities
def L1TStage2SimDigisSummary
def L1TGlobalSimDigisSummary