CMS 3D CMS Logo

testHGCalSimSingleMuonPt100_cfg.py
Go to the documentation of this file.
1 
9 import FWCore.ParameterSet.Config as cms
10 import os, sys, imp, re, random
11 import FWCore.ParameterSet.VarParsing as VarParsing
12 
13 
15 options = VarParsing.VarParsing('standard')
16 options.register('geometry',
17  "D110",
18  VarParsing.VarParsing.multiplicity.singleton,
19  VarParsing.VarParsing.varType.string,
20  "geometry of operations: D105, D110, D114, V17Shift, D104")
21 options.register('type',
22  "DDD",
23  VarParsing.VarParsing.multiplicity.singleton,
24  VarParsing.VarParsing.varType.string,
25  "type of operations: DDD, DD4hep")
26 
27 
28 options.parseArguments()
29 
30 print(options)
31 
32 
34 
35 if (options.type == "DD4hep"):
36  from Configuration.ProcessModifiers.dd4hep_cff import dd4hep
37  if (options.geometry == "V17Shift"):
38  from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
39  process = cms.Process('SingleMuonSim',Phase2C17I13M9,dd4hep)
40  geomFile = "Geometry.HGCalCommonData.testHGCal" + options.type + options.geometry + "Reco_cff"
41  elif (options.geometry == "D104"):
42  from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
43  process = cms.Process('SingleMuonSim',Phase2C22I13M9,dd4hep)
44  geomFile = "Configuration.Geometry.Geometry" + options.type +"Extended2026" + options.geometry + "Reco_cff"
45  else:
46  from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
47  process = cms.Process('SingleMuonSim',Phase2C17I13M9,dd4hep)
48  geomFile = "Configuration.Geometry.Geometry" + options.type +"Extended2026" + options.geometry + "Reco_cff"
49 else:
50  if (options.geometry == "V17Shift"):
51  from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
52  process = cms.Process('SingleMuonSim',Phase2C17I13M9)
53  geomFile = "Geometry.HGCalCommonData.testHGCal" + options.geometry + "Reco_cff"
54  elif (options.geometry == "D104"):
55  from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
56  process = cms.Process('SingleMuonSim',Phase2C22I13M9)
57  geomFile = "Configuration.Geometry.GeometryExtended2026" + options.geometry + "Reco_cff"
58  else:
59  from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
60  process = cms.Process('SingleMuonSim',Phase2C17I13M9)
61  geomFile = "Configuration.Geometry.GeometryExtended2026" + options.geometry + "Reco_cff"
62 
63 globalTag = "auto:phase2_realistic_T33"
64 outFile = "file:step1" + options.type + options.geometry + "mu.root"
65 
66 print("Geometry file: ", geomFile)
67 print("Global Tag: ", globalTag)
68 print("Output file: ", outFile)
69 
70 # import of standard configurations
71 process.load(geomFile)
72 process.load('Configuration.StandardSequences.Services_cff')
73 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
74 process.load('FWCore.MessageService.MessageLogger_cfi')
75 process.load('Configuration.EventContent.EventContent_cff')
76 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
77 process.load('Configuration.StandardSequences.MagneticField_cff')
78 process.load('Configuration.StandardSequences.Generator_cff')
79 process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic50ns13TeVCollision_cfi')
80 process.load('GeneratorInterface.Core.genFilterSummary_cff')
81 process.load('Configuration.StandardSequences.SimIdeal_cff')
82 process.load('Configuration.StandardSequences.EndOfProcess_cff')
83 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
84 process.load('Configuration.StandardSequences.EndOfProcess_cff')
85 process.load('SimG4CMS.Calo.hgcalHitPartial_cff')
86 process.load("IOMC.RandomEngine.IOMC_cff")
87 
88 rndm = random.randint(0,200000)
89 process.RandomNumberGeneratorService.generator.initialSeed = rndm
90 print("Processing with random number seed: ", rndm)
91 
92 process.maxEvents = cms.untracked.PSet(
93  input = cms.untracked.int32(5000)
94 )
95 
96 process.MessageLogger.cerr.FwkReport.reportEvery = 1
97 if hasattr(process,'MessageLogger'):
98  process.MessageLogger.HGCalError=dict()
99 # process.MessageLogger.HGCSim=dict()
100 # process.MessageLogger.HGCalSim=dict()
101 
102 # Input source
103 process.source = cms.Source("EmptySource")
104 
105 process.options = cms.untracked.PSet(
106  wantSummary = cms.untracked.bool(True),
107  numberOfConcurrentRuns = cms.untracked.uint32(1),
108  numberOfStreams = cms.untracked.uint32(0),
109  numberOfThreads = cms.untracked.uint32(1),
110  printDependencies = cms.untracked.bool(False),
111  sizeOfStackForThreadsInKB = cms.optional.untracked.uint32,
112 )
113 
114 # Production Info
115 process.configurationMetadata = cms.untracked.PSet(
116  version = cms.untracked.string(''),
117  annotation = cms.untracked.string(''),
118  name = cms.untracked.string('Applications')
119 )
120 
121 # Output definition
122 process.output = cms.OutputModule("PoolOutputModule",
123  SelectEvents = cms.untracked.PSet(
124  SelectEvents = cms.vstring('generation_step')
125  ),
126  dataset = cms.untracked.PSet(
127  filterName = cms.untracked.string(''),
128  dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW-RECO')
129  ),
130  fileName = cms.untracked.string(outFile),
131  outputCommands = process.FEVTDEBUGEventContent.outputCommands,
132  eventAutoFlushCompressedSize = cms.untracked.int32(5242880),
133  splitLevel = cms.untracked.int32(0)
134 )
135 
136 # Additional output definition
137 
138 # Other statements
139 process.genstepfilter.triggerConditions=cms.vstring("generation_step")
140 from Configuration.AlCa.GlobalTag import GlobalTag
141 process.GlobalTag = GlobalTag(process.GlobalTag, globalTag, '')
142 
143 process.generator = cms.EDFilter("Pythia8PtGun",
144  PGunParameters = cms.PSet(
145  MaxPt = cms.double(100.01),
146  MinPt = cms.double(99.99),
147  ParticleID = cms.vint32(-13),
148  AddAntiParticle = cms.bool(True),
149  MaxEta = cms.double(3.1),
150  MaxPhi = cms.double(3.14159265359),
151  MinEta = cms.double(2.8),
152  MinPhi = cms.double(-3.14159265359)
153  ),
154  Verbosity = cms.untracked.int32(0),
155  psethack = cms.string('single mu pt 100'),
156  firstRun = cms.untracked.uint32(1),
157  PythiaParameters = cms.PSet(parameterSets = cms.vstring())
158 )
159 
160 
161 #Modified to produce hgceedigis
162 process.ProductionFilterSequence = cms.Sequence(process.generator)
163 
164 process.g4SimHits.HGCSD.CheckID = True
165 process.g4SimHits.HGCScintSD.CheckID = True
166 
167 # Path and EndPath definitions
168 process.generation_step = cms.Path(process.pgen)
169 process.simulation_step = cms.Path(process.psim)
170 process.genfiltersummary_step = cms.EndPath(process.genFilterSummary)
171 process.endjob_step = cms.EndPath(process.endOfProcess)
172 process.analysis_step = cms.Path(process.hgcalHitPartialEE+process.hgcalHitPartialHE+process.hgcalHitPartialHEB)
173 process.out_step = cms.EndPath(process.output)
174 
175 # Schedule definition
176 process.schedule = cms.Schedule(process.generation_step,
177  process.genfiltersummary_step,
178  process.simulation_step,
179  process.endjob_step,
180  process.analysis_step,
181  process.out_step
182  )
183 
184 from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask
186 # filter all path with the production filter sequence
187 for path in process.paths:
188  getattr(process,path).insert(0, process.ProductionFilterSequence)
189 
190 
191 # Customisation from command line
192 
193 # Add early deletion of temporary data products to reduce peak memory need
194 from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete
195 process = customiseEarlyDelete(process)
196 # End adding early deletion
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:50
def associatePatAlgosToolsTask(process)
Definition: helpers.py:24