Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-12-01 23:40:31

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