CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
L1TrackObjectNtupleMaker_cfg.py
Go to the documentation of this file.
1 ############################################################
2 # define basic process
3 ############################################################
4 
5 import FWCore.ParameterSet.Config as cms
6 import FWCore.Utilities.FileUtils as FileUtils
7 import os
8 
9 ############################################################
10 # edit options here
11 ############################################################
12 L1TRK_INST ="L1TrackJets" ### if not in input DIGRAW then we make them in the above step
13 process = cms.Process(L1TRK_INST)
14 
15 L1TRKALGO = 'HYBRID' #baseline, 4par fit
16 # L1TRKALGO = 'HYBRID_DISPLACED' #extended, 5par fit
17 #L1TRKALGO = 'HYBRID_PROMPTANDDISP'
18 
19 DISPLACED = ''
20 
21 ############################################################
22 # import standard configurations
23 ############################################################
24 
25 process.load('Configuration.StandardSequences.Services_cff')
26 process.load('Configuration.EventContent.EventContent_cff')
27 process.load('Configuration.StandardSequences.MagneticField_cff')
28 process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff')
29 process.load('Configuration.Geometry.GeometryExtended2026D49_cff')
30 process.load('Configuration.StandardSequences.EndOfProcess_cff')
31 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
32 
33 from Configuration.AlCa.GlobalTag import GlobalTag
34 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '')
35 
36 ############################################################
37 # input and output
38 ############################################################
39 
40 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(50))
41 
42 readFiles = cms.untracked.vstring(
43  "/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"
44 )
45 secFiles = cms.untracked.vstring()
46 
47 process.source = cms.Source ("PoolSource",
48  fileNames = readFiles,
49  secondaryFileNames = secFiles,
50  duplicateCheckMode = cms.untracked.string('noDuplicateCheck'),
51  )
52 
53 
54 process.TFileService = cms.Service("TFileService", fileName = cms.string('CheckingJets_CMSSW11_CMS.root'), closeFileFast = cms.untracked.bool(True))
55 
56 
57 ############################################################
58 # L1 tracking: remake stubs?
59 ############################################################
60 
61 #process.load('L1Trigger.TrackTrigger.TrackTrigger_cff')
62 #from L1Trigger.TrackTrigger.TTStubAlgorithmRegister_cfi import *
63 #process.load("SimTracker.TrackTriggerAssociation.TrackTriggerAssociator_cff")
64 
65 #from SimTracker.TrackTriggerAssociation.TTClusterAssociation_cfi import *
66 #TTClusterAssociatorFromPixelDigis.digiSimLinks = cms.InputTag("simSiPixelDigis","Tracker")
67 
68 #process.TTClusterStub = cms.Path(process.TrackTriggerClustersStubs)
69 #process.TTClusterStubTruth = cms.Path(process.TrackTriggerAssociatorClustersStubs)
70 
71 
72 process.load("L1Trigger.TrackFindingTracklet.L1HybridEmulationTracks_cff")
73 process.load("L1Trigger.L1TTrackMatch.L1TrackJetProducer_cfi")
74 process.load("L1Trigger.L1TTrackMatch.L1TrackFastJetProducer_cfi")
75 process.load("L1Trigger.L1TTrackMatch.L1TrackerEtMissProducer_cfi")
76 process.load("L1Trigger.L1TTrackMatch.L1TkHTMissProducer_cfi")
77 
78 
79 # HYBRID: prompt tracking
80 if (L1TRKALGO == 'HYBRID'):
81  process.TTTracksEmulation = cms.Path(process.L1HybridTracks)
82  process.TTTracksEmulationWithTruth = cms.Path(process.L1HybridTracksWithAssociators)
83  process.pL1TrackJets = cms.Path(process.L1TrackJets)
84  process.pL1TrackFastJets=cms.Path(process.L1TrackFastJets)
85  process.pTkMET = cms.Path(process.L1TrackerEtMiss)
86  process.pTkMHT = cms.Path(process.L1TrackerHTMiss)
87  DISPLACED = 'Prompt'
88 
89 # HYBRID: extended tracking
90 elif (L1TRKALGO == 'HYBRID_DISPLACED'):
91  process.TTTracksEmulation = cms.Path(process.L1ExtendedHybridTracks)
92  process.TTTracksEmulationWithTruth = cms.Path(process.L1ExtendedHybridTracksWithAssociators)
93  process.pL1TrackJets = cms.Path(process.L1TrackJetsExtended)
94  process.pL1TrackFastJets = cms.Path(process.L1TrackFastJetsExtended)
95  process.pTkMET = cms.Path(process.L1TrackerEtMissExtended)
96  process.pTkMHT = cms.Path(process.L1TrackerHTMissExtended)
97  DISPLACED = 'Displaced'#
98 
99 # HYBRID: extended tracking
100 elif (L1TRKALGO == 'HYBRID_PROMPTANDDISP'):
101  process.TTTracksEmulation = cms.Path(process.L1PromptExtendedHybridTracks)
102  process.TTTracksEmulationWithTruth = cms.Path(process.L1PromptExtendedHybridTracksWithAssociators)
103  process.pL1TrackJets = cms.Path(process.L1TrackJets*process.L1TrackJetsExtended)
104  process.pL1TrackFastJets = cms.Path(process.L1TrackFastJets*process.L1TrackFastJetsExtended)
105  process.pTkMET = cms.Path(process.L1TrackerEtMiss*process.L1TrackerEtMissExtended)
106  process.pTkMHT = cms.Path(process.L1TrackerHTMiss*process.L1TrackerHTMissExtended)
107  DISPLACED = 'Both'
108 
109 
110 ############################################################
111 # Primary vertex
112 ############################################################
113 process.load("L1Trigger.L1TTrackMatch.L1TkPrimaryVertexProducer_cfi")
114 process.pPV = cms.Path(process.L1TkPrimaryVertex)
115 
116 
117 ############################################################
118 # Define the track ntuple process, MyProcess is the (unsigned) PDGID corresponding to the process which is run
119 # e.g. single electron/positron = 11
120 # single pion+/pion- = 211
121 # single muon+/muon- = 13
122 # pions in jets = 6
123 # taus = 15
124 # all TPs = 1
125 ############################################################
126 
127 process.L1TrackNtuple = cms.EDAnalyzer('L1TrackObjectNtupleMaker',
128  MyProcess = cms.int32(1),
129  DebugMode = cms.bool(False), # printout lots of debug statements
130  SaveAllTracks = cms.bool(True), # save *all* L1 tracks, not just truth matched to primary particle
131  SaveStubs = cms.bool(False), # save some info for *all* stubs
132  Displaced = cms.string(DISPLACED),# "Prompt", "Displaced", "Both"
133  L1Tk_minNStub = cms.int32(4), # L1 tracks with >= 4 stubs
134  TP_minNStub = cms.int32(4), # require TP to have >= X number of stubs associated with it
135  TP_minNStubLayer = cms.int32(4), # require TP to have stubs in >= X layers/disks
136  TP_minPt = cms.double(2.0), # only save TPs with pt > X GeV
137  TP_maxEta = cms.double(2.5), # only save TPs with |eta| < X
138  TP_maxZ0 = cms.double(30.0), # only save TPs with |z0| < X cm
139  L1TrackInputTag = cms.InputTag("TTTracksFromTrackletEmulation", "Level1TTTracks"), # TTTracks, prompt
140  L1TrackExtendedInputTag = cms.InputTag("TTTracksFromExtendedTrackletEmulation", "Level1TTTracks"), # TTTracks, extended
141  MCTruthTrackInputTag = cms.InputTag("TTTrackAssociatorFromPixelDigis", "Level1TTTracks"), # MCTruth track, prompt
142  MCTruthTrackExtendedInputTag = cms.InputTag("TTTrackAssociatorFromPixelDigisExtended", "Level1TTTracks"), # MCTruth track, extended
143  L1StubInputTag = cms.InputTag("TTStubsFromPhase2TrackerDigis","StubAccepted"),
144  MCTruthClusterInputTag = cms.InputTag("TTClusterAssociatorFromPixelDigis", "ClusterAccepted"),
145  MCTruthStubInputTag = cms.InputTag("TTStubAssociatorFromPixelDigis", "StubAccepted"),
146  TrackingParticleInputTag = cms.InputTag("mix", "MergedTrackTruth"),
147  TrackingVertexInputTag = cms.InputTag("mix", "MergedTrackTruth"),
148  ## tracking in jets stuff (--> requires AK4 genjet collection present!)
149  TrackingInJets = cms.bool(False),
150  GenJetInputTag = cms.InputTag("ak4GenJets", ""),
151  ##track jets and track MET
152  SaveTrackJets = cms.bool(True),
153  SaveTrackMET = cms.bool(True),
154  TrackFastJetsInputTag = cms.InputTag("L1TrackFastJets","L1TrackFastJets"),
155  TrackFastJetsExtendedInputTag = cms.InputTag("L1TrackFastJetsExtended","L1TrackFastJetsExtended"),
156  TrackJetsInputTag=cms.InputTag("L1TrackJets", "L1TrackJets"),
157  TrackJetsExtendedInputTag=cms.InputTag("L1TrackJetsExtended", "L1TrackJetsExtended"),
158  TrackMETInputTag = cms.InputTag("L1TrackerEtMiss","L1TrackerEtMiss","L1TrackJets"),
159  TrackMETExtendedInputTag = cms.InputTag("L1TrackerEtMissExtended","L1TrackerEtMissExtended"),
160  TrackMHTInputTag = cms.InputTag("L1TrackerHTMiss","L1TrackerHTMiss","L1TrackJets"),
161  TrackMHTExtendedInputTag = cms.InputTag("L1TrackerHTMissExtended","L1TrackerHTMiss"),
162  GenParticleInputTag = cms.InputTag("genParticles",""),
163  RecoVertexInputTag=cms.InputTag("L1TkPrimaryVertex"),
164 )
165 
166 process.ntuple = cms.Path(process.L1TrackNtuple)
167 
168 process.out = cms.OutputModule( "PoolOutputModule",
169  fastCloning = cms.untracked.bool( False ),
170  fileName = cms.untracked.string("test.root" )
171  )
172 process.pOut = cms.EndPath(process.out)
173 
174 
175 
176 # use this if you want to re-run the stub making
177 # process.schedule = cms.Schedule(process.TTClusterStub,process.TTClusterStubTruth,process.TTTracksEmulationWithTruth,process.ntuple)
178 
179 # use this if cluster/stub associators not available
180 # process.schedule = cms.Schedule(process.TTClusterStubTruth,process.TTTracksEmulationWithTruth,process.ntuple)
181 
182 #process.schedule = cms.Schedule(process.pPV, process.pL1TrackJets, process.pL1TrackFastJets, process.pTkMET, process.pTkMHT,process.pOut)
183 #process.schedule = cms.Schedule(process.pPV, process.pL1TrackJets, process.pL1TrackFastJets, process.pTkMET, process.pTkMHT, process.ntuple)
184 #process.schedule = cms.Schedule(process.ntuple)
185 process.schedule = cms.Schedule(process.TTTracksEmulationWithTruth, process.pPV, process.pL1TrackJets, process.pL1TrackFastJets, process.pTkMET, process.pTkMHT, process.ntuple)