Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-10-25 03:22:28

0001 ############################################################
0002 # define basic process
0003 ############################################################
0004 
0005 import FWCore.ParameterSet.Config as cms
0006 import FWCore.Utilities.FileUtils as FileUtils
0007 import os
0008 
0009 ############################################################
0010 # edit options here
0011 ############################################################
0012 L1TRK_INST ="MyL1TrackJets" ### if not in input DIGRAW then we make them in the above step
0013 process = cms.Process(L1TRK_INST)
0014 
0015 #L1TRKALGO = 'HYBRID'  #baseline, 4par fit
0016 # L1TRKALGO = 'HYBRID_DISPLACED'  #extended, 5par fit
0017 L1TRKALGO = 'HYBRID_PROMPTANDDISP'
0018 
0019 DISPLACED = ''
0020 
0021 ############################################################
0022 # import standard configurations
0023 ############################################################
0024 
0025 process.load('Configuration.StandardSequences.Services_cff')
0026 process.load('Configuration.EventContent.EventContent_cff')
0027 process.load('Configuration.StandardSequences.MagneticField_cff')
0028 process.load('Configuration.Geometry.GeometryExtended2026D77Reco_cff')
0029 process.load('Configuration.Geometry.GeometryExtended2026D77_cff')
0030 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0031 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0032 
0033 from Configuration.AlCa.GlobalTag import GlobalTag
0034 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '')
0035 
0036 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0037 process.MessageLogger.cerr.INFO.limit = cms.untracked.int32(0) # default: 0
0038 
0039 ############################################################
0040 # input and output
0041 ############################################################
0042 
0043 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(10))
0044 
0045 readFiles = cms.untracked.vstring(
0046     '/store/relval/CMSSW_12_3_0_pre4/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU_123X_mcRun4_realistic_v3_2026D77PU200-v1/2580000/c6df2819-ed05-4b98-8f92-81b7d1b1092e.root',
0047     '/store/relval/CMSSW_12_3_0_pre4/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU_123X_mcRun4_realistic_v3_2026D77PU200-v1/2580000/3f476d95-1ef7-4be6-977b-6bcd1a7c5678.root',
0048     '/store/relval/CMSSW_12_3_0_pre4/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU_123X_mcRun4_realistic_v3_2026D77PU200-v1/2580000/68d651da-4cb7-4bf4-b002-66aecc57a2bc.root',
0049     '/store/relval/CMSSW_12_3_0_pre4/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU_123X_mcRun4_realistic_v3_2026D77PU200-v1/2580000/db0e0ce2-4c5a-4988-9dbd-52066e40b9d2.root',
0050     '/store/relval/CMSSW_12_3_0_pre4/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU_123X_mcRun4_realistic_v3_2026D77PU200-v1/2580000/257a9712-0a96-47b7-897e-f5d980605e46.root',
0051     '/store/relval/CMSSW_12_3_0_pre4/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU_123X_mcRun4_realistic_v3_2026D77PU200-v1/2580000/bee31399-8559-4243-b539-cae1ea897def.root',
0052     '/store/relval/CMSSW_12_3_0_pre4/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU_123X_mcRun4_realistic_v3_2026D77PU200-v1/2580000/24629540-2377-4168-9ae5-518ddd4c43a9.root',
0053     '/store/relval/CMSSW_12_3_0_pre4/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU_123X_mcRun4_realistic_v3_2026D77PU200-v1/2580000/e31ba8f0-332a-4a1a-8bc0-91a12a5fe3db.root',
0054     '/store/relval/CMSSW_12_3_0_pre4/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU_123X_mcRun4_realistic_v3_2026D77PU200-v1/2580000/17902198-4db6-4fcc-9e8c-787991b4db32.root',
0055 )
0056 secFiles = cms.untracked.vstring()
0057 
0058 process.source = cms.Source ("PoolSource",
0059                             fileNames = readFiles,
0060                             secondaryFileNames = secFiles,
0061                             duplicateCheckMode = cms.untracked.string('noDuplicateCheck'),
0062                             )
0063 
0064 process.source.inputCommands = cms.untracked.vstring("keep *","drop l1tTkPrimaryVertexs_L1TkPrimaryVertex__*")
0065 process.Timing = cms.Service("Timing",
0066   summaryOnly = cms.untracked.bool(False),
0067   useJobReport = cms.untracked.bool(True)
0068 )
0069 
0070 process.TFileService = cms.Service("TFileService", fileName = cms.string('GTTObjects_ttbar200PU.root'), closeFileFast = cms.untracked.bool(True))
0071 
0072 
0073 ############################################################
0074 # L1 tracking: remake stubs?
0075 ############################################################
0076 
0077 process.load('L1Trigger.TrackTrigger.TrackTrigger_cff')
0078 from L1Trigger.TrackTrigger.TTStubAlgorithmRegister_cfi import *
0079 process.load("SimTracker.TrackTriggerAssociation.TrackTriggerAssociator_cff")
0080 
0081 from SimTracker.TrackTriggerAssociation.TTClusterAssociation_cfi import *
0082 TTClusterAssociatorFromPixelDigis.digiSimLinks = cms.InputTag("simSiPixelDigis","Tracker")
0083 
0084 process.TTClusterStub = cms.Path(process.TrackTriggerClustersStubs)
0085 process.TTClusterStubTruth = cms.Path(process.TrackTriggerAssociatorClustersStubs)
0086 
0087 
0088 # DTC emulation
0089 process.load('L1Trigger.TrackerDTC.ProducerES_cff')
0090 process.load('L1Trigger.TrackerDTC.ProducerED_cff')
0091 process.dtc = cms.Path(process.TrackerDTCProducer)#*process.TrackerDTCAnalyzer)
0092 
0093 process.load("L1Trigger.TrackFindingTracklet.L1HybridEmulationTracks_cff")
0094 process.load("L1Trigger.L1TTrackMatch.l1tTrackSelectionProducer_cfi")
0095 process.load("L1Trigger.L1TTrackMatch.l1tTrackJets_cfi")
0096 process.load("L1Trigger.L1TTrackMatch.l1tGTTInputProducer_cfi")
0097 process.load("L1Trigger.L1TTrackMatch.l1tTrackJetsEmulation_cfi")
0098 process.load("L1Trigger.L1TTrackMatch.l1tTrackFastJets_cfi")
0099 process.load("L1Trigger.L1TTrackMatch.l1tTrackerEtMiss_cfi")
0100 process.load("L1Trigger.L1TTrackMatch.l1tTrackerEmuEtMiss_cfi")
0101 process.load("L1Trigger.L1TTrackMatch.l1tTrackerHTMiss_cfi")
0102 process.load("L1Trigger.L1TTrackMatch.l1tTrackerEmuHTMiss_cfi")
0103 process.load('L1Trigger.VertexFinder.l1tVertexProducer_cfi')
0104 
0105 
0106 ############################################################
0107 # Primary vertex
0108 ############################################################
0109 process.l1tVertexFinder = process.l1tVertexProducer.clone()
0110 process.pPV = cms.Path(process.l1tVertexFinder)
0111 process.l1tVertexFinderEmulator = process.l1tVertexProducer.clone()
0112 process.l1tVertexFinderEmulator.VertexReconstruction.Algorithm = "fastHistoEmulation"
0113 process.l1tVertexFinderEmulator.l1TracksInputTag = cms.InputTag("l1tGTTInputProducer","Level1TTTracksConverted")
0114 process.l1tVertexFinderEmulator.VertexReconstruction.VxMinTrackPt = cms.double(0.0)
0115 process.pPVemu = cms.Path(process.l1tVertexFinderEmulator)
0116 
0117 process.l1tTrackFastJets.L1PrimaryVertexTag = cms.InputTag("l1tVertexFinder", "l1vertices")
0118 process.l1tTrackFastJetsExtended.L1PrimaryVertexTag = cms.InputTag("l1tVertexFinder", "l1vertices")
0119 process.l1tTrackJets.L1PVertexCollection = cms.InputTag("l1tVertexFinder", "l1vertices")
0120 process.l1tTrackJetsExtended.L1PVertexCollection = cms.InputTag("l1tVertexFinder", "l1vertices")
0121 process.l1tTrackerEtMiss.L1VertexInputTag = cms.InputTag("l1tVertexFinder", "l1vertices")
0122 process.l1tTrackerHTMiss.L1VertexInputTag = cms.InputTag("l1tVertexFinder", "l1vertices")
0123 process.l1tTrackerEtMissExtended.L1VertexInputTag = cms.InputTag("l1tVertexFinder", "l1vertices")
0124 process.l1tTrackerHTMissExtended.L1VertexInputTag = cms.InputTag("l1tVertexFinder", "l1vertices")
0125 process.l1tTrackerEmuEtMiss.L1VertexInputTag = cms.InputTag("l1tVertexFinderEmulator", "l1verticesEmulation")
0126 
0127 
0128 # HYBRID: prompt tracking
0129 if (L1TRKALGO == 'HYBRID'):
0130     process.TTTracksEmu = cms.Path(process.L1THybridTracks)
0131     process.TTTracksEmuWithTruth = cms.Path(process.L1THybridTracksWithAssociators)
0132     process.pL1TrackSelection = cms.Path(process.l1tTrackSelectionProducer)
0133     process.pL1TrackJets = cms.Path(process.l1tTrackJets)
0134     process.pL1TrackFastJets=cms.Path(process.l1tTrackFastJets)
0135     process.pL1GTTInput = cms.Path(process.l1tGTTInputProducer)
0136     process.pL1TrackJetsEmu = cms.Path(process.l1tTrackJetsEmulation)
0137     process.pTkMET = cms.Path(process.l1tTrackerEtMiss)
0138     process.pTkMETEmu = cms.Path(process.l1tTrackerEmuEtMiss)
0139     process.pTkMHT = cms.Path(process.l1tTrackerHTMiss)
0140     process.pTkMHTEmulator = cms.Path(process.l1tTrackerEmuHTMiss)
0141     DISPLACED = 'Prompt'
0142 
0143 # HYBRID: extended tracking
0144 elif (L1TRKALGO == 'HYBRID_DISPLACED'):
0145     process.TTTracksEmu = cms.Path(process.L1TExtendedHybridTracks)
0146     process.TTTracksEmuWithTruth = cms.Path(process.L1TExtendedHybridTracksWithAssociators)
0147     process.pL1TrackSelection = cms.Path(process.l1tTrackSelectionProducerExtended)
0148     process.pL1TrackJets = cms.Path(process.l1tTrackJetsExtended)
0149     process.pL1TrackFastJets = cms.Path(process.l1tTrackFastJetsExtended)
0150     process.pL1GTTInput = cms.Path(process.l1tGTTInputProducerExtended)
0151     process.pL1TrackJetsEmu = cms.Path(process.l1tTrackJetsExtendedEmulation)
0152     process.pTkMET = cms.Path(process.l1tTrackerEtMissExtended)
0153     #process.pTkMETEmu = cms.Path(process.L1TrackerEmuEtMissExtended) #Doesn't exist
0154     process.pTkMHT = cms.Path(process.l1tTrackerHTMissExtended)
0155     process.pTkMHTEmulator = cms.Path(process.l1tTrackerEmuHTMissExtended)
0156     DISPLACED = 'Displaced'#
0157 
0158 # HYBRID: extended tracking
0159 elif (L1TRKALGO == 'HYBRID_PROMPTANDDISP'):
0160     process.TTTracksEmu = cms.Path(process.L1TPromptExtendedHybridTracks)
0161     process.TTTracksEmuWithTruth = cms.Path(process.L1TPromptExtendedHybridTracksWithAssociators)
0162     process.pL1TrackSelection = cms.Path(process.l1tTrackSelectionProducer*process.l1tTrackSelectionProducerExtended)
0163     process.pL1TrackJets = cms.Path(process.l1tTrackJets*process.l1tTrackJetsExtended)
0164     process.pL1TrackFastJets = cms.Path(process.l1tTrackFastJets*process.l1tTrackFastJetsExtended)
0165     process.pL1GTTInput = cms.Path(process.l1tGTTInputProducer*process.l1tGTTInputProducerExtended)
0166     process.pL1TrackJetsEmu = cms.Path(process.l1tTrackJetsEmulation*process.l1tTrackJetsExtendedEmulation)
0167     process.pTkMET = cms.Path(process.l1tTrackerEtMiss*process.l1tTrackerEtMissExtended)
0168     process.pTkMETEmu = cms.Path(process.l1tTrackerEmuEtMiss)
0169     process.pTkMHT = cms.Path(process.l1tTrackerHTMiss*process.l1tTrackerHTMissExtended)
0170     process.pTkMHTEmulator = cms.Path(process.l1tTrackerEmuHTMiss*process.l1tTrackerEmuHTMissExtended)
0171     DISPLACED = 'Both'
0172 
0173 
0174 
0175 
0176 ############################################################
0177 # Define the track ntuple process, MyProcess is the (unsigned) PDGID corresponding to the process which is run
0178 # e.g. single electron/positron = 11
0179 #      single pion+/pion- = 211
0180 #      single muon+/muon- = 13
0181 #      pions in jets = 6
0182 #      taus = 15
0183 #      all TPs = 1
0184 ############################################################
0185 
0186 process.L1TrackNtuple = cms.EDAnalyzer('L1TrackObjectNtupleMaker',
0187         MyProcess = cms.int32(1),
0188         DebugMode = cms.bool(False),      # printout lots of debug statements
0189         SaveAllTracks = cms.bool(True),  # save *all* L1 tracks, not just truth matched to primary particle
0190         SaveStubs = cms.bool(False),      # save some info for *all* stubs
0191         Displaced = cms.string(DISPLACED),# "Prompt", "Displaced", "Both"
0192         L1Tk_minNStub = cms.int32(4),     # L1 tracks with >= 4 stubs
0193         TP_minNStub = cms.int32(4),       # require TP to have >= X number of stubs associated with it
0194         TP_minNStubLayer = cms.int32(4),  # require TP to have stubs in >= X layers/disks
0195         TP_minPt = cms.double(2.0),       # only save TPs with pt > X GeV
0196         TP_maxEta = cms.double(2.5),      # only save TPs with |eta| < X
0197         TP_maxZ0 = cms.double(15.0),      # only save TPs with |z0| < X cm
0198         L1TrackInputTag = cms.InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks"),                                                      # TTTracks, prompt
0199         L1TrackExtendedInputTag = cms.InputTag("l1tTTTracksFromExtendedTrackletEmulation", "Level1TTTracks"),                                      # TTTracks, extended
0200         MCTruthTrackInputTag = cms.InputTag("TTTrackAssociatorFromPixelDigis", "Level1TTTracks"),                                               # MCTruth track, prompt
0201         MCTruthTrackExtendedInputTag = cms.InputTag("TTTrackAssociatorFromPixelDigisExtended", "Level1TTTracks"),                               # MCTruth track, extended
0202         L1TrackGTTInputTag = cms.InputTag("l1tGTTInputProducer","Level1TTTracksConverted"),                                                      # TTTracks, prompt, GTT converted
0203         L1TrackExtendedGTTInputTag = cms.InputTag("l1tGTTInputProducerExtended","Level1TTTracksExtendedConverted"),                              # TTTracks, extended, GTT converted
0204         L1TrackSelectedInputTag = cms.InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelected"),                                           # TTTracks, prompt, selected
0205         L1TrackSelectedEmulationInputTag = cms.InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelectedEmulation"),                         # TTTracks, prompt, emulation, selected
0206         L1TrackExtendedSelectedInputTag = cms.InputTag("l1tTrackSelectionProducerExtended", "Level1TTTracksExtendedSelected"),                   # TTTracks, extended, selected
0207         L1TrackExtendedSelectedEmulationInputTag = cms.InputTag("l1tTrackSelectionProducerExtended", "Level1TTTracksExtendedSelectedEmulation"), # TTTracks, extended, emulation, selected
0208         L1StubInputTag = cms.InputTag("TTStubsFromPhase2TrackerDigis","StubAccepted"),
0209         MCTruthClusterInputTag = cms.InputTag("TTClusterAssociatorFromPixelDigis", "ClusterAccepted"),
0210         MCTruthStubInputTag = cms.InputTag("TTStubAssociatorFromPixelDigis", "StubAccepted"),
0211         TrackingParticleInputTag = cms.InputTag("mix", "MergedTrackTruth"),
0212         TrackingVertexInputTag = cms.InputTag("mix", "MergedTrackTruth"),
0213         GenJetInputTag = cms.InputTag("ak4GenJets", ""),
0214         ##track jets and track MET
0215         SaveTrackJets = cms.bool(True), #includes emulated jets
0216         SaveTrackSums = cms.bool(True), #includes simulated/emulated track MET, MHT, and HT
0217         TrackFastJetsInputTag = cms.InputTag("l1tTrackFastJets","L1TrackFastJets"),
0218         TrackFastJetsExtendedInputTag = cms.InputTag("l1tTrackFastJetsExtended","L1TrackFastJetsExtended"),
0219         TrackJetsInputTag = cms.InputTag("l1tTrackJets", "L1TrackJets"),
0220         TrackJetsExtendedInputTag=cms.InputTag("l1tTrackJetsExtended", "L1TrackJetsExtended"),
0221         TrackJetsEmuInputTag = cms.InputTag("l1tTrackJetsEmulation","L1TrackJets"),
0222         TrackJetsExtendedEmuInputTag = cms.InputTag("l1tTrackJetsExtendedEmulation","L1TrackJetsExtended"),
0223         TrackMETInputTag = cms.InputTag("l1tTrackerEtMiss","L1TrackerEtMiss"),
0224         TrackMETExtendedInputTag = cms.InputTag("l1tTrackerEtMissExtended","L1TrackerExtendedEtMiss"),
0225         TrackMETEmuInputTag = cms.InputTag("l1tTrackerEmuEtMiss","L1TrackerEmuEtMiss"),
0226         TrackMHTInputTag = cms.InputTag("L1TrackerHTMiss","L1TrackerHTMiss"), #includes HT
0227         TrackMHTExtendedInputTag = cms.InputTag("l1tTrackerHTMissExtended","L1TrackerHTMissExtended"),
0228         TrackMHTEmuInputTag = cms.InputTag("l1tTrackerEmuHTMiss",process.l1tTrackerEmuHTMiss.L1MHTCollectionName.value()),
0229         TrackMHTEmuExtendedInputTag = cms.InputTag("l1tTrackerEmuHTMissExtended",process.l1tTrackerEmuHTMissExtended.L1MHTCollectionName.value()),
0230         GenParticleInputTag = cms.InputTag("genParticles",""),
0231         RecoVertexInputTag=cms.InputTag("l1tVertexFinder", "l1vertices"),
0232         RecoVertexEmuInputTag=cms.InputTag("l1tVertexFinderEmulator", "l1verticesEmulation"),
0233 )
0234 
0235 process.ntuple = cms.Path(process.L1TrackNtuple)
0236 
0237 process.out = cms.OutputModule( "PoolOutputModule",
0238                                 fastCloning = cms.untracked.bool( False ),
0239                                 fileName = cms.untracked.string("test.root" )
0240                        )
0241 process.pOut = cms.EndPath(process.out)
0242 
0243 
0244 # use this if you want to re-run the stub making
0245 # process.schedule = cms.Schedule(process.TTClusterStub,process.TTClusterStubTruth,process.TTTracksEmuWithTruth,process.ntuple)
0246 
0247 # use this if cluster/stub associators not available
0248 # process.schedule = cms.Schedule(process.TTClusterStubTruth,process.TTTracksEmuWithTruth,process.ntuple)
0249 
0250 process.schedule = cms.Schedule(process.TTClusterStub, process.TTClusterStubTruth, process.dtc, process.TTTracksEmuWithTruth, process.pL1GTTInput, process.pPV, process.pPVemu, process.pL1TrackSelection, process.pL1TrackJets, process.pL1TrackJetsEmu,
0251 process.pL1TrackFastJets, process.pTkMET, process.pTkMETEmu, process.pTkMHT, process.pTkMHTEmulator, process.ntuple)