File indexing completed on 2021-02-14 13:30:46
0001
0002
0003
0004
0005
0006
0007 import FWCore.ParameterSet.Config as cms
0008 import FWCore.Utilities.FileUtils as FileUtils
0009 import FWCore.ParameterSet.VarParsing as VarParsing
0010 import os
0011
0012 process = cms.Process("Demo")
0013
0014 GEOMETRY = "D49"
0015
0016 if GEOMETRY == "D49":
0017 process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff')
0018 process.load('Configuration.Geometry.GeometryExtended2026D49_cff')
0019 else:
0020 print "this is not a valid geometry!!!"
0021 exit
0022
0023 process.load('Configuration.StandardSequences.MagneticField_cff')
0024 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0025 from Configuration.AlCa.GlobalTag import GlobalTag
0026 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '')
0027
0028 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0029 process.MessageLogger.L1track = cms.untracked.PSet(limit = cms.untracked.int32(-1))
0030
0031 options = VarParsing.VarParsing ('analysis')
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 if GEOMETRY == "D49":
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055 inputMC = ["/store/relval/CMSSW_11_2_0_pre5/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/FDFA00CE-FA93-0142-B187-99CBD4A43944.root"]
0056
0057
0058 options.register('Events',100,VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.int,"Number of Events to analyze")
0059
0060
0061 options.register('histFile','Hist.root',VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string,"Name of output histogram file")
0062
0063
0064 options.register('makeStubs',0,VarParsing.VarParsing.multiplicity.singleton,VarParsing.VarParsing.varType.int,"Make stubs, and truth association, on the fly")
0065
0066
0067
0068 options.register('outputDataset',0,VarParsing.VarParsing.multiplicity.singleton,VarParsing.VarParsing.varType.int,"Create GEN-SIM-DIGI-RAW dataset containing TMTT L1 tracks")
0069
0070 options.parseArguments()
0071
0072
0073
0074 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.Events) )
0075
0076 process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring(*inputMC))
0077
0078 outputHistFile = options.histFile
0079
0080 if outputHistFile != "":
0081 process.TFileService = cms.Service("TFileService", fileName = cms.string(outputHistFile))
0082
0083 process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(False) )
0084 process.Timing = cms.Service("Timing", summaryOnly = cms.untracked.bool(True))
0085
0086
0087
0088
0089
0090 process.load('L1Trigger.TrackFindingTMTT.TMTrackProducer_Ultimate_cff')
0091
0092
0093 process.TMTrackProducer.EnableMCtruth = True
0094 process.TMTrackProducer.EnableHistos = True
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107 process.p = cms.Path(process.TMTrackProducer)
0108
0109
0110 if options.makeStubs == 1:
0111 process.load('L1Trigger.TrackTrigger.TrackTrigger_cff')
0112 process.load('SimTracker.TrackTriggerAssociation.TrackTriggerAssociator_cff')
0113 process.TTClusterAssociatorFromPixelDigis.digiSimLinks = cms.InputTag("simSiPixelDigis","Tracker")
0114
0115 LOOSE_STUBS = False
0116
0117 if (LOOSE_STUBS):
0118
0119
0120
0121
0122 process.TTStubAlgorithm_official_Phase2TrackerDigi_ = cms.ESProducer("TTStubAlgorithm_official_Phase2TrackerDigi_",
0123 zMatchingPS = cms.bool(True),
0124 zMatching2S = cms.bool(True),
0125
0126 NTiltedRings = cms.vdouble( 0., 12., 12., 12., 0., 0., 0.),
0127 BarrelCut = cms.vdouble( 0, 2.0, 3, 4.5, 6, 6.5, 7.0),
0128 TiltedBarrelCutSet = cms.VPSet(
0129 cms.PSet( TiltedCut = cms.vdouble( 0 ) ),
0130 cms.PSet( TiltedCut = cms.vdouble( 0, 3, 3., 2.5, 3., 3., 2.5, 2.5, 2., 1.5, 1.5, 1, 1) ),
0131 cms.PSet( TiltedCut = cms.vdouble( 0, 4., 4, 4, 4, 4., 4., 4.5, 5, 4., 3.5, 3.5, 3) ),
0132 cms.PSet( TiltedCut = cms.vdouble( 0, 5, 5, 5, 5, 5, 5, 5.5, 5, 5, 5.5, 5.5, 5.5) ),
0133 ),
0134 EndcapCutSet = cms.VPSet(
0135 cms.PSet( EndcapCut = cms.vdouble( 0 ) ),
0136 cms.PSet( EndcapCut = cms.vdouble( 0, 1., 2.5, 2.5, 3.5, 5.5, 5.5, 6, 6.5, 6.5, 6.5, 6.5, 6.5, 6.5, 7, 7) ),
0137 cms.PSet( EndcapCut = cms.vdouble( 0, 0.5, 2.5, 2.5, 3, 5, 6, 6, 6.5, 6.5, 6.5, 6.5, 6.5, 6.5, 7, 7) ),
0138 cms.PSet( EndcapCut = cms.vdouble( 0, 1, 3., 4.5, 6., 6.5, 6.5, 6.5, 7, 7, 7, 7, 7) ),
0139 cms.PSet( EndcapCut = cms.vdouble( 0, 1., 2.5, 3.5, 6., 6.5, 6.5, 6.5, 6.5, 7, 7, 7, 7) ),
0140 cms.PSet( EndcapCut = cms.vdouble( 0, 0.5, 1.5, 3., 4.5, 6.5, 6.5, 7, 7, 7, 7, 7, 7) ),
0141 )
0142 )
0143
0144 else:
0145
0146
0147
0148 process.TTStubAlgorithm_official_Phase2TrackerDigi_ = cms.ESProducer("TTStubAlgorithm_official_Phase2TrackerDigi_",
0149 zMatchingPS = cms.bool(True),
0150 zMatching2S = cms.bool(True),
0151
0152 NTiltedRings = cms.vdouble( 0., 12., 12., 12., 0., 0., 0.),
0153 BarrelCut = cms.vdouble( 0, 2.0, 2.0, 3.5, 4.5, 5.5, 6.5),
0154
0155 TiltedBarrelCutSet = cms.VPSet(
0156 cms.PSet( TiltedCut = cms.vdouble( 0 ) ),
0157 cms.PSet( TiltedCut = cms.vdouble( 0, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2., 2., 1.5, 1.5, 1., 1.) ),
0158 cms.PSet( TiltedCut = cms.vdouble( 0, 3., 3., 3., 3., 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2, 2) ),
0159 cms.PSet( TiltedCut = cms.vdouble( 0, 4.5, 4.5, 4, 4, 4, 4, 3.5, 3.5, 3.5, 3, 3, 3) ),
0160 ),
0161 EndcapCutSet = cms.VPSet(
0162 cms.PSet( EndcapCut = cms.vdouble( 0 ) ),
0163 cms.PSet( EndcapCut = cms.vdouble( 0, 1, 1.5, 1.5, 2, 2, 2.5, 3, 3, 3.5, 4, 2.5, 3, 3.5, 4.5, 5.5) ),
0164 cms.PSet( EndcapCut = cms.vdouble( 0, 1, 1.5, 1.5, 2, 2, 2, 2.5, 3, 3, 3, 2, 3, 4, 5, 5.5) ),
0165 cms.PSet( EndcapCut = cms.vdouble( 0, 1.5, 1.5, 2, 2, 2.5, 2.5, 2.5, 3.5, 2.5, 5, 5.5, 6) ),
0166 cms.PSet( EndcapCut = cms.vdouble( 0, 1.0, 1.5, 1.5, 2, 2, 2, 2, 3, 3, 6, 6, 6.5) ),
0167 cms.PSet( EndcapCut = cms.vdouble( 0, 1.0, 1.5, 1.5, 1.5, 2, 2, 2, 3, 3, 6, 6, 6.5) ),
0168 )
0169 )
0170
0171 process.p = cms.Path(process.TrackTriggerClustersStubs * process.TrackTriggerAssociatorClustersStubs * process.TMTrackProducer)
0172
0173
0174 if options.outputDataset == 1:
0175
0176
0177 process.load('SimTracker.TrackTriggerAssociation.TrackTriggerAssociator_cff')
0178 process.TTAssociatorTMTT = process.TTTrackAssociatorFromPixelDigis.clone(
0179
0180 TTTracks = cms.VInputTag(cms.InputTag("TMTrackProducer", 'TML1TracksKF4ParamsComb'))
0181
0182 )
0183 process.pa = cms.Path(process.TTAssociatorTMTT)
0184
0185
0186 process.load('Configuration.EventContent.EventContent_cff')
0187
0188 process.writeDataset = cms.OutputModule("PoolOutputModule",
0189 splitLevel = cms.untracked.int32(0),
0190 eventAutoFlushCompressedSize = cms.untracked.int32(5242880),
0191 outputCommands = process.RAWSIMEventContent.outputCommands,
0192 fileName = cms.untracked.string('output_dataset.root'),
0193 dataset = cms.untracked.PSet(
0194 filterName = cms.untracked.string(''),
0195 dataTier = cms.untracked.string('GEN-SIM')
0196 )
0197 )
0198
0199 process.writeDataset.outputCommands.append('keep *TTTrack*_*_*_*')
0200 process.writeDataset.outputCommands.append('keep *TTStub*_*_*_*')
0201
0202 process.pd = cms.EndPath(process.writeDataset)
0203 process.schedule = cms.Schedule(process.p, process.pa, process.pd)