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