CMS 3D CMS Logo

testHGCalSimTTBar_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('TTBarSim',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 globalTag = "auto:phase2_realistic_T21"
37 outFile = "file:step1" + options.geometry + "tt.root"
38 
39 print("Geometry file: ", geomFile)
40 print("Global Tag: ", globalTag)
41 print("Output file: ", outFile)
42 
43 # import of standard configurations
44 process.load(geomFile)
45 process.load('Configuration.StandardSequences.Services_cff')
46 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
47 process.load('FWCore.MessageService.MessageLogger_cfi')
48 process.load('Configuration.EventContent.EventContent_cff')
49 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
50 process.load('Configuration.StandardSequences.MagneticField_cff')
51 process.load('Configuration.StandardSequences.Generator_cff')
52 process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic50ns13TeVCollision_cfi')
53 process.load('GeneratorInterface.Core.genFilterSummary_cff')
54 process.load('Configuration.StandardSequences.SimIdeal_cff')
55 process.load('Configuration.StandardSequences.EndOfProcess_cff')
56 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
57 process.load('Configuration.StandardSequences.EndOfProcess_cff')
58 process.load('SimG4CMS.Calo.hgcalHitPartial_cff')
59 process.load("IOMC.RandomEngine.IOMC_cff")
60 
61 rndm = random.randint(0,200000)
62 process.RandomNumberGeneratorService.generator.initialSeed = rndm
63 print("Processing with random number seed: ", rndm)
64 
65 process.maxEvents = cms.untracked.PSet(
66  input = cms.untracked.int32(1000)
67 )
68 
69 process.MessageLogger.cerr.FwkReport.reportEvery = 1
70 if hasattr(process,'MessageLogger'):
71  process.MessageLogger.HGCalError=dict()
72 # process.MessageLogger.HGCSim=dict()
73 # process.MessageLogger.HGCalSim=dict()
74 
75 # Input source
76 process.source = cms.Source("EmptySource")
77 
78 process.options = cms.untracked.PSet(
79  wantSummary = cms.untracked.bool(True),
80  numberOfConcurrentRuns = cms.untracked.uint32(1),
81  numberOfStreams = cms.untracked.uint32(0),
82  numberOfThreads = cms.untracked.uint32(1),
83  printDependencies = cms.untracked.bool(False),
84  sizeOfStackForThreadsInKB = cms.optional.untracked.uint32,
85 )
86 
87 # Production Info
88 process.configurationMetadata = cms.untracked.PSet(
89  version = cms.untracked.string(''),
90  annotation = cms.untracked.string(''),
91  name = cms.untracked.string('Applications')
92 )
93 
94 # Output definition
95 process.output = cms.OutputModule("PoolOutputModule",
96  SelectEvents = cms.untracked.PSet(
97  SelectEvents = cms.vstring('generation_step')
98  ),
99  dataset = cms.untracked.PSet(
100  filterName = cms.untracked.string(''),
101  dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW-RECO')
102  ),
103  fileName = cms.untracked.string(outFile),
104  outputCommands = process.FEVTDEBUGEventContent.outputCommands,
105  eventAutoFlushCompressedSize = cms.untracked.int32(5242880),
106  splitLevel = cms.untracked.int32(0)
107 )
108 
109 # Additional output definition
110 
111 # Other statements
112 process.genstepfilter.triggerConditions=cms.vstring("generation_step")
113 from Configuration.AlCa.GlobalTag import GlobalTag
114 process.GlobalTag = GlobalTag(process.GlobalTag, globalTag, '')
115 
118 
119 process.generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter",
120  pythiaHepMCVerbosity = cms.untracked.bool(False),
121  maxEventsToPrint = cms.untracked.int32(0),
122  pythiaPylistVerbosity = cms.untracked.int32(0),
123  filterEfficiency = cms.untracked.double(1.0),
124  comEnergy = cms.double(14000.0),
125  PythiaParameters = cms.PSet(
126  pythia8CommonSettingsBlock,
127  pythia8CUEP8M1SettingsBlock,
128  processParameters = cms.vstring(
129  'Top:gg2ttbar = on ',
130  'Top:qqbar2ttbar = on ',
131  '6:m0 = 175 ',
132  ),
133  parameterSets = cms.vstring('pythia8CommonSettings',
134  'pythia8CUEP8M1Settings',
135  'processParameters',
136  )
137  )
138 )
139 
140 
141 #Modified to produce hgceedigis
142 process.ProductionFilterSequence = cms.Sequence(process.generator)
143 
144 # Path and EndPath definitions
145 process.generation_step = cms.Path(process.pgen)
146 process.simulation_step = cms.Path(process.psim)
147 process.genfiltersummary_step = cms.EndPath(process.genFilterSummary)
148 process.endjob_step = cms.EndPath(process.endOfProcess)
149 process.analysis_step = cms.Path(process.hgcalHitPartialEE+process.hgcalHitPartialHE)
150 process.out_step = cms.EndPath(process.output)
151 
152 process.g4SimHits.HGCSD.CheckID = True
153 process.g4SimHits.HGCScintSD.CheckID = True
154 
155 # Schedule definition
156 process.schedule = cms.Schedule(process.generation_step,
157  process.genfiltersummary_step,
158  process.simulation_step,
159  process.endjob_step,
160  process.analysis_step,
161  process.out_step
162  )
163 
164 from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask
166 # filter all path with the production filter sequence
167 for path in process.paths:
168  getattr(process,path).insert(0, process.ProductionFilterSequence)
169 
170 
171 # Customisation from command line
172 
173 # Add early deletion of temporary data products to reduce peak memory need
174 from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete
175 process = customiseEarlyDelete(process)
176 # 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