CMS 3D CMS Logo

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