CMS 3D CMS Logo

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