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