|
4 | 4 | import FWCore.ParameterSet.VarParsing as VarParsing |
5 | 5 | from CalibTracker.SiStripCommon.shallowTree_test_template import * |
6 | 6 |
|
| 7 | +################################################################### |
| 8 | +def alterTriggersForUnitTest(process): |
| 9 | +################################################################### |
| 10 | + ''' |
| 11 | + These modification as necessary only in order to run on a |
| 12 | + RelVal MC in which the physics menu is not simulated! |
| 13 | + ''' |
| 14 | + if(hasattr(process,'AAGFilter')): |
| 15 | + process.AAGFilter.triggerConditions = ["HLT_Random_v*"] |
| 16 | + if(hasattr(process,'IsolatedMuonFilter')): |
| 17 | + process.IsolatedMuonFilter.triggerConditions = ["MC_IsoMu_v*"] |
| 18 | + |
| 19 | + return process |
| 20 | + |
7 | 21 | ################################################################### |
8 | 22 | # Setup 'standard' options |
9 | 23 | ################################################################### |
|
45 | 59 | VarParsing.VarParsing.varType.int, |
46 | 60 | "number of events to process (\"-1\" for all)") |
47 | 61 |
|
| 62 | +options.register('unitTest', |
| 63 | + False, |
| 64 | + VarParsing.VarParsing.multiplicity.singleton, |
| 65 | + VarParsing.VarParsing.varType.bool, |
| 66 | + "is for unit test?") |
| 67 | + |
48 | 68 | options.parseArguments() |
49 | 69 |
|
50 | 70 | print("conditionGT : ", options.conditionGT) |
|
68 | 88 | process.GlobalTag = GlobalTag(process.GlobalTag, options.conditionGT, options.conditionOverwrite) |
69 | 89 |
|
70 | 90 | process.load('FWCore.MessageService.MessageLogger_cfi') |
| 91 | +process.MessageLogger.destinations = ['cout', 'cerr'] |
| 92 | +if(options.unitTest): |
| 93 | + process.MessageLogger.cerr.FwkReport.reportEvery = 1 |
| 94 | +else: |
| 95 | + process.MessageLogger.cerr.FwkReport.reportEvery = 100 |
| 96 | + |
71 | 97 | process.load('Configuration.StandardSequences.Services_cff') |
72 | 98 | process.add_( cms.Service( "TFileService", |
73 | 99 | fileName = cms.string( options.outputFile ), |
|
81 | 107 | fileNames = cms.untracked.vstring(options.inputFiles[0]) |
82 | 108 | ) |
83 | 109 |
|
84 | | -process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) |
85 | | -process.MessageLogger.cerr.FwkReport.reportEvery = 10000 |
86 | | - |
87 | 110 | #definition of input collection |
88 | 111 | process.CalibrationTracks.src = cms.InputTag( options.inputCollection ) |
89 | 112 | process.shallowTracks.Tracks = cms.InputTag( options.inputCollection ) |
|
98 | 121 | ## process.L1T1.L1TechTriggerSeeding = cms.bool(True) |
99 | 122 | ## process.L1T1.L1SeedsLogicalExpression = cms.string('(40 OR 41) AND NOT (36 OR 37 OR 38 OR 39)') |
100 | 123 |
|
101 | | -#compressionSettings = 201 |
| 124 | +compressionSettings = 201 |
102 | 125 | process.EventInfo = cms.EDAnalyzer("ShallowTree", |
103 | 126 | CompressionSettings = process.gainCalibrationTreeStdBunch.CompressionSettings, |
104 | 127 | outputCommands = cms.untracked.vstring('drop *', |
105 | 128 | 'keep *_shallowEventRun_*_*', |
106 | 129 | ) |
107 | 130 | ) |
108 | | -#process.gainCalibrationTreeStdBunch.CompressionSettings = cms.untracked.int32(compressionSettings) |
109 | | -#process.gainCalibrationTreeStdBunch0T.CompressionSettings = cms.untracked.int32(compressionSettings) |
110 | | -#process.gainCalibrationTreeIsoMuon.CompressionSettings = cms.untracked.int32(compressionSettings) |
111 | | -#process.gainCalibrationTreeIsoMuon0T.CompressionSettings = cms.untracked.int32(compressionSettings) |
112 | | -#process.gainCalibrationTreeAagBunch.CompressionSettings = cms.untracked.int32(compressionSettings) |
113 | | -#process.gainCalibrationTreeAagBunch0T.CompressionSettings = cms.untracked.int32(compressionSettings) |
| 131 | + |
| 132 | +process.gainCalibrationTreeStdBunch.CompressionSettings = cms.untracked.int32(compressionSettings) |
| 133 | +process.gainCalibrationTreeStdBunch0T.CompressionSettings = cms.untracked.int32(compressionSettings) |
| 134 | +process.gainCalibrationTreeIsoMuon.CompressionSettings = cms.untracked.int32(compressionSettings) |
| 135 | +process.gainCalibrationTreeIsoMuon0T.CompressionSettings = cms.untracked.int32(compressionSettings) |
| 136 | +process.gainCalibrationTreeAagBunch.CompressionSettings = cms.untracked.int32(compressionSettings) |
| 137 | +process.gainCalibrationTreeAagBunch0T.CompressionSettings = cms.untracked.int32(compressionSettings) |
114 | 138 |
|
115 | 139 | #process.TkCalPath = cms.Path(process.L1T1*process.TkCalFullSequence) |
116 | 140 |
|
| 141 | +### if it is a unit test run, do not look for not existing triggers |
| 142 | +### e.g. no AAG in MC |
| 143 | + |
| 144 | +if(options.unitTest): |
| 145 | + alterTriggersForUnitTest(process) |
| 146 | + |
117 | 147 | process.TkCalPath_StdBunch = cms.Path(process.TkCalSeq_StdBunch*process.shallowEventRun*process.EventInfo) |
118 | 148 | process.TkCalPath_StdBunch0T = cms.Path(process.TkCalSeq_StdBunch0T*process.shallowEventRun*process.EventInfo) |
119 | 149 | process.TkCalPath_IsoMuon = cms.Path(process.TkCalSeq_IsoMuon*process.shallowEventRun*process.EventInfo) |
|
123 | 153 |
|
124 | 154 | process.schedule = cms.Schedule( process.TkCalPath_StdBunch, |
125 | 155 | process.TkCalPath_StdBunch0T, |
126 | | - process.TkCalPath_IsoMuon, # no After Abort Gap in MC |
| 156 | + process.TkCalPath_IsoMuon, |
127 | 157 | process.TkCalPath_IsoMuon0T, |
128 | 158 | process.TkCalPath_AagBunch, |
129 | 159 | process.TkCalPath_AagBunch0T, |
130 | 160 | ) |
131 | 161 |
|
132 | 162 | process.options = cms.untracked.PSet( |
| 163 | + #wantSummary = cms.untracked.bool(True), |
133 | 164 | Rethrow = cms.untracked.vstring('OtherCMS', |
134 | 165 | 'StdException', |
135 | 166 | 'Unknown', |
|
157 | 188 | 'ProductDoesNotSupportPtr', |
158 | 189 | 'NotFound') |
159 | 190 | ) |
| 191 | + |
| 192 | +process.Timing = cms.Service("Timing", |
| 193 | + summaryOnly = cms.untracked.bool(True), |
| 194 | + useJobReport = cms.untracked.bool(True) |
| 195 | + ) |
| 196 | + |
| 197 | +''' |
| 198 | +if(options.unitTest): |
| 199 | + process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck", |
| 200 | + ignoreTotal = cms.untracked.int32(1), |
| 201 | + moduleMemorySummary = cms.untracked.bool(True) |
| 202 | + ) |
| 203 | +''' |
| 204 | + |
| 205 | +#Setup FWK for multithreaded |
| 206 | +process.options.numberOfThreads=cms.untracked.uint32(4) |
| 207 | +process.options.numberOfStreams=cms.untracked.uint32(0) |
| 208 | +#process.options.numberOfConcurrentLuminosityBlocks=cms.untracked.uint32(2) ## not yet |
0 commit comments