Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 10:06:41

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun testHGCalTTBar_cfg.py geometry=D92 type=DDD
0004 #
0005 #   Options for geometry: D88, D92, D93, V17Shift, V18
0006 #               type: DDD, DD4hep
0007 #
0008 ###############################################################################
0009 import FWCore.ParameterSet.Config as cms
0010 import os, sys, imp, re, random
0011 import FWCore.ParameterSet.VarParsing as VarParsing
0012 
0013 ####################################################################
0014 ### SETUP OPTIONS
0015 options = VarParsing.VarParsing('standard')
0016 options.register('geometry',
0017                  "D92",
0018                   VarParsing.VarParsing.multiplicity.singleton,
0019                   VarParsing.VarParsing.varType.string,
0020                   "geometry of operations: D88, D92, D93, V17Shift, V18")
0021 options.register('type',
0022                  "DDD",
0023                   VarParsing.VarParsing.multiplicity.singleton,
0024                   VarParsing.VarParsing.varType.string,
0025                   "type of operations: DDD, DD4hep")
0026 
0027 ### get and parse the command line arguments
0028 options.parseArguments()
0029 
0030 print(options)
0031 
0032 ####################################################################
0033 # Use the options
0034 
0035 from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0036 if (options.type == "DD4hep"):
0037     from Configuration.ProcessModifiers.dd4hep_cff import dd4hep
0038     process = cms.Process('SingleMuonSim',Phase2C17I13M9,dd4hep)
0039     if (options.geometry == "V17Shift"):
0040         geomFile = "Geometry.HGCalCommonData.testHGCal" + options.type + options.geometry + "Reco_cff"
0041     elif (options.geometry == "V18"):
0042         geomFile = "Geometry.HGCalCommonData.testHGCal" + options.type + options.geometry + "Reco_cff"
0043     else:
0044         geomFile = "Configuration.Geometry.Geometry" + options.type +"Extended2026" + options.geometry + "Reco_cff"
0045 else:
0046     process = cms.Process('SingleMuonSim',Phase2C17I13M9)
0047     if (options.geometry == "V17Shift"):
0048         geomFile = "Geometry.HGCalCommonData.testHGCal" + options.geometry + "Reco_cff"
0049     elif (options.geometry == "V18"):
0050         geomFile = "Geometry.HGCalCommonData.testHGCal" + options.geometry + "Reco_cff"
0051     else:
0052         geomFile = "Configuration.Geometry.GeometryExtended2026" + options.geometry + "Reco_cff"
0053 
0054 globalTag = "auto:phase2_realistic_T21"
0055 outFile = "file:step1" + options.type + options.geometry + "tt.root"
0056 
0057 print("Geometry file: ", geomFile)
0058 print("Global Tag:    ", globalTag)
0059 print("Output file:   ", outFile)
0060 
0061 # import of standard configurations
0062 process.load(geomFile)
0063 process.load('Configuration.StandardSequences.Services_cff')
0064 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0065 process.load('FWCore.MessageService.MessageLogger_cfi')
0066 process.load('Configuration.EventContent.EventContent_cff')
0067 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
0068 process.load('Configuration.StandardSequences.MagneticField_cff')
0069 process.load('Configuration.StandardSequences.Generator_cff')
0070 process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic50ns13TeVCollision_cfi')
0071 process.load('GeneratorInterface.Core.genFilterSummary_cff')
0072 process.load('Configuration.StandardSequences.SimIdeal_cff')
0073 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0074 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0075 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0076 process.load('SimG4CMS.Calo.hgcalHitPartial_cff')
0077 process.load("IOMC.RandomEngine.IOMC_cff")
0078 
0079 rndm = random.randint(0,200000)
0080 process.RandomNumberGeneratorService.generator.initialSeed = rndm
0081 print("Processing with random number seed: ", rndm)
0082 
0083 process.maxEvents = cms.untracked.PSet(
0084     input = cms.untracked.int32(1000)
0085 )
0086 
0087 process.MessageLogger.cerr.FwkReport.reportEvery = 1
0088 if hasattr(process,'MessageLogger'):
0089     process.MessageLogger.HGCalError=dict()
0090 #   process.MessageLogger.HGCSim=dict()
0091 #   process.MessageLogger.HGCalSim=dict()
0092 
0093 # Input source
0094 process.source = cms.Source("EmptySource")
0095 
0096 process.options = cms.untracked.PSet(
0097     wantSummary = cms.untracked.bool(True),
0098     numberOfConcurrentRuns = cms.untracked.uint32(1),
0099     numberOfStreams = cms.untracked.uint32(0),
0100     numberOfThreads = cms.untracked.uint32(1),
0101     printDependencies = cms.untracked.bool(False),
0102     sizeOfStackForThreadsInKB = cms.optional.untracked.uint32,
0103 )
0104 
0105 # Production Info
0106 process.configurationMetadata = cms.untracked.PSet(
0107     version = cms.untracked.string(''),
0108     annotation = cms.untracked.string(''),
0109     name = cms.untracked.string('Applications')
0110 )
0111 
0112 # Output definition
0113 process.output = cms.OutputModule("PoolOutputModule",
0114     SelectEvents = cms.untracked.PSet(
0115         SelectEvents = cms.vstring('generation_step')
0116     ),
0117     dataset = cms.untracked.PSet(
0118         filterName = cms.untracked.string(''),
0119         dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW-RECO')
0120     ),
0121     fileName = cms.untracked.string(outFile),
0122     outputCommands = process.FEVTDEBUGEventContent.outputCommands,
0123     eventAutoFlushCompressedSize = cms.untracked.int32(5242880),
0124     splitLevel = cms.untracked.int32(0)
0125 )
0126 
0127 # Additional output definition
0128 
0129 # Other statements
0130 process.genstepfilter.triggerConditions=cms.vstring("generation_step")
0131 from Configuration.AlCa.GlobalTag import GlobalTag
0132 process.GlobalTag = GlobalTag(process.GlobalTag, globalTag, '')
0133 
0134 from Configuration.Generator.Pythia8CommonSettings_cfi import *
0135 from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import *
0136 
0137 process.generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter",
0138                                  pythiaHepMCVerbosity = cms.untracked.bool(False),
0139                                  maxEventsToPrint = cms.untracked.int32(0),
0140                                  pythiaPylistVerbosity = cms.untracked.int32(0),
0141                                  filterEfficiency = cms.untracked.double(1.0),
0142                                  comEnergy = cms.double(14000.0),
0143                                  PythiaParameters = cms.PSet(
0144                                          pythia8CommonSettingsBlock,
0145                                          pythia8CUEP8M1SettingsBlock,
0146                                          processParameters = cms.vstring(
0147                                                  'Top:gg2ttbar = on ',
0148                                                  'Top:qqbar2ttbar = on ',
0149                                                  '6:m0 = 175 ',
0150                                         ),
0151                                          parameterSets = cms.vstring('pythia8CommonSettings',
0152                                                                      'pythia8CUEP8M1Settings',
0153                                                                      'processParameters',
0154                                                              )
0155                                  )
0156 )
0157 
0158 
0159 #Modified to produce hgceedigis
0160 process.ProductionFilterSequence = cms.Sequence(process.generator)
0161 
0162 # Path and EndPath definitions
0163 process.generation_step = cms.Path(process.pgen)
0164 process.simulation_step = cms.Path(process.psim)
0165 process.genfiltersummary_step = cms.EndPath(process.genFilterSummary)
0166 process.endjob_step = cms.EndPath(process.endOfProcess)
0167 process.analysis_step = cms.Path(process.hgcalHitPartialEE+process.hgcalHitPartialHE)
0168 process.out_step = cms.EndPath(process.output)
0169 
0170 process.g4SimHits.HGCSD.CheckID = True
0171 process.g4SimHits.HGCScintSD.CheckID = True
0172 
0173 # Schedule definition
0174 process.schedule = cms.Schedule(process.generation_step,
0175                                 process.genfiltersummary_step,
0176                 process.simulation_step,
0177                                 process.endjob_step,
0178                                 process.analysis_step,
0179                 process.out_step
0180                 )
0181 
0182 from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask
0183 associatePatAlgosToolsTask(process)
0184 # filter all path with the production filter sequence
0185 for path in process.paths:
0186         getattr(process,path).insert(0, process.ProductionFilterSequence)
0187 
0188 
0189 # Customisation from command line
0190 
0191 # Add early deletion of temporary data products to reduce peak memory need
0192 from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete
0193 process = customiseEarlyDelete(process)
0194 # End adding early deletion