CMS 3D CMS Logo

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