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