File indexing completed on 2024-11-15 23:40:48
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 GEOMETRY = "D98"
0020
0021
0022
0023
0024
0025
0026 L1TRKALGO = 'HYBRID'
0027
0028 WRITE_DATA = False
0029
0030
0031
0032
0033
0034 process.load('Configuration.StandardSequences.Services_cff')
0035 process.load('Configuration.EventContent.EventContent_cff')
0036 process.load('Configuration.StandardSequences.MagneticField_cff')
0037
0038 process.load('FWCore.MessageService.MessageLogger_cfi')
0039 process.MessageLogger.L1track = dict(limit = -1)
0040 process.MessageLogger.Tracklet = dict(limit = -1)
0041 process.MessageLogger.TrackTriggerHPH = dict(limit = -1)
0042
0043 if GEOMETRY == "D88" or GEOMETRY == 'D98':
0044 print("using geometry " + GEOMETRY + " (tilted)")
0045 process.load('Configuration.Geometry.GeometryExtended2026' + GEOMETRY + 'Reco_cff')
0046 process.load('Configuration.Geometry.GeometryExtended2026' + GEOMETRY +'_cff')
0047 else:
0048 print("this is not a valid geometry!!!")
0049
0050 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0051 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0052
0053 from Configuration.AlCa.GlobalTag import GlobalTag
0054
0055
0056 process.GlobalTag = GlobalTag(process.GlobalTag, '133X_mcRun4_realistic_v1', '')
0057
0058
0059
0060
0061
0062
0063 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(100))
0064
0065
0066
0067
0068
0069
0070
0071 if GEOMETRY == "D98":
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085 inputMC = ["/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"]
0086
0087 elif GEOMETRY == "D88":
0088
0089
0090 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"]
0091
0092 else:
0093
0094 print("this is not a valid geometry!!!")
0095
0096 process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring(*inputMC))
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111 process.TFileService = cms.Service("TFileService", fileName = cms.string('L1TrkNtuple.root'), closeFileFast = cms.untracked.bool(True))
0112 process.Timing = cms.Service("Timing", summaryOnly = cms.untracked.bool(True))
0113
0114
0115
0116
0117
0118
0119 process.load('L1Trigger.TrackTrigger.TrackTrigger_cff')
0120 process.load('L1Trigger.TrackerTFP.ProducerES_cff')
0121 process.load('L1Trigger.TrackerTFP.ProducerLayerEncoding_cff')
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135 process.load('L1Trigger.TrackerDTC.ProducerED_cff')
0136
0137
0138
0139
0140
0141
0142
0143
0144 process.dtc = cms.Path(process.TrackerDTCProducer)
0145
0146 process.TrackerDTCProducer.CheckHistory = True
0147
0148
0149
0150
0151
0152 process.load("L1Trigger.TrackFindingTracklet.L1HybridEmulationTracks_cff")
0153
0154
0155 if (L1TRKALGO == 'HYBRID'):
0156 process.TTTracksEmulation = cms.Path(process.L1THybridTracks)
0157 process.TTTracksEmulationWithTruth = cms.Path(process.L1THybridTracksWithAssociators)
0158 NHELIXPAR = 4
0159 L1TRK_NAME = "l1tTTTracksFromTrackletEmulation"
0160 L1TRK_LABEL = "Level1TTTracks"
0161 L1TRUTH_NAME = "TTTrackAssociatorFromPixelDigis"
0162
0163
0164 elif (L1TRKALGO == 'HYBRID_DISPLACED'):
0165 process.TTTracksEmulation = cms.Path(process.L1TExtendedHybridTracks)
0166 process.TTTracksEmulationWithTruth = cms.Path(process.L1TExtendedHybridTracksWithAssociators)
0167 NHELIXPAR = 5
0168 L1TRK_NAME = "l1tTTTracksFromExtendedTrackletEmulation"
0169 L1TRK_LABEL = "Level1TTTracks"
0170 L1TRUTH_NAME = "TTTrackAssociatorFromPixelDigisExtended"
0171
0172
0173 elif (L1TRKALGO == 'HYBRID_NEWKF' or L1TRKALGO == 'HYBRID_REDUCED'):
0174 process.load( 'L1Trigger.TrackFindingTracklet.Producer_cff' )
0175 NHELIXPAR = 4
0176 L1TRK_NAME = process.TrackFindingTrackletProducer_params.LabelKFout.value()
0177 L1TRK_LABEL = process.TrackFindingTrackletProducer_params.BranchAcceptedTTTracks.value()
0178 L1TRUTH_NAME = "TTTrackAssociatorFromPixelDigis"
0179 process.TTTrackAssociatorFromPixelDigis.TTTracks = cms.VInputTag( cms.InputTag(L1TRK_NAME, L1TRK_LABEL) )
0180 process.HybridNewKF = cms.Sequence(process.L1THybridTracks + process.TrackFindingTrackletProducerTBout + process.TrackFindingTrackletProducerDRin + process.TrackFindingTrackletProducerDR + process.TrackFindingTrackletProducerKFin + process.TrackFindingTrackletProducerKF + process.TrackFindingTrackletProducerKFout)
0181 process.TTTracksEmulation = cms.Path(process.HybridNewKF)
0182
0183
0184 process.load( 'SimTracker.TrackTriggerAssociation.StubAssociator_cff' )
0185 process.load( 'L1Trigger.TrackFindingTracklet.Analyzer_cff' )
0186 process.TTTracksEmulationWithTruth = cms.Path(process.HybridNewKF + process.TrackTriggerAssociatorTracks + process.StubAssociator + process.TrackFindingTrackletAnalyzerTracklet + process.TrackFindingTrackletAnalyzerTBout + process.TrackFindingTrackletAnalyzerDRin + process.TrackFindingTrackletAnalyzerDR + process.TrackFindingTrackletAnalyzerKFin + process.TrackFindingTrackletAnalyzerKF + process.TrackFindingTrackletAnalyzerKFout)
0187 from L1Trigger.TrackFindingTracklet.Customize_cff import *
0188 if (L1TRKALGO == 'HYBRID_NEWKF'):
0189 fwConfig( process )
0190 if (L1TRKALGO == 'HYBRID_REDUCED'):
0191 reducedConfig( process )
0192
0193 process.HitPatternHelperSetup.useNewKF = True
0194
0195
0196 elif (L1TRKALGO == 'TRACKLET'):
0197 print("\n WARNING: This is not the baseline algorithm! Prefer HYBRID or HYBRID_DISPLACED!")
0198 print("\n To run the Tracklet-only algorithm, ensure you have commented out 'CXXFLAGS=-DUSEHYBRID' in BuildFile.xml & recompiled! \n")
0199 process.TTTracksEmulation = cms.Path(process.L1THybridTracks)
0200 process.TTTracksEmulationWithTruth = cms.Path(process.L1THybridTracksWithAssociators)
0201 from L1Trigger.TrackFindingTracklet.Customize_cff import *
0202 trackletConfig( process )
0203 NHELIXPAR = 4
0204 L1TRK_NAME = "l1tTTTracksFromTrackletEmulation"
0205 L1TRK_LABEL = "Level1TTTracks"
0206 L1TRUTH_NAME = "TTTrackAssociatorFromPixelDigis"
0207
0208
0209 elif (L1TRKALGO == 'TMTT'):
0210 print("\n WARNING: This is not the baseline algorithm! Prefer HYBRID or HYBRID_DISPLACED! \n")
0211 process.load("L1Trigger.TrackFindingTMTT.TMTrackProducer_Ultimate_cff")
0212 L1TRK_PROC = process.TMTrackProducer
0213 L1TRK_NAME = "TMTrackProducer"
0214 L1TRK_LABEL = "TML1TracksKF4ParamsComb"
0215 L1TRUTH_NAME = "TTTrackAssociatorFromPixelDigis"
0216 NHELIXPAR = 4
0217 L1TRK_PROC.EnableMCtruth = cms.bool(False)
0218 L1TRK_PROC.EnableHistos = cms.bool(False)
0219 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cfi")
0220 process.load("SimTracker.TrackTriggerAssociation.TrackTriggerAssociator_cff")
0221 process.TTTrackAssociatorFromPixelDigis.TTTracks = cms.VInputTag( cms.InputTag(L1TRK_NAME, L1TRK_LABEL) )
0222 process.TTTracksEmulation = cms.Path(process.offlineBeamSpot*L1TRK_PROC)
0223 process.TTTracksEmulationWithTruth = cms.Path(process.offlineBeamSpot*L1TRK_PROC*process.TrackTriggerAssociatorTracks)
0224
0225 else:
0226 print("ERROR: Unknown L1TRKALGO option")
0227 exit(1)
0228
0229
0230
0231 from L1Trigger.TrackFindingTracklet.L1TrackNtupleMaker_cfi import *
0232 process.L1TrackNtuple = L1TrackNtupleMaker.clone(
0233 L1Tk_nPar = NHELIXPAR,
0234 L1TrackInputTag = (L1TRK_NAME, L1TRK_LABEL),
0235 MCTruthTrackInputTag = (L1TRUTH_NAME, L1TRK_LABEL),
0236 )
0237
0238 process.ana = cms.Path(process.L1TrackNtuple)
0239
0240
0241
0242
0243
0244
0245
0246
0247
0248
0249
0250
0251
0252 process.schedule = cms.Schedule(process.dtc,process.TTTracksEmulationWithTruth,process.ana)
0253
0254
0255
0256
0257
0258
0259 if (WRITE_DATA):
0260 process.writeDataset = cms.OutputModule("PoolOutputModule",
0261 splitLevel = cms.untracked.int32(0),
0262 eventAutoFlushCompressedSize = cms.untracked.int32(5242880),
0263 outputCommands = process.RAWSIMEventContent.outputCommands,
0264 fileName = cms.untracked.string('output_dataset.root'),
0265 dataset = cms.untracked.PSet(
0266 filterName = cms.untracked.string(''),
0267 dataTier = cms.untracked.string('GEN-SIM')
0268 )
0269 )
0270 process.writeDataset.outputCommands.append('keep *TTTrack*_*_*_*')
0271 process.writeDataset.outputCommands.append('keep *TTStub*_*_*_*')
0272
0273 process.pd = cms.EndPath(process.writeDataset)
0274 process.schedule.append(process.pd)
0275
0276
0277