Fork me on GitHub

Ticket #878: delphes_card_CMS_modify_v2.tcl

File delphes_card_CMS_modify_v2.tcl, 11.6 KB (added by drakemarquis, 9 years ago)
Line 
1#######################################
2# Order of execution of various modules
3#######################################
4
5set ExecutionPath {
6 ParticlePropagator
7
8 ChargedHadronTrackingEfficiency
9 ElectronTrackingEfficiency
10 MuonTrackingEfficiency
11
12 ChargedHadronMomentumSmearing
13 ElectronMomentumSmearing
14 MuonMomentumSmearing
15
16 TrackMerger
17 Calorimeter
18
19 ECALParticles
20
21 PhotonEfficiency
22 PhotonIsolationECAL
23
24 UniqueObjectFinder
25
26 TreeWriter
27}
28
29#################################
30# Propagate particles in cylinder
31#################################
32
33module ParticlePropagator ParticlePropagator {
34 set InputArray Delphes/stableParticles
35
36 set OutputArray stableParticles
37 set ChargedHadronOutputArray chargedHadrons
38 set ElectronOutputArray electrons
39 set MuonOutputArray muons
40
41 # radius of the magnetic field coverage, in m
42 set Radius 1.29
43 # half-length of the magnetic field coverage, in m
44 set HalfLength 3.00
45
46 # magnetic field
47 set Bz 3.8
48}
49
50####################################
51# Charged hadron tracking efficiency
52####################################
53
54module Efficiency ChargedHadronTrackingEfficiency {
55 set InputArray ParticlePropagator/chargedHadrons
56 set OutputArray chargedHadrons
57
58 # add EfficiencyFormula {efficiency formula as a function of eta and pt}
59
60 # tracking efficiency formula for charged hadrons
61 set EfficiencyFormula { (pt <= 0.1) * (0.00) +
62 (abs(eta) <= 1.5) * (pt > 0.1 && pt <= 1.0) * (0.70) +
63 (abs(eta) <= 1.5) * (pt > 1.0) * (0.95) +
64 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1 && pt <= 1.0) * (0.60) +
65 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 1.0) * (0.85) +
66 (abs(eta) > 2.5) * (0.00)}
67}
68
69##############################
70# Electron tracking efficiency
71##############################
72
73module Efficiency ElectronTrackingEfficiency {
74 set InputArray ParticlePropagator/electrons
75 set OutputArray electrons
76
77 # set EfficiencyFormula {efficiency formula as a function of eta and pt}
78
79 # tracking efficiency formula for electrons
80 set EfficiencyFormula { (pt <= 0.1) * (0.00) +
81 (abs(eta) <= 1.5) * (pt > 0.1 && pt <= 1.0) * (0.73) +
82 (abs(eta) <= 1.5) * (pt > 1.0 && pt <= 1.0e2) * (0.95) +
83 (abs(eta) <= 1.5) * (pt > 1.0e2) * (0.99) +
84 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1 && pt <= 1.0) * (0.50) +
85 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 1.0 && pt <= 1.0e2) * (0.83) +
86 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 1.0e2) * (0.90) +
87 (abs(eta) > 2.5) * (0.00)}
88}
89
90##########################
91# Muon tracking efficiency
92##########################
93
94module Efficiency MuonTrackingEfficiency {
95 set InputArray ParticlePropagator/muons
96 set OutputArray muons
97
98 # set EfficiencyFormula {efficiency formula as a function of eta and pt}
99
100 # tracking efficiency formula for muons
101 set EfficiencyFormula { (pt <= 0.1) * (0.00) +
102 (abs(eta) <= 1.5) * (pt > 0.1 && pt <= 1.0) * (0.75) +
103 (abs(eta) <= 1.5) * (pt > 1.0) * (0.99) +
104 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1 && pt <= 1.0) * (0.70) +
105 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 1.0) * (0.98) +
106 (abs(eta) > 2.5) * (0.00)}
107}
108
109########################################
110# Momentum resolution for charged tracks
111########################################
112
113module MomentumSmearing ChargedHadronMomentumSmearing {
114 set InputArray ChargedHadronTrackingEfficiency/chargedHadrons
115 set OutputArray chargedHadrons
116
117 # set ResolutionFormula {resolution formula as a function of eta and pt}
118
119 # resolution formula for charged hadrons
120 # based on arXiv:1405.6569
121 set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.06^2 + pt^2*1.3e-3^2) +
122 (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.10^2 + pt^2*1.7e-3^2) +
123 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.25^2 + pt^2*3.1e-3^2)}
124}
125
126###################################
127# Momentum resolution for electrons
128###################################
129
130module MomentumSmearing ElectronMomentumSmearing {
131 set InputArray ElectronTrackingEfficiency/electrons
132 set OutputArray electrons
133
134 # set ResolutionFormula {resolution formula as a function of eta and energy}
135
136 # resolution formula for electrons
137 # based on arXiv:1405.6569
138 set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.06^2 + pt^2*1.3e-3^2) +
139 (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.10^2 + pt^2*1.7e-3^2) +
140 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.25^2 + pt^2*3.1e-3^2)}
141}
142
143###############################
144# Momentum resolution for muons
145###############################
146
147module MomentumSmearing MuonMomentumSmearing {
148 set InputArray MuonTrackingEfficiency/muons
149 set OutputArray muons
150
151 # set ResolutionFormula {resolution formula as a function of eta and pt}
152
153 # resolution formula for muons
154 set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.01^2 + pt^2*2.0e-4^2) +
155 (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.02^2 + pt^2*3.0e-4^2) +
156 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.05^2 + pt^2*6.0e-4^2)}
157}
158
159##############
160# Track merger
161##############
162
163module Merger TrackMerger {
164# add InputArray InputArray
165 add InputArray ChargedHadronMomentumSmearing/chargedHadrons
166 add InputArray ElectronMomentumSmearing/electrons
167 add InputArray MuonMomentumSmearing/muons
168 set OutputArray tracks
169}
170
171#############
172# Calorimeter
173#############
174
175module Calorimeter Calorimeter {
176 set ParticleInputArray ParticlePropagator/stableParticles
177 set TrackInputArray TrackMerger/tracks
178
179 set TowerOutputArray towers
180 set PhotonOutputArray photons
181
182 set EFlowTrackOutputArray eflowTracks
183 set EFlowPhotonOutputArray eflowPhotons
184 set EFlowNeutralHadronOutputArray eflowNeutralHadrons
185
186 set ECalEnergyMin 0.5
187 set HCalEnergyMin 1.0
188
189 set ECalEnergySignificanceMin 1.0
190 set HCalEnergySignificanceMin 1.0
191
192 set SmearTowerCenter true
193
194 set pi [expr {acos(-1)}]
195
196 # lists of the edges of each tower in eta and phi
197 # each list starts with the lower edge of the first tower
198 # the list ends with the higher edged of the last tower
199
200 # 5 degrees towers
201 set PhiBins {}
202 for {set i -36} {$i <= 36} {incr i} {
203 add PhiBins [expr {$i * $pi/36.0}]
204 }
205 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} {
206 add EtaPhiBins $eta $PhiBins
207 }
208
209 # 10 degrees towers
210 set PhiBins {}
211 for {set i -18} {$i <= 18} {incr i} {
212 add PhiBins [expr {$i * $pi/18.0}]
213 }
214 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} {
215 add EtaPhiBins $eta $PhiBins
216 }
217
218 # 20 degrees towers
219 set PhiBins {}
220 for {set i -9} {$i <= 9} {incr i} {
221 add PhiBins [expr {$i * $pi/9.0}]
222 }
223 foreach eta {-5 -4.7 -4.525 4.7 5} {
224 add EtaPhiBins $eta $PhiBins
225 }
226
227 # default energy fractions {abs(PDG code)} {Fecal Fhcal}
228 add EnergyFraction {0} {0.0 1.0}
229 # energy fractions for e, gamma and pi0
230 add EnergyFraction {11} {1.0 0.0}
231 add EnergyFraction {22} {1.0 0.0}
232 add EnergyFraction {111} {1.0 0.0}
233 # energy fractions for muon, neutrinos and neutralinos
234 add EnergyFraction {12} {0.0 0.0}
235 add EnergyFraction {13} {0.0 0.0}
236 add EnergyFraction {14} {0.0 0.0}
237 add EnergyFraction {16} {0.0 0.0}
238 add EnergyFraction {1000022} {0.0 0.0}
239 add EnergyFraction {1000023} {0.0 0.0}
240 add EnergyFraction {1000025} {0.0 0.0}
241 add EnergyFraction {1000035} {0.0 0.0}
242 add EnergyFraction {1000045} {0.0 0.0}
243 # energy fractions for K0short and Lambda
244 add EnergyFraction {310} {0.3 0.7}
245 add EnergyFraction {3122} {0.3 0.7}
246
247 # set ECalResolutionFormula {resolution formula as a function of eta and energy}
248 set ECalResolutionFormula { (abs(eta) <= 3.0) * sqrt(energy^2*0.007^2 + energy*0.07^2 + 0.35^2) +
249 (abs(eta) > 3.0 && abs(eta) <= 5.0) * sqrt(energy^2*0.107^2 + energy*2.08^2)}
250
251 # set HCalResolutionFormula {resolution formula as a function of eta and energy}
252 set HCalResolutionFormula { (abs(eta) <= 3.0) * sqrt(energy^2*0.050^2 + energy*1.50^2) +
253 (abs(eta) > 3.0 && abs(eta) <= 5.0) * sqrt(energy^2*0.130^2 + energy*2.70^2)}
254}
255
256
257###############
258# Merge Calorimeter/eflowPhotons and Calorimeter/eflowTracks
259###############
260
261module Merger ECALParticles {
262 # add InputArray InputArray
263 add InputArray Calorimeter/eflowTracks
264 add InputArray Calorimeter/eflowPhotons
265 set OutputArray ecalParticles
266}
267
268
269###################
270# Photon efficiency
271###################
272
273module Efficiency PhotonEfficiency {
274 set InputArray Calorimeter/eflowPhotons
275 set OutputArray photons
276
277 # set EfficiencyFormula {efficiency formula as a function of eta and pt}
278
279 # efficiency formula for photons
280 set EfficiencyFormula { (pt <= 10.0) * (0.00) +
281 (abs(eta) <= 1.5) * (pt > 10.0) * (0.95) +
282 (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 10.0) * (0.85) +
283 (abs(eta) > 2.5) * (0.00)}
284}
285
286
287###############
288# Photon isolation at ECAL
289###############
290
291module Isolation PhotonIsolationECAL {
292 set CandidateInputArray Calorimeter/eflowPhotons
293 set IsolationInputArray ECALParticles/ecalParticles
294
295 set OutputArray ecalPhotons
296
297 set UsePTSum true
298
299 set DeltaRMax 0.4
300
301 set PTMin 0.5
302
303 set PTSumMax 4.2
304}
305
306
307#####################################################
308# Find uniquely identified photons/electrons/tau/jets
309#####################################################
310
311module UniqueObjectFinder UniqueObjectFinder {
312# earlier arrays take precedence over later ones
313# add InputArray InputArray OutputArray
314 add InputArray PhotonIsolationECAL/ecalPhotons photons
315}
316
317##################
318# ROOT tree writer
319##################
320
321# tracks, towers and eflow objects are not stored by default in the output.
322# if needed (for jet constituent or other studies), uncomment the relevant
323# "add Branch ..." lines.
324
325module TreeWriter TreeWriter {
326# add Branch InputArray BranchName BranchClass
327 add Branch Delphes/allParticles Particle GenParticle
328
329 add Branch TrackMerger/tracks Track Track
330 add Branch Calorimeter/towers Tower Tower
331
332 add Branch Calorimeter/eflowTracks EFlowTrack Track
333 add Branch Calorimeter/eflowPhotons EFlowPhoton Tower
334 add Branch Calorimeter/eflowNeutralHadrons EFlowNeutralHadron Tower
335
336 add Branch UniqueObjectFinder/photons Photon Photon
337}