Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-03-26 02:43:45

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.GeometryExtended2026D49Reco_cff')
0029 process.load('Configuration.Geometry.GeometryExtended2026D49_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     # 'file:F7BF4AED-51F1-9D47-B86D-6C3DDA134AB9.root'
0047     '/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/F7BF4AED-51F1-9D47-B86D-6C3DDA134AB9.root',
0048 '/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/075DCEC8-A2E9-7E48-A630-E1CBF89370A9.root',
0049 '/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/07EEAB60-C58E-6146-804B-6BA1B8E14875.root',
0050 '/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/09C2F689-B97E-6C44-94D2-C76445A4D703.root',
0051 '/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/01816581-F04F-B849-83AA-38A348F9320B.root',
0052 '/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/11564303-DE2D-474D-99ED-F4CB2793C5FB.root',
0053 '/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/176B2AC1-57AA-DE46-85FC-D375D25C4C2A.root',
0054 '/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/1818154D-11CB-9841-932A-A48845A430B6.root',
0055 '/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/19678708-B88E-A547-884E-CD1D924B2D3C.root',
0056 '/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/1D2905A5-5CB9-BB41-8C59-64427CEE7082.root',
0057 '/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v2_2026D49PU200-v1/20000/1F59B52D-BD93-CA4A-BB59-64E00A436EEF.root'
0058 )
0059 secFiles = cms.untracked.vstring()
0060 
0061 process.source = cms.Source ("PoolSource",
0062                             fileNames = readFiles,
0063                             secondaryFileNames = secFiles,
0064                             duplicateCheckMode = cms.untracked.string('noDuplicateCheck'),
0065                             )
0066 
0067 
0068 process.TFileService = cms.Service("TFileService", fileName = cms.string('GTTObjects_ttbar200PU.root'), closeFileFast = cms.untracked.bool(True))
0069 
0070 
0071 ############################################################
0072 # L1 tracking: remake stubs?
0073 ############################################################
0074 
0075 process.load('L1Trigger.TrackTrigger.TrackTrigger_cff')
0076 from L1Trigger.TrackTrigger.TTStubAlgorithmRegister_cfi import *
0077 process.load("SimTracker.TrackTriggerAssociation.TrackTriggerAssociator_cff")
0078 
0079 from SimTracker.TrackTriggerAssociation.TTClusterAssociation_cfi import *
0080 TTClusterAssociatorFromPixelDigis.digiSimLinks = cms.InputTag("simSiPixelDigis","Tracker")
0081 
0082 process.TTClusterStub = cms.Path(process.TrackTriggerClustersStubs)
0083 process.TTClusterStubTruth = cms.Path(process.TrackTriggerAssociatorClustersStubs)
0084 
0085 
0086 # DTC emulation
0087 process.load('L1Trigger.TrackerDTC.ProducerES_cff')
0088 process.load('L1Trigger.TrackerDTC.ProducerED_cff')
0089 process.dtc = cms.Path(process.TrackerDTCProducer)#*process.TrackerDTCAnalyzer)
0090 
0091 process.load("L1Trigger.TrackFindingTracklet.L1HybridEmulationTracks_cff")
0092 process.load("L1Trigger.L1TTrackMatch.L1TrackSelectionProducer_cfi")
0093 process.load("L1Trigger.L1TTrackMatch.L1TrackJetProducer_cfi")
0094 process.load("L1Trigger.L1TTrackMatch.L1GTTInputProducer_cfi")
0095 process.load("L1Trigger.L1TTrackMatch.L1TrackJetEmulationProducer_cfi")
0096 process.load("L1Trigger.L1TTrackMatch.L1TrackFastJetProducer_cfi")
0097 process.load("L1Trigger.L1TTrackMatch.L1TrackerEtMissProducer_cfi")
0098 process.load("L1Trigger.L1TTrackMatch.L1TrackerEtMissEmulatorProducer_cfi")
0099 process.load("L1Trigger.L1TTrackMatch.L1TkHTMissProducer_cfi")
0100 process.load("L1Trigger.L1TTrackMatch.L1TkHTMissEmulatorProducer_cfi")
0101 process.load('L1Trigger.VertexFinder.VertexProducer_cff')
0102 
0103 
0104 ############################################################
0105 # Primary vertex
0106 ############################################################
0107 process.L1VertexFinder = process.VertexProducer.clone()
0108 process.pPV = cms.Path(process.L1VertexFinder)
0109 process.L1VertexFinderEmulator = process.VertexProducer.clone()
0110 process.L1VertexFinderEmulator.VertexReconstruction.Algorithm = "fastHistoEmulation"
0111 process.L1VertexFinderEmulator.l1TracksInputTag = cms.InputTag("L1GTTInputProducer","Level1TTTracksConverted")
0112 process.pPVemu = cms.Path(process.L1VertexFinderEmulator)
0113 
0114 process.L1TrackFastJets.L1PrimaryVertexTag = cms.InputTag("L1VertexFinder", "l1vertices")
0115 process.L1TrackFastJetsExtended.L1PrimaryVertexTag = cms.InputTag("L1VertexFinder", "l1vertices")
0116 process.L1TrackJets.L1PVertexCollection = cms.InputTag("L1VertexFinder", "l1vertices")
0117 process.L1TrackJetsExtended.L1PVertexCollection = cms.InputTag("L1VertexFinder", "l1vertices")
0118 process.L1TrackerEtMiss.L1VertexInputTag = cms.InputTag("L1VertexFinder", "l1vertices")
0119 process.L1TrackerHTMiss.L1VertexInputTag = cms.InputTag("L1VertexFinder", "l1vertices")
0120 process.L1TrackerEtMissExtended.L1VertexInputTag = cms.InputTag("L1VertexFinder", "l1vertices")
0121 process.L1TrackerHTMissExtended.L1VertexInputTag = cms.InputTag("L1VertexFinder", "l1vertices")
0122 process.L1TrackerEmuEtMiss.L1VertexInputTag = cms.InputTag("L1VertexFinderEmulator", "l1verticesEmulation")
0123 
0124 
0125 # HYBRID: prompt tracking
0126 if (L1TRKALGO == 'HYBRID'):
0127     process.TTTracksEmu = cms.Path(process.L1HybridTracks)
0128     process.TTTracksEmuWithTruth = cms.Path(process.L1HybridTracksWithAssociators)
0129     process.pL1TrackSelection = cms.Path(process.L1TrackSelectionProducer)
0130     process.pL1TrackJets = cms.Path(process.L1TrackJets)
0131     process.pL1TrackFastJets=cms.Path(process.L1TrackFastJets)
0132     process.pL1GTTInput = cms.Path(process.L1GTTInputProducer)
0133     process.pL1TrackJetsEmu = cms.Path(process.L1TrackJetsEmulation)
0134     process.pTkMET = cms.Path(process.L1TrackerEtMiss)
0135     process.pTkMETEmu = cms.Path(process.L1TrackerEmuEtMiss)
0136     process.pTkMHT = cms.Path(process.L1TrackerHTMiss)
0137     process.pTkMHTEmulator = cms.Path(process.L1TrackerEmuHTMiss)
0138     DISPLACED = 'Prompt'
0139 
0140 # HYBRID: extended tracking
0141 elif (L1TRKALGO == 'HYBRID_DISPLACED'):
0142     process.TTTracksEmu = cms.Path(process.L1ExtendedHybridTracks)
0143     process.TTTracksEmuWithTruth = cms.Path(process.L1ExtendedHybridTracksWithAssociators)
0144     process.pL1TrackSelection = cms.Path(process.L1TrackSelectionProducerExtended)
0145     process.pL1TrackJets = cms.Path(process.L1TrackJetsExtended)
0146     process.pL1TrackFastJets = cms.Path(process.L1TrackFastJetsExtended)
0147     process.pL1GTTInput = cms.Path(process.L1GTTInputProducerExtended)
0148     process.pL1TrackJetsEmu = cms.Path(process.L1TrackJetsExtendedEmulation)
0149     process.pTkMET = cms.Path(process.L1TrackerEtMissExtended)
0150     #process.pTkMETEmu = cms.Path(process.L1TrackerEmuEtMissExtended) #Doesn't exist
0151     process.pTkMHT = cms.Path(process.L1TrackerHTMissExtended)
0152     process.pTkMHTEmulator = cms.Path(process.L1TrackerEmuHTMissExtended)
0153     DISPLACED = 'Displaced'#
0154 
0155 # HYBRID: extended tracking
0156 elif (L1TRKALGO == 'HYBRID_PROMPTANDDISP'):
0157     process.TTTracksEmu = cms.Path(process.L1PromptExtendedHybridTracks)
0158     process.TTTracksEmuWithTruth = cms.Path(process.L1PromptExtendedHybridTracksWithAssociators)
0159     process.pL1TrackSelection = cms.Path(process.L1TrackSelectionProducer*process.L1TrackSelectionProducerExtended)
0160     process.pL1TrackJets = cms.Path(process.L1TrackJets*process.L1TrackJetsExtended)
0161     process.pL1TrackFastJets = cms.Path(process.L1TrackFastJets*process.L1TrackFastJetsExtended)
0162     process.pL1GTTInput = cms.Path(process.L1GTTInputProducer*process.L1GTTInputProducerExtended)
0163     process.pL1TrackJetsEmu = cms.Path(process.L1TrackJetsEmulation*process.L1TrackJetsExtendedEmulation)
0164     process.pTkMET = cms.Path(process.L1TrackerEtMiss*process.L1TrackerEtMissExtended)
0165     process.pTkMETEmu = cms.Path(process.L1TrackerEmuEtMiss)
0166     process.pTkMHT = cms.Path(process.L1TrackerHTMiss*process.L1TrackerHTMissExtended)
0167     process.pTkMHTEmulator = cms.Path(process.L1TrackerEmuHTMiss*process.L1TrackerEmuHTMissExtended)
0168     DISPLACED = 'Both'
0169 
0170 
0171 
0172 
0173 ############################################################
0174 # Define the track ntuple process, MyProcess is the (unsigned) PDGID corresponding to the process which is run
0175 # e.g. single electron/positron = 11
0176 #      single pion+/pion- = 211
0177 #      single muon+/muon- = 13
0178 #      pions in jets = 6
0179 #      taus = 15
0180 #      all TPs = 1
0181 ############################################################
0182 
0183 process.L1TrackNtuple = cms.EDAnalyzer('L1TrackObjectNtupleMaker',
0184         MyProcess = cms.int32(1),
0185         DebugMode = cms.bool(False),      # printout lots of debug statements
0186         SaveAllTracks = cms.bool(True),  # save *all* L1 tracks, not just truth matched to primary particle
0187         SaveStubs = cms.bool(False),      # save some info for *all* stubs
0188         Displaced = cms.string(DISPLACED),# "Prompt", "Displaced", "Both"
0189         L1Tk_minNStub = cms.int32(4),     # L1 tracks with >= 4 stubs
0190         TP_minNStub = cms.int32(4),       # require TP to have >= X number of stubs associated with it
0191         TP_minNStubLayer = cms.int32(4),  # require TP to have stubs in >= X layers/disks
0192         TP_minPt = cms.double(2.0),       # only save TPs with pt > X GeV
0193         TP_maxEta = cms.double(2.5),      # only save TPs with |eta| < X
0194         TP_maxZ0 = cms.double(15.0),      # only save TPs with |z0| < X cm
0195         L1TrackInputTag = cms.InputTag("TTTracksFromTrackletEmulation", "Level1TTTracks"),                                                      # TTTracks, prompt
0196         L1TrackExtendedInputTag = cms.InputTag("TTTracksFromExtendedTrackletEmulation", "Level1TTTracks"),                                      # TTTracks, extended
0197         MCTruthTrackInputTag = cms.InputTag("TTTrackAssociatorFromPixelDigis", "Level1TTTracks"),                                               # MCTruth track, prompt
0198         MCTruthTrackExtendedInputTag = cms.InputTag("TTTrackAssociatorFromPixelDigisExtended", "Level1TTTracks"),                               # MCTruth track, extended
0199         L1TrackGTTInputTag = cms.InputTag("L1GTTInputProducer","Level1TTTracksConverted"),                                                      # TTTracks, prompt, GTT converted
0200         L1TrackExtendedGTTInputTag = cms.InputTag("L1GTTInputProducerExtended","Level1TTTracksExtendedConverted"),                              # TTTracks, extended, GTT converted
0201         L1TrackSelectedInputTag = cms.InputTag("L1TrackSelectionProducer", "Level1TTTracksSelected"),                                           # TTTracks, prompt, selected
0202         L1TrackSelectedEmulationInputTag = cms.InputTag("L1TrackSelectionProducer", "Level1TTTracksSelectedEmulation"),                         # TTTracks, prompt, emulation, selected
0203         L1TrackExtendedSelectedInputTag = cms.InputTag("L1TrackSelectionProducerExtended", "Level1TTTracksExtendedSelected"),                   # TTTracks, extended, selected
0204         L1TrackExtendedSelectedEmulationInputTag = cms.InputTag("L1TrackSelectionProducerExtended", "Level1TTTracksExtendedSelectedEmulation"), # TTTracks, extended, emulation, selected
0205         L1StubInputTag = cms.InputTag("TTStubsFromPhase2TrackerDigis","StubAccepted"),
0206         MCTruthClusterInputTag = cms.InputTag("TTClusterAssociatorFromPixelDigis", "ClusterAccepted"),
0207         MCTruthStubInputTag = cms.InputTag("TTStubAssociatorFromPixelDigis", "StubAccepted"),
0208         TrackingParticleInputTag = cms.InputTag("mix", "MergedTrackTruth"),
0209         TrackingVertexInputTag = cms.InputTag("mix", "MergedTrackTruth"),
0210         GenJetInputTag = cms.InputTag("ak4GenJets", ""),
0211         ##track jets and track MET
0212         SaveTrackJets = cms.bool(True), #includes emulated jets
0213         SaveTrackSums = cms.bool(True), #includes simulated/emulated track MET, MHT, and HT
0214         TrackFastJetsInputTag = cms.InputTag("L1TrackFastJets","L1TrackFastJets"),
0215         TrackFastJetsExtendedInputTag = cms.InputTag("L1TrackFastJetsExtended","L1TrackFastJetsExtended"),
0216         TrackJetsInputTag = cms.InputTag("L1TrackJets", "L1TrackJets"),
0217         TrackJetsExtendedInputTag=cms.InputTag("L1TrackJetsExtended", "L1TrackJetsExtended"),
0218         TrackJetsEmuInputTag = cms.InputTag("L1TrackJetsEmulation","L1TrackJets"),
0219         TrackJetsExtendedEmuInputTag = cms.InputTag("L1TrackJetsExtendedEmulation","L1TrackJetsExtended"),
0220         TrackMETInputTag = cms.InputTag("L1TrackerEtMiss","L1TrackerEtMiss"),
0221         TrackMETExtendedInputTag = cms.InputTag("L1TrackerEtMissExtended","L1TrackerExtendedEtMiss"),
0222         TrackMETEmuInputTag = cms.InputTag("L1TrackerEmuEtMiss","L1TrackerEmuEtMiss"),
0223         TrackMHTInputTag = cms.InputTag("L1TrackerHTMiss","L1TrackerHTMiss"), #includes HT
0224         TrackMHTExtendedInputTag = cms.InputTag("L1TrackerHTMissExtended","L1TrackerHTMissExtended"),
0225         TrackMHTEmuInputTag = cms.InputTag("L1TrackerEmuHTMiss",process.L1TrackerEmuHTMiss.L1MHTCollectionName.value()),
0226         TrackMHTEmuExtendedInputTag = cms.InputTag("L1TrackerEmuHTMissExtended",process.L1TrackerEmuHTMissExtended.L1MHTCollectionName.value()),
0227         GenParticleInputTag = cms.InputTag("genParticles",""),
0228         RecoVertexInputTag=cms.InputTag("L1VertexFinder", "l1vertices"),
0229         RecoVertexEmuInputTag=cms.InputTag("L1VertexFinderEmulator", "l1verticesEmulation"),
0230 )
0231 
0232 process.ntuple = cms.Path(process.L1TrackNtuple)
0233 
0234 process.out = cms.OutputModule( "PoolOutputModule",
0235                                 fastCloning = cms.untracked.bool( False ),
0236                                 fileName = cms.untracked.string("test.root" )
0237                        )
0238 process.pOut = cms.EndPath(process.out)
0239 
0240 
0241 # use this if you want to re-run the stub making
0242 # process.schedule = cms.Schedule(process.TTClusterStub,process.TTClusterStubTruth,process.TTTracksEmuWithTruth,process.ntuple)
0243 
0244 # use this if cluster/stub associators not available
0245 # process.schedule = cms.Schedule(process.TTClusterStubTruth,process.TTTracksEmuWithTruth,process.ntuple)
0246 
0247 process.schedule = cms.Schedule(process.TTClusterStub, process.TTClusterStubTruth, process.dtc, process.TTTracksEmuWithTruth, process.pL1GTTInput, process.pPV, process.pPVemu, process.pL1TrackSelection, process.pL1TrackJets, process.pL1TrackJetsEmu,
0248 process.pL1TrackFastJets, process.pTkMET, process.pTkMETEmu, process.pTkMHT, process.pTkMHTEmulator, process.ntuple)