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")
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 geomFile = "Configuration.Geometry.GeometryExtended2026" + options.geometry + "Reco_cff"
33 globalTag = "auto:phase2_realistic_T21"
34 outFile = "file:step1" + options.geometry + "tt.root"
35 
36 print("Geometry file: ", geomFile)
37 print("Global Tag: ", globalTag)
38 print("Output file: ", outFile)
39 
40 # import of standard configurations
41 process.load(geomFile)
42 process.load('Configuration.StandardSequences.Services_cff')
43 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
44 process.load('FWCore.MessageService.MessageLogger_cfi')
45 process.load('Configuration.EventContent.EventContent_cff')
46 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
47 process.load('Configuration.StandardSequences.MagneticField_cff')
48 process.load('Configuration.StandardSequences.Generator_cff')
49 process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic50ns13TeVCollision_cfi')
50 process.load('GeneratorInterface.Core.genFilterSummary_cff')
51 process.load('Configuration.StandardSequences.SimIdeal_cff')
52 process.load('Configuration.StandardSequences.EndOfProcess_cff')
53 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
54 process.load('Configuration.StandardSequences.EndOfProcess_cff')
55 process.load('SimG4CMS.Calo.hgcalHitPartial_cff')
56 process.load("IOMC.RandomEngine.IOMC_cff")
57 
58 rndm = random.randint(0,200000)
59 process.RandomNumberGeneratorService.generator.initialSeed = rndm
60 print("Processing with random number seed: ", rndm)
61 
62 process.maxEvents = cms.untracked.PSet(
63  input = cms.untracked.int32(1000)
64 )
65 
66 process.MessageLogger.cerr.FwkReport.reportEvery = 1
67 #if hasattr(process,'MessageLogger'):
68 # process.MessageLogger.ValidHGCal=dict()
69 # process.MessageLogger.HGCalGeom=dict()
70 # process.MessageLogger.HGCalSim=dict()
71 
72 # Input source
73 process.source = cms.Source("EmptySource")
74 
75 process.options = cms.untracked.PSet(
76  wantSummary = cms.untracked.bool(True),
77  numberOfConcurrentRuns = cms.untracked.uint32(1),
78  numberOfStreams = cms.untracked.uint32(0),
79  numberOfThreads = cms.untracked.uint32(1),
80  printDependencies = cms.untracked.bool(False),
81  sizeOfStackForThreadsInKB = cms.optional.untracked.uint32,
82 )
83 
84 # Production Info
85 process.configurationMetadata = cms.untracked.PSet(
86  version = cms.untracked.string(''),
87  annotation = cms.untracked.string(''),
88  name = cms.untracked.string('Applications')
89 )
90 
91 # Output definition
92 process.output = cms.OutputModule("PoolOutputModule",
93  SelectEvents = cms.untracked.PSet(
94  SelectEvents = cms.vstring('generation_step')
95  ),
96  dataset = cms.untracked.PSet(
97  filterName = cms.untracked.string(''),
98  dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW-RECO')
99  ),
100  fileName = cms.untracked.string(outFile),
101  outputCommands = process.FEVTDEBUGEventContent.outputCommands,
102  eventAutoFlushCompressedSize = cms.untracked.int32(5242880),
103  splitLevel = cms.untracked.int32(0)
104 )
105 
106 # Additional output definition
107 
108 # Other statements
109 process.genstepfilter.triggerConditions=cms.vstring("generation_step")
110 from Configuration.AlCa.GlobalTag import GlobalTag
111 process.GlobalTag = GlobalTag(process.GlobalTag, globalTag, '')
112 
115 
116 process.generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter",
117  pythiaHepMCVerbosity = cms.untracked.bool(False),
118  maxEventsToPrint = cms.untracked.int32(0),
119  pythiaPylistVerbosity = cms.untracked.int32(0),
120  filterEfficiency = cms.untracked.double(1.0),
121  comEnergy = cms.double(14000.0),
122  PythiaParameters = cms.PSet(
123  pythia8CommonSettingsBlock,
124  pythia8CUEP8M1SettingsBlock,
125  processParameters = cms.vstring(
126  'Top:gg2ttbar = on ',
127  'Top:qqbar2ttbar = on ',
128  '6:m0 = 175 ',
129  ),
130  parameterSets = cms.vstring('pythia8CommonSettings',
131  'pythia8CUEP8M1Settings',
132  'processParameters',
133  )
134  )
135 )
136 
137 
138 #Modified to produce hgceedigis
139 process.ProductionFilterSequence = cms.Sequence(process.generator)
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)
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