File indexing completed on 2025-06-03 00:12:26
0001
0002
0003
0004
0005
0006
0007
0008 import FWCore.ParameterSet.Config as cms
0009 import FWCore.Utilities.FileUtils as FileUtils
0010 import os
0011 process = cms.Process("L1TrackNtuple")
0012
0013
0014
0015
0016
0017
0018
0019
0020 GEOMETRY = "D110"
0021
0022
0023
0024
0025
0026
0027 L1TRKALGO = 'HYBRID'
0028
0029 WRITE_DATA = False
0030
0031
0032
0033
0034
0035 process.load('Configuration.StandardSequences.Services_cff')
0036 process.load('Configuration.EventContent.EventContent_cff')
0037 process.load('Configuration.StandardSequences.MagneticField_cff')
0038
0039 process.load('FWCore.MessageService.MessageLogger_cfi')
0040 process.MessageLogger.L1track = dict(limit = -1)
0041 process.MessageLogger.Tracklet = dict(limit = -1)
0042 process.MessageLogger.TrackTriggerHPH = dict(limit = -1)
0043
0044
0045 print("using geometry " + GEOMETRY + " (tilted)")
0046 process.load('Configuration.Geometry.GeometryExtendedRun4' + GEOMETRY + 'Reco_cff')
0047 process.load('Configuration.Geometry.GeometryExtendedRun4' + GEOMETRY +'_cff')
0048 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0049 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0050 from Configuration.AlCa.GlobalTag import GlobalTag
0051
0052 if GEOMETRY == "D88" or GEOMETRY == 'D98':
0053 process.GlobalTag = GlobalTag(process.GlobalTag, '133X_mcRun4_realistic_v1', '')
0054 elif GEOMETRY == 'D110':
0055 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '')
0056 else:
0057 print("this is not a valid geometry!!!")
0058
0059 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0060 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0061
0062
0063
0064
0065
0066
0067 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1000))
0068
0069
0070
0071
0072
0073
0074
0075 if GEOMETRY == "D98":
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089 inputMC = [
0090 '/store/relval/CMSSW_14_0_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU_133X_mcRun4_realistic_v1_STD_2026D98_PU200_RV229-v1/2580000/0b2b0b0b-f312-48a8-9d46-ccbadc69bbfd.root',
0091 '/store/relval/CMSSW_14_0_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU_133X_mcRun4_realistic_v1_STD_2026D98_PU200_RV229-v1/2580000/0c3cb20d-8556-450d-b4f0-e5c754818f74.root',
0092 '/store/relval/CMSSW_14_0_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU_133X_mcRun4_realistic_v1_STD_2026D98_PU200_RV229-v1/2580000/0eafa2b4-711a-43ec-be1c-7e564c294a9a.root',
0093 '/store/relval/CMSSW_14_0_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU_133X_mcRun4_realistic_v1_STD_2026D98_PU200_RV229-v1/2580000/1450b1bb-171e-495e-a767-68e2796d95c2.root',
0094 '/store/relval/CMSSW_14_0_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU_133X_mcRun4_realistic_v1_STD_2026D98_PU200_RV229-v1/2580000/15498564-9cf0-4219-aab7-f97b3484b122.root',
0095 '/store/relval/CMSSW_14_0_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU_133X_mcRun4_realistic_v1_STD_2026D98_PU200_RV229-v1/2580000/1838a806-316b-4f53-9d22-5b3856019623.root',
0096 '/store/relval/CMSSW_14_0_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU_133X_mcRun4_realistic_v1_STD_2026D98_PU200_RV229-v1/2580000/1a34eb87-b9a3-47fb-b945-57e6f775fcac.root',
0097 '/store/relval/CMSSW_14_0_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU_133X_mcRun4_realistic_v1_STD_2026D98_PU200_RV229-v1/2580000/1add5b2e-19cb-4581-956d-271907d03b72.root',
0098 '/store/relval/CMSSW_14_0_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU_133X_mcRun4_realistic_v1_STD_2026D98_PU200_RV229-v1/2580000/1bed1837-ef65-4e07-a2ac-13c705b20fc1.root',
0099 '/store/relval/CMSSW_14_0_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU_133X_mcRun4_realistic_v1_STD_2026D98_PU200_RV229-v1/2580000/1d057884-72bd-4353-8375-ec4616c00a33.root'
0100 ]
0101
0102 elif GEOMETRY == "D88":
0103
0104
0105 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"]
0106
0107 elif GEOMETRY == "D110":
0108
0109
0110 inputMC = ["/store/mc/Phase2Spring24DIGIRECOMiniAOD/TT_TuneCP5_14TeV-powheg-pythia8/GEN-SIM-DIGI-RAW-MINIAOD/PU200_Trk1GeV_140X_mcRun4_realistic_v4-v2/130000/00c7f40e-b44e-4eea-a86b-def8f7d82b0e.root"]
0111
0112 else:
0113
0114 print("this is not a valid geometry!!!")
0115
0116 process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring(*inputMC))
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131 process.TFileService = cms.Service("TFileService", fileName = cms.string('L1TrkNtuple.root'), closeFileFast = cms.untracked.bool(True))
0132 process.Timing = cms.Service("Timing", summaryOnly = cms.untracked.bool(True))
0133
0134
0135
0136
0137
0138
0139 process.load('L1Trigger.TrackTrigger.TrackTrigger_cff')
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153 process.load( 'SimTracker.TrackTriggerAssociation.StubAssociator_cff' )
0154
0155 process.load('L1Trigger.TrackerDTC.DTC_cff')
0156
0157
0158 process.load('L1Trigger.TrackerDTC.Analyzer_cff')
0159
0160
0161
0162
0163
0164 process.dtc = cms.Path(process.StubAssociator + process.ProducerDTC + process.AnalyzerDTC)
0165
0166
0167
0168
0169
0170 process.load("L1Trigger.TrackFindingTracklet.L1HybridEmulationTracks_cff")
0171
0172
0173 if (L1TRKALGO == 'HYBRID'):
0174 process.load( 'L1Trigger.TrackFindingTracklet.Analyzer_cff' )
0175 process.TTTracksEmulation = cms.Path(process.L1THybridTracks)
0176 process.TTTracksEmulationWithTruth = cms.Path(process.L1THybridTracksWithAssociators + process.AnalyzerTracklet)
0177 NHELIXPAR = 4
0178 L1TRK_NAME = "l1tTTTracksFromTrackletEmulation"
0179 L1TRK_LABEL = "Level1TTTracks"
0180 L1TRUTH_NAME = "TTTrackAssociatorFromPixelDigis"
0181
0182
0183 elif (L1TRKALGO == 'HYBRID_DISPLACED'):
0184 process.TTTracksEmulation = cms.Path(process.L1TExtendedHybridTracks)
0185 process.TTTracksEmulationWithTruth = cms.Path(process.L1TExtendedHybridTracksWithAssociators)
0186 NHELIXPAR = 5
0187 L1TRK_NAME = "l1tTTTracksFromExtendedTrackletEmulation"
0188 L1TRK_LABEL = "Level1TTTracks"
0189 L1TRUTH_NAME = "TTTrackAssociatorFromPixelDigisExtended"
0190
0191
0192 elif (L1TRKALGO == 'HYBRID_NEWKF' or L1TRKALGO == 'HYBRID_REDUCED'):
0193 process.load( 'L1Trigger.TrackFindingTracklet.Producer_cff' )
0194 process.load( 'L1Trigger.TrackFindingTracklet.Analyzer_cff' )
0195 NHELIXPAR = 4
0196 L1TRK_NAME = process.TrackFindingTrackletAnalyzer_params.OutputLabelTFP.value()
0197 L1TRK_LABEL = process.TrackFindingTrackletProducer_params.BranchTTTracks.value()
0198 L1TRUTH_NAME = "TTTrackAssociatorFromPixelDigis"
0199 process.TTTrackAssociatorFromPixelDigis.TTTracks = cms.VInputTag( cms.InputTag(L1TRK_NAME, L1TRK_LABEL) )
0200 process.HybridNewKF = cms.Sequence(process.L1THybridTracks + process.ProducerTM + process.ProducerDR + process.ProducerKF + process.ProducerTQ + process.ProducerTFP)
0201 process.TTTracksEmulation = cms.Path(process.HybridNewKF)
0202
0203
0204 process.load( 'SimTracker.TrackTriggerAssociation.StubAssociator_cff' )
0205 process.TTTracksEmulationWithTruth = cms.Path(process.HybridNewKF + process.TrackTriggerAssociatorTracks + process.StubAssociator + process.AnalyzerTracklet + process.AnalyzerTM + process.AnalyzerDR + process.AnalyzerKF + process.AnalyzerTQ + process.AnalyzerTFP )
0206 from L1Trigger.TrackFindingTracklet.Customize_cff import *
0207 if (L1TRKALGO == 'HYBRID_NEWKF'):
0208 fwConfig( process )
0209 if (L1TRKALGO == 'HYBRID_REDUCED'):
0210 reducedConfig( process )
0211
0212 process.HitPatternHelperSetup.useNewKF = True
0213
0214
0215 elif (L1TRKALGO == 'TRACKLET'):
0216 print("\n WARNING: This is not the baseline algorithm! Prefer HYBRID or HYBRID_DISPLACED!")
0217 print("\n To run the Tracklet-only algorithm, ensure you have commented out 'CXXFLAGS=-DUSEHYBRID' in BuildFile.xml & recompiled! \n")
0218 process.TTTracksEmulation = cms.Path(process.L1THybridTracks)
0219 process.TTTracksEmulationWithTruth = cms.Path(process.L1THybridTracksWithAssociators)
0220 from L1Trigger.TrackFindingTracklet.Customize_cff import *
0221 trackletConfig( process )
0222 NHELIXPAR = 4
0223 L1TRK_NAME = "l1tTTTracksFromTrackletEmulation"
0224 L1TRK_LABEL = "Level1TTTracks"
0225 L1TRUTH_NAME = "TTTrackAssociatorFromPixelDigis"
0226
0227
0228 elif (L1TRKALGO == 'TMTT'):
0229 print("\n WARNING: This is not the baseline algorithm! Prefer HYBRID or HYBRID_DISPLACED! \n")
0230 process.load("L1Trigger.TrackFindingTMTT.TMTrackProducer_Ultimate_cff")
0231 L1TRK_PROC = process.TMTrackProducer
0232 L1TRK_NAME = "TMTrackProducer"
0233 L1TRK_LABEL = "TML1TracksKF4ParamsComb"
0234 L1TRUTH_NAME = "TTTrackAssociatorFromPixelDigis"
0235 NHELIXPAR = 4
0236 L1TRK_PROC.EnableMCtruth = cms.bool(False)
0237 L1TRK_PROC.EnableHistos = cms.bool(False)
0238 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cfi")
0239 process.load("SimTracker.TrackTriggerAssociation.TrackTriggerAssociator_cff")
0240 process.TTTrackAssociatorFromPixelDigis.TTTracks = cms.VInputTag( cms.InputTag(L1TRK_NAME, L1TRK_LABEL) )
0241 process.TTTracksEmulation = cms.Path(process.offlineBeamSpot*L1TRK_PROC)
0242 process.TTTracksEmulationWithTruth = cms.Path(process.offlineBeamSpot*L1TRK_PROC*process.TrackTriggerAssociatorTracks)
0243
0244 else:
0245 print("ERROR: Unknown L1TRKALGO option")
0246 exit(1)
0247
0248
0249
0250 from L1Trigger.TrackFindingTracklet.L1TrackNtupleMaker_cfi import *
0251 process.L1TrackNtuple = L1TrackNtupleMaker.clone(
0252 L1Tk_nPar = NHELIXPAR,
0253 L1TrackInputTag = (L1TRK_NAME, L1TRK_LABEL),
0254 MCTruthTrackInputTag = (L1TRUTH_NAME, L1TRK_LABEL),
0255 )
0256
0257 process.ana = cms.Path(process.L1TrackNtuple)
0258
0259
0260
0261
0262
0263
0264
0265
0266
0267
0268
0269
0270
0271 process.schedule = cms.Schedule(process.dtc,process.TTTracksEmulationWithTruth,process.ana)
0272
0273
0274
0275
0276
0277
0278 if (WRITE_DATA):
0279 process.writeDataset = cms.OutputModule("PoolOutputModule",
0280 splitLevel = cms.untracked.int32(0),
0281 eventAutoFlushCompressedSize = cms.untracked.int32(5242880),
0282 outputCommands = process.RAWSIMEventContent.outputCommands,
0283 fileName = cms.untracked.string('output_dataset.root'),
0284 dataset = cms.untracked.PSet(
0285 filterName = cms.untracked.string(''),
0286 dataTier = cms.untracked.string('GEN-SIM')
0287 )
0288 )
0289 process.writeDataset.outputCommands.append('keep *TTTrack*_*_*_*')
0290 process.writeDataset.outputCommands.append('keep *TTStub*_*_*_*')
0291
0292 process.pd = cms.EndPath(process.writeDataset)
0293 process.schedule.append(process.pd)
0294
0295
0296