CMS 3D CMS Logo

testHGCalDigi_cfg.py
Go to the documentation of this file.
1 
11 import FWCore.ParameterSet.Config as cms
12 import os, sys, imp, re, random
13 import FWCore.ParameterSet.VarParsing as VarParsing
14 
15 
17 options = VarParsing.VarParsing('standard')
18 options.register('geometry',
19  "D92",
20  VarParsing.VarParsing.multiplicity.singleton,
21  VarParsing.VarParsing.varType.string,
22  "geometry of operations: D88, D92, D93, D92Shift")
23 options.register('type',
24  "mu",
25  VarParsing.VarParsing.multiplicity.singleton,
26  VarParsing.VarParsing.varType.string,
27  "type of operations: mu, tt")
28 options.register('noise',
29  "ok",
30  VarParsing.VarParsing.multiplicity.singleton,
31  VarParsing.VarParsing.varType.string,
32  "noise of operations: none, ok")
33 options.register('threshold',
34  "ok",
35  VarParsing.VarParsing.multiplicity.singleton,
36  VarParsing.VarParsing.varType.string,
37  "threshold of operations: none, ok")
38 
39 
40 options.parseArguments()
41 
42 print(options)
43 
44 
46 from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
47 process = cms.Process('Digi',Phase2C17I13M9)
48 
49 if (options.geometry == "D92Shift"):
50  geomFile = "Geometry.HGCalCommonData.testHGCalV17ShiftReco_cff"
51 else:
52  geomFile = "Configuration.Geometry.GeometryExtended2026" + options.geometry + "Reco_cff"
53 globalTag = "auto:phase2_realistic_T21"
54 inFile = "file:step1" + options.geometry + options.type + ".root"
55 outFile = "file:step2" + options.geometry + options.type + ".root"
56 
57 print("Geometry file: ", geomFile)
58 print("Global Tag: ", globalTag)
59 print("Input file: ", inFile)
60 print("Output file: ", outFile)
61 
63 from SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi import hgchefrontDigitizer
64 from SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi import hgchebackDigitizer
66 from SimCalorimetry.HGCalSimProducers.hgcROCParameters_cfi import hgcROCSettings
67 # import of standard configurations
68 process.load('Configuration.StandardSequences.Services_cff')
69 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
70 process.load('FWCore.MessageService.MessageLogger_cfi')
71 process.load('Configuration.EventContent.EventContent_cff')
72 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
73 process.load(geomFile)
74 process.load('Configuration.StandardSequences.MagneticField_cff')
75 process.load('Configuration.StandardSequences.Digi_cff')
76 process.load('Configuration.StandardSequences.L1TrackTrigger_cff')
77 process.load('Configuration.StandardSequences.SimL1Emulator_cff')
78 process.load('Configuration.StandardSequences.DigiToRaw_cff')
79 process.load('HLTrigger.Configuration.HLT_Fake2_cff')
80 process.load('Configuration.StandardSequences.EndOfProcess_cff')
81 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
82 
83 process.MessageLogger.cerr.FwkReport.reportEvery = 1
84 
85 process.maxEvents = cms.untracked.PSet(
86  input = cms.untracked.int32(-1),
87  output = cms.optional.untracked.allowed(cms.int32,cms.PSet)
88 )
89 
90 # Input source
91 process.source = cms.Source("PoolSource",
92  dropDescendantsOfDroppedBranches = cms.untracked.bool(False),
93  fileNames = cms.untracked.vstring(inFile),
94  inputCommands = cms.untracked.vstring(
95  'keep *',
96  'drop *_genParticles_*_*',
97  'drop *_genParticlesForJets_*_*',
98  'drop *_kt4GenJets_*_*',
99  'drop *_kt6GenJets_*_*',
100  'drop *_iterativeCone5GenJets_*_*',
101  'drop *_ak4GenJets_*_*',
102  'drop *_ak7GenJets_*_*',
103  'drop *_ak8GenJets_*_*',
104  'drop *_ak4GenJetsNoNu_*_*',
105  'drop *_ak8GenJetsNoNu_*_*',
106  'drop *_genCandidatesForMET_*_*',
107  'drop *_genParticlesForMETAllVisible_*_*',
108  'drop *_genMetCalo_*_*',
109  'drop *_genMetCaloAndNonPrompt_*_*',
110  'drop *_genMetTrue_*_*',
111  'drop *_genMetIC5GenJs_*_*'
112  ),
113  secondaryFileNames = cms.untracked.vstring()
114 )
115 
116 process.options = cms.untracked.PSet(
117  FailPath = cms.untracked.vstring(),
118  IgnoreCompletely = cms.untracked.vstring(),
119  Rethrow = cms.untracked.vstring(),
120  SkipEvent = cms.untracked.vstring(),
121  accelerators = cms.untracked.vstring('*'),
122  allowUnscheduled = cms.obsolete.untracked.bool,
123  canDeleteEarly = cms.untracked.vstring(),
124  deleteNonConsumedUnscheduledModules = cms.untracked.bool(True),
125  dumpOptions = cms.untracked.bool(False),
126  emptyRunLumiMode = cms.obsolete.untracked.string,
127  eventSetup = cms.untracked.PSet(
128  forceNumberOfConcurrentIOVs = cms.untracked.PSet(
129  allowAnyLabel_=cms.required.untracked.uint32
130  ),
131  numberOfConcurrentIOVs = cms.untracked.uint32(0)
132  ),
133  fileMode = cms.untracked.string('FULLMERGE'),
134  forceEventSetupCacheClearOnNewRun = cms.untracked.bool(False),
135  makeTriggerResults = cms.obsolete.untracked.bool,
136  numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(0),
137  numberOfConcurrentRuns = cms.untracked.uint32(1),
138  numberOfStreams = cms.untracked.uint32(0),
139  numberOfThreads = cms.untracked.uint32(1),
140  printDependencies = cms.untracked.bool(False),
141  sizeOfStackForThreadsInKB = cms.optional.untracked.uint32,
142  throwIfIllegalParameter = cms.untracked.bool(True),
143  wantSummary = cms.untracked.bool(False)
144 )
145 
146 # Production Info
147 process.configurationMetadata = cms.untracked.PSet(
148  annotation = cms.untracked.string('step2 nevts:1000'),
149  name = cms.untracked.string('Applications'),
150  version = cms.untracked.string('$Revision: 1.19 $')
151 )
152 
153 # Output definition
154 
155 process.FEVTDEBUGHLToutput = cms.OutputModule("PoolOutputModule",
156  dataset = cms.untracked.PSet(
157  dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW'),
158  filterName = cms.untracked.string('')
159  ),
160  fileName = cms.untracked.string(outFile),
161  outputCommands = process.FEVTDEBUGHLTEventContent.outputCommands,
162  splitLevel = cms.untracked.int32(0)
163 )
164 
165 # Additional output definition
166 
167 # Other statements
168 process.mix.digitizers = cms.PSet(process.theDigitizersValid)
169 from Configuration.AlCa.GlobalTag import GlobalTag
170 process.GlobalTag = GlobalTag(process.GlobalTag, globalTag, '')
171 
172 # Path and EndPath definitions
173 process.digitisation_step = cms.Path(process.pdigi_valid)
174 process.L1TrackTrigger_step = cms.Path(process.L1TrackTrigger)
175 process.L1simulation_step = cms.Path(process.SimL1Emulator)
176 process.digi2raw_step = cms.Path(process.DigiToRaw)
177 process.endjob_step = cms.EndPath(process.endOfProcess)
178 process.FEVTDEBUGHLToutput_step = cms.EndPath(process.FEVTDEBUGHLToutput)
179 
180 if (options.noise == "none"):
181  process.HGCAL_noise_fC.values = [0,0,0]
182 
183 if (options.threshold == "none"):
184  process.mix.digitizers.hgceeDigitizer.digiCfg.feCfg.adcThreshold_fC = 0.0
185  process.mix.digitizers.hgchefrontDigitizer.digiCfg.feCfg.adcThreshold_fC = 0.0
186  process.mix.digitizers.hgchebackDigitizer.digiCfg.feCfg.adcThreshold_fC = 0.0
187 
188 # Schedule definition
189 # process.schedule imported from cff in HLTrigger.Configuration
190 process.schedule.insert(0, process.digitisation_step)
191 process.schedule.insert(1, process.L1TrackTrigger_step)
192 process.schedule.insert(2, process.L1simulation_step)
193 process.schedule.insert(3, process.digi2raw_step)
194 process.schedule.extend([process.endjob_step,process.FEVTDEBUGHLToutput_step])
195 
196 from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask
198 
199 # customisation of the process.
200 
201 # Automatic addition of the customisation function from HLTrigger.Configuration.customizeHLTforMC
202 from HLTrigger.Configuration.customizeHLTforMC import customizeHLTforMC
203 
204 #call to customisation function customizeHLTforMC imported from HLTrigger.Configuration.customizeHLTforMC
205 process = customizeHLTforMC(process)
206 
207 # End of customisation functions
208 
209 
210 # Customisation from command line
211 
212 # Add early deletion of temporary data products to reduce peak memory need
213 from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete
214 process = customiseEarlyDelete(process)
215 # End adding early deletion
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def associatePatAlgosToolsTask(process)
Definition: helpers.py:24