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 PileUp events
0004 # production in tracker only
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.mix_POISSON_average_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) # Tilted is the new default
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 process.maxEvents = cms.untracked.PSet(
0058     input = cms.untracked.int32(5)
0059 )
0060 
0061 # Input source
0062 process.source = cms.Source("EmptySource")
0063 
0064 process.mix.minBunch = cms.int32(-12)
0065 process.mix.bunchspace=cms.int32(25)
0066 process.mix.input.nbPileupEvents.averageNumber = cms.double(20.0)  # The average number of pileup events you want  
0067 process.mix.input.fileNames     = cms.untracked.vstring('file:MBias_100_TkOnly.root') # The file where to pick them up
0068 
0069 # Additional output definition
0070 
0071 process.genstepfilter.triggerConditions=cms.vstring("generation_step")
0072 
0073 from Configuration.AlCa.GlobalTag import GlobalTag
0074 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '')
0075 
0076 process.RandomNumberGeneratorService.generator.initialSeed      = 20
0077 process.RandomNumberGeneratorService.VtxSmeared.initialSeed     = 2
0078 process.RandomNumberGeneratorService.g4SimHits.initialSeed      = 178
0079 process.RandomNumberGeneratorService.mix.initialSeed            = 210
0080 
0081 
0082 # Generate particle gun events
0083 process.generator = cms.EDFilter("Pythia8PtGun",
0084     PGunParameters = cms.PSet(
0085         AddAntiParticle = cms.bool(True),
0086         MaxEta = cms.double(2.5),
0087         MaxPhi = cms.double(3.14159265359),
0088         MaxPt = cms.double(200.0),
0089         MinEta = cms.double(-2.5),
0090         MinPhi = cms.double(-3.14159265359),
0091         MinPt = cms.double(0.9),
0092         ParticleID = cms.vint32(-13, -13)
0093     ),
0094     PythiaParameters = cms.PSet(
0095         parameterSets = cms.vstring()
0096     ),
0097     Verbosity = cms.untracked.int32(0),
0098     firstRun = cms.untracked.uint32(1),
0099     psethack = cms.string('Four mu pt 1 to 200')
0100 )
0101 
0102 
0103 # Output definition
0104 
0105 process.RAWSIMoutput = cms.OutputModule("PoolOutputModule",
0106     splitLevel = cms.untracked.int32(0),
0107     eventAutoFlushCompressedSize = cms.untracked.int32(5242880),
0108     outputCommands = process.RAWSIMEventContent.outputCommands,
0109     fileName = cms.untracked.string('PU_20_sample_TkOnly.root'),
0110     dataset = cms.untracked.PSet(
0111         filterName = cms.untracked.string(''),
0112         dataTier = cms.untracked.string('GEN-SIM')
0113     ),
0114     SelectEvents = cms.untracked.PSet(
0115         SelectEvents = cms.vstring('generation_step')
0116     )
0117 )
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  *_simSi*_*_*')
0124 process.RAWSIMoutput.outputCommands.append('keep  *_*_MergedTrackTruth_*')
0125 process.RAWSIMoutput.outputCommands.append('keep  *_mix_Tracker_*')
0126 
0127 
0128 # Path and EndPath definitions
0129 process.generation_step         = cms.Path(process.pgen)
0130 process.simulation_step         = cms.Path(process.psim)
0131 process.genfiltersummary_step   = cms.EndPath(process.genFilterSummary)
0132 process.digitisationTkOnly_step = cms.Path(process.pdigi_valid)
0133 process.L1TrackTrigger_step     = cms.Path(process.TrackTriggerClustersStubs)
0134 process.L1TTAssociator_step     = cms.Path(process.TrackTriggerAssociatorClustersStubs)
0135 process.endjob_step             = cms.EndPath(process.endOfProcess)
0136 process.RAWSIMoutput_step       = cms.EndPath(process.RAWSIMoutput)
0137 
0138 
0139 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)
0140 
0141 # filter all path with the production filter sequence
0142 for path in process.paths:
0143     getattr(process,path)._seq = process.generator * getattr(process,path)._seq
0144 
0145 
0146 # Automatic addition of the customisation function
0147 from L1Trigger.TrackTrigger.TkOnlyDigi_cff import TkOnlyDigi
0148 process = TkOnlyDigi(process)
0149 # End of customisation functions
0150 
0151 
0152