Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:11

0001 from __future__ import print_function
0002 #########################
0003 #
0004 # Configuration file for simple PGUN events
0005 # production in Tracker-Only geometry
0006 #
0007 # Author: S.Viret (viret@in2p3.fr)
0008 # Date  : 16/02/2017
0009 #
0010 # Script tested with release CMSSW_10_0_0_pre1
0011 #
0012 #########################
0013 #
0014 # Here you choose if you want flat (True) or tilted (False) geometry
0015 #
0016 
0017 flat=False
0018 
0019 ###################
0020 
0021 import FWCore.ParameterSet.Config as cms
0022 
0023 process = cms.Process('STUBS')
0024 
0025 # import of standard configurations
0026 process.load('Configuration.StandardSequences.Services_cff')
0027 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0028 process.load('FWCore.MessageService.MessageLogger_cfi')
0029 process.load('Configuration.EventContent.EventContent_cff')
0030 process.load('Configuration.StandardSequences.MagneticField_cff')
0031 process.load('Configuration.StandardSequences.Generator_cff')
0032 process.load('Configuration.StandardSequences.SimIdeal_cff')
0033 process.load('Configuration.StandardSequences.Digi_cff')
0034 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
0035 process.load('IOMC.EventVertexGenerators.VtxSmearedGauss_cfi')
0036 process.load('GeneratorInterface.Core.genFilterSummary_cff')
0037 process.load('L1Trigger.TrackTrigger.TrackTrigger_cff')
0038 process.load('SimTracker.TrackTriggerAssociation.TrackTriggerAssociator_cff')
0039 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0040 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0041 
0042 if flat:
0043     print('You choose the flat geometry')
0044     process.load('L1Trigger.TrackTrigger.TkOnlyFlatGeom_cff') # Special config file for TkOnly geometry
0045     process.TTStubAlgorithm_official_Phase2TrackerDigi_.zMatchingPS = cms.bool(False) 
0046     process.TTStubAlgorithm_official_Phase2TrackerDigi_.EndcapCutSet = cms.VPSet(
0047         cms.PSet( EndcapCut = cms.vdouble( 0 ) ),
0048         cms.PSet( EndcapCut = cms.vdouble( 0, 0.5, 2, 3.5, 2, 3.5, 5.5, 6, 6.5, 6.5, 6.5, 6.5, 6.5, 6.5, 7, 7) ),
0049         cms.PSet( EndcapCut = cms.vdouble( 0, 0.5, 1.5, 3, 2, 3, 5, 6, 6.5, 6.5, 6.5, 5, 6.5, 6.5, 7, 7) ),
0050         cms.PSet( EndcapCut = cms.vdouble( 0, 0.5, 0.5, 0.5, 1, 1.5, 3, 4.5, 6, 6.5, 6.5, 7, 7, 7, 7, 7) ),
0051         cms.PSet( EndcapCut = cms.vdouble( 0, 0.5, 0.5, 0.5, 0.5, 1.5, 2., 3.5, 5., 6.5, 6.5, 6.5, 6, 7, 7, 7) ),
0052         cms.PSet( EndcapCut = cms.vdouble( 0, 0.5, 0.5, 0.5, 0.5, 1., 1.5, 2.5, 4., 5, 7, 5.5, 7, 7, 7, 7) ),
0053         )
0054 else:
0055     print('You choose the tilted geometry')
0056     process.load('L1Trigger.TrackTrigger.TkOnlyTiltedGeom_cff') # Special config file for TkOnly geometry
0057 
0058 
0059 process.maxEvents = cms.untracked.PSet(
0060     input = cms.untracked.int32(100)
0061 )
0062 
0063 # Input source
0064 process.source = cms.Source("EmptySource")
0065 
0066 
0067 # Output definition
0068 
0069 process.RAWSIMoutput = cms.OutputModule("PoolOutputModule",
0070     splitLevel = cms.untracked.int32(0),
0071     eventAutoFlushCompressedSize = cms.untracked.int32(5242880),
0072     outputCommands = process.RAWSIMEventContent.outputCommands,
0073     fileName = cms.untracked.string('PGun_example_TkOnly.root'),
0074     dataset = cms.untracked.PSet(
0075         filterName = cms.untracked.string(''),
0076         dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW-FEVT')
0077     ),
0078     SelectEvents = cms.untracked.PSet(
0079         SelectEvents = cms.vstring('generation_step')
0080     )
0081 )
0082 
0083 # Additional output definition
0084 # Other statements
0085 process.genstepfilter.triggerConditions=cms.vstring("generation_step")
0086 from Configuration.AlCa.GlobalTag import GlobalTag
0087 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '')
0088 
0089 
0090 # Random seeds
0091 process.RandomNumberGeneratorService.generator.initialSeed      = 1
0092 process.RandomNumberGeneratorService.VtxSmeared.initialSeed     = 2
0093 process.RandomNumberGeneratorService.g4SimHits.initialSeed      = 3
0094 process.RandomNumberGeneratorService.mix.initialSeed            = 4
0095 
0096 # Generate particle gun events
0097 process.generator = cms.EDFilter("Pythia8PtGun",
0098     PGunParameters = cms.PSet(
0099         AddAntiParticle = cms.bool(True),
0100         MaxEta = cms.double(2.5),
0101         MaxPhi = cms.double(3.14159265359),
0102         MaxPt = cms.double(200.0),
0103         MinEta = cms.double(-2.5),
0104         MinPhi = cms.double(-3.14159265359),
0105         MinPt = cms.double(0.9),
0106         ParticleID = cms.vint32(-13, -13)
0107     ),
0108     PythiaParameters = cms.PSet(
0109         parameterSets = cms.vstring()
0110     ),
0111     Verbosity = cms.untracked.int32(0),
0112     firstRun = cms.untracked.uint32(1),
0113     psethack = cms.string('Four mu pt 1 to 200')
0114 )
0115 
0116 
0117 # This line is necessary to keep track of the Tracking Particles
0118 
0119 process.RAWSIMoutput.outputCommands.append('keep  *_*_*_*')
0120 process.RAWSIMoutput.outputCommands.append('drop  *_mix_*_STUBS')
0121 process.RAWSIMoutput.outputCommands.append('drop  PCaloHits_*_*_*')
0122 process.RAWSIMoutput.outputCommands.append('drop  *_ak*_*_*')
0123 process.RAWSIMoutput.outputCommands.append('drop  *_simSiPixelDigis_*_*')
0124 process.RAWSIMoutput.outputCommands.append('keep  *_*_MergedTrackTruth_*')
0125 process.RAWSIMoutput.outputCommands.append('keep  *_mix_Tracker_*')
0126 
0127 # Path and EndPath definitions
0128 process.generation_step         = cms.Path(process.pgen)
0129 process.simulation_step         = cms.Path(process.psim)
0130 process.genfiltersummary_step   = cms.EndPath(process.genFilterSummary)
0131 process.digitisationTkOnly_step = cms.Path(process.pdigi_valid)
0132 process.L1TrackTrigger_step     = cms.Path(process.TrackTriggerClustersStubs)
0133 process.L1TTAssociator_step     = cms.Path(process.TrackTriggerAssociatorClustersStubs)
0134 process.endjob_step             = cms.EndPath(process.endOfProcess)
0135 process.RAWSIMoutput_step       = cms.EndPath(process.RAWSIMoutput)
0136 
0137 
0138 process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.digitisationTkOnly_step,process.L1TrackTrigger_step,process.L1TTAssociator_step,process.endjob_step,process.RAWSIMoutput_step)
0139 
0140 # filter all path with the production filter sequence
0141 for path in process.paths:
0142     getattr(process,path)._seq = process.generator * getattr(process,path)._seq
0143     
0144 # Automatic addition of the customisation function 
0145 
0146 from L1Trigger.TrackTrigger.TkOnlyDigi_cff import TkOnlyDigi
0147 
0148 process = TkOnlyDigi(process) # TkOnly digitization
0149 
0150 # End of customisation functions    
0151