-
Notifications
You must be signed in to change notification settings - Fork 2
/
CloseByParticle_Photon_ERZRanges_cfi_GEN_SIM.py
207 lines (176 loc) · 8.15 KB
/
CloseByParticle_Photon_ERZRanges_cfi_GEN_SIM.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# Auto generated configuration file
# using:
# Revision: 1.19
# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v
# with command line options: CloseByParticle_Photon_ERZRanges_cfi -s GEN,SIM -n 10 --conditions auto:phase2_realistic_T25 --beamspot HGCALCloseBy --datatier GEN-SIM --eventcontent FEVTDEBUG --geometry Extended2026D98 --era Phase2C17I13M9 --relval 9000,100 --fileout file:step1.root
import FWCore.ParameterSet.Config as cms
from FWCore.ParameterSet.VarParsing import VarParsing
options = VarParsing ('analysis')
options.register('generatorRandomSeed',
123456,
VarParsing.multiplicity.singleton,
VarParsing.varType.int,
"Random seed for generator process")
options.register('pdgid',
22,
VarParsing.multiplicity.singleton,
VarParsing.varType.int,
"PDG ID for particle gun")
options.register('minEn',
49.9,
VarParsing.multiplicity.singleton,
VarParsing.varType.float,
"Minimum En of CloseByPhotons")
options.register('maxEn',
50.1,
VarParsing.multiplicity.singleton,
VarParsing.varType.float,
"Maximum En of CloseByPhotons")
options.register('minEta',
1.6,
VarParsing.multiplicity.singleton,
VarParsing.varType.float,
"Minimum eta of CloseByPhotons")
options.register('maxEta',
2.8,
VarParsing.multiplicity.singleton,
VarParsing.varType.float,
"Maximum eta of CloseByPhotons")
options.register('minPhi',
-3.14159265359,
VarParsing.multiplicity.singleton,
VarParsing.varType.float,
"Minimum phi of CloseByPhotons")
options.register('maxPhi',
3.14159265359,
VarParsing.multiplicity.singleton,
VarParsing.varType.float,
"Maximum phi of CloseByPhotons")
options.register('minz',
320,
VarParsing.multiplicity.singleton,
VarParsing.varType.float,
"Minimum z of CloseByPhotons")
from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
process = cms.Process('SIM',Phase2C17I13M9)
# import of standard configurations
process.load('Configuration.StandardSequences.Services_cff')
process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load('Configuration.EventContent.EventContent_cff')
process.load('SimGeneral.MixingModule.mixNoPU_cfi')
process.load('Configuration.Geometry.GeometryExtended2026D98Reco_cff')
process.load('Configuration.Geometry.GeometryExtended2026D98_cff')
process.load('Configuration.StandardSequences.MagneticField_cff')
process.load('Configuration.StandardSequences.Generator_cff')
process.load('IOMC.EventVertexGenerators.VtxSmearedHGCALCloseBy_cfi')
process.load('GeneratorInterface.Core.genFilterSummary_cff')
process.load('Configuration.StandardSequences.SimIdeal_cff')
process.load('Configuration.StandardSequences.EndOfProcess_cff')
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(10),
output = cms.optional.untracked.allowed(cms.int32,cms.PSet)
)
# Input source
process.source = cms.Source("EmptySource")
process.options = cms.untracked.PSet(
IgnoreCompletely = cms.untracked.vstring(),
Rethrow = cms.untracked.vstring(),
TryToContinue = cms.untracked.vstring(),
accelerators = cms.untracked.vstring('*'),
allowUnscheduled = cms.obsolete.untracked.bool,
canDeleteEarly = cms.untracked.vstring(),
deleteNonConsumedUnscheduledModules = cms.untracked.bool(True),
dumpOptions = cms.untracked.bool(False),
emptyRunLumiMode = cms.obsolete.untracked.string,
eventSetup = cms.untracked.PSet(
forceNumberOfConcurrentIOVs = cms.untracked.PSet(
allowAnyLabel_=cms.required.untracked.uint32
),
numberOfConcurrentIOVs = cms.untracked.uint32(0)
),
fileMode = cms.untracked.string('FULLMERGE'),
forceEventSetupCacheClearOnNewRun = cms.untracked.bool(False),
holdsReferencesToDeleteEarly = cms.untracked.VPSet(),
makeTriggerResults = cms.obsolete.untracked.bool,
modulesToCallForTryToContinue = cms.untracked.vstring(),
modulesToIgnoreForDeleteEarly = cms.untracked.vstring(),
numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(0),
numberOfConcurrentRuns = cms.untracked.uint32(1),
numberOfStreams = cms.untracked.uint32(0),
numberOfThreads = cms.untracked.uint32(1),
printDependencies = cms.untracked.bool(False),
sizeOfStackForThreadsInKB = cms.optional.untracked.uint32,
throwIfIllegalParameter = cms.untracked.bool(True),
wantSummary = cms.untracked.bool(False)
)
# Production Info
process.configurationMetadata = cms.untracked.PSet(
annotation = cms.untracked.string('CloseByParticle_Photon_ERZRanges_cfi nevts:10'),
name = cms.untracked.string('Applications'),
version = cms.untracked.string('$Revision: 1.19 $')
)
# Output definition
process.FEVTDEBUGoutput = cms.OutputModule("PoolOutputModule",
SelectEvents = cms.untracked.PSet(
SelectEvents = cms.vstring('generation_step')
),
dataset = cms.untracked.PSet(
dataTier = cms.untracked.string('GEN-SIM'),
filterName = cms.untracked.string('')
),
fileName = cms.untracked.string('file:step1.root'),
outputCommands = process.FEVTDEBUGEventContent.outputCommands,
splitLevel = cms.untracked.int32(0)
)
# Additional output definition
# Other statements
process.genstepfilter.triggerConditions=cms.vstring("generation_step")
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T25', '')
process.generator = cms.EDProducer("CloseByParticleGunProducer",
AddAntiParticle = cms.bool(False),
PGunParameters = cms.PSet(
ControlledByEta = cms.bool(False),
Delta = cms.double(10),
EnMax = cms.double(options.maxEn),
EnMin = cms.double(options.minEn),
MaxEnSpread = cms.bool(False),
MaxEta = cms.double(options.maxEta),
MaxPhi = cms.double(options.maxPhi),
MinEta = cms.double(options.minEta),
MinPhi = cms.double(options.minPhi),
NParticles = cms.int32(1),
Overlapping = cms.bool(False),
PartID = cms.vint32(options.pdgid),
Pointing = cms.bool(True),
RMax = cms.double(120),
RMin = cms.double(60),
RandomShoot = cms.bool(False),
ZMax = cms.double(options.minz+1),
ZMin = cms.double(options.minz)
),
Verbosity = cms.untracked.int32(0),
firstRun = cms.untracked.uint32(1),
psethack = cms.string('random particles in phi and r windows')
)
process.RandomNumberGeneratorService.generator.initialSeed = options.generatorRandomSeed
# Path and EndPath definitions
process.generation_step = cms.Path(process.pgen)
process.simulation_step = cms.Path(process.psim)
process.genfiltersummary_step = cms.EndPath(process.genFilterSummary)
process.endjob_step = cms.EndPath(process.endOfProcess)
process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput)
# Schedule definition
process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.endjob_step,process.FEVTDEBUGoutput_step)
from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask
associatePatAlgosToolsTask(process)
# filter all path with the production filter sequence
for path in process.paths:
getattr(process,path).insert(0, process.generator)
# Customisation from command line
# Add early deletion of temporary data products to reduce peak memory need
from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete
process = customiseEarlyDelete(process)
# End adding early deletion