Fork me on GitHub

source: git/cards/trkCountingBTaggingCMS.tcl@ 392d142

ImprovedOutputFile Timing dual_readout llp
Last change on this file since 392d142 was ca9e119, checked in by Kevin Pedro <kpedro88@…>, 7 years ago

example of track counting b-tagging

  • Property mode set to 100644
File size: 16.0 KB
Line 
1#set MaxEvents 100
2
3#
4# CMS Run2 example
5#
6# Main authors: Kevin Pedro (FNAL)
7#
8# Test TrackSmearing and TrackCountingBTagging algorithm
9# based on default CMS card
10#
11
12#######################################
13# Order of execution of various modules
14#######################################
15
16set ExecutionPath {
17 ParticlePropagator
18
19 ChargedHadronTrackingEfficiency
20 ElectronTrackingEfficiency
21 MuonTrackingEfficiency
22
23 ChargedHadronMomentumSmearing
24 ElectronMomentumSmearing
25 MuonMomentumSmearing
26
27 TrackMerger
28 TrackSmearing
29
30 ECal
31 HCal
32
33 EFlowMerger
34 EFlowFilter
35
36 FastJetFinder
37
38 JetEnergyScale
39
40 JetFlavorAssociation
41
42 TrackCountingBTagging
43
44 TreeWriter
45}
46
47#################################
48# Propagate particles in cylinder
49#################################
50
51module ParticlePropagator ParticlePropagator {
52 set InputArray Delphes/stableParticles
53
54 set OutputArray stableParticles
55 set ChargedHadronOutputArray chargedHadrons
56 set ElectronOutputArray electrons
57 set MuonOutputArray muons
58
59 # radius of the magnetic field coverage, in m
60 set Radius 1.29
61 # half-length of the magnetic field coverage, in m
62 set HalfLength 3.00
63
64 # magnetic field
65 set Bz 3.8
66}
67
68####################################
69# Charged hadron tracking efficiency
70####################################
71
72module Efficiency ChargedHadronTrackingEfficiency {
73 set InputArray ParticlePropagator/chargedHadrons
74 set OutputArray chargedHadrons
75
76 # add EfficiencyFormula {efficiency formula as a function of eta and pt}
77
78 # tracking efficiency formula for charged hadrons
79 set EfficiencyFormula { (pt <= 0.1) * (0.00) +
80 (abs(eta) <= 1.5) * (pt > 0.1 && pt <= 1.0) * (0.70) +
81 (abs(eta) <= 1.5) * (pt > 1.0) * (0.95) +
82 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1 && pt <= 1.0) * (0.60) +
83 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 1.0) * (0.85) +
84 (abs(eta) > 2.5) * (0.00)}
85}
86
87##############################
88# Electron tracking efficiency
89##############################
90
91module Efficiency ElectronTrackingEfficiency {
92 set InputArray ParticlePropagator/electrons
93 set OutputArray electrons
94
95 # set EfficiencyFormula {efficiency formula as a function of eta and pt}
96
97 # tracking efficiency formula for electrons
98 set EfficiencyFormula { (pt <= 0.1) * (0.00) +
99 (abs(eta) <= 1.5) * (pt > 0.1 && pt <= 1.0) * (0.73) +
100 (abs(eta) <= 1.5) * (pt > 1.0 && pt <= 1.0e2) * (0.95) +
101 (abs(eta) <= 1.5) * (pt > 1.0e2) * (0.99) +
102 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1 && pt <= 1.0) * (0.50) +
103 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 1.0 && pt <= 1.0e2) * (0.83) +
104 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 1.0e2) * (0.90) +
105 (abs(eta) > 2.5) * (0.00)}
106}
107
108##########################
109# Muon tracking efficiency
110##########################
111
112module Efficiency MuonTrackingEfficiency {
113 set InputArray ParticlePropagator/muons
114 set OutputArray muons
115
116 # set EfficiencyFormula {efficiency formula as a function of eta and pt}
117
118 # tracking efficiency formula for muons
119 set EfficiencyFormula { (pt <= 0.1) * (0.00) +
120 (abs(eta) <= 1.5) * (pt > 0.1 && pt <= 1.0) * (0.75) +
121 (abs(eta) <= 1.5) * (pt > 1.0 && pt <= 1.0e3) * (0.99) +
122 (abs(eta) <= 1.5) * (pt > 1.0e3 ) * (0.99 * exp(0.5 - pt*5.0e-4)) +
123
124 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1 && pt <= 1.0) * (0.70) +
125 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 1.0 && pt <= 1.0e3) * (0.98) +
126 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 1.0e3) * (0.98 * exp(0.5 - pt*5.0e-4)) +
127 (abs(eta) > 2.5) * (0.00)}
128}
129
130########################################
131# Momentum resolution for charged tracks
132########################################
133
134module MomentumSmearing ChargedHadronMomentumSmearing {
135 set InputArray ChargedHadronTrackingEfficiency/chargedHadrons
136 set OutputArray chargedHadrons
137
138 # set ResolutionFormula {resolution formula as a function of eta and pt}
139
140 # resolution formula for charged hadrons
141 # based on arXiv:1405.6569
142 set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.06^2 + pt^2*1.3e-3^2) +
143 (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.10^2 + pt^2*1.7e-3^2) +
144 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.25^2 + pt^2*3.1e-3^2)}
145}
146
147###################################
148# Momentum resolution for electrons
149###################################
150
151module MomentumSmearing ElectronMomentumSmearing {
152 set InputArray ElectronTrackingEfficiency/electrons
153 set OutputArray electrons
154
155 # set ResolutionFormula {resolution formula as a function of eta and energy}
156
157 # resolution formula for electrons
158 # based on arXiv:1405.6569
159 set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.03^2 + pt^2*1.3e-3^2) +
160 (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.05^2 + pt^2*1.7e-3^2) +
161 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.15^2 + pt^2*3.1e-3^2)}
162}
163
164###############################
165# Momentum resolution for muons
166###############################
167
168module MomentumSmearing MuonMomentumSmearing {
169 set InputArray MuonTrackingEfficiency/muons
170 set OutputArray muons
171
172 # set ResolutionFormula {resolution formula as a function of eta and pt}
173
174 # resolution formula for muons
175 set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.01^2 + pt^2*1.0e-4^2) +
176 (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.015^2 + pt^2*1.5e-4^2) +
177 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.025^2 + pt^2*3.5e-4^2)}
178}
179
180##############
181# Track merger
182##############
183
184module Merger TrackMerger {
185# add InputArray InputArray
186 add InputArray ChargedHadronMomentumSmearing/chargedHadrons
187 add InputArray ElectronMomentumSmearing/electrons
188 add InputArray MuonMomentumSmearing/muons
189 set OutputArray tracks
190}
191
192
193
194################################
195# Track impact parameter smearing
196################################
197
198module TrackSmearing TrackSmearing {
199 set InputArray TrackMerger/tracks
200# set BeamSpotInputArray BeamSpotFilter/beamSpotParticle
201 set OutputArray tracks
202# set ApplyToPileUp true
203
204 # magnetic field
205 set Bz 3.8
206
207 source trackResolutionCMS.tcl
208}
209
210
211
212#############
213# ECAL
214#############
215
216module SimpleCalorimeter ECal {
217 set ParticleInputArray ParticlePropagator/stableParticles
218 set TrackInputArray TrackSmearing/tracks
219
220 set TowerOutputArray ecalTowers
221 set EFlowTrackOutputArray eflowTracks
222 set EFlowTowerOutputArray eflowPhotons
223
224 set IsEcal true
225
226 set EnergyMin 0.5
227 set EnergySignificanceMin 2.0
228
229 set SmearTowerCenter true
230
231 set pi [expr {acos(-1)}]
232
233 # lists of the edges of each tower in eta and phi
234 # each list starts with the lower edge of the first tower
235 # the list ends with the higher edged of the last tower
236
237 # assume 0.02 x 0.02 resolution in eta,phi in the barrel |eta| < 1.5
238
239 set PhiBins {}
240 for {set i -180} {$i <= 180} {incr i} {
241 add PhiBins [expr {$i * $pi/180.0}]
242 }
243
244 # 0.02 unit in eta up to eta = 1.5 (barrel)
245 for {set i -85} {$i <= 86} {incr i} {
246 set eta [expr {$i * 0.0174}]
247 add EtaPhiBins $eta $PhiBins
248 }
249
250 # assume 0.02 x 0.02 resolution in eta,phi in the endcaps 1.5 < |eta| < 3.0 (HGCAL- ECAL)
251
252 set PhiBins {}
253 for {set i -180} {$i <= 180} {incr i} {
254 add PhiBins [expr {$i * $pi/180.0}]
255 }
256
257 # 0.02 unit in eta up to eta = 3
258 for {set i 1} {$i <= 84} {incr i} {
259 set eta [expr { -2.958 + $i * 0.0174}]
260 add EtaPhiBins $eta $PhiBins
261 }
262
263 for {set i 1} {$i <= 84} {incr i} {
264 set eta [expr { 1.4964 + $i * 0.0174}]
265 add EtaPhiBins $eta $PhiBins
266 }
267
268 # take present CMS granularity for HF
269
270 # 0.175 x (0.175 - 0.35) resolution in eta,phi in the HF 3.0 < |eta| < 5.0
271 set PhiBins {}
272 for {set i -18} {$i <= 18} {incr i} {
273 add PhiBins [expr {$i * $pi/18.0}]
274 }
275
276 foreach eta {-5 -4.7 -4.525 -4.35 -4.175 -4 -3.825 -3.65 -3.475 -3.3 -3.125 -2.958 3.125 3.3 3.475 3.65 3.825 4 4.175 4.35 4.525 4.7 5} {
277 add EtaPhiBins $eta $PhiBins
278 }
279
280
281 add EnergyFraction {0} {0.0}
282 # energy fractions for e, gamma and pi0
283 add EnergyFraction {11} {1.0}
284 add EnergyFraction {22} {1.0}
285 add EnergyFraction {111} {1.0}
286 # energy fractions for muon, neutrinos and neutralinos
287 add EnergyFraction {12} {0.0}
288 add EnergyFraction {13} {0.0}
289 add EnergyFraction {14} {0.0}
290 add EnergyFraction {16} {0.0}
291 add EnergyFraction {1000022} {0.0}
292 add EnergyFraction {1000023} {0.0}
293 add EnergyFraction {1000025} {0.0}
294 add EnergyFraction {1000035} {0.0}
295 add EnergyFraction {1000045} {0.0}
296 # energy fractions for K0short and Lambda
297 add EnergyFraction {310} {0.3}
298 add EnergyFraction {3122} {0.3}
299
300 # set ResolutionFormula {resolution formula as a function of eta and energy}
301
302 # for the ECAL barrel (|eta| < 1.5), see hep-ex/1306.2016 and 1502.02701
303
304 # set ECalResolutionFormula {resolution formula as a function of eta and energy}
305 # Eta shape from arXiv:1306.2016, Energy shape from arXiv:1502.02701
306 set ResolutionFormula { (abs(eta) <= 1.5) * (1+0.64*eta^2) * sqrt(energy^2*0.008^2 + energy*0.11^2 + 0.40^2) +
307 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (2.16 + 5.6*(abs(eta)-2)^2) * sqrt(energy^2*0.008^2 + energy*0.11^2 + 0.40^2) +
308 (abs(eta) > 2.5 && abs(eta) <= 5.0) * sqrt(energy^2*0.107^2 + energy*2.08^2)}
309
310}
311
312
313#############
314# HCAL
315#############
316
317module SimpleCalorimeter HCal {
318 set ParticleInputArray ParticlePropagator/stableParticles
319 set TrackInputArray ECal/eflowTracks
320
321 set TowerOutputArray hcalTowers
322 set EFlowTrackOutputArray eflowTracks
323 set EFlowTowerOutputArray eflowNeutralHadrons
324
325 set IsEcal false
326
327 set EnergyMin 1.0
328 set EnergySignificanceMin 1.0
329
330 set SmearTowerCenter true
331
332 set pi [expr {acos(-1)}]
333
334 # lists of the edges of each tower in eta and phi
335 # each list starts with the lower edge of the first tower
336 # the list ends with the higher edged of the last tower
337
338 # 5 degrees towers
339 set PhiBins {}
340 for {set i -36} {$i <= 36} {incr i} {
341 add PhiBins [expr {$i * $pi/36.0}]
342 }
343 foreach eta {-1.566 -1.479 -1.392 -1.305 -1.218 -1.131 -1.044 -0.957 -0.87 -0.783 -0.696 -0.609 -0.522 -0.435 -0.348 -0.261 -0.174 -0.087 0 0.087 0.174 0.261 0.348 0.435 0.522 0.609 0.696 0.783 0.87 0.957 1.044 1.131 1.218 1.305 1.392 1.479 1.566 1.653} {
344 add EtaPhiBins $eta $PhiBins
345 }
346
347 # 10 degrees towers
348 set PhiBins {}
349 for {set i -18} {$i <= 18} {incr i} {
350 add PhiBins [expr {$i * $pi/18.0}]
351 }
352 foreach eta {-4.35 -4.175 -4 -3.825 -3.65 -3.475 -3.3 -3.125 -2.95 -2.868 -2.65 -2.5 -2.322 -2.172 -2.043 -1.93 -1.83 -1.74 -1.653 1.74 1.83 1.93 2.043 2.172 2.322 2.5 2.65 2.868 2.95 3.125 3.3 3.475 3.65 3.825 4 4.175 4.35 4.525} {
353 add EtaPhiBins $eta $PhiBins
354 }
355
356 # 20 degrees towers
357 set PhiBins {}
358 for {set i -9} {$i <= 9} {incr i} {
359 add PhiBins [expr {$i * $pi/9.0}]
360 }
361 foreach eta {-5 -4.7 -4.525 4.7 5} {
362 add EtaPhiBins $eta $PhiBins
363 }
364
365 # default energy fractions {abs(PDG code)} {Fecal Fhcal}
366 add EnergyFraction {0} {1.0}
367 # energy fractions for e, gamma and pi0
368 add EnergyFraction {11} {0.0}
369 add EnergyFraction {22} {0.0}
370 add EnergyFraction {111} {0.0}
371 # energy fractions for muon, neutrinos and neutralinos
372 add EnergyFraction {12} {0.0}
373 add EnergyFraction {13} {0.0}
374 add EnergyFraction {14} {0.0}
375 add EnergyFraction {16} {0.0}
376 add EnergyFraction {1000022} {0.0}
377 add EnergyFraction {1000023} {0.0}
378 add EnergyFraction {1000025} {0.0}
379 add EnergyFraction {1000035} {0.0}
380 add EnergyFraction {1000045} {0.0}
381 # energy fractions for K0short and Lambda
382 add EnergyFraction {310} {0.7}
383 add EnergyFraction {3122} {0.7}
384
385 # set HCalResolutionFormula {resolution formula as a function of eta and energy}
386 set ResolutionFormula { (abs(eta) <= 3.0) * sqrt(energy^2*0.050^2 + energy*1.50^2) +
387 (abs(eta) > 3.0 && abs(eta) <= 5.0) * sqrt(energy^2*0.130^2 + energy*2.70^2)}
388
389}
390
391
392####################
393# Energy flow merger
394####################
395
396module Merger EFlowMerger {
397# add InputArray InputArray
398 add InputArray HCal/eflowTracks
399 add InputArray ECal/eflowPhotons
400 add InputArray HCal/eflowNeutralHadrons
401 set OutputArray eflow
402}
403
404######################
405# EFlowFilter
406######################
407
408module PdgCodeFilter EFlowFilter {
409 set InputArray EFlowMerger/eflow
410 set OutputArray eflow
411
412 add PdgCode {11}
413 add PdgCode {-11}
414 add PdgCode {13}
415 add PdgCode {-13}
416}
417
418############
419# Jet finder
420############
421
422module FastJetFinder FastJetFinder {
423 set InputArray EFlowMerger/eflow
424
425 set OutputArray jets
426
427 # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt
428 set JetAlgorithm 6
429 set ParameterR 0.5
430
431 set JetPTMin 20.0
432}
433
434##################
435# Jet Energy Scale
436##################
437
438module EnergyScale JetEnergyScale {
439 set InputArray FastJetFinder/jets
440 set OutputArray jets
441
442 # scale formula for jets
443 set ScaleFormula {sqrt( (2.5 - 0.15*(abs(eta)))^2 / pt + 1.0 )}
444}
445
446########################
447# Jet Flavor Association
448########################
449
450module JetFlavorAssociation JetFlavorAssociation {
451
452 set PartonInputArray Delphes/partons
453 set ParticleInputArray Delphes/allParticles
454 set ParticleLHEFInputArray Delphes/allParticlesLHEF
455 set JetInputArray JetEnergyScale/jets
456
457 set DeltaR 0.5
458 set PartonPTMin 1.0
459 set PartonEtaMax 2.5
460
461}
462
463############################
464# b-tagging (track counting)
465############################
466
467module TrackCountingBTagging TrackCountingBTagging {
468 set JetInputArray JetEnergyScale/jets
469 set TrackInputArray HCal/eflowTracks
470
471 set BitNumber 0
472
473 # maximum distance between jet and track
474 set DeltaR 0.3
475
476 # minimum pt of tracks
477 set TrackPTMin 1.0
478
479 # maximum transverse impact parameter (in mm)
480 set TrackIPMax 2.0
481
482 # minimum ip significance for the track to be counted
483 set SigMin 2.0
484 set Use3D true
485 # alternate setting for 2D IP (default)
486# set SigMin 1.3
487# set Use3D false
488
489 # minimum number of tracks (high efficiency n=2, high purity n=3)
490 set Ntracks 3
491}
492
493#####################################################
494# Find uniquely identified photons/electrons/tau/jets
495#####################################################
496
497module UniqueObjectFinder UniqueObjectFinder {
498# earlier arrays take precedence over later ones
499# add InputArray InputArray OutputArray
500 add InputArray PhotonIsolation/photons photons
501 add InputArray ElectronIsolation/electrons electrons
502 add InputArray MuonIsolation/muons muons
503 add InputArray JetEnergyScale/jets jets
504}
505
506##################
507# ROOT tree writer
508##################
509
510# tracks, towers and eflow objects are not stored by default in the output.
511# if needed (for jet constituent or other studies), uncomment the relevant
512# "add Branch ..." lines.
513
514module TreeWriter TreeWriter {
515# add Branch InputArray BranchName BranchClass
516 add Branch Delphes/allParticles Particle GenParticle
517
518 add Branch TrackSmearing/tracks Track Track
519
520 add Branch HCal/eflowTracks EFlowTrack Track
521 add Branch ECal/eflowPhotons EFlowPhoton Tower
522 add Branch HCal/eflowNeutralHadrons EFlowNeutralHadron Tower
523
524 add Branch JetEnergyScale/jets Jet Jet
525}
Note: See TracBrowser for help on using the repository browser.