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