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  FailPath = cms.untracked.vstring(),
137  IgnoreCompletely = cms.untracked.vstring(),
138  Rethrow = cms.untracked.vstring(),
139  SkipEvent = cms.untracked.vstring(),
140  accelerators = cms.untracked.vstring('*'),
141  allowUnscheduled = cms.obsolete.untracked.bool,
142  canDeleteEarly = cms.untracked.vstring(),
143  deleteNonConsumedUnscheduledModules = cms.untracked.bool(True),
144  dumpOptions = cms.untracked.bool(False),
145  emptyRunLumiMode = cms.obsolete.untracked.string,
146  eventSetup = cms.untracked.PSet(
147  forceNumberOfConcurrentIOVs = cms.untracked.PSet(
148  allowAnyLabel_=cms.required.untracked.uint32
149  ),
150  numberOfConcurrentIOVs = cms.untracked.uint32(0)
151  ),
152  fileMode = cms.untracked.string('FULLMERGE'),
153  forceEventSetupCacheClearOnNewRun = cms.untracked.bool(False),
154  makeTriggerResults = cms.obsolete.untracked.bool,
155  numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(0),
156  numberOfConcurrentRuns = cms.untracked.uint32(1),
157  numberOfStreams = cms.untracked.uint32(0),
158  numberOfThreads = cms.untracked.uint32(1),
159  printDependencies = cms.untracked.bool(False),
160  sizeOfStackForThreadsInKB = cms.optional.untracked.uint32,
161  throwIfIllegalParameter = cms.untracked.bool(True),
162  wantSummary = cms.untracked.bool(False)
163 )
164 
165 # Production Info
166 process.configurationMetadata = cms.untracked.PSet(
167  annotation = cms.untracked.string('step2 nevts:1000'),
168  name = cms.untracked.string('Applications'),
169  version = cms.untracked.string('$Revision: 1.19 $')
170 )
171 
172 # Output definition
173 
174 process.FEVTDEBUGHLToutput = cms.OutputModule("PoolOutputModule",
175  dataset = cms.untracked.PSet(
176  dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW'),
177  filterName = cms.untracked.string('')
178  ),
179  fileName = cms.untracked.string(outFile),
180  outputCommands = process.FEVTDEBUGHLTEventContent.outputCommands,
181  splitLevel = cms.untracked.int32(0)
182 )
183 
184 # Additional output definition
185 
186 # Other statements
187 process.mix.digitizers = cms.PSet(process.theDigitizersValid)
188 from Configuration.AlCa.GlobalTag import GlobalTag
189 process.GlobalTag = GlobalTag(process.GlobalTag, globalTag, '')
190 
191 # Path and EndPath definitions
192 process.digitisation_step = cms.Path(process.pdigi_valid)
193 process.L1TrackTrigger_step = cms.Path(process.L1TrackTrigger)
194 process.L1simulation_step = cms.Path(process.SimL1Emulator)
195 process.digi2raw_step = cms.Path(process.DigiToRaw)
196 process.endjob_step = cms.EndPath(process.endOfProcess)
197 process.FEVTDEBUGHLToutput_step = cms.EndPath(process.FEVTDEBUGHLToutput)
198 
199 if (options.noise == "none"):
200  process.HGCAL_noise_fC.values = [0,0,0]
201 
202 if (options.threshold == "none"):
203  process.mix.digitizers.hgceeDigitizer.digiCfg.feCfg.adcThreshold_fC = 0.0
204  process.mix.digitizers.hgchefrontDigitizer.digiCfg.feCfg.adcThreshold_fC = 0.0
205  process.mix.digitizers.hgchebackDigitizer.digiCfg.feCfg.adcThreshold_fC = 0.0
206 
207 # Schedule definition
208 # process.schedule imported from cff in HLTrigger.Configuration
209 process.schedule.insert(0, process.digitisation_step)
210 process.schedule.insert(1, process.L1TrackTrigger_step)
211 process.schedule.insert(2, process.L1simulation_step)
212 process.schedule.insert(3, process.digi2raw_step)
213 process.schedule.extend([process.endjob_step,process.FEVTDEBUGHLToutput_step])
214 
215 from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask
217 
218 # customisation of the process.
219 
220 # Automatic addition of the customisation function from HLTrigger.Configuration.customizeHLTforMC
221 from HLTrigger.Configuration.customizeHLTforMC import customizeHLTforMC
222 
223 #call to customisation function customizeHLTforMC imported from HLTrigger.Configuration.customizeHLTforMC
224 process = customizeHLTforMC(process)
225 
226 # End of customisation functions
227 
228 
229 # Customisation from command line
230 
231 # Add early deletion of temporary data products to reduce peak memory need
232 from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete
233 process = customiseEarlyDelete(process)
234 # 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