EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
H1.tcl
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file H1.tcl
1 set ExecutionPath {
2  ParticlePropagator
3 
4  ChargedHadronTrackingEfficiency
5  ElectronTrackingEfficiency
6 
7 
8  ChargedHadronMomentumSmearing
9  ElectronMomentumSmearing
10  TrackMerger
11 
12 
13  ECal
14  HCal
15 
16  Calorimeter
17  EFlowMerger
18  EFlowFilter
19 
20  PhotonEfficiency
21  PhotonIsolation
22 
23  ElectronFilter
24  ElectronEfficiency
25  ElectronIsolation
26 
27  ChargedHadronFilter
28  MissingET
29  NeutrinoFilter
30  GenJetFinder
31  GenMissingET
32  FastJetFinder
33 
34  JetEnergyScale
35  ElectronEnergyScale
36 
37  JetFlavorAssociation
38  GenJetFlavorAssociation
39 
40  UniqueObjectFinder
41 
42  ScalarHT
43 
44 
45 
46  TreeWriter
47 }
48 
49 
50 module ParticlePropagator ParticlePropagator {
51  set InputArray Delphes/stableParticles
52  set OutputArray stableParticles
53  set ChargedHadronOutputArray chargedHadrons
54  set ElectronOutputArray electrons
55 
56  # radius of the magnetic field coverage, in m
57  set Radius 1.5
58  # half-length of the magnetic field coverage, in m
59  set HalfLength 1.20
60  # magnetic field
61  set Bz 1.16
62 }
63 
64 ## H1 central tracker covered
65 set CommonTrackingEfficiency {
66  (abs(eta) <= 2.0) * (pt > 0.100) * (1.0) +
67  0.0
68 }
69 
70 set CommonTrackingResolution {
71  (abs(eta)<=1.0) * (sqrt( (2.0e-2)^2 + (pt*cosh(eta)*5e-3)^2 ) ) +
72  (abs(eta)>1.0 && abs(eta)<2.0) * (sqrt( (10.0e-2)^2 + (pt*cosh(eta)*1e-2)^2 ) )
73 }
74 
75 
76 module Efficiency ChargedHadronTrackingEfficiency {
77  set InputArray ParticlePropagator/chargedHadrons
78  set OutputArray chargedHadrons
79  set EfficiencyFormula $CommonTrackingEfficiency
80 }
81 
82 ##############################
83 # Electron tracking efficiency
84 ##############################
85 
86 module Efficiency ElectronTrackingEfficiency {
87  set InputArray ParticlePropagator/electrons
88  set OutputArray electrons
89  set EfficiencyFormula $CommonTrackingEfficiency
90 
91 }
92 ########################################
93 # Momentum resolution for charged tracks
94 ########################################
95 
96 module MomentumSmearing ChargedHadronMomentumSmearing {
97  set InputArray ChargedHadronTrackingEfficiency/chargedHadrons
98  set OutputArray chargedHadrons
99  set ResolutionFormula $CommonTrackingResolution
100 }
101 ###################################
102 # Momentum resolution for electrons
103 ###################################
104 module MomentumSmearing ElectronMomentumSmearing {
105  set InputArray ElectronTrackingEfficiency/electrons
106  set OutputArray electrons
107  set ResolutionFormula $CommonTrackingResolution
108 }
109 
110 
111 ##############
112 # Track merger
113 ##############
114 
115 module Merger TrackMerger {
116 # add InputArray InputArray
117  add InputArray ChargedHadronMomentumSmearing/chargedHadrons
118  add InputArray ElectronMomentumSmearing/electrons
119 
120  set OutputArray tracks
121 }
122 
123 ################################
124 # Track impact parameter smearing
125 ################################
126 
127 #module TrackSmearing TrackSmearing {
128 
129 # set InputArray TrackMerger/tracks
130 # set BeamSpotInputArray BeamSpotFilter/beamSpotParticle
131 # set OutputArray tracks
132 # set ApplyToPileUp true
133  # magnetic field
134 # set Bz 1.16
135 # set PResolutionFormula { 0.0 }
136 # set CtgThetaResolutionFormula { 0.0 }
137 # set PhiResolutionFormula { 0.0 }
138 # set D0ResolutionFormula "0.02"
139 # set DZResolutionFormula "0.02 "
140 
141 #}
142 
143 
144 
145 #############
146 # ECAL
147 #############
148 
149 module SimpleCalorimeter ECal {
150  set ParticleInputArray ParticlePropagator/stableParticles
151  set TrackInputArray TrackMerger/tracks
152 
153  set TowerOutputArray ecalTowers
154  set EFlowTrackOutputArray eflowTracks
155  set EFlowTowerOutputArray eflowPhotons
156 
157  set IsEcal true
158  set EnergyMin 0.10
159 
160 
161 
162  set EnergySignificanceMin 1.0
163 
164  set SmearTowerCenter true
165  set pi [expr {acos(-1)}]
166  set PhiBins {}
167  for {set i -30} {$i <=30} {incr i} {
168  add PhiBins [expr {$i * $pi/30.0}]
169  }
170  for {set i -10} {$i <=10} {incr i} {
171  set eta [expr {$i * 0.1}]
172  add EtaPhiBins $eta $PhiBins
173  }
174  set PhiBins {}
175  for {set i -30} {$i <=30} {incr i} {
176  add PhiBins [expr {$i * $pi/30.0}]
177  }
178 
179  foreach eta {-3.3 -3.26996837 -3.14642305 -3.03653567 -2.93760447 -2.84766006 -2.76522251 -2.68915144 \
180 -2.61854952 -2.55269788 -2.49101173 -2.43300894 -2.3782873 -2.3265078 -2.27738197 -2.23066235 -2.1861350\
181 3 -2.14361383 -2.10293569 -2.063957 -2.02655061 -1.99060337 -1.95601417 -1.92269228 -1.89055593 -1.8595312\
182  -1.82955102 -1.80055436 -1.77248548 -1.74529337 -1.71893119 -1.69335587 -1.66852765 -1.64440978 -1.62096\
183 821 -1.59817135 -1.57598979 -1.55439612 -1.53336478 -1.51287184 -1.4928949 -1.47341295 -1.45440623 -1.435\
184 85618 -1.41774529 -1.40005705 -1.38277588 -1.36588703 -1.34937654 -1.33323117 -1.31743839 -1.30198626 -1.2\
185 8686345 -1.27205918 -1.25756317 -1.24336562 -1.22945719 -1.21582897 -1.20247241 -1.18937936 -1.17654201 -1\
186 .16395288 -1.15160481 -1.13949092 -1.12760462 -1.11593955 -1.10448965 -1.09324904 -1.08221211 -1.07137\
187 342 -1.06072776 -1.0502701 -1.03999558} {
188  add EtaPhiBins $eta $PhiBins
189 }
190  foreach eta {1.0 1.0502701 1.06072776 1.07137342 1.08221211 1.09324904 1.10448965 1.11593955 1.127604\
191 62 1.13949092 1.15160481 1.16395288 1.17654201 1.18937936 1.20247241 1.21582897 1.22945719 1.24336562 1.25\
192 756317 1.27205918 1.28686345 1.30198626 1.31743839 1.33323117 1.34937654 1.36588703 1.38277588 1.40005705 \
193 1.41774529 1.43585618 1.45440623 1.47341295 1.4928949 1.51287184 1.53336478 1.55439612 1.57598979 1.59817\
194 135 1.62096821 1.64440978 1.66852765 1.69335587 1.71893119 1.74529337 1.77248548 1.80055436 1.82955102 1.8\
195 595312 1.89055593 1.92269228 1.95601417 1.99060337 2.02655061 2.063957 2.10293569 2.14361383 2.18613503 2.\
196 23066235 2.27738197 2.3265078 2.3782873 2.43300894 2.49101173 2.55269788 2.61854952 2.68915144 2.76522251\
197  2.84766006 2.93760447 3.03653567 3.14642305 3.26996837 3.3} {
198  add EtaPhiBins $eta $PhiBins
199 }
200 
201  add EnergyFraction {0} {0.0}
202  # energy fractions for e, gamma and pi0
203  add EnergyFraction {11} {1.0}
204  add EnergyFraction {22} {1.0}
205  add EnergyFraction {111} {1.0}
206  # energy fractions for muon, neutrinos and neutralinos
207  add EnergyFraction {12} {0.0}
208  add EnergyFraction {13} {0.0}
209  add EnergyFraction {14} {0.0}
210  add EnergyFraction {16} {0.0}
211  add EnergyFraction {1000022} {0.0}
212  add EnergyFraction {1000023} {0.0}
213  add EnergyFraction {1000025} {0.0}
214  add EnergyFraction {1000035} {0.0}
215  add EnergyFraction {1000045} {0.0}
216 # energy fractions for K0short and Lambda
217  add EnergyFraction {310} {0.3}
218  add EnergyFraction {3122} {0.3}
219 
220 
221  set ResolutionFormula {
222  ( eta> -1.46 && eta < 3.35 ) * sqrt(energy^2*0.025^2 + energy*0.11^2 )
223  + ( eta> -3.35 && eta < -1.46 ) * sqrt(energy^2*0.030^2 + energy*0.10^2 )
224  }
225 
226 }
227 
228 #############
229 # HCAL
230 #############
231 
232 module SimpleCalorimeter HCal {
233  set ParticleInputArray ParticlePropagator/stableParticles
234  set TrackInputArray ECal/eflowTracks
235 
236  set TowerOutputArray hcalTowers
237  set EFlowTrackOutputArray eflowTracks
238  set EFlowTowerOutputArray eflowNeutralHadrons
239 
240  set IsEcal false
241 
242  ##Assumes noise 100 MeV per tower.
243  set EnergyMin 0.5
244  set EnergySignificanceMin 1.0
245 
246  set SmearTowerCenter true
247 
248  set SmearTowerCenter true
249 
250  set pi [expr {acos(-1)}]
251 
252  set PhiBins {}
253  for {set i -30} {$i <=30} {incr i} {
254  add PhiBins [expr {$i * $pi/30.0}]
255  }
256  for {set i -10} {$i <=10} {incr i} {
257  set eta [expr {$i * 0.1}]
258  add EtaPhiBins $eta $PhiBins
259  }
260 
261  for {set i -30} {$i <=30} {incr i} {
262  add PhiBins [expr {$i * $pi/30.0}]
263  }
264 
265  foreach eta {-3.3 -2.95880652 -2.68264484 -2.46773612 -2.29224349 -2.14432155 -2.01681569 -1.90506801 \
266 -1.80587261 -1.71692581 -1.63651428 -1.56332731 -1.49633825 -1.43472677 -1.37782606 -1.325086 -1.2760468\
267 4 -1.23031998 -1.18757364 -1.14752205 -1.10991713 -1.07454199 -1.04120583 -1.00} {
268  add EtaPhiBins $eta $PhiBins
269  }
270 
271  foreach eta {1.0 1.04 1.075 1.1099 1.14752205 1.18757364 1.23031998 1.27604684 1.325086 1.37782606 1.4\
272 3472677 1.49633825 1.56332731 1.63651428 1.71692581 1.80587261 1.90506801 2.01681569 2.14432155 2.29224349\
273  2.46773612 2.68264484 2.95880652 3.3} {
274  add EtaPhiBins $eta $PhiBins
275  }
276 
277  add EnergyFraction {0} {1.0}
278  # energy fractions for e, gamma and pi0
279  add EnergyFraction {11} {0.0}
280  add EnergyFraction {22} {0.0}
281  add EnergyFraction {111} {0.0}
282  # energy fractions for muon, neutrinos and neutralinos
283  add EnergyFraction {12} {0.0}
284  add EnergyFraction {13} {0.0}
285  add EnergyFraction {14} {0.0}
286  add EnergyFraction {16} {0.0}
287  add EnergyFraction {1000022} {0.0}
288  add EnergyFraction {1000023} {0.0}
289  add EnergyFraction {1000025} {0.0}
290  add EnergyFraction {1000035} {0.0}
291  add EnergyFraction {1000045} {0.0}
292 
293  add EnergyFraction {310} {0.7}
294  add EnergyFraction {3122} {0.7}
295 
296  # set HCalResolutionFormula {resolution formula as a function of eta and energy}
297 
298  set ResolutionFormula {
299  ( eta> -0.64 && eta < 3.20 ) * sqrt(energy^2*0.20^2 + energy*0.50^2)
300  + ( eta> 3.20 && eta < 3.35 ) * sqrt(energy^2*0.40^2 + energy*0.90^2)
301  + ( eta> -0.97 && eta < -0.64 ) * sqrt(energy^2*0.40^2 + energy*0.90^2)
302  }
303 }
304 
305 #################
306 # Electron filter
307 #################
308 
309 module PdgCodeFilter ElectronFilter {
310  set InputArray HCal/eflowTracks
311  set OutputArray electrons
312  set Invert true
313  add PdgCode {11}
314  add PdgCode {-11}
315 }
316 ######################
317 # ChargedHadronFilter
318 ######################
319 
320 module PdgCodeFilter ChargedHadronFilter {
321  set InputArray HCal/eflowTracks
322  set OutputArray chargedHadrons
323 
324  add PdgCode {11}
325  add PdgCode {-11}
326  add PdgCode {13}
327  add PdgCode {-13}
328 }
329 
330 
331 ###################################################
332 # Tower Merger (in case not using e-flow algorithm)
333 ###################################################
334 
335 module Merger Calorimeter {
336 # add InputArray InputArray
337  add InputArray ECal/ecalTowers
338  add InputArray HCal/hcalTowers
339  set OutputArray towers
340 }
341 ####################
342 # Energy flow merger
343 ####################
344 
345 module Merger EFlowMerger {
346 # add InputArray InputArray
347  add InputArray HCal/eflowTracks
348  add InputArray ECal/eflowPhotons
349  add InputArray HCal/eflowNeutralHadrons
350  set OutputArray eflow
351 }
352 
353 ######################
354 # EFlowFilter
355 ######################
356 
357 module PdgCodeFilter EFlowFilter {
358  set InputArray EFlowMerger/eflow
359  set OutputArray eflow
360 
361  add PdgCode {11}
362  add PdgCode {-11}
363  add PdgCode {13}
364  add PdgCode {-13}
365 }
366 ###################
367 # Photon efficiency
368 ###################
369 
370 module Efficiency PhotonEfficiency {
371  set InputArray ECal/eflowPhotons
372  set OutputArray photons
373 
374  # set EfficiencyFormula {efficiency formula as a function of eta and pt}
375 
376  # efficiency formula for photons
377  set EfficiencyFormula { 1}
378 }
379 module Isolation PhotonIsolation {
380  set CandidateInputArray PhotonEfficiency/photons
381  set IsolationInputArray EFlowFilter/eflow
382 
383  set OutputArray photons
384 
385  set DeltaRMax 0.5
386 
387  set PTMin 0.5
388 
389  set PTRatioMax 0.12
390 }
391 module Efficiency ElectronEfficiency {
392  set InputArray ElectronFilter/electrons
393  set OutputArray electrons
394 
395  # set EfficiencyFormula {efficiency formula as a function of eta and pt}
396 
397  # efficiency formula for electrons
398  set EfficiencyFormula {1}
399 }
400 
401 ####################
402 # Electron isolation
403 ####################
404 
405 module Isolation ElectronIsolation {
406  set CandidateInputArray ElectronEfficiency/electrons
407  set IsolationInputArray EFlowFilter/eflow
408 
409  set OutputArray electrons
410 
411  set DeltaRMax 0.5
412 
413  set PTMin 0.5
414  set PTRatioMax 0.12
415 }
416 
417 ###################
418 # Missing ET merger
419 ###################
420 
421 module Merger MissingET {
422 # add InputArray InputArray
423  add InputArray EFlowMerger/eflow
424  set MomentumOutputArray momentum
425 }
426 ##################
427 # Scalar HT merger
428 ##################
429 
430 module Merger ScalarHT {
431 # add InputArray InputArray
432  add InputArray UniqueObjectFinder/jets
433  add InputArray UniqueObjectFinder/electrons
434  add InputArray UniqueObjectFinder/photons
435 
436  set EnergyOutputArray energy
437 }
438 #####################
439 # Neutrino Filter
440 #####################
441 module PdgCodeFilter NeutrinoFilter {
442  set InputArray Delphes/stableParticles
443  set OutputArray filteredParticles
444  set PTMin 0.0
445  add PdgCode {12}
446  add PdgCode {14}
447  add PdgCode {16}
448  add PdgCode {-12}
449  add PdgCode {-14}
450  add PdgCode {-16}
451 
452 }
453 #####################
454 # MC truth jet finder
455 #####################
456 
457 module FastJetFinder GenJetFinder {
458  set InputArray NeutrinoFilter/filteredParticles
459 
460  set OutputArray jets
461 
462  # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt
463  set JetAlgorithm 6
464  set ParameterR 1.0
465 
466  set JetPTMin 3.0
467 }
468 #########################
469 # Gen Missing ET merger
470 ########################
471 
472 module Merger GenMissingET {
473 # add InputArray InputArray
474  add InputArray NeutrinoFilter/filteredParticles
475  set MomentumOutputArray momentum
476 }
477 ############
478 # Jet finder
479 ############
480 
481 module FastJetFinder FastJetFinder {
482 # set InputArray Calorimeter/towers
483  set InputArray EFlowMerger/eflow
484 
485  set OutputArray jets
486 
487  # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt
488  set JetAlgorithm 6
489  set ParameterR 1.0
490 
491  set ComputeNsubjettiness 1
492  set Beta 1.0
493  set AxisMode 4
494 set ComputeTrimming 1
495  set RTrim 0.4
496  set PtFracTrim 0.20
497  #set PtFracTrim 0.05
498 
499  set ComputePruning 1
500  set ZcutPrun 0.1
501  set RcutPrun 0.5
502  set RPrun 0.8
503 
504  set ComputeSoftDrop 1
505  set BetaSoftDrop 0.0
506  set SymmetryCutSoftDrop 0.1
507  set R0SoftDrop 0.8
508 
509  set JetPTMin 3.0}
510 ##################
511 # Jet Energy Scale
512 ##################
513 
514 module EnergyScale JetEnergyScale {
515  set InputArray FastJetFinder/jets
516  set OutputArray jets
517 
518  # scale formula for jets (do not apply it)
519  set ScaleFormula {1.0}
520 }
521 
522 module EnergyScale ElectronEnergyScale {
523  set InputArray ElectronIsolation/electrons
524  set OutputArray electrons
525  set ScaleFormula {0.995}
526 }
527 
528 
529 ########################
530 # Jet Flavor Association
531 ########################
532 
533 module JetFlavorAssociation JetFlavorAssociation {
534 
535  set PartonInputArray Delphes/partons
536  set ParticleInputArray Delphes/allParticles
537  set ParticleLHEFInputArray Delphes/allParticlesLHEF
538  set JetInputArray JetEnergyScale/jets
539 
540  set DeltaR 0.5
541  set PartonPTMin 4.0
542  set PartonEtaMax 4.0
543 
544 }
545 module JetFlavorAssociation GenJetFlavorAssociation {
546 
547  set PartonInputArray Delphes/partons
548  set ParticleInputArray Delphes/allParticles
549  set ParticleLHEFInputArray Delphes/allParticlesLHEF
550  set JetInputArray GenJetFinder/jets
551 
552  set DeltaR 0.5
553  set PartonPTMin 1.0
554  set PartonEtaMax 4.0
555 
556 }
557 #####################################################
558 # Find uniquely identified photons/electrons/tau/jets
559 #####################################################
560 
561 module UniqueObjectFinder UniqueObjectFinder {
562 # earlier arrays take precedence over later ones
563 # add InputArray InputArray OutputArray
564  add InputArray PhotonIsolation/photons photons
565  add InputArray ElectronEnergyScale/electrons electrons
566  add InputArray JetEnergyScale/jets jets
567 }
568 module TreeWriter TreeWriter {
569 # add Branch InputArray BranchName BranchClass
570  add Branch Delphes/allParticles Particle GenParticle
571 
572  add Branch TrackMerger/tracks Track Track
573  add Branch Calorimeter/towers Tower Tower
574 
575  add Branch HCal/eflowTracks EFlowTrack Track
576  add Branch ECal/eflowPhotons EFlowPhoton Tower
577  add Branch HCal/eflowNeutralHadrons EFlowNeutralHadron Tower
578 
579  add Branch GenJetFinder/jets GenJet Jet
580  add Branch GenMissingET/momentum GenMissingET MissingET
581 
582  add Branch UniqueObjectFinder/jets Jet Jet
583  add Branch UniqueObjectFinder/electrons Electron Electron
584  add Branch UniqueObjectFinder/photons Photon Photon
585 
586  add Branch MissingET/momentum MissingET MissingET
587  add Branch ScalarHT/energy ScalarHT ScalarHT
588 }
589 
590