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