EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ATHENA.tcl
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ATHENA.tcl
1 ######################################################################################################################
2 # ATHENA detector model. Based on parametrizations from G4 simulations made by the ATHENA collaboration
3 # email: miguel.arratia@ucr.edu, ssekula@mail.smu.edu
4 #######################################################################################################################
5 
6 #######################################
7 # Order of execution of various modules
8 #######################################
9 
10 set ExecutionPath {
11  BeamSpotFilter
12  ParticlePropagator
13 
14  ChargedHadronTrackingEfficiency
15  ElectronTrackingEfficiency
16  MuonTrackingEfficiency
17 
18  ChargedHadronSmearing
19  ElectronSmearing
20  MuonSmearing
21 
22  TrackMerger
23 
24  ECal
25  HCal
26 
27  Calorimeter
28  EFlowMerger
29  EFlowFilter
30 
31  PhotonEfficiency
32  PhotonIsolation
33 
34  ElectronFilter
35  ElectronEfficiency
36  ElectronIsolation
37 
38  ChargedHadronFilter
39  MissingET
40 
41  NeutrinoFilter
42  GenJetFinder
43  GenMissingET
44 
45  FastJetFinder
46 
47  JetEnergyScale
48 
49  JetFlavorAssociation
50  GenJetFlavorAssociation
51 
52  UniqueObjectFinder
53 
54  ScalarHT
55 
56  TrackCountingBTagging
57 
58  pfRICH
59  barrelDIRC_epid
60  barrelDIRC_hpid
61  BTOF_e
62  BTOF_h
63  dualRICH_aerogel
64  dualRICH_c2f6
65 
66  TreeWriter
67 }
68 
69 
70 #################################
71 # Propagate particles in cylinder
72 #################################
73 
74 #######################
75 # GenBeamSpotFilter
76 # Saves a particle intended to represent the beamspot
77 #######################
78 
79 module BeamSpotFilter BeamSpotFilter {
80  set InputArray Delphes/stableParticles
81  set OutputArray beamSpotParticle
82 
83 }
84 
85 
86 
87 module ParticlePropagator ParticlePropagator {
88  set InputArray Delphes/stableParticles
89  set OutputArray stableParticles
90  set BeamSpotInputArray BeamSpotFilter/beamSpotParticle
91  set ChargedHadronOutputArray chargedHadrons
92  set ElectronOutputArray electrons
93  set MuonOutputArray muons
94  # radius of the magnetic field coverage, in m
95  set Radius 1.60
96  # half-length of the magnetic field coverage, in m
97  set HalfLength 1.92
98  # magnetic field
99  set Bz 3.0
100 }
101 
102 
103 ####################################
104 # Common Tracking Efficiency Model
105 ####################################
106 #
107 set CommonTrackingEfficiency {
108  (eta > -3.5 && eta <= -3.0 ) * (pt*cosh(eta) > 1.25 && pt*cosh(eta)<6.0) * (0.875) +
109  (eta > -3.5 && eta <= -3.0 ) * (pt*cosh(eta) > 6.0 ) * (0.95) +
110  (eta > -3.0 && eta <= -2.5 ) * (pt*cosh(eta) > 0.55 && pt*cosh(eta)<2.0) * (0.875) +
111  (eta > -3.0 && eta <= -2.5 ) * (pt*cosh(eta) > 2.0) * (0.95) +
112  (eta > -2.5 && eta <= -2.0) * (pt*cosh(eta)> 0.45 && pt*cosh(eta)<0.6) * (0.875) +
113  (eta > -2.5 && eta <= -2.0) * (pt*cosh(eta)>0.6) * (0.95) +
114  (eta > -2.0 && eta <= -1.5) * (pt*cosh(eta)> 0.250 && pt*cosh(eta)<0.500)* (0.875) +
115  (eta > -2.0 && eta <= -1.5) * (pt*cosh(eta)>0.500) * (0.95) +
116  (eta > -1.5 && eta <= -1.0) * (pt*cosh(eta) > 0.150 && pt*cosh(eta)<0.300)* (0.86) +
117  (eta > -1.5 && eta <= -1.0) * (pt*cosh(eta) > 0.300) * (0.92) +
118  (eta > -1.0 && eta <= -0.5) * (pt*cosh(eta) > 0.150 && pt*cosh(eta)<0.200)* (0.89) +
119  (eta > -1.0 && eta <= -0.5) * (pt*cosh(eta) > 0.200) * (0.98) +
120  (eta > -0.5 && eta <= 0.0) * (pt*cosh(eta) > 0.150 && pt*cosh(eta)<0.200)*(0.89) +
121  (eta > -0.5 && eta <= 0.0) * (pt*cosh(eta) > 0.200 ) * (0.98) +
122  (eta > 0.0 && eta <= 0.5 ) * (pt*cosh(eta) > 0.150 && pt*cosh(eta)<0.200)* (0.89) +
123  (eta > 0.0 && eta <= 0.5 ) * (pt*cosh(eta) > 0.200) * (0.98) +
124  (eta > 0.5 && eta <= 1.0 ) * (pt*cosh(eta) > 0.150 && pt*cosh(eta)<0.200)* (0.89) +
125  (eta > 0.5 && eta <= 1.0 ) * (pt*cosh(eta) > 0.200) * (0.98) +
126  (eta > 1.0 && eta <= 1.5) * (pt*cosh(eta) > 0.150 && pt*cosh(eta)<0.200)* (0.86) +
127  (eta > 1.0 && eta <= 1.5) * (pt*cosh(eta) > 0.200) * (0.92) +
128  (eta > 1.5 && eta <= 2.0) * (pt*cosh(eta) > 0.250 && pt*cosh(eta)<0.500)* (0.89) +
129  (eta > 1.5 && eta <= 2.0) * (pt*cosh(eta) > 0.500) * (0.98) +
130  (eta > 2.0 && eta <= 2.5) * (pt*cosh(eta) > 0.350 && pt*cosh(eta)<0.700)* (0.88) +
131  (eta > 2.0 && eta <= 2.5) * (pt*cosh(eta) > 0.700) * (0.97) +
132  (eta > 2.5 && eta <= 3.0) * (pt*cosh(eta) > 0.550 && pt*cosh(eta)<2.0) * (0.87) +
133  (eta > 2.5 && eta <= 3.0) * (pt*cosh(eta) > 2.0) * (0.95) +
134  (eta > 3.0 && eta <= 3.5) * (pt*cosh(eta) > 0.850 && pt*cosh(eta)<4.0) * (0.87) +
135  (eta > 3.0 && eta <= 3.5) * (pt*cosh(eta) > 4.0) * (0.95) +
136  (abs(eta) > 3.5) * (0.00)+
137  0.0
138 }
139 
140 #ATHENA Hybrid design
141 set CommonTrackingResolution {
142  (eta<=-3.0 && eta>-3.5) * (sqrt( (1.841e-2)^2 + (pt*cosh(eta)*7.1e-4)^2 ) ) +
143  (eta<=-2.5 && eta>-3.0) * (sqrt( (1.080e-2)^2 + (pt*cosh(eta)*1.7e-4)^2 ) ) +
144  (eta<=-2.0 && eta>-2.5) * (sqrt( (6.33e-3)^2 + (pt*cosh(eta)*0.0)^2 ) ) +
145  (eta<=-1.5 && eta>-2.0) * (sqrt( (4.76e-3)^2 + (pt*cosh(eta)*1.1e-4)^2 ) ) +
146  (eta<=-1.0 && eta>-1.5) * (sqrt( (4.33e-3)^2 + (pt*cosh(eta)*1.6e-4)^2 ) ) +
147  (eta<=-0.5 && eta>-1.0) * (sqrt( (3.98e-3)^2 + (pt*cosh(eta)*5.0e-4)^2 ) ) +
148  (eta<= 0.0 && eta>-0.5) * (sqrt( (3.53e-3)^2 + (pt*cosh(eta)*5.9e-4)^2 ) ) +
149 
150  (eta<=0.5 && eta>0) * (sqrt( (3.50e-3)^2 + (pt*cosh(eta)*5.9e-4)^2 ) ) +
151  (eta<=1.0 && eta>0.5) * (sqrt( (4.01e-3)^2 + (pt*cosh(eta)*5.0e-4)^2 ) ) +
152  (eta<=1.5 && eta>1.0) * (sqrt( (4.14e-3)^2 + (pt*cosh(eta)*1.5e-4)^2 ) ) +
153  (eta<=2.0 && eta>1.5) * (sqrt( (4.66e-3)^2 + (pt*cosh(eta)*1.1e-4)^2 ) ) +
154  (eta<=2.5 && eta>2.0) * (sqrt( (6.38e-3)^2 + (pt*cosh(eta)*1.3e-4)^2 ) ) +
155  (eta<=3.0 && eta>2.5) * (sqrt( (1.089e-2)^2 + (pt*cosh(eta)*1.1e-4)^2 ) ) +
156  (eta<=3.5 && eta>3.0) * (sqrt( (1.905e-2)^2 + (pt*cosh(eta)*3.1e-4)^2 ) )
157 }
158 
159 
160 ####################################
161 # Charged hadron tracking efficiency
162 ####################################
163 
164 module Efficiency ChargedHadronTrackingEfficiency {
165  set InputArray ParticlePropagator/chargedHadrons
166  set OutputArray chargedHadrons
167  set EfficiencyFormula $CommonTrackingEfficiency
168 }
169 
170 ##############################
171 # Electron tracking efficiency
172 ##############################
173 
174 module Efficiency ElectronTrackingEfficiency {
175  set InputArray ParticlePropagator/electrons
176  set OutputArray electrons
177  set EfficiencyFormula $CommonTrackingEfficiency
178 
179 }
180 
181 ##############################
182 # Muon tracking efficiency
183 ##############################
184 module Efficiency MuonTrackingEfficiency {
185  set InputArray ParticlePropagator/muons
186  set OutputArray muons
187  set EfficiencyFormula $CommonTrackingEfficiency
188 
189 }
190 
191 ########################################
192 # Smearing for charged hadrons
193 ########################################
194 
195 module TrackSmearing ChargedHadronSmearing {
196  set InputArray ChargedHadronTrackingEfficiency/chargedHadrons
197  set BeamSpotInputArray BeamSpotFilter/beamSpotParticle
198  set OutputArray chargedHadrons
199 # set ApplyToPileUp true
200  # magnetic field
201  set Bz 3.0
202  set PResolutionFormula $CommonTrackingResolution
203  set CtgThetaResolutionFormula { 0.0 }
204  set PhiResolutionFormula { 0.0 }
205 
206 
207 
208  set D0ResolutionFormula "
209  (eta<=0.0 && eta>-0.5) * (sqrt( (0.00541)^2 + (0.02679/pt)^2 ) ) +
210  (eta<=-0.5 && eta>-1.0) * (sqrt( (0.00545)^2 + (0.02960/pt)^2 ) ) +
211  (eta<=-1.0 && eta>-1.5) * (sqrt( (0.00577)^2 + (0.03561/pt)^2 ) ) +
212  (eta<=-1.5 && eta>-2.0) * (sqrt( (0.00550)^2 + (0.04260/pt)^2 ) ) +
213  (eta<=-2.0 && eta>-2.5) * (sqrt( (0.00596)^2 + (0.05891/pt)^2 ) ) +
214  (eta<=-2.5 && eta>-3.0) * (sqrt( (0.00773)^2 + (0.07631/pt)^2 ) ) +
215  (eta<=-3.0 && eta>-3.5) * (sqrt( (0.01392)^2 + (0.09182/pt)^2 ) ) +
216 
217  (eta<=0.5 && eta>0) * (sqrt( (0.00536)^2 + (0.02668/pt)^2 ) ) +
218  (eta<=1.0 && eta>0.5) * (sqrt( (0.00550)^2 + (0.02951/pt)^2 ) ) +
219  (eta<=1.5 && eta>1.0) * (sqrt( (0.00570)^2 + (0.03565/pt)^2 ) ) +
220 
221  (eta<=2.0 && eta>1.5) * (sqrt( (0.00539)^2 + (0.04250/pt)^2 ) ) +
222  (eta<=2.5 && eta>2.0) * (sqrt( (0.00588)^2 + (0.05919/pt)^2 ) ) +
223  (eta<=3.0 && eta>2.5) * (sqrt( (0.00650)^2 + (0.07622/pt)^2 ) ) +
224  (eta<=3.5 && eta>3.0) * (sqrt( (0.01119)^2 + (0.09137/pt)^2 ) )
225  "
226 
227 
228  set DZResolutionFormula "
229  (abs(eta)<=0.5) * (sqrt( (0.0034)^2 + (0.027/pt)^2 ) ) +
230  (abs(eta)<=1.0 && abs(eta)>0.5) * (sqrt( (0.0038)^2 + (0.036/pt)^2 ) ) +
231  (abs(eta)<=1.5 && abs(eta)>1.0) * (sqrt( (0.0056)^2 + (0.061/pt)^2 ) ) +
232  (abs(eta)<=2.0 && abs(eta)>1.5) * (sqrt( (0.0072)^2 + (0.116/pt)^2 ) ) +
233  (abs(eta)<=2.5 && abs(eta)>2.0) * (sqrt( (0.0095)^2 + (0.244/pt)^2 ) ) +
234  (abs(eta)<=3.0 && abs(eta)>2.5) * (sqrt( (0.0330)^2 + (2.581/pt)^2 ) ) +
235  (abs(eta)<=3.5 && abs(eta)>3.0) * (sqrt( (0.1890)^2 + (8.349/pt)^2 ) )
236  "
237 
238 
239 }
240 
241 ###################################
242 # Smearing for muons
243 ###################################
244 
245 module TrackSmearing MuonSmearing {
246  set InputArray MuonTrackingEfficiency/muons
247  set BeamSpotInputArray BeamSpotFilter/beamSpotParticle
248  set OutputArray muons
249 # set ApplyToPileUp true
250  # magnetic field
251  set Bz 3.0
252  set PResolutionFormula $CommonTrackingResolution
253  set CtgThetaResolutionFormula { 0.0 }
254  set PhiResolutionFormula { 0.0 }
255 
256  set D0ResolutionFormula "
257  (eta<=0.0 && eta>-0.5) * (sqrt( (0.00541)^2 + (0.02679/pt)^2 ) ) +
258  (eta<=-0.5 && eta>-1.0) * (sqrt( (0.00545)^2 + (0.02960/pt)^2 ) ) +
259  (eta<=-1.0 && eta>-1.5) * (sqrt( (0.00577)^2 + (0.03561/pt)^2 ) ) +
260  (eta<=-1.5 && eta>-2.0) * (sqrt( (0.00550)^2 + (0.04260/pt)^2 ) ) +
261  (eta<=-2.0 && eta>-2.5) * (sqrt( (0.00596)^2 + (0.05891/pt)^2 ) ) +
262  (eta<=-2.5 && eta>-3.0) * (sqrt( (0.00773)^2 + (0.07631/pt)^2 ) ) +
263  (eta<=-3.0 && eta>-3.5) * (sqrt( (0.01392)^2 + (0.09182/pt)^2 ) ) +
264 
265  (eta<=0.5 && eta>0) * (sqrt( (0.00536)^2 + (0.02668/pt)^2 ) ) +
266  (eta<=1.0 && eta>0.5) * (sqrt( (0.00550)^2 + (0.02951/pt)^2 ) ) +
267  (eta<=1.5 && eta>1.0) * (sqrt( (0.00570)^2 + (0.03565/pt)^2 ) ) +
268  (eta<=2.0 && eta>1.5) * (sqrt( (0.00539)^2 + (0.04250/pt)^2 ) ) +
269  (eta<=2.5 && eta>2.0) * (sqrt( (0.00588)^2 + (0.05919/pt)^2 ) ) +
270  (eta<=3.0 && eta>2.5) * (sqrt( (0.00650)^2 + (0.07622/pt)^2 ) ) +
271  (eta<=3.5 && eta>3.0) * (sqrt( (0.01119)^2 + (0.09137/pt)^2 ) )
272  "
273 
274 
275 
276 set DZResolutionFormula "
277  (abs(eta)<=0.5) * (sqrt( (0.0034)^2 + (0.027/pt)^2 ) ) +
278  (abs(eta)<=1.0 && abs(eta)>0.5) * (sqrt( (0.0038)^2 + (0.036/pt)^2 ) ) +
279  (abs(eta)<=1.5 && abs(eta)>1.0) * (sqrt( (0.0056)^2 + (0.061/pt)^2 ) ) +
280  (abs(eta)<=2.0 && abs(eta)>1.5) * (sqrt( (0.0072)^2 + (0.116/pt)^2 ) ) +
281  (abs(eta)<=2.5 && abs(eta)>2.0) * (sqrt( (0.0095)^2 + (0.244/pt)^2 ) ) +
282  (abs(eta)<=3.0 && abs(eta)>2.5) * (sqrt( (0.0330)^2 + (2.581/pt)^2 ) ) +
283  (abs(eta)<=3.5 && abs(eta)>3.0) * (sqrt( (0.1890)^2 + (8.349/pt)^2 ) )
284  "
285 
286 
287 }
288 
289 ###################################
290 # Smearing for electrons
291 ###################################
292 
293 
294 module TrackSmearing ElectronSmearing {
295  set InputArray ElectronTrackingEfficiency/electrons
296  set BeamSpotInputArray BeamSpotFilter/beamSpotParticle
297  set OutputArray electrons
298 # set ApplyToPileUp true
299  # magnetic field
300  set Bz 3.0
301  set PResolutionFormula $CommonTrackingResolution
302  set CtgThetaResolutionFormula { 0.0 }
303  set PhiResolutionFormula { 0.0 }
304 
305  set D0ResolutionFormula "
306  (eta<=0.0 && eta>-0.5) * (sqrt( (0.00541)^2 + (0.02679/pt)^2 ) ) +
307  (eta<=-0.5 && eta>-1.0) * (sqrt( (0.00545)^2 + (0.02960/pt)^2 ) ) +
308  (eta<=-1.0 && eta>-1.5) * (sqrt( (0.00577)^2 + (0.03561/pt)^2 ) ) +
309  (eta<=-1.5 && eta>-2.0) * (sqrt( (0.00550)^2 + (0.04260/pt)^2 ) ) +
310  (eta<=-2.0 && eta>-2.5) * (sqrt( (0.00596)^2 + (0.05891/pt)^2 ) ) +
311  (eta<=-2.5 && eta>-3.0) * (sqrt( (0.00773)^2 + (0.07631/pt)^2 ) ) +
312  (eta<=-3.0 && eta>-3.5) * (sqrt( (0.01392)^2 + (0.09182/pt)^2 ) ) +
313 
314  (eta<=0.5 && eta>0) * (sqrt( (0.00536)^2 + (0.02668/pt)^2 ) ) +
315  (eta<=1.0 && eta>0.5) * (sqrt( (0.00550)^2 + (0.02951/pt)^2 ) ) +
316  (eta<=1.5 && eta>1.0) * (sqrt( (0.00570)^2 + (0.03565/pt)^2 ) ) +
317  (eta<=2.0 && eta>1.5) * (sqrt( (0.00539)^2 + (0.04250/pt)^2 ) ) +
318  (eta<=2.5 && eta>2.0) * (sqrt( (0.00588)^2 + (0.05919/pt)^2 ) ) +
319  (eta<=3.0 && eta>2.5) * (sqrt( (0.00650)^2 + (0.07622/pt)^2 ) ) +
320  (eta<=3.5 && eta>3.0) * (sqrt( (0.01119)^2 + (0.09137/pt)^2 ) )
321  "
322 
323 
324 
325 set DZResolutionFormula "
326  (abs(eta)<=0.5) * (sqrt( (0.0034)^2 + (0.027/pt)^2 ) ) +
327  (abs(eta)<=1.0 && abs(eta)>0.5) * (sqrt( (0.0038)^2 + (0.036/pt)^2 ) ) +
328  (abs(eta)<=1.5 && abs(eta)>1.0) * (sqrt( (0.0056)^2 + (0.061/pt)^2 ) ) +
329  (abs(eta)<=2.0 && abs(eta)>1.5) * (sqrt( (0.0072)^2 + (0.116/pt)^2 ) ) +
330  (abs(eta)<=2.5 && abs(eta)>2.0) * (sqrt( (0.0095)^2 + (0.244/pt)^2 ) ) +
331  (abs(eta)<=3.0 && abs(eta)>2.5) * (sqrt( (0.0330)^2 + (2.581/pt)^2 ) ) +
332  (abs(eta)<=3.5 && abs(eta)>3.0) * (sqrt( (0.1890)^2 + (8.349/pt)^2 ) )
333  "
334 
335 }
336 
337 ##############
338 # Track merger
339 ##############
340 
341 module Merger TrackMerger {
342 # add InputArray InputArray
343  add InputArray ChargedHadronSmearing/chargedHadrons
344  add InputArray ElectronSmearing/electrons
345  add InputArray MuonSmearing/muons
346  set OutputArray tracks
347 }
348 
349 
350 
351 #############
352 # ECAL
353 #############
354 
355 module SimpleCalorimeter ECal {
356  set ParticleInputArray ParticlePropagator/stableParticles
357  set TrackInputArray TrackMerger/tracks
358 
359  set TowerOutputArray ecalTowers
360  set EFlowTrackOutputArray eflowTracks
361  set EFlowTowerOutputArray eflowPhotons
362 
363  set IsEcal true
364  set EnergyMin 0.050
365  set EnergySignificanceMin 1.0
366 
367  set SmearTowerCenter true
368 
369  set pi [expr {acos(-1)}]
370 
371  # lists of the edges of each tower in eta and phi
372  # each list starts with the lower edge of the first tower
373  # the list ends with the higher edged of the last tower
374 
375  set PhiBins {}
376  for {set i -30} {$i <=30} {incr i} {
377  add PhiBins [expr {$i * $pi/30.0}]
378  }
379  for {set i -10} {$i <=10} {incr i} {
380  set eta [expr {$i * 0.1}]
381  add EtaPhiBins $eta $PhiBins
382  }
383 
384 
385  ## assume 0.1 x 0.1 (real cell size will be smaller, so this is to represent some cluster)
386  set PhiBins {}
387  for {set i -30} {$i <=30} {incr i} {
388  add PhiBins [expr {$i * $pi/30.0}]
389  }
390 
391  foreach eta {-4.0 -3.5 -3.41102102 -3.26996837 -3.14642305 -3.03653567 -2.93760447 -2.84766006 -2.76522251 -2.68915144 -2.61854952 -2.55269788 -2.49101173 -2.43300894 -2.3782873 -2.3265078 -2.27738197 -2.23066235 -2.18613503 -2.14361383 -2.10293569 -2.063957 -2.02655061 -1.99060337 -1.95601417 -1.92269228 -1.89055593 -1.8595312 -1.82955102 -1.80055436 -1.77248548 -1.74529337 -1.71893119 -1.69335587 -1.66852765 -1.64440978 -1.62096821 -1.59817135 -1.57598979 -1.55439612 -1.53336478 -1.51287184 -1.4928949 -1.47341295 -1.45440623 -1.43585618 -1.41774529 -1.40005705 -1.38277588 -1.36588703 -1.34937654 -1.33323117 -1.31743839 -1.30198626 -1.28686345 -1.27205918 -1.25756317 -1.24336562 -1.22945719 -1.21582897 -1.20247241 -1.18937936 -1.17654201 -1.16395288 -1.15160481 -1.13949092 -1.12760462 -1.11593955 -1.10448965 -1.09324904 -1.08221211 -1.07137342 -1.06072776 -1.0502701 -1.03999558} {
392  add EtaPhiBins $eta $PhiBins
393  }
394  foreach eta {1.0 1.0502701 1.06072776 1.07137342 1.08221211 1.09324904 1.10448965 1.11593955 1.12760462 1.13949092 1.15160481 1.16395288 1.17654201 1.18937936 1.20247241 1.21582897 1.22945719 1.24336562 1.25756317 1.27205918 1.28686345 1.30198626 1.31743839 1.33323117 1.34937654 1.36588703 1.38277588 1.40005705 1.41774529 1.43585618 1.45440623 1.47341295 1.4928949 1.51287184 1.53336478 1.55439612 1.57598979 1.59817135 1.62096821 1.64440978 1.66852765 1.69335587 1.71893119 1.74529337 1.77248548 1.80055436 1.82955102 1.8595312 1.89055593 1.92269228 1.95601417 1.99060337 2.02655061 2.063957 2.10293569 2.14361383 2.18613503 2.23066235 2.27738197 2.3265078 2.3782873 2.43300894 2.49101173 2.55269788 2.61854952 2.68915144 2.76522251 2.84766006 2.93760447 3.03653567 3.14642305 3.26996837 3.41102102 3.5 4.0} {
395  add EtaPhiBins $eta $PhiBins
396  }
397 
398  add EnergyFraction {0} {0.0}
399  # energy fractions for e, gamma and pi0
400  add EnergyFraction {11} {1.0}
401  add EnergyFraction {22} {1.0}
402  add EnergyFraction {111} {1.0}
403  # energy fractions for muon, neutrinos and neutralinos
404  add EnergyFraction {12} {0.0}
405  add EnergyFraction {13} {0.0}
406  add EnergyFraction {14} {0.0}
407  add EnergyFraction {16} {0.0}
408  add EnergyFraction {1000022} {0.0}
409  add EnergyFraction {1000023} {0.0}
410  add EnergyFraction {1000025} {0.0}
411  add EnergyFraction {1000035} {0.0}
412  add EnergyFraction {1000045} {0.0}
413  # energy fractions for K0short and Lambda
414  add EnergyFraction {310} {0.3}
415  add EnergyFraction {3122} {0.3}
416 
417  set ResolutionFormula { (eta <= -2.3 && eta>-4.0) * sqrt(energy^2*0.01^2 + energy*0.020^2 )+ \
418  (eta <= -1.5 && eta>-2.3 ) * sqrt(energy^2*0.02^2 + energy*0.025^2 )+ \
419  (eta <= 1.2 && eta> -1.5 ) * sqrt(energy^2*0.01^2 + energy*0.055^2 )+ \
420  (eta <= 4.0 && eta>1.2 ) * sqrt(energy^2*0.02^2 + energy*0.100^2 )}
421 
422 }
423 
424 
425 #############
426 # HCAL
427 #############
428 
429 module SimpleCalorimeter HCal {
430  set ParticleInputArray ParticlePropagator/stableParticles
431  set TrackInputArray ECal/eflowTracks
432 
433  set TowerOutputArray hcalTowers
434  set EFlowTrackOutputArray eflowTracks
435  set EFlowTowerOutputArray eflowNeutralHadrons
436 
437  set IsEcal false
438 
439  set EnergyMin 0.300
440  set EnergySignificanceMin 1.0
441 
442  set SmearTowerCenter true
443 
444  set pi [expr {acos(-1)}]
445 
446  set PhiBins {}
447  for {set i -30} {$i <=30} {incr i} {
448  add PhiBins [expr {$i * $pi/30.0}]
449  }
450  for {set i -10} {$i <=10} {incr i} {
451  set eta [expr {$i * 0.1}]
452  add EtaPhiBins $eta $PhiBins
453  }
454 
455  for {set i -30} {$i <=30} {incr i} {
456  add PhiBins [expr {$i * $pi/30.0}]
457  }
458  foreach eta {-4.0 -3.5 -2.95880652 -2.68264484 -2.46773612 -2.29224349 -2.14432155 -2.01681569 -1.90506801 -1.80587261 -1.71692581 -1.63651428 -1.56332731 -1.49633825 -1.43472677 -1.37782606 -1.325086 -1.27604684 -1.23031998 -1.18757364 -1.14752205 -1.10991713 -1.07454199 -1.04120583 -1.00} {
459  add EtaPhiBins $eta $PhiBins
460  }
461 
462  foreach eta {1.0 1.04 1.075 1.1099 1.14752205 1.18757364 1.23031998 1.27604684 1.325086 1.37782606 1.43472677 1.49633825 1.56332731 1.63651428 1.71692581 1.80587261 1.90506801 2.01681569 2.14432155 2.29224349 2.46773612 2.68264484 2.95880652 3.5 4.0} {
463  add EtaPhiBins $eta $PhiBins
464  }
465 
466 
467  add EnergyFraction {0} {1.0}
468  # energy fractions for e, gamma and pi0
469  add EnergyFraction {11} {0.0}
470  add EnergyFraction {22} {0.0}
471  add EnergyFraction {111} {0.0}
472  # energy fractions for muon, neutrinos and neutralinos
473  add EnergyFraction {12} {0.0}
474  add EnergyFraction {13} {0.0}
475  add EnergyFraction {14} {0.0}
476  add EnergyFraction {16} {0.0}
477  add EnergyFraction {1000022} {0.0}
478  add EnergyFraction {1000023} {0.0}
479  add EnergyFraction {1000025} {0.0}
480  add EnergyFraction {1000035} {0.0}
481  add EnergyFraction {1000045} {0.0}
482  # energy fractions for K0short and Lambda
483  add EnergyFraction {310} {0.7}
484  add EnergyFraction {3122} {0.7}
485 
486  # set HCalResolutionFormula {resolution formula as a function of eta and energy}
487  set ResolutionFormula { (eta <= -1.0 && eta>-4.0) * sqrt(energy^2*0.05^2 + energy*0.70^2)+
488  (eta <= 1.0 && eta>-1.0 ) * sqrt(energy^2*0.37^2 )+
489  (eta <= 4.0 && eta>1.0 ) * sqrt(energy^2*0.06^2 + energy*0.40^2)
490  }
491 
492 }
493 
494 
495 #################
496 # Electron filter
497 #################
498 
499 module PdgCodeFilter ElectronFilter {
500  set InputArray HCal/eflowTracks
501  set OutputArray electrons
502  set Invert true
503  add PdgCode {11}
504  add PdgCode {-11}
505 }
506 
507 ######################
508 # ChargedHadronFilter
509 ######################
510 
511 module PdgCodeFilter ChargedHadronFilter {
512  set InputArray HCal/eflowTracks
513  set OutputArray chargedHadrons
514 
515  add PdgCode {11}
516  add PdgCode {-11}
517  add PdgCode {13}
518  add PdgCode {-13}
519 }
520 
521 
522 ###################################################
523 # Tower Merger (in case not using e-flow algorithm)
524 ###################################################
525 
526 module Merger Calorimeter {
527 # add InputArray InputArray
528  add InputArray ECal/ecalTowers
529  add InputArray HCal/hcalTowers
530  set OutputArray towers
531 }
532 
533 
534 
535 ####################
536 # Energy flow merger
537 ####################
538 
539 module Merger EFlowMerger {
540 # add InputArray InputArray
541  add InputArray HCal/eflowTracks
542  add InputArray ECal/eflowPhotons
543  add InputArray HCal/eflowNeutralHadrons
544  set OutputArray eflow
545 }
546 
547 ######################
548 # EFlowFilter
549 ######################
550 
551 module PdgCodeFilter EFlowFilter {
552  set InputArray EFlowMerger/eflow
553  set OutputArray eflow
554 
555  add PdgCode {11}
556  add PdgCode {-11}
557  add PdgCode {13}
558  add PdgCode {-13}
559 }
560 
561 ###################
562 # Photon efficiency
563 ###################
564 
565 module Efficiency PhotonEfficiency {
566  set InputArray ECal/eflowPhotons
567  set OutputArray photons
568 
569  # set EfficiencyFormula {efficiency formula as a function of eta and pt}
570 
571  # efficiency formula for photons
572  set EfficiencyFormula { 1}
573 }
574 
575 ##################
576 # Photon isolation
577 ##################
578 
579 module Isolation PhotonIsolation {
580  set CandidateInputArray PhotonEfficiency/photons
581  set IsolationInputArray EFlowFilter/eflow
582 
583  set OutputArray photons
584 
585  set DeltaRMax 0.5
586 
587  set PTMin 0.5
588 
589  set PTRatioMax 0.12
590 }
591 
592 
593 #####################
594 # Electron efficiency
595 #####################
596 
597 module Efficiency ElectronEfficiency {
598  set InputArray ElectronFilter/electrons
599  set OutputArray electrons
600 
601  # set EfficiencyFormula {efficiency formula as a function of eta and pt}
602 
603  # efficiency formula for electrons
604  set EfficiencyFormula {1}
605 }
606 
607 ####################
608 # Electron isolation
609 ####################
610 
611 module Isolation ElectronIsolation {
612  set CandidateInputArray ElectronEfficiency/electrons
613  set IsolationInputArray EFlowFilter/eflow
614 
615  set OutputArray electrons
616 
617  set DeltaRMax 0.5
618 
619  set PTMin 0.5
620 
621  set PTRatioMax 0.12
622 }
623 
624 ###################
625 # Missing ET merger
626 ###################
627 
628 module Merger MissingET {
629 # add InputArray InputArray
630  add InputArray EFlowMerger/eflow
631  set MomentumOutputArray momentum
632 }
633 
634 ##################
635 # Scalar HT merger
636 ##################
637 
638 module Merger ScalarHT {
639 # add InputArray InputArray
640  add InputArray UniqueObjectFinder/jets
641  add InputArray UniqueObjectFinder/electrons
642  add InputArray UniqueObjectFinder/photons
643 
644  set EnergyOutputArray energy
645 }
646 
647 
648 #####################
649 # Neutrino Filter
650 #####################
651 
652 module PdgCodeFilter NeutrinoFilter {
653 
654  set InputArray Delphes/stableParticles
655  set OutputArray filteredParticles
656 
657  set PTMin 0.0
658 
659  add PdgCode {12}
660  add PdgCode {14}
661  add PdgCode {16}
662  add PdgCode {-12}
663  add PdgCode {-14}
664  add PdgCode {-16}
665 
666 }
667 
668 
669 #####################
670 # MC truth jet finder
671 #####################
672 
673 module FastJetFinder GenJetFinder {
674  set InputArray NeutrinoFilter/filteredParticles
675 
676  set OutputArray jets
677 
678  # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt
679  set JetAlgorithm 6
680  set ParameterR 1.0
681 
682  set JetPTMin 3.0
683 }
684 
685 #########################
686 # Gen Missing ET merger
687 ########################
688 
689 module Merger GenMissingET {
690 # add InputArray InputArray
691  add InputArray NeutrinoFilter/filteredParticles
692  set MomentumOutputArray momentum
693 }
694 
695 
696 
697 ############
698 # Jet finder
699 ############
700 
701 module FastJetFinder FastJetFinder {
702 # set InputArray Calorimeter/towers
703  set InputArray EFlowMerger/eflow
704 
705  set OutputArray jets
706 
707  # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt
708  set JetAlgorithm 6
709  set ParameterR 1.0
710 
711  set ComputeNsubjettiness 1
712  set Beta 1.0
713  set AxisMode 4
714 
715  set ComputeTrimming 1
716  set RTrim 0.4
717  set PtFracTrim 0.20
718  #set PtFracTrim 0.05
719 
720  set ComputePruning 1
721  set ZcutPrun 0.1
722  set RcutPrun 0.5
723  set RPrun 0.8
724 
725  set ComputeSoftDrop 1
726  set BetaSoftDrop 0.0
727  set SymmetryCutSoftDrop 0.1
728  set R0SoftDrop 0.8
729 
730  set JetPTMin 3.0}
731 
732 
733 ##################
734 # Jet Energy Scale
735 ##################
736 
737 module EnergyScale JetEnergyScale {
738  set InputArray FastJetFinder/jets
739  set OutputArray jets
740 
741  # scale formula for jets (do not apply it)
742  set ScaleFormula {1.0}
743 }
744 
745 ########################
746 # Jet Flavor Association
747 ########################
748 
749 module JetFlavorAssociation JetFlavorAssociation {
750 
751  set PartonInputArray Delphes/partons
752  set ParticleInputArray Delphes/allParticles
753  set ParticleLHEFInputArray Delphes/allParticlesLHEF
754  set JetInputArray JetEnergyScale/jets
755 
756  set DeltaR 0.5
757  set PartonPTMin 4.0
758  set PartonEtaMax 4.0
759 
760 }
761 
762 module JetFlavorAssociation GenJetFlavorAssociation {
763 
764  set PartonInputArray Delphes/partons
765  set ParticleInputArray Delphes/allParticles
766  set ParticleLHEFInputArray Delphes/allParticlesLHEF
767  set JetInputArray GenJetFinder/jets
768 
769  set DeltaR 0.5
770  set PartonPTMin 1.0
771  set PartonEtaMax 4.0
772 
773 }
774 
775 
776 
777 #####################################################
778 # Find uniquely identified photons/electrons/tau/jets
779 #####################################################
780 
781 module UniqueObjectFinder UniqueObjectFinder {
782 # earlier arrays take precedence over later ones
783 # add InputArray InputArray OutputArray
784  add InputArray PhotonIsolation/photons photons
785  add InputArray ElectronIsolation/electrons electrons
786  add InputArray JetEnergyScale/jets jets
787 }
788 
789 ############################
790 # b-tagging (track counting)
791 ############################
792 
793 module TrackCountingBTagging TrackCountingBTagging {
794  set JetInputArray JetEnergyScale/jets
795  set TrackInputArray HCal/eflowTracks
796  set BitNumber 0
797  # maximum distance between jet and track
798  set DeltaR 0.5
799  # minimum pt of tracks
800  set TrackPtMin 1.0
801  # maximum transverse impact parameter (in mm)
802  set TrackIPMax 3
803  # minimum ip significance for the track to be counted
804  set SigMin 2.0
805  set Use3D true
806  # alternate setting for 2D IP (default)
807  # set SigMin 1.3
808  # set Use3D false
809  # minimum number of tracks (high efficiency n=2, high purity n=3)
810  #set Ntracks 3
811 
812 }
813 
814 ##################
815 # Particle ID Systems
816 ##################
817 
818 source pfRICH_0.25mrad.tcl
819 #source pfRICH_0.0mrad.tcl
820 source barrelDIRC_epid.tcl
821 source barrelDIRC_hpid.tcl
822 #source BTOF.epid.t020ps.tcl
823 #source BTOF.hpid.t020ps.tcl
824 source BTOF.epid.t030ps.tcl
825 source BTOF.hpid.t030ps.tcl
826 #source dualRICH_aerogel_0.00mrad.tcl
827 #source dualRICH_aerogel_0.50mrad.tcl
828 source dualRICH_aerogel_0.25mrad.tcl
829 source dualRICH_c2f6_0.25mrad.tcl
830 #source dualRICH_c2f6_0.00mrad.tcl
831 #source dualRICH_c2f6_0.50mrad.tcl
832 
833 
834 ##################
835 # ROOT tree writer
836 ##################
837 
838 # tracks, towers and eflow objects are not stored by default in the output.
839 # if needed (for jet constituent or other studies), uncomment the relevant
840 # "add Branch ..." lines.
841 
842 module TreeWriter TreeWriter {
843 # add Branch InputArray BranchName BranchClass
844  add Branch Delphes/allParticles Particle GenParticle
845  add Branch BeamSpotFilter/beamSpotParticle BeamSpot GenParticle
846 
847  add Branch TrackMerger/tracks Track Track
848  add Branch Calorimeter/towers Tower Tower
849 
850  add Branch HCal/eflowTracks EFlowTrack Track
851  add Branch ECal/eflowPhotons EFlowPhoton Tower
852  add Branch HCal/eflowNeutralHadrons EFlowNeutralHadron Tower
853 
854  add Branch pfRICH/tracks pfRICHTrack Track
855 
856  add Branch barrelDIRC_epid/tracks barrelDIRC_epidTrack Track
857  add Branch barrelDIRC_hpid/tracks barrelDIRC_hpidTrack Track
858 
859  add Branch BTOF_e/tracks BTOF_eTrack Track
860  add Branch BTOF_h/tracks BTOF_hTrack Track
861  add Branch dualRICH_aerogel/tracks dualRICHagTrack Track
862  add Branch dualRICH_c2f6/tracks dualRICHcfTrack Track
863 
864  add Branch GenJetFinder/jets GenJet Jet
865  add Branch GenMissingET/momentum GenMissingET MissingET
866 
867  add Branch UniqueObjectFinder/jets Jet Jet
868  add Branch UniqueObjectFinder/electrons Electron Electron
869  add Branch UniqueObjectFinder/photons Photon Photon
870 
871  add Branch MissingET/momentum MissingET MissingET
872  add Branch ScalarHT/energy ScalarHT ScalarHT
873 }