CMS 3D CMS Logo

testHGCalSimTTBar_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 +"ExtendedRun4" + 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 +"ExtendedRun4" + 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.GeometryExtendedRun4" + 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.GeometryExtendedRun4" + options.geometry + "Reco_cff"
62 
63 globalTag = "auto:phase2_realistic_T33"
64 outFile = "file:step1" + options.type + options.geometry + "tt.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(1000)
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 
145 
146 process.generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter",
147  pythiaHepMCVerbosity = cms.untracked.bool(False),
148  maxEventsToPrint = cms.untracked.int32(0),
149  pythiaPylistVerbosity = cms.untracked.int32(0),
150  filterEfficiency = cms.untracked.double(1.0),
151  comEnergy = cms.double(14000.0),
152  PythiaParameters = cms.PSet(
153  pythia8CommonSettingsBlock,
154  pythia8CUEP8M1SettingsBlock,
155  processParameters = cms.vstring(
156  'Top:gg2ttbar = on ',
157  'Top:qqbar2ttbar = on ',
158  '6:m0 = 175 ',
159  ),
160  parameterSets = cms.vstring('pythia8CommonSettings',
161  'pythia8CUEP8M1Settings',
162  'processParameters',
163  )
164  )
165 )
166 
167 
168 #Modified to produce hgceedigis
169 process.ProductionFilterSequence = cms.Sequence(process.generator)
170 
171 # Path and EndPath definitions
172 process.generation_step = cms.Path(process.pgen)
173 process.simulation_step = cms.Path(process.psim)
174 process.genfiltersummary_step = cms.EndPath(process.genFilterSummary)
175 process.endjob_step = cms.EndPath(process.endOfProcess)
176 process.analysis_step = cms.Path(process.hgcalHitPartialEE+process.hgcalHitPartialHE)
177 process.out_step = cms.EndPath(process.output)
178 
179 process.g4SimHits.HGCSD.CheckID = True
180 process.g4SimHits.HGCScintSD.CheckID = True
181 
182 # Schedule definition
183 process.schedule = cms.Schedule(process.generation_step,
184  process.genfiltersummary_step,
185  process.simulation_step,
186  process.endjob_step,
187  process.analysis_step,
188  process.out_step
189  )
190 
191 from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask
193 # filter all path with the production filter sequence
194 for path in process.paths:
195  getattr(process,path).insert(0, process.ProductionFilterSequence)
196 
197 
198 # Customisation from command line
199 
200 # Add early deletion of temporary data products to reduce peak memory need
201 from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete
202 process = customiseEarlyDelete(process)
203 # 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