Index: cards/CLIC/CLICdet_BeamCalF_Binning.tcl
===================================================================
--- cards/CLIC/CLICdet_BeamCalF_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/CLIC/CLICdet_BeamCalF_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,29 @@
+# A.F.Zarnecki, based on ILCDelphes implementation
+
+set pi [expr {acos(-1)} ]
+
+# BeamCal eta range 4.0 - 5.3 -> 2.099-0.572 =1.527deg
+#
+# Inner part (4.5-5.3):  1.273-0.347 = 0.926 deg
+# 360/0.0973/cosh(5.3) = ~36 => 32 bins (taking key hole into account!!!)
+#
+# Outer part (4.0-4.5):  2.099-1.273 = 0.826 deg
+# 360/0.0973/cosh(4.4) = ~90 => 90 bins
+# Front part
+
+  set PhiBins {}
+  for {set i -45} {$i <= 45} {incr i} {
+    add PhiBins [expr {$i * $pi/45.0} ]
+  }
+  for {set i 0} {$i <= 10} {incr i} {
+    set eta [expr {4.0 + $i * 0.4999/10.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
+  set PhiBins {}
+  for {set i -16} {$i <= 16} {incr i} {
+    add PhiBins [expr {$i * $pi/18.0} ]
+  }
+  for {set i 0} {$i <= 10} {incr i} {
+    set eta [expr {4.5 + $i * 0.8/10.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
Index: cards/CLIC/CLICdet_BeamCalR_Binning.tcl
===================================================================
--- cards/CLIC/CLICdet_BeamCalR_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/CLIC/CLICdet_BeamCalR_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,29 @@
+# A.F.Zarnecki, based on ILCDelphes implementation
+
+set pi [expr {acos(-1)} ]
+
+# BeamCal eta range 4.0 - 5.3 -> 2.099-0.572 =1.527deg
+#
+# Inner part (4.5-5.3):  1.273-0.347 = 0.926 deg
+# 360/0.0973/cosh(5.3) = ~36 => 32 bins (taking key hole into account!!!)
+#
+# Outer part (4.0-4.5):  2.099-1.273 = 0.826 deg
+# 360/0.0973/cosh(4.4) = ~90 => 90 bins
+# Rear part
+
+  set PhiBins {}
+  for {set i -45} {$i <= 45} {incr i} {
+    add PhiBins [expr {$i * $pi/45.0}]
+  }
+  for {set i 0} {$i <= 10} {incr i} {
+    set eta [expr {-4.0 - $i * 0.4999/10.0}]
+    add EtaPhiBins $eta $PhiBins
+  }
+  set PhiBins {}
+  for {set i -16} {$i <= 16} {incr i} {
+    add PhiBins [expr {$i * $pi/18.0}]
+  }
+  for {set i 0} {$i <= 10} {incr i} {
+    set eta [expr {-4.5 - $i * 0.8/10.0}]
+    add EtaPhiBins $eta $PhiBins
+  }
Index: cards/CLIC/CLICdet_BeamCal_Efficiency_Stage3.tcl
===================================================================
--- cards/CLIC/CLICdet_BeamCal_Efficiency_Stage3.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/CLIC/CLICdet_BeamCal_Efficiency_Stage3.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,16 @@
+# Efficiency formula for photons/electrons in BeamCal
+# Based on CLICdp-Note-2018-005 (Fig. 69)
+# A.F.Zarnecki
+
+set EfficiencyFormula {
+    (energy  < 400 )                                                         * (0.00) +
+    (energy >= 400 )                 * (abs(eta) <= 4.00 )                   * (0.00) +
+    (energy >= 400 && energy < 800 ) * (abs(eta) > 4.00 && abs(eta) <= 4.15) * (0.00144 * energy - 0.16) +
+    (energy >= 800 )                 * (abs(eta) > 4.00 && abs(eta) <= 4.15) * (0.99) +
+    (energy >= 400 && energy < 800 ) * (abs(eta) > 4.15 && abs(eta) <= 4.70) * (0.99 + (0.0016*energy-1.2796290)*(abs(eta)-4.15)) +
+    (energy >= 800 )                 * (abs(eta) > 4.15 && abs(eta) <= 4.70) * (0.99) +
+    (energy >= 400 && energy < 800 ) * (abs(eta) > 4.70 && abs(eta) <= 5.30) * (0.00) +
+    (energy >= 800 )                 * (abs(eta) > 4.70 && abs(eta) <= 5.30) *
+    (1.- pow(1.-min(pow((5.35-abs(eta))/0.95,0.55),1.0),max(0.0029*energy-0.13,1.0))) * (0.98) +
+    (energy >= 400 )                 * (abs(eta) > 5.30 )                    * (0.00)
+  }
Index: cards/CLIC/CLICdet_BeamCal_EnergyFractions.tcl
===================================================================
--- cards/CLIC/CLICdet_BeamCal_EnergyFractions.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/CLIC/CLICdet_BeamCal_EnergyFractions.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,20 @@
+# As for ECAL
+
+  add EnergyFraction {0} {0.0}
+  # energy fractions for e, gamma and pi0
+  add EnergyFraction {11} {1.0}
+  add EnergyFraction {22} {1.0}
+  add EnergyFraction {111} {1.0}
+  # energy fractions for muon, neutrinos and neutralinos
+  add EnergyFraction {12} {0.0}
+  add EnergyFraction {13} {0.0}
+  add EnergyFraction {14} {0.0}
+  add EnergyFraction {16} {0.0}
+  add EnergyFraction {1000022} {0.0}
+  add EnergyFraction {1000023} {0.0}
+  add EnergyFraction {1000025} {0.0}
+  add EnergyFraction {1000035} {0.0}
+  add EnergyFraction {1000045} {0.0}
+  # energy fractions for K0short and Lambda
+  add EnergyFraction {310} {0.3}
+  add EnergyFraction {3122} {0.3}
Index: cards/CLIC/CLICdet_BeamCal_Resolution_Stage3.tcl
===================================================================
--- cards/CLIC/CLICdet_BeamCal_Resolution_Stage3.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/CLIC/CLICdet_BeamCal_Resolution_Stage3.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,6 @@
+# A.F.Zarnecki
+# BeamCal resolution at 3TeV from CLICdp-Note-2018-005 (Fig. 72)
+
+  set ResolutionFormula {
+             energy*0.11
+  }
Index: cards/CLIC/CLICdet_LumiCalF_Binning.tcl
===================================================================
--- cards/CLIC/CLICdet_LumiCalF_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/CLIC/CLICdet_LumiCalF_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,15 @@
+# Copy of ILCDelphes implementation by P.Sopicki
+
+set pi [expr {acos(-1)} ]
+
+# LumiCal eta range 3.0 - 4.0 (no beam crossing boost)
+# Front part
+set PhiBins {}
+  for {set i -24} {$i <= 24} {incr i} {
+    add PhiBins [expr {$i * $pi/24.0} ]
+  }
+
+for {set i 0} {$i <= 64} {incr i} {
+    set eta [expr {3.0 + $i * 1.0/64.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
Index: cards/CLIC/CLICdet_LumiCalR_Binning.tcl
===================================================================
--- cards/CLIC/CLICdet_LumiCalR_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/CLIC/CLICdet_LumiCalR_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,15 @@
+# Copy of ILCDelphes implementation by P.Sopicki
+
+set pi [expr {acos(-1)} ]
+
+# LumiCal eta range 3.0 - 4.0 (no beam crossing boost)
+# Rear part
+set PhiBins {}
+  for {set i -24} {$i <= 24} {incr i} {
+    add PhiBins [expr {$i * $pi/24.0} ]
+  }
+
+for {set i 0} {$i <= 64} {incr i} {
+    set eta [expr {-4.0 + $i * 1.0/64.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
Index: cards/CLIC/CLICdet_LumiCal_Efficiency_Stage3.tcl
===================================================================
--- cards/CLIC/CLICdet_LumiCal_Efficiency_Stage3.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/CLIC/CLICdet_LumiCal_Efficiency_Stage3.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,25 @@
+# Efficiency formula for photons/electrons in LumiCal at 3 TeV
+# Based on CLICdp-Note-2018-005 (Fig. 65)
+# A.F.Zarnecki
+
+set EfficiencyFormula {
+    (energy < 10 ) *                                                       (0.00) +
+    (energy >= 10 ) * (abs(eta) <= 3.0 ) *                                 (0.00) +
+    (energy >= 10 && energy < 50 ) *  (abs(eta) > 3.00 && abs(eta) <= 3.22) *
+                             pow(0.99 - 3.60283*(3.22-abs(eta)), 50./energy)      +
+    (energy >= 50 ) *                 (abs(eta) > 3.00 && abs(eta) <= 3.22) *
+                               (0.99 - 3.60283*(3.22-abs(eta)))                   +
+    (energy >= 10 && energy < 60 ) *  (abs(eta) > 3.22 && abs(eta) <= 3.37) *
+                                 (0.899781 +  0.0510312 * log10(energy))          +
+    (energy >= 60 ) *                 (abs(eta) > 3.22 && abs(eta) <= 3.37) *
+                                 (0.99)                                           +
+    (energy >= 10 && energy < 98 ) *  (abs(eta) > 3.37 && abs(eta) <= 3.55) *
+                                 (0.252111 +  0.37063 * log10(energy))            +
+    (energy >= 98 ) *                 (abs(eta) > 3.37 && abs(eta) <= 3.55) *
+                                 (0.99)                                           +
+    (energy >= 10 && energy < 98 ) *  (abs(eta) > 3.55 && abs(eta) <= 4.00) *
+     (1.- pow(1.-pow((4.4-abs(eta))/0.9,exp(2.60527-0.0139161*energy)),4.0)) * (0.252111 +  0.37063  * log10(energy)) +
+    (energy >= 98 ) *                 (abs(eta) > 3.55 && abs(eta) <= 4.00) *
+     (1.- pow(1.-pow((4.4-abs(eta))/0.9,exp(2.60527-0.0139161*energy)),4.0)) * (0.99) +
+    (energy >= 10 ) * (abs(eta) > 4.0 ) *                                  (0.00)
+  }
Index: cards/CLIC/CLICdet_LumiCal_EnergyFractions.tcl
===================================================================
--- cards/CLIC/CLICdet_LumiCal_EnergyFractions.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/CLIC/CLICdet_LumiCal_EnergyFractions.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,20 @@
+# As for ECAL
+
+  add EnergyFraction {0} {0.0}
+  # energy fractions for e, gamma and pi0
+  add EnergyFraction {11} {1.0}
+  add EnergyFraction {22} {1.0}
+  add EnergyFraction {111} {1.0}
+  # energy fractions for muon, neutrinos and neutralinos
+  add EnergyFraction {12} {0.0}
+  add EnergyFraction {13} {0.0}
+  add EnergyFraction {14} {0.0}
+  add EnergyFraction {16} {0.0}
+  add EnergyFraction {1000022} {0.0}
+  add EnergyFraction {1000023} {0.0}
+  add EnergyFraction {1000025} {0.0}
+  add EnergyFraction {1000035} {0.0}
+  add EnergyFraction {1000045} {0.0}
+  # energy fractions for K0short and Lambda
+  add EnergyFraction {310} {0.3}
+  add EnergyFraction {3122} {0.3}
Index: cards/CLIC/CLICdet_LumiCal_Resolution_Stage3.tcl
===================================================================
--- cards/CLIC/CLICdet_LumiCal_Resolution_Stage3.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/CLIC/CLICdet_LumiCal_Resolution_Stage3.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,6 @@
+# A.F.Zarnecki
+# LumiCal energy resolution at 3TeV from CLICdp-Note-2018-005 (Fig. 68) 
+
+  set ResolutionFormula {
+           sqrt(40.9 + energy*0.356624) 
+  }
Index: cards/FCC/FCChh.tcl
===================================================================
--- cards/FCC/FCChh.tcl	(revision a5af1df1cf2ca5a488fc610ab546c762b7cdb5f2)
+++ cards/FCC/FCChh.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -4,5 +4,9 @@
 #  Main authors:  Michele Selvaggi (CERN)
 #
-#  Released on: Dec. 1st, 2017
+#  Released on: October 14th, 2020
+#
+#  - fix muon resolution at high pT
+#  - updated btagging, tau tagging and photon ID
+#
 #
 #  Configuration: FCC-hh baseline detector
@@ -1049,5 +1053,5 @@
   (abs(eta) <= 2.5) * (pt > 1.0 && pt < 5.0)  * (0.70) +
   (abs(eta) <= 2.5) * (pt > 5.0 && pt < 10.0) * (0.85) +
-  (abs(eta) <= 2.5) * (pt > 10.0)             * (0.95) +
+  (abs(eta) <= 2.5) * (pt > 10.0)             * (0.90) +
     
   (abs(eta) > 2.5 && abs(eta) <= 4.0) * (pt > 1.0 && pt < 5.0)  * (0.60) + 
@@ -1138,6 +1142,6 @@
   (abs(eta) < 2.5)                   * (pt > 500.0 && pt < 15000.0) * (0.01)*(1.0 - pt/15000.) + \
   (abs(eta) < 2.5)                   * (pt > 15000.0)               * (0.00) + \
-  (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 10.0 && pt < 500)      * (0.0075) + \
-  (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 500.0 && pt < 15000.0) * (0.0075)*(1.0 - pt/15000.) + \
+  (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 10.0 && pt < 500)      * (0.01) + \
+  (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 500.0 && pt < 15000.0) * (0.01)*(1.0 - pt/15000.) + \
   (abs(eta) < 2.5 && abs(eta) < 4.0) * (pt > 15000.0)               * (0.000) + \
   (abs(eta) > 4.0) * (0.00)}
@@ -1146,9 +1150,9 @@
 
   (pt <= 10.0)                       * (0.00) +
-  (abs(eta) < 2.5)                   * (pt > 10.0 && pt < 500)      * (0.05) + \
-  (abs(eta) < 2.5)                   * (pt > 500.0 && pt < 15000.0) * (0.05)*(1.0 - pt/15000.) + \
+  (abs(eta) < 2.5)                   * (pt > 10.0 && pt < 500)      * (0.15) + \
+  (abs(eta) < 2.5)                   * (pt > 500.0 && pt < 15000.0) * (0.15)*(1.0 - pt/15000.) + \
   (abs(eta) < 2.5)                   * (pt > 15000.0)               * (0.000) + \
-  (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 10.0 && pt < 500)      * (0.03) + \
-  (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 500.0 && pt < 15000.0) * (0.03)*(1.0 - pt/15000.) + \
+  (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 10.0 && pt < 500)      * (0.10) + \
+  (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 500.0 && pt < 15000.0) * (0.10)*(1.0 - pt/15000.) + \
   (abs(eta) < 2.5 && abs(eta) < 4.0) * (pt > 15000.0)               * (0.000) + \
   (abs(eta) > 4.0) * (0.00)}
@@ -1157,6 +1161,6 @@
 
   (pt <= 10.0)                                                       * (0.00) +
-  (abs(eta) < 2.5)                    * (pt > 10.0 && pt < 500)      * (0.85) + 
-  (abs(eta) < 2.5)                    * (pt > 500.0 && pt < 15000.0) * (0.85)*(1.0 - pt/15000.) + 
+  (abs(eta) < 2.5)                    * (pt > 10.0 && pt < 500)      * (0.82) + 
+  (abs(eta) < 2.5)                    * (pt > 500.0 && pt < 15000.0) * (0.82)*(1.0 - pt/15000.) + 
   (abs(eta) < 2.5)                    * (pt > 15000.0)               * (0.000) + 
   (abs(eta) >= 2.5 && abs(eta) < 4.0) * (pt > 10.0 && pt < 500)      * (0.64) + 
@@ -1217,6 +1221,6 @@
 
   (pt <= 10.0)                                                       * (0.00) +
-  (abs(eta) < 2.5)                   * (pt > 10.0 && pt < 5000.0)    * (0.01) + \
-  (abs(eta) < 2.5)                   * (pt > 5000.0 && pt < 34000.0) * (0.01)  *(8./9. - pt/30000.) + \
+  (abs(eta) < 2.5)                   * (pt > 10.0 && pt < 5000.0)    * (0.02) + \
+  (abs(eta) < 2.5)                   * (pt > 5000.0 && pt < 34000.0) * (0.02)  *(8./9. - pt/30000.) + \
   (abs(eta) < 2.5)                   * (pt > 34000.0)                * (0.000) + \
   (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 10.0 && pt < 5000.0)    * (0.0075) + \
@@ -1228,9 +1232,9 @@
 
   (pt <= 10.0)                                                       * (0.00) +
-  (abs(eta) < 2.5)                   * (pt > 10.0 && pt < 5000.0)    * (0.005) + \
-  (abs(eta) < 2.5)                   * (pt > 5000.0 && pt < 34000.0) * (0.005)  *(8./9. - pt/30000.) + \
+  (abs(eta) < 2.5)                   * (pt > 10.0 && pt < 5000.0)    * (0.001) + \
+  (abs(eta) < 2.5)                   * (pt > 5000.0 && pt < 34000.0) * (0.001)  *(8./9. - pt/30000.) + \
   (abs(eta) < 2.5)                   * (pt > 34000.0)                * (0.000) + \
-  (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 10.0 && pt < 5000.0)    * (0.00375) + \
-  (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 5000.0 && pt < 34000.0) * (0.00375)*(8./9. - pt/30000.) + \
+  (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 10.0 && pt < 5000.0)    * (0.001) + \
+  (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 5000.0 && pt < 34000.0) * (0.001)*(8./9. - pt/30000.) + \
   (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 34000.0)                * (0.00) + \
   (abs(eta) > 4.0)                   * (0.00)}
Index: cards/FCC/muonMomentumResolutionVsP.tcl
===================================================================
--- cards/FCC/muonMomentumResolutionVsP.tcl	(revision a5af1df1cf2ca5a488fc610ab546c762b7cdb5f2)
+++ cards/FCC/muonMomentumResolutionVsP.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -12,18 +12,19 @@
 set ResolutionFormula { 
  
-( abs(eta) < 1.35 ) * 
-
-(sqrt(0.0000364164 + (
-   9.06262e-8 *pt^2* cosh(
-     eta)^2 *(2.82074e-7/sin(2*atan(exp(-abs(eta))))^2 + (
-      504.525 *(1/400000000 + (0.117945* 1/cosh(eta)^2)/(
-         pt^2 *sin(2*atan(exp(-abs(eta))))^2)))/
-      sin(2*atan(exp(-abs(eta))))^2) *sin(2*atan(exp(-abs(eta))))^2)/(
-   0.00516429/sin(2*atan(exp(-abs(eta))))^2 + (
-    96868.8 *(1/400000000 + (0.117945 * 1/cosh(eta)^2)/(
-       pt^2 *sin(2*atan(exp(-abs(eta))))^2)))/
-    sin(2*atan(exp(-abs(eta))))^2))
-
-) +
+
+( abs(eta) < 1.35 ) *
+
+    (sqrt(0.0000364164 + (
+                          3*9.06262e-8 *pt^2* cosh(
+         eta)^2 *(2.82074e-7/sin(2*atan(exp(-abs(eta))))^2 + (
+          504.525 *(1/400000000 + (0.117945* 1/cosh(eta)^2)/(
+             pt^2 *sin(2*atan(exp(-abs(eta))))^2)))/
+          sin(2*atan(exp(-abs(eta))))^2) *sin(2*atan(exp(-abs(eta))))^2)/(
+       0.00516429/sin(2*atan(exp(-abs(eta))))^2 + (
+        96868.8 *(1/400000000 + 5*(0.117945 * 1/cosh(eta)^2)/(
+           pt^2 *sin(2*atan(exp(-abs(eta))))^2)))/
+        sin(2*atan(exp(-abs(eta))))^2))
+
+    ) +
   
 ( abs(eta) > 1.35 && abs(eta) < 2.00) * 
Index: cards/ILCgen/ILCgen_BTagging_50.tcl
===================================================================
--- cards/ILCgen/ILCgen_BTagging_50.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_BTagging_50.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,104 @@
+  # misidentification rate (uds)
+  # average efficiency: 0.00583
+  add EfficiencyFormula {0} {
+    ( abs(eta)<0.867 )*( energy<30 )*( 0.00885 )+ 
+    ( abs(eta)<0.867 )*( 30<=energy && energy<60 )*( 0.00773 )+ 
+    ( abs(eta)<0.867 )*( 60<=energy && energy<100 )*( 0.00734 )+ 
+    ( abs(eta)<0.867 )*( 100<=energy && energy<150 )*( 0.00757 )+ 
+    ( abs(eta)<0.867 )*( 150<=energy )*( 0.00884 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( energy<30 )*( 0.00835 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 30<=energy && energy<60 )*( 0.00764 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 60<=energy && energy<100 )*( 0.00768 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 100<=energy && energy<150 )*( 0.00768 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 150<=energy )*( 0.00878 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( energy<30 )*( 0.00703 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 30<=energy && energy<60 )*( 0.00554 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 60<=energy && energy<100 )*( 0.00637 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 100<=energy && energy<150 )*( 0.00662 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 150<=energy )*( 0.0079 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( energy<30 )*( 0.00491 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 30<=energy && energy<60 )*( 0.00465 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 60<=energy && energy<100 )*( 0.00463 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 100<=energy && energy<150 )*( 0.00421 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 150<=energy )*( 0.0064 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( energy<30 )*( 0.0057 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 30<=energy && energy<60 )*( 0.00348 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 60<=energy && energy<100 )*( 0.00316 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 100<=energy && energy<150 )*( 0.00263 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 150<=energy )*( 0.00401 )+ 
+    ( 2.99<=abs(eta) )*( energy<30 )*( 0.00289 )+ 
+    ( 2.99<=abs(eta) )*( 30<=energy && energy<60 )*( 0.0054 )+ 
+    ( 2.99<=abs(eta) )*( 60<=energy && energy<100 )*( 0.00384 )+ 
+    ( 2.99<=abs(eta) )*( 100<=energy && energy<150 )*( 0.00187 )+ 
+    ( 2.99<=abs(eta) )*( 150<=energy )*( 0.00327 )
+  }
+  
+  # misidentification rate (c)
+  # average efficiency: 0.0544
+  add EfficiencyFormula {4} {
+    ( abs(eta)<0.867 )*( energy<30 )*( 0.0627 )+ 
+    ( abs(eta)<0.867 )*( 30<=energy && energy<60 )*( 0.074 )+ 
+    ( abs(eta)<0.867 )*( 60<=energy && energy<100 )*( 0.0869 )+ 
+    ( abs(eta)<0.867 )*( 100<=energy && energy<150 )*( 0.096 )+ 
+    ( abs(eta)<0.867 )*( 150<=energy )*( 0.119 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( energy<30 )*( 0.054 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 30<=energy && energy<60 )*( 0.0692 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 60<=energy && energy<100 )*( 0.0835 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 100<=energy && energy<150 )*( 0.0952 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 150<=energy )*( 0.108 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( energy<30 )*( 0.0369 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 30<=energy && energy<60 )*( 0.0605 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 60<=energy && energy<100 )*( 0.0745 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 100<=energy && energy<150 )*( 0.0815 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 150<=energy )*( 0.108 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( energy<30 )*( 0.027 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 30<=energy && energy<60 )*( 0.0387 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 60<=energy && energy<100 )*( 0.0561 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 100<=energy && energy<150 )*( 0.0653 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 150<=energy )*( 0.0775 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( energy<30 )*( 0.0125 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 30<=energy && energy<60 )*( 0.0197 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 60<=energy && energy<100 )*( 0.0195 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 100<=energy && energy<150 )*( 0.026 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 150<=energy )*( 0.0356 )+ 
+    ( 2.99<=abs(eta) )*( energy<30 )*( 0.00479 )+ 
+    ( 2.99<=abs(eta) )*( 30<=energy && energy<60 )*( 0.00805 )+ 
+    ( 2.99<=abs(eta) )*( 60<=energy && energy<100 )*( 0.00797 )+ 
+    ( 2.99<=abs(eta) )*( 100<=energy && energy<150 )*( 0.0106 )+ 
+    ( 2.99<=abs(eta) )*( 150<=energy )*( 0.0144 )
+  }
+  
+  # b-tagging efficiency
+  # average efficiency: 0.529
+  add EfficiencyFormula {5} {
+    ( abs(eta)<0.867 )*( energy<30 )*( 0.682 )+ 
+    ( abs(eta)<0.867 )*( 30<=energy && energy<60 )*( 0.803 )+ 
+    ( abs(eta)<0.867 )*( 60<=energy && energy<100 )*( 0.852 )+ 
+    ( abs(eta)<0.867 )*( 100<=energy && energy<150 )*( 0.887 )+ 
+    ( abs(eta)<0.867 )*( 150<=energy )*( 0.899 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( energy<30 )*( 0.568 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 30<=energy && energy<60 )*( 0.743 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 60<=energy && energy<100 )*( 0.816 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 100<=energy && energy<150 )*( 0.854 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 150<=energy )*( 0.881 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( energy<30 )*( 0.432 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 30<=energy && energy<60 )*( 0.632 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 60<=energy && energy<100 )*( 0.748 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 100<=energy && energy<150 )*( 0.801 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 150<=energy )*( 0.851 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( energy<30 )*( 0.28 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 30<=energy && energy<60 )*( 0.443 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 60<=energy && energy<100 )*( 0.563 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 100<=energy && energy<150 )*( 0.643 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 150<=energy )*( 0.717 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( energy<30 )*( 0.143 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 30<=energy && energy<60 )*( 0.206 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 60<=energy && energy<100 )*( 0.226 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 100<=energy && energy<150 )*( 0.281 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 150<=energy )*( 0.325 )+ 
+    ( 2.99<=abs(eta) )*( energy<30 )*( 0.0336 )+ 
+    ( 2.99<=abs(eta) )*( 30<=energy && energy<60 )*( 0.0865 )+ 
+    ( 2.99<=abs(eta) )*( 60<=energy && energy<100 )*( 0.152 )+ 
+    ( 2.99<=abs(eta) )*( 100<=energy && energy<150 )*( 0.166 )+ 
+    ( 2.99<=abs(eta) )*( 150<=energy )*( 0.162 )
+  }
Index: cards/ILCgen/ILCgen_BTagging_70.tcl
===================================================================
--- cards/ILCgen/ILCgen_BTagging_70.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_BTagging_70.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,104 @@
+  # misidentification rate (uds)
+  # average efficiency: 0.0613
+  add EfficiencyFormula {0} {
+    ( abs(eta)<0.867 )*( energy<30 )*( 0.067 )+ 
+    ( abs(eta)<0.867 )*( 30<=energy && energy<60 )*( 0.0564 )+ 
+    ( abs(eta)<0.867 )*( 60<=energy && energy<100 )*( 0.0588 )+ 
+    ( abs(eta)<0.867 )*( 100<=energy && energy<150 )*( 0.0644 )+ 
+    ( abs(eta)<0.867 )*( 150<=energy )*( 0.0751 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( energy<30 )*( 0.0699 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 30<=energy && energy<60 )*( 0.0599 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 60<=energy && energy<100 )*( 0.0598 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 100<=energy && energy<150 )*( 0.0669 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 150<=energy )*( 0.0832 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( energy<30 )*( 0.0685 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 30<=energy && energy<60 )*( 0.0563 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 60<=energy && energy<100 )*( 0.0611 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 100<=energy && energy<150 )*( 0.0658 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 150<=energy )*( 0.0832 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( energy<30 )*( 0.0664 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 30<=energy && energy<60 )*( 0.0517 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 60<=energy && energy<100 )*( 0.0517 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 100<=energy && energy<150 )*( 0.061 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 150<=energy )*( 0.0724 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( energy<30 )*( 0.0878 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 30<=energy && energy<60 )*( 0.0498 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 60<=energy && energy<100 )*( 0.04 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 100<=energy && energy<150 )*( 0.0432 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 150<=energy )*( 0.0498 )+ 
+    ( 2.99<=abs(eta) )*( energy<30 )*( 0.0852 )+ 
+    ( 2.99<=abs(eta) )*( 30<=energy && energy<60 )*( 0.0638 )+ 
+    ( 2.99<=abs(eta) )*( 60<=energy && energy<100 )*( 0.0449 )+ 
+    ( 2.99<=abs(eta) )*( 100<=energy && energy<150 )*( 0.0368 )+ 
+    ( 2.99<=abs(eta) )*( 150<=energy )*( 0.0379 )
+  }
+  
+  # misidentification rate (c)
+  # average efficiency: 0.289
+  add EfficiencyFormula {4} {
+    ( abs(eta)<0.867 )*( energy<30 )*( 0.385 )+ 
+    ( abs(eta)<0.867 )*( 30<=energy && energy<60 )*( 0.396 )+ 
+    ( abs(eta)<0.867 )*( 60<=energy && energy<100 )*( 0.408 )+ 
+    ( abs(eta)<0.867 )*( 100<=energy && energy<150 )*( 0.427 )+ 
+    ( abs(eta)<0.867 )*( 150<=energy )*( 0.453 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( energy<30 )*( 0.329 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 30<=energy && energy<60 )*( 0.367 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 60<=energy && energy<100 )*( 0.395 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 100<=energy && energy<150 )*( 0.431 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 150<=energy )*( 0.448 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( energy<30 )*( 0.256 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 30<=energy && energy<60 )*( 0.323 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 60<=energy && energy<100 )*( 0.373 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 100<=energy && energy<150 )*( 0.406 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 150<=energy )*( 0.452 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( energy<30 )*( 0.209 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 30<=energy && energy<60 )*( 0.254 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 60<=energy && energy<100 )*( 0.3 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 100<=energy && energy<150 )*( 0.355 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 150<=energy )*( 0.402 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( energy<30 )*( 0.129 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 30<=energy && energy<60 )*( 0.137 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 60<=energy && energy<100 )*( 0.147 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 100<=energy && energy<150 )*( 0.182 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 150<=energy )*( 0.23 )+ 
+    ( 2.99<=abs(eta) )*( energy<30 )*( 0.0814 )+ 
+    ( 2.99<=abs(eta) )*( 30<=energy && energy<60 )*( 0.0862 )+ 
+    ( 2.99<=abs(eta) )*( 60<=energy && energy<100 )*( 0.0837 )+ 
+    ( 2.99<=abs(eta) )*( 100<=energy && energy<150 )*( 0.0933 )+ 
+    ( 2.99<=abs(eta) )*( 150<=energy )*( 0.127 )
+  }
+  
+  # b-tagging efficiency
+  # average efficiency: 0.702
+  add EfficiencyFormula {5} {
+    ( abs(eta)<0.867 )*( energy<30 )*( 0.851 )+ 
+    ( abs(eta)<0.867 )*( 30<=energy && energy<60 )*( 0.918 )+ 
+    ( abs(eta)<0.867 )*( 60<=energy && energy<100 )*( 0.947 )+ 
+    ( abs(eta)<0.867 )*( 100<=energy && energy<150 )*( 0.964 )+ 
+    ( abs(eta)<0.867 )*( 150<=energy )*( 0.974 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( energy<30 )*( 0.766 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 30<=energy && energy<60 )*( 0.885 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 60<=energy && energy<100 )*( 0.929 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 100<=energy && energy<150 )*( 0.956 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 150<=energy )*( 0.964 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( energy<30 )*( 0.653 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 30<=energy && energy<60 )*( 0.812 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 60<=energy && energy<100 )*( 0.892 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 100<=energy && energy<150 )*( 0.932 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 150<=energy )*( 0.957 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( energy<30 )*( 0.525 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 30<=energy && energy<60 )*( 0.695 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 60<=energy && energy<100 )*( 0.805 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 100<=energy && energy<150 )*( 0.862 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 150<=energy )*( 0.897 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( energy<30 )*( 0.347 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 30<=energy && energy<60 )*( 0.469 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 60<=energy && energy<100 )*( 0.506 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 100<=energy && energy<150 )*( 0.577 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 150<=energy )*( 0.63 )+ 
+    ( 2.99<=abs(eta) )*( energy<30 )*( 0.144 )+ 
+    ( 2.99<=abs(eta) )*( 30<=energy && energy<60 )*( 0.239 )+ 
+    ( 2.99<=abs(eta) )*( 60<=energy && energy<100 )*( 0.309 )+ 
+    ( 2.99<=abs(eta) )*( 100<=energy && energy<150 )*( 0.325 )+ 
+    ( 2.99<=abs(eta) )*( 150<=energy )*( 0.344 )
+  }
Index: cards/ILCgen/ILCgen_BTagging_80.tcl
===================================================================
--- cards/ILCgen/ILCgen_BTagging_80.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_BTagging_80.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,104 @@
+  # misidentification rate (uds)
+  # average efficiency: 0.182
+  add EfficiencyFormula {0} {
+    ( abs(eta)<0.867 )*( energy<30 )*( 0.179 )+ 
+    ( abs(eta)<0.867 )*( 30<=energy && energy<60 )*( 0.139 )+ 
+    ( abs(eta)<0.867 )*( 60<=energy && energy<100 )*( 0.136 )+ 
+    ( abs(eta)<0.867 )*( 100<=energy && energy<150 )*( 0.14 )+ 
+    ( abs(eta)<0.867 )*( 150<=energy )*( 0.155 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( energy<30 )*( 0.211 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 30<=energy && energy<60 )*( 0.157 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 60<=energy && energy<100 )*( 0.145 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 100<=energy && energy<150 )*( 0.151 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 150<=energy )*( 0.168 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( energy<30 )*( 0.225 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 30<=energy && energy<60 )*( 0.168 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 60<=energy && energy<100 )*( 0.156 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 100<=energy && energy<150 )*( 0.158 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 150<=energy )*( 0.173 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( energy<30 )*( 0.253 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 30<=energy && energy<60 )*( 0.175 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 60<=energy && energy<100 )*( 0.155 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 100<=energy && energy<150 )*( 0.159 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 150<=energy )*( 0.168 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( energy<30 )*( 0.337 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 30<=energy && energy<60 )*( 0.192 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 60<=energy && energy<100 )*( 0.146 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 100<=energy && energy<150 )*( 0.131 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 150<=energy )*( 0.139 )+ 
+    ( 2.99<=abs(eta) )*( energy<30 )*( 0.349 )+ 
+    ( 2.99<=abs(eta) )*( 30<=energy && energy<60 )*( 0.273 )+ 
+    ( 2.99<=abs(eta) )*( 60<=energy && energy<100 )*( 0.194 )+ 
+    ( 2.99<=abs(eta) )*( 100<=energy && energy<150 )*( 0.163 )+ 
+    ( 2.99<=abs(eta) )*( 150<=energy )*( 0.162 )
+  }
+  
+  # misidentification rate (c)
+  # average efficiency: 0.504
+  add EfficiencyFormula {4} {
+    ( abs(eta)<0.867 )*( energy<30 )*( 0.619 )+ 
+    ( abs(eta)<0.867 )*( 30<=energy && energy<60 )*( 0.639 )+ 
+    ( abs(eta)<0.867 )*( 60<=energy && energy<100 )*( 0.648 )+ 
+    ( abs(eta)<0.867 )*( 100<=energy && energy<150 )*( 0.659 )+ 
+    ( abs(eta)<0.867 )*( 150<=energy )*( 0.67 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( energy<30 )*( 0.563 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 30<=energy && energy<60 )*( 0.603 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 60<=energy && energy<100 )*( 0.632 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 100<=energy && energy<150 )*( 0.656 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 150<=energy )*( 0.67 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( energy<30 )*( 0.5 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 30<=energy && energy<60 )*( 0.548 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 60<=energy && energy<100 )*( 0.602 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 100<=energy && energy<150 )*( 0.642 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 150<=energy )*( 0.672 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( energy<30 )*( 0.447 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 30<=energy && energy<60 )*( 0.459 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 60<=energy && energy<100 )*( 0.506 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 100<=energy && energy<150 )*( 0.571 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 150<=energy )*( 0.616 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( energy<30 )*( 0.391 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 30<=energy && energy<60 )*( 0.326 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 60<=energy && energy<100 )*( 0.328 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 100<=energy && energy<150 )*( 0.338 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 150<=energy )*( 0.396 )+ 
+    ( 2.99<=abs(eta) )*( energy<30 )*( 0.376 )+ 
+    ( 2.99<=abs(eta) )*( 30<=energy && energy<60 )*( 0.294 )+ 
+    ( 2.99<=abs(eta) )*( 60<=energy && energy<100 )*( 0.271 )+ 
+    ( 2.99<=abs(eta) )*( 100<=energy && energy<150 )*( 0.227 )+ 
+    ( 2.99<=abs(eta) )*( 150<=energy )*( 0.257 )
+  }
+  
+  # b-tagging efficiency
+  # average efficiency: 0.801
+  add EfficiencyFormula {5} {
+    ( abs(eta)<0.867 )*( energy<30 )*( 0.908 )+ 
+    ( abs(eta)<0.867 )*( 30<=energy && energy<60 )*( 0.948 )+ 
+    ( abs(eta)<0.867 )*( 60<=energy && energy<100 )*( 0.971 )+ 
+    ( abs(eta)<0.867 )*( 100<=energy && energy<150 )*( 0.982 )+ 
+    ( abs(eta)<0.867 )*( 150<=energy )*( 0.988 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( energy<30 )*( 0.85 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 30<=energy && energy<60 )*( 0.927 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 60<=energy && energy<100 )*( 0.96 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 100<=energy && energy<150 )*( 0.978 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 150<=energy )*( 0.982 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( energy<30 )*( 0.79 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 30<=energy && energy<60 )*( 0.88 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 60<=energy && energy<100 )*( 0.935 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 100<=energy && energy<150 )*( 0.963 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 150<=energy )*( 0.979 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( energy<30 )*( 0.708 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 30<=energy && energy<60 )*( 0.802 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 60<=energy && energy<100 )*( 0.882 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 100<=energy && energy<150 )*( 0.927 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 150<=energy )*( 0.944 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( energy<30 )*( 0.59 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 30<=energy && energy<60 )*( 0.639 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 60<=energy && energy<100 )*( 0.668 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 100<=energy && energy<150 )*( 0.721 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 150<=energy )*( 0.756 )+ 
+    ( 2.99<=abs(eta) )*( energy<30 )*( 0.411 )+ 
+    ( 2.99<=abs(eta) )*( 30<=energy && energy<60 )*( 0.477 )+ 
+    ( 2.99<=abs(eta) )*( 60<=energy && energy<100 )*( 0.472 )+ 
+    ( 2.99<=abs(eta) )*( 100<=energy && energy<150 )*( 0.5 )+ 
+    ( 2.99<=abs(eta) )*( 150<=energy )*( 0.488 )
+  }
Index: cards/ILCgen/ILCgen_BTagging_N.tcl
===================================================================
--- cards/ILCgen/ILCgen_BTagging_N.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_BTagging_N.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,105 @@
+###################################
+# b-tagging for inclusive jets, N=2
+###################################
+module BTagging BTagging80_N2 {
+    set JetInputArray JetFinder_N2/jets
+    set BitNumber 0
+
+    source ILCgen/ILCgen_BTagging_80.tcl
+}
+module BTagging BTagging70_N2 {
+    set JetInputArray JetFinder_N2/jets
+    set BitNumber 1
+
+    source ILCgen/ILCgen_BTagging_70.tcl
+}
+module BTagging BTagging50_N2 {
+    set JetInputArray JetFinder_N2/jets
+    set BitNumber 2
+
+    source ILCgen/ILCgen_BTagging_50.tcl
+}
+###################################
+# b-tagging for inclusive jets, N=3
+###################################
+module BTagging BTagging80_N3 {
+    set JetInputArray JetFinder_N3/jets
+    set BitNumber 0
+
+    source ILCgen/ILCgen_BTagging_80.tcl
+}
+module BTagging BTagging70_N3 {
+    set JetInputArray JetFinder_N3/jets
+    set BitNumber 1
+
+    source ILCgen/ILCgen_BTagging_70.tcl
+}
+module BTagging BTagging50_N3 {
+    set JetInputArray JetFinder_N3/jets
+    set BitNumber 2
+
+    source ILCgen/ILCgen_BTagging_50.tcl
+}
+###################################
+# b-tagging for inclusive jets, N=4
+###################################
+module BTagging BTagging80_N4 {
+    set JetInputArray JetFinder_N4/jets
+    set BitNumber 0
+
+    source ILCgen/ILCgen_BTagging_80.tcl
+}
+module BTagging BTagging70_N4 {
+    set JetInputArray JetFinder_N4/jets
+    set BitNumber 1
+
+    source ILCgen/ILCgen_BTagging_70.tcl
+}
+module BTagging BTagging50_N4 {
+    set JetInputArray JetFinder_N4/jets
+    set BitNumber 2
+
+    source ILCgen/ILCgen_BTagging_50.tcl
+}
+###################################
+# b-tagging for inclusive jets, N=5
+###################################
+module BTagging BTagging80_N5 {
+    set JetInputArray JetFinder_N5/jets
+    set BitNumber 0
+
+    source ILCgen/ILCgen_BTagging_80.tcl
+}
+module BTagging BTagging70_N5 {
+    set JetInputArray JetFinder_N5/jets
+    set BitNumber 1
+
+    source ILCgen/ILCgen_BTagging_70.tcl
+}
+module BTagging BTagging50_N5 {
+    set JetInputArray JetFinder_N5/jets
+    set BitNumber 2
+
+    source ILCgen/ILCgen_BTagging_50.tcl
+}
+###################################
+# b-tagging for inclusive jets, N=6
+###################################
+module BTagging BTagging80_N6 {
+    set JetInputArray JetFinder_N6/jets
+    set BitNumber 0
+
+    source ILCgen/ILCgen_BTagging_80.tcl
+}
+module BTagging BTagging70_N6 {
+    set JetInputArray JetFinder_N6/jets
+    set BitNumber 1
+
+    source ILCgen/ILCgen_BTagging_70.tcl
+}
+module BTagging BTagging50_N6 {
+    set JetInputArray JetFinder_N6/jets
+    set BitNumber 2
+
+    source ILCgen/ILCgen_BTagging_50.tcl
+}
Index: cards/ILCgen/ILCgen_BeamCalEfficiency.tcl
===================================================================
--- cards/ILCgen/ILCgen_BeamCalEfficiency.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_BeamCalEfficiency.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,11 @@
+# Efficiency formula for photons in Forward BeamCal
+# Based on IDR Figure 8.8a and Moritz Hebermehl PhD Thesis Figure 4.10
+# A.F.Zarnecki,  June 2020
+
+set EfficiencyFormula {
+    (energy <= 10 ) *                                                      (0.00) +
+    (energy > 10 ) * (abs(eta)  > 5.88 )                                 * (0.00) +
+    (energy > 10 ) * (abs(eta) <= 4.25 )                     * (0.98 - 1.0/energy) +
+    (energy > 10 ) * (abs(eta) > 4.25 && abs(eta) <= 5.88)   *
+         (1.- pow(1.-pow(3.6-abs(eta)/1.634,pow(85./energy,1.4)),4.0)) * (0.98 - 1.0/energy) 
+  }
Index: cards/ILCgen/ILCgen_BeamCalF_Binning.tcl
===================================================================
--- cards/ILCgen/ILCgen_BeamCalF_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_BeamCalF_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,30 @@
+#P.Sopicki: based on plots from D.Jeans:
+# corrected by A.F.Zarnecki
+
+set pi [expr {acos(-1)} ]
+
+# BeamCal eta range 4.0 - 5.8 -> 2.099-0.347 =1.752deg
+#
+# Inner part (4.6-5.8):  1.152-0.347 = 0.805 deg
+# 360/0.0973/cosh(5.3) = ~36 => 32 bins (taking key hole into account!!!)
+#
+# Outer part (4.0-4.6):  2.099-1.152 = 0.947 deg
+# 360/0.0973/cosh(4.4) = ~90 => 90 bins
+#Front part
+
+  set PhiBins {}
+  for {set i -45} {$i <= 45} {incr i} {
+    add PhiBins [expr {$i * $pi/45.0}]
+  }
+  for {set i 0} {$i <= 12} {incr i} {
+    set eta [expr {4.0 + $i * 0.5999/12.0}]
+    add EtaPhiBins $eta $PhiBins
+  }
+  set PhiBins {}
+  for {set i -16} {$i <= 16} {incr i} {
+    add PhiBins [expr {$i * $pi/18.0}]
+  }
+  for {set i 0} {$i <= 8} {incr i} {
+    set eta [expr {4.6 + $i * 1.2/8.0}]
+    add EtaPhiBins $eta $PhiBins
+  }
Index: cards/ILCgen/ILCgen_BeamCalR_Binning.tcl
===================================================================
--- cards/ILCgen/ILCgen_BeamCalR_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_BeamCalR_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,29 @@
+#P.Sopicki: based on plots from D.Jeans:
+# corrected by A.F.Zarnecki
+
+set pi [expr {acos(-1)} ]
+
+# BeamCal eta range 4.0 - 5.8 -> 2.099-0.347 =1.752deg
+#
+# Inner part (4.6-5.8):  1.152-0.347 = 0.805 deg
+# 360/0.0973/cosh(5.3) = ~36 => 32 bins (taking key hole into account!!!)
+#
+# Outer part (4.0-4.6):  2.099-1.152 = 0.947 deg
+# 360/0.0973/cosh(4.4) = ~90 => 90 bins
+  #Rear part
+  set PhiBins {}
+  for {set i -45} {$i <= 45} {incr i} {
+    add PhiBins [expr {$i * $pi/45.0}]
+  }
+  for {set i 0} {$i <= 12} {incr i} {
+    set eta [expr {-4.0 - $i * 0.5999/12.0}]
+    add EtaPhiBins $eta $PhiBins
+  }
+  set PhiBins {}
+  for {set i -16} {$i <= 16} {incr i} {
+    add PhiBins [expr {$i * $pi/18.0}]
+  }
+  for {set i 0} {$i <= 8} {incr i} {
+    set eta [expr {-4.6 - $i * 1.2/8.0}]
+    add EtaPhiBins $eta $PhiBins
+  }
Index: cards/ILCgen/ILCgen_BeamCal_EnergyFractions.tcl
===================================================================
--- cards/ILCgen/ILCgen_BeamCal_EnergyFractions.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_BeamCal_EnergyFractions.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,20 @@
+#P.Sopicki
+
+  add EnergyFraction {0} {0.0}
+  # energy fractions for e, gamma and pi0
+  add EnergyFraction {11} {1.0}
+  add EnergyFraction {22} {1.0}
+  add EnergyFraction {111} {1.0}
+  # energy fractions for muon, neutrinos and neutralinos
+  add EnergyFraction {12} {0.0}
+  add EnergyFraction {13} {0.0}
+  add EnergyFraction {14} {0.0}
+  add EnergyFraction {16} {0.0}
+  add EnergyFraction {1000022} {0.0}
+  add EnergyFraction {1000023} {0.0}
+  add EnergyFraction {1000025} {0.0}
+  add EnergyFraction {1000035} {0.0}
+  add EnergyFraction {1000045} {0.0}
+  # energy fractions for K0short and Lambda
+  add EnergyFraction {310} {0.3}
+  add EnergyFraction {3122} {0.3}
Index: cards/ILCgen/ILCgen_BeamCal_Resolution.tcl
===================================================================
--- cards/ILCgen/ILCgen_BeamCal_Resolution.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_BeamCal_Resolution.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,7 @@
+# P.Sopicki, corrected by A.F.Zarnecki
+# BeamCal resolution
+
+  set ResolutionFormula {
+  (abs(eta) > 4.0 && abs(eta) <= 4.8) * sqrt(energy^2*0.02^2 + energy*0.30^2) +
+  (abs(eta) > 4.8 && abs(eta) <= 5.8) * sqrt(energy^2*0.03^2 + energy*0.45^2) 
+  }
Index: cards/ILCgen/ILCgen_CTagging_20.tcl
===================================================================
--- cards/ILCgen/ILCgen_CTagging_20.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_CTagging_20.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,104 @@
+  # misidentification rate (uds)
+  # average efficiency: 0.00182
+  add EfficiencyFormula {0} {
+    ( abs(eta)<0.867 )*( energy<30 )*( 0.0038 )+ 
+    ( abs(eta)<0.867 )*( 30<=energy && energy<60 )*( 0.00379 )+ 
+    ( abs(eta)<0.867 )*( 60<=energy && energy<100 )*( 0.00361 )+ 
+    ( abs(eta)<0.867 )*( 100<=energy && energy<150 )*( 0.00394 )+ 
+    ( abs(eta)<0.867 )*( 150<=energy )*( 0.00424 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( energy<30 )*( 0.00388 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 30<=energy && energy<60 )*( 0.00269 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 60<=energy && energy<100 )*( 0.00324 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 100<=energy && energy<150 )*( 0.00291 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 150<=energy )*( 0.00269 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( energy<30 )*( 0.00182 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 30<=energy && energy<60 )*( 0.00262 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 60<=energy && energy<100 )*( 0.00213 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 100<=energy && energy<150 )*( 0.00276 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 150<=energy )*( 0.00227 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( energy<30 )*( 3.89e-06 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 30<=energy && energy<60 )*( 0.00135 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 60<=energy && energy<100 )*( 0.000845 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 100<=energy && energy<150 )*( 0.00191 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 150<=energy )*( 0.00269 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( energy<30 )*( 0.000414 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 30<=energy && energy<60 )*( 0.000177 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 60<=energy && energy<100 )*( 0.000379 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 100<=energy && energy<150 )*( 0.000363 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 150<=energy )*( 0.000169 )+ 
+    ( 2.99<=abs(eta) )*( energy<30 )*( -1.89e-06 )+ 
+    ( 2.99<=abs(eta) )*( 30<=energy && energy<60 )*( -1.86e-05 )+ 
+    ( 2.99<=abs(eta) )*( 60<=energy && energy<100 )*( 3.06e-08 )+ 
+    ( 2.99<=abs(eta) )*( 100<=energy && energy<150 )*( -2.29e-07 )+ 
+    ( 2.99<=abs(eta) )*( 150<=energy )*( 8.83e-07 )
+  }
+  
+  # c-tagging efficiency
+  # average efficiency: 0.198
+  add EfficiencyFormula {4} {
+    ( abs(eta)<0.867 )*( energy<30 )*( 0.306 )+ 
+    ( abs(eta)<0.867 )*( 30<=energy && energy<60 )*( 0.4 )+ 
+    ( abs(eta)<0.867 )*( 60<=energy && energy<100 )*( 0.451 )+ 
+    ( abs(eta)<0.867 )*( 100<=energy && energy<150 )*( 0.485 )+ 
+    ( abs(eta)<0.867 )*( 150<=energy )*( 0.491 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( energy<30 )*( 0.198 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 30<=energy && energy<60 )*( 0.301 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 60<=energy && energy<100 )*( 0.377 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 100<=energy && energy<150 )*( 0.421 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 150<=energy )*( 0.449 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( energy<30 )*( 0.0907 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 30<=energy && energy<60 )*( 0.18 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 60<=energy && energy<100 )*( 0.272 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 100<=energy && energy<150 )*( 0.347 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 150<=energy )*( 0.385 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( energy<30 )*( 0.0387 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 30<=energy && energy<60 )*( 0.0714 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 60<=energy && energy<100 )*( 0.125 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 100<=energy && energy<150 )*( 0.186 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 150<=energy )*( 0.23 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( energy<30 )*( 0.00354 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 30<=energy && energy<60 )*( 0.0139 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 60<=energy && energy<100 )*( 0.0165 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 100<=energy && energy<150 )*( 0.025 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 150<=energy )*( 0.0392 )+ 
+    ( 2.99<=abs(eta) )*( energy<30 )*( 0.000778 )+ 
+    ( 2.99<=abs(eta) )*( 30<=energy && energy<60 )*( 0.00199 )+ 
+    ( 2.99<=abs(eta) )*( 60<=energy && energy<100 )*( 0.00779 )+ 
+    ( 2.99<=abs(eta) )*( 100<=energy && energy<150 )*( 0.00916 )+ 
+    ( 2.99<=abs(eta) )*( 150<=energy )*( 0.00666 )
+  }
+  
+  # misidentification rate (b)
+  # average efficiency: 0.0283
+  add EfficiencyFormula {5} {
+    ( abs(eta)<0.867 )*( energy<30 )*( 0.0861 )+ 
+    ( abs(eta)<0.867 )*( 30<=energy && energy<60 )*( 0.0538 )+ 
+    ( abs(eta)<0.867 )*( 60<=energy && energy<100 )*( 0.0404 )+ 
+    ( abs(eta)<0.867 )*( 100<=energy && energy<150 )*( 0.0321 )+ 
+    ( abs(eta)<0.867 )*( 150<=energy )*( 0.0258 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( energy<30 )*( 0.0779 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 30<=energy && energy<60 )*( 0.0514 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 60<=energy && energy<100 )*( 0.0393 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 100<=energy && energy<150 )*( 0.032 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 150<=energy )*( 0.0277 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( energy<30 )*( 0.0419 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 30<=energy && energy<60 )*( 0.0486 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 60<=energy && energy<100 )*( 0.0371 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 100<=energy && energy<150 )*( 0.0331 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 150<=energy )*( 0.0275 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( energy<30 )*( 0.0247 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 30<=energy && energy<60 )*( 0.0282 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 60<=energy && energy<100 )*( 0.0319 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 100<=energy && energy<150 )*( 0.0297 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 150<=energy )*( 0.031 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( energy<30 )*( 0.0065 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 30<=energy && energy<60 )*( 0.00828 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 60<=energy && energy<100 )*( 0.00793 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 100<=energy && energy<150 )*( 0.00827 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 150<=energy )*( 0.00596 )+ 
+    ( 2.99<=abs(eta) )*( energy<30 )*( 0.0045 )+ 
+    ( 2.99<=abs(eta) )*( 30<=energy && energy<60 )*( 0.00185 )+ 
+    ( 2.99<=abs(eta) )*( 60<=energy && energy<100 )*( 0.00299 )+ 
+    ( 2.99<=abs(eta) )*( 100<=energy && energy<150 )*( 0.00243 )+ 
+    ( 2.99<=abs(eta) )*( 150<=energy )*( 0.0001 )
+  }
Index: cards/ILCgen/ILCgen_CTagging_30.tcl
===================================================================
--- cards/ILCgen/ILCgen_CTagging_30.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_CTagging_30.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,104 @@
+  # misidentification rate (uds)
+  # average efficiency: 0.0168
+  add EfficiencyFormula {0} {
+    ( abs(eta)<0.867 )*( energy<30 )*( 0.0294 )+ 
+    ( abs(eta)<0.867 )*( 30<=energy && energy<60 )*( 0.0285 )+ 
+    ( abs(eta)<0.867 )*( 60<=energy && energy<100 )*( 0.0286 )+ 
+    ( abs(eta)<0.867 )*( 100<=energy && energy<150 )*( 0.0301 )+ 
+    ( abs(eta)<0.867 )*( 150<=energy )*( 0.0311 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( energy<30 )*( 0.0262 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 30<=energy && energy<60 )*( 0.0239 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 60<=energy && energy<100 )*( 0.0235 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 100<=energy && energy<150 )*( 0.0244 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 150<=energy )*( 0.0273 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( energy<30 )*( 0.0197 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 30<=energy && energy<60 )*( 0.0165 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 60<=energy && energy<100 )*( 0.0183 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 100<=energy && energy<150 )*( 0.0216 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 150<=energy )*( 0.0221 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( energy<30 )*( 0.0103 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 30<=energy && energy<60 )*( 0.0125 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 60<=energy && energy<100 )*( 0.0116 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 100<=energy && energy<150 )*( 0.0138 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 150<=energy )*( 0.0167 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( energy<30 )*( 0.00848 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 30<=energy && energy<60 )*( 0.00687 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 60<=energy && energy<100 )*( 0.00718 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 100<=energy && energy<150 )*( 0.00868 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 150<=energy )*( 0.00706 )+ 
+    ( 2.99<=abs(eta) )*( energy<30 )*( 0.00685 )+ 
+    ( 2.99<=abs(eta) )*( 30<=energy && energy<60 )*( 0.00459 )+ 
+    ( 2.99<=abs(eta) )*( 60<=energy && energy<100 )*( 0.00485 )+ 
+    ( 2.99<=abs(eta) )*( 100<=energy && energy<150 )*( 0.00657 )+ 
+    ( 2.99<=abs(eta) )*( 150<=energy )*( 0.0083 )
+  }
+  
+  # c-tagging efficiency
+  # average efficiency: 0.315
+  add EfficiencyFormula {4} {
+    ( abs(eta)<0.867 )*( energy<30 )*( 0.497 )+ 
+    ( abs(eta)<0.867 )*( 30<=energy && energy<60 )*( 0.598 )+ 
+    ( abs(eta)<0.867 )*( 60<=energy && energy<100 )*( 0.652 )+ 
+    ( abs(eta)<0.867 )*( 100<=energy && energy<150 )*( 0.686 )+ 
+    ( abs(eta)<0.867 )*( 150<=energy )*( 0.702 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( energy<30 )*( 0.351 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 30<=energy && energy<60 )*( 0.48 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 60<=energy && energy<100 )*( 0.565 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 100<=energy && energy<150 )*( 0.614 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 150<=energy )*( 0.649 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( energy<30 )*( 0.194 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 30<=energy && energy<60 )*( 0.321 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 60<=energy && energy<100 )*( 0.432 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 100<=energy && energy<150 )*( 0.517 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 150<=energy )*( 0.567 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( energy<30 )*( 0.0942 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 30<=energy && energy<60 )*( 0.161 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 60<=energy && energy<100 )*( 0.239 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 100<=energy && energy<150 )*( 0.313 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 150<=energy )*( 0.37 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( energy<30 )*( 0.0216 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 30<=energy && energy<60 )*( 0.0524 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 60<=energy && energy<100 )*( 0.0616 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 100<=energy && energy<150 )*( 0.075 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 150<=energy )*( 0.0988 )+ 
+    ( 2.99<=abs(eta) )*( energy<30 )*( 0.00502 )+ 
+    ( 2.99<=abs(eta) )*( 30<=energy && energy<60 )*( 0.0135 )+ 
+    ( 2.99<=abs(eta) )*( 60<=energy && energy<100 )*( 0.0276 )+ 
+    ( 2.99<=abs(eta) )*( 100<=energy && energy<150 )*( 0.0428 )+ 
+    ( 2.99<=abs(eta) )*( 150<=energy )*( 0.0402 )
+  }
+  
+  # misidentification rate (b)
+  # average efficiency: 0.105
+  add EfficiencyFormula {5} {
+    ( abs(eta)<0.867 )*( energy<30 )*( 0.212 )+ 
+    ( abs(eta)<0.867 )*( 30<=energy && energy<60 )*( 0.143 )+ 
+    ( abs(eta)<0.867 )*( 60<=energy && energy<100 )*( 0.112 )+ 
+    ( abs(eta)<0.867 )*( 100<=energy && energy<150 )*( 0.0862 )+ 
+    ( abs(eta)<0.867 )*( 150<=energy )*( 0.0749 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( energy<30 )*( 0.215 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 30<=energy && energy<60 )*( 0.148 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 60<=energy && energy<100 )*( 0.117 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 100<=energy && energy<150 )*( 0.0992 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 150<=energy )*( 0.0827 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( energy<30 )*( 0.182 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 30<=energy && energy<60 )*( 0.161 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 60<=energy && energy<100 )*( 0.119 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 100<=energy && energy<150 )*( 0.107 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 150<=energy )*( 0.0884 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( energy<30 )*( 0.137 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 30<=energy && energy<60 )*( 0.136 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 60<=energy && energy<100 )*( 0.133 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 100<=energy && energy<150 )*( 0.108 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 150<=energy )*( 0.101 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( energy<30 )*( 0.0688 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 30<=energy && energy<60 )*( 0.0724 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 60<=energy && energy<100 )*( 0.0761 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 100<=energy && energy<150 )*( 0.0751 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 150<=energy )*( 0.064 )+ 
+    ( 2.99<=abs(eta) )*( energy<30 )*( 0.0264 )+ 
+    ( 2.99<=abs(eta) )*( 30<=energy && energy<60 )*( 0.0337 )+ 
+    ( 2.99<=abs(eta) )*( 60<=energy && energy<100 )*( 0.0504 )+ 
+    ( 2.99<=abs(eta) )*( 100<=energy && energy<150 )*( 0.0501 )+ 
+    ( 2.99<=abs(eta) )*( 150<=energy )*( 0.056 )
+  }
Index: cards/ILCgen/ILCgen_CTagging_55.tcl
===================================================================
--- cards/ILCgen/ILCgen_CTagging_55.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_CTagging_55.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,104 @@
+  # misidentification rate (uds)
+  # average efficiency: 0.165
+  add EfficiencyFormula {0} {
+    ( abs(eta)<0.867 )*( energy<30 )*( 0.193 )+ 
+    ( abs(eta)<0.867 )*( 30<=energy && energy<60 )*( 0.148 )+ 
+    ( abs(eta)<0.867 )*( 60<=energy && energy<100 )*( 0.139 )+ 
+    ( abs(eta)<0.867 )*( 100<=energy && energy<150 )*( 0.14 )+ 
+    ( abs(eta)<0.867 )*( 150<=energy )*( 0.147 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( energy<30 )*( 0.216 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 30<=energy && energy<60 )*( 0.159 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 60<=energy && energy<100 )*( 0.146 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 100<=energy && energy<150 )*( 0.147 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 150<=energy )*( 0.156 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( energy<30 )*( 0.222 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 30<=energy && energy<60 )*( 0.159 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 60<=energy && energy<100 )*( 0.153 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 100<=energy && energy<150 )*( 0.154 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 150<=energy )*( 0.165 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( energy<30 )*( 0.226 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 30<=energy && energy<60 )*( 0.163 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 60<=energy && energy<100 )*( 0.148 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 100<=energy && energy<150 )*( 0.155 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 150<=energy )*( 0.162 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( energy<30 )*( 0.266 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 30<=energy && energy<60 )*( 0.162 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 60<=energy && energy<100 )*( 0.138 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 100<=energy && energy<150 )*( 0.13 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 150<=energy )*( 0.14 )+ 
+    ( 2.99<=abs(eta) )*( energy<30 )*( 0.223 )+ 
+    ( 2.99<=abs(eta) )*( 30<=energy && energy<60 )*( 0.19 )+ 
+    ( 2.99<=abs(eta) )*( 60<=energy && energy<100 )*( 0.139 )+ 
+    ( 2.99<=abs(eta) )*( 100<=energy && energy<150 )*( 0.124 )+ 
+    ( 2.99<=abs(eta) )*( 150<=energy )*( 0.142 )
+  }
+  
+  # c-tagging efficiency
+  # average efficiency: 0.547
+  add EfficiencyFormula {4} {
+    ( abs(eta)<0.867 )*( energy<30 )*( 0.704 )+ 
+    ( abs(eta)<0.867 )*( 30<=energy && energy<60 )*( 0.766 )+ 
+    ( abs(eta)<0.867 )*( 60<=energy && energy<100 )*( 0.811 )+ 
+    ( abs(eta)<0.867 )*( 100<=energy && energy<150 )*( 0.842 )+ 
+    ( abs(eta)<0.867 )*( 150<=energy )*( 0.858 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( energy<30 )*( 0.604 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 30<=energy && energy<60 )*( 0.69 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 60<=energy && energy<100 )*( 0.761 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 100<=energy && energy<150 )*( 0.802 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 150<=energy )*( 0.826 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( energy<30 )*( 0.505 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 30<=energy && energy<60 )*( 0.579 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 60<=energy && energy<100 )*( 0.673 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 100<=energy && energy<150 )*( 0.742 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 150<=energy )*( 0.786 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( energy<30 )*( 0.436 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 30<=energy && energy<60 )*( 0.46 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 60<=energy && energy<100 )*( 0.525 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 100<=energy && energy<150 )*( 0.606 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 150<=energy )*( 0.66 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( energy<30 )*( 0.328 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 30<=energy && energy<60 )*( 0.304 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 60<=energy && energy<100 )*( 0.307 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 100<=energy && energy<150 )*( 0.33 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 150<=energy )*( 0.395 )+ 
+    ( 2.99<=abs(eta) )*( energy<30 )*( 0.251 )+ 
+    ( 2.99<=abs(eta) )*( 30<=energy && energy<60 )*( 0.209 )+ 
+    ( 2.99<=abs(eta) )*( 60<=energy && energy<100 )*( 0.21 )+ 
+    ( 2.99<=abs(eta) )*( 100<=energy && energy<150 )*( 0.203 )+ 
+    ( 2.99<=abs(eta) )*( 150<=energy )*( 0.233 )
+  }
+  
+  # misidentification rate (b)
+  # average efficiency: 0.343
+  add EfficiencyFormula {5} {
+    ( abs(eta)<0.867 )*( energy<30 )*( 0.358 )+ 
+    ( abs(eta)<0.867 )*( 30<=energy && energy<60 )*( 0.258 )+ 
+    ( abs(eta)<0.867 )*( 60<=energy && energy<100 )*( 0.217 )+ 
+    ( abs(eta)<0.867 )*( 100<=energy && energy<150 )*( 0.184 )+ 
+    ( abs(eta)<0.867 )*( 150<=energy )*( 0.175 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( energy<30 )*( 0.41 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 30<=energy && energy<60 )*( 0.298 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 60<=energy && energy<100 )*( 0.248 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 100<=energy && energy<150 )*( 0.218 )+ 
+    ( 0.867<=abs(eta) && abs(eta)<1.47 )*( 150<=energy )*( 0.184 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( energy<30 )*( 0.465 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 30<=energy && energy<60 )*( 0.36 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 60<=energy && energy<100 )*( 0.3 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 100<=energy && energy<150 )*( 0.261 )+ 
+    ( 1.47<=abs(eta) && abs(eta)<1.83 )*( 150<=energy )*( 0.222 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( energy<30 )*( 0.49 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 30<=energy && energy<60 )*( 0.454 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 60<=energy && energy<100 )*( 0.437 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 100<=energy && energy<150 )*( 0.393 )+ 
+    ( 1.83<=abs(eta) && abs(eta)<2.3 )*( 150<=energy )*( 0.342 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( energy<30 )*( 0.441 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 30<=energy && energy<60 )*( 0.44 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 60<=energy && energy<100 )*( 0.484 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 100<=energy && energy<150 )*( 0.497 )+ 
+    ( 2.3<=abs(eta) && abs(eta)<2.99 )*( 150<=energy )*( 0.528 )+ 
+    ( 2.99<=abs(eta) )*( energy<30 )*( 0.279 )+ 
+    ( 2.99<=abs(eta) )*( 30<=energy && energy<60 )*( 0.337 )+ 
+    ( 2.99<=abs(eta) )*( 60<=energy && energy<100 )*( 0.305 )+ 
+    ( 2.99<=abs(eta) )*( 100<=energy && energy<150 )*( 0.354 )+ 
+    ( 2.99<=abs(eta) )*( 150<=energy )*( 0.337 )
+  }
Index: cards/ILCgen/ILCgen_CTagging_N.tcl
===================================================================
--- cards/ILCgen/ILCgen_CTagging_N.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_CTagging_N.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,105 @@
+###################################
+# c-tagging for inclusive jets, N=2
+###################################
+module BTagging CTagging55_N2 {
+    set JetInputArray JetFinder_N2/jets
+    set BitNumber 4
+
+    source ILCgen/ILCgen_CTagging_55.tcl
+}
+module BTagging CTagging30_N2 {
+    set JetInputArray JetFinder_N2/jets
+    set BitNumber 5
+
+    source ILCgen/ILCgen_CTagging_30.tcl
+}
+module BTagging CTagging20_N2 {
+    set JetInputArray JetFinder_N2/jets
+    set BitNumber 6
+
+    source ILCgen/ILCgen_CTagging_20.tcl
+}
+###################################
+# c-tagging for inclusive jets, N=3
+###################################
+module BTagging CTagging55_N3 {
+    set JetInputArray JetFinder_N3/jets
+    set BitNumber 4
+
+    source ILCgen/ILCgen_CTagging_55.tcl
+}
+module BTagging CTagging30_N3 {
+    set JetInputArray JetFinder_N3/jets
+    set BitNumber 5
+
+    source ILCgen/ILCgen_CTagging_30.tcl
+}
+module BTagging CTagging20_N3 {
+    set JetInputArray JetFinder_N3/jets
+    set BitNumber 6
+
+    source ILCgen/ILCgen_CTagging_20.tcl
+}
+###################################
+# c-tagging for inclusive jets, N=4
+###################################
+module BTagging CTagging55_N4 {
+    set JetInputArray JetFinder_N4/jets
+    set BitNumber 4
+
+    source ILCgen/ILCgen_CTagging_55.tcl
+}
+module BTagging CTagging30_N4 {
+    set JetInputArray JetFinder_N4/jets
+    set BitNumber 5
+
+    source ILCgen/ILCgen_CTagging_30.tcl
+}
+module BTagging CTagging20_N4 {
+    set JetInputArray JetFinder_N4/jets
+    set BitNumber 6
+
+    source ILCgen/ILCgen_CTagging_20.tcl
+}
+###################################
+# c-tagging for inclusive jets, N=5
+###################################
+module BTagging CTagging55_N5 {
+    set JetInputArray JetFinder_N5/jets
+    set BitNumber 4
+
+    source ILCgen/ILCgen_CTagging_55.tcl
+}
+module BTagging CTagging30_N5 {
+    set JetInputArray JetFinder_N5/jets
+    set BitNumber 5
+
+    source ILCgen/ILCgen_CTagging_30.tcl
+}
+module BTagging CTagging20_N5 {
+    set JetInputArray JetFinder_N5/jets
+    set BitNumber 6
+
+    source ILCgen/ILCgen_CTagging_20.tcl
+}
+###################################
+# c-tagging for inclusive jets, N=6
+###################################
+module BTagging CTagging55_N6 {
+    set JetInputArray JetFinder_N6/jets
+    set BitNumber 4
+
+    source ILCgen/ILCgen_CTagging_55.tcl
+}
+module BTagging CTagging30_N6 {
+    set JetInputArray JetFinder_N6/jets
+    set BitNumber 5
+
+    source ILCgen/ILCgen_CTagging_30.tcl
+}
+module BTagging CTagging20_N6 {
+    set JetInputArray JetFinder_N6/jets
+    set BitNumber 6
+
+    source ILCgen/ILCgen_CTagging_20.tcl
+}
Index: cards/ILCgen/ILCgen_ChrgHadMomentumSmearing.tcl
===================================================================
--- cards/ILCgen/ILCgen_ChrgHadMomentumSmearing.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_ChrgHadMomentumSmearing.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,17 @@
+
+# Track momentum resolution dpt/pt 
+#  based on parametrisation of ILD IDR results (Figure 8.1a)
+#  A.F.Zarnecki, June 12, 2020
+
+
+set ResolutionFormula {
+  (abs(eta) <= 2.0) *
+    exp( -6.82012  - 0.284133*abs(eta) + 0.64585*eta*eta
+     + (0.829675 -0.188197*abs(eta) +  0.106226 * eta*eta  - 1.0) * log(pt)
+     + (0.0766417-0.00435667*abs(eta) + 0.00174804*eta*eta) * log(pt)*log(pt))
+  +
+  (abs(eta) > 2.0 && abs(eta) <= 3.0) *
+    exp(  -4.54609
+     + ( 0.87526 - 1.0) * log(pt)
+     + (-0.0800672 + 0.0891669 * abs(eta)) * log(pt)*log(pt))
+  }
Index: cards/ILCgen/ILCgen_ChrgHadTrackingEff.tcl
===================================================================
--- cards/ILCgen/ILCgen_ChrgHadTrackingEff.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_ChrgHadTrackingEff.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,21 @@
+
+# Tracking efficiency as given in the ILD IDR (Figure 8.2)
+#  for high angles (FTD coverage): educated guess
+#  A.F.Zarnecki, June 12, 2020
+
+set EfficiencyFormula {
+                                                                 (pt <= 0.1)   * (0.00)  +
+                       (abs(eta) <= 1.83)     *      (pt > 0.1 && pt <= 0.2)   * (0.70)  +
+                       (abs(eta) <= 1.83)     *      (pt > 0.2 && pt <= 0.3)   * (0.93)  +
+                       (abs(eta) <= 1.83)     *      (pt > 0.3 && pt <= 0.7)   * (0.995) +
+                       (abs(eta) <= 1.83)     *      (pt > 0.7)                * (1.00)  +
+    (abs(eta) > 1.83 && abs(eta) <= 2.65)     *      (pt > 0.1 && pt <= 0.2)   * (0.697) +
+    (abs(eta) > 1.83 && abs(eta) <= 2.65)     *      (pt > 0.2 && pt <= 0.3)   * (0.925) +
+    (abs(eta) > 1.83 && abs(eta) <= 2.65)     *      (pt > 0.3 && pt <= 0.7)   * (0.99)  +
+    (abs(eta) > 1.83 && abs(eta) <= 2.65)     *      (pt > 0.7)                * (0.995) +
+    (abs(eta) > 2.65 && abs(eta) <= 3.00)     *      (pt > 0.1 && pt <= 0.2)   * (0.665) +
+    (abs(eta) > 2.65 && abs(eta) <= 3.00)     *      (pt > 0.2 && pt <= 0.3)   * (0.884) +
+    (abs(eta) > 2.65 && abs(eta) <= 3.00)     *      (pt > 0.3 && pt <= 0.7)   * (0.945) +
+    (abs(eta) > 2.65 && abs(eta) <= 3.00)     *      (pt > 0.7)                * (0.95)  +
+    (abs(eta) > 3.00)                         *      (pt > 0.1)                * (0.00)
+  }
Index: cards/ILCgen/ILCgen_ECAL_Binning.tcl
===================================================================
--- cards/ILCgen/ILCgen_ECAL_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_ECAL_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,76 @@
+#P.Sopicki: based on plots from D.Jeans:
+# corrected by A.F.Zarnecki
+
+set pi [expr {acos(-1)} ]
+
+# ECAL barrel
+# 0.003 segm in eta and phi(rad) - towers (5x5 mm^2) for |eta| <= 1.1
+
+# to get dphi = 0.003rad/0.17deg -> 360/0.17 /cosh(0.55) =~ 1813 -> 1800 
+set PhiBins {}
+  for {set i -900} {$i <= 900} {incr i} {
+    add PhiBins [expr {$i * $pi/900} ]
+  }
+
+#
+# |eta| = 1.1, delta = 0.003 -> 733,(3) =~ 720 
+  for {set i 1} {$i <= 720} {incr i} {
+    set eta [expr {-1.1 + $i * 2.2/720} ]
+    add EtaPhiBins $eta $PhiBins
+  }
+
+# ECAL endcaps 
+# eta 1.1 - 2   : dphi(rad) and deta = 0.006
+# eta 2 - 2.5   : d = 0.011
+# eta 2.5 - 3   : d = 0.016
+
+#360/0.34/cosh(1.65) : ~387.9 -> 380 divisions
+#0.9/0.006: 150
+set PhiBins {}
+  for {set i -190} {$i <= 190} {incr i} {
+    add PhiBins [expr {$i * $pi/190} ]
+  }
+
+for {set i 1} {$i <= 150} {incr i} {
+    set eta [expr {-2.0 + $i * 0.9/150.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
+
+for {set i 1} {$i <= 150} {incr i} {
+    set eta [expr {1.1 + $i * 0.9/150.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
+
+#360/0.63/cosh(2.25) : ~119 -> 120 divisions
+#0.5/0.011: ~45.5 -> 48 
+set PhiBins {}
+  for {set i -60} {$i <= 60} {incr i} {
+    add PhiBins [expr {$i * $pi/60} ]
+  }
+
+for {set i 1} {$i <= 48} {incr i} {
+    set eta [expr {-2.5 + $i * 0.5/48.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
+
+for {set i 1} {$i <= 48} {incr i} {
+    set eta [expr {2.0 + $i * 0.5/48.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
+
+#360/0.63/cosh(2.75) : ~50 divisions
+#0.5/0.016: ~31 -> 30
+set PhiBins {}
+  for {set i -25} {$i <= 25} {incr i} {
+    add PhiBins [expr {$i * $pi/25} ]
+  }
+
+for {set i 0} {$i <= 30} {incr i} {
+    set eta [expr {-3.0 + $i * 0.5/30.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
+
+for {set i 1} {$i <= 30} {incr i} {
+    set eta [expr {2.5 + $i * 0.5/30.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
Index: cards/ILCgen/ILCgen_ECAL_EnergyFractions.tcl
===================================================================
--- cards/ILCgen/ILCgen_ECAL_EnergyFractions.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_ECAL_EnergyFractions.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,20 @@
+#P.Sopicki
+
+  add EnergyFraction {0} {0.0}
+  # energy fractions for e, gamma and pi0
+  add EnergyFraction {11} {1.0}
+  add EnergyFraction {22} {1.0}
+  add EnergyFraction {111} {1.0}
+  # energy fractions for muon, neutrinos and neutralinos
+  add EnergyFraction {12} {0.0}
+  add EnergyFraction {13} {0.0}
+  add EnergyFraction {14} {0.0}
+  add EnergyFraction {16} {0.0}
+  add EnergyFraction {1000022} {0.0}
+  add EnergyFraction {1000023} {0.0}
+  add EnergyFraction {1000025} {0.0}
+  add EnergyFraction {1000035} {0.0}
+  add EnergyFraction {1000045} {0.0}
+  # energy fractions for K0short and Lambda
+  add EnergyFraction {310} {0.3}
+  add EnergyFraction {3122} {0.3}
Index: cards/ILCgen/ILCgen_ECAL_Resolution.tcl
===================================================================
--- cards/ILCgen/ILCgen_ECAL_Resolution.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_ECAL_Resolution.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,8 @@
+# P.Sopicki, corrected by A.F.Zarnecki: based on email from D.Jeans
+# ECAL and LumiCal resolution: same formula used at the moment
+#
+
+set ResolutionFormula {
+    (abs(eta) <= 3 )                 * sqrt(energy^2*0.01^2 + energy*0.17^2)+
+    (abs(eta) > 3 && abs(eta) <= 4 ) * sqrt(energy^2*0.01^2 + energy*0.17^2) 
+  }
Index: cards/ILCgen/ILCgen_ElectronEfficiency.tcl
===================================================================
--- cards/ILCgen/ILCgen_ElectronEfficiency.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_ElectronEfficiency.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,9 @@
+
+# efficiency formula for electrons (ECAL and LumiCal)
+# LumiCal added for consistency: not in tracking range
+
+  set EfficiencyFormula {
+        (energy <= 2 )                                        * (0.00) +
+        (energy > 2 )  *  (abs(eta) <= 3.0)                   * (0.95) +
+        (energy > 2 )  *  (abs(eta) > 3.0 && abs(eta) <= 4.0) * (0.90) 
+  }
Index: cards/ILCgen/ILCgen_ElectronIsolation.tcl
===================================================================
--- cards/ILCgen/ILCgen_ElectronIsolation.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_ElectronIsolation.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,6 @@
+
+  set DeltaRMax 0.5
+
+  set PTMin 0.5
+
+  set PTRatioMax 0.12
Index: cards/ILCgen/ILCgen_ElectronMomentumSmearing.tcl
===================================================================
--- cards/ILCgen/ILCgen_ElectronMomentumSmearing.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_ElectronMomentumSmearing.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,17 @@
+
+# Track momentum resolution dpt/pt 
+#  based on parametrisation of ILD IDR results (Figure 8.1a)
+#  A.F.Zarnecki, June 12, 2020
+
+
+set ResolutionFormula {
+  (abs(eta) <= 2.0) *
+    exp( -6.82012  - 0.284133*abs(eta) + 0.64585*eta*eta
+     + (0.829675 -0.188197*abs(eta) +  0.106226 * eta*eta  - 1.0) * log(pt)
+     + (0.0766417-0.00435667*abs(eta) + 0.00174804*eta*eta) * log(pt)*log(pt))
+  +
+  (abs(eta) > 2.0 && abs(eta) <= 3.0) *
+    exp(  -4.54609
+     + ( 0.87526 - 1.0) * log(pt)
+     + (-0.0800672 + 0.0891669 * abs(eta)) * log(pt)*log(pt))
+  }
Index: cards/ILCgen/ILCgen_ElectronTrackingEff.tcl
===================================================================
--- cards/ILCgen/ILCgen_ElectronTrackingEff.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_ElectronTrackingEff.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,21 @@
+
+# Tracking efficiency as given in the ILD IDR (Figure 8.2)
+#  for high angles (FTD coverage): educated guess
+#  A.F.Zarnecki, June 12, 2020
+
+set EfficiencyFormula {
+                                                                 (pt <= 0.1)   * (0.00)  +
+                       (abs(eta) <= 1.83)     *      (pt > 0.1 && pt <= 0.2)   * (0.70)  +
+                       (abs(eta) <= 1.83)     *      (pt > 0.2 && pt <= 0.3)   * (0.93)  +
+                       (abs(eta) <= 1.83)     *      (pt > 0.3 && pt <= 0.7)   * (0.995) +
+                       (abs(eta) <= 1.83)     *      (pt > 0.7)                * (1.00)  +
+    (abs(eta) > 1.83 && abs(eta) <= 2.65)     *      (pt > 0.1 && pt <= 0.2)   * (0.697) +
+    (abs(eta) > 1.83 && abs(eta) <= 2.65)     *      (pt > 0.2 && pt <= 0.3)   * (0.925) +
+    (abs(eta) > 1.83 && abs(eta) <= 2.65)     *      (pt > 0.3 && pt <= 0.7)   * (0.99)  +
+    (abs(eta) > 1.83 && abs(eta) <= 2.65)     *      (pt > 0.7)                * (0.995) +
+    (abs(eta) > 2.65 && abs(eta) <= 3.00)     *      (pt > 0.1 && pt <= 0.2)   * (0.665) +
+    (abs(eta) > 2.65 && abs(eta) <= 3.00)     *      (pt > 0.2 && pt <= 0.3)   * (0.884) +
+    (abs(eta) > 2.65 && abs(eta) <= 3.00)     *      (pt > 0.3 && pt <= 0.7)   * (0.945) +
+    (abs(eta) > 2.65 && abs(eta) <= 3.00)     *      (pt > 0.7)                * (0.95)  +
+    (abs(eta) > 3.00)                         *      (pt > 0.1)                * (0.00)
+  }
Index: cards/ILCgen/ILCgen_GenJetFinder.tcl
===================================================================
--- cards/ILCgen/ILCgen_GenJetFinder.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_GenJetFinder.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,7 @@
+  set JetAlgorithm 6
+
+  set ExclusiveClustering false
+
+  set ParameterR 1.0
+
+  set JetPTMin 5.0
Index: cards/ILCgen/ILCgen_HCAL_Binning.tcl
===================================================================
--- cards/ILCgen/ILCgen_HCAL_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_HCAL_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,75 @@
+#P.Sopicki: based on plots from D.Jeans:
+# corrected by A.F.Zarnecki
+
+set pi [expr {acos(-1)} ]
+
+# HCAL barrel
+# 0.015 segm in eta and phi(rad) - towers (5x5 mm^2) for |eta| <= 1.1
+
+# to get dphi = 0.015rad/0.86deg -> 360/0.86 /cosh(0.55) = ~362.7 -> 360
+# to get deta = 0.015 2.2/0.015=146.(6)
+set PhiBins {}
+  for {set i -180} {$i <= 180} {incr i} {
+    add PhiBins [expr {$i * $pi/180.0} ]
+  }
+
+for {set i 1} {$i <= 147} {incr i} {
+    set eta [expr {-1.1 + $i * 2.2/147.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
+
+# HCAL endcaps 
+# eta 1.1 - 2   : dphi(rad) and deta = 0.03
+# eta 2 - 2.5   : d = 0.065
+# eta 2.5 - 2.8   : d = 0.08
+
+#360/1.72 deg/cosh(1.65) : ~77.6 -> 76 divisions
+#0.9/0.03: 30
+set PhiBins {}
+  for {set i -38} {$i <= 38} {incr i} {
+    add PhiBins [expr {$i * $pi/38} ]
+  }
+
+for {set i 1} {$i <= 30} {incr i} {
+    set eta [expr {-2.0 + $i * 0.9/30.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
+
+for {set i 1} {$i <= 30} {incr i} {
+    set eta [expr {1.1 + $i * 0.9/30.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
+
+#360/3.72 deg/cosh(2.25) : ~20  divisions
+#0.5/0.065: ~7.65 -> 8  
+set PhiBins {}
+  for {set i -20} {$i <= 20} {incr i} {
+    add PhiBins [expr {$i * $pi/20} ]
+  }
+
+for {set i 1} {$i <= 8} {incr i} {
+    set eta [expr {-2.5 + $i * 0.5/8.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
+
+for {set i 1} {$i <= 8} {incr i} {
+    set eta [expr {2.0 + $i * 0.5/8.0} ]
+    add EtaPhiBins $eta $PhiBins
+}
+
+#360/4.58 deg/cosh(2.65) : ~11 -> 10 divisions
+#0.3/0.08: ~4
+set PhiBins {}
+  for {set i -5} {$i <= 5} {incr i} {
+    add PhiBins [expr {$i * $pi/5} ]
+  }
+
+for {set i 0} {$i <= 4} {incr i} {
+    set eta [expr {-2.8 + $i * 0.3/4.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
+
+for {set i 1} {$i <= 4} {incr i} {
+    set eta [expr {2.5 + $i * 0.3/4.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
Index: cards/ILCgen/ILCgen_HCAL_EnergyFractions.tcl
===================================================================
--- cards/ILCgen/ILCgen_HCAL_EnergyFractions.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_HCAL_EnergyFractions.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,20 @@
+#P.Sopicki
+
+  add EnergyFraction {0} {1.0}
+  # energy fractions for e, gamma and pi0
+  add EnergyFraction {11} {0.0}
+  add EnergyFraction {22} {0.0}
+  add EnergyFraction {111} {0.0}
+  # energy fractions for muon, neutrinos and neutralinos
+  add EnergyFraction {12} {0.0}
+  add EnergyFraction {13} {0.0}
+  add EnergyFraction {14} {0.0}
+  add EnergyFraction {16} {0.0}
+  add EnergyFraction {1000022} {0.0}
+  add EnergyFraction {1000023} {0.0}
+  add EnergyFraction {1000025} {0.0}
+  add EnergyFraction {1000035} {0.0}
+  add EnergyFraction {1000045} {0.0}
+  # energy fractions for K0short and Lambda
+  add EnergyFraction {310} {0.7}
+  add EnergyFraction {3122} {0.7}
Index: cards/ILCgen/ILCgen_HCAL_Resolution.tcl
===================================================================
--- cards/ILCgen/ILCgen_HCAL_Resolution.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_HCAL_Resolution.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,8 @@
+# P.Sopicki, corrected by A.F.Zarnecki: based on email from D.Jeans
+# HCAL and LHCAL resolution: same formula used at the moment
+#
+
+set ResolutionFormula {
+   (abs(eta) <= 2.8 )                 * sqrt(energy^2*0.017^2 + energy*0.45^2)+
+   (abs(eta) > 2.8 && abs(eta)<=3.8 ) * sqrt(energy^2*0.017^2 + energy*0.45^2)
+  }
Index: cards/ILCgen/ILCgen_JetFinder.tcl
===================================================================
--- cards/ILCgen/ILCgen_JetFinder.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_JetFinder.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,7 @@
+  set JetAlgorithm 6
+
+  set ExclusiveClustering false
+
+  set ParameterR 1.0
+
+  set JetPTMin 5.0
Index: cards/ILCgen/ILCgen_JetFinder_N.tcl
===================================================================
--- cards/ILCgen/ILCgen_JetFinder_N.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_JetFinder_N.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,80 @@
+##################################
+# Jet finder in inclusive mode N=2
+##################################
+module FastJetFinder JetFinder_N2 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray jets
+    set JetAlgorithm 9
+
+    set NJets 2
+    set ExclusiveClustering true
+
+    set ParameterR 2.0
+    set Beta 1.0
+    set Gamma 0.0
+    set JetPTMin 0.0
+}
+##################################
+# Jet finder in inclusive mode N=3
+##################################
+module FastJetFinder JetFinder_N3 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray jets
+    set JetAlgorithm 9
+
+    set NJets 3
+    set ExclusiveClustering true
+
+    set ParameterR 2.0
+    set Beta 1.0
+    set Gamma 0.0
+    set JetPTMin 0.0
+}
+##################################
+# Jet finder in inclusive mode N=4
+##################################
+module FastJetFinder JetFinder_N4 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray jets
+    set JetAlgorithm 9
+
+    set NJets 4
+    set ExclusiveClustering true
+
+    set ParameterR 2.0
+    set Beta 1.0
+    set Gamma 0.0
+    set JetPTMin 0.0
+}
+##################################
+# Jet finder in inclusive mode N=5
+##################################
+module FastJetFinder JetFinder_N5 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray jets
+    set JetAlgorithm 9
+
+    set NJets 5
+    set ExclusiveClustering true
+
+    set ParameterR 2.0
+    set Beta 1.0
+    set Gamma 0.0
+    set JetPTMin 0.0
+}
+##################################
+# Jet finder in inclusive mode N=6
+##################################
+module FastJetFinder JetFinder_N6 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray jets
+    set JetAlgorithm 9
+
+    set NJets 6
+    set ExclusiveClustering true
+
+    set ParameterR 2.0
+    set Beta 1.0
+    set Gamma 0.0
+    set JetPTMin 0.0
+}
Index: cards/ILCgen/ILCgen_JetFlavourAssoc.tcl
===================================================================
--- cards/ILCgen/ILCgen_JetFlavourAssoc.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_JetFlavourAssoc.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,6 @@
+
+  set DeltaR 0.5
+
+  set PartonPTMin 1.0
+
+  set PartonEtaMax 4.0
Index: cards/ILCgen/ILCgen_JetFlavourAssoc_N.tcl
===================================================================
--- cards/ILCgen/ILCgen_JetFlavourAssoc_N.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_JetFlavourAssoc_N.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,65 @@
+################################################
+# Jet flavor association for inclusive jets, N=2
+################################################
+module JetFlavorAssociation JetFlavor_N2 {
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetFinder_N2/jets
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 4.0
+}
+################################################
+# Jet flavor association for inclusive jets, N=3
+################################################
+module JetFlavorAssociation JetFlavor_N3 {
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetFinder_N3/jets
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 4.0
+}
+################################################
+# Jet flavor association for inclusive jets, N=4
+################################################
+module JetFlavorAssociation JetFlavor_N4 {
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetFinder_N4/jets
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 4.0
+}
+################################################
+# Jet flavor association for inclusive jets, N=5
+################################################
+module JetFlavorAssociation JetFlavor_N5 {
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetFinder_N5/jets
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 4.0
+}
+################################################
+# Jet flavor association for inclusive jets, N=6
+################################################
+module JetFlavorAssociation JetFlavor_N6 {
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetFinder_N6/jets
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 4.0
+}
Index: cards/ILCgen/ILCgen_LHCalF_Binning.tcl
===================================================================
--- cards/ILCgen/ILCgen_LHCalF_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_LHCalF_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,15 @@
+#P.Sopicki: based on plots from D.Jeans:
+
+set pi [expr {acos(-1)} ]
+
+# LHCAL eta range 2.8 - 3.8
+# Front part
+set PhiBins {}
+  for {set i -12} {$i <= 12} {incr i} {
+    add PhiBins [expr {$i * $pi/12.0} ]
+  }
+
+for {set i 0} {$i <= 32} {incr i} {
+    set eta [expr {2.8 + $i * 1.0/32.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
Index: cards/ILCgen/ILCgen_LHCalR_Binning.tcl
===================================================================
--- cards/ILCgen/ILCgen_LHCalR_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_LHCalR_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,15 @@
+#P.Sopicki: based on plots from D.Jeans:
+
+set pi [expr {acos(-1)} ]
+
+# LHCAL eta range 2.8 - 3.8
+# Rear part
+set PhiBins {}
+  for {set i -12} {$i <= 12} {incr i} {
+    add PhiBins [expr {$i * $pi/12.0} ]
+  }
+
+for {set i 0} {$i <= 32} {incr i} {
+    set eta [expr {-3.8 + $i * 1.0/32.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
Index: cards/ILCgen/ILCgen_LumiCalF_Binning.tcl
===================================================================
--- cards/ILCgen/ILCgen_LumiCalF_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_LumiCalF_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,15 @@
+#P.Sopicki: based on plots from D.Jeans:
+
+set pi [expr {acos(-1)} ]
+
+# LumiCal eta range 3.0 - 4.0 (no beam crossing boost)
+# Front part
+set PhiBins {}
+  for {set i -24} {$i <= 24} {incr i} {
+    add PhiBins [expr {$i * $pi/24.0} ]
+  }
+
+for {set i 0} {$i <= 64} {incr i} {
+    set eta [expr {3.0 + $i * 1.0/64.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
Index: cards/ILCgen/ILCgen_LumiCalR_Binning.tcl
===================================================================
--- cards/ILCgen/ILCgen_LumiCalR_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_LumiCalR_Binning.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,15 @@
+#P.Sopicki: based on plots from D.Jeans:
+
+set pi [expr {acos(-1)} ]
+
+# LumiCal eta range 3.0 - 4.0 (no beam crossing boost)
+# Rear part
+set PhiBins {}
+  for {set i -24} {$i <= 24} {incr i} {
+    add PhiBins [expr {$i * $pi/24.0} ]
+  }
+
+for {set i 0} {$i <= 64} {incr i} {
+    set eta [expr {-4.0 + $i * 1.0/64.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
Index: cards/ILCgen/ILCgen_MuonEfficiency.tcl
===================================================================
--- cards/ILCgen/ILCgen_MuonEfficiency.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_MuonEfficiency.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,8 @@
+# efficiency formula for muons
+# Identification based on tracking only
+
+  set EfficiencyFormula {
+        (energy <= 2 )                  * (0.00) +
+        (energy > 2  && energy <= 10 )  * (0.95) +
+        (energy > 10 )                  * (0.97)
+  }
Index: cards/ILCgen/ILCgen_MuonIsolation.tcl
===================================================================
--- cards/ILCgen/ILCgen_MuonIsolation.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_MuonIsolation.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,6 @@
+
+  set DeltaRMax 0.5
+
+  set PTMin 0.5
+
+  set PTRatioMax 0.25
Index: cards/ILCgen/ILCgen_MuonMomentumSmearing.tcl
===================================================================
--- cards/ILCgen/ILCgen_MuonMomentumSmearing.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_MuonMomentumSmearing.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,17 @@
+
+# Track momentum resolution dpt/pt 
+#  based on parametrisation of ILD IDR results (Figure 8.1a)
+#  A.F.Zarnecki, June 12, 2020
+
+
+set ResolutionFormula {
+  (abs(eta) <= 2.0) *
+    exp( -6.82012  - 0.284133*abs(eta) + 0.64585*eta*eta
+     + (0.829675 -0.188197*abs(eta) +  0.106226 * eta*eta  - 1.0) * log(pt)
+     + (0.0766417-0.00435667*abs(eta) + 0.00174804*eta*eta) * log(pt)*log(pt))
+  +
+  (abs(eta) > 2.0 && abs(eta) <= 3.0) *
+    exp(  -4.54609
+     + ( 0.87526 - 1.0) * log(pt)
+     + (-0.0800672 + 0.0891669 * abs(eta)) * log(pt)*log(pt))
+  }
Index: cards/ILCgen/ILCgen_MuonTrackingEff.tcl
===================================================================
--- cards/ILCgen/ILCgen_MuonTrackingEff.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_MuonTrackingEff.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,21 @@
+
+# Tracking efficiency as given in the ILD IDR (Figure 8.2)
+#  for high angles (FTD coverage): educated guess
+#  A.F.Zarnecki, June 12, 2020
+
+set EfficiencyFormula {
+                                                                 (pt <= 0.1)   * (0.00)  +
+                       (abs(eta) <= 1.83)     *      (pt > 0.1 && pt <= 0.2)   * (0.70)  +
+                       (abs(eta) <= 1.83)     *      (pt > 0.2 && pt <= 0.3)   * (0.93)  +
+                       (abs(eta) <= 1.83)     *      (pt > 0.3 && pt <= 0.7)   * (0.995) +
+                       (abs(eta) <= 1.83)     *      (pt > 0.7)                * (1.00)  +
+    (abs(eta) > 1.83 && abs(eta) <= 2.65)     *      (pt > 0.1 && pt <= 0.2)   * (0.697) +
+    (abs(eta) > 1.83 && abs(eta) <= 2.65)     *      (pt > 0.2 && pt <= 0.3)   * (0.925) +
+    (abs(eta) > 1.83 && abs(eta) <= 2.65)     *      (pt > 0.3 && pt <= 0.7)   * (0.99)  +
+    (abs(eta) > 1.83 && abs(eta) <= 2.65)     *      (pt > 0.7)                * (0.995) +
+    (abs(eta) > 2.65 && abs(eta) <= 3.00)     *      (pt > 0.1 && pt <= 0.2)   * (0.665) +
+    (abs(eta) > 2.65 && abs(eta) <= 3.00)     *      (pt > 0.2 && pt <= 0.3)   * (0.884) +
+    (abs(eta) > 2.65 && abs(eta) <= 3.00)     *      (pt > 0.3 && pt <= 0.7)   * (0.945) +
+    (abs(eta) > 2.65 && abs(eta) <= 3.00)     *      (pt > 0.7)                * (0.95)  +
+    (abs(eta) > 3.00)                         *      (pt > 0.1)                * (0.00)
+  }
Index: cards/ILCgen/ILCgen_PhotonEfficiency.tcl
===================================================================
--- cards/ILCgen/ILCgen_PhotonEfficiency.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_PhotonEfficiency.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,8 @@
+# set EfficiencyFormula (efficiency formula as a function of eta and pt)
+# efficiency formula for photons (ECAL + LumiCal)
+
+  set EfficiencyFormula {
+        (energy <= 2 )                                      * (0.00) +
+        (energy > 2 ) * (abs(eta) <= 3.0)                   * (0.95) +
+        (energy > 2 ) * (abs(eta) > 3.0 && abs(eta) <= 4.0) * (0.90)
+  }
Index: cards/ILCgen/ILCgen_PhotonIsolation.tcl
===================================================================
--- cards/ILCgen/ILCgen_PhotonIsolation.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_PhotonIsolation.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,6 @@
+
+  set DeltaRMax 0.5
+
+  set PTMin 0.5
+
+  set PTRatioMax 0.12
Index: cards/ILCgen/ILCgen_Propagator.tcl
===================================================================
--- cards/ILCgen/ILCgen_Propagator.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_Propagator.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,10 @@
+  # Magnetic field and tracking volume definition based on ILD-large design
+
+  # radius of the magnetic field coverage, in m
+  set Radius 1.8
+
+  # half-length of the magnetic field coverage, in m
+  set HalfLength 2.4
+
+  # magnetic field
+  set Bz 3.5
Index: cards/ILCgen/ILCgen_TauTagging.tcl
===================================================================
--- cards/ILCgen/ILCgen_TauTagging.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_TauTagging.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,24 @@
+
+  set DeltaR 0.1
+
+  set TauPTMin 1.0
+
+  set TauEtaMax 4.0
+
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {
+     (abs(eta) <= 3 ) * (energy <= 15 )                *   0.0000 +
+     (abs(eta) <= 3 ) * (energy  > 15 && energy <=25 ) *  (0.0600 - 0.00336 * (energy - 15 ) ) +
+     (abs(eta) <= 3 ) * (energy  > 25 && energy <=45 ) *  (0.0264 - 0.00041 * (energy - 25 ) ) +
+     (abs(eta) <= 3 ) * (energy  > 45 )                *   0.0182 +
+     (abs(eta)  > 3 )                                  *   0.0000 
+  }
+
+  # efficiency formula for tau-jets
+  add EfficiencyFormula {15} {
+     (abs(eta) <= 3 ) * (energy <=15 )                 *   0.000 +
+     (abs(eta) <= 3 ) * (energy  > 15 && energy <=25 ) *  (0.118 + 0.0352 * (energy - 15 ) ) +
+     (abs(eta) <= 3 ) * (energy  > 25 && energy <=45 ) *  (0.470 + 0.0090 * (energy - 25 ) ) +
+     (abs(eta) <= 3 ) * (energy  > 45 )                *   0.650 +
+     (abs(eta)  > 3 )                                  *   0.000 
+  }
Index: cards/ILCgen/ILCgen_TauTagging_N.tcl
===================================================================
--- cards/ILCgen/ILCgen_TauTagging_N.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/ILCgen/ILCgen_TauTagging_N.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,50 @@
+#####################################
+# tau-tagging for inclusive jets, N=2
+#####################################
+module TauTagging TauTagging_N2 {
+    set ParticleInputArray Delphes/allParticles
+    set PartonInputArray Delphes/partons
+    set JetInputArray JetFinder_N2/jets
+
+    source ILCgen/ILCgen_TauTagging.tcl
+}
+#####################################
+# tau-tagging for inclusive jets, N=3
+#####################################
+module TauTagging TauTagging_N3 {
+    set ParticleInputArray Delphes/allParticles
+    set PartonInputArray Delphes/partons
+    set JetInputArray JetFinder_N3/jets
+
+    source ILCgen/ILCgen_TauTagging.tcl
+}
+#####################################
+# tau-tagging for inclusive jets, N=4
+#####################################
+module TauTagging TauTagging_N4 {
+    set ParticleInputArray Delphes/allParticles
+    set PartonInputArray Delphes/partons
+    set JetInputArray JetFinder_N4/jets
+
+    source ILCgen/ILCgen_TauTagging.tcl
+}
+#####################################
+# tau-tagging for inclusive jets, N=5
+#####################################
+module TauTagging TauTagging_N5 {
+    set ParticleInputArray Delphes/allParticles
+    set PartonInputArray Delphes/partons
+    set JetInputArray JetFinder_N5/jets
+
+    source ILCgen/ILCgen_TauTagging.tcl
+}
+#####################################
+# tau-tagging for inclusive jets, N=6
+#####################################
+module TauTagging TauTagging_N6 {
+    set ParticleInputArray Delphes/allParticles
+    set PartonInputArray Delphes/partons
+    set JetInputArray JetFinder_N6/jets
+
+    source ILCgen/ILCgen_TauTagging.tcl
+}
Index: cards/MuonCollider/MuonColliderDet_BTag_50.tcl
===================================================================
--- cards/MuonCollider/MuonColliderDet_BTag_50.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/MuonCollider/MuonColliderDet_BTag_50.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,81 @@
+    # efficiency formula for b-jets
+    add EfficiencyFormula {5} {0.5}
+
+    # default efficiency formula (misidentification rate)
+add EfficiencyFormula {0} {
+	(energy >= 500 )* ( abs(eta) <=2.66 && abs(eta) > 2.09  ) * (  6e-3 )+ \
+		(energy >= 500 )* ( abs(eta) <=2.09 && abs(eta) > 1.53  ) * (  3e-3 )+ \
+		(energy >= 500 )* ( abs(eta) <=1.53 && abs(eta)> 1.165  ) * (  2e-3 )+ \
+		(energy >= 500 )* ( abs(eta) <=1.165 && abs(eta)>0.885  ) * (  2e-3 )+ \
+		(energy >= 500 )* ( abs(eta) <=0.885 && abs(eta)>0.655  ) * (  2e-3 )+ \
+		(energy >= 500 )* ( abs(eta) <=0.655 && abs(eta)> 0.455 ) * (  2e-3 )+ \
+		(energy >= 500 )* ( abs(eta) <=0.455 && abs(eta)>0.27   ) * (  3e-3 )+ \
+		(energy >= 500 )* ( abs(eta) <=0.27 && abs(eta)> 0.09   ) * (  3e-3 )+ \
+		(energy >= 500 )* ( abs(eta) <=0.09                     ) * (  3e-3 )+ \
+		(energy < 500 && energy >= 250)* ( abs(eta) <=2.66 && abs(eta) > 2.09  ) * (  5e-3 )+ \
+		(energy < 500 && energy >= 250)* ( abs(eta) <=2.09 && abs(eta) > 1.53  ) * (  2e-3 )+ \
+		(energy < 500 && energy >= 250)* ( abs(eta) <=1.53 && abs(eta)> 1.165  ) * (  1e-3 )+ \
+		(energy < 500 && energy >= 250)* ( abs(eta) <=1.165 && abs(eta)>0.885  ) * (  1e-3 )+ \
+		(energy < 500 && energy >= 250)* ( abs(eta) <=0.885 && abs(eta)>0.655  ) * (  1e-3 )+ \
+		(energy < 500 && energy >= 250)* ( abs(eta) <=0.655 && abs(eta)> 0.455 ) * (  1e-3 )+ \
+		(energy < 500 && energy >= 250)* ( abs(eta) <=0.455 && abs(eta)>0.27   ) * (  1e-3 )+ \
+		(energy < 500 && energy >= 250)* ( abs(eta) <=0.27 && abs(eta)> 0.09   ) * (  1e-3 )+ \
+		(energy < 500 && energy >= 250)* ( abs(eta) <=0.09                     ) * (  1e-3 )+ \
+		(energy < 250 && energy >= 100)* ( abs(eta) <=2.66 && abs(eta) > 2.09  ) * ( 3e-3)+ \
+		(energy < 250 && energy >= 100)* ( abs(eta) <=2.09 && abs(eta) > 1.53  ) * ( 1e-3)+ \
+		(energy < 250 && energy >= 100)* ( abs(eta) <=1.53 && abs(eta)> 1.165  ) * ( 9e-4)+ \
+		(energy < 250 && energy >= 100)* ( abs(eta) <=1.165 && abs(eta)>0.885  ) * ( 9e-4)+ \
+		(energy < 250 && energy >= 100)* ( abs(eta) <=0.885 && abs(eta)>0.655  ) * ( 8e-4)+ \
+		(energy < 250 && energy >= 100)* ( abs(eta) <=0.655 && abs(eta)> 0.455 ) * ( 7e-4)+ \
+		(energy < 250 && energy >= 100)* ( abs(eta) <=0.455 && abs(eta)>0.27   ) * ( 7e-4)+ \
+		(energy < 250 && energy >= 100)* ( abs(eta) <=0.27 && abs(eta)> 0.09   ) * ( 7e-4)+ \
+		(energy < 250 && energy >= 100)* ( abs(eta) <=0.09                     ) * ( 7e-4)+ \
+		(energy < 100 )* ( abs(eta) <=2.66 && abs(eta) > 2.09  ) * (   2e-3 )+ \
+		(energy < 100 )* ( abs(eta) <=2.09 && abs(eta) > 1.53  ) * (   7e-4 )+ \
+		(energy < 100 )* ( abs(eta) <=1.53 && abs(eta)> 1.165  ) * (   5e-4 )+ \
+		(energy < 100 )* ( abs(eta) <=1.165 && abs(eta)>0.885  ) * (   4e-4 )+ \
+		(energy < 100 )* ( abs(eta) <=0.885 && abs(eta)>0.655  ) * (   3e-4 )+ \
+		(energy < 100 )* ( abs(eta) <=0.655 && abs(eta)> 0.455 ) * (   2e-4 )+ \
+		(energy < 100 )* ( abs(eta) <=0.455 && abs(eta)>0.27   ) * (   2e-4 )+ \
+		(energy < 100 )* ( abs(eta) <=0.27 && abs(eta)> 0.09   ) * (   2e-4 )+ \
+		(energy < 100 )* ( abs(eta) <=0.09                     ) * (   3e-4 )}
+
+    # efficiency formula for c-jets (misidentification rate)
+    add EfficiencyFormula {4} {
+		(energy >= 500 )*(abs(eta) <=2.66 && abs(eta) > 2.09  ) * (  2e-2)+ \
+			(energy >= 500 )*(abs(eta) <=2.09 && abs(eta) > 1.53  ) * (  1e-2)+ \
+			(energy >= 500 )*(abs(eta) <=1.53 && abs(eta)> 1.165  ) * (  8e-3)+ \
+			(energy >= 500 )*(abs(eta) <=1.165 && abs(eta)>0.885  ) * (  8e-3)+ \
+			(energy >= 500 )*(abs(eta) <=0.885 && abs(eta)>0.655  ) * (  9e-3)+ \
+			(energy >= 500 )*(abs(eta) <=0.655 && abs(eta)> 0.455 ) * (  1e-2)+ \
+			(energy >= 500 )*(abs(eta) <=0.455 && abs(eta)>0.27   ) * (  1e-2)+ \
+			(energy >= 500 )*(abs(eta) <=0.27 && abs(eta)> 0.09   ) * (  1e-2)+ \
+			(energy >= 500 )*(abs(eta) <=0.09                     ) * (  1e-2)+ \
+			(energy < 500 && energy >= 250)*( abs(eta) <=2.66 && abs(eta) > 2.09  ) * (  2e-2)+ \
+			(energy < 500 && energy >= 250)*( abs(eta) <=2.09 && abs(eta) > 1.53  ) * (  6e-3)+ \
+			(energy < 500 && energy >= 250)*( abs(eta) <=1.53 && abs(eta)> 1.165  ) * (  5e-3)+ \
+			(energy < 500 && energy >= 250)*( abs(eta) <=1.165 && abs(eta)>0.885  ) * (  5e-3)+ \
+			(energy < 500 && energy >= 250)*( abs(eta) <=0.885 && abs(eta)>0.655  ) * (  4e-3)+ \
+			(energy < 500 && energy >= 250)*( abs(eta) <=0.655 && abs(eta)> 0.455 ) * (  4e-3)+ \
+			(energy < 500 && energy >= 250)*( abs(eta) <=0.455 && abs(eta)>0.27   ) * (  3e-3)+ \
+			(energy < 500 && energy >= 250)*( abs(eta) <=0.27 && abs(eta)> 0.09   ) * (  4e-3)+ \
+			(energy < 500 && energy >= 250)*( abs(eta) <=0.09                     ) * (    3e-3)+ \
+			(energy < 250 && energy >= 100)*( abs(eta) <=2.66 && abs(eta) > 2.09  ) * (    3e-2)+ \
+			(energy < 250 && energy >= 100)*( abs(eta) <=2.09 && abs(eta) > 1.53  ) * (    4e-3)+ \
+			(energy < 250 && energy >= 100)*( abs(eta) <=1.53 && abs(eta)> 1.165  ) * (    3e-3)+ \
+			(energy < 250 && energy >= 100)*( abs(eta) <=1.165 && abs(eta)>0.885  ) * (    2e-3)+ \
+			(energy < 250 && energy >= 100)*( abs(eta) <=0.885 && abs(eta)>0.655  ) * (    1e-3)+ \
+			(energy < 250 && energy >= 100)*( abs(eta) <=0.655 && abs(eta)> 0.455 ) * (    1e-3)+ \
+			(energy < 250 && energy >= 100)*( abs(eta) <=0.455 && abs(eta)>0.27   ) * (    1e-3)+ \
+			(energy < 250 && energy >= 100)*( abs(eta) <=0.27 && abs(eta)> 0.09   ) * (    1e-3)+ \
+			(energy < 250 && energy >= 100)*( abs(eta) <=0.09                     ) * (    1e-3)+ \
+			(energy < 100 )*( abs(eta) <=2.66 && abs(eta) > 2.09  ) * (    3e-2 )+ \
+			(energy < 100 )*( abs(eta) <=2.09 && abs(eta) > 1.53  ) * (    7e-3 )+ \
+			(energy < 100 )*( abs(eta) <=1.53 && abs(eta)> 1.165  ) * (    3e-3 )+ \
+			(energy < 100 )*( abs(eta) <=1.165 && abs(eta)>0.885  ) * (    2e-3 )+ \
+			(energy < 100 )*( abs(eta) <=0.885 && abs(eta)>0.655  ) * (    1e-3 )+ \
+			(energy < 100 )*( abs(eta) <=0.655 && abs(eta)> 0.455 ) * (    1e-3 )+ \
+			(energy < 100 )*( abs(eta) <=0.455 && abs(eta)>0.27   ) * (    9e-4 )+ \
+			(energy < 100 )*( abs(eta) <=0.27 && abs(eta)> 0.09   ) * (    9e-4 )+ \
+			(energy < 100 )*( abs(eta) <=0.09                     ) * (    7e-4 )}
+
Index: cards/MuonCollider/MuonColliderDet_BTag_70.tcl
===================================================================
--- cards/MuonCollider/MuonColliderDet_BTag_70.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/MuonCollider/MuonColliderDet_BTag_70.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,81 @@
+# efficiency formula for b-jets
+add EfficiencyFormula {5} {0.7}
+# default efficiency formula (misidentification rate)
+add EfficiencyFormula {0} {(energy >= 500 )*
+    (energy >= 500 )*( abs(eta) <=2.66 && abs(eta) > 2.09  ) * ( 2e-2 )+ \
+			       (energy >= 500 )*( abs(eta) <=2.09 && abs(eta) > 1.53  ) * ( 9e-3 )+ \
+			       (energy >= 500 )*( abs(eta) <=1.53 && abs(eta)> 1.165  ) * ( 8e-3 )+ \
+			       (energy >= 500 )*( abs(eta) <=1.165 && abs(eta)>0.885  ) * ( 8e-3 )+ \
+			       (energy >= 500 )*( abs(eta) <=0.885 && abs(eta)>0.655  ) * ( 1e-2 )+ \
+			       (energy >= 500 )*( abs(eta) <=0.655 && abs(eta)> 0.455 ) * ( 9e-3 )+ \
+			       (energy >= 500 )*( abs(eta) <=0.455 && abs(eta)>0.27   ) * ( 1e-2 )+ \
+			       (energy >= 500 )*( abs(eta) <=0.27 && abs(eta)> 0.09   ) * ( 1e-2 )+ \
+			       (energy >= 500 )*( abs(eta) <=0.09                     ) * ( 1e-2 )+ \
+			       (energy < 500 && energy >= 250)*( abs(eta) <=2.66 && abs(eta) > 2.09  ) * ( 2e-2 )+ \
+			       (energy < 500 && energy >= 250)*( abs(eta) <=2.09 && abs(eta) > 1.53  ) * ( 7e-3 )+ \
+			       (energy < 500 && energy >= 250)*( abs(eta) <=1.53 && abs(eta)> 1.165  ) * ( 6e-3 )+ \
+			       (energy < 500 && energy >= 250)*( abs(eta) <=1.165 && abs(eta)>0.885  ) * ( 6e-3 )+ \
+			       (energy < 500 && energy >= 250)*( abs(eta) <=0.885 && abs(eta)>0.655  ) * ( 5e-3 )+ \
+			       (energy < 500 && energy >= 250)*( abs(eta) <=0.655 && abs(eta)> 0.455 ) * ( 5e-3 )+ \
+			       (energy < 500 && energy >= 250)*( abs(eta) <=0.455 && abs(eta)>0.27   ) * ( 5e-3 )+ \
+			       (energy < 500 && energy >= 250)*( abs(eta) <=0.27 && abs(eta)> 0.09   ) * ( 5e-3 )+ \
+			       (energy < 500 && energy >= 250)*( abs(eta) <=0.09                     ) * ( 5e-3 )+ \
+			       (energy < 250 && energy >= 100)*( abs(eta) <=2.66 && abs(eta) > 2.09  ) * ( 2e-2 )+ \
+			       (energy < 250 && energy >= 100)*( abs(eta) <=2.09 && abs(eta) > 1.53  ) * ( 4e-3 )+ \
+			       (energy < 250 && energy >= 100)*( abs(eta) <=1.53 && abs(eta)> 1.165  ) * ( 3e-3 )+ \
+			       (energy < 250 && energy >= 100)*( abs(eta) <=1.165 && abs(eta)>0.885  ) * ( 3e-3 )+ \
+			       (energy < 250 && energy >= 100)*( abs(eta) <=0.885 && abs(eta)>0.655  ) * ( 2e-3 )+ \
+			       (energy < 250 && energy >= 100)*( abs(eta) <=0.655 && abs(eta)> 0.455 ) * ( 2e-3 )+ \
+			       (energy < 250 && energy >= 100)*( abs(eta) <=0.455 && abs(eta)>0.27   ) * ( 2e-3 )+ \
+			       (energy < 250 && energy >= 100)*( abs(eta) <=0.27 && abs(eta)> 0.09   ) * ( 2e-3 )+ \
+			       (energy < 250 && energy >= 100)*( abs(eta) <=0.09                     ) * ( 2e-3 )+ \
+			       (energy < 100 )*( abs(eta) <=2.66 && abs(eta) > 2.09  ) * ( 2e-2 )+ \
+			       (energy < 100 )*( abs(eta) <=2.09 && abs(eta) > 1.53  ) * ( 6e-3 )+ \
+			       (energy < 100 )*( abs(eta) <=1.53 && abs(eta)> 1.165  ) * ( 3e-3 )+ \
+			       (energy < 100 )*( abs(eta) <=1.165 && abs(eta)>0.885  ) * ( 2e-3 )+ \
+			       (energy < 100 )*( abs(eta) <=0.885 && abs(eta)>0.655  ) * ( 1e-3 )+ \
+			       (energy < 100 )*( abs(eta) <=0.655 && abs(eta)> 0.455 ) * ( 1e-3 )+ \
+			       (energy < 100 )*( abs(eta) <=0.455 && abs(eta)>0.27   ) * ( 1e-3 )+ \
+			       (energy < 100 )*( abs(eta) <=0.27 && abs(eta)> 0.09   ) * ( 1e-3 )+ \
+			       (energy < 100 )*( abs(eta) <=0.09                     ) * ( 1e-3 )
+}
+
+# efficiency formula for c-jets (misidentification rate)
+add EfficiencyFormula {4} {
+    (energy >= 500 )*(abs(eta) <=2.66 && abs(eta) > 2.09  ) * ( 1e-1 )+ \
+	(energy >= 500 )*(abs(eta) <=2.09 && abs(eta) > 1.53  ) * ( 4e-2 )+ \
+	(energy >= 500 )*(abs(eta) <=1.53 && abs(eta)> 1.165  ) * ( 3e-2 )+ \
+	(energy >= 500 )*(abs(eta) <=1.165 && abs(eta)>0.885  ) * ( 3e-2 )+ \
+	(energy >= 500 )*(abs(eta) <=0.885 && abs(eta)>0.655  ) * ( 4e-2 )+ \
+	(energy >= 500 )*(abs(eta) <=0.655 && abs(eta)> 0.455 ) * ( 4e-2 )+ \
+	(energy >= 500 )*(abs(eta) <=0.455 && abs(eta)>0.27   ) * ( 5e-2 )+ \
+	(energy >= 500 )*(abs(eta) <=0.27 && abs(eta)> 0.09   ) * ( 5e-2 )+ \
+	(energy >= 500 )*(abs(eta) <=0.09                     ) * ( 6e-2 )+ \
+	(energy < 500 && energy >= 250)*(abs(eta) <=2.66 && abs(eta) > 2.09  ) * ( 1e-1 )+ \
+	(energy < 500 && energy >= 250)*(abs(eta) <=2.09 && abs(eta) > 1.53  ) * ( 4e-2 )+ \
+	(energy < 500 && energy >= 250)*(abs(eta) <=1.53 && abs(eta)> 1.165  ) * ( 3e-2 )+ \
+	(energy < 500 && energy >= 250)*(abs(eta) <=1.165 && abs(eta)>0.885  ) * ( 2e-2 )+ \
+	(energy < 500 && energy >= 250)*(abs(eta) <=0.885 && abs(eta)>0.655  ) * ( 1e-2 )+ \
+	(energy < 500 && energy >= 250)*(abs(eta) <=0.655 && abs(eta)> 0.455 ) * ( 1e-2 )+ \
+	(energy < 500 && energy >= 250)*(abs(eta) <=0.455 && abs(eta)>0.27   ) * ( 1e-2 )+ \
+	(energy < 500 && energy >= 250)*(abs(eta) <=0.27 && abs(eta)> 0.09   ) * ( 1e-2 )+ \
+	(energy < 500 && energy >= 250)*(abs(eta) <=0.09                     ) * ( 1e-2 )+ \
+	(energy < 250 && energy >= 100)*(abs(eta) <=2.66 && abs(eta) > 2.09  ) * ( 1e-1 )+ \
+	(energy < 250 && energy >= 100)*(abs(eta) <=2.09 && abs(eta) > 1.53  ) * ( 4e-2 )+ \
+	(energy < 250 && energy >= 100)*(abs(eta) <=1.53 && abs(eta)> 1.165  ) * ( 2e-2 )+ \
+	(energy < 250 && energy >= 100)*(abs(eta) <=1.165 && abs(eta)>0.885  ) * ( 1e-2 )+ \
+	(energy < 250 && energy >= 100)*(abs(eta) <=0.885 && abs(eta)>0.655  ) * ( 1e-2 )+ \
+	(energy < 250 && energy >= 100)*(abs(eta) <=0.655 && abs(eta)> 0.455 ) * ( 8e-3 )+ \
+	(energy < 250 && energy >= 100)*(abs(eta) <=0.455 && abs(eta)>0.27   ) * ( 7e-3 )+ \
+	(energy < 250 && energy >= 100)*(abs(eta) <=0.27 && abs(eta)> 0.09   ) * ( 7e-3 )+ \
+	(energy < 250 && energy >= 100)*(abs(eta) <=0.09                     ) * ( 7e-3 )+ \
+	(energy < 100 )* (abs(eta) <=2.66 && abs(eta) > 2.09  ) * ( 1e-1 )+ \
+	(energy < 100 )* (abs(eta) <=2.09 && abs(eta) > 1.53  ) * ( 7e-2 )+ \
+	(energy < 100 )* (abs(eta) <=1.53 && abs(eta)> 1.165  ) * ( 4e-2 )+ \
+	(energy < 100 )* (abs(eta) <=1.165 && abs(eta)>0.885  ) * ( 2e-2 )+ \
+	(energy < 100 )* (abs(eta) <=0.885 && abs(eta)>0.655  ) * ( 1e-2 )+ \
+	(energy < 100 )* (abs(eta) <=0.655 && abs(eta)> 0.455 ) * ( 1e-2 )+ \
+	(energy < 100 )* (abs(eta) <=0.455 && abs(eta)>0.27   ) * ( 1e-2 )+ \
+	(energy < 100 )* (abs(eta) <=0.27 && abs(eta)> 0.09   ) * ( 9e-3 )+ \
+	(energy < 100 )* (abs(eta) <=0.09                     ) * ( 9e-3 )
+}
Index: cards/MuonCollider/MuonColliderDet_BTag_90.tcl
===================================================================
--- cards/MuonCollider/MuonColliderDet_BTag_90.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/MuonCollider/MuonColliderDet_BTag_90.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,81 @@
+# efficiency formula for b-jets
+add EfficiencyFormula {5} {0.9}
+# default efficiency formula (misidentification rate)
+add EfficiencyFormula {0} {
+	(energy >= 500 )*( abs(eta) <=2.66 && abs(eta) > 2.09  ) * ( 2e-1 )+ \
+		(energy >= 500 )*( abs(eta) <=2.09 && abs(eta) > 1.53  ) * ( 5e-2 )+ \
+		(energy >= 500 )*( abs(eta) <=1.53 && abs(eta)> 1.165  ) * ( 4e-2 )+ \
+		(energy >= 500 )*( abs(eta) <=1.165 && abs(eta)>0.885  ) * ( 5e-2 )+ \
+		(energy >= 500 )*( abs(eta) <=0.885 && abs(eta)>0.655  ) * ( 6e-2 )+ \
+		(energy >= 500 )*( abs(eta) <=0.655 && abs(eta)> 0.455 ) * ( 7e-2 )+ \
+		(energy >= 500 )*( abs(eta) <=0.455 && abs(eta)>0.27   ) * ( 7e-2 )+ \
+		(energy >= 500 )*( abs(eta) <=0.27 && abs(eta)> 0.09   ) * ( 8e-2 )+ \
+		(energy >= 500 )*( abs(eta) <=0.09                     ) * ( 8e-2 )+ \
+		(energy < 500 && energy >= 250)*( abs(eta) <=2.66 && abs(eta) > 2.09  ) * ( 2e-1 )+ \
+		(energy < 500 && energy >= 250)*( abs(eta) <=2.09 && abs(eta) > 1.53  ) * ( 4e-2 )+ \
+		(energy < 500 && energy >= 250)*( abs(eta) <=1.53 && abs(eta)> 1.165  ) * ( 3e-2 )+ \
+		(energy < 500 && energy >= 250)*( abs(eta) <=1.165 && abs(eta)>0.885  ) * ( 3e-2 )+ \
+		(energy < 500 && energy >= 250)*( abs(eta) <=0.885 && abs(eta)>0.655  ) * ( 2e-2 )+ \
+		(energy < 500 && energy >= 250)*( abs(eta) <=0.655 && abs(eta)> 0.455 ) * ( 2e-2 )+ \
+		(energy < 500 && energy >= 250)*( abs(eta) <=0.455 && abs(eta)>0.27   ) * ( 2e-2 )+ \
+		(energy < 500 && energy >= 250)*( abs(eta) <=0.27 && abs(eta)> 0.09   ) * ( 2e-2 )+ \
+		(energy < 500 && energy >= 250)*( abs(eta) <=0.09                     ) * ( 2e-2 )+ \
+		(energy < 250 && energy >= 100)*( abs(eta) <=2.66 && abs(eta) > 2.09  ) * ( 2e-1 )+ \
+		(energy < 250 && energy >= 100)*( abs(eta) <=2.09 && abs(eta) > 1.53  ) * ( 5e-2 )+ \
+		(energy < 250 && energy >= 100)*( abs(eta) <=1.53 && abs(eta)> 1.165  ) * ( 3e-2 )+ \
+		(energy < 250 && energy >= 100)*( abs(eta) <=1.165 && abs(eta)>0.885  ) * ( 2e-2 )+ \
+		(energy < 250 && energy >= 100)*( abs(eta) <=0.885 && abs(eta)>0.655  ) * ( 2e-2 )+ \
+		(energy < 250 && energy >= 100)*( abs(eta) <=0.655 && abs(eta)> 0.455 ) * ( 1e-2 )+ \
+		(energy < 250 && energy >= 100)*( abs(eta) <=0.455 && abs(eta)>0.27   ) * ( 1e-2 )+ \
+		(energy < 250 && energy >= 100)*( abs(eta) <=0.27 && abs(eta)> 0.09   ) * ( 1e-2 )+ \
+		(energy < 250 && energy >= 100)*( abs(eta) <=0.09                     ) * ( 1e-2 )+ \
+		(energy < 100 )*( abs(eta) <=2.66 && abs(eta) > 2.09  ) * ( 2e-1 )+ \
+		(energy < 100 )*( abs(eta) <=2.09 && abs(eta) > 1.53  ) * ( 8e-2 )+ \
+		(energy < 100 )*( abs(eta) <=1.53 && abs(eta)> 1.165  ) * ( 4e-2 )+ \
+		(energy < 100 )*( abs(eta) <=1.165 && abs(eta)>0.885  ) * ( 3e-2 )+ \
+		(energy < 100 )*( abs(eta) <=0.885 && abs(eta)>0.655  ) * ( 2e-2 )+ \
+		(energy < 100 )*( abs(eta) <=0.655 && abs(eta)> 0.455 ) * ( 1e-2 )+ \
+		(energy < 100 )*( abs(eta) <=0.455 && abs(eta)>0.27   ) * ( 1e-2 )+ \
+		(energy < 100 )*( abs(eta) <=0.27 && abs(eta)> 0.09   ) * ( 1e-2 )+ \
+		(energy < 100 )*( abs(eta) <=0.09                     ) * ( 1e-2 )
+}
+
+# efficiency formula for c-jets (misidentification rate)
+add EfficiencyFormula {4} {
+	(energy >= 500 )*( abs(eta) <=2.66 && abs(eta) > 2.09  ) * ( 8e-1 )+ \
+		(energy >= 500 )*( abs(eta) <=2.09 && abs(eta) > 1.53  ) * ( 4e-1 )+ \
+		(energy >= 500 )*( abs(eta) <=1.53 && abs(eta)> 1.165  ) * ( 3e-1 )+ \
+		(energy >= 500 )*( abs(eta) <=1.165 && abs(eta)>0.885  ) * ( 3e-1 )+ \
+		(energy >= 500 )*( abs(eta) <=0.885 && abs(eta)>0.655  ) * ( 3e-1 )+ \
+		(energy >= 500 )*( abs(eta) <=0.655 && abs(eta)> 0.455 ) * ( 3e-1 )+ \
+		(energy >= 500 )*( abs(eta) <=0.455 && abs(eta)>0.27   ) * ( 4e-1 )+ \
+		(energy >= 500 )*( abs(eta) <=0.27 && abs(eta)> 0.09   ) * ( 4e-1 )+ \
+		(energy >= 500 )*( abs(eta) <=0.09                     ) * ( 4e-1 )+ \
+		(energy < 500 && energy >= 250)*( abs(eta) <=2.66 && abs(eta) > 2.09  ) * ( 6e-1 )+ \
+		(energy < 500 && energy >= 250)*( abs(eta) <=2.09 && abs(eta) > 1.53  ) * ( 5e-1 )+ \
+		(energy < 500 && energy >= 250)*( abs(eta) <=1.53 && abs(eta)> 1.165  ) * ( 4e-1 )+ \
+		(energy < 500 && energy >= 250)*( abs(eta) <=1.165 && abs(eta)>0.885  ) * ( 3e-1 )+ \
+		(energy < 500 && energy >= 250)*( abs(eta) <=0.885 && abs(eta)>0.655  ) * ( 2e-1 )+ \
+		(energy < 500 && energy >= 250)*( abs(eta) <=0.655 && abs(eta)> 0.455 ) * ( 2e-1 )+ \
+		(energy < 500 && energy >= 250)*( abs(eta) <=0.455 && abs(eta)>0.27   ) * ( 2e-1 )+ \
+		(energy < 500 && energy >= 250)*( abs(eta) <=0.27 && abs(eta)> 0.09   ) * ( 2e-1 )+ \
+		(energy < 500 && energy >= 250)*( abs(eta) <=0.09                     ) * ( 2e-1 )+ \
+		(energy < 250 && energy >= 100)*( abs(eta) <=2.66 && abs(eta) > 2.09  ) * ( 5e-1 )+ \
+		(energy < 250 && energy >= 100)*( abs(eta) <=2.09 && abs(eta) > 1.53  ) * ( 4e-1 )+ \
+		(energy < 250 && energy >= 100)*( abs(eta) <=1.53 && abs(eta)> 1.165  ) * ( 3e-1 )+ \
+		(energy < 250 && energy >= 100)*( abs(eta) <=1.165 && abs(eta)>0.885  ) * ( 2e-1 )+ \
+		(energy < 250 && energy >= 100)*( abs(eta) <=0.885 && abs(eta)>0.655  ) * ( 2e-1 )+ \
+		(energy < 250 && energy >= 100)*( abs(eta) <=0.655 && abs(eta)> 0.455 ) * ( 2e-1 )+ \
+		(energy < 250 && energy >= 100)*( abs(eta) <=0.455 && abs(eta)>0.27   ) * ( 2e-1 )+ \
+		(energy < 250 && energy >= 100)*( abs(eta) <=0.27 && abs(eta)> 0.09   ) * ( 2e-1 )+ \
+		(energy < 250 && energy >= 100)*( abs(eta) <=0.09                     ) * ( 2e-1 )+ \
+		(energy < 100 )*( abs(eta) <=2.66 && abs(eta) > 2.09  ) * ( 5e-1 )+ \
+		(energy < 100 )*( abs(eta) <=2.09 && abs(eta) > 1.53  ) * ( 5e-1 )+ \
+		(energy < 100 )*( abs(eta) <=1.53 && abs(eta)> 1.165  ) * ( 4e-1 )+ \
+		(energy < 100 )*( abs(eta) <=1.165 && abs(eta)>0.885  ) * ( 3e-1 )+ \
+		(energy < 100 )*( abs(eta) <=0.885 && abs(eta)>0.655  ) * ( 3e-1 )+ \
+		(energy < 100 )*( abs(eta) <=0.655 && abs(eta)> 0.455 ) * ( 2e-1 )+ \
+		(energy < 100 )*( abs(eta) <=0.455 && abs(eta)>0.27   ) * ( 2e-1 )+ \
+		(energy < 100 )*( abs(eta) <=0.27 && abs(eta)> 0.09   ) * ( 2e-1 )+ \
+		(energy < 100 )*( abs(eta) <=0.09                     ) * ( 2e-1 )
+}
Index: cards/MuonCollider/MuonColliderDet_BTagging.tcl
===================================================================
--- cards/MuonCollider/MuonColliderDet_BTagging.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/MuonCollider/MuonColliderDet_BTagging.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,547 @@
+module BTagging BTagging_WP50_R02N2 {
+	set JetInputArray JetMomentumSmearing_VLCR02N2/JER_VLCjetsR02N2
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+
+module BTagging BTagging_WP70_R02N2 {
+	set JetInputArray JetMomentumSmearing_VLCR02N2/JER_VLCjetsR02N2
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R02N2 {
+	set JetInputArray JetMomentumSmearing_VLCR02N2/JER_VLCjetsR02N2
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R02N3 {
+	set JetInputArray JetMomentumSmearing_VLCR02N3/JER_VLCjetsR02N3
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R02N3 {
+	set JetInputArray JetMomentumSmearing_VLCR02N3/JER_VLCjetsR02N3
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R02N3 {
+	set JetInputArray JetMomentumSmearing_VLCR02N3/JER_VLCjetsR02N3
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R02N4 {
+	set JetInputArray JetMomentumSmearing_VLCR02N4/JER_VLCjetsR02N4
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R02N4 {
+	set JetInputArray JetMomentumSmearing_VLCR02N4/JER_VLCjetsR02N4
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R02N4 {
+	set JetInputArray JetMomentumSmearing_VLCR02N4/JER_VLCjetsR02N4
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R02N5 {
+	set JetInputArray JetMomentumSmearing_VLCR02N5/JER_VLCjetsR02N5
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R02N5 {
+	set JetInputArray JetMomentumSmearing_VLCR02N5/JER_VLCjetsR02N5
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R02N5 {
+	set JetInputArray JetMomentumSmearing_VLCR02N5/JER_VLCjetsR02N5
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R02N6 {
+	set JetInputArray JetMomentumSmearing_VLCR02N6/JER_VLCjetsR02N6
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R02N6 {
+	set JetInputArray JetMomentumSmearing_VLCR02N6/JER_VLCjetsR02N6
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R02N6 {
+	set JetInputArray JetMomentumSmearing_VLCR02N6/JER_VLCjetsR02N6
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+
+module BTagging BTagging_WP50_R05N2 {
+	set JetInputArray JetMomentumSmearing_VLCR05N2/JER_VLCjetsR05N2
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R05N2 {
+	set JetInputArray JetMomentumSmearing_VLCR05N2/JER_VLCjetsR05N2
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R05N2 {
+	set JetInputArray JetMomentumSmearing_VLCR05N2/JER_VLCjetsR05N2
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R05N3 {
+	set JetInputArray JetMomentumSmearing_VLCR05N3/JER_VLCjetsR05N3
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R05N3 {
+	set JetInputArray JetMomentumSmearing_VLCR05N3/JER_VLCjetsR05N3
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R05N3 {
+	set JetInputArray JetMomentumSmearing_VLCR05N3/JER_VLCjetsR05N3
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R05N4 {
+	set JetInputArray JetMomentumSmearing_VLCR05N4/JER_VLCjetsR05N4
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R05N4 {
+	set JetInputArray JetMomentumSmearing_VLCR05N4/JER_VLCjetsR05N4
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R05N4 {
+	set JetInputArray JetMomentumSmearing_VLCR05N4/JER_VLCjetsR05N4
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R05N5 {
+	set JetInputArray JetMomentumSmearing_VLCR05N5/JER_VLCjetsR05N5
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R05N5 {
+	set JetInputArray JetMomentumSmearing_VLCR05N5/JER_VLCjetsR05N5
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R05N5 {
+	set JetInputArray JetMomentumSmearing_VLCR05N5/JER_VLCjetsR05N5
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R05N6 {
+	set JetInputArray JetMomentumSmearing_VLCR05N6/JER_VLCjetsR05N6
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R05N6 {
+	set JetInputArray JetMomentumSmearing_VLCR05N6/JER_VLCjetsR05N6
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R05N6 {
+	set JetInputArray JetMomentumSmearing_VLCR05N6/JER_VLCjetsR05N6
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R07N2 {
+	set JetInputArray JetMomentumSmearing_VLCR07N2/JER_VLCjetsR07N2
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R07N2 {
+	set JetInputArray JetMomentumSmearing_VLCR07N2/JER_VLCjetsR07N2
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R07N2 {
+	set JetInputArray JetMomentumSmearing_VLCR07N2/JER_VLCjetsR07N2
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R07N3 {
+	set JetInputArray JetMomentumSmearing_VLCR07N3/JER_VLCjetsR07N3
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R07N3 {
+	set JetInputArray JetMomentumSmearing_VLCR07N3/JER_VLCjetsR07N3
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R07N3 {
+	set JetInputArray JetMomentumSmearing_VLCR07N3/JER_VLCjetsR07N3
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R07N4 {
+	set JetInputArray JetMomentumSmearing_VLCR07N4/JER_VLCjetsR07N4
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R07N4 {
+	set JetInputArray JetMomentumSmearing_VLCR07N4/JER_VLCjetsR07N4
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R07N4 {
+	set JetInputArray JetMomentumSmearing_VLCR07N4/JER_VLCjetsR07N4
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R07N5 {
+	set JetInputArray JetMomentumSmearing_VLCR07N5/JER_VLCjetsR07N5
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R07N5 {
+	set JetInputArray JetMomentumSmearing_VLCR07N5/JER_VLCjetsR07N5
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R07N5 {
+	set JetInputArray JetMomentumSmearing_VLCR07N5/JER_VLCjetsR07N5
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R07N6 {
+	set JetInputArray JetMomentumSmearing_VLCR07N6/JER_VLCjetsR07N6
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R07N6 {
+	set JetInputArray JetMomentumSmearing_VLCR07N6/JER_VLCjetsR07N6
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R07N6 {
+	set JetInputArray JetMomentumSmearing_VLCR07N6/JER_VLCjetsR07N6
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R10N2 {
+	set JetInputArray JetMomentumSmearing_VLCR10N2/JER_VLCjetsR10N2
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R10N2 {
+	set JetInputArray JetMomentumSmearing_VLCR10N2/JER_VLCjetsR10N2
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R10N2 {
+	set JetInputArray JetMomentumSmearing_VLCR10N2/JER_VLCjetsR10N2
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R10N3 {
+	set JetInputArray JetMomentumSmearing_VLCR10N3/JER_VLCjetsR10N3
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R10N3 {
+	set JetInputArray JetMomentumSmearing_VLCR10N3/JER_VLCjetsR10N3
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R10N3 {
+	set JetInputArray JetMomentumSmearing_VLCR10N3/JER_VLCjetsR10N3
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R10N4 {
+	set JetInputArray JetMomentumSmearing_VLCR10N4/JER_VLCjetsR10N4
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R10N4 {
+	set JetInputArray JetMomentumSmearing_VLCR10N4/JER_VLCjetsR10N4
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R10N4 {
+	set JetInputArray JetMomentumSmearing_VLCR10N4/JER_VLCjetsR10N4
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R10N5 {
+	set JetInputArray JetMomentumSmearing_VLCR10N5/JER_VLCjetsR10N5
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R10N5 {
+	set JetInputArray JetMomentumSmearing_VLCR10N5/JER_VLCjetsR10N5
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R10N5 {
+	set JetInputArray JetMomentumSmearing_VLCR10N5/JER_VLCjetsR10N5
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R10N6 {
+	set JetInputArray JetMomentumSmearing_VLCR10N6/JER_VLCjetsR10N6
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R10N6 {
+	set JetInputArray JetMomentumSmearing_VLCR10N6/JER_VLCjetsR10N6
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R10N6 {
+	set JetInputArray JetMomentumSmearing_VLCR10N6/JER_VLCjetsR10N6
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R12N2 {
+	set JetInputArray JetMomentumSmearing_VLCR12N2/JER_VLCjetsR12N2
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R12N2 {
+	set JetInputArray JetMomentumSmearing_VLCR12N2/JER_VLCjetsR12N2
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R12N2 {
+	set JetInputArray JetMomentumSmearing_VLCR12N2/JER_VLCjetsR12N2
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R12N3 {
+	set JetInputArray JetMomentumSmearing_VLCR12N3/JER_VLCjetsR12N3
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R12N3 {
+	set JetInputArray JetMomentumSmearing_VLCR12N3/JER_VLCjetsR12N3
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R12N3 {
+	set JetInputArray JetMomentumSmearing_VLCR12N3/JER_VLCjetsR12N3
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R12N4 {
+	set JetInputArray JetMomentumSmearing_VLCR12N4/JER_VLCjetsR12N4
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R12N4 {
+	set JetInputArray JetMomentumSmearing_VLCR12N4/JER_VLCjetsR12N4
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R12N4 {
+	set JetInputArray JetMomentumSmearing_VLCR12N4/JER_VLCjetsR12N4
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R12N5 {
+	set JetInputArray JetMomentumSmearing_VLCR12N5/JER_VLCjetsR12N5
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R12N5 {
+	set JetInputArray JetMomentumSmearing_VLCR12N5/JER_VLCjetsR12N5
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R12N5 {
+	set JetInputArray JetMomentumSmearing_VLCR12N5/JER_VLCjetsR12N5
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R12N6 {
+	set JetInputArray JetMomentumSmearing_VLCR12N6/JER_VLCjetsR12N6
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R12N6 {
+	set JetInputArray JetMomentumSmearing_VLCR12N6/JER_VLCjetsR12N6
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R12N6 {
+	set JetInputArray JetMomentumSmearing_VLCR12N6/JER_VLCjetsR12N6
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R15N2 {
+	set JetInputArray JetMomentumSmearing_VLCR15N2/JER_VLCjetsR15N2
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R15N2 {
+	set JetInputArray JetMomentumSmearing_VLCR15N2/JER_VLCjetsR15N2
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R15N2 {
+	set JetInputArray JetMomentumSmearing_VLCR15N2/JER_VLCjetsR15N2
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R15N3 {
+	set JetInputArray JetMomentumSmearing_VLCR15N3/JER_VLCjetsR15N3
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R15N3 {
+	set JetInputArray JetMomentumSmearing_VLCR15N3/JER_VLCjetsR15N3
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R15N3 {
+	set JetInputArray JetMomentumSmearing_VLCR15N3/JER_VLCjetsR15N3
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R15N4 {
+	set JetInputArray JetMomentumSmearing_VLCR15N4/JER_VLCjetsR15N4
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R15N4 {
+	set JetInputArray JetMomentumSmearing_VLCR15N4/JER_VLCjetsR15N4
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R15N4 {
+	set JetInputArray JetMomentumSmearing_VLCR15N4/JER_VLCjetsR15N4
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R15N5 {
+	set JetInputArray JetMomentumSmearing_VLCR15N5/JER_VLCjetsR15N5
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R15N5 {
+	set JetInputArray JetMomentumSmearing_VLCR15N5/JER_VLCjetsR15N5
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R15N5 {
+	set JetInputArray JetMomentumSmearing_VLCR15N5/JER_VLCjetsR15N5
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R15N6 {
+	set JetInputArray JetMomentumSmearing_VLCR15N6/JER_VLCjetsR15N6
+	set BitNumber 0
+	source MuonCollider/MuonColliderDet_BTag_50.tcl
+}
+module BTagging BTagging_WP70_R15N6 {
+	set JetInputArray JetMomentumSmearing_VLCR15N6/JER_VLCjetsR15N6
+	set BitNumber 1
+	source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R15N6 {
+	set JetInputArray JetMomentumSmearing_VLCR15N6/JER_VLCjetsR15N6
+	set BitNumber 2
+	source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+
+########################
+# inclusive clustering
+########################
+
+module BTagging BTagging_WP50_R02_inclusive {
+ set JetInputArray JetMomentumSmearing_VLCR02_inclusive/JER_VLCjetsR02_inclusive
+ set BitNumber 0
+ source MuonCollider/MuonColliderDet_BTag_50.tcl
+ }
+module BTagging BTagging_WP70_R02_inclusive {
+ set JetInputArray JetMomentumSmearing_VLCR02_inclusive/JER_VLCjetsR02_inclusive
+ set BitNumber 1
+ source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R02_inclusive {
+ set JetInputArray JetMomentumSmearing_VLCR02_inclusive/JER_VLCjetsR02_inclusive
+ set BitNumber 2
+ source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R05_inclusive {
+ set JetInputArray JetMomentumSmearing_VLCR05_inclusive/JER_VLCjetsR05_inclusive
+ set BitNumber 0
+ source MuonCollider/MuonColliderDet_BTag_50.tcl
+ }
+module BTagging BTagging_WP70_R05_inclusive {
+ set JetInputArray JetMomentumSmearing_VLCR05_inclusive/JER_VLCjetsR05_inclusive
+ set BitNumber 1
+ source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R05_inclusive {
+ set JetInputArray JetMomentumSmearing_VLCR05_inclusive/JER_VLCjetsR05_inclusive
+ set BitNumber 2
+ source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R07_inclusive {
+ set JetInputArray JetMomentumSmearing_VLCR07_inclusive/JER_VLCjetsR07_inclusive
+ set BitNumber 0
+ source MuonCollider/MuonColliderDet_BTag_50.tcl
+ }
+module BTagging BTagging_WP70_R07_inclusive {
+ set JetInputArray JetMomentumSmearing_VLCR07_inclusive/JER_VLCjetsR07_inclusive
+ set BitNumber 1
+ source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R07_inclusive {
+ set JetInputArray JetMomentumSmearing_VLCR07_inclusive/JER_VLCjetsR07_inclusive
+ set BitNumber 2
+ source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R10_inclusive {
+ set JetInputArray JetMomentumSmearing_VLCR10_inclusive/JER_VLCjetsR10_inclusive
+ set BitNumber 0
+ source MuonCollider/MuonColliderDet_BTag_50.tcl
+ }
+module BTagging BTagging_WP70_R10_inclusive {
+ set JetInputArray JetMomentumSmearing_VLCR10_inclusive/JER_VLCjetsR10_inclusive
+ set BitNumber 1
+ source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R10_inclusive {
+ set JetInputArray JetMomentumSmearing_VLCR10_inclusive/JER_VLCjetsR10_inclusive
+ set BitNumber 2
+ source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R12_inclusive {
+ set JetInputArray JetMomentumSmearing_VLCR12_inclusive/JER_VLCjetsR12_inclusive
+ set BitNumber 0
+ source MuonCollider/MuonColliderDet_BTag_50.tcl
+ }
+module BTagging BTagging_WP70_R12_inclusive {
+ set JetInputArray JetMomentumSmearing_VLCR12_inclusive/JER_VLCjetsR12_inclusive
+ set BitNumber 1
+ source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R12_inclusive {
+ set JetInputArray JetMomentumSmearing_VLCR12_inclusive/JER_VLCjetsR12_inclusive
+ set BitNumber 2
+ source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
+module BTagging BTagging_WP50_R15_inclusive {
+ set JetInputArray JetMomentumSmearing_VLCR15_inclusive/JER_VLCjetsR15_inclusive
+ set BitNumber 0
+ source MuonCollider/MuonColliderDet_BTag_50.tcl
+ }
+module BTagging BTagging_WP70_R15_inclusive {
+ set JetInputArray JetMomentumSmearing_VLCR15_inclusive/JER_VLCjetsR15_inclusive
+ set BitNumber 1
+ source MuonCollider/MuonColliderDet_BTag_70.tcl
+}
+module BTagging BTagging_WP90_R15_inclusive {
+ set JetInputArray JetMomentumSmearing_VLCR15_inclusive/JER_VLCjetsR15_inclusive
+ set BitNumber 2
+ source MuonCollider/MuonColliderDet_BTag_90.tcl
+}
Index: cards/MuonCollider/MuonColliderDet_JetFlavorAssociation.tcl
===================================================================
--- cards/MuonCollider/MuonColliderDet_JetFlavorAssociation.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/MuonCollider/MuonColliderDet_JetFlavorAssociation.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,444 @@
+module JetFlavorAssociation JetFlavorAssociation_R02N2 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR02N2/JER_VLCjetsR02N2
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R02N3 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR02N3/JER_VLCjetsR02N3
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R02N4 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR02N4/JER_VLCjetsR02N4
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R02N5 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR02N5/JER_VLCjetsR02N5
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R02N6 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR02N6/JER_VLCjetsR02N6
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+
+module JetFlavorAssociation JetFlavorAssociation_R05N2 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR05N2/JER_VLCjetsR05N2
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R05N3 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR05N3/JER_VLCjetsR05N3
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R05N4 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR05N4/JER_VLCjetsR05N4
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R05N5 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR05N5/JER_VLCjetsR05N5
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R05N6 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR05N6/JER_VLCjetsR05N6
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+
+#R07
+module JetFlavorAssociation JetFlavorAssociation_R07N2 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR07N2/JER_VLCjetsR07N2
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R07N3 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR07N3/JER_VLCjetsR07N3
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R07N4 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR07N4/JER_VLCjetsR07N4
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R07N5 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR07N5/JER_VLCjetsR07N5
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R07N6 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR07N6/JER_VLCjetsR07N6
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+
+
+#R10
+module JetFlavorAssociation JetFlavorAssociation_R10N2 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR10N2/JER_VLCjetsR10N2
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R10N3 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR10N3/JER_VLCjetsR10N3
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R10N4 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR10N4/JER_VLCjetsR10N4
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R10N5 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR10N5/JER_VLCjetsR10N5
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R10N6 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR10N6/JER_VLCjetsR10N6
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+
+
+# R 12
+module JetFlavorAssociation JetFlavorAssociation_R12N2 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR12N2/JER_VLCjetsR12N2
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R12N3 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR12N3/JER_VLCjetsR12N3
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R12N4 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR12N4/JER_VLCjetsR12N4
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R12N5 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR12N5/JER_VLCjetsR12N5
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R12N6 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR12N6/JER_VLCjetsR12N6
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+
+# R15
+module JetFlavorAssociation JetFlavorAssociation_R15N2 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR15N2/JER_VLCjetsR15N2
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R15N3 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR15N3/JER_VLCjetsR15N3
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R15N4 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR15N4/JER_VLCjetsR15N4
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R15N5 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR15N5/JER_VLCjetsR15N5
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R15N6 {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR15N6/JER_VLCjetsR15N6
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+
+module JetFlavorAssociation JetFlavorAssociation_R02_inclusive {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR02_inclusive/JER_VLCjetsR02_inclusive
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R05_inclusive {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR05_inclusive/JER_VLCjetsR05_inclusive
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R07_inclusive {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR07_inclusive/JER_VLCjetsR07_inclusive
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R10_inclusive {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR10_inclusive/JER_VLCjetsR10_inclusive
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R12_inclusive {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR12_inclusive/JER_VLCjetsR12_inclusive
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
+module JetFlavorAssociation JetFlavorAssociation_R15_inclusive {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetMomentumSmearing_VLCR15_inclusive/JER_VLCjetsR15_inclusive
+
+    set DeltaR 0.5
+    set PartonPTMin 1.0
+    set PartonEtaMax 2.5
+
+}
Index: cards/MuonCollider/MuonColliderDet_JetReco.tcl
===================================================================
--- cards/MuonCollider/MuonColliderDet_JetReco.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/MuonCollider/MuonColliderDet_JetReco.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,498 @@
+############
+# Jet finder VLC
+############
+#R02 N2
+module FastJetFinder FastJetFinderVLC_R02_N2 {
+    #  set InputArray Calorimeter/towers
+    set InputArray EFlowFilter/eflow
+
+    set OutputArray VLCjetsR02N2
+
+    # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt, 7 anti-kt with winner-take-all axis (for N-subjettiness), 8 N-jettiness, 9 Valencia
+    set NJets 2
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 0.2
+    set Beta 1.0
+    set Gamma 1.0
+
+    set JetPTMin 20.0
+}
+#R02 N3
+module FastJetFinder FastJetFinderVLC_R02_N3 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR02N3
+    set NJets 3
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 0.2
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R02 N4
+module FastJetFinder FastJetFinderVLC_R02_N4 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR02N4
+    set NJets 4
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 0.2
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R02 N5
+module FastJetFinder FastJetFinderVLC_R02_N5 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR02N5
+    set NJets 5
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 0.2
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R02 N6
+module FastJetFinder FastJetFinderVLC_R02_N6 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR02N6
+    set NJets 6
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 0.2
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R05 N2
+module FastJetFinder FastJetFinderVLC_R05_N2 {
+    #  set InputArray Calorimeter/towers
+    set InputArray EFlowFilter/eflow
+
+    set OutputArray VLCjetsR05N2
+
+    # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt, 7 anti-kt with winner-take-all axis (for N-subjettiness), 8 N-jettiness, 9 Valencia
+    set NJets 2
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 0.5
+    set Beta 1.0
+    set Gamma 1.0
+
+    set JetPTMin 20.0
+}
+#R05 N3
+module FastJetFinder FastJetFinderVLC_R05_N3 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR05N3
+    set NJets 3
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 0.5
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R05 N4
+module FastJetFinder FastJetFinderVLC_R05_N4 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR05N4
+    set NJets 4
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 0.5
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R05 N5
+module FastJetFinder FastJetFinderVLC_R05_N5 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR05N5
+    set NJets 5
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 0.5
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R05 N6
+module FastJetFinder FastJetFinderVLC_R05_N6 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR05N6
+    set NJets 6
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 0.5
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R07 N2
+module FastJetFinder FastJetFinderVLC_R07_N2 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR07N2
+    set NJets 2
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 0.7
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R07 N3
+module FastJetFinder FastJetFinderVLC_R07_N3 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR07N3
+    set NJets 3
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 0.7
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R07 N4
+module FastJetFinder FastJetFinderVLC_R07_N4 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR07N4
+    set NJets 4
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 0.7
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R07 N5
+module FastJetFinder FastJetFinderVLC_R07_N5 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR07N5
+    set NJets 5
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 0.7
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R07 N6
+module FastJetFinder FastJetFinderVLC_R07_N6 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR07N6
+    set NJets 6
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 0.7
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+
+#R10N2
+module FastJetFinder FastJetFinderVLC_R10_N2 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR10N2
+    set NJets 2
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 1.0
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R10 N3
+module FastJetFinder FastJetFinderVLC_R10_N3 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR10N3
+    set NJets 3
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 1.0
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R10 N4
+module FastJetFinder FastJetFinderVLC_R10_N4 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR10N4
+    set NJets 4
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 1.0
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R10 N5
+module FastJetFinder FastJetFinderVLC_R10_N5 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR10N5
+    set NJets 5
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 1.0
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R10 N6
+module FastJetFinder FastJetFinderVLC_R10_N6 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR10N6
+    set NJets 6
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 1.0
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+
+#R12 N2
+module FastJetFinder FastJetFinderVLC_R12_N2 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR12N2
+    set NJets 2
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 1.2
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R12 N3
+module FastJetFinder FastJetFinderVLC_R12_N3 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR12N3
+    set NJets 3
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 1.2
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R12 N4
+module FastJetFinder FastJetFinderVLC_R12_N4 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR12N4
+    set NJets 4
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 1.2
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R12 N5
+module FastJetFinder FastJetFinderVLC_R12_N5 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR12N5
+    set NJets 5
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 1.2
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R12 N6
+module FastJetFinder FastJetFinderVLC_R12_N6 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR12N6
+    set NJets 6
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 1.2
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+
+
+#R15 N2
+module FastJetFinder FastJetFinderVLC_R15_N2 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR15N2
+    set NJets 2
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 1.5
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R15 N3
+module FastJetFinder FastJetFinderVLC_R15_N3 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR15N3
+    set NJets 3
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 1.5
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R15 N4
+module FastJetFinder FastJetFinderVLC_R15_N4 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR15N4
+    set NJets 4
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 1.5
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R15 N5
+module FastJetFinder FastJetFinderVLC_R15_N5 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR15N5
+    set NJets 5
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 1.5
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+#R15 N6
+module FastJetFinder FastJetFinderVLC_R15_N6 {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR15N6
+    set NJets 6
+    set ExclusiveClustering true
+    set JetAlgorithm 9
+    set ParameterR 1.5
+    set Beta 1.0
+    set Gamma 1.0
+    set JetPTMin 20.0
+}
+
+########################
+# inclusive clustering
+# as means of comparison
+########################
+#R02
+module FastJetFinder FastJetFinderVLC_R02_inclusive {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR02_inclusive
+    set ExclusiveClustering false
+    set JetAlgorithm 9
+    set ParameterR 0.2
+    set Beta 1.0
+    set Gamma 1.0
+
+    set ComputeNsubjettiness 1
+    set AxisMode 4
+
+    set ComputeSoftDrop 1
+    set BetaSoftDrop 0.0
+    set SymmetryCutSoftDrop 0.1
+    set R0SoftDrop 0.2
+
+    set JetPTMin 20.0
+
+
+
+
+
+}
+#R05
+module FastJetFinder FastJetFinderVLC_R05_inclusive {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR05_inclusive
+    set ExclusiveClustering false
+    set JetAlgorithm 9
+    set ParameterR 0.5
+    set Beta 1.0
+    set Gamma 1.0
+    set ComputeNsubjettiness 1
+    set AxisMode 4
+
+    set ComputeSoftDrop 1
+    set BetaSoftDrop 0.0
+    set SymmetryCutSoftDrop 0.1
+    set R0SoftDrop 0.5
+    set JetPTMin 20.0
+}
+#R07
+module FastJetFinder FastJetFinderVLC_R07_inclusive {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR07_inclusive
+    set ExclusiveClustering false
+    set JetAlgorithm 9
+    set ParameterR 0.7
+    set Beta 1.0
+    set Gamma 1.0
+    set ComputeNsubjettiness 1
+    set AxisMode 4
+
+    set ComputeSoftDrop 1
+    set BetaSoftDrop 0.0
+    set SymmetryCutSoftDrop 0.1
+    set R0SoftDrop 0.7
+    set JetPTMin 20.0
+}
+#R10
+module FastJetFinder FastJetFinderVLC_R10_inclusive {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR10_inclusive
+    set ExclusiveClustering false
+    set JetAlgorithm 9
+    set ParameterR 1.0
+    set Beta 1.0
+    set Gamma 1.0
+    set ComputeNsubjettiness 1
+    set AxisMode 4
+
+    set ComputeSoftDrop 1
+    set BetaSoftDrop 0.0
+    set SymmetryCutSoftDrop 0.1
+    set R0SoftDrop 1.0
+    set JetPTMin 20.0
+}
+#R12
+module FastJetFinder FastJetFinderVLC_R12_inclusive {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR12_inclusive
+    set ExclusiveClustering false
+    set JetAlgorithm 9
+    set ParameterR 1.2
+    set Beta 1.0
+    set Gamma 1.0
+    set ComputeNsubjettiness 1
+    set AxisMode 4
+
+    set ComputeSoftDrop 1
+    set BetaSoftDrop 0.0
+    set SymmetryCutSoftDrop 0.1
+    set R0SoftDrop 1.2
+    set JetPTMin 20.0
+}
+#R15
+module FastJetFinder FastJetFinderVLC_R15_inclusive {
+    set InputArray EFlowFilter/eflow
+    set OutputArray VLCjetsR15_inclusive
+    set ExclusiveClustering false
+    set JetAlgorithm 9
+    set ParameterR 1.5
+    set Beta 1.0
+    set Gamma 1.0
+    set ComputeNsubjettiness 1
+    set AxisMode 4
+
+    set ComputeSoftDrop 1
+    set BetaSoftDrop 0.0
+    set SymmetryCutSoftDrop 0.1
+    set R0SoftDrop 1.5
+
+    set JetPTMin 20.0
+}
Index: cards/MuonCollider/MuonColliderDet_JetSmearing.tcl
===================================================================
--- cards/MuonCollider/MuonColliderDet_JetSmearing.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/MuonCollider/MuonColliderDet_JetSmearing.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,184 @@
+module MomentumSmearing JetMomentumSmearing_VLCR02N2 {
+    set InputArray  FastJetFinderVLC_R02_N2/VLCjetsR02N2
+    set OutputArray JER_VLCjetsR02N2
+
+     # Resolution given in dpT/pT.
+    set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR02N3 {
+ set InputArray  FastJetFinderVLC_R02_N3/VLCjetsR02N3
+  set OutputArray JER_VLCjetsR02N3
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR02N4 {
+ set InputArray  FastJetFinderVLC_R02_N4/VLCjetsR02N4
+  set OutputArray JER_VLCjetsR02N4
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR02N5 {
+ set InputArray  FastJetFinderVLC_R02_N5/VLCjetsR02N5
+  set OutputArray JER_VLCjetsR02N5
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR02N6 {
+ set InputArray  FastJetFinderVLC_R02_N6/VLCjetsR02N6
+  set OutputArray JER_VLCjetsR02N6
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR02_inclusive {
+ set InputArray  FastJetFinderVLC_R02_inclusive/VLCjetsR02_inclusive
+  set OutputArray JER_VLCjetsR02_inclusive
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR05N2 {
+    set InputArray  FastJetFinderVLC_R05_N2/VLCjetsR05N2
+    set OutputArray JER_VLCjetsR05N2
+
+     # Resolution given in dpT/pT.
+    set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR05N3 {
+ set InputArray  FastJetFinderVLC_R05_N3/VLCjetsR05N3
+  set OutputArray JER_VLCjetsR05N3
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR05N4 {
+ set InputArray  FastJetFinderVLC_R05_N4/VLCjetsR05N4
+  set OutputArray JER_VLCjetsR05N4
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR05N5 {
+ set InputArray  FastJetFinderVLC_R05_N5/VLCjetsR05N5
+  set OutputArray JER_VLCjetsR05N5
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR05N6 {
+ set InputArray  FastJetFinderVLC_R05_N6/VLCjetsR05N6
+  set OutputArray JER_VLCjetsR05N6
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR05_inclusive {
+ set InputArray  FastJetFinderVLC_R05_inclusive/VLCjetsR05_inclusive
+  set OutputArray JER_VLCjetsR05_inclusive
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR07N2 {
+ set InputArray  FastJetFinderVLC_R07_N2/VLCjetsR07N2
+  set OutputArray JER_VLCjetsR07N2
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR07N3 {
+ set InputArray  FastJetFinderVLC_R07_N3/VLCjetsR07N3
+  set OutputArray JER_VLCjetsR07N3
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR07N4 {
+ set InputArray  FastJetFinderVLC_R07_N4/VLCjetsR07N4
+  set OutputArray JER_VLCjetsR07N4
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR07N5 {
+ set InputArray  FastJetFinderVLC_R07_N5/VLCjetsR07N5
+  set OutputArray JER_VLCjetsR07N5
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR07N6 {
+ set InputArray  FastJetFinderVLC_R07_N6/VLCjetsR07N6
+  set OutputArray JER_VLCjetsR07N6
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR07_inclusive {
+ set InputArray  FastJetFinderVLC_R07_inclusive/VLCjetsR07_inclusive
+  set OutputArray JER_VLCjetsR07_inclusive
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR10N2 {
+ set InputArray  FastJetFinderVLC_R10_N2/VLCjetsR10N2
+  set OutputArray JER_VLCjetsR10N2
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR10N3 {
+ set InputArray  FastJetFinderVLC_R10_N3/VLCjetsR10N3
+  set OutputArray JER_VLCjetsR10N3
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR10N4 {
+ set InputArray  FastJetFinderVLC_R10_N4/VLCjetsR10N4
+  set OutputArray JER_VLCjetsR10N4
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR10N5 {
+ set InputArray  FastJetFinderVLC_R10_N5/VLCjetsR10N5
+  set OutputArray JER_VLCjetsR10N5
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR10N6 {
+ set InputArray  FastJetFinderVLC_R10_N6/VLCjetsR10N6
+  set OutputArray JER_VLCjetsR10N6
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR10_inclusive {
+ set InputArray  FastJetFinderVLC_R10_inclusive/VLCjetsR10_inclusive
+  set OutputArray JER_VLCjetsR10_inclusive
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR12N2 {
+ set InputArray  FastJetFinderVLC_R12_N2/VLCjetsR12N2
+  set OutputArray JER_VLCjetsR12N2
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR12N3 {
+ set InputArray  FastJetFinderVLC_R12_N3/VLCjetsR12N3
+  set OutputArray JER_VLCjetsR12N3
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR12N4 {
+ set InputArray  FastJetFinderVLC_R12_N4/VLCjetsR12N4
+  set OutputArray JER_VLCjetsR12N4
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR12N5 {
+ set InputArray  FastJetFinderVLC_R12_N5/VLCjetsR12N5
+  set OutputArray JER_VLCjetsR12N5
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR12N6 {
+ set InputArray  FastJetFinderVLC_R12_N6/VLCjetsR12N6
+  set OutputArray JER_VLCjetsR12N6
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR12_inclusive {
+ set InputArray  FastJetFinderVLC_R12_inclusive/VLCjetsR12_inclusive
+  set OutputArray JER_VLCjetsR12_inclusive
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR15N2 {
+ set InputArray  FastJetFinderVLC_R15_N2/VLCjetsR15N2
+  set OutputArray JER_VLCjetsR15N2
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR15N3 {
+ set InputArray  FastJetFinderVLC_R15_N3/VLCjetsR15N3
+  set OutputArray JER_VLCjetsR15N3
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR15N4 {
+ set InputArray  FastJetFinderVLC_R15_N4/VLCjetsR15N4
+  set OutputArray JER_VLCjetsR15N4
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR15N5 {
+ set InputArray  FastJetFinderVLC_R15_N5/VLCjetsR15N5
+  set OutputArray JER_VLCjetsR15N5
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR15N6 {
+ set InputArray  FastJetFinderVLC_R15_N6/VLCjetsR15N6
+  set OutputArray JER_VLCjetsR15N6
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
+module MomentumSmearing JetMomentumSmearing_VLCR15_inclusive {
+ set InputArray  FastJetFinderVLC_R15_inclusive/VLCjetsR15_inclusive
+  set OutputArray JER_VLCjetsR15_inclusive
+  set ResolutionFormula { (abs(eta) < 0.76) * ( 0.02 ) + (abs(eta) >= 0.76 ) * (0.05) }
+}
Index: cards/MuonCollider/MuonColliderDet_TauTagging.tcl
===================================================================
--- cards/MuonCollider/MuonColliderDet_TauTagging.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/MuonCollider/MuonColliderDet_TauTagging.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,553 @@
+module TauTagging TauTagging_R02N2 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+    set JetInputArray JetMomentumSmearing_VLCR02N2/JER_VLCjetsR02N2
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+    # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt}
+    # default efficiency formula (misidentification rate)
+    add EfficiencyFormula {0} {0.02}
+    add EfficiencyFormula {11} {0.001}
+    # efficiency formula for tau-jets
+
+    add EfficiencyFormula {15} {
+	(pt < 5) * (0.0) +
+	(pt >=5) * (0.80)
+    }
+}
+
+module TauTagging TauTagging_R02N3 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR02N3/JER_VLCjetsR02N3
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R02N4 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR02N4/JER_VLCjetsR02N4
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R02N5 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR02N5/JER_VLCjetsR02N5
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R02N6 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR02N6/JER_VLCjetsR02N6
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+
+module TauTagging TauTagging_R05N2 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+    set JetInputArray JetMomentumSmearing_VLCR05N2/JER_VLCjetsR05N2
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+    # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt}
+    # default efficiency formula (misidentification rate)
+    add EfficiencyFormula {0} {0.02}
+    add EfficiencyFormula {11} {0.001}
+    # efficiency formula for tau-jets
+
+    add EfficiencyFormula {15} {
+	(pt < 5) * (0.0) +
+	(pt >=5) * (0.80)
+    }
+}
+
+module TauTagging TauTagging_R05N3 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR05N3/JER_VLCjetsR05N3
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R05N4 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR05N4/JER_VLCjetsR05N4
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R05N5 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR05N5/JER_VLCjetsR05N5
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R05N6 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR05N6/JER_VLCjetsR05N6
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R07N2 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR07N2/JER_VLCjetsR07N2
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R07N3 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR07N3/JER_VLCjetsR07N3
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R07N4 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR07N4/JER_VLCjetsR07N4
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R07N5 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR07N5/JER_VLCjetsR07N5
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R07N6 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR07N6/JER_VLCjetsR07N6
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R10N2 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR10N2/JER_VLCjetsR10N2
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R10N3 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR10N3/JER_VLCjetsR10N3
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R10N4 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR10N4/JER_VLCjetsR10N4
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R10N5 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR10N5/JER_VLCjetsR10N5
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R10N6 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR10N6/JER_VLCjetsR10N6
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R12N2 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR12N2/JER_VLCjetsR12N2
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R12N3 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR12N3/JER_VLCjetsR12N3
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R12N4 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR12N4/JER_VLCjetsR12N4
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R12N5 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR12N5/JER_VLCjetsR12N5
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R12N6 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR12N6/JER_VLCjetsR12N6
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R15N2 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR15N2/JER_VLCjetsR15N2
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R15N3 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR15N3/JER_VLCjetsR15N3
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R15N4 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR15N4/JER_VLCjetsR15N4
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R15N5 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR15N5/JER_VLCjetsR15N5
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+module TauTagging TauTagging_R15N6 {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR15N6/JER_VLCjetsR15N6
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+
+ module TauTagging TauTagging_R02_inclusive {
+  set ParticleInputArray Delphes/allParticles
+  set PartonInputArray Delphes/partons
+  set JetInputArray JetMomentumSmearing_VLCR02_inclusive/JER_VLCjetsR02_inclusive
+  set DeltaR 0.5
+  set TauPTMin 1.0
+  set TauEtaMax 2.5
+  add EfficiencyFormula {0} {0.02}
+  add EfficiencyFormula {11} {0.001}
+  add EfficiencyFormula {15} {
+  (pt < 10) * (0.0) +
+  (pt >=10) * (0.80)
+  }
+  }
+
+  module TauTagging TauTagging_R05_inclusive {
+   set ParticleInputArray Delphes/allParticles
+   set PartonInputArray Delphes/partons
+   set JetInputArray JetMomentumSmearing_VLCR05_inclusive/JER_VLCjetsR05_inclusive
+   set DeltaR 0.5
+   set TauPTMin 1.0
+   set TauEtaMax 2.5
+   add EfficiencyFormula {0} {0.02}
+   add EfficiencyFormula {11} {0.001}
+   add EfficiencyFormula {15} {
+   (pt < 10) * (0.0) +
+   (pt >=10) * (0.80)
+   }
+   }
+
+
+module TauTagging TauTagging_R07_inclusive {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR07_inclusive/JER_VLCjetsR07_inclusive
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+
+module TauTagging TauTagging_R10_inclusive {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR10_inclusive/JER_VLCjetsR10_inclusive
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+
+module TauTagging TauTagging_R12_inclusive {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR12_inclusive/JER_VLCjetsR12_inclusive
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
+
+
+module TauTagging TauTagging_R15_inclusive {
+ set ParticleInputArray Delphes/allParticles
+ set PartonInputArray Delphes/partons
+ set JetInputArray JetMomentumSmearing_VLCR15_inclusive/JER_VLCjetsR15_inclusive
+ set DeltaR 0.5
+ set TauPTMin 1.0
+ set TauEtaMax 2.5
+ add EfficiencyFormula {0} {0.02}
+ add EfficiencyFormula {11} {0.001}
+ add EfficiencyFormula {15} {
+ (pt < 10) * (0.0) +
+ (pt >=10) * (0.80)
+ }
+ }
Index: cards/delphes_card_CLICdet_Stage1.tcl
===================================================================
--- cards/delphes_card_CLICdet_Stage1.tcl	(revision a5af1df1cf2ca5a488fc610ab546c762b7cdb5f2)
+++ cards/delphes_card_CLICdet_Stage1.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -298,10 +298,11 @@
 
     set EfficiencyFormula {
-	(abs(eta) > 2.54) * (0.000) +
-	(energy >= 80) * (abs(eta) < 2.54)  * (1.000) +
-	(energy < 80 && energy >= 3) * (abs(eta) <=2.54 && abs(eta) > 2.34)  * (0.994) +
-	(energy < 80 && energy >= 3) * (abs(eta) <= 2.34) * (1.000) +
-	(energy < 3) * (abs(eta) <= 2.54 && abs(eta) > 0.55 ) * (0.000) +
-	(energy < 3) * (abs(eta) <= 0.55 ) * (1.000) 
+ (pt <= 0.1)                                                                        * (0.000) +
+ (pt > 0.1)                                * (abs(eta) > 2.54)                      * (0.000) +
+ (pt > 0.1) * (energy >= 80)               * (abs(eta) < 2.54)                      * (1.000) +
+ (pt > 0.1) * (energy < 80 && energy >= 3) * (abs(eta) <=2.54 && abs(eta) > 2.34)   * (0.994) +
+ (pt > 0.1) * (energy < 80 && energy >= 3) * (abs(eta) <= 2.34)                     * (1.000) +
+ (pt > 0.1) * (energy < 3)                 * (abs(eta) <= 2.54 && abs(eta) > 0.55 ) * (0.990) +
+ (pt > 0.1) * (energy < 3)                 * (abs(eta) <= 0.55 )                    * (1.000) 
     }
 }
@@ -318,14 +319,14 @@
     # Current full simulation with CLICdet provides for electrons:
     set EfficiencyFormula {
-	(pt <= 1)                                                               * (0.000) +
-	(abs(eta) > 2.54)                                                       * (0.000) +
-	(energy >= 80)                 * (abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (0.993) +
-	(energy >= 80)                 * (abs(eta) <= 2.44 && abs(eta) > 2.34 ) * (0.997) +
-	(energy >= 80)                 * (abs(eta) <= 2.34  )                   * (1.000) +
-	(energy < 80 && energy >= 5) * (abs(eta) <= 2.54 && abs(eta) > 2.17 ) * (0.998) +
-	(energy < 80 && energy >= 5) * (abs(eta) <= 2.17)                     * (1.000) +
-	(energy < 5)   * (abs(eta) > 2.34 )                     * (0.000) +
-	(energy < 5)   * (abs(eta) <= 2.34 && abs(eta) > 0.76 ) * (0.997) +
-	(energy < 5)   * (abs(eta) <= 0.76)                     * (0.999)
+ (pt <= 0.1)                                                                        * (0.000) +
+ (pt > 0.1)                                * (abs(eta) > 2.54)                      * (0.000) +
+ (pt > 0.1) * (energy >= 80)               * (abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (0.993) +
+ (pt > 0.1) * (energy >= 80)               * (abs(eta) <= 2.44 && abs(eta) > 2.34 ) * (0.997) +
+ (pt > 0.1) * (energy >= 80)               * (abs(eta) <= 2.34  )                   * (1.000) +
+ (pt > 0.1) * (energy < 80 && energy >= 5) * (abs(eta) <= 2.54 && abs(eta) > 2.17 ) * (0.998) +
+ (pt > 0.1) * (energy < 80 && energy >= 5) * (abs(eta) <= 2.17)                     * (1.000) +
+ (pt > 0.1) * (energy < 5)                 * (abs(eta) <= 2.54 && abs(eta) > 2.34 ) * (1.000) +
+ (pt > 0.1) * (energy < 5)                 * (abs(eta) <= 2.34 && abs(eta) > 0.76 ) * (0.997) +
+ (pt > 0.1) * (energy < 5)                 * (abs(eta) <= 0.76)                     * (0.999)
     }
 }
@@ -341,14 +342,12 @@
     # Current full simulation with CLICdet provides for muons:
     set EfficiencyFormula {
-	(pt < 1)                                                                * (0.000) +
-	(abs(eta) > 2.54)                                                       * (0.000) +
-	(abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (energy >= 80)                 * (0.994) +
-	(abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (energy >= 5 && energy < 80)   * (0.996) +
-	(abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (energy < 5 )                  * (0.996) +
-	(abs(eta) <= 2.44 )                    * (energy >= 5 )                 * (1.000) +
-	(abs(eta) <= 2.44 && abs(eta) > 2.25 ) * (energy < 5 && pt >=1 )        * (0.999) +
-	(abs(eta) <= 2.25 )                    * (energy >= 1)                  * (1.000) 
-
-	
+  (pt <= 0.1)                                                                          * (0.000) +
+  (pt > 0.1) * (abs(eta) > 2.54)                                                       * (0.000) +
+  (pt > 0.1) * (abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (energy >= 80)                 * (0.994) +
+  (pt > 0.1) * (abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (energy >= 5 && energy < 80)   * (0.996) +
+  (pt > 0.1) * (abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (energy < 5 )                  * (0.996) +
+  (pt > 0.1) * (abs(eta) <= 2.44 )                    * (energy >= 5 )                 * (1.000) +
+  (pt > 0.1) * (abs(eta) <= 2.44 && abs(eta) > 2.25 ) * (energy < 5 )                  * (0.999) +
+  (pt > 0.1) * (abs(eta) <= 2.25 )                    * (energy < 5 )                  * (1.000) 
     }
 }
@@ -945,5 +944,5 @@
 module FastJetFinder FastJetFinderKt {
     #  set InputArray Calorimeter/towers
-    set InputArray EFlowMerger/eflow
+    set InputArray EFlowFilter/eflow
 
     set OutputArray KTjets
Index: cards/delphes_card_CLICdet_Stage2.tcl
===================================================================
--- cards/delphes_card_CLICdet_Stage2.tcl	(revision a5af1df1cf2ca5a488fc610ab546c762b7cdb5f2)
+++ cards/delphes_card_CLICdet_Stage2.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -490,10 +490,11 @@
 
     set EfficiencyFormula {
-	(abs(eta) > 2.54) * (0.000) +
-	(energy >= 80) * (abs(eta) < 2.54)  * (1.000) +
-	(energy < 80 && energy >= 3) * (abs(eta) <=2.54 && abs(eta) > 2.34)  * (0.994) +
-	(energy < 80 && energy >= 3) * (abs(eta) <= 2.34) * (1.000) +
-	(energy < 3) * (abs(eta) <= 2.54 && abs(eta) > 0.55 ) * (0.000) +
-	(energy < 3) * (abs(eta) <= 0.55 ) * (1.000) 
+ (pt <= 0.1)                                                                        * (0.000) +
+ (pt > 0.1)                                * (abs(eta) > 2.54)                      * (0.000) +
+ (pt > 0.1) * (energy >= 80)               * (abs(eta) < 2.54)                      * (1.000) +
+ (pt > 0.1) * (energy < 80 && energy >= 3) * (abs(eta) <=2.54 && abs(eta) > 2.34)   * (0.994) +
+ (pt > 0.1) * (energy < 80 && energy >= 3) * (abs(eta) <= 2.34)                     * (1.000) +
+ (pt > 0.1) * (energy < 3)                 * (abs(eta) <= 2.54 && abs(eta) > 0.55 ) * (0.990) +
+ (pt > 0.1) * (energy < 3)                 * (abs(eta) <= 0.55 )                    * (1.000) 
     }
 }
@@ -510,14 +511,14 @@
     # Current full simulation with CLICdet provides for electrons:
     set EfficiencyFormula {
-	(pt <= 1)                                                               * (0.000) +
-	(abs(eta) > 2.54)                                                       * (0.000) +
-	(energy >= 80)                 * (abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (0.993) +
-	(energy >= 80)                 * (abs(eta) <= 2.44 && abs(eta) > 2.34 ) * (0.997) +
-	(energy >= 80)                 * (abs(eta) <= 2.34  )                   * (1.000) +
-	(energy < 80 && energy >= 5) * (abs(eta) <= 2.54 && abs(eta) > 2.17 ) * (0.998) +
-	(energy < 80 && energy >= 5) * (abs(eta) <= 2.17)                     * (1.000) +
-	(energy < 5)   * (abs(eta) > 2.34 )                     * (0.000) +
-	(energy < 5)   * (abs(eta) <= 2.34 && abs(eta) > 0.76 ) * (0.997) +
-	(energy < 5)   * (abs(eta) <= 0.76)                     * (0.999)
+ (pt <= 0.1)                                                                        * (0.000) +
+ (pt > 0.1)                                * (abs(eta) > 2.54)                      * (0.000) +
+ (pt > 0.1) * (energy >= 80)               * (abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (0.993) +
+ (pt > 0.1) * (energy >= 80)               * (abs(eta) <= 2.44 && abs(eta) > 2.34 ) * (0.997) +
+ (pt > 0.1) * (energy >= 80)               * (abs(eta) <= 2.34  )                   * (1.000) +
+ (pt > 0.1) * (energy < 80 && energy >= 5) * (abs(eta) <= 2.54 && abs(eta) > 2.17 ) * (0.998) +
+ (pt > 0.1) * (energy < 80 && energy >= 5) * (abs(eta) <= 2.17)                     * (1.000) +
+ (pt > 0.1) * (energy < 5)                 * (abs(eta) <= 2.54 && abs(eta) > 2.34 ) * (1.000) +
+ (pt > 0.1) * (energy < 5)                 * (abs(eta) <= 2.34 && abs(eta) > 0.76 ) * (0.997) +
+ (pt > 0.1) * (energy < 5)                 * (abs(eta) <= 0.76)                     * (0.999)
     }
 }
@@ -533,14 +534,12 @@
     # Current full simulation with CLICdet provides for muons:
     set EfficiencyFormula {
-	(pt < 1)                                                                * (0.000) +
-	(abs(eta) > 2.54)                                                       * (0.000) +
-	(abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (energy >= 80)                 * (0.994) +
-	(abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (energy >= 5 && energy < 80)   * (0.996) +
-	(abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (energy < 5 )                  * (0.996) +
-	(abs(eta) <= 2.44 )                    * (energy >= 5 )                 * (1.000) +
-	(abs(eta) <= 2.44 && abs(eta) > 2.25 ) * (energy < 5 && pt >=1 )        * (0.999) +
-	(abs(eta) <= 2.25 )                    * (energy >= 1)                  * (1.000) 
-
-	
+  (pt <= 0.1)                                                                          * (0.000) +
+  (pt > 0.1) * (abs(eta) > 2.54)                                                       * (0.000) +
+  (pt > 0.1) * (abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (energy >= 80)                 * (0.994) +
+  (pt > 0.1) * (abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (energy >= 5 && energy < 80)   * (0.996) +
+  (pt > 0.1) * (abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (energy < 5 )                  * (0.996) +
+  (pt > 0.1) * (abs(eta) <= 2.44 )                    * (energy >= 5 )                 * (1.000) +
+  (pt > 0.1) * (abs(eta) <= 2.44 && abs(eta) > 2.25 ) * (energy < 5 )                  * (0.999) +
+  (pt > 0.1) * (abs(eta) <= 2.25 )                    * (energy < 5 )                  * (1.000) 
     }
 }
@@ -1136,5 +1135,5 @@
 module FastJetFinder FastJetFinderKt {
     #  set InputArray Calorimeter/towers
-    set InputArray EFlowMerger/eflow
+    set InputArray EFlowFilter/eflow
 
     set OutputArray KTjets
Index: cards/delphes_card_CLICdet_Stage3.tcl
===================================================================
--- cards/delphes_card_CLICdet_Stage3.tcl	(revision a5af1df1cf2ca5a488fc610ab546c762b7cdb5f2)
+++ cards/delphes_card_CLICdet_Stage3.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -484,10 +484,11 @@
 
     set EfficiencyFormula {
-	(abs(eta) > 2.54) * (0.000) +
-	(energy >= 80) * (abs(eta) < 2.54)  * (1.000) +
-	(energy < 80 && energy >= 3) * (abs(eta) <=2.54 && abs(eta) > 2.34)  * (0.994) +
-	(energy < 80 && energy >= 3) * (abs(eta) <= 2.34) * (1.000) +
-	(energy < 3) * (abs(eta) <= 2.54 && abs(eta) > 0.55 ) * (0.000) +
-	(energy < 3) * (abs(eta) <= 0.55 ) * (1.000) 
+ (pt <= 0.1)                                                                        * (0.000) +
+ (pt > 0.1)                                * (abs(eta) > 2.54)                      * (0.000) +
+ (pt > 0.1) * (energy >= 80)               * (abs(eta) < 2.54)                      * (1.000) +
+ (pt > 0.1) * (energy < 80 && energy >= 3) * (abs(eta) <=2.54 && abs(eta) > 2.34)   * (0.994) +
+ (pt > 0.1) * (energy < 80 && energy >= 3) * (abs(eta) <= 2.34)                     * (1.000) +
+ (pt > 0.1) * (energy < 3)                 * (abs(eta) <= 2.54 && abs(eta) > 0.55 ) * (0.990) +
+ (pt > 0.1) * (energy < 3)                 * (abs(eta) <= 0.55 )                    * (1.000) 
     }
 }
@@ -504,14 +505,14 @@
     # Current full simulation with CLICdet provides for electrons:
     set EfficiencyFormula {
-	(pt <= 1)                                                               * (0.000) +
-	(abs(eta) > 2.54)                                                       * (0.000) +
-	(energy >= 80)                 * (abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (0.993) +
-	(energy >= 80)                 * (abs(eta) <= 2.44 && abs(eta) > 2.34 ) * (0.997) +
-	(energy >= 80)                 * (abs(eta) <= 2.34  )                   * (1.000) +
-	(energy < 80 && energy >= 5) * (abs(eta) <= 2.54 && abs(eta) > 2.17 ) * (0.998) +
-	(energy < 80 && energy >= 5) * (abs(eta) <= 2.17)                     * (1.000) +
-	(energy < 5)   * (abs(eta) > 2.34 )                     * (0.000) +
-	(energy < 5)   * (abs(eta) <= 2.34 && abs(eta) > 0.76 ) * (0.997) +
-	(energy < 5)   * (abs(eta) <= 0.76)                     * (0.999)
+ (pt <= 0.1)                                                                        * (0.000) +
+ (pt > 0.1)                                * (abs(eta) > 2.54)                      * (0.000) +
+ (pt > 0.1) * (energy >= 80)               * (abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (0.993) +
+ (pt > 0.1) * (energy >= 80)               * (abs(eta) <= 2.44 && abs(eta) > 2.34 ) * (0.997) +
+ (pt > 0.1) * (energy >= 80)               * (abs(eta) <= 2.34  )                   * (1.000) +
+ (pt > 0.1) * (energy < 80 && energy >= 5) * (abs(eta) <= 2.54 && abs(eta) > 2.17 ) * (0.998) +
+ (pt > 0.1) * (energy < 80 && energy >= 5) * (abs(eta) <= 2.17)                     * (1.000) +
+ (pt > 0.1) * (energy < 5)                 * (abs(eta) <= 2.54 && abs(eta) > 2.34 ) * (1.000) +
+ (pt > 0.1) * (energy < 5)                 * (abs(eta) <= 2.34 && abs(eta) > 0.76 ) * (0.997) +
+ (pt > 0.1) * (energy < 5)                 * (abs(eta) <= 0.76)                     * (0.999)
     }
 }
@@ -527,14 +528,12 @@
     # Current full simulation with CLICdet provides for muons:
     set EfficiencyFormula {
-	(pt < 1)                                                                * (0.000) +
-	(abs(eta) > 2.54)                                                       * (0.000) +
-	(abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (energy >= 80)                 * (0.994) +
-	(abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (energy >= 5 && energy < 80)   * (0.996) +
-	(abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (energy < 5 )                  * (0.996) +
-	(abs(eta) <= 2.44 )                    * (energy >= 5 )                 * (1.000) +
-	(abs(eta) <= 2.44 && abs(eta) > 2.25 ) * (energy < 5 && pt >=1 )        * (0.999) +
-	(abs(eta) <= 2.25 )                    * (energy >= 1)                  * (1.000) 
-
-	
+  (pt <= 0.1)                                                                          * (0.000) +
+  (pt > 0.1) * (abs(eta) > 2.54)                                                       * (0.000) +
+  (pt > 0.1) * (abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (energy >= 80)                 * (0.994) +
+  (pt > 0.1) * (abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (energy >= 5 && energy < 80)   * (0.996) +
+  (pt > 0.1) * (abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (energy < 5 )                  * (0.996) +
+  (pt > 0.1) * (abs(eta) <= 2.44 )                    * (energy >= 5 )                 * (1.000) +
+  (pt > 0.1) * (abs(eta) <= 2.44 && abs(eta) > 2.25 ) * (energy < 5 )                  * (0.999) +
+  (pt > 0.1) * (abs(eta) <= 2.25 )                    * (energy < 5 )                  * (1.000) 
     }
 }
@@ -1132,5 +1131,5 @@
 module FastJetFinder FastJetFinderKt {
     #  set InputArray Calorimeter/towers
-    set InputArray EFlowMerger/eflow
+    set InputArray EFlowFilter/eflow
 
     set OutputArray KTjets
Index: cards/delphes_card_CLICdet_Stage3_fcal.tcl
===================================================================
--- cards/delphes_card_CLICdet_Stage3_fcal.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/delphes_card_CLICdet_Stage3_fcal.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,1452 @@
+#######################################
+# CLICdet_fcal model for 3TeV CLIC stage
+#
+# Based on CLICdet model
+# by Ulrike Schnoor ulrike.schnoor@cern.ch
+#
+# Forward calorimeters implemented
+# by Aleksander Filip Zarnecki zarnecki@fuw.edu.pl
+# based on ILCDelphes model and 
+# full simulation results for CLICdet
+# described in arXiv:1812.07337 
+#######################################
+
+#######################################
+# Order of execution of various modules
+#######################################
+
+set ExecutionPath {
+    ParticlePropagator
+
+    ChargedHadronTrackingEfficiency
+    ElectronTrackingEfficiency
+    MuonTrackingEfficiency
+
+    ChargedHadronMomentumSmearing
+    ElectronMomentumSmearing
+    MuonMomentumSmearing
+
+    TrackMerger
+    
+    ECal
+    HCal
+
+    LumiCalF
+    LumiCalR
+
+    BeamCalF
+    BeamCalR
+
+    Calorimeter
+    EFlowMerger
+
+    LumiTowers
+    BCalTowers
+
+    LumiMerger
+    BCalMerger
+    
+    LumiEfficiency
+    BCalEfficiency
+    
+    PhotonEfficiency
+    PhotonIsolation
+
+    ElectronFilter
+    ElectronEfficiency
+    ElectronIsolation
+
+    ChargedHadronFilter
+
+    MuonEfficiency
+    MuonIsolation
+
+    EFlowFilter
+    
+    NeutrinoFilter
+    GenJetFinder
+    FastJetFinderKt
+    FastJetFinderVLC_R05_N2
+    FastJetFinderVLC_R05_N3
+    FastJetFinderVLC_R05_N4
+    FastJetFinderVLC_R05_N5
+    FastJetFinderVLC_R05_N6
+    FastJetFinderVLC_R07_N2
+    FastJetFinderVLC_R07_N3
+    FastJetFinderVLC_R07_N4
+    FastJetFinderVLC_R07_N5
+    FastJetFinderVLC_R07_N6
+    FastJetFinderVLC_R10_N2
+    FastJetFinderVLC_R10_N3
+    FastJetFinderVLC_R10_N4
+    FastJetFinderVLC_R10_N5
+    FastJetFinderVLC_R10_N6
+    FastJetFinderVLC_R12_N2
+    FastJetFinderVLC_R12_N3
+    FastJetFinderVLC_R12_N4
+    FastJetFinderVLC_R12_N5
+    FastJetFinderVLC_R12_N6
+    FastJetFinderVLC_R15_N2
+    FastJetFinderVLC_R15_N3
+    FastJetFinderVLC_R15_N4
+    FastJetFinderVLC_R15_N5
+    FastJetFinderVLC_R15_N6
+
+    FastJetFinderVLC_R05_inclusive
+    FastJetFinderVLC_R07_inclusive
+    FastJetFinderVLC_R10_inclusive
+    FastJetFinderVLC_R12_inclusive
+    FastJetFinderVLC_R15_inclusive
+
+    
+    MissingET
+    GenMissingET
+
+    
+    JetMomentumSmearing_VLCR05N2                                                                 
+    JetMomentumSmearing_VLCR05N3                                                                 
+    JetMomentumSmearing_VLCR05N4                                                                 
+    JetMomentumSmearing_VLCR05N5
+    JetMomentumSmearing_VLCR05N6
+    JetMomentumSmearing_VLCR05_inclusive
+    JetMomentumSmearing_VLCR07N2
+    JetMomentumSmearing_VLCR07N3
+    JetMomentumSmearing_VLCR07N4
+    JetMomentumSmearing_VLCR07N5
+    JetMomentumSmearing_VLCR07N6
+    JetMomentumSmearing_VLCR07_inclusive
+    JetMomentumSmearing_VLCR10N2
+    JetMomentumSmearing_VLCR10N3
+    JetMomentumSmearing_VLCR10N4
+    JetMomentumSmearing_VLCR10N5
+    JetMomentumSmearing_VLCR10N6
+    JetMomentumSmearing_VLCR10_inclusive
+    JetMomentumSmearing_VLCR12N2
+    JetMomentumSmearing_VLCR12N3
+    JetMomentumSmearing_VLCR12N4
+    JetMomentumSmearing_VLCR12N5
+    JetMomentumSmearing_VLCR12N6
+    JetMomentumSmearing_VLCR12_inclusive
+    JetMomentumSmearing_VLCR15N2
+    JetMomentumSmearing_VLCR15N3
+    JetMomentumSmearing_VLCR15N4
+    JetMomentumSmearing_VLCR15N5
+    JetMomentumSmearing_VLCR15N6
+    JetMomentumSmearing_VLCR15_inclusive
+
+
+       
+
+    JetFlavorAssociation_R05N2
+    JetFlavorAssociation_R05N3
+    JetFlavorAssociation_R05N4
+    JetFlavorAssociation_R05N5
+    JetFlavorAssociation_R05N6
+    
+    JetFlavorAssociation_R07N2
+    JetFlavorAssociation_R07N3
+    JetFlavorAssociation_R07N4
+    JetFlavorAssociation_R07N5
+    JetFlavorAssociation_R07N6
+
+    JetFlavorAssociation_R10N2
+    JetFlavorAssociation_R10N3
+    JetFlavorAssociation_R10N4
+    JetFlavorAssociation_R10N5
+    JetFlavorAssociation_R10N6
+
+    JetFlavorAssociation_R12N2
+    JetFlavorAssociation_R12N3
+    JetFlavorAssociation_R12N4
+    JetFlavorAssociation_R12N5
+    JetFlavorAssociation_R12N6
+
+    JetFlavorAssociation_R15N2
+    JetFlavorAssociation_R15N3
+    JetFlavorAssociation_R15N4
+    JetFlavorAssociation_R15N5
+    JetFlavorAssociation_R15N6
+
+    JetFlavorAssociation_R05_inclusive
+    JetFlavorAssociation_R07_inclusive
+    JetFlavorAssociation_R10_inclusive
+    JetFlavorAssociation_R12_inclusive
+    JetFlavorAssociation_R15_inclusive
+
+    JetFlavorAssociation_JER_R05N2
+    JetFlavorAssociation_JER_R05N3
+    JetFlavorAssociation_JER_R05N4
+    JetFlavorAssociation_JER_R05N5
+    JetFlavorAssociation_JER_R05N6
+    
+    JetFlavorAssociation_JER_R07N2
+    JetFlavorAssociation_JER_R07N3
+    JetFlavorAssociation_JER_R07N4
+    JetFlavorAssociation_JER_R07N5
+    JetFlavorAssociation_JER_R07N6
+    
+    JetFlavorAssociation_JER_R10N2
+    JetFlavorAssociation_JER_R10N3
+    JetFlavorAssociation_JER_R10N4
+    JetFlavorAssociation_JER_R10N5
+    JetFlavorAssociation_JER_R10N6
+    
+    JetFlavorAssociation_JER_R12N2
+    JetFlavorAssociation_JER_R12N3
+    JetFlavorAssociation_JER_R12N4
+    JetFlavorAssociation_JER_R12N5
+    JetFlavorAssociation_JER_R12N6
+    
+    JetFlavorAssociation_JER_R15N2
+    JetFlavorAssociation_JER_R15N3
+    JetFlavorAssociation_JER_R15N4
+    JetFlavorAssociation_JER_R15N5
+    JetFlavorAssociation_JER_R15N6
+    
+    JetFlavorAssociation_JER_R05_inclusive
+    JetFlavorAssociation_JER_R07_inclusive
+    JetFlavorAssociation_JER_R10_inclusive
+    JetFlavorAssociation_JER_R12_inclusive
+    JetFlavorAssociation_JER_R15_inclusive
+    
+    BTaggingWP50_R05N2
+    BTaggingWP70_R05N2
+    BTaggingWP90_R05N2
+    BTaggingWP50_R05N3
+    BTaggingWP70_R05N3
+    BTaggingWP90_R05N3
+    BTaggingWP50_R05N4
+    BTaggingWP70_R05N4
+    BTaggingWP90_R05N4
+    BTaggingWP50_R05N5
+    BTaggingWP70_R05N5
+    BTaggingWP90_R05N5
+    BTaggingWP50_R05N6
+    BTaggingWP70_R05N6
+    BTaggingWP90_R05N6
+    BTaggingWP50_R07N2
+    BTaggingWP70_R07N2
+    BTaggingWP90_R07N2
+    BTaggingWP50_R07N3
+    BTaggingWP70_R07N3
+    BTaggingWP90_R07N3
+    BTaggingWP50_R07N4
+    BTaggingWP70_R07N4
+    BTaggingWP90_R07N4
+    BTaggingWP50_R07N5
+    BTaggingWP70_R07N5
+    BTaggingWP90_R07N5
+    BTaggingWP50_R07N6
+    BTaggingWP70_R07N6
+    BTaggingWP90_R07N6
+    BTaggingWP50_R10N2
+    BTaggingWP70_R10N2
+    BTaggingWP90_R10N2
+    BTaggingWP50_R10N3
+    BTaggingWP70_R10N3
+    BTaggingWP90_R10N3
+    BTaggingWP50_R10N4
+    BTaggingWP70_R10N4
+    BTaggingWP90_R10N4
+    BTaggingWP50_R10N5
+    BTaggingWP70_R10N5
+    BTaggingWP90_R10N5
+    BTaggingWP50_R10N6
+    BTaggingWP70_R10N6
+    BTaggingWP90_R10N6
+    BTaggingWP50_R12N2
+    BTaggingWP70_R12N2
+    BTaggingWP90_R12N2
+    BTaggingWP50_R12N3
+    BTaggingWP70_R12N3
+    BTaggingWP90_R12N3
+    BTaggingWP50_R12N4
+    BTaggingWP70_R12N4
+    BTaggingWP90_R12N4
+    BTaggingWP50_R12N5
+    BTaggingWP70_R12N5
+    BTaggingWP90_R12N5
+    BTaggingWP50_R12N6
+    BTaggingWP70_R12N6
+    BTaggingWP90_R12N6
+    BTaggingWP50_R15N2
+    BTaggingWP70_R15N2
+    BTaggingWP90_R15N2
+    BTaggingWP50_R15N3
+    BTaggingWP70_R15N3
+    BTaggingWP90_R15N3
+    BTaggingWP50_R15N4
+    BTaggingWP70_R15N4
+    BTaggingWP90_R15N4
+    BTaggingWP50_R15N5
+    BTaggingWP70_R15N5
+    BTaggingWP90_R15N5
+    BTaggingWP50_R15N6
+    BTaggingWP70_R15N6
+    BTaggingWP90_R15N6
+    BTaggingWP50_R05_inclusive
+    BTaggingWP70_R05_inclusive
+    BTaggingWP90_R05_inclusive
+    BTaggingWP50_R07_inclusive
+    BTaggingWP70_R07_inclusive
+    BTaggingWP90_R07_inclusive
+    BTaggingWP50_R10_inclusive
+    BTaggingWP70_R10_inclusive
+    BTaggingWP90_R10_inclusive
+    BTaggingWP50_R12_inclusive
+    BTaggingWP70_R12_inclusive
+    BTaggingWP90_R12_inclusive
+    BTaggingWP50_R15_inclusive
+    BTaggingWP70_R15_inclusive
+    BTaggingWP90_R15_inclusive
+
+    BTagging_JER_WP50_R05N2
+    BTagging_JER_WP70_R05N2
+    BTagging_JER_WP90_R05N2
+    BTagging_JER_WP50_R05N3
+    BTagging_JER_WP70_R05N3
+    BTagging_JER_WP90_R05N3
+    BTagging_JER_WP50_R05N4
+    BTagging_JER_WP70_R05N4
+    BTagging_JER_WP90_R05N4
+    BTagging_JER_WP50_R05N5
+    BTagging_JER_WP70_R05N5
+    BTagging_JER_WP90_R05N5
+    BTagging_JER_WP50_R05N6
+    BTagging_JER_WP70_R05N6
+    BTagging_JER_WP90_R05N6
+    BTagging_JER_WP50_R07N2
+    BTagging_JER_WP70_R07N2
+    BTagging_JER_WP90_R07N2
+    BTagging_JER_WP50_R07N3
+    BTagging_JER_WP70_R07N3
+    BTagging_JER_WP90_R07N3
+    BTagging_JER_WP50_R07N4
+    BTagging_JER_WP70_R07N4
+    BTagging_JER_WP90_R07N4
+    BTagging_JER_WP50_R07N5
+    BTagging_JER_WP70_R07N5
+    BTagging_JER_WP90_R07N5
+    BTagging_JER_WP50_R07N6
+    BTagging_JER_WP70_R07N6
+    BTagging_JER_WP90_R07N6
+    BTagging_JER_WP50_R10N2
+    BTagging_JER_WP70_R10N2
+    BTagging_JER_WP90_R10N2
+    BTagging_JER_WP50_R10N3
+    BTagging_JER_WP70_R10N3
+    BTagging_JER_WP90_R10N3
+    BTagging_JER_WP50_R10N4
+    BTagging_JER_WP70_R10N4
+    BTagging_JER_WP90_R10N4
+    BTagging_JER_WP50_R10N5
+    BTagging_JER_WP70_R10N5
+    BTagging_JER_WP90_R10N5
+    BTagging_JER_WP50_R10N6
+    BTagging_JER_WP70_R10N6
+    BTagging_JER_WP90_R10N6
+    BTagging_JER_WP50_R12N2
+    BTagging_JER_WP70_R12N2
+    BTagging_JER_WP90_R12N2
+    BTagging_JER_WP50_R12N3
+    BTagging_JER_WP70_R12N3
+    BTagging_JER_WP90_R12N3
+    BTagging_JER_WP50_R12N4
+    BTagging_JER_WP70_R12N4
+    BTagging_JER_WP90_R12N4
+    BTagging_JER_WP50_R12N5
+    BTagging_JER_WP70_R12N5
+    BTagging_JER_WP90_R12N5
+    BTagging_JER_WP50_R12N6
+    BTagging_JER_WP70_R12N6
+    BTagging_JER_WP90_R12N6
+    BTagging_JER_WP50_R15N2
+    BTagging_JER_WP70_R15N2
+    BTagging_JER_WP90_R15N2
+    BTagging_JER_WP50_R15N3
+    BTagging_JER_WP70_R15N3
+    BTagging_JER_WP90_R15N3
+    BTagging_JER_WP50_R15N4
+    BTagging_JER_WP70_R15N4
+    BTagging_JER_WP90_R15N4
+    BTagging_JER_WP50_R15N5
+    BTagging_JER_WP70_R15N5
+    BTagging_JER_WP90_R15N5
+    BTagging_JER_WP50_R15N6
+    BTagging_JER_WP70_R15N6
+    BTagging_JER_WP90_R15N6
+    BTagging_JER_WP50_R05_inclusive
+    BTagging_JER_WP70_R05_inclusive
+    BTagging_JER_WP90_R05_inclusive
+    BTagging_JER_WP50_R07_inclusive
+    BTagging_JER_WP70_R07_inclusive
+    BTagging_JER_WP90_R07_inclusive
+    BTagging_JER_WP50_R10_inclusive
+    BTagging_JER_WP70_R10_inclusive
+    BTagging_JER_WP90_R10_inclusive
+    BTagging_JER_WP50_R12_inclusive
+    BTagging_JER_WP70_R12_inclusive
+    BTagging_JER_WP90_R12_inclusive
+    BTagging_JER_WP50_R15_inclusive
+    BTagging_JER_WP70_R15_inclusive
+    BTagging_JER_WP90_R15_inclusive
+     
+    TauTagging_R05N2
+    TauTagging_R05N3
+    TauTagging_R05N4
+    TauTagging_R05N5
+    TauTagging_R05N6
+    TauTagging_R07N2
+    TauTagging_R07N3
+    TauTagging_R07N4
+    TauTagging_R07N5
+    TauTagging_R07N6
+    TauTagging_R10N2
+    TauTagging_R10N3
+    TauTagging_R10N4
+    TauTagging_R10N5
+    TauTagging_R10N6
+    TauTagging_R12N2
+    TauTagging_R12N3
+    TauTagging_R12N4
+    TauTagging_R12N5
+    TauTagging_R12N6
+    TauTagging_R15N2
+    TauTagging_R15N3
+    TauTagging_R15N4
+    TauTagging_R15N5
+    TauTagging_R15N6
+    TauTagging_R05_inclusive
+    TauTagging_R07_inclusive
+    TauTagging_R10_inclusive
+    TauTagging_R12_inclusive
+    TauTagging_R15_inclusive
+
+    TauTagging_JER_R05N2
+    TauTagging_JER_R05N3
+    TauTagging_JER_R05N4
+    TauTagging_JER_R05N5
+    TauTagging_JER_R05N6
+    TauTagging_JER_R07N2
+    TauTagging_JER_R07N3
+    TauTagging_JER_R07N4
+    TauTagging_JER_R07N5
+    TauTagging_JER_R07N6
+    TauTagging_JER_R10N2
+    TauTagging_JER_R10N3
+    TauTagging_JER_R10N4
+    TauTagging_JER_R10N5
+    TauTagging_JER_R10N6
+    TauTagging_JER_R12N2
+    TauTagging_JER_R12N3
+    TauTagging_JER_R12N4
+    TauTagging_JER_R12N5
+    TauTagging_JER_R12N6
+    TauTagging_JER_R15N2
+    TauTagging_JER_R15N3
+    TauTagging_JER_R15N4
+    TauTagging_JER_R15N5
+    TauTagging_JER_R15N6
+    TauTagging_JER_R05_inclusive
+    TauTagging_JER_R07_inclusive
+    TauTagging_JER_R10_inclusive
+    TauTagging_JER_R12_inclusive
+    TauTagging_JER_R15_inclusive
+
+
+    ScalarHT
+
+
+    TreeWriter
+}
+
+#################################
+# Propagate particles in cylinder
+#################################
+
+module ParticlePropagator ParticlePropagator {
+    set InputArray Delphes/stableParticles
+
+    set OutputArray stableParticles
+    set ChargedHadronOutputArray chargedHadrons
+    set ElectronOutputArray electrons
+    set MuonOutputArray muons
+
+    # radius of the magnetic field coverage in the calorimeter, in m
+    set Radius 1.5
+    # half-length of the magnetic field coverage in the calorimeter, in m
+    set HalfLength 2.31
+
+    # magnetic field, in T
+    set Bz 4.0
+}
+
+####################################
+# Charged hadron tracking efficiency
+####################################
+
+module Efficiency ChargedHadronTrackingEfficiency {
+    set InputArray ParticlePropagator/chargedHadrons
+    set OutputArray chargedHadrons
+    # Current full simulation with CLICdet provides for pions:
+
+    set EfficiencyFormula {
+ (pt <= 0.1)                                                                        * (0.000) +
+ (pt > 0.1)                                * (abs(eta) > 2.54)                      * (0.000) +
+ (pt > 0.1) * (energy >= 80)               * (abs(eta) < 2.54)                      * (1.000) +
+ (pt > 0.1) * (energy < 80 && energy >= 3) * (abs(eta) <=2.54 && abs(eta) > 2.34)   * (0.994) +
+ (pt > 0.1) * (energy < 80 && energy >= 3) * (abs(eta) <= 2.34)                     * (1.000) +
+ (pt > 0.1) * (energy < 3)                 * (abs(eta) <= 2.54 && abs(eta) > 0.55 ) * (0.990) +
+ (pt > 0.1) * (energy < 3)                 * (abs(eta) <= 0.55 )                    * (1.000) 
+    }
+}
+
+##############################
+# Electron tracking efficiency
+##############################
+
+module Efficiency ElectronTrackingEfficiency {
+    set InputArray ParticlePropagator/electrons
+    set OutputArray electrons
+
+
+    # Current full simulation with CLICdet provides for electrons:
+    set EfficiencyFormula {
+ (pt <= 0.1)                                                                        * (0.000) +
+ (pt > 0.1)                                * (abs(eta) > 2.54)                      * (0.000) +
+ (pt > 0.1) * (energy >= 80)               * (abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (0.993) +
+ (pt > 0.1) * (energy >= 80)               * (abs(eta) <= 2.44 && abs(eta) > 2.34 ) * (0.997) +
+ (pt > 0.1) * (energy >= 80)               * (abs(eta) <= 2.34  )                   * (1.000) +
+ (pt > 0.1) * (energy < 80 && energy >= 5) * (abs(eta) <= 2.54 && abs(eta) > 2.17 ) * (0.998) +
+ (pt > 0.1) * (energy < 80 && energy >= 5) * (abs(eta) <= 2.17)                     * (1.000) +
+ (pt > 0.1) * (energy < 5)                 * (abs(eta) <= 2.54 && abs(eta) > 2.34 ) * (1.000) +
+ (pt > 0.1) * (energy < 5)                 * (abs(eta) <= 2.34 && abs(eta) > 0.76 ) * (0.997) +
+ (pt > 0.1) * (energy < 5)                 * (abs(eta) <= 0.76)                     * (0.999)
+    }
+}
+
+##########################
+# Muon tracking efficiency
+##########################
+
+module Efficiency MuonTrackingEfficiency {
+    set InputArray ParticlePropagator/muons
+    set OutputArray muons
+
+    # Current full simulation with CLICdet provides for muons:
+    set EfficiencyFormula {
+  (pt <= 0.1)                                                                          * (0.000) +
+  (pt > 0.1) * (abs(eta) > 2.54)                                                       * (0.000) +
+  (pt > 0.1) * (abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (energy >= 80)                 * (0.994) +
+  (pt > 0.1) * (abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (energy >= 5 && energy < 80)   * (0.996) +
+  (pt > 0.1) * (abs(eta) <= 2.54 && abs(eta) > 2.44 ) * (energy < 5 )                  * (0.996) +
+  (pt > 0.1) * (abs(eta) <= 2.44 )                    * (energy >= 5 )                 * (1.000) +
+  (pt > 0.1) * (abs(eta) <= 2.44 && abs(eta) > 2.25 ) * (energy < 5 )                  * (0.999) +
+  (pt > 0.1) * (abs(eta) <= 2.25 )                    * (energy < 5 )                  * (1.000) 
+    }
+}
+
+########################################
+# Momentum resolution for charged tracks
+########################################
+
+module MomentumSmearing ChargedHadronMomentumSmearing {
+    set InputArray ChargedHadronTrackingEfficiency/chargedHadrons
+    set OutputArray chargedHadrons
+
+
+    # Resolution given in dpT/pT.
+    # CLICdet internal studies
+    set ResolutionFormula {
+	(abs(eta) < 2.66 && abs(eta) >= 1.74 ) * 2 * sqrt( 8.56036e-05^2 * pt^2 +0.0148987^2    ) +
+      	(abs(eta) < 1.74 && abs(eta) >= 1.32 ) * 1.5 * sqrt( 8.56036e-05^2 * pt^2 +0.0148987^2    ) +
+	(abs(eta) < 1.32 && abs(eta) >= 0.76 ) * sqrt( 1.12382e-05^2 * pt^2 +0.00391722^2   ) +
+	(abs(eta) < 0.76 && abs(eta) >= 0.36 ) * sqrt( 1.16768e-05^2 * pt^2 +0.00255204^2    ) +
+	(abs(eta) < 0.36 && abs(eta) >= 0.18 ) * sqrt( 1.28327e-05^2 * pt^2 +0.00220587^2   ) +
+	(abs(eta) < 0.18)                      * sqrt( 1.32845e-05^2 * pt^2 +0.00209325^2   )
+	
+    }
+}
+
+###################################
+# Momentum resolution for electrons
+###################################
+
+module MomentumSmearing ElectronMomentumSmearing {
+    set InputArray ElectronTrackingEfficiency/electrons
+    set OutputArray electrons
+
+    # Resolution given in dpT/pT.
+    # CLICdet internal studies
+    set ResolutionFormula {
+	(abs(eta) < 2.66 && abs(eta) >= 1.74 ) * 2 * sqrt( 8.62283e-05^2 * pt^2  + 0.0177556^2   ) +
+	(abs(eta) < 1.74 && abs(eta) >= 1.32 ) * 1.5 * sqrt( 8.62283e-05^2 * pt^2  + 0.0177556^2   ) +
+	(abs(eta) < 1.32 && abs(eta) >= 0.76 ) * sqrt( 1.0915e-05 ^2 * pt^2  + 0.00663766^2  ) +
+	(abs(eta) < 0.76 && abs(eta) >= 0.36 ) * sqrt( 1.15518e-05^2 * pt^2  + 0.00398644^2  ) +
+	(abs(eta) < 0.36 && abs(eta) >= 0.18 ) * sqrt( 1.3307e-05 ^2 * pt^2  + 0.00317807^2  ) +
+	(abs(eta) < 0.18)                      * sqrt( 1.40722e-05^2 * pt^2 + 0.00292138^2  )
+
+    }
+}
+
+###############################
+# Momentum resolution for muons
+###############################
+
+module MomentumSmearing MuonMomentumSmearing {
+    set InputArray MuonTrackingEfficiency/muons
+    set OutputArray muons
+
+    # Resolution given in dpT/pT.
+
+    # CLICdet internal studies
+    set ResolutionFormula {
+
+	(abs(eta) < 2.66 && abs(eta) >= 1.74 ) 	 * 2 * sqrt(4.57439e-05^2 * pt^2   + 0.0149328^2	   ) +
+	(abs(eta) < 1.74 && abs(eta) >= 1.32 )   * 1.5 * sqrt(4.57439e-05^2 * pt^2   + 0.0149328^2	   ) +
+	(abs(eta) < 1.32 && abs(eta) >= 0.76 )	 * sqrt(9.81626e-06^2 * pt^2   + 0.00379895^2  ) +
+	(abs(eta) < 0.76 && abs(eta) >= 0.36 )	 * sqrt(1.1959e-05^2 * pt^2   +  0.00242417^2 ) +
+	(abs(eta) < 0.36 && abs(eta) >= 0.18 )	 * sqrt(1.20149e-05^2 * pt^2  + 0.00219291^2  ) +
+	(abs(eta) < 0.18)                     	 * sqrt(1.29686e-05^2 * pt^2  + 0.0020392^2      ) 
+
+    }
+}
+
+##############
+# Track merger
+##############
+
+module Merger TrackMerger {
+    # add InputArray InputArray
+    add InputArray ChargedHadronMomentumSmearing/chargedHadrons
+    add InputArray ElectronMomentumSmearing/electrons
+    add InputArray MuonMomentumSmearing/muons
+    set OutputArray tracks
+}
+
+#############
+#   ECAL
+#############
+
+module SimpleCalorimeter ECal {
+    set ParticleInputArray ParticlePropagator/stableParticles
+    set TrackInputArray TrackMerger/tracks
+
+    set TowerOutputArray ecalTowers
+    set EFlowTrackOutputArray eflowTracks
+    set EFlowTowerOutputArray eflowPhotons
+
+    set IsEcal true 
+    
+    set EnergyMin 0.5
+    set EnergySignificanceMin 1.0
+
+    set SmearTowerCenter true
+
+    set pi [expr {acos(-1)}]
+
+    # lists of the edges of each tower in eta and phi
+    # each list starts with the lower edge of the first tower
+    # the list ends with the higher edged of the last tower
+
+    #ECAL barrel: dphi = 0.2 degree, deta=0.003 towers up to |eta| <=1.2
+    #ECAL endcaps: dphi = 0.8 degree, deta=0.02 towers up to |eta| <=2.5
+    #ECAL plug: dphi = 1 degree, deta = 0.02 up to |eta| <=3
+    #ECAL cell sizes always 5x5 mm^2
+
+    #barrel:
+    #dphi = 0.2 degree towers up to eta <=1.2
+    set PhiBins {}
+    for {set i -900} {$i <= 900} {incr i} {
+	add PhiBins [expr {$i * $pi/900.0 }]
+    }
+    # 0.003 unit (5x5 mm^2) in eta up to eta <=1.2
+    for {set i -400} {$i <=400} {incr i} {
+	set eta [expr {$i * 0.003}]
+	add EtaPhiBins $eta $PhiBins
+    }
+
+    #endcaps:
+    #dphi = 0.8 degree towers for 1.2 < eta <=2.5
+    set PhiBins {}
+    for {set i -225} {$i <= 225} {incr i} {
+	add PhiBins [expr {$i * $pi/225.}]
+    }
+    #deta=0.02 units for 1.2 < |eta| <=2.5
+    #first, from -2.5 to -1.2, there will be (1.3/0.02=)65 segments
+    for {set i 1} {$i <=66} {incr i} {
+	set eta [expr {-2.52 + $i * 0.02}]
+	add EtaPhiBins $eta $PhiBins
+    }
+    #same for 1.2 to 2.5
+    for  {set i 1} {$i <=66} {incr i} {
+	set eta [expr {1.18 + $i*0.02}]
+	add EtaPhiBins $eta $PhiBins
+    }
+    
+    #plug: 
+    #dphi = 1 degree for 2.5 < eta <=3
+    set PhiBins {}
+    for {set i -180} {$i <= 180} {incr i} {
+	add PhiBins [expr {$i * $pi/180.}]
+    }
+    # deta = 0.02 for 2.5 < |eta| <=3
+    # from -3 to -2.5, there will be 25 segments
+    for {set i 1} {$i <= 26} {incr i} {
+	set eta [expr {-3.02 + $i * 0.02}]
+	add EtaPhiBins $eta $PhiBins
+    }
+    #same for 2.5 to 3
+    for {set i 1} {$i <= 26} {incr i} {
+	set eta [expr {2.48 + $i*0.02}]
+	add EtaPhiBins $eta $PhiBins
+    }
+    
+
+
+    # default energy fractions {abs(PDG code)} {fraction of energy deposited in ECAL}
+
+    add EnergyFraction {0} {0.0}
+    # energy fractions for e, gamma and pi0
+    add EnergyFraction {11} {1.0}
+    add EnergyFraction {22} {1.0}
+    add EnergyFraction {111} {1.0}
+    # energy fractions for muon, neutrinos and neutralinos
+    add EnergyFraction {12} {0.0}
+    add EnergyFraction {13} {0.0}
+    add EnergyFraction {14} {0.0}
+    add EnergyFraction {16} {0.0}
+    add EnergyFraction {1000022} {0.0}
+    add EnergyFraction {1000023} {0.0}
+    add EnergyFraction {1000025} {0.0}
+    add EnergyFraction {1000035} {0.0}
+    add EnergyFraction {1000045} {0.0}
+    # energy fractions for K0short and Lambda
+    add EnergyFraction {310} {0.3}
+    add EnergyFraction {3122} {0.3}
+
+    # set ECalResolutionFormula {resolution formula as a function of eta and energy}
+    set ResolutionFormula {
+	(abs(eta) <= 0.78 )  * sqrt(energy^2*0.01^2 + energy*0.156^2)+
+	(abs(eta) > 0.78 && abs(eta) <=0.83 ) * sqrt( energy^0.01^2 + energy*0.175^2  ) +
+	(abs(eta) <= 3 && abs(eta) > 0.83) * sqrt( energy^2*0.01^2 + energy*0.151^2  )}
+}    
+
+#############
+#   HCAL
+#############
+
+module SimpleCalorimeter HCal {
+    set ParticleInputArray ParticlePropagator/stableParticles
+    set TrackInputArray ECal/eflowTracks
+
+    set TowerOutputArray hcalTowers
+    set EFlowTrackOutputArray eflowTracks
+    set EFlowTowerOutputArray eflowNeutralHadrons
+
+    set IsEcal false 
+    
+    set EnergyMin 1.0
+    set EnergySignificanceMin 1.0
+
+    set SmearTowerCenter true
+
+    set pi [expr {acos(-1)}]
+
+    # lists of the edges of each tower in eta and phi
+    # each list starts with the lower edge of the first tower
+    # the list ends with the higher edged of the last tower
+
+    
+    #HCAL barrel: dphi = 1 degree, deta= 0.02 towers up to |eta| <=0.8
+    #HCAL ring: dphi = 1 degree, deta= 0.02 towers up to |eta| <=0.9
+    #HCAL endcaps: dphi = 6 degree, deta = 0.1  up to |eta| <=3.5
+    #HCAL cell sizes always 30x30 mm^2
+
+    #barrel and ring:
+    #dphi = 1 degree up to |eta| <=0.9
+    set PhiBins {}
+    for {set i -180} {$i <=180} {incr i} {
+	add PhiBins [expr {$i * $pi/180.0}]
+    }
+    #deta= 0.02 towers up to |eta| <=0.9
+    for {set i -45} {$i <=45} {incr i} {
+	set eta [expr {$i * 0.02}]
+	add EtaPhiBins $eta $PhiBins
+    }
+
+    #endcaps:
+    # dphi = 6 degree
+    set PhiBins {}
+    for {set i -30} {$i <=30} {incr i} {
+	add PhiBins [expr {$i * $pi/30.0}]
+    }
+    # deta =0.1 for 0.9 < |eta| <=3.0
+    #for -3.0 to -0.9, 21 segments
+    for {set i 1} {$i <=22} {incr i} {
+	set eta [expr {-3.1 + $i * 0.1}]
+	add EtaPhiBins $eta $PhiBins
+    }
+    #same for 0.9 to 3.0
+    for {set i 1} {$i <=22} {incr i} {
+	set eta [expr {0.8 + $i * 0.1 }]
+	add EtaPhiBins $eta $PhiBins
+    }
+
+    # default energy fractions {abs(PDG code)} {Fecal Fhcal}
+    add EnergyFraction {0} {1.0}
+    # energy fractions for e, gamma and pi0
+    add EnergyFraction {11} {0.0}
+    add EnergyFraction {22} {0.0}
+    add EnergyFraction {111} {0.0}
+    # energy fractions for muon, neutrinos and neutralinos
+    add EnergyFraction {12} {0.0}
+    add EnergyFraction {13} {0.0}
+    add EnergyFraction {14} {0.0}
+    add EnergyFraction {16} {0.0}
+    add EnergyFraction {1000022} {0.0}
+    add EnergyFraction {1000023} {0.0}
+    add EnergyFraction {1000025} {0.0}
+    add EnergyFraction {1000035} {0.0}
+    add EnergyFraction {1000045} {0.0}
+    # energy fractions for K0short and Lambda
+    add EnergyFraction {310} {0.7}
+    add EnergyFraction {3122} {0.7}
+
+    # set HCalResolutionFormula {resolution formula as a function of eta and energy}
+    #CLICdet internal studies
+    set ResolutionFormula {
+	(abs(eta)<= 0.3) * sqrt(1.38^2  + energy*0.308^2  + energy^2*0.050^2) +
+	 (abs(eta)<= 0.78 && abs(eta) > 0.3) * sqrt(1.25^2  + energy*0.322^2  + energy^2*0.048^2) +
+	 (abs(eta)<=1.099 && abs(eta) > 0.78) * sqrt(  1.159^2 + energy*0.341^2 + energy^2*0.049^2 ) +
+	 (abs(eta)<=3 && abs(eta)> 1.099) * sqrt( 1.09^2 + energy*0.319^2 + energy^2*0.052^2  )
+	}
+    
+}
+
+##############
+# LumiCal
+##############
+module SimpleCalorimeter LumiCalF {
+    set ParticleInputArray ParticlePropagator/stableParticles
+    set TrackInputArray TrackMerger/tracks
+    
+    set TowerOutputArray lumicalTowers
+    set EFlowTowerOutputArray lumicalPhotons
+    
+    set IsEcal true 
+    
+    set EnergyMin 2.0
+    set EnergySignificanceMin 1.0
+    
+    set SmearTowerCenter true
+    
+    source CLIC/CLICdet_LumiCalF_Binning.tcl
+    source CLIC/CLICdet_LumiCal_EnergyFractions.tcl
+    source CLIC/CLICdet_LumiCal_Resolution_Stage3.tcl
+}
+
+module SimpleCalorimeter LumiCalR {
+    set ParticleInputArray ParticlePropagator/stableParticles
+    set TrackInputArray TrackMerger/tracks
+    
+    set TowerOutputArray lumicalTowers
+    set EFlowTowerOutputArray lumicalPhotons
+    
+    set IsEcal true 
+    
+    set EnergyMin 2.0
+    set EnergySignificanceMin 1.0
+    
+    set SmearTowerCenter true
+    
+    source CLIC/CLICdet_LumiCalR_Binning.tcl
+    source CLIC/CLICdet_LumiCal_EnergyFractions.tcl
+    source CLIC/CLICdet_LumiCal_Resolution_Stage3.tcl
+}
+
+##############
+# BeamCal
+##############
+module SimpleCalorimeter BeamCalR {
+    set ParticleInputArray ParticlePropagator/stableParticles
+    set TrackInputArray TrackMerger/tracks
+    
+    set TowerOutputArray bcalTowers
+    set EFlowTowerOutputArray bcalPhotons
+    
+    set IsEcal true 
+    
+    set EnergyMin 5.0
+    set EnergySignificanceMin 1.0
+    
+    set SmearTowerCenter true
+    
+    source CLIC/CLICdet_BeamCalR_Binning.tcl
+    source CLIC/CLICdet_BeamCal_EnergyFractions.tcl
+    source CLIC/CLICdet_BeamCal_Resolution_Stage3.tcl
+}
+
+module SimpleCalorimeter BeamCalF {
+    set ParticleInputArray ParticlePropagator/stableParticles
+    set TrackInputArray TrackMerger/tracks
+    
+    set TowerOutputArray bcalTowers
+    set EFlowTowerOutputArray bcalPhotons
+    
+    set IsEcal true 
+    
+    set EnergyMin 5.0
+
+    set EnergySignificanceMin 1.0
+    
+    set SmearTowerCenter true
+    
+    source CLIC/CLICdet_BeamCalF_Binning.tcl
+    source CLIC/CLICdet_BeamCal_EnergyFractions.tcl
+    source CLIC/CLICdet_BeamCal_Resolution_Stage3.tcl
+}
+
+#################
+# Electron filter
+#################
+
+module PdgCodeFilter ElectronFilter {
+    set InputArray HCal/eflowTracks
+    set OutputArray electrons
+    set Invert true
+    add PdgCode {11}
+    add PdgCode {-11}
+}
+
+######################
+# ChargedHadronFilter
+######################
+
+module PdgCodeFilter ChargedHadronFilter {
+    set InputArray HCal/eflowTracks
+    set OutputArray chargedHadrons
+    
+    add PdgCode {11}
+    add PdgCode {-11}
+    add PdgCode {13}
+    add PdgCode {-13}
+}
+
+
+
+###################################################
+# Tower Merger (in case not using e-flow algorithm)
+###################################################
+
+module Merger Calorimeter {
+    # add InputArray InputArray
+    add InputArray ECal/ecalTowers
+    add InputArray HCal/hcalTowers
+    set OutputArray towers
+}
+
+
+###############################
+# LumiCal tower merger
+###############################
+module Merger LumiTowers {
+# add InputArray InputArray
+  add InputArray LumiCalF/lumicalTowers
+  add InputArray LumiCalR/lumicalTowers
+  set OutputArray lumicalTowers
+}
+  
+###############################
+# BeamCal tower merger
+###############################
+module Merger BCalTowers {
+# add InputArray InputArray
+  add InputArray BeamCalF/bcalTowers
+  add InputArray BeamCalR/bcalTowers
+  set OutputArray bcalTowers
+}
+  
+####################
+# Energy flow merger
+####################
+
+module Merger EFlowMerger {
+    # add InputArray InputArray
+    add InputArray HCal/eflowTracks
+    add InputArray ECal/eflowPhotons
+    add InputArray HCal/eflowNeutralHadrons
+    set OutputArray eflow
+}
+
+###############################
+# LumiCal energy flow merger
+###############################
+module Merger LumiMerger {
+# add InputArray InputArray
+  add InputArray LumiCalF/lumicalPhotons
+  add InputArray LumiCalR/lumicalPhotons
+  set OutputArray lumicalPhotons
+}
+  
+###############################
+# BeamCal energy flow merger
+###############################
+module Merger BCalMerger {
+# add InputArray InputArray
+  add InputArray BeamCalF/bcalPhotons
+  add InputArray BeamCalR/bcalPhotons
+  set OutputArray bcalPhotons
+}
+  
+
+###################
+# Photon efficiency
+###################
+
+module Efficiency PhotonEfficiency {
+    set InputArray ECal/eflowPhotons
+    set OutputArray photons
+
+    # set EfficiencyFormula {efficiency formula as a function of eta and pt}
+
+    # efficiency formula for photons
+    # current full simulation of CLICdet yields:
+    set EfficiencyFormula {
+	(energy < 2.0 ) * (0.000) +
+	(energy >= 2.0) * (abs(eta) < 0.7)*(0.94) +
+	(energy >= 2.0) * (abs(eta) >=0.7 && abs(eta) <=3.0) * (0.9)	}
+
+}
+
+
+##################
+# Photon isolation
+##################
+
+module Isolation PhotonIsolation {
+    set CandidateInputArray PhotonEfficiency/photons
+    set IsolationInputArray EFlowMerger/eflow
+
+    set OutputArray photons
+
+    set DeltaRMax 0.1
+
+    set PTMin 0.5
+
+    set PTRatioMax 0.2
+}
+
+##############################
+# LumiCal photon efficiency
+##############################
+module Efficiency LumiEfficiency {
+    set InputArray  LumiMerger/lumicalPhotons
+    set OutputArray lumicalPhotons
+
+    source CLIC/CLICdet_LumiCal_Efficiency_Stage3.tcl
+}
+
+
+##############################
+# BeamCal photon efficiency
+##############################
+module Efficiency BCalEfficiency {
+    set InputArray  BCalMerger/bcalPhotons
+    set OutputArray bcalPhotons
+
+    source CLIC/CLICdet_BeamCal_Efficiency_Stage3.tcl
+}
+
+
+#####################
+# Electron efficiency
+#####################
+
+module Efficiency ElectronEfficiency {
+    set InputArray ElectronFilter/electrons
+    set OutputArray electrons
+
+    # set EfficiencyFormula {efficiency formula as a function of eta and pt}
+
+    set EfficiencyFormula {
+	(energy < 3.0) * ( 0.00 ) +
+	( energy >=3 && energy < 8  ) * (abs(eta) > 1.95)                     * (0.58 ) +
+	( energy >=3 && energy < 8  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * ( 0.7 ) + 	 
+	( energy >=3 && energy < 8  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * ( 0.6 ) +	 
+	( energy >=3 && energy < 8  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * ( 0.7 ) +	 
+	( energy >=3 && energy < 8  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * ( 0.8 ) +	 
+	( energy >=3 && energy < 8  ) * (abs(eta) <= 0.69)                    * (0.84 ) +      
+	( energy >=8 && energy < 13  ) * (abs(eta) > 1.95)                     * (  0.6 ) +
+	( energy >=8 && energy < 13  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * ( 0.76 ) + 	 
+	( energy >=8 && energy < 13  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * ( 0.67 ) +	 
+	( energy >=8 && energy < 13  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * ( 0.78 ) +	 
+	( energy >=8 && energy < 13  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * ( 0.86 ) +	 
+	( energy >=8 && energy < 13  ) * (abs(eta) <= 0.69)                    * ( 0.88 ) +      
+	( energy >=13 && energy < 18  ) * (abs(eta) > 1.95)                     * (  0.6 ) +
+	( energy >=13 && energy < 18  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * (  0.8 ) + 	 
+	( energy >=13 && energy < 18  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * ( 0.68 ) +	 
+	( energy >=13 && energy < 18  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * ( 0.84 ) +	 
+	( energy >=13 && energy < 18  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * ( 0.88 ) +	 
+	( energy >=13 && energy < 18  ) * (abs(eta) <= 0.69)                    * (  0.9 ) +      
+	( energy >=18 && energy < 23  ) * (abs(eta) > 1.95)                     * (0.64 ) +
+	( energy >=18 && energy < 23  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * (0.82 ) + 	 
+	( energy >=18 && energy < 23  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * ( 0.7 ) +	 
+	( energy >=18 && energy < 23  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * (0.84 ) +	 
+	( energy >=18 && energy < 23  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * ( 0.9 ) +	 
+	( energy >=18 && energy < 23  ) * (abs(eta) <= 0.69)                    * (0.92 ) +      
+	( energy >= 23 && energy < 28  ) * (abs(eta) > 1.95)                     * (0.64 ) +
+	( energy >= 23 && energy < 28  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * (0.86 ) + 	 
+	( energy >= 23 && energy < 28  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * (0.74 ) +	 
+	( energy >= 23 && energy < 28  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * (0.87 ) +	 
+	( energy >= 23 && energy < 28  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * (0.91 ) +	 
+	( energy >= 23 && energy < 28  ) * (abs(eta) <= 0.69)                    * (0.94 ) +      
+	( energy >=28 && energy < 35  ) * (abs(eta) > 1.95)                     * (0.67 ) +
+	( energy >=28 && energy < 35  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * (0.88 ) + 	 
+	( energy >=28 && energy < 35  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * (0.78 ) +	 
+	( energy >=28 && energy < 35  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * ( 0.9 ) +	 
+	( energy >=28 && energy < 35  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * (0.94 ) +	 
+	( energy >=28 && energy < 35  ) * (abs(eta) <= 0.69)                    * (0.94 ) +      
+	( energy >=35 && energy < 45  ) * (abs(eta) > 1.95)                     * (0.68 ) +
+	( energy >=35 && energy < 45  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * ( 0.9 ) + 	 
+	( energy >=35 && energy < 45  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * (0.86 ) +	 
+	( energy >=35 && energy < 45  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * (0.92 ) +	 
+	( energy >=35 && energy < 45  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * (0.94 ) +	 
+	( energy >=35 && energy < 45  ) * (abs(eta) <= 0.69)                    * (0.96 ) +      
+	( energy >=45 && energy < 80  ) * (abs(eta) > 1.95)                     * (  0.7 ) +
+	( energy >=45 && energy < 80  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * ( 0.92 ) + 	 
+	( energy >=45 && energy < 80  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * (  0.8 ) +	 
+	( energy >=45 && energy < 80  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * ( 0.94 ) +	 
+	( energy >=45 && energy < 80  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * ( 0.96 ) +	 
+	( energy >=45 && energy < 80  ) * (abs(eta) <= 0.69)                    * ( 0.97 ) +      
+	( energy >=80 && energy < 200  ) * (abs(eta) > 1.95)                     * (0.68 ) +
+	( energy >=80 && energy < 200  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * (0.96 ) + 	 
+	( energy >=80 && energy < 200  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * (0.84 ) +	 
+	( energy >=80 && energy < 200  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * (0.94 ) +	 
+	( energy >=80 && energy < 200  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * (0.98 ) +	 
+	( energy >=80 && energy < 200  ) * (abs(eta) <= 0.69)                    * (0.98 ) +      
+	( energy >=200 && energy < 400  ) * (abs(eta) > 1.95)                     * ( 0.68 ) +
+	( energy >=200 && energy < 400  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * ( 0.97 ) + 	 
+	( energy >=200 && energy < 400  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * ( 0.86 ) +	 
+	( energy >=200 && energy < 400  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * ( 0.96 ) +	 
+	( energy >=200 && energy < 400  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * ( 0.98 ) +	 
+	( energy >=200 && energy < 400  ) * (abs(eta) <= 0.69)                    * ( 0.98 ) +      
+	( energy >=400  ) * (abs(eta) > 1.95)                     * (0.68 ) +
+	( energy >=400  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * (0.96 ) + 	 
+	( energy >=400  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * (0.82 ) +	 
+	( energy >=400  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * (0.96 ) +	 
+	( energy >=400  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * (0.98 ) +	 
+	( energy >=400  ) * (abs(eta) <= 0.69)                    * (0.98 )       
+    }
+}
+
+####################
+# Electron isolation
+####################
+
+module Isolation ElectronIsolation {
+    set CandidateInputArray ElectronEfficiency/electrons
+    set IsolationInputArray EFlowMerger/eflow
+
+    set OutputArray electrons
+
+    set DeltaRMax 0.1
+
+    set PTMin 0.5
+
+    set PTRatioMax 0.2
+}
+
+#################
+# Muon efficiency
+#################
+
+module Efficiency MuonEfficiency {
+    set InputArray MuonMomentumSmearing/muons
+    set OutputArray muons
+
+    # set EfficiencyFormula {efficiency as a function of eta and pt}
+
+    # efficiency formula for muons
+    # current full simulation of CLICdet yields:
+
+
+
+    set EfficiencyFormula {
+	(energy < 2.0 )     * (0.00) +
+	(energy>=2.0)        * (0.999)
+    }
+}
+
+################
+# Muon isolation
+################
+
+module Isolation MuonIsolation {
+    set CandidateInputArray MuonEfficiency/muons
+    set IsolationInputArray EFlowMerger/eflow
+
+    set OutputArray muons
+
+    set DeltaRMax 0.1
+
+    set PTMin 0.5
+
+    set PTRatioMax 0.2
+}
+
+
+
+###################
+# Missing ET merger
+###################
+
+module Merger MissingET {
+    # add InputArray InputArray
+    add InputArray EFlowMerger/eflow
+    set MomentumOutputArray momentum
+}
+
+
+##################
+# Scalar HT merger
+##################
+
+module Merger ScalarHT {
+    # add InputArray InputArray
+    add InputArray EFlowMerger/eflow
+    set EnergyOutputArray energy
+}
+######################
+# EFlowFilter (UniqueObjectFinder)
+######################
+module UniqueObjectFinder EFlowFilter {
+    add InputArray PhotonIsolation/photons photons
+    add InputArray ElectronIsolation/electrons electrons
+    add InputArray MuonIsolation/muons muons
+    add InputArray EFlowMerger/eflow eflow
+}
+
+#################
+# Neutrino Filter
+#################
+
+module PdgCodeFilter NeutrinoFilter {
+
+    set InputArray Delphes/stableParticles
+    set OutputArray filteredParticles
+
+    set PTMin 0.0
+
+    add PdgCode {12}
+    add PdgCode {14}
+    add PdgCode {16}
+    add PdgCode {-12}
+    add PdgCode {-14}
+    add PdgCode {-16}
+
+}
+
+
+#####################
+# MC truth jet finder
+#####################
+
+module FastJetFinder GenJetFinder {
+    set InputArray NeutrinoFilter/filteredParticles
+
+    set OutputArray jets
+
+    # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt, 7 anti-kt with winner-take-all axis (for N-subjettiness), 8 N-jettiness, 9 Valencia
+    set JetAlgorithm 9
+    set ParameterR 0.5
+
+    set JetPTMin 20.0
+}
+
+#########################
+# Gen Missing ET merger
+########################
+
+module Merger GenMissingET {
+    # add InputArray InputArray
+    add InputArray NeutrinoFilter/filteredParticles
+    set MomentumOutputArray momentum
+}
+
+
+
+############
+# Jet finder
+############
+
+module FastJetFinder FastJetFinderKt {
+    #  set InputArray Calorimeter/towers
+    set InputArray EFlowFilter/eflow
+
+    set OutputArray KTjets
+
+    # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt, 7 anti-kt with winner-take-all axis (for N-subjettiness), 8 N-jettiness, 9 Valencia
+    set JetAlgorithm 4
+    set ParameterR 0.5
+
+    set JetPTMin 20.0
+}
+
+################
+# Jet finder VLC
+################
+
+
+source CLIC/CLICdet_JetReco.tcl
+
+
+#########################################
+# Jet Momentum Smearing to mimick overlay
+#########################################
+
+
+source CLIC/CLICdet_JetSmearing.tcl
+
+
+
+########################
+# Jet Flavor Association
+########################
+
+source  CLIC/CLICdet_JetFlavorAssociation.tcl
+source  CLIC/CLICdet_JetFlavorAssociation_JER.tcl
+
+###########
+# b-tagging
+###########
+# based on CLICdp-Note-2014-002    
+
+source  CLIC/CLICdet_BTagging.tcl
+source  CLIC/CLICdet_BTagging_JER.tcl
+
+
+#############
+# tau-tagging
+#############
+# based on LCD-2010-009
+
+source CLIC/CLICdet_TauTagging.tcl
+source CLIC/CLICdet_TauTagging_JER.tcl
+
+
+
+##################
+# ROOT tree writer
+##################
+
+module TreeWriter TreeWriter {
+    # add Branch InputArray BranchName BranchClass
+    add Branch Delphes/allParticles Particle GenParticle
+    
+    add Branch GenJetFinder/jets GenJet Jet
+
+    add Branch FastJetFinderKt/KTjets KTjet Jet
+    add Branch FastJetFinderVLC_R05_N2/VLCjetsR05N2 VLCjetR05N2 Jet
+    add Branch FastJetFinderVLC_R05_N3/VLCjetsR05N3 VLCjetR05N3 Jet
+    add Branch FastJetFinderVLC_R05_N4/VLCjetsR05N4 VLCjetR05N4 Jet
+    add Branch FastJetFinderVLC_R05_N5/VLCjetsR05N5 VLCjetR05N5 Jet
+    add Branch FastJetFinderVLC_R05_N6/VLCjetsR05N6 VLCjetR05N6 Jet
+
+    add Branch FastJetFinderVLC_R07_N2/VLCjetsR07N2 VLCjetR07N2 Jet
+    add Branch FastJetFinderVLC_R07_N3/VLCjetsR07N3 VLCjetR07N3 Jet
+    add Branch FastJetFinderVLC_R07_N4/VLCjetsR07N4 VLCjetR07N4 Jet
+    add Branch FastJetFinderVLC_R07_N5/VLCjetsR07N5 VLCjetR07N5 Jet
+    add Branch FastJetFinderVLC_R07_N6/VLCjetsR07N6 VLCjetR07N6 Jet
+
+    add Branch FastJetFinderVLC_R10_N2/VLCjetsR10N2 VLCjetR10N2 Jet
+    add Branch FastJetFinderVLC_R10_N3/VLCjetsR10N3 VLCjetR10N3 Jet
+    add Branch FastJetFinderVLC_R10_N4/VLCjetsR10N4 VLCjetR10N4 Jet
+    add Branch FastJetFinderVLC_R10_N5/VLCjetsR10N5 VLCjetR10N5 Jet
+    add Branch FastJetFinderVLC_R10_N6/VLCjetsR10N6 VLCjetR10N6 Jet
+
+    add Branch FastJetFinderVLC_R12_N2/VLCjetsR12N2 VLCjetR12N2 Jet
+    add Branch FastJetFinderVLC_R12_N3/VLCjetsR12N3 VLCjetR12N3 Jet
+    add Branch FastJetFinderVLC_R12_N4/VLCjetsR12N4 VLCjetR12N4 Jet
+    add Branch FastJetFinderVLC_R12_N5/VLCjetsR12N5 VLCjetR12N5 Jet
+    add Branch FastJetFinderVLC_R12_N6/VLCjetsR12N6 VLCjetR12N6 Jet
+
+    add Branch FastJetFinderVLC_R15_N2/VLCjetsR15N2 VLCjetR15N2 Jet
+    add Branch FastJetFinderVLC_R15_N3/VLCjetsR15N3 VLCjetR15N3 Jet
+    add Branch FastJetFinderVLC_R15_N4/VLCjetsR15N4 VLCjetR15N4 Jet
+    add Branch FastJetFinderVLC_R15_N5/VLCjetsR15N5 VLCjetR15N5 Jet
+    add Branch FastJetFinderVLC_R15_N6/VLCjetsR15N6 VLCjetR15N6 Jet
+
+    add Branch FastJetFinderVLC_R05_inclusive/VLCjetsR05_inclusive VLCjetR05_inclusive Jet
+    add Branch FastJetFinderVLC_R07_inclusive/VLCjetsR07_inclusive VLCjetR07_inclusive Jet
+    add Branch FastJetFinderVLC_R10_inclusive/VLCjetsR10_inclusive VLCjetR10_inclusive Jet
+    add Branch FastJetFinderVLC_R12_inclusive/VLCjetsR12_inclusive VLCjetR12_inclusive Jet
+    add Branch FastJetFinderVLC_R15_inclusive/VLCjetsR15_inclusive VLCjetR15_inclusive Jet
+
+
+   
+    
+   ###with jet energy smearing
+    add Branch JetMomentumSmearing_VLCR05N2/JER_VLCjetsR05N2 JER_VLCjetR05N2 Jet
+    add Branch JetMomentumSmearing_VLCR05N3/JER_VLCjetsR05N3 JER_VLCjetR05N3 Jet
+    add Branch JetMomentumSmearing_VLCR05N4/JER_VLCjetsR05N4 JER_VLCjetR05N4 Jet
+    add Branch JetMomentumSmearing_VLCR05N5/JER_VLCjetsR05N5 JER_VLCjetR05N5 Jet
+    add Branch JetMomentumSmearing_VLCR05N6/JER_VLCjetsR05N6 JER_VLCjetR05N6 Jet
+
+    add Branch JetMomentumSmearing_VLCR07N2/JER_VLCjetsR07N2 JER_VLCjetR07N2 Jet
+    add Branch JetMomentumSmearing_VLCR07N3/JER_VLCjetsR07N3 JER_VLCjetR07N3 Jet
+    add Branch JetMomentumSmearing_VLCR07N4/JER_VLCjetsR07N4 JER_VLCjetR07N4 Jet
+    add Branch JetMomentumSmearing_VLCR07N5/JER_VLCjetsR07N5 JER_VLCjetR07N5 Jet
+    add Branch JetMomentumSmearing_VLCR07N6/JER_VLCjetsR07N6 JER_VLCjetR07N6 Jet
+
+    add Branch JetMomentumSmearing_VLCR10N2/JER_VLCjetsR10N2 JER_VLCjetR10N2 Jet
+    add Branch JetMomentumSmearing_VLCR10N3/JER_VLCjetsR10N3 JER_VLCjetR10N3 Jet
+    add Branch JetMomentumSmearing_VLCR10N4/JER_VLCjetsR10N4 JER_VLCjetR10N4 Jet
+    add Branch JetMomentumSmearing_VLCR10N5/JER_VLCjetsR10N5 JER_VLCjetR10N5 Jet
+    add Branch JetMomentumSmearing_VLCR10N6/JER_VLCjetsR10N6 JER_VLCjetR10N6 Jet
+
+    add Branch JetMomentumSmearing_VLCR12N2/JER_VLCjetsR12N2 JER_VLCjetR12N2 Jet
+    add Branch JetMomentumSmearing_VLCR12N3/JER_VLCjetsR12N3 JER_VLCjetR12N3 Jet
+    add Branch JetMomentumSmearing_VLCR12N4/JER_VLCjetsR12N4 JER_VLCjetR12N4 Jet
+    add Branch JetMomentumSmearing_VLCR12N5/JER_VLCjetsR12N5 JER_VLCjetR12N5 Jet
+    add Branch JetMomentumSmearing_VLCR12N6/JER_VLCjetsR12N6 JER_VLCjetR12N6 Jet
+
+    add Branch JetMomentumSmearing_VLCR15N2/JER_VLCjetsR15N2 JER_VLCjetR15N2 Jet
+    add Branch JetMomentumSmearing_VLCR15N3/JER_VLCjetsR15N3 JER_VLCjetR15N3 Jet
+    add Branch JetMomentumSmearing_VLCR15N4/JER_VLCjetsR15N4 JER_VLCjetR15N4 Jet
+    add Branch JetMomentumSmearing_VLCR15N5/JER_VLCjetsR15N5 JER_VLCjetR15N5 Jet
+    add Branch JetMomentumSmearing_VLCR15N6/JER_VLCjetsR15N6 JER_VLCjetR15N6 Jet
+
+    add Branch JetMomentumSmearing_VLCR05_inclusive/JER_VLCjetsR05_inclusive JER_VLCjetR05_inclusive Jet
+    add Branch JetMomentumSmearing_VLCR07_inclusive/JER_VLCjetsR07_inclusive JER_VLCjetR07_inclusive Jet
+    add Branch JetMomentumSmearing_VLCR10_inclusive/JER_VLCjetsR10_inclusive JER_VLCjetR10_inclusive Jet
+    add Branch JetMomentumSmearing_VLCR12_inclusive/JER_VLCjetsR12_inclusive JER_VLCjetR12_inclusive Jet
+    add Branch JetMomentumSmearing_VLCR15_inclusive/JER_VLCjetsR15_inclusive JER_VLCjetR15_inclusive Jet
+
+    ####
+
+    add Branch GenMissingET/momentum GenMissingET MissingET
+
+    add Branch TrackMerger/tracks Track Track
+    add Branch Calorimeter/towers Tower Tower
+
+    add Branch HCal/eflowTracks EFlowTrack Track
+    add Branch ECal/eflowPhotons EFlowPhoton Tower
+    add Branch HCal/eflowNeutralHadrons EFlowNeutralHadron Tower
+    
+    add Branch EFlowFilter/photons Photon Photon
+    add Branch EFlowFilter/electrons Electron Electron
+    add Branch EFlowFilter/muons Muon Muon
+    
+    add Branch MissingET/momentum MissingET MissingET
+    add Branch ScalarHT/energy ScalarHT ScalarHT
+
+
+    add Branch BCalTowers/bcalTowers BCalTower Tower
+    add Branch LumiTowers/lumicalTowers LumiTower Tower
+
+    add Branch LumiEfficiency/lumicalPhotons LumiPhoton Photon
+    add Branch BCalEfficiency/bcalPhotons BCalPhoton Photon
+
+}
+
Index: cards/delphes_card_CircularEE.tcl
===================================================================
--- cards/delphes_card_CircularEE.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/delphes_card_CircularEE.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,1104 @@
+#######################################
+# Order of execution of various modules
+#######################################
+
+set ExecutionPath {
+  ParticlePropagator
+
+  ChargedHadronTrackingEfficiency
+  ElectronTrackingEfficiency
+  MuonTrackingEfficiency
+
+  ChargedHadronMomentumSmearing
+  ElectronMomentumSmearing
+  MuonMomentumSmearing
+
+  TrackMerger
+
+  ECal
+  HCal
+
+  Calorimeter
+  EFlowMerger
+  EFlowFilter
+
+  PhotonEfficiency
+  PhotonIsolation
+
+  ElectronFilter
+  ElectronEfficiency
+  ElectronIsolation
+
+  ChargedHadronFilter
+
+  MuonEfficiency
+  MuonIsolation
+
+  NeutrinoFilter
+  GenJetFinder
+  FastJetFinder
+
+  ExclusiveFastJetFinder_N2
+  ExclusiveFastJetFinder_N4
+  ExclusiveFastJetFinder_N6
+
+  MissingET
+  GenMissingET
+
+  JetEnergyScale
+
+  JetFlavorAssociation
+
+  BTagging
+  CTagging
+  TauTaggingTight
+  TauTaggingLoose
+
+  BTaggingExclusive_N2
+  BTaggingExclusive_N4
+  BTaggingExclusive_N6
+
+  CTaggingExclusive_N2
+  CTaggingExclusive_N4
+  CTaggingExclusive_N6
+
+  TauTaggingTightExclusive_N2
+  TauTaggingTightExclusive_N4
+  TauTaggingTightExclusive_N6
+
+  TauTaggingLooseExclusive_N2
+  TauTaggingLooseExclusive_N4
+  TauTaggingLooseExclusive_N6
+
+  ScalarHT
+
+  UniqueObjectFinder
+
+  TreeWriter
+}
+
+#################################
+# Propagate particles in cylinder
+#################################
+
+module ParticlePropagator ParticlePropagator {
+  set InputArray Delphes/stableParticles
+
+  set OutputArray stableParticles
+  set ChargedHadronOutputArray chargedHadrons
+  set ElectronOutputArray electrons
+  set MuonOutputArray muons
+
+  # radius of the magnetic field coverage, in m
+  set Radius 1.81
+  # half-length of the magnetic field coverage, in m
+  set HalfLength 2.35
+
+  # magnetic field
+  set Bz 3.5
+}
+
+####################################
+# Charged hadron tracking efficiency
+####################################
+
+module Efficiency ChargedHadronTrackingEfficiency {
+  set InputArray ParticlePropagator/chargedHadrons
+  set OutputArray chargedHadrons
+
+  # add EfficiencyFormula {efficiency formula as a function of eta and pt}
+
+  # tracking efficiency formula for charged hadrons
+  set EfficiencyFormula {                                                    (pt <= 0.1)   * (0.00) +
+                                           (abs(eta) <= 3.0)               * (pt > 0.1)    * (1.00) +
+                                           (abs(eta) >  3.0)                               * (0.00)}
+}
+
+##############################
+# Electron tracking efficiency
+##############################
+
+module Efficiency ElectronTrackingEfficiency {
+  set InputArray ParticlePropagator/electrons
+  set OutputArray electrons
+
+  # set EfficiencyFormula {efficiency formula as a function of eta and pt}
+
+  # tracking efficiency formula for electrons
+  set EfficiencyFormula {                                                    (pt <= 0.1)   * (0.00) +
+                                           (abs(eta) <= 3.0)               * (pt > 0.1)    * (1.00) +
+                                           (abs(eta) >  3.0)                               * (0.00)}
+}
+
+##########################
+# Muon tracking efficiency
+##########################
+
+module Efficiency MuonTrackingEfficiency {
+  set InputArray ParticlePropagator/muons
+  set OutputArray muons
+
+  # set EfficiencyFormula {efficiency formula as a function of eta and pt}
+
+  # tracking efficiency formula for muons
+  set EfficiencyFormula {                                                    (pt <= 0.1)   * (0.00) +
+                                           (abs(eta) <= 3.0)               * (pt > 0.1)    * (1.00) +
+                                           (abs(eta) >  3.0)                               * (0.00)}
+}
+
+########################################
+# Momentum resolution for charged tracks
+########################################
+
+module MomentumSmearing ChargedHadronMomentumSmearing {
+  set InputArray ChargedHadronTrackingEfficiency/chargedHadrons
+  set OutputArray chargedHadrons
+
+  # set ResolutionFormula {resolution formula as a function of eta and pt}
+
+  # resolution formula for charged hadrons
+  set ResolutionFormula {    (abs(eta) <= 3.0)                   * sqrt(0.001^2 + pt^2*1.e-5^2) +
+                             (abs(eta) > 1.0 && abs(eta) <= 3.0) * sqrt(0.01^2 + pt^2*1.e-4^2)}
+
+
+}
+
+###################################
+# Momentum resolution for electrons
+###################################
+
+module MomentumSmearing ElectronMomentumSmearing {
+  set InputArray ElectronTrackingEfficiency/electrons
+  set OutputArray electrons
+
+  # set ResolutionFormula {resolution formula as a function of eta and energy}
+
+   # resolution formula for charged hadrons
+  set ResolutionFormula {    (abs(eta) <= 1.0)                   * sqrt(0.001^2 + pt^2*1.e-5^2) +
+                             (abs(eta) > 1.0 && abs(eta) <= 3.0) * sqrt(0.01^2 + pt^2*1.e-4^2)}
+}
+
+###############################
+# Momentum resolution for muons
+###############################
+
+module MomentumSmearing MuonMomentumSmearing {
+  set InputArray MuonTrackingEfficiency/muons
+  set OutputArray muons
+
+  # set ResolutionFormula {resolution formula as a function of eta and pt}
+
+   # resolution formula for charged hadrons
+  set ResolutionFormula {    (abs(eta) <= 1.0)                   * sqrt(0.001^2 + pt^2*1.e-5^2) +
+                             (abs(eta) > 1.0 && abs(eta) <= 3.0) * sqrt(0.01^2 + pt^2*1.e-4^2)}
+
+}
+
+##############
+# Track merger
+##############
+
+module Merger TrackMerger {
+# add InputArray InputArray
+  add InputArray ChargedHadronMomentumSmearing/chargedHadrons
+  add InputArray ElectronMomentumSmearing/electrons
+  add InputArray MuonMomentumSmearing/muons
+  set OutputArray tracks
+}
+
+#############
+#   ECAL
+#############
+
+module SimpleCalorimeter ECal {
+  set ParticleInputArray ParticlePropagator/stableParticles
+  set TrackInputArray TrackMerger/tracks
+
+  set TowerOutputArray ecalTowers
+  set EFlowTrackOutputArray eflowTracks
+  set EFlowTowerOutputArray eflowPhotons
+
+  set IsEcal true
+
+  set EnergyMin 0.5
+  set EnergySignificanceMin 1.0
+
+  set SmearTowerCenter true
+
+  set pi [expr {acos(-1)}]
+
+  # lists of the edges of each tower in eta and phi
+  # each list starts with the lower edge of the first tower
+  # the list ends with the higher edged of the last tower
+
+  # 1.0 degree towers (3 cm x 3 cm)
+  set PhiBins {}
+  for {set i -180} {$i <= 180} {incr i} {
+    add PhiBins [expr {$i * $pi/180.0}]
+  }
+
+  # 0.02 unit in eta up to eta = 3.0
+  for {set i -150} {$i <= 150} {incr i} {
+    set eta [expr {$i * 0.02}]
+    add EtaPhiBins $eta $PhiBins
+  }
+
+  # default energy fractions {abs(PDG code)} {fraction of energy deposited in ECAL}
+
+  add EnergyFraction {0} {0.0}
+  # energy fractions for e, gamma and pi0
+  add EnergyFraction {11} {1.0}
+  add EnergyFraction {22} {1.0}
+  add EnergyFraction {111} {1.0}
+  # energy fractions for muon, neutrinos and neutralinos
+  add EnergyFraction {12} {0.0}
+  add EnergyFraction {13} {0.0}
+  add EnergyFraction {14} {0.0}
+  add EnergyFraction {16} {0.0}
+  add EnergyFraction {1000022} {0.0}
+  add EnergyFraction {1000023} {0.0}
+  add EnergyFraction {1000025} {0.0}
+  add EnergyFraction {1000035} {0.0}
+  add EnergyFraction {1000045} {0.0}
+  # energy fractions for K0short and Lambda
+  add EnergyFraction {310} {0.3}
+  add EnergyFraction {3122} {0.3}
+
+  # set ECalResolutionFormula {resolution formula as a function of eta and energy}
+
+  set ResolutionFormula { (abs(eta) <= 3.0)                   * sqrt(energy^2*0.005^2 + energy*0.20^2) }
+
+}
+
+#############
+#   HCAL
+#############
+
+module SimpleCalorimeter HCal {
+  set ParticleInputArray ParticlePropagator/stableParticles
+  set TrackInputArray ECal/eflowTracks
+
+  set TowerOutputArray hcalTowers
+  set EFlowTrackOutputArray eflowTracks
+  set EFlowTowerOutputArray eflowNeutralHadrons
+
+  set IsEcal false
+
+  set EnergyMin 1.0
+  set EnergySignificanceMin 1.0
+
+  set SmearTowerCenter true
+
+  set pi [expr {acos(-1)}]
+
+  # lists of the edges of each tower in eta and phi
+  # each list starts with the lower edge of the first tower
+  # the list ends with the higher edged of the last tower
+
+
+  # 2.0 degree towers (6 cm x 6 cm)
+  set PhiBins {}
+  for {set i -180} {$i <= 180} {incr i} {
+    add PhiBins [expr {$i * $pi/180.0}]
+  }
+
+  # 0.04 unit in eta up to eta = 3.0
+  for {set i -75} {$i <= 75} {incr i} {
+    set eta [expr {$i * 0.04}]
+    add EtaPhiBins $eta $PhiBins
+  }
+
+
+  # default energy fractions {abs(PDG code)} {Fecal Fhcal}
+  add EnergyFraction {0} {1.0}
+  # energy fractions for e, gamma and pi0
+  add EnergyFraction {11} {0.0}
+  add EnergyFraction {22} {0.0}
+  add EnergyFraction {111} {0.0}
+  # energy fractions for muon, neutrinos and neutralinos
+  add EnergyFraction {12} {0.0}
+  add EnergyFraction {13} {0.0}
+  add EnergyFraction {14} {0.0}
+  add EnergyFraction {16} {0.0}
+  add EnergyFraction {1000022} {0.0}
+  add EnergyFraction {1000023} {0.0}
+  add EnergyFraction {1000025} {0.0}
+  add EnergyFraction {1000035} {0.0}
+  add EnergyFraction {1000045} {0.0}
+  # energy fractions for K0short and Lambda
+  add EnergyFraction {310} {0.7}
+  add EnergyFraction {3122} {0.7}
+
+  # set HCalResolutionFormula {resolution formula as a function of eta and energy}
+
+  set ResolutionFormula {                  (abs(eta) <= 3.0) * sqrt(energy^2*0.01^2 + energy*0.60^2)}
+
+}
+
+#################
+# Electron filter
+#################
+
+module PdgCodeFilter ElectronFilter {
+  set InputArray HCal/eflowTracks
+  set OutputArray electrons
+  set Invert true
+  add PdgCode {11}
+  add PdgCode {-11}
+}
+
+######################
+# ChargedHadronFilter
+######################
+
+module PdgCodeFilter ChargedHadronFilter {
+  set InputArray HCal/eflowTracks
+  set OutputArray chargedHadrons
+
+  add PdgCode {11}
+  add PdgCode {-11}
+  add PdgCode {13}
+  add PdgCode {-13}
+}
+
+
+
+###################################################
+# Tower Merger (in case not using e-flow algorithm)
+###################################################
+
+module Merger Calorimeter {
+# add InputArray InputArray
+  add InputArray ECal/ecalTowers
+  add InputArray HCal/hcalTowers
+  set OutputArray towers
+}
+
+
+####################
+# Energy flow merger
+####################
+
+module Merger EFlowMerger {
+# add InputArray InputArray
+  add InputArray HCal/eflowTracks
+  add InputArray ECal/eflowPhotons
+  add InputArray HCal/eflowNeutralHadrons
+  set OutputArray eflow
+}
+
+######################
+# EFlowFilter
+######################
+
+module PdgCodeFilter EFlowFilter {
+  set InputArray EFlowMerger/eflow
+  set OutputArray eflow
+
+  add PdgCode {11}
+  add PdgCode {-11}
+  add PdgCode {13}
+  add PdgCode {-13}
+}
+
+
+###################
+# Missing ET merger
+###################
+
+module Merger MissingET {
+# add InputArray InputArray
+  add InputArray EFlowMerger/eflow
+  set MomentumOutputArray momentum
+}
+
+
+##################
+# Scalar HT merger
+##################
+
+module Merger ScalarHT {
+# add InputArray InputArray
+  add InputArray EFlowMerger/eflow
+  set EnergyOutputArray energy
+}
+
+#################
+# Neutrino Filter
+#################
+
+module PdgCodeFilter NeutrinoFilter {
+
+  set InputArray Delphes/stableParticles
+  set OutputArray filteredParticles
+
+  set PTMin 0.0
+
+  add PdgCode {12}
+  add PdgCode {14}
+  add PdgCode {16}
+  add PdgCode {-12}
+  add PdgCode {-14}
+  add PdgCode {-16}
+
+}
+
+
+#####################
+# MC truth jet finder
+#####################
+
+module FastJetFinder GenJetFinder {
+  set InputArray NeutrinoFilter/filteredParticles
+
+  set OutputArray jets
+
+  # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt
+  set JetAlgorithm 6
+  set ParameterR 0.5
+
+  set JetPTMin 20.0
+}
+
+#########################
+# Gen Missing ET merger
+########################
+
+module Merger GenMissingET {
+# add InputArray InputArray
+  add InputArray NeutrinoFilter/filteredParticles
+  set MomentumOutputArray momentum
+}
+
+############
+# Jet finder
+############
+
+## inclusive generalized kT ee algorithm
+module FastJetFinder FastJetFinder {
+#  set InputArray Calorimeter/towers
+  set InputArray EFlowMerger/eflow
+
+  set OutputArray jets
+
+  # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt
+  set JetAlgorithm 10
+  set ParameterR 0.5
+
+  set JetPTMin 20.0
+}
+
+######################
+# Exclusive Jet finder
+######################
+
+## exclusive valencia , N=2
+module FastJetFinder ExclusiveFastJetFinder_N2 {
+
+  set OutputArray jets
+
+  # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt, 7 anti-kt with winner-take-all axis (for N-subjettiness), 8 N-jettiness, 9 Valencia
+  set NJets 2
+  set ExclusiveClustering true
+  set JetAlgorithm 9
+  set ParameterR 0.5
+  set Beta 1.0
+  set Gamma 1.0
+
+  set JetPTMin 20.0
+}
+
+######################
+# Exclusive Jet finder
+######################
+
+## exclusive valencia , N=4
+module FastJetFinder ExclusiveFastJetFinder_N4 {
+
+  set OutputArray jets
+
+  # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt, 7 anti-kt with winner-take-all axis (for N-subjettiness), 8 N-jettiness, 9 Valencia
+  set NJets 4
+  set ExclusiveClustering true
+  set JetAlgorithm 9
+  set ParameterR 0.5
+  set Beta 1.0
+  set Gamma 1.0
+
+  set JetPTMin 20.0
+}
+
+
+######################
+# Exclusive Jet finder
+######################
+
+## exclusive valencia , N=6
+module FastJetFinder ExclusiveFastJetFinder_N6 {
+
+  set OutputArray jets
+
+  # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt, 7 anti-kt with winner-take-all axis (for N-subjettiness), 8 N-jettiness, 9 Valencia
+  set NJets 6
+  set ExclusiveClustering true
+  set JetAlgorithm 9
+  set ParameterR 0.5
+  set Beta 1.0
+  set Gamma 1.0
+
+  set JetPTMin 20.0
+}
+
+##################
+# Jet Energy Scale
+##################
+
+module EnergyScale JetEnergyScale {
+  set InputArray FastJetFinder/jets
+  set OutputArray jets
+
+ # scale formula for jets
+  set ScaleFormula {1.00}
+}
+
+########################
+# Jet Flavor Association
+########################
+
+module JetFlavorAssociation JetFlavorAssociation {
+
+  set PartonInputArray Delphes/partons
+  set ParticleInputArray Delphes/allParticles
+  set ParticleLHEFInputArray Delphes/allParticlesLHEF
+  set JetInputArray JetEnergyScale/jets
+
+  set DeltaR 0.5
+  set PartonPTMin 1.0
+  set PartonEtaMax 3.0
+
+}
+
+###################
+# Photon efficiency
+###################
+
+module Efficiency PhotonEfficiency {
+  set InputArray ECal/eflowPhotons
+  set OutputArray photons
+
+  # set EfficiencyFormula {efficiency formula as a function of eta and pt}
+
+  # efficiency formula for photons
+  set EfficiencyFormula {                                      (energy <= 2.0) * (0.00) +
+                                           (abs(eta) <= 1.5) * (energy > 2.0)  * (0.99) +
+                         (abs(eta) > 1.5 && abs(eta) <= 3.0) * (energy > 2.0)  * (0.99) +
+                         (abs(eta) > 3.0)                                   * (0.00)}
+}
+
+##################
+# Photon isolation
+##################
+
+module Isolation PhotonIsolation {
+  set CandidateInputArray PhotonEfficiency/photons
+  set IsolationInputArray EFlowFilter/eflow
+
+  set OutputArray photons
+
+  set DeltaRMax 0.5
+
+  set PTMin 0.5
+
+  set PTRatioMax 0.12
+}
+
+#####################
+# Electron efficiency
+#####################
+
+module Efficiency ElectronEfficiency {
+  set InputArray ElectronFilter/electrons
+  set OutputArray electrons
+
+  # set EfficiencyFormula {efficiency formula as a function of eta and pt}
+
+  # efficiency formula for electrons
+  set EfficiencyFormula {                                      (energy <= 2.0) * (0.00) +
+                                           (abs(eta) <= 1.5) * (energy > 2.0)  * (0.99) +
+                         (abs(eta) > 1.5 && abs(eta) <= 3.0) * (energy > 2.0)  * (0.99) +
+                         (abs(eta) > 3.0)                                      * (0.00)}
+}
+
+####################
+# Electron isolation
+####################
+
+module Isolation ElectronIsolation {
+  set CandidateInputArray ElectronEfficiency/electrons
+  set IsolationInputArray EFlowFilter/eflow
+
+  set OutputArray electrons
+
+  set DeltaRMax 0.5
+
+  set PTMin 0.5
+
+  set PTRatioMax 0.12
+}
+
+#################
+# Muon efficiency
+#################
+
+module Efficiency MuonEfficiency {
+  set InputArray MuonMomentumSmearing/muons
+  set OutputArray muons
+
+  # set EfficiencyFormula {efficiency as a function of eta and pt}
+  set EfficiencyFormula {                                      (energy <= 2.0) * (0.00) +
+                                           (abs(eta) <= 1.5) * (energy > 2.0)  * (0.99) +
+                         (abs(eta) > 1.5 && abs(eta) <= 3.0) * (energy > 2.0)  * (0.99) +
+                         (abs(eta) > 3.0)                                      * (0.00)}
+}
+
+################
+# Muon isolation
+################
+
+module Isolation MuonIsolation {
+  set CandidateInputArray MuonEfficiency/muons
+  set IsolationInputArray EFlowFilter/eflow
+
+  set OutputArray muons
+
+  set DeltaRMax 0.5
+
+  set PTMin 0.5
+
+  set PTRatioMax 0.25
+}
+
+
+###########
+# b-tagging
+###########
+
+module BTagging BTagging {
+  set JetInputArray JetEnergyScale/jets
+
+  set BitNumber 0
+
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.001}
+
+  # efficiency formula for c-jets (misidentification rate)
+  add EfficiencyFormula {4} {0.10}
+
+  # efficiency formula for b-jets
+  add EfficiencyFormula {5} {0.80}
+}
+
+###########
+# c-tagging
+###########
+
+module BTagging CTagging {
+  set JetInputArray JetEnergyScale/jets
+
+  set BitNumber 1
+
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.12}
+
+  # efficiency formula for c-jets (misidentification rate)
+  add EfficiencyFormula {4} {0.70}
+
+  # efficiency formula for b-jets
+  add EfficiencyFormula {5} {0.20}
+}
+
+
+#############
+# tau-tagging
+#############
+
+
+module TauTagging TauTaggingTight {
+  set ParticleInputArray Delphes/allParticles
+  set PartonInputArray Delphes/partons
+  set JetInputArray JetEnergyScale/jets
+
+  set BitNumber 0
+
+  set DeltaR 0.5
+
+  set TauPTMin 1.0
+
+  set TauEtaMax 3.0
+
+  # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt}
+
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.001}
+  # efficiency formula for tau-jets
+  add EfficiencyFormula {15} {0.4}
+}
+
+
+
+#############
+# tau-tagging
+#############
+
+
+module TauTagging TauTaggingLoose {
+  set ParticleInputArray Delphes/allParticles
+  set PartonInputArray Delphes/partons
+  set JetInputArray JetEnergyScale/jets
+
+  set BitNumber 1
+
+  set DeltaR 0.5
+
+  set TauPTMin 1.0
+
+  set TauEtaMax 3.0
+
+  # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt}
+
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.1}
+  # efficiency formula for tau-jets
+  add EfficiencyFormula {15} {0.85}
+}
+
+
+
+###########
+# b-tagging
+###########
+
+module BTagging BTaggingExclusive_N2 {
+  set JetInputArray ExclusiveFastJetFinder_N2/jets
+
+  set BitNumber 0
+
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.001}
+
+  # efficiency formula for c-jets (misidentification rate)
+  add EfficiencyFormula {4} {0.10}
+
+  # efficiency formula for b-jets
+  add EfficiencyFormula {5} {0.80}
+}
+
+###########
+# c-tagging
+###########
+
+module BTagging CTaggingExclusive_N2 {
+  set JetInputArray ExclusiveFastJetFinder_N2/jets
+
+  set BitNumber 1
+
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.12}
+
+  # efficiency formula for c-jets (misidentification rate)
+  add EfficiencyFormula {4} {0.70}
+
+  # efficiency formula for b-jets
+  add EfficiencyFormula {5} {0.20}
+}
+
+
+#############
+# tau-tagging
+#############
+
+
+module TauTagging TauTaggingTightExclusive_N2 {
+  set ParticleInputArray Delphes/allParticles
+  set PartonInputArray Delphes/partons
+  set JetInputArray ExclusiveFastJetFinder_N2/jets
+
+  set BitNumber 0
+
+  set DeltaR 0.5
+
+  set TauPTMin 1.0
+
+  set TauEtaMax 3.0
+
+  # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt}
+
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.001}
+  # efficiency formula for tau-jets
+  add EfficiencyFormula {15} {0.4}
+}
+
+
+#############
+# tau-tagging
+#############
+
+
+module TauTagging TauTaggingLooseExclusive_N2 {
+  set ParticleInputArray Delphes/allParticles
+  set PartonInputArray Delphes/partons
+  set JetInputArray ExclusiveFastJetFinder_N2/jets
+
+  set BitNumber 1
+
+  set DeltaR 0.5
+
+  set TauPTMin 1.0
+
+  set TauEtaMax 3.0
+
+  # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt}
+
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.1}
+  # efficiency formula for tau-jets
+  add EfficiencyFormula {15} {0.85}
+}
+
+
+
+
+
+###########
+# b-tagging
+###########
+
+module BTagging BTaggingExclusive_N4 {
+  set JetInputArray ExclusiveFastJetFinder_N4/jets
+
+  set BitNumber 0
+
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.001}
+
+  # efficiency formula for c-jets (misidentification rate)
+  add EfficiencyFormula {4} {0.10}
+
+  # efficiency formula for b-jets
+  add EfficiencyFormula {5} {0.80}
+}
+
+###########
+# c-tagging
+###########
+
+module BTagging CTaggingExclusive_N4 {
+  set JetInputArray ExclusiveFastJetFinder_N4/jets
+
+  set BitNumber 1
+
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.12}
+
+  # efficiency formula for c-jets (misidentification rate)
+  add EfficiencyFormula {4} {0.70}
+
+  # efficiency formula for b-jets
+  add EfficiencyFormula {5} {0.20}
+}
+
+
+#############
+# tau-tagging
+#############
+
+
+module TauTagging TauTaggingTightExclusive_N4 {
+  set ParticleInputArray Delphes/allParticles
+  set PartonInputArray Delphes/partons
+  set JetInputArray ExclusiveFastJetFinder_N4/jets
+  
+  set BitNumber 0
+
+  set DeltaR 0.5
+
+  set TauPTMin 1.0
+
+  set TauEtaMax 3.0
+
+  # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt}
+
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.001}
+  # efficiency formula for tau-jets
+  add EfficiencyFormula {15} {0.4}
+}
+
+
+
+#############
+# tau-tagging
+#############
+
+
+module TauTagging TauTaggingLooseExclusive_N4 {
+  set ParticleInputArray Delphes/allParticles
+  set PartonInputArray Delphes/partons
+  set JetInputArray ExclusiveFastJetFinder_N4/jets
+  
+  set BitNumber 1
+
+  set DeltaR 0.5
+
+  set TauPTMin 1.0
+
+  set TauEtaMax 3.0
+
+  # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt}
+
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.1}
+  # efficiency formula for tau-jets
+  add EfficiencyFormula {15} {0.85}
+}
+
+
+
+###########
+# b-tagging
+###########
+
+module BTagging BTaggingExclusive_N6 {
+  set JetInputArray ExclusiveFastJetFinder_N6/jets
+
+  set BitNumber 0
+
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.001}
+
+  # efficiency formula for c-jets (misidentification rate)
+  add EfficiencyFormula {4} {0.10}
+
+  # efficiency formula for b-jets
+  add EfficiencyFormula {5} {0.80}
+}
+
+###########
+# c-tagging
+###########
+
+module BTagging CTaggingExclusive_N6 {
+  set JetInputArray ExclusiveFastJetFinder_N6/jets
+
+  set BitNumber 1
+
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.12}
+
+  # efficiency formula for c-jets (misidentification rate)
+  add EfficiencyFormula {4} {0.70}
+
+  # efficiency formula for b-jets
+  add EfficiencyFormula {5} {0.20}
+}
+
+
+#############
+# tau-tagging
+#############
+
+
+module TauTagging TauTaggingTightExclusive_N6 {
+  set ParticleInputArray Delphes/allParticles
+  set PartonInputArray Delphes/partons
+  set JetInputArray ExclusiveFastJetFinder_N6/jets
+
+  set BitNumber 0
+
+  set DeltaR 0.5
+
+  set TauPTMin 1.0
+
+  set TauEtaMax 3.0
+
+  # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt}
+
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.001}
+  # efficiency formula for tau-jets
+  add EfficiencyFormula {15} {0.4}
+}
+
+
+#############
+# tau-tagging
+#############
+
+
+module TauTagging TauTaggingLooseExclusive_N6 {
+  set ParticleInputArray Delphes/allParticles
+  set PartonInputArray Delphes/partons
+  set JetInputArray ExclusiveFastJetFinder_N6/jets
+
+  set BitNumber 1
+
+  set DeltaR 0.5
+
+  set TauPTMin 1.0
+
+  set TauEtaMax 3.0
+
+  # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt}
+
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.1}
+  # efficiency formula for tau-jets
+  add EfficiencyFormula {15} {0.85}
+}
+
+
+#####################################################
+# Find uniquely identified photons/electrons/tau/jets
+#####################################################
+
+module UniqueObjectFinder UniqueObjectFinder {
+# earlier arrays take precedence over later ones
+# add InputArray InputArray OutputArray
+  add InputArray PhotonIsolation/photons photons
+  add InputArray ElectronIsolation/electrons electrons
+  add InputArray MuonIsolation/muons muons
+  add InputArray JetEnergyScale/jets jets
+}
+
+
+##################
+# ROOT tree writer
+##################
+
+module TreeWriter TreeWriter {
+# add Branch InputArray BranchName BranchClass
+  add Branch Delphes/allParticles Particle GenParticle
+
+  add Branch GenJetFinder/jets GenJet Jet
+  add Branch GenMissingET/momentum GenMissingET MissingET
+
+  add Branch TrackMerger/tracks Track Track
+  add Branch Calorimeter/towers Tower Tower
+
+  add Branch HCal/eflowTracks EFlowTrack Track
+  add Branch ECal/eflowPhotons EFlowPhoton Tower
+  add Branch HCal/eflowNeutralHadrons EFlowNeutralHadron Tower
+
+  add Branch UniqueObjectFinder/photons Photon Photon
+  add Branch UniqueObjectFinder/electrons Electron Electron
+  add Branch UniqueObjectFinder/muons Muon Muon
+  add Branch UniqueObjectFinder/jets Jet Jet
+
+  add Branch ExclusiveFastJetFinder_N2/jets ExclusiveJets_N2 Jet
+  add Branch ExclusiveFastJetFinder_N4/jets ExclusiveJets_N4 Jet
+  add Branch ExclusiveFastJetFinder_N6/jets ExclusiveJets_N6 Jet
+
+  add Branch MissingET/momentum MissingET MissingET
+  add Branch ScalarHT/energy ScalarHT ScalarHT
+}
Index: cards/delphes_card_FCCeh.tcl
===================================================================
--- cards/delphes_card_FCCeh.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/delphes_card_FCCeh.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,872 @@
+#######################################
+# Uta Klein
+# Order of execution of various modules
+# 19.12.16 add paramterisations according to Peter Kostka's design
+# muons not considered here - take CMS/FCC values
+# 22.12.16 new extensions for FCC-eh based on new LHeC cards
+# needs eflow and photons and JetFlavour Ass
+# 3.3.17 add more Filter 16.3.17 smaller constant CAL terms c.f. Max Klein 
+# 17.3.17 add track resolutions as given by Peter Kostka
+#######################################
+
+set ExecutionPath {
+  ParticlePropagator
+
+  ChargedHadronTrackingEfficiency
+  ElectronTrackingEfficiency
+  MuonTrackingEfficiency
+
+  ChargedHadronMomentumSmearing
+  ElectronMomentumSmearing
+  MuonMomentumSmearing
+
+  TrackMerger
+  ImpactParameterSmearing
+  Calorimeter
+  EFlowMerger
+  EFlowFilter
+
+  PhotonEfficiency
+  PhotonIsolation
+ 
+  ElectronFilter
+  ElectronEfficiency
+  ElectronIsolation
+  
+ 
+  MuonEfficiency
+  MuonIsolation
+
+  NeutrinoFilter
+
+  MissingET
+  GenMissingET
+  GenJetFinder
+  FastJetFinder
+  JetEnergyScale
+ 
+  GenJetFlavorAssociation
+  JetFlavorAssociation
+
+  GenBTagging
+  BTagging
+
+  GenCTagging
+  CTagging
+
+  GenTauTagging
+  TauTagging
+
+  UniqueObjectFinder
+
+  ScalarHT
+  
+  TreeWriter
+}
+
+# exclude since it adds also an entry to Jet->BTag
+# TrackCountingBTagging
+
+#################################
+# Propagate particles in cylinder
+#################################
+
+module ParticlePropagator ParticlePropagator {
+  set InputArray Delphes/stableParticles
+
+  set OutputArray stableParticles
+  set ChargedHadronOutputArray chargedHadrons
+  set ElectronOutputArray electrons
+  set MuonOutputArray muons
+
+# FCC-eh
+# radius of the magnetic field coverage, in m
+  set Radius 1.36
+  # half-length of the magnetic field coverage, in m
+  set HalfLength 5.24
+
+  # magnetic field
+  set Bz 3.8
+
+}
+
+####################################
+# Charged hadron tracking efficiency
+####################################
+
+module Efficiency ChargedHadronTrackingEfficiency {
+  set InputArray ParticlePropagator/chargedHadrons
+  set OutputArray chargedHadrons
+
+# add EfficiencyFormula {efficiency formula as a function of eta and pt}
+
+# tracking efficiency formula for charged hadrons
+# set to 1 for full range (-0.2 eta already subtracted from edges)
+  set EfficiencyFormula { (pt <= 0.5) * (0.00) + (pt > 0.5) *( eta <= 5.2 && eta >= -5.0)  * (1.0) + \
+				(eta > 5.2 || eta < -5.0 ) * (0.00)}
+}
+##############################
+# Electron tracking efficiency
+##############################
+
+module Efficiency ElectronTrackingEfficiency {
+  set InputArray ParticlePropagator/electrons
+  set OutputArray electrons
+
+  # set EfficiencyFormula {efficiency formula as a function of eta and pt}
+
+  # tracking efficiency formula for electrons
+# set to 1
+  set EfficiencyFormula {   (pt <= 0.5) * (0.00) + (pt > 0.5) *( (eta <=5.2 && eta >= -5.0) ) * (1.0) + \
+			       ((eta > 5.2 || eta < -5.0)) * (0.00)}
+ }
+##########################
+# Muon tracking efficiency
+##########################
+
+module Efficiency MuonTrackingEfficiency {
+ set InputArray ParticlePropagator/muons
+  set OutputArray muons
+
+  # set EfficiencyFormula {efficiency formula as a function of eta and pt}
+
+  # tracking efficiency formula for muons
+# set to 1
+  set EfficiencyFormula {    (pt <= 0.5) * (0.00) + (pt > 0.5) *(abs(eta) <= 4)  * (1.0) + \
+				(abs(eta) > 4) * (0.00)}
+}
+
+
+########################################
+# Momentum resolution for charged tracks
+########################################
+
+module MomentumSmearing ChargedHadronMomentumSmearing {
+  set InputArray ChargedHadronTrackingEfficiency/chargedHadrons
+  set OutputArray chargedHadrons
+
+  # set ResolutionFormula {resolution formula as a function of eta and pt}
+### 17.3.17 Peter's values
+  set ResolutionFormula {  (pt <= 0.1 ) * (0.00) + ( pt > 0.1   && eta < 5.2 && eta > -5.0)*sqrt( pt^2*5.e-5^2) + \ 
+                            (eta > 5.2 || eta < -5.0) * (0.00)} }
+
+  # resolution formula for charged hadrons
+# taken from FCC but adjust to ep
+#the abs(eta) <= 2.0 should be the "central best" and abs(eta) >
+#2.0  and  <= 4.9 the fwd    /    <= 4.3 the bwd    (LHeC)
+#        and abs(eta) > 2.0 and <= 5.2 fwd   /   <= 5.0   the bwd    (FCC)
+#
+#  set ResolutionFormula {                  (abs(eta) <= 2.0) * (pt > 0.1   && pt <= 1.0)   * (0.02) + \
+#                                           (abs(eta) <= 2.0) * (pt > 1.0   && pt <= 1.0e1) * (0.01) + \
+#                                           (abs(eta) <= 2.0) * (pt > 1.0e1 && pt <= 2.0e2) * (0.03) + \
+#                                           (abs(eta) <= 2.0) * (pt > 2.0e2)                * (0.05) + \
+#                         (abs(eta) > 2.0 && ( eta <= 5.2 && eta >= -5.0 ) ) * (pt > 0.1   && pt <= 1.0)   * (0.03) + \
+#                         (abs(eta) > 2.0 && ( eta <= 5.2 && eta >= -5.0 ) ) * (pt > 1.0   && pt <= 1.0e1) * (0.02) + \
+#                         (abs(eta) > 2.0 && ( eta <= 5.2 && eta >= -5.0 ) ) * (pt > 1.0e1 && pt <= 2.0e2) * (0.04) + \
+#                        (abs(eta) > 2.0 && ( eta <= 5.2 && eta >= -5.0 ) ) * (pt > 2.0e2)                * (0.05)}
+#}
+
+
+#################################
+# Energy resolution for electrons
+#################################
+
+module MomentumSmearing ElectronMomentumSmearing {
+  set InputArray ElectronTrackingEfficiency/electrons
+  set OutputArray electrons
+
+
+### 17.3.17 Peter's values
+  set ResolutionFormula {  (pt <= 0.1 ) * (0.00) + ( pt > 0.1   && eta < 5.2 && eta > -5.0)*sqrt( pt^2*5.e-5^2) + \ 
+                            (eta > 5.2 || eta < -5.0) * (0.00)} }
+
+# 22.12.16 Uta
+## take value from ECAL WITHOUT some energy ranges
+## usually there were energy ranges given
+
+# set ResolutionFormula {                  ( eta <= 5.5 && eta > 3.0  && energy > 0.1 ) * sqrt(energy*0.1^2 + energy^2*0.01^2)  + \
+#                             ( eta <= 3.0 && eta >= -2.7 && energy > 0.1 ) * sqrt(energy*0.09^2 + energy^2*0.02^2)         +
+#     \                            ( eta < -2.7 && eta >= -5.2 && energy > 0.1  ) * sqrt(energy*0.1^2 + energy^2*0.01^2) }
+#
+#}
+
+###############################
+# Momentum resolution for muons
+###############################
+
+module MomentumSmearing MuonMomentumSmearing {
+  set InputArray MuonTrackingEfficiency/muons
+  set OutputArray muons
+
+  # set ResolutionFormula {resolution formula as a function of eta and pt}
+
+### 17.3.17 Peter's values
+  set ResolutionFormula {  (pt <= 0.1 ) * (0.00) + ( pt > 0.1   && eta < 5.2 && eta > -5.0)*sqrt( pt^2*5.e-5^2) + \ 
+                            (eta > 5.2 || eta < -5.0) * (0.00)} }
+
+
+  # resolution formula for muons
+# taken from FCC
+#   set ResolutionFormula {                  (abs(eta) <= 0.5) * (pt > 0.1   && pt <= 5.0)   * (0.02) + \
+#                                           (abs(eta) <= 0.5) * (pt > 5.0   && pt <= 1.0e2) * (0.015) + \
+#                                           (abs(eta) <= 0.5) * (pt > 1.0e2 && pt <= 2.0e2) * (0.03) + \
+#                                           (abs(eta) <= 0.5) * (pt > 2.0e2)                * (0.05 + pt*1.e-4) + \
+#                         (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1   && pt <= 5.0)   * (0.03) + \
+#                         (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 5.0   && pt <= 1.0e2) * (0.02) + \
+#                         (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 1.0e2 && pt <= 2.0e2) * (0.04) + \
+#                         (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 2.0e2)                * (0.05 + pt*1.e-4) + \
+#                         (abs(eta) > 1.5 && abs(eta) <= 4.0) * (pt > 0.1   && pt <= 5.0)   * (0.04) + \
+#                         (abs(eta) > 1.5 && abs(eta) <= 4.0) * (pt > 5.0   && pt <= 1.0e2) * (0.035) + \
+#                         (abs(eta) > 1.5 && abs(eta) <= 4.0) * (pt > 1.0e2 && pt <= 2.0e2) * (0.05) + \
+#                         (abs(eta) > 1.5 && abs(eta) <= 4.0) * (pt > 2.0e2)                * (0.05 + pt*1.e-4)}
+#}
+
+
+##############
+# Track merger
+##############
+
+module Merger TrackMerger {
+# add InputArray InputArray
+  add InputArray ChargedHadronMomentumSmearing/chargedHadrons
+#  add InputArray ElectronEnergySmearing/electrons
+# change here to the momentum smearing
+  add InputArray ElectronMomentumSmearing/electrons
+  add InputArray MuonMomentumSmearing/muons
+  set OutputArray tracks
+}
+###################
+# Impact Parameters
+###################
+
+module ImpactParameterSmearing ImpactParameterSmearing {
+  set TrackInputArray TrackMerger/tracks
+  set OutputArray tracks
+
+# set ResolutionFormula {resolution formula as a function of eta and pt}
+# taken from FCC example - and about achieved at ATLAS Run-2
+# absolute impact parameter smearing formula (in mm) as a function of pt and eta
+#set ResolutionFormula {(pt > 0.1  && pt <= 5.0)   * (0.010) + \
+#                       (pt > 5.0)                 * (0.005)}
+#
+#}
+# value from Peter 5mu m x 20 mu m /( p sin theta ^3/2)
+set ResolutionFormula { (pt > 0.5  )  * ( sqrt( (0.0001/pt)^2/(sin(2*atan(exp(-eta))))^3 ) )  }
+
+##
+
+##################
+# LHeC Calorimeter
+##################
+
+module Calorimeter Calorimeter {
+  set ParticleInputArray ParticlePropagator/stableParticles
+## 17.3.17 use also TrackMerger/tracks
+  set TrackInputArray TrackMerger/tracks
+#  set TrackInputArray ImpactParameterSmearing/tracks
+
+  set TowerOutputArray towers
+  set PhotonOutputArray photons
+
+  set EFlowTrackOutputArray eflowTracks
+  set EFlowPhotonOutputArray eflowPhotons
+  set EFlowNeutralHadronOutputArray eflowNeutralHadrons
+
+  set pi [expr {acos(-1)}]
+
+  # lists of the edges of each tower in eta and phi
+  # each list starts with the lower edge of the first tower
+  # the list ends with the higher edged of the last tower
+
+  # use a delta_phi=0.025 for 2*phi range == 252 cells
+  # use a delta_eta-0.025 for eta = -5 to 5 == 400 cells
+  # Uta 22.12.16 use eta range from Peter Kostka -4.7 - 5.2
+  set PhiBins {}
+  for {set i -126} {$i <= 126} {incr i} {
+      add PhiBins [expr {$i * $pi/126.0}]
+  }
+  foreach eta { -5.600 -5.575 -5.550 -5.525 -5.500 -5.475 -5.450 -5.425 -5.400 -5.375 -5.350 -5.325 -5.300 -5.275 -5.250 -5.225 -5.200 -5.175 -5.150 -5.125 -5.100 -5.075 -5.050 -5.025 -5.000  -4.975 -4.950 -4.925 -4.900 -4.875 -4.850 -4.825 -4.800 -4.775 -4.750 -4.725 -4.700 -4.675 -4.650 -4.625 -4.600 -4.575 -4.550 -4.525 -4.500 -4.475 -4.450 -4.425 -4.400 -4.375 -4.350 -4.325 -4.300 -4.275 -4.250 -4.225 -4.200 -4.175 -4.150 -4.125 -4.100 -4.075 -4.050 -4.025 -4.000 -3.975 -3.950 -3.925 -3.900 -3.875 -3.850 -3.825 -3.800 -3.775 -3.750 -3.725 -3.700 -3.675 -3.650 -3.625 -3.600 -3.575 -3.550 -3.525 -3.500 -3.475 -3.450 -3.425 -3.400 -3.375 -3.350 -3.325 -3.300 -3.275 -3.250 -3.225 -3.200 -3.175 -3.150 -3.125 -3.100 -3.075 -3.050 -3.025 -3.000 -2.975 -2.950 -2.925 -2.900 -2.875 -2.850 -2.825 -2.800 -2.775 -2.750 -2.725 -2.700 -2.675 -2.650 -2.625 -2.600 -2.575 -2.550 -2.525 -2.500 -2.475 -2.450 -2.425 -2.400 -2.375 -2.350 -2.325 -2.300 -2.275 -2.250 -2.225 -2.200 -2.175 -2.150 -2.125 -2.100 -2.075 -2.050 -2.025 -2.000 -1.975 -1.950 -1.925 -1.900 -1.875 -1.850 -1.825 -1.800 -1.775 -1.750 -1.725 -1.700 -1.675 -1.650 -1.625 -1.600 -1.575 -1.550 -1.525 -1.500 -1.475 -1.450 -1.425 -1.400 -1.375 -1.350 -1.325 -1.300 -1.275 -1.250 -1.225 -1.200 -1.175 -1.150 -1.125 -1.100 -1.075 -1.050 -1.025 -1.000 -0.975 -0.950 -0.925 -0.900 -0.875 -0.850 -0.825 -0.800 -0.775 -0.750 -0.725 -0.700 -0.675 -0.650 -0.625 -0.600 -0.575 -0.550 -0.525 -0.500 -0.475 -0.450 -0.425 -0.400 -0.375 -0.350 -0.325 -0.300 -0.275 -0.250 -0.225 -0.200 -0.175 -0.150 -0.125 -0.100 -0.075 -0.050 -0.025  0.000  0.025  0.050  0.075  0.100  0.125  0.150  0.175  0.200  0.225  0.250  0.275  0.300  0.325  0.350  0.375  0.400  0.425  0.450  0.475  0.500  0.525  0.550  0.575  0.600  0.625  0.650  0.675  0.700  0.725  0.750  0.775  0.800  0.825  0.850  0.875  0.900  0.925  0.950  0.975  1.000  1.025  1.050  1.075  1.100  1.125  1.150  1.175  1.200  1.225  1.250  1.275  1.300  1.325  1.350  1.375  1.400  1.425  1.450  1.475  1.500  1.525  1.550  1.575  1.600  1.625  1.650  1.675  1.700  1.725  1.750  1.775  1.800  1.825  1.850  1.875  1.900  1.925  1.950  1.975  2.000  2.025  2.050  2.075  2.100  2.125  2.150  2.175  2.200  2.225  2.250  2.275  2.300  2.325  2.350  2.375  2.400  2.425  2.450  2.475  2.500  2.525  2.550  2.575  2.600  2.625  2.650  2.675  2.700  2.725  2.750  2.775  2.800  2.825  2.850  2.875  2.900  2.925  2.950  2.975  3.000  3.025  3.050  3.075  3.100  3.125  3.150  3.175  3.200  3.225  3.250  3.275  3.300  3.325  3.350  3.375  3.400  3.425  3.450  3.475  3.500  3.525  3.550  3.575  3.600  3.625  3.650  3.675  3.700  3.725  3.750  3.775  3.800  3.825  3.850  3.875  3.900  3.925  3.950  3.975  4.000  4.025  4.050  4.075  4.100  4.125  4.150  4.175  4.200  4.225  4.250  4.275  4.300  4.325  4.350  4.375  4.400  4.425  4.450  4.475  4.500  4.525  4.550  4.575  4.600  4.625  4.650  4.675  4.700  4.725  4.750  4.775  4.800  4.825  4.850  4.875  4.900  4.925  4.950  4.975  5.00  5.025  5.050  5.075  5.100  5.125  5.150  5.175  5.200 5.225  5.250  5.275  5.300  5.325  5.350  5.375  5.400  5.425  5.450  5.475  5.500  5.525  5.550  5.575  5.600  5.625  5.650  5.675  5.700  5.725  5.750  5.775  5.800  5.825  5.850  5.875  5.900  5.925  5.950  5.975  6.000
+  } {
+      add EtaPhiBins $eta $PhiBins
+  }
+
+
+  # default energy fractions {abs(PDG code)} {Fecal Fhcal}
+  add EnergyFraction {0} {0.0 1.0}
+  # energy fractions for e, gamma and pi0
+  add EnergyFraction {11} {1.0 0.0}
+  add EnergyFraction {22} {1.0 0.0}
+  add EnergyFraction {111} {1.0 0.0}
+  # energy fractions for muon, neutrinos and neutralinos
+  add EnergyFraction {12} {0.0 0.0}
+  add EnergyFraction {13} {0.0 0.0}
+  add EnergyFraction {14} {0.0 0.0}
+  add EnergyFraction {16} {0.0 0.0}
+  add EnergyFraction {1000022} {0.0 0.0}
+  add EnergyFraction {1000023} {0.0 0.0}
+  add EnergyFraction {1000025} {0.0 0.0}
+  add EnergyFraction {1000035} {0.0 0.0}
+  add EnergyFraction {1000045} {0.0 0.0}
+  # energy fractions for K0short and Lambda
+  add EnergyFraction {310} {0.3 0.7}
+  add EnergyFraction {3122} {0.3 0.7}
+
+## no minimum p range given (Uta 22.12.16) - update with max 16.3.17 improved constant terms
+## sigma_E = E* (a/sqrt(E) + b) = sqrt ( E*a^2 E +E^2*b^2 )
+## a = sampling term, b = constant term 
+# ECAL eta : 5.0 - 2.7 - -2.1 - -4.4 (subtract -0.1 in eta as safety distance to edges) 
+    set ECalResolutionFormula {                  ( eta <= 5.5 && eta > 3.0  && energy > 0.1 ) * sqrt(energy*0.1^2 + energy^2*0.01^2)  + \
+                             ( eta <= 3.0 && eta >= -2.7 && energy > 0.1 ) * sqrt(energy*0.09^2 + energy^2*0.01^2)         +
+     \                            ( eta < -2.7 && eta >= -5.2 && energy > 0.1  ) * sqrt(energy*0.1^2 + energy^2*0.01^2) }
+    
+#### HCAL eta : 5.1 - 2.1 - -1.7 - -4.6 (subtract -0.1 in eta as safety distance to edges) 
+#set HCalResolutionFormula {resolution formula as a function of eta and energy}
+
+    set HCalResolutionFormula {  ( eta >= 5.9 && eta > 2.5 ) * sqrt(energy*0.3^2 + energy^2*0.01^2)  + \
+				     ( eta <=2.5 && eta >= -2.2 ) * sqrt(energy*0.4^2 + energy^2*0.01^2)         + \   
+	( eta < -2.2 && eta >= -5.5 ) * sqrt(energy*0.4^2 + energy^2*0.02^2) }
+
+### HCal from Tanaka-san LHEC Hbb study
+#set ECalResolutionFormula {                  (abs(eta) <= 3.0) * sqrt(energy^2*0.007^2 + energy*0.07^2 + 0.35^2)  + \
+#                             (abs(eta) > 3.0 && abs(eta) <= 4.0) * sqrt(energy^2*0.02^2 + energy*0.2^2)           +
+# \                             (abs(eta) > 4.0 && abs(eta) <= 5.0) * sqrt(energy^2*0.10^2 + energy*0.4^2)}
+
+# uta gues inspired by ILC particle flow resolution
+  # set HCalResolutionFormula {resolution formula as a function of eta and energy}
+#  set HCalResolutionFormula {                  (abs(eta) <= 2.0) * sqrt(energy^2*0.030^2 + energy*0.35^2) + \
+#                             (abs(eta) > 2.0 && abs(eta) <= 5.0) * sqrt(energy^2*0.050^2 + energy*0.45^2)}
+
+
+    
+}
+####################
+# Energy flow merger
+####################
+
+module Merger EFlowMerger {
+# add InputArray InputArray
+# exchange UK:  25.7.16 change back to all eflowtracks!
+#  add InputArray ImpactParameterSmearing/tracks
+  add InputArray Calorimeter/eflowTracks
+  add InputArray Calorimeter/eflowPhotons
+  add InputArray Calorimeter/eflowNeutralHadrons
+  set OutputArray eflow
+}
+######################
+# EFlowFilter
+######################
+
+module PdgCodeFilter EFlowFilter {
+  set InputArray EFlowMerger/eflow
+  set OutputArray eflow
+  
+  add PdgCode {11}
+  add PdgCode {-11}
+  add PdgCode {13}
+  add PdgCode {-13}
+}
+
+
+###################
+# Photon efficiency
+###################
+
+module Efficiency PhotonEfficiency {
+#  set InputArray Calorimeter/eflowPhotons
+# 21.7.16 use photons
+  set InputArray Calorimeter/photons
+  set OutputArray photons
+
+  # set EfficiencyFormula {efficiency formula as a function of eta and pt}
+
+  # efficiency formula for photons - same as for  electrons
+# expand and set flat
+ # set to 1
+  set EfficiencyFormula {  (pt <= 0.5) * (0.00) + (pt > 0.5) *( (eta <=5.4 && eta >= -5.1) ) * (1.0) + \
+			       ((eta > 5.4 || eta < -5.1)) * (0.00)} 
+
+} 
+
+##################
+# Photon isolation
+##################
+
+module Isolation PhotonIsolation {
+  set CandidateInputArray PhotonEfficiency/photons
+#  set IsolationInputArray EFlowMerger/eflow
+ 	set IsolationInputArray EFlowFilter/eflow
+
+  set OutputArray photons
+
+  set DeltaRMax 0.3
+
+  set PTMin 0.5
+
+  set PTRatioMax 0.1
+}
+#################
+# Electron filter
+#################
+
+module PdgCodeFilter ElectronFilter {
+  set InputArray Calorimeter/eflowTracks
+  set OutputArray electrons
+  set Invert true
+    add PdgCode {11}
+    add PdgCode {-11}
+}
+
+
+
+#################
+# Muon filter
+#################
+
+module PdgCodeFilter MuonFilter {
+  set InputArray Calorimeter/eflowTracks
+  set OutputArray muons
+  set Invert true
+    add PdgCode {13}
+    add PdgCode {-13}
+}
+
+
+#####################
+# Electron efficiency
+#####################
+
+module Efficiency ElectronEfficiency {
+#  set InputArray ElectronEnergySmearing/electrons
+  set InputArray ElectronFilter/electrons
+  set OutputArray electrons
+
+  # set EfficiencyFormula {efficiency formula as a function of eta and pt}
+
+  # efficiency formula for electrons
+# set to 1 for eta<4.7 1 degree 
+   set EfficiencyFormula {   (pt <= 0.5) * (0.00) + (pt > 0.5) *( (eta <=5.4 && eta >= -5.1) ) * (1.0) + \
+			       ((eta > 5.4 || eta < -5.1)) * (0.00)} 
+# set EfficiencyFormula {                 (abs(eta) <= 4.7)  * (1.0) + \
+#                         (abs(eta) > 4.7)    * (0.00)}
+}
+
+####################
+# Electron isolation
+####################
+
+module Isolation ElectronIsolation {
+  set CandidateInputArray ElectronEfficiency/electrons
+#  set IsolationInputArray EFlowMerger/eflow
+  set IsolationInputArray EFlowFilter/eflow
+
+  set OutputArray electrons
+
+  set DeltaRMax 0.3
+
+  set PTMin 0.5
+
+  set PTRatioMax 0.1
+}
+
+#################
+# Muon efficiency
+#################
+
+module Efficiency MuonEfficiency {
+  set InputArray MuonMomentumSmearing/muons
+  set OutputArray muons
+
+  # set EfficiencyFormula {efficiency as a function of eta and pt}
+
+  # efficiency formula for muons
+# set to 1 for eta<4
+  set EfficiencyFormula {     (pt <= 0.5) * (0.00) + (pt > 0.5) *(abs(eta) <= 4)  * (1.0) + \
+                         (abs(eta) > 4)                                   * (0.00)}
+}
+
+################
+# Muon isolation
+################
+
+module Isolation MuonIsolation {
+  set CandidateInputArray MuonEfficiency/muons
+#  set IsolationInputArray EFlowMerger/eflow
+  set IsolationInputArray EFlowFilter/eflow
+
+  set OutputArray muons
+
+  set DeltaRMax 0.3
+
+  set PTMin 0.5
+
+  set PTRatioMax 0.1
+}
+
+###################
+# Missing ET merger
+###################
+
+module Merger MissingET {
+# add InputArray InputArray
+  add InputArray EFlowMerger/eflow
+  set MomentumOutputArray momentum
+}
+#########################
+# Gen Missing ET merger
+########################
+
+module Merger GenMissingET {
+
+# add InputArray InputArray
+  add InputArray NeutrinoFilter/filteredParticles
+  set MomentumOutputArray momentum
+}
+
+
+##################
+# Scalar HT merger
+##################
+
+module Merger ScalarHT {
+# add InputArray InputArray
+  add InputArray UniqueObjectFinder/jets
+  add InputArray UniqueObjectFinder/electrons
+  add InputArray UniqueObjectFinder/photons
+  add InputArray UniqueObjectFinder/muons
+  set EnergyOutputArray energy
+}
+#################
+# Neutrino Filter
+#################
+
+module PdgCodeFilter NeutrinoFilter {
+
+  set InputArray Delphes/stableParticles
+  set OutputArray filteredParticles
+
+  set PTMin 0.0
+
+  add PdgCode {12}
+  add PdgCode {14}
+  add PdgCode {16}
+  add PdgCode {-12}
+  add PdgCode {-14}
+  add PdgCode {-16}
+
+}
+
+
+#####################
+# MC truth jet finder
+#####################
+
+module FastJetFinder GenJetFinder {
+  set InputArray Delphes/stableParticles
+
+  set OutputArray jets
+
+  # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt
+  set JetAlgorithm 6
+  set ParameterR 0.4
+
+  set JetPTMin 3.0
+}
+
+############
+# Jet finder
+############
+
+module FastJetFinder FastJetFinder {
+# ATLAS uses towers
+#  set InputArray Calorimeter/towers
+# CMS and we  use eflow
+ set InputArray EFlowMerger/eflow
+
+  set OutputArray jets
+
+  # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt
+  set JetAlgorithm 6
+  set ParameterR 0.4
+
+  set JetPTMin 3.0
+}
+
+##################
+# Jet Energy Scale
+##################
+
+module EnergyScale JetEnergyScale {
+  set InputArray FastJetFinder/jets
+  set OutputArray jets
+
+ # scale formula for jets
+  set ScaleFormula {1.00}
+}
+########################
+# GenJet Flavor Association
+########################
+
+module JetFlavorAssociation GenJetFlavorAssociation {
+  set PartonInputArray Delphes/partons
+  set ParticleInputArray Delphes/allParticles
+  set ParticleLHEFInputArray Delphes/allParticlesLHEF
+  set JetInputArray GenJetFinder/jets
+# 18.4.17 enhance pt cut and eta range -> eta cut in tagging modules
+# change deltaR of 0.4 back to FCC-hh delta_R cut of 0.5
+  set DeltaR 0.5
+#  set PartonPTMin 0.5
+  set PartonPTMin 1.0
+ # set PartonEtaMax 4.0
+ set PartonEtaMax 6.0
+
+}
+########################
+# Jet Flavor Association
+########################
+
+module JetFlavorAssociation JetFlavorAssociation {
+
+  set PartonInputArray Delphes/partons
+  set ParticleInputArray Delphes/allParticles
+  set ParticleLHEFInputArray Delphes/allParticlesLHEF
+  set JetInputArray JetEnergyScale/jets
+
+# 18.4.17 enhance pt cut and eta range -> eta cut in tagging modules
+  set DeltaR 0.5
+#  set PartonPTMin 0.5
+  set PartonPTMin 1.0
+ # set PartonEtaMax 4.0
+ set PartonEtaMax 6.0
+
+}
+
+#################
+# Gen b-tagging
+#################
+module BTagging GenBTagging {
+#  set PartonInputArray Delphes/partons
+  set JetInputArray GenJetFinder/jets
+
+# 18.4.17 taken from FCC hh but lower pt cut from 10 to 4
+  set BitNumber 0	
+ 
+  add EfficiencyFormula {0} {
+
+  (pt <= 4.0)                       * (0.00) +
+  (abs(eta) < 2.5)                   * (pt > 4.0 && pt < 500)      * (0.001) + \
+  (abs(eta) < 2.5)                   * (pt > 500.0 && pt < 20000.0) * (0.001)*(1.0 - pt/20000.) + \
+  (abs(eta) < 2.5)                   * (pt > 20000.0)               * (0.000) + \
+  (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 4.0 && pt < 500)      * (0.00075) + \
+  (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 500.0 && pt < 20000.0) * (0.00075)*(1.0 - pt/20000.) + \
+  (abs(eta) < 2.5 && abs(eta) < 4.0) * (pt > 20000.0)               * (0.000) + \
+  (abs(eta) > 4.0) * (0.00)}
+
+  add EfficiencyFormula {4} {
+
+  (pt <= 4.0)                       * (0.00) +
+  (abs(eta) < 2.5)                   * (pt > 4.0 && pt < 500)      * (0.04) + \
+  (abs(eta) < 2.5)                   * (pt > 500.0 && pt < 20000.0) * (0.04)*(1.0 - pt/20000.) + \
+  (abs(eta) < 2.5)                   * (pt > 20000.0)               * (0.000) + \
+  (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 4.0 && pt < 500)      * (0.03) + \
+  (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 500.0 && pt < 20000.0) * (0.03)*(1.0 - pt/20000.) + \
+  (abs(eta) < 2.5 && abs(eta) < 4.0) * (pt > 20000.0)               * (0.000) + \
+  (abs(eta) > 4.0) * (0.00)}
+
+  add EfficiencyFormula {5} {
+
+  (pt <= 4.0)                                                       * (0.00) +
+  (abs(eta) < 2.5)                    * (pt > 4.0 && pt < 500)      * (0.85) + 
+  (abs(eta) < 2.5)                    * (pt > 500.0 && pt < 20000.0) * (0.85)*(1.0 - pt/20000.) + 
+  (abs(eta) < 2.5)                    * (pt > 20000.0)               * (0.000) + 
+  (abs(eta) >= 2.5 && abs(eta) < 4.0) * (pt > 4.0 && pt < 500)      * (0.64) + 
+  (abs(eta) >= 2.5 && abs(eta) < 4.0) * (pt > 500.0 && pt < 20000.0) * (0.64)*(1.0 - pt/20000.) + 
+  (abs(eta) <= 2.5 && abs(eta) < 4.0) * (pt > 20000.0)               * (0.000) + 
+  (abs(eta) >= 4.0) * (0.00)}
+
+}
+
+#################
+# Rec b-tagging
+#################
+module BTagging BTagging {
+#  set PartonInputArray Delphes/partons
+  set JetInputArray JetEnergyScale/jets
+
+# 18.4.17 taken from FCC hh but lower pt cut from 10 to 4
+  set BitNumber 0	
+ 
+  add EfficiencyFormula {0} {
+
+  (pt <= 4.0)                       * (0.00) +
+  (abs(eta) < 2.5)                   * (pt > 4.0 && pt < 500)      * (0.001) + \
+  (abs(eta) < 2.5)                   * (pt > 500.0 && pt < 20000.0) * (0.001)*(1.0 - pt/20000.) + \
+  (abs(eta) < 2.5)                   * (pt > 20000.0)               * (0.000) + \
+  (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 4.0 && pt < 500)      * (0.00075) + \
+  (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 500.0 && pt < 20000.0) * (0.00075)*(1.0 - pt/20000.) + \
+  (abs(eta) < 2.5 && abs(eta) < 4.0) * (pt > 20000.0)               * (0.000) + \
+  (abs(eta) > 4.0) * (0.00)}
+
+  add EfficiencyFormula {4} {
+
+  (pt <= 4.0)                       * (0.00) +
+  (abs(eta) < 2.5)                   * (pt > 4.0 && pt < 500)      * (0.04) + \
+  (abs(eta) < 2.5)                   * (pt > 500.0 && pt < 20000.0) * (0.04)*(1.0 - pt/20000.) + \
+  (abs(eta) < 2.5)                   * (pt > 20000.0)               * (0.000) + \
+  (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 4.0 && pt < 500)      * (0.03) + \
+  (abs(eta) > 2.5 && abs(eta) < 4.0) * (pt > 500.0 && pt < 20000.0) * (0.03)*(1.0 - pt/20000.) + \
+  (abs(eta) < 2.5 && abs(eta) < 4.0) * (pt > 20000.0)               * (0.000) + \
+  (abs(eta) > 4.0) * (0.00)}
+
+  add EfficiencyFormula {5} {
+
+  (pt <= 4.0)                                                       * (0.00) +
+  (abs(eta) < 2.5)                    * (pt > 4.0 && pt < 500)      * (0.85) + 
+  (abs(eta) < 2.5)                    * (pt > 500.0 && pt < 20000.0) * (0.85)*(1.0 - pt/20000.) + 
+  (abs(eta) < 2.5)                    * (pt > 20000.0)               * (0.000) + 
+  (abs(eta) >= 2.5 && abs(eta) < 4.0) * (pt > 4.0 && pt < 500)      * (0.64) + 
+  (abs(eta) >= 2.5 && abs(eta) < 4.0) * (pt > 500.0 && pt < 20000.0) * (0.64)*(1.0 - pt/20000.) + 
+  (abs(eta) <= 2.5 && abs(eta) < 4.0) * (pt > 20000.0)               * (0.000) + 
+  (abs(eta) >= 4.0) * (0.00)}
+
+}
+#################
+# Gen  c-tagging
+#################
+
+module BTagging GenCTagging {
+#  set PartonInputArray Delphes/partons
+  set JetInputArray GenJetFinder/jets
+
+
+  set BitNumber 1
+
+  add EfficiencyFormula {0} {
+
+  (pt <= 4.0)     * (0.00) +
+  (abs(eta) < 4.0) * (pt > 4.0) * (0.01) + \
+  (abs(eta) > 4.0) * (pt > 4.0) * (0.00)}
+
+  add EfficiencyFormula {4} {
+
+  (pt <= 4.0)     * (0.00) +
+  (abs(eta) < 4.0) * (pt > 4.0) * (0.10) + \
+  (abs(eta) > 4.0) * (pt > 4.0) * (0.00)}
+
+  add EfficiencyFormula {5} {
+
+  (pt <= 4.0)     * (0.00) +
+  (abs(eta) < 4.0) * (pt > 4.0) * (0.25) + \
+  (abs(eta) > 4.0) * (pt > 4.0) * (0.00)}
+
+}
+
+#################
+# Rec  c-tagging
+#################
+
+module BTagging CTagging {
+#  set PartonInputArray Delphes/partons
+  set JetInputArray JetEnergyScale/jets	
+
+
+  set BitNumber 1
+
+  add EfficiencyFormula {0} {
+
+  (pt <= 4.0)     * (0.00) +
+  (abs(eta) < 4.0) * (pt > 4.0) * (0.01) + \
+  (abs(eta) > 4.0) * (pt > 4.0) * (0.00)}
+
+  add EfficiencyFormula {4} {
+
+  (pt <= 4.0)     * (0.00) +
+  (abs(eta) < 4.0) * (pt > 4.0) * (0.10) + \
+  (abs(eta) > 4.0) * (pt > 4.0) * (0.00)}
+
+  add EfficiencyFormula {5} {
+
+  (pt <= 4.0)     * (0.00) +
+  (abs(eta) < 4.0) * (pt > 4.0) * (0.25) + \
+  (abs(eta) > 4.0) * (pt > 4.0) * (0.00)}
+
+}
+module TauTagging TauTagging {
+  set ParticleInputArray Delphes/allParticles
+  set PartonInputArray Delphes/partons
+  set JetInputArray JetEnergyScale/jets
+
+  set DeltaR 0.5
+
+  set TauPTMin 0.5
+
+  set TauEtaMax 6.0
+
+  # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt}
+
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.001}
+  # efficiency formula for tau-jets
+  add EfficiencyFormula {15} { (pt <= 0.5) * (0.00) + (pt > 0.5) * (0.4) }
+}
+
+module TauTagging GenTauTagging {
+  set ParticleInputArray Delphes/allParticles
+  set PartonInputArray Delphes/partons
+  set JetInputArray GenJetFinder/jets
+
+  set DeltaR 0.4
+
+  set TauPTMin 0.5
+
+  set TauEtaMax 6.0
+
+  # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt}
+
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.001}
+  # efficiency formula for tau-jets
+  add EfficiencyFormula {15} { (pt <= 0.5) * (0.00) + (pt > 0.5) * (0.4) }
+}
+
+
+
+#####################################################
+# Find uniquely identified photons/electrons/tau/jets
+#####################################################
+
+module UniqueObjectFinder UniqueObjectFinder {
+# earlier arrays take precedence over later ones
+# add InputArray InputArray OutputArray
+  add InputArray PhotonIsolation/photons photons
+  add InputArray ElectronIsolation/electrons electrons
+  add InputArray MuonIsolation/muons muons
+  add InputArray JetEnergyScale/jets jets
+}
+
+##################
+# ROOT tree writer
+##################
+
+# tracks, towers and eflow objects are not stored by default in the output.
+# if needed (for jet constituent or other studies), uncomment the relevant
+# "add Branch ..." lines.
+
+module TreeWriter TreeWriter {
+# add Branch InputArray BranchName BranchClass
+  add Branch Delphes/allParticles Particle GenParticle
+
+  add Branch TrackMerger/tracks Track Track
+  #add Branch Calorimeter/towers Tower Tower
+
+  #add Branch Calorimeter/eflowTracks EFlowTrack Track
+  #add Branch Calorimeter/eflowPhotons EFlowPhoton Tower
+  #add Branch Calorimeter/eflowNeutralHadrons EFlowNeutralHadron Tower
+
+  add Branch GenJetFinder/jets GenJet Jet
+  add Branch UniqueObjectFinder/jets Jet Jet
+  add Branch UniqueObjectFinder/electrons Electron Electron
+  add Branch UniqueObjectFinder/photons Photon Photon
+  add Branch UniqueObjectFinder/muons Muon Muon
+  add Branch MissingET/momentum MissingET MissingET
+  add Branch ScalarHT/energy ScalarHT ScalarHT
+}
Index: cards/delphes_card_IDEA.tcl
===================================================================
--- cards/delphes_card_IDEA.tcl	(revision a5af1df1cf2ca5a488fc610ab546c762b7cdb5f2)
+++ cards/delphes_card_IDEA.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -1,11 +1,25 @@
+set RandomSeed 123
+
 ####################################################################                                l
-# FCC-ee IDEA detector model                                                                                      
-#                                                                                                    
-# Authors: Elisa Fontanesi, Lorenzo Pezzotti, Massimiliano Antonello                                 
+# FCC-ee IDEA detector model
+#
+# Authors: Elisa Fontanesi, Lorenzo Pezzotti, Massimiliano Antonello, Michele Selvaggi
 # email: efontane@bo.infn.it,
-#        lorenzo.pezzotti01@universitadipavia.it,                                                    
-#        m.antonello@uninsubria.it,                                                                  
-#####################################################################                                
-#       
+#        lorenzo.pezzotti01@universitadipavia.it,
+#        m.antonello@uninsubria.it,
+#        michele.selvaggi@cern.ch
+#####################################################################
+
+## MOD2: set vtx mode timing to MC truth
+
+set B 2.0
+
+## Drift chamber coordinates
+set DCHZMIN -2.125
+set DCHZMAX 2.125
+set DCHRMIN 0.345
+set DCHRMAX 2.02
+
+
 #######################################
 # Order of execution of various modules
@@ -13,4 +27,6 @@
 
 set ExecutionPath {
+
+  TruthVertexFinder
   ParticlePropagator
 
@@ -19,14 +35,24 @@
   MuonTrackingEfficiency
 
-  ChargedHadronMomentumSmearing
-  ElectronMomentumSmearing
-  MuonMomentumSmearing
-
-  TrackMerger 
+  TrackMergerPre
+  TrackSmearing
+  ClusterCounting
+  TimeSmearing
+  TimeOfFlight
+
+  TrackMerger
+  ForwardLooperTracks
   Calorimeter
+
+  TimeSmearingNeutrals
+  TimeOfFlightNeutralHadron
+
+  EFlowTrackMerger
   EFlowMerger
 
   PhotonEfficiency
   PhotonIsolation
+
+  MuonFilter
 
   ElectronFilter
@@ -42,5 +68,5 @@
   GenJetFinder
   GenMissingET
-  
+
   FastJetFinder
 
@@ -52,10 +78,19 @@
   TauTagging
 
-  UniqueObjectFinder
-
-  ScalarHT
   TreeWriter
 }
 
+#################################
+# Truth Vertex Finder
+#################################
+
+module TruthVertexFinder TruthVertexFinder {
+
+  ## below this distance two vertices are assumed to be merged
+  set Resolution 1E-06
+
+  set InputArray Delphes/stableParticles
+  set VertexOutputArray vertices
+}
 
 #################################
@@ -78,5 +113,5 @@
 
   # magnetic field, in T
-  set Bz 2.0
+  set Bz $B
 }
 
@@ -88,17 +123,12 @@
     set InputArray ParticlePropagator/chargedHadrons
     set OutputArray chargedHadrons
-    # We use only one efficiency, we set only 0 effincency out of eta bounds:
+    set UseMomentumVector true
 
     set EfficiencyFormula {
-        (abs(eta) > 3.0)                                       * (0.000) +
-        (energy >= 0.5) * (abs(eta) <= 3.0)                    * (0.997) +
-        (energy < 0.5 && energy >= 0.3) * (abs(eta) <= 3.0)    * (0.65) +
-        (energy < 0.3) * (abs(eta) <= 3.0)                     * (0.06)
-    }
-}
-
-#	(pt <= 0.1)                                     * (0.00) + 
-#	(abs(eta) <= 3.0)               * (pt > 0.1)    * (1.00) +
-#	(abs(eta) > 3)                                  * (0.00)
+        (abs(eta) > 2.56)                                  * (0.000) +
+        (pt < 0.1) * (abs(eta) <= 2.56)                    * (0.000) +
+        (pt >= 0.1) * (abs(eta) <= 2.56)                   * (1.000)
+    }
+}
 
 
@@ -111,13 +141,11 @@
     set InputArray ParticlePropagator/electrons
     set OutputArray electrons
-
-
-    # Current full simulation with CLICdet provides for electrons:
+    set UseMomentumVector true
+
     set EfficiencyFormula {
-        (abs(eta) > 3.0)                                       * (0.000) +
-        (energy >= 0.5) * (abs(eta) <= 3.0)                    * (0.997) +
-        (energy < 0.5 && energy >= 0.3) * (abs(eta) <= 3.0)    * (0.65) +
-        (energy < 0.3) * (abs(eta) <= 3.0)                     * (0.06)
-    } 
+        (abs(eta) > 2.56)                                  * (0.000) +
+        (pt < 0.1) * (abs(eta) <= 2.56)                    * (0.000) +
+        (pt >= 0.1) * (abs(eta) <= 2.56)                   * (1.000)
+    }
 }
 
@@ -130,58 +158,10 @@
     set InputArray ParticlePropagator/muons
     set OutputArray muons
-
-    # Current full simulation with CLICdet provides for muons:
+    set UseMomentumVector true
+
     set EfficiencyFormula {
-        (abs(eta) > 3.0)                                       * (0.000) +
-        (energy >= 0.5) * (abs(eta) <= 3.0)                    * (0.997) +
-        (energy < 0.5 && energy >= 0.3) * (abs(eta) <= 3.0)    * (0.65) +
-        (energy < 0.3) * (abs(eta) <= 3.0)                     * (0.06)
-    }
-}
-
-
-########################################
-# Momentum resolution for charged tracks
-########################################
-
-module MomentumSmearing ChargedHadronMomentumSmearing {
-    set InputArray ChargedHadronTrackingEfficiency/chargedHadrons
-    set OutputArray chargedHadrons
-
-
-    # Resolution given in dpT/pT.
-    # IDEAdet
-    set ResolutionFormula {
-	(abs(eta) <= 3.0)                   * sqrt(0.0006^2 + (pt*7.e-5)^2)
-    }
-}
-
-###################################
-# Momentum resolution for electrons
-###################################
-
-module MomentumSmearing ElectronMomentumSmearing {
-    set InputArray ElectronTrackingEfficiency/electrons
-    set OutputArray electrons
-
-    # Resolution given in dpT/pT.
-    # IDEAdet
-    set ResolutionFormula {
-	(abs(eta) <= 3.0)                   * sqrt(0.0006^2 + (pt*7.e-5)^2)
-    }  
-}
-
-###############################
-# Momentum resolution for muons
-###############################
-
-module MomentumSmearing MuonMomentumSmearing {
-    set InputArray MuonTrackingEfficiency/muons
-    set OutputArray muons
-
-    # Resolution given in dpT/pT.
-    # IDEAdet
-    set ResolutionFormula {
-	(abs(eta) <= 3.0)                   * sqrt(0.0006^2 + (pt*7.e-5)^2)
+        (abs(eta) > 2.56)                                  * (0.000) +
+        (pt < 0.1) * (abs(eta) <= 2.56)                    * (0.000) +
+        (pt >= 0.1) * (abs(eta) <= 2.56)                   * (1.000)
     }
 }
@@ -191,16 +171,293 @@
 ##############
 
+module Merger TrackMergerPre {
+# add InputArray InputArray
+  add InputArray ChargedHadronTrackingEfficiency/chargedHadrons
+  add InputArray ElectronTrackingEfficiency/electrons
+  add InputArray MuonTrackingEfficiency/muons
+  set OutputArray tracks
+}
+
+
+
+########################################
+# Smearing for charged tracks
+########################################
+
+module TrackCovariance TrackSmearing {
+
+    set InputArray TrackMergerPre/tracks
+    set OutputArray tracks
+
+    ## minimum number of hits to accept a track
+    set NMinHits 6
+
+    ## magnetic field
+    set Bz $B
+
+    ## uses https://raw.githubusercontent.com/selvaggi/FastTrackCovariance/master/GeoIDEA_BASE.txt
+    set DetectorGeometry {
+
+
+      # Layer type 1 = R (barrel) or 2 = z (forward/backward)
+      # Layer label
+      # Minimum dimension z for barrel or R for forward
+      # Maximum dimension z for barrel or R for forward
+      # R/z location of layer
+      # Thickness (meters)
+      # Radiation length (meters)
+      # Number of measurements in layers (1D or 2D)
+      # Stereo angle (rad) - 0(pi/2) = axial(z) layer - Upper side
+      # Stereo angle (rad) - 0(pi/2) = axial(z) layer - Lower side
+      # Resolution Upper side (meters) - 0 = no measurement
+      # Resolution Lower side (meters) - 0 = no measurement
+      # measurement flag = T, scattering only = F
+
+      # barrel  name       zmin   zmax   r        w (m)      X0        n_meas  th_up (rad) th_down (rad)    reso_up (m)   reso_down (m)  flag
+
+      # barrel  name       zmin   zmax   r        w (m)      X0        n_meas  th_up (rad) th_down (rad)    reso_up (m)   reso_down (m)  flag
+
+      1        PIPE       -100    100    0.015    0.001655  0.2805     0        0          0                0             0              0
+      1        VTXLOW     -0.12   0.12   0.017    0.00028   0.0937     2        0          1.5708           3e-006        3e-006         1
+      1        VTXLOW     -0.16   0.16   0.023    0.00028   0.0937     2        0          1.5708           3e-006        3e-006         1
+      1        VTXLOW     -0.16   0.16   0.031    0.00028   0.0937     2        0          1.5708           3e-006        3e-006         1
+      1        VTXHIGH    -1      1      0.32     0.00047   0.0937     2        0          1.5708           7e-006        7e-006         1
+      1        VTXHIGH    -1.05   1.05   0.34     0.00047   0.0937     2        0          1.5708           7e-006        7e-006         1
+
+      # endcap  name       rmin   rmax   z        w (m)      X0        n_meas   th_up (rad)  th_down (rad)   reso_up (m)   reso_down (m) flag
+
+      2        VTXDSK      0.141  0.3   -0.92     0.00028   0.0937     2        0          1.5708           7e-006        7e-006         1
+      2        VTXDSK      0.138  0.3   -0.9      0.00028   0.0937     2        0          1.5708           7e-006        7e-006         1
+      2        VTXDSK      0.065  0.3   -0.42     0.00028   0.0937     2        0          1.5708           7e-006        7e-006         1
+      2        VTXDSK      0.062  0.3   -0.4      0.00028   0.0937     2        0          1.5708           7e-006        7e-006         1
+      2        VTXDSK      0.062  0.3    0.4      0.00028   0.0937     2        0          1.5708           7e-006        7e-006         1
+      2        VTXDSK      0.065  0.3    0.42     0.00028   0.0937     2        0          1.5708           7e-006        7e-006         1
+      2        VTXDSK      0.138  0.3    0.9      0.00028   0.0937     2        0          1.5708           7e-006        7e-006         1
+      2        VTXDSK      0.141  0.3    0.92     0.00028   0.0937     2        0          1.5708           7e-006        7e-006         1
+
+      1 DCHCANI $DCHZMIN $DCHZMAX $DCHRMIN 0.0002 0.237223 0 0 0 0 0 0
+      1 DCH -2 2 0.36 0.0147748 1400 1 0.0203738 0 0.0001 0 1
+      1 DCH -2 2 0.374775 0.0147748 1400 1 -0.0212097 0 0.0001 0 1
+      1 DCH -2 2 0.38955 0.0147748 1400 1 0.0220456 0 0.0001 0 1
+      1 DCH -2 2 0.404324 0.0147748 1400 1 -0.0228814 0 0.0001 0 1
+      1 DCH -2 2 0.419099 0.0147748 1400 1 0.0237172 0 0.0001 0 1
+      1 DCH -2 2 0.433874 0.0147748 1400 1 -0.024553 0 0.0001 0 1
+      1 DCH -2 2 0.448649 0.0147748 1400 1 0.0253888 0 0.0001 0 1
+      1 DCH -2 2 0.463423 0.0147748 1400 1 -0.0262245 0 0.0001 0 1
+      1 DCH -2 2 0.478198 0.0147748 1400 1 0.0270602 0 0.0001 0 1
+      1 DCH -2 2 0.492973 0.0147748 1400 1 -0.0278958 0 0.0001 0 1
+      1 DCH -2 2 0.507748 0.0147748 1400 1 0.0287314 0 0.0001 0 1
+      1 DCH -2 2 0.522523 0.0147748 1400 1 -0.029567 0 0.0001 0 1
+      1 DCH -2 2 0.537297 0.0147748 1400 1 0.0304025 0 0.0001 0 1
+      1 DCH -2 2 0.552072 0.0147748 1400 1 -0.031238 0 0.0001 0 1
+      1 DCH -2 2 0.566847 0.0147748 1400 1 0.0320734 0 0.0001 0 1
+      1 DCH -2 2 0.581622 0.0147748 1400 1 -0.0329088 0 0.0001 0 1
+      1 DCH -2 2 0.596396 0.0147748 1400 1 0.0337442 0 0.0001 0 1
+      1 DCH -2 2 0.611171 0.0147748 1400 1 -0.0345795 0 0.0001 0 1
+      1 DCH -2 2 0.625946 0.0147748 1400 1 0.0354147 0 0.0001 0 1
+      1 DCH -2 2 0.640721 0.0147748 1400 1 -0.0362499 0 0.0001 0 1
+      1 DCH -2 2 0.655495 0.0147748 1400 1 0.0370851 0 0.0001 0 1
+      1 DCH -2 2 0.67027 0.0147748 1400 1 -0.0379202 0 0.0001 0 1
+      1 DCH -2 2 0.685045 0.0147748 1400 1 0.0387552 0 0.0001 0 1
+      1 DCH -2 2 0.69982 0.0147748 1400 1 -0.0395902 0 0.0001 0 1
+      1 DCH -2 2 0.714595 0.0147748 1400 1 0.0404252 0 0.0001 0 1
+      1 DCH -2 2 0.729369 0.0147748 1400 1 -0.04126 0 0.0001 0 1
+      1 DCH -2 2 0.744144 0.0147748 1400 1 0.0420949 0 0.0001 0 1
+      1 DCH -2 2 0.758919 0.0147748 1400 1 -0.0429296 0 0.0001 0 1
+      1 DCH -2 2 0.773694 0.0147748 1400 1 0.0437643 0 0.0001 0 1
+      1 DCH -2 2 0.788468 0.0147748 1400 1 -0.044599 0 0.0001 0 1
+      1 DCH -2 2 0.803243 0.0147748 1400 1 0.0454336 0 0.0001 0 1
+      1 DCH -2 2 0.818018 0.0147748 1400 1 -0.0462681 0 0.0001 0 1
+      1 DCH -2 2 0.832793 0.0147748 1400 1 0.0471025 0 0.0001 0 1
+      1 DCH -2 2 0.847568 0.0147748 1400 1 -0.0479369 0 0.0001 0 1
+      1 DCH -2 2 0.862342 0.0147748 1400 1 0.0487713 0 0.0001 0 1
+      1 DCH -2 2 0.877117 0.0147748 1400 1 -0.0496055 0 0.0001 0 1
+      1 DCH -2 2 0.891892 0.0147748 1400 1 0.0504397 0 0.0001 0 1
+      1 DCH -2 2 0.906667 0.0147748 1400 1 -0.0512738 0 0.0001 0 1
+      1 DCH -2 2 0.921441 0.0147748 1400 1 0.0521079 0 0.0001 0 1
+      1 DCH -2 2 0.936216 0.0147748 1400 1 -0.0529418 0 0.0001 0 1
+      1 DCH -2 2 0.950991 0.0147748 1400 1 0.0537757 0 0.0001 0 1
+      1 DCH -2 2 0.965766 0.0147748 1400 1 -0.0546095 0 0.0001 0 1
+      1 DCH -2 2 0.980541 0.0147748 1400 1 0.0554433 0 0.0001 0 1
+      1 DCH -2 2 0.995315 0.0147748 1400 1 -0.056277 0 0.0001 0 1
+      1 DCH -2 2 1.01009 0.0147748 1400 1 0.0571106 0 0.0001 0 1
+      1 DCH -2 2 1.02486 0.0147748 1400 1 -0.0579441 0 0.0001 0 1
+      1 DCH -2 2 1.03964 0.0147748 1400 1 0.0587775 0 0.0001 0 1
+      1 DCH -2 2 1.05441 0.0147748 1400 1 -0.0596108 0 0.0001 0 1
+      1 DCH -2 2 1.06919 0.0147748 1400 1 0.0604441 0 0.0001 0 1
+      1 DCH -2 2 1.08396 0.0147748 1400 1 -0.0612773 0 0.0001 0 1
+      1 DCH -2 2 1.09874 0.0147748 1400 1 0.0621104 0 0.0001 0 1
+      1 DCH -2 2 1.11351 0.0147748 1400 1 -0.0629434 0 0.0001 0 1
+      1 DCH -2 2 1.12829 0.0147748 1400 1 0.0637763 0 0.0001 0 1
+      1 DCH -2 2 1.14306 0.0147748 1400 1 -0.0646092 0 0.0001 0 1
+      1 DCH -2 2 1.15784 0.0147748 1400 1 0.0654419 0 0.0001 0 1
+      1 DCH -2 2 1.17261 0.0147748 1400 1 -0.0662746 0 0.0001 0 1
+      1 DCH -2 2 1.18739 0.0147748 1400 1 0.0671071 0 0.0001 0 1
+      1 DCH -2 2 1.20216 0.0147748 1400 1 -0.0679396 0 0.0001 0 1
+      1 DCH -2 2 1.21694 0.0147748 1400 1 0.068772 0 0.0001 0 1
+      1 DCH -2 2 1.23171 0.0147748 1400 1 -0.0696042 0 0.0001 0 1
+      1 DCH -2 2 1.24649 0.0147748 1400 1 0.0704364 0 0.0001 0 1
+      1 DCH -2 2 1.26126 0.0147748 1400 1 -0.0712685 0 0.0001 0 1
+      1 DCH -2 2 1.27604 0.0147748 1400 1 0.0721005 0 0.0001 0 1
+      1 DCH -2 2 1.29081 0.0147748 1400 1 -0.0729324 0 0.0001 0 1
+      1 DCH -2 2 1.30559 0.0147748 1400 1 0.0737642 0 0.0001 0 1
+      1 DCH -2 2 1.32036 0.0147748 1400 1 -0.0745958 0 0.0001 0 1
+      1 DCH -2 2 1.33514 0.0147748 1400 1 0.0754274 0 0.0001 0 1
+      1 DCH -2 2 1.34991 0.0147748 1400 1 -0.0762589 0 0.0001 0 1
+      1 DCH -2 2 1.36468 0.0147748 1400 1 0.0770903 0 0.0001 0 1
+      1 DCH -2 2 1.37946 0.0147748 1400 1 -0.0779215 0 0.0001 0 1
+      1 DCH -2 2 1.39423 0.0147748 1400 1 0.0787527 0 0.0001 0 1
+      1 DCH -2 2 1.40901 0.0147748 1400 1 -0.0795837 0 0.0001 0 1
+      1 DCH -2 2 1.42378 0.0147748 1400 1 0.0804147 0 0.0001 0 1
+      1 DCH -2 2 1.43856 0.0147748 1400 1 -0.0812455 0 0.0001 0 1
+      1 DCH -2 2 1.45333 0.0147748 1400 1 0.0820762 0 0.0001 0 1
+      1 DCH -2 2 1.46811 0.0147748 1400 1 -0.0829068 0 0.0001 0 1
+      1 DCH -2 2 1.48288 0.0147748 1400 1 0.0837373 0 0.0001 0 1
+      1 DCH -2 2 1.49766 0.0147748 1400 1 -0.0845677 0 0.0001 0 1
+      1 DCH -2 2 1.51243 0.0147748 1400 1 0.0853979 0 0.0001 0 1
+      1 DCH -2 2 1.52721 0.0147748 1400 1 -0.086228 0 0.0001 0 1
+      1 DCH -2 2 1.54198 0.0147748 1400 1 0.087058 0 0.0001 0 1
+      1 DCH -2 2 1.55676 0.0147748 1400 1 -0.0878879 0 0.0001 0 1
+      1 DCH -2 2 1.57153 0.0147748 1400 1 0.0887177 0 0.0001 0 1
+      1 DCH -2 2 1.58631 0.0147748 1400 1 -0.0895474 0 0.0001 0 1
+      1 DCH -2 2 1.60108 0.0147748 1400 1 0.0903769 0 0.0001 0 1
+      1 DCH -2 2 1.61586 0.0147748 1400 1 -0.0912063 0 0.0001 0 1
+      1 DCH -2 2 1.63063 0.0147748 1400 1 0.0920356 0 0.0001 0 1
+      1 DCH -2 2 1.64541 0.0147748 1400 1 -0.0928647 0 0.0001 0 1
+      1 DCH -2 2 1.66018 0.0147748 1400 1 0.0936937 0 0.0001 0 1
+      1 DCH -2 2 1.67495 0.0147748 1400 1 -0.0945226 0 0.0001 0 1
+      1 DCH -2 2 1.68973 0.0147748 1400 1 0.0953514 0 0.0001 0 1
+      1 DCH -2 2 1.7045 0.0147748 1400 1 -0.09618 0 0.0001 0 1
+      1 DCH -2 2 1.71928 0.0147748 1400 1 0.0970085 0 0.0001 0 1
+      1 DCH -2 2 1.73405 0.0147748 1400 1 -0.0978369 0 0.0001 0 1
+      1 DCH -2 2 1.74883 0.0147748 1400 1 0.0986651 0 0.0001 0 1
+      1 DCH -2 2 1.7636 0.0147748 1400 1 -0.0994932 0 0.0001 0 1
+      1 DCH -2 2 1.77838 0.0147748 1400 1 0.100321 0 0.0001 0 1
+      1 DCH -2 2 1.79315 0.0147748 1400 1 -0.101149 0 0.0001 0 1
+      1 DCH -2 2 1.80793 0.0147748 1400 1 0.101977 0 0.0001 0 1
+      1 DCH -2 2 1.8227 0.0147748 1400 1 -0.102804 0 0.0001 0 1
+      1 DCH -2 2 1.83748 0.0147748 1400 1 0.103632 0 0.0001 0 1
+      1 DCH -2 2 1.85225 0.0147748 1400 1 -0.104459 0 0.0001 0 1
+      1 DCH -2 2 1.86703 0.0147748 1400 1 0.105286 0 0.0001 0 1
+      1 DCH -2 2 1.8818 0.0147748 1400 1 -0.106113 0 0.0001 0 1
+      1 DCH -2 2 1.89658 0.0147748 1400 1 0.10694 0 0.0001 0 1
+      1 DCH -2 2 1.91135 0.0147748 1400 1 -0.107766 0 0.0001 0 1
+      1 DCH -2 2 1.92613 0.0147748 1400 1 0.108593 0 0.0001 0 1
+      1 DCH -2 2 1.9409 0.0147748 1400 1 -0.109419 0 0.0001 0 1
+      1 DCH -2 2 1.95568 0.0147748 1400 1 0.110246 0 0.0001 0 1
+      1 DCH -2 2 1.97045 0.0147748 1400 1 -0.111072 0 0.0001 0 1
+      1 DCH -2 2 1.98523 0.0147748 1400 1 0.111898 0 0.0001 0 1
+      1 DCH -2 2 2 0.0147748 1400 1 -0.112723 0 0.0001 0 1
+      1 DCHCANO $DCHZMIN $DCHZMAX $DCHRMAX $DCHRMAX 0.02 1.667 0 0 0 0 0 0
+      1 BSILWRP -2.35 2.35 2.04 0.00047 0.0937 2 0 1.5708 7e-006 9e-005 1
+      1 BSILWRP -2.35 2.35 2.06 0.00047 0.0937 2 0 1.5708 7e-006 9e-005 1
+      1 MAG -2.5 2.5 2.25 0.05 0.0658 0 0 0 0 0 0
+      1 BPRESH -2.55 2.55 2.45 0.02 1 2 0 1.5708 7e-005 0.01 1
+      2 DCHWALL $DCHRMIN $DCHRMAX $DCHZMAX 0.25 5.55 0 0 0 0 0 0
+      2 DCHWALL $DCHRMIN $DCHRMAX $DCHZMIN 0.25 5.55 0 0 0 0 0 0
+      2 FSILWRP 0.354 2.02 -2.32 0.00047 0.0937 2 0 1.5708 7e-006 9e-005 1
+      2 FSILWRP 0.35 2.02 -2.3 0.00047 0.0937 2 0 1.5708 7e-006 9e-005 1
+      2 FSILWRP 0.35 2.02 2.3 0.00047 0.0937 2 0 1.5708 7e-006 9e-005 1
+      2 FSILWRP 0.354 2.02 2.32 0.00047 0.0937 2 0 1.5708 7e-006 9e-005 1
+      2 FRAD 0.38 2.09 2.49 0.0043 0.005612 0 0 0 0 0 0
+      2 FRAD 0.38 2.09 -2.49 0.0043 0.005612 0 0 0 0 0 0
+      2 FPRESH 0.39 2.43 -2.55 0.02 1 2 0 1.5708 7e-005 0.01 1
+      2 FPRESH 0.39 2.43 2.55 0.02 1 2 0 1.5708 7e-005 0.01 1
+    }
+
+}
+
+###################
+# Cluster Counting
+###################
+
+module ClusterCounting ClusterCounting {
+
+  add InputArray TrackSmearing/tracks
+  set OutputArray tracks
+
+  set Bz $B
+
+  ## check that these are consistent with DCHCANI/DCHNANO parameters in TrackCovariance module
+  set Rmin $DCHRMIN
+  set Rmax $DCHRMAX
+  set Zmin $DCHZMIN
+  set Zmax $DCHZMAX
+
+  # gas mix option:
+  # 0:  Helium 90% - Isobutane 10%
+  # 1:  Helium 100%
+  # 2:  Argon 50% - Ethane 50%
+  # 3:  Argon 100%
+
+  set GasOption 0
+
+}
+
+
+########################################
+#   Time Smearing MIP
+########################################
+
+module TimeSmearing TimeSmearing {
+  set InputArray ClusterCounting/tracks
+  set OutputArray tracks
+
+  # assume constant 30 ps resolution for now
+  set TimeResolution {
+                       (abs(eta) > 0.0 && abs(eta) <= 3.0)* 30E-12
+                     }
+}
+
+
+########################################
+#   Time Of Flight Measurement
+########################################
+
+module TimeOfFlight TimeOfFlight {
+  set InputArray TimeSmearing/tracks
+  set VertexInputArray TruthVertexFinder/vertices
+
+  set OutputArray tracks
+
+  # 0: assume vertex time tV from MC Truth (ideal case)
+  # 1: assume vertex time tV = 0
+  # 2: calculate vertex time as vertex TOF, assuming tPV=0
+
+  set VertexTimeMode 0
+}
+
+##############
+# Track merger
+##############
+
 module Merger TrackMerger {
 # add InputArray InputArray
-  add InputArray ChargedHadronMomentumSmearing/chargedHadrons
-  add InputArray ElectronMomentumSmearing/electrons
-  add InputArray MuonMomentumSmearing/muons
+  add InputArray TimeOfFlight/tracks
   set OutputArray tracks
 }
 
 
-#############                                                                                                                         
-# Calorimeter                                                                                                                                            
-#############                                                                                                                                           
+######################
+# Looper Selection
+######################
+
+module Efficiency ForwardLooperTracks  {
+  set InputArray TrackMerger/tracks
+  set OutputArray tracks
+  set UseMomentumVector False
+
+  ## select looping tracks that end up in position |eta| > 3.142 (lost by calo)
+  set EfficiencyFormula {
+    (abs(eta) > 3.0 )                                 * (1.000) +
+    (abs(eta) <= 3.0 )                                * (0.000)
+  }
+
+}
+
+
+#############
+# Calorimeter
+#############
 module DualReadoutCalorimeter Calorimeter {
   set ParticleInputArray ParticlePropagator/stableParticles
@@ -216,25 +473,27 @@
   set ECalEnergyMin 0.5
   set HCalEnergyMin 0.5
+  set ECalEnergySignificanceMin 3.0
+  set HCalEnergySignificanceMin 3.0
+
   set EnergyMin 0.5
-  set ECalEnergySignificanceMin 1.0
-  set HCalEnergySignificanceMin 1.0
-  set EnergySignificanceMin 1.0
-
-  set SmearTowerCenter true
+  set EnergySignificanceMin 3.0
+
+  #set SmearTowerCenter true
+  set SmearTowerCenter false
     set pi [expr {acos(-1)}]
 
-    # Lists of the edges of each tower in eta and phi;                                                                                            
-    # each list starts with the lower edge of the first tower;                                                                                                    
-    # the list ends with the higher edged of the last tower.                                                                                        
-    # Barrel:  deta=0.02 towers up to |eta| <= 0.88 ( up to 45Â°)                                                                                        
-    # Endcaps: deta=0.02 towers up to |eta| <= 3.0 (8.6Â° = 100 mrad)                                                                                           
-    # Cell size: about 6 cm x 6 cm                                                  
-
-    #barrel:                                                                                        
+    # Lists of the edges of each tower in eta and phi;
+    # each list starts with the lower edge of the first tower;
+    # the list ends with the higher edged of the last tower.
+    # Barrel:  deta=0.02 towers up to |eta| <= 0.88 ( up to 45Â°)
+    # Endcaps: deta=0.02 towers up to |eta| <= 3.0 (8.6Â° = 100 mrad)
+    # Cell size: about 6 cm x 6 cm
+
+    #barrel:
     set PhiBins {}
     for {set i -120} {$i <= 120} {incr i} {
         add PhiBins [expr {$i * $pi/120}]
     }
-    #deta=0.02 units for |eta| <= 0.88                                                              
+    #deta=0.02 units for |eta| <= 0.88
     for {set i -44} {$i < 45} {incr i} {
         set eta [expr {$i * 0.02}]
@@ -242,16 +501,16 @@
     }
 
-    #endcaps:                                                                                       
+    #endcaps:
     set PhiBins {}
     for {set i -120} {$i <= 120} {incr i} {
         add PhiBins [expr {$i* $pi/120}]
     }
-    #deta=0.02 units for 0.88 < |eta| <= 3.0                                                        
-    #first, from -3.0 to -0.88                                                                      
-    for {set i 1} {$i <=106} {incr i} {
+    #deta=0.02 units for 0.88 < |eta| <= 3.0
+    #first, from -3.0 to -0.88
+    for {set i 0} {$i <=106} {incr i} {
         set eta [expr {-3.00 + $i * 0.02}]
         add EtaPhiBins $eta $PhiBins
     }
-    #same for 0.88 to 3.0                                                                           
+    #same for 0.88 to 3.0
     for  {set i 1} {$i <=106} {incr i} {
         set eta [expr {0.88 + $i * 0.02}]
@@ -259,11 +518,11 @@
     }
 
-    # default energy fractions {abs(PDG code)} {Fecal Fhcal}                                                                                  
+    # default energy fractions {abs(PDG code)} {Fecal Fhcal}
     add EnergyFraction {0} {0.0 1.0}
-    # energy fractions for e, gamma and pi0                                                                                                           
+    # energy fractions for e, gamma and pi0
     add EnergyFraction {11} {1.0 0.0}
     add EnergyFraction {22} {1.0 0.0}
     add EnergyFraction {111} {1.0 0.0}
-    # energy fractions for muon, neutrinos and neutralinos                                                                             
+    # energy fractions for muon, neutrinos and neutralinos
     add EnergyFraction {12} {0.0 0.0}
     add EnergyFraction {13} {0.0 0.0}
@@ -275,10 +534,11 @@
     add EnergyFraction {1000035} {0.0 0.0}
     add EnergyFraction {1000045} {0.0 0.0}
-    # energy fractions for K0short and Lambda                                                                                                            
+    # energy fractions for K0short and Lambda
     add EnergyFraction {310} {0.3 0.7}
+    add EnergyFraction {130} {0.3 0.7}
     add EnergyFraction {3122} {0.3 0.7}
 
 
-    # set ECalResolutionFormula {resolution formula as a function of eta and energy}                                
+    # set ECalResolutionFormula {resolution formula as a function of eta and energy}
     set ECalResolutionFormula {
     (abs(eta) <= 0.88 )                     * sqrt(energy^2*0.01^2 + energy*0.11^2)+
@@ -286,5 +546,5 @@
     }
 
-    # set HCalResolutionFormula {resolution formula as a function of eta and energy}                                                
+    # set HCalResolutionFormula {resolution formula as a function of eta and energy}
     set HCalResolutionFormula {
     (abs(eta) <= 0.88 )                     * sqrt(energy^2*0.01^2 + energy*0.30^2)+
@@ -293,4 +553,50 @@
 }
 
+########################################
+#   Time Smearing Neutrals
+########################################
+
+module TimeSmearing TimeSmearingNeutrals {
+  set InputArray Calorimeter/eflowNeutralHadrons
+  set OutputArray eflowNeutralHadrons
+
+  # assume constant 30 ps resolution for now
+  set TimeResolution {
+                       (abs(eta) > 0.0 && abs(eta) <= 3.0)* 30E-12
+                     }
+}
+
+########################################
+#   Time Of Flight Measurement
+########################################
+
+module TimeOfFlight TimeOfFlightNeutralHadron {
+  set InputArray TimeSmearingNeutrals/eflowNeutralHadrons
+  set VertexInputArray TruthVertexFinder/vertices
+
+  set OutputArray eflowNeutralHadrons
+
+  # 0: assume vertex time tV from MC Truth (ideal case)
+  # 1: assume vertex time tV = 0
+  # 2: calculate vertex time as vertex TOF, assuming tPV=0
+
+  ## TBF (add option to take hard vertex time)
+  set VertexTimeMode 1
+}
+
+
+############################
+# Energy flow track merger
+############################
+
+module Merger EFlowTrackMerger {
+# add InputArray InputArray
+  add InputArray Calorimeter/eflowTracks
+  add InputArray ForwardLooperTracks/tracks
+  set OutputArray eflowTracks
+}
+
+
+
 ####################
 # Energy flow merger
@@ -299,9 +605,10 @@
 module Merger EFlowMerger {
 # add InputArray InputArray
-  add InputArray Calorimeter/eflowTracks
+  add InputArray EFlowTrackMerger/eflowTracks
   add InputArray Calorimeter/eflowPhotons
-  add InputArray Calorimeter/eflowNeutralHadrons
+  add InputArray TimeOfFlightNeutralHadron/eflowNeutralHadrons
   set OutputArray eflow
 }
+
 
 ###################
@@ -337,5 +644,5 @@
   set PTMin 0.5
 
-  set PTRatioMax 999.
+  set PTRatioMax 9999.
 }
 
@@ -345,5 +652,5 @@
 
 module PdgCodeFilter ElectronFilter {
-  set InputArray Calorimeter/eflowTracks
+  set InputArray EFlowTrackMerger/eflowTracks
   set OutputArray electrons
   set Invert true
@@ -352,4 +659,17 @@
 }
 
+#################
+# Muon filter
+#################
+
+module PdgCodeFilter MuonFilter {
+  set InputArray EFlowTrackMerger/eflowTracks
+  set OutputArray muons
+  set Invert true
+  add PdgCode {13}
+  add PdgCode {-13}
+}
+
+
 #####################
 # Electron efficiency
@@ -363,5 +683,5 @@
 
   # efficiency formula for electrons
-  set EfficiencyFormula {          
+  set EfficiencyFormula {
         (energy < 2.0)                                         * (0.000)+
         (energy >= 2.0) * (abs(eta) <= 0.88)                   * (0.99) +
@@ -385,5 +705,5 @@
   set PTMin 0.5
 
-  set PTRatioMax 0.12
+  set PTRatioMax 9999
 }
 
@@ -393,5 +713,5 @@
 
 module Efficiency MuonEfficiency {
-  set InputArray MuonMomentumSmearing/muons
+  set InputArray MuonFilter/muons
   set OutputArray muons
 
@@ -399,5 +719,5 @@
 
   # efficiency formula for muons
-  set EfficiencyFormula {                                   
+  set EfficiencyFormula {
         (energy < 2.0)                                         * (0.000)+
         (energy >= 2.0) * (abs(eta) <= 0.88)                   * (0.99) +
@@ -421,5 +741,5 @@
   set PTMin 0.5
 
-  set PTRatioMax 0.25
+  set PTRatioMax 9999.
 }
 
@@ -473,11 +793,11 @@
 module FastJetFinder GenJetFinder {
   set InputArray NeutrinoFilter/filteredParticles
-
   set OutputArray jets
 
-  # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt
-  set JetAlgorithm 6
-  set ParameterR 0.4
+  set JetAlgorithm 10
+  set ParameterR 1.5
+  set ParameterP -1.0
   set JetPTMin 1.0
+
 }
 
@@ -504,7 +824,10 @@
 
   # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt
-  set JetAlgorithm 6
-  set ParameterR 0.4
+  set JetAlgorithm 10
+  set ParameterR 1.5
+  set ParameterP -1.0
   set JetPTMin 1.0
+
+
 }
 
@@ -518,5 +841,5 @@
 
   # scale formula for jets
-  set ScaleFormula {1.08}
+  set ScaleFormula {1.00}
 }
 
@@ -547,5 +870,5 @@
 
   # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt}
-  
+
   # default efficiency formula (misidentification rate)
   add EfficiencyFormula {0} {0.01}
@@ -578,18 +901,4 @@
 
 
-#####################################################
-# Find uniquely identified photons/electrons/tau/jets
-#####################################################
-
-module UniqueObjectFinder UniqueObjectFinder {
-# earlier arrays take precedence over later ones
-# add InputArray InputArray OutputArray
-  add InputArray PhotonIsolation/photons photons
-  add InputArray ElectronIsolation/electrons electrons
-  add InputArray MuonIsolation/muons muons
-  add InputArray JetEnergyScale/jets jets
-}
-
-
 
 ##################
@@ -603,30 +912,26 @@
 module TreeWriter TreeWriter {
     # add Branch InputArray BranchName BranchClass
-    
+
     add Branch Delphes/allParticles Particle GenParticle
-
-    add Branch TrackMerger/tracks Track Track
-    add Branch Calorimeter/towers Tower Tower
-    
-    add Branch Calorimeter/eflowTracks EFlowTrack Track
+    add Branch TruthVertexFinder/vertices GenVertex Vertex
+
+    add Branch EFlowTrackMerger/eflowTracks EFlowTrack Track
+    add Branch TrackSmearing/tracks Track Track
     add Branch Calorimeter/eflowPhotons EFlowPhoton Tower
-    add Branch Calorimeter/eflowNeutralHadrons EFlowNeutralHadron Tower
-
-    add Branch Calorimeter/photons CaloPhoton Photon
-    add Branch PhotonEfficiency/photons PhotonEff Photon
-    add Branch PhotonIsolation/photons PhotonIso Photon
-    
+    add Branch TimeOfFlightNeutralHadron/eflowNeutralHadrons EFlowNeutralHadron Tower
+
+    add Branch EFlowMerger/eflow ParticleFlowCandidate ParticleFlowCandidate
+
+    add Branch ElectronEfficiency/electrons Electron Electron
+    add Branch MuonEfficiency/muons Muon Muon
+    add Branch PhotonEfficiency/photons Photon Photon
+
+    add Branch JetEnergyScale/jets Jet Jet
+    add Branch MissingET/momentum MissingET MissingET
+
     add Branch GenJetFinder/jets GenJet Jet
     add Branch GenMissingET/momentum GenMissingET MissingET
-    
-    add Branch UniqueObjectFinder/jets Jet Jet
-    add Branch UniqueObjectFinder/electrons Electron Electron
-    add Branch UniqueObjectFinder/photons Photon Photon
-    add Branch UniqueObjectFinder/muons Muon Muon
-    
-    add Branch JetEnergyScale/jets AntiKtJet Jet  
-    
-    add Branch MissingET/momentum MissingET MissingET
-    add Branch ScalarHT/energy ScalarHT ScalarHT
-}
-
+
+    # add Info InfoName InfoValue
+    add Info Bz $B
+}
Index: cards/delphes_card_ILCgen.tcl
===================================================================
--- cards/delphes_card_ILCgen.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/delphes_card_ILCgen.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,1018 @@
+################################################
+#
+# ILCgen model
+#
+# Generic ILC detector model for Delphes,
+# developed for the Snowmass 2021 study.
+# While it has been mainly based on the ILD
+# detector concept, as presented in ILD IDR,
+# it can be considered a generic ILC detector
+# model, as expected performances of both ILD
+# and SiD are very similar and details of the
+# detector design are not taken into account.
+#
+# For more details and references see:
+#   https://github.com/iLCSoft/ILCDelphes
+#
+# Questions and comments can be send to:
+# Aleksander Filip Zarnecki <zarnecki@fuw.edu.pl>
+#
+################################################
+
+#######################################
+# Order of execution of various modules
+#######################################
+
+set ExecutionPath {
+
+  NeutrinoFilter
+
+  ParticlePropagator
+
+  ChargedHadronTrackingEfficiency
+  ElectronTrackingEfficiency
+  MuonTrackingEfficiency
+
+  ChargedHadronMomentumSmearing
+  ElectronMomentumSmearing
+  MuonMomentumSmearing
+
+  TrackMerger
+
+
+    
+  ECal
+  LumiCalF
+  LumiCalR
+
+  HCal
+  LHCalF
+  LHCalR
+    
+  Calorimeter
+
+  
+  
+  BeamCalF
+  BeamCalR
+
+  BCalTowers
+  BCalMerger
+  BCalEfficiency
+   
+  HCalMerger  
+  ElectronFilter
+
+    
+  EFlowMerger
+  PhotonMerger
+  NeutralMerger
+
+  PhotonEfficiency
+  PhotonIsolation
+    
+  ElectronEfficiency
+  ElectronIsolation
+
+  MuonEfficiency
+  MuonIsolation
+
+  
+  EFlowFilter
+
+  GenJetFinder
+
+  JetFinder
+  JetFlavorAssociation
+  BTagging80
+  BTagging70
+  BTagging50
+  CTagging55
+  CTagging30
+  CTagging20
+  TauTagging
+
+  
+  JetFinder_N2
+  JetFlavor_N2
+  BTagging80_N2
+  BTagging70_N2
+  BTagging50_N2
+  CTagging55_N2
+  CTagging30_N2
+  CTagging20_N2
+  TauTagging_N2
+    
+
+  JetFinder_N3
+  JetFlavor_N3
+  BTagging80_N3
+  BTagging70_N3
+  BTagging50_N3
+  CTagging55_N3
+  CTagging30_N3
+  CTagging20_N3
+  TauTagging_N3
+    
+
+  JetFinder_N4
+  JetFlavor_N4
+  BTagging80_N4
+  BTagging70_N4
+  BTagging50_N4
+  CTagging55_N4
+  CTagging30_N4
+  CTagging20_N4
+  TauTagging_N4
+    
+
+  JetFinder_N5
+  JetFlavor_N5
+  BTagging80_N5
+  BTagging70_N5
+  BTagging50_N5
+  CTagging55_N5
+  CTagging30_N5
+  CTagging20_N5
+  TauTagging_N5
+    
+
+  JetFinder_N6
+  JetFlavor_N6
+  BTagging80_N6
+  BTagging70_N6
+  BTagging50_N6
+  CTagging55_N6
+  CTagging30_N6
+  CTagging20_N6
+  TauTagging_N6
+    
+
+  MissingET
+  GenMissingET
+  ScalarHT
+
+
+    
+  MainCalorimeter
+
+  EFlowMerger_MainCal
+
+  PhotonEfficiency_MainCal
+  PhotonIsolation_MainCal
+
+  EFlowFilter_MainCal
+
+  JetFinder_MainCal
+  JetFlavorAssociation_MainCal
+  BTagging80_MainCal
+  BTagging70_MainCal
+  BTagging50_MainCal
+  CTagging55_MainCal
+  CTagging30_MainCal
+  CTagging20_MainCal
+  TauTagging_MainCal
+
+  MissingET_MainCal
+  ScalarHT_MainCal
+
+    
+    
+  TreeWriter
+}
+
+#################################
+# Propagate particles in cylinder
+#################################
+module ParticlePropagator ParticlePropagator {
+    set InputArray Delphes/stableParticles
+
+    set OutputArray stableParticles
+    set ChargedHadronOutputArray chargedHadrons
+    set ElectronOutputArray electrons
+    set MuonOutputArray muons
+    
+    source ILCgen/ILCgen_Propagator.tcl
+    
+}
+
+####################################
+# Charged hadron tracking efficiency
+####################################
+module Efficiency ChargedHadronTrackingEfficiency {
+    set InputArray ParticlePropagator/chargedHadrons
+    set OutputArray chargedHadrons
+
+
+    source ILCgen/ILCgen_ChrgHadTrackingEff.tcl 
+}
+
+##############################
+# Electron tracking efficiency
+##############################
+module Efficiency ElectronTrackingEfficiency {
+    set InputArray ParticlePropagator/electrons
+    set OutputArray electrons
+
+    source ILCgen/ILCgen_ElectronTrackingEff.tcl 
+}
+
+##########################
+# Muon tracking efficiency
+##########################
+module Efficiency MuonTrackingEfficiency {
+    set InputArray ParticlePropagator/muons
+    set OutputArray muons
+
+    source ILCgen/ILCgen_MuonTrackingEff.tcl 
+}
+
+########################################
+# Momentum resolution for charged tracks
+########################################
+module MomentumSmearing ChargedHadronMomentumSmearing {
+  set InputArray ChargedHadronTrackingEfficiency/chargedHadrons
+  set OutputArray chargedHadrons
+
+    source ILCgen/ILCgen_ChrgHadMomentumSmearing.tcl
+
+}
+
+###################################
+# Momentum resolution for electrons
+###################################
+module MomentumSmearing ElectronMomentumSmearing {
+    set InputArray ElectronTrackingEfficiency/electrons
+    set OutputArray electrons
+
+    source ILCgen/ILCgen_ElectronMomentumSmearing.tcl 
+}
+
+###############################
+# Momentum resolution for muons
+###############################
+module MomentumSmearing MuonMomentumSmearing {
+    set InputArray MuonTrackingEfficiency/muons
+    set OutputArray muons
+
+    source ILCgen/ILCgen_MuonMomentumSmearing.tcl 
+}
+
+##############
+# Track merger
+##############
+module Merger TrackMerger {
+# add InputArray InputArray
+  add InputArray ChargedHadronMomentumSmearing/chargedHadrons
+  add InputArray ElectronMomentumSmearing/electrons
+  add InputArray MuonMomentumSmearing/muons
+  set OutputArray tracks
+}
+
+#############
+#   ECAL
+#############
+module SimpleCalorimeter ECal {
+    set ParticleInputArray ParticlePropagator/stableParticles
+    set TrackInputArray TrackMerger/tracks
+
+    set TowerOutputArray ecalTowers
+    
+    set EFlowTrackOutputArray eflowTracks
+    set EFlowTowerOutputArray eflowPhotons
+    
+    set IsEcal true
+    
+    set EnergyMin 0.1
+    set EnergySignificanceMin 1.0
+    
+    set SmearTowerCenter true
+    
+    source ILCgen/ILCgen_ECAL_Binning.tcl
+    source ILCgen/ILCgen_ECAL_EnergyFractions.tcl
+    source ILCgen/ILCgen_ECAL_Resolution.tcl 
+}
+
+##############
+# LumiCal
+##############
+module SimpleCalorimeter LumiCalF {
+    set ParticleInputArray ParticlePropagator/stableParticles
+    set TrackInputArray TrackMerger/tracks
+    
+    set TowerOutputArray lumicalTowers
+    
+    set EFlowTrackOutputArray eflowTracks
+    set EFlowTowerOutputArray eflowPhotons
+    
+    set IsEcal true 
+    
+    set EnergyMin 2.0
+    set EnergySignificanceMin 1.0
+    
+    set SmearTowerCenter true
+    
+    source ILCgen/ILCgen_LumiCalF_Binning.tcl
+    source ILCgen/ILCgen_ECAL_EnergyFractions.tcl
+    source ILCgen/ILCgen_ECAL_Resolution.tcl
+}
+
+module SimpleCalorimeter LumiCalR {
+    set ParticleInputArray ParticlePropagator/stableParticles
+    set TrackInputArray TrackMerger/tracks
+    
+    set TowerOutputArray lumicalTowers
+    
+    set EFlowTrackOutputArray eflowTracks
+    set EFlowTowerOutputArray eflowPhotons
+    
+    set IsEcal true 
+    
+    set EnergyMin 2.0
+    set EnergySignificanceMin 1.0
+    
+    set SmearTowerCenter true
+    
+    source ILCgen/ILCgen_LumiCalR_Binning.tcl
+    source ILCgen/ILCgen_ECAL_EnergyFractions.tcl
+    source ILCgen/ILCgen_ECAL_Resolution.tcl
+}
+
+#############
+#   HCAL 
+#############
+module SimpleCalorimeter HCal {
+    set ParticleInputArray ParticlePropagator/stableParticles
+    set TrackInputArray ECal/eflowTracks
+    
+    set TowerOutputArray hcalTowers
+    set EFlowTrackOutputArray eflowTracks
+    set EFlowTowerOutputArray eflowNeutralHadrons
+
+    set IsEcal false
+    
+    set EnergyMin 0.25
+    set EnergySignificanceMin 1.0
+    
+    set SmearTowerCenter true
+    
+    source ILCgen/ILCgen_HCAL_Binning.tcl
+    source ILCgen/ILCgen_HCAL_EnergyFractions.tcl
+    source ILCgen/ILCgen_HCAL_Resolution.tcl 
+}
+
+##############
+# LHCal
+##############
+module SimpleCalorimeter LHCalR {
+    set ParticleInputArray ParticlePropagator/stableParticles
+    set TrackInputArray ECal/eflowTracks
+    
+    set TowerOutputArray lhcalTowers
+    set EFlowTrackOutputArray eflowTracks
+    set EFlowTowerOutputArray eflowNeutralHadrons
+    
+    set IsEcal false 
+    
+    set EnergyMin 2.0
+    set EnergySignificanceMin 1.0
+    
+    set SmearTowerCenter true
+    
+    source ILCgen/ILCgen_LHCalR_Binning.tcl
+    source ILCgen/ILCgen_HCAL_EnergyFractions.tcl
+    source ILCgen/ILCgen_HCAL_Resolution.tcl
+}
+
+module SimpleCalorimeter LHCalF {
+    set ParticleInputArray ParticlePropagator/stableParticles
+    set TrackInputArray ECal/eflowTracks
+    
+    set TowerOutputArray lhcalTowers
+    set EFlowTrackOutputArray eflowTracks
+    set EFlowTowerOutputArray eflowNeutralHadrons
+    
+    set IsEcal false 
+    
+    set EnergyMin 2.0
+    set EnergySignificanceMin 1.0
+    
+    set SmearTowerCenter true
+    
+    source ILCgen/ILCgen_LHCalF_Binning.tcl
+    source ILCgen/ILCgen_HCAL_EnergyFractions.tcl
+    source ILCgen/ILCgen_HCAL_Resolution.tcl
+}
+
+##############
+# BeamCal
+##############
+module SimpleCalorimeter BeamCalR {
+    set ParticleInputArray ParticlePropagator/stableParticles
+    set TrackInputArray TrackMerger/tracks
+    
+    set TowerOutputArray bcalTowers
+    set EFlowTowerOutputArray bcalPhotons
+    
+    set IsEcal true 
+    
+    set EnergyMin 5.0
+    set EnergySignificanceMin 1.0
+    
+    set SmearTowerCenter true
+    
+    source ILCgen/ILCgen_BeamCalR_Binning.tcl
+    source ILCgen/ILCgen_BeamCal_EnergyFractions.tcl
+    source ILCgen/ILCgen_BeamCal_Resolution.tcl
+}
+
+module SimpleCalorimeter BeamCalF {
+    set ParticleInputArray ParticlePropagator/stableParticles
+    set TrackInputArray TrackMerger/tracks
+    
+    set TowerOutputArray bcalTowers
+    set EFlowTowerOutputArray bcalPhotons
+    
+    set IsEcal true 
+    
+    set EnergyMin 5.0
+
+    set EnergySignificanceMin 1.0
+    
+    set SmearTowerCenter true
+    
+    source ILCgen/ILCgen_BeamCalF_Binning.tcl
+    source ILCgen/ILCgen_BeamCal_EnergyFractions.tcl
+    source ILCgen/ILCgen_BeamCal_Resolution.tcl
+}
+
+#################
+# Electron merger
+#################
+module Merger HCalMerger {
+# add InputArray InputArray
+  add InputArray HCal/eflowTracks
+  add InputArray LHCalF/eflowTracks
+  add InputArray LHCalR/eflowTracks
+  set OutputArray eflowTracks
+}
+
+#################
+# Electron filter
+#################
+module PdgCodeFilter ElectronFilter {
+  set InputArray  HCalMerger/eflowTracks
+  set OutputArray electrons
+  set Invert true
+
+  add PdgCode {11}
+  add PdgCode {-11}
+}
+
+###################################################
+# Tower Merger (in case not using e-flow algorithm)
+###################################################
+module Merger Calorimeter {
+# add InputArray InputArray
+  add InputArray ECal/ecalTowers
+  add InputArray HCal/hcalTowers
+  add InputArray LumiCalF/lumicalTowers
+  add InputArray LumiCalR/lumicalTowers
+  add InputArray LHCalF/lhcalTowers
+  add InputArray LHCalR/lhcalTowers
+  set OutputArray towers
+}
+
+############################################
+# Tower Merger for central calorimeters only
+############################################
+module Merger MainCalorimeter {
+# add InputArray InputArray
+  add InputArray ECal/ecalTowers 
+  add InputArray HCal/hcalTowers
+  set OutputArray towers
+}
+
+####################
+# Energy flow merger
+####################
+module Merger EFlowMerger {
+# add InputArray InputArray
+  add InputArray HCalMerger/eflowTracks
+  add InputArray ECal/eflowPhotons
+  add InputArray LumiCalF/eflowPhotons
+  add InputArray LumiCalR/eflowPhotons
+  add InputArray HCal/eflowNeutralHadrons
+  add InputArray LHCalF/eflowNeutralHadrons
+  add InputArray LHCalR/eflowNeutralHadrons
+  set OutputArray eflow
+}
+
+##################################################
+# Energy flow merger for central calorimeters only
+##################################################
+module Merger EFlowMerger_MainCal {
+# add InputArray InputArray
+  add InputArray HCal/eflowTracks
+  add InputArray ECal/eflowPhotons
+  add InputArray HCal/eflowNeutralHadrons
+  set OutputArray eflow
+}
+
+###############
+# Photon merger
+###############
+module Merger PhotonMerger {
+# add InputArray InputArray
+  add InputArray ECal/eflowPhotons
+  add InputArray LumiCalF/eflowPhotons
+  add InputArray LumiCalR/eflowPhotons
+
+  set OutputArray eflowPhotons
+}
+
+#######################
+# Neutral hadron merger
+#######################
+module Merger NeutralMerger {
+# add InputArray InputArray
+  add InputArray HCal/eflowNeutralHadrons
+  add InputArray LHCalF/eflowNeutralHadrons
+  add InputArray LHCalR/eflowNeutralHadrons
+  set OutputArray eflowNeutralHadrons
+}
+
+###############################
+# BeamCal tower merger
+###############################
+module Merger BCalTowers {
+# add InputArray InputArray
+  add InputArray BeamCalF/bcalTowers
+  add InputArray BeamCalR/bcalTowers
+  set OutputArray bcalTowers
+}
+  
+###############################
+# BeamCal energy flow merger
+###############################
+module Merger BCalMerger {
+# add InputArray InputArray
+  add InputArray BeamCalF/bcalPhotons
+  add InputArray BeamCalR/bcalPhotons
+  set OutputArray bcalPhotons
+}
+  
+##############################
+# BeamCal photon efficiency
+##############################
+module Efficiency BCalEfficiency {
+    set InputArray  BCalMerger/bcalPhotons
+    set OutputArray bcalPhotons
+
+    source ILCgen/ILCgen_BeamCalEfficiency.tcl
+}
+
+###################
+# Photon efficiency
+###################
+module Efficiency PhotonEfficiency {
+    set InputArray PhotonMerger/eflowPhotons
+    set OutputArray photons
+
+    source ILCgen/ILCgen_PhotonEfficiency.tcl
+}
+
+##################
+# Photon isolation
+##################
+module Isolation PhotonIsolation {
+    set CandidateInputArray PhotonEfficiency/photons
+    set IsolationInputArray EFlowMerger/eflow
+    set OutputArray photons
+
+    source ILCgen/ILCgen_PhotonIsolation.tcl
+}
+
+#####################
+# Electron efficiency
+#####################
+module Efficiency ElectronEfficiency {
+    set InputArray ElectronFilter/electrons
+    set OutputArray electrons
+
+    source ILCgen/ILCgen_ElectronEfficiency.tcl
+}
+
+####################
+# Electron isolation
+####################
+module Isolation ElectronIsolation {
+    set CandidateInputArray ElectronEfficiency/electrons
+    set IsolationInputArray EFlowMerger/eflow
+    set OutputArray electrons
+    
+    source ILCgen/ILCgen_ElectronIsolation.tcl
+}
+
+#################
+# Muon efficiency
+#################
+module Efficiency MuonEfficiency {
+    set InputArray MuonMomentumSmearing/muons
+    set OutputArray muons
+
+    source ILCgen/ILCgen_MuonEfficiency.tcl
+}
+
+################
+# Muon isolation
+################
+module Isolation MuonIsolation {
+    set CandidateInputArray MuonEfficiency/muons
+    set IsolationInputArray EFlowMerger/eflow
+    set OutputArray muons
+    
+    source ILCgen/ILCgen_MuonIsolation.tcl
+}
+
+##################################
+# EFlowFilter (UniqueObjectFinder)
+##################################
+module UniqueObjectFinder EFlowFilter {
+    add InputArray PhotonIsolation/photons photons
+    add InputArray ElectronIsolation/electrons electrons
+    add InputArray MuonIsolation/muons muons
+    add InputArray EFlowMerger/eflow eflow
+}
+
+###################
+# Missing ET merger
+###################
+module Merger MissingET {
+  add InputArray EFlowMerger/eflow
+  set MomentumOutputArray momentum
+}
+
+module Merger MissingET_MainCal {
+  add InputArray EFlowMerger_MainCal/eflow
+  set MomentumOutputArray momentum
+}
+
+##################
+# Scalar HT merger
+##################
+module Merger ScalarHT {
+  add InputArray EFlowMerger/eflow
+  set EnergyOutputArray energy
+}
+
+module Merger ScalarHT_MainCal {
+  add InputArray EFlowMerger_MainCal/eflow
+  set EnergyOutputArray energy
+}
+
+#################
+# Neutrino Filter
+#################
+module PdgCodeFilter NeutrinoFilter {
+
+  set InputArray Delphes/stableParticles
+  set OutputArray filteredParticles
+
+  set PTMin 0.0
+
+  add PdgCode {12}
+  add PdgCode {14}
+  add PdgCode {16}
+  add PdgCode {-12}
+  add PdgCode {-14}
+  add PdgCode {-16}
+
+}
+
+#####################
+# MC truth jet finder
+#####################
+module FastJetFinder GenJetFinder {
+  set InputArray NeutrinoFilter/filteredParticles
+  set OutputArray jets
+
+  source ILCgen/ILCgen_GenJetFinder.tcl
+}
+
+#########################
+# Gen Missing ET merger
+########################
+module Merger GenMissingET {
+# add InputArray InputArray
+  add InputArray NeutrinoFilter/filteredParticles
+  set MomentumOutputArray momentum
+}
+
+############
+# Jet finder
+############
+module FastJetFinder JetFinder {
+    #set InputArray TowerMerger/towers
+    set InputArray EFlowFilter/eflow
+    set OutputArray jets
+    
+    source ILCgen/ILCgen_JetFinder.tcl
+}
+
+########################
+# Jet Flavor Association
+########################
+module JetFlavorAssociation JetFlavorAssociation {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetFinder/jets
+
+    source ILCgen/ILCgen_JetFlavourAssoc.tcl
+}
+
+###########
+# b-tagging
+###########
+module BTagging BTagging80 {
+    set JetInputArray JetFinder/jets
+    set BitNumber 0
+
+    source ILCgen/ILCgen_BTagging_80.tcl
+}
+
+module BTagging BTagging70 {
+    set JetInputArray JetFinder/jets
+    set BitNumber 1
+
+    source ILCgen/ILCgen_BTagging_70.tcl
+}
+
+module BTagging BTagging50 {
+    set JetInputArray JetFinder/jets
+    set BitNumber 2
+
+    source ILCgen/ILCgen_BTagging_50.tcl
+}
+
+###########
+# c-tagging
+###########
+module BTagging CTagging55 {
+    set JetInputArray JetFinder/jets
+    set BitNumber 4
+
+    source ILCgen/ILCgen_CTagging_55.tcl
+}
+
+module BTagging CTagging30 {
+    set JetInputArray JetFinder/jets
+    set BitNumber 5
+
+    source ILCgen/ILCgen_CTagging_30.tcl
+}
+
+module BTagging CTagging20 {
+    set JetInputArray JetFinder/jets
+    set BitNumber 6
+
+    source ILCgen/ILCgen_CTagging_20.tcl
+}
+
+#############
+# tau-tagging
+#############
+module TauTagging TauTagging {
+    set ParticleInputArray Delphes/allParticles
+    set PartonInputArray Delphes/partons
+    set JetInputArray JetFinder/jets
+
+    source ILCgen/ILCgen_TauTagging.tcl
+}
+
+##############################################
+# Jet finder for inclusive clustering, N=2...6
+##############################################
+source ILCgen/ILCgen_JetFinder_N.tcl
+
+##########################################################
+# Jet Flavor Association for inclusive clustering, N=2...6
+##########################################################
+source ILCgen/ILCgen_JetFlavourAssoc_N.tcl
+
+#############################################
+# b-tagging for inclusive clustering, N=2...6
+#############################################
+source ILCgen/ILCgen_BTagging_N.tcl
+
+#############################################
+# c-tagging for inclusive clustering, N=2...6
+#############################################
+source ILCgen/ILCgen_CTagging_N.tcl
+
+###############################################
+# tau-tagging for inclusive clustering, N=2...6
+###############################################
+source ILCgen/ILCgen_TauTagging_N.tcl
+
+####################################
+# Photon efficiency central detector
+####################################
+module Efficiency PhotonEfficiency_MainCal {
+    set InputArray ECal/eflowPhotons
+    set OutputArray photons
+
+    source ILCgen/ILCgen_PhotonEfficiency.tcl
+}
+
+####################################
+# Photon isolation central detectors
+####################################
+module Isolation PhotonIsolation_MainCal {
+    set CandidateInputArray PhotonEfficiency_MainCal/photons
+    set IsolationInputArray EFlowMerger_MainCal/eflow
+    set OutputArray photons
+
+    source ILCgen/ILCgen_PhotonIsolation.tcl
+}
+
+######################################
+# EFlowFilter for central calorimeters
+######################################
+module UniqueObjectFinder EFlowFilter_MainCal {
+    add InputArray PhotonIsolation_MainCal/photons photons
+    add InputArray ElectronIsolation/electrons electrons
+    add InputArray MuonIsolation/muons muons
+    add InputArray EFlowMerger_MainCal/eflow eflow
+}
+
+#######################################
+# Jet finder for central detectors only
+#######################################
+module FastJetFinder JetFinder_MainCal {
+    #set InputArray TowerMerger/towers
+    set InputArray EFlowFilter_MainCal/eflow
+    set OutputArray jets
+    
+    source ILCgen/ILCgen_JetFinder.tcl
+}
+
+#########################################
+# Jet Flavor Association for central jets
+#########################################
+module JetFlavorAssociation JetFlavorAssociation_MainCal {
+
+    set PartonInputArray Delphes/partons
+    set ParticleInputArray Delphes/allParticles
+    set ParticleLHEFInputArray Delphes/allParticlesLHEF
+    set JetInputArray JetFinder_MainCal/jets
+
+    source ILCgen/ILCgen_JetFlavourAssoc.tcl
+}
+
+############################
+# b-tagging for central jets
+############################
+module BTagging BTagging80_MainCal {
+    set JetInputArray JetFinder_MainCal/jets
+    set BitNumber 0
+
+    source ILCgen/ILCgen_BTagging_80.tcl
+}
+
+module BTagging BTagging70_MainCal {
+    set JetInputArray JetFinder_MainCal/jets
+    set BitNumber 1
+
+    source ILCgen/ILCgen_BTagging_70.tcl
+}
+
+module BTagging BTagging50_MainCal {
+    set JetInputArray JetFinder_MainCal/jets
+    set BitNumber 2
+
+    source ILCgen/ILCgen_BTagging_50.tcl
+}
+
+############################
+# c-tagging for central jets
+############################
+module BTagging CTagging55_MainCal {
+    set JetInputArray JetFinder_MainCal/jets
+    set BitNumber 4
+
+    source ILCgen/ILCgen_CTagging_55.tcl
+}
+
+module BTagging CTagging30_MainCal {
+    set JetInputArray JetFinder_MainCal/jets
+    set BitNumber 5
+
+    source ILCgen/ILCgen_CTagging_30.tcl
+}
+
+module BTagging CTagging20_MainCal {
+    set JetInputArray JetFinder_MainCal/jets
+    set BitNumber 6
+
+    source ILCgen/ILCgen_CTagging_20.tcl
+}
+
+##########################
+# tau-tagging central jets
+##########################
+module TauTagging TauTagging_MainCal {
+    set ParticleInputArray Delphes/allParticles
+    set PartonInputArray Delphes/partons
+    set JetInputArray JetFinder_MainCal/jets
+
+    source ILCgen/ILCgen_TauTagging.tcl
+}
+
+##################
+# ROOT tree writer
+##################
+module TreeWriter TreeWriter {
+# add Branch InputArray BranchName BranchClass
+
+#
+# Generator level 
+#
+  add Branch Delphes/allParticles Particle GenParticle
+  add Branch GenJetFinder/jets GenJet Jet
+  add Branch GenMissingET/momentum GenMissingET MissingET
+
+#
+# Raw detector response
+#     uncomment for tests or for Dephes event display 
+#
+#  add Branch TrackMerger/tracks Track Track
+#  add Branch Calorimeter/towers Tower Tower
+
+#
+# Additional raw data collections
+#     for tests only
+#
+#  add Branch MainCalorimeter/towers Tower_MainCal Tower
+#  add Branch BCalTowers/bcalTowers BCalTower Tower
+
+#
+# Particle flow objects 
+#
+  add Branch HCalMerger/eflowTracks EFlowTrack Track
+  add Branch PhotonMerger/eflowPhotons EFlowPhoton Tower
+  add Branch NeutralMerger/eflowNeutralHadrons EFlowNeutralHadron Tower
+
+#
+# Particle flow objects for main calorimeters only,
+# exclusing LumiCal and LHCal - for tests only 
+#
+#  add Branch ECal/eflowPhotons EFlowPhoton_MainCal Tower
+#  add Branch HCal/eflowNeutralHadrons EFlowNeutralHadron_MainCal Tower
+#
+  
+#
+# Final state reconstruction
+#  
+  add Branch EFlowFilter/electrons Electron Electron
+  add Branch EFlowFilter/muons Muon Muon
+  add Branch EFlowFilter/photons Photon Photon
+  
+  add Branch JetFinder/jets Jet Jet
+  
+  add Branch JetFinder_N2/jets Jet_N2 Jet
+  add Branch JetFinder_N3/jets Jet_N3 Jet
+  add Branch JetFinder_N4/jets Jet_N4 Jet
+  add Branch JetFinder_N5/jets Jet_N5 Jet
+  add Branch JetFinder_N6/jets Jet_N6 Jet
+
+#
+# Final state reconstruction with no LumiCal/LHCal
+#   for special cases only, not in the default output stream  
+#  
+#  add Branch EFlowFilter_MainCal/photons Photon_MainCal Photon
+#  add Branch JetFinder_MainCal/jets Jet_MainCal Jet
+
+#
+# Missing transverse momentum and transverse energy
+# (vector and scalar sum of particle flow object momenta)
+#  
+  add Branch MissingET/momentum MissingET MissingET
+  add Branch ScalarHT/energy ScalarHT ScalarHT
+
+#  
+# Missing transverse momentum and transverse energy
+#  without LumiCal and LHCal objects - for special cases only
+#
+#  add Branch MissingET_MainCal/momentum MissingET_MainCal MissingET
+#  add Branch ScalarHT_MainCal/energy ScalarHT_MainCal ScalarHT
+
+# BeamCal photons - not included in particle flow/clustering
+#  nor in the transverse momentym/energy calculation
+  
+  add Branch BCalEfficiency/bcalPhotons BCalPhoton Photon
+
+}
+
Index: cards/delphes_card_LHeC.tcl
===================================================================
--- cards/delphes_card_LHeC.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/delphes_card_LHeC.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,698 @@
+#######################################
+# Order of execution of various modules
+# 15.9.2014 try a fine granulated calorimeter for LHeC
+# 0.025 in eta and phi
+# 19.12.16 add paramterisations according to Peter Kostka's design
+# muons not considered here - take CMS/FCC values
+# without CTagging, with electrons, muons and b-tagging issues considered
+# 30.1.2018 hammad add Muon Filter module
+#######################################
+
+set ExecutionPath {
+  ParticlePropagator
+
+  ChargedHadronTrackingEfficiency
+  ElectronTrackingEfficiency
+  MuonTrackingEfficiency
+
+  ChargedHadronMomentumSmearing
+  ElectronMomentumSmearing
+  MuonMomentumSmearing
+
+  TrackMerger
+  Calorimeter
+  EFlowMerger
+
+  PhotonEfficiency
+  PhotonIsolation
+
+  ElectronFilter
+  MuonFilter
+  ElectronEfficiency
+  ElectronIsolation
+
+  MuonEfficiency
+  MuonIsolation
+
+  MissingET
+
+  GenJetFinder
+  FastJetFinder
+
+  JetEnergyScale
+
+  GenJetFlavorAssociation	
+  JetFlavorAssociation
+
+  GenBTagging
+  BTagging
+
+  GenTauTagging
+  TauTagging
+
+  UniqueObjectFinder
+
+  ScalarHT
+
+  TreeWriter
+}
+
+# exclude since it adds also an entry to Jet->BTag
+# TrackCountingBTagging
+
+#################################
+# Propagate particles in cylinder
+#################################
+
+module ParticlePropagator ParticlePropagator {
+  set InputArray Delphes/stableParticles
+
+  set OutputArray stableParticles
+  set ChargedHadronOutputArray chargedHadrons
+  set ElectronOutputArray electrons
+  set MuonOutputArray muons
+
+# LHeC
+# radius of the magnetic field coverage, in m
+  set Radius 1.14
+  # half-length of the magnetic field coverage, in m
+  set HalfLength 2.9
+
+  # magnetic field
+  set Bz 3.8
+
+}
+
+####################################
+# Charged hadron tracking efficiency
+####################################
+
+module Efficiency ChargedHadronTrackingEfficiency {
+  set InputArray ParticlePropagator/chargedHadrons
+  set OutputArray chargedHadrons
+
+# add EfficiencyFormula {efficiency formula as a function of eta and pt}
+
+# tracking efficiency formula for charged hadrons
+# set to 1 for full range (-0.2 eta already subtracted from edges)
+  set EfficiencyFormula {   ( eta <= 4.9 && eta >= -4.3)  * (1.0) + \
+				(eta > 4.9 || eta < -4.3 ) * (0.00)}
+}
+##############################
+# Electron tracking efficiency
+##############################
+
+module Efficiency ElectronTrackingEfficiency {
+  set InputArray ParticlePropagator/electrons
+  set OutputArray electrons
+
+  # set EfficiencyFormula {efficiency formula as a function of eta and pt}
+
+  # tracking efficiency formula for electrons
+# set to 1
+  set EfficiencyFormula {  ( (eta <=4.9 && eta >= -4.3) ) * (1.0) + \
+			       ((eta > 4.9 || eta < -4.3)) * (0.00)}
+ }
+##########################
+# Muon tracking efficiency
+##########################
+
+module Efficiency MuonTrackingEfficiency {
+ set InputArray ParticlePropagator/muons
+  set OutputArray muons
+
+  # set EfficiencyFormula {efficiency formula as a function of eta and pt}
+
+  # tracking efficiency formula for muons
+# set to 1
+  set EfficiencyFormula {   (abs(eta) <= 4)  * (1.0) + \
+				(abs(eta) > 4) * (0.00)}
+}
+
+
+########################################
+# Momentum resolution for charged tracks
+########################################
+
+module MomentumSmearing ChargedHadronMomentumSmearing {
+  set InputArray ChargedHadronTrackingEfficiency/chargedHadrons
+  set OutputArray chargedHadrons
+
+  # set ResolutionFormula {resolution formula as a function of eta and pt}
+
+  # resolution formula for charged hadrons
+# taken from FCC but adjust to ep
+#the abs(eta) <= 2.0 should be the "central best" and abs(eta) >
+#2.0  and  <= 4.9 the fwd    /    <= 4.3 the bwd    (LHeC)
+#        and abs(eta) > 2.0 and <= 5.2 fwd   /   <= 5.0   the bwd    (FCC)
+
+  set ResolutionFormula {                  (abs(eta) <= 2.0) * (pt > 0.1   && pt <= 1.0)   * (0.02) + \
+                                           (abs(eta) <= 2.0) * (pt > 1.0   && pt <= 1.0e1) * (0.01) + \
+                                           (abs(eta) <= 2.0) * (pt > 1.0e1 && pt <= 2.0e2) * (0.03) + \
+                                           (abs(eta) <= 2.0) * (pt > 2.0e2)                * (0.05) + \
+                         (abs(eta) > 2.0 && ( eta <= 4.9 && eta >= -4.3 ) ) * (pt > 0.1   && pt <= 1.0)   * (0.03) + \
+                         (abs(eta) > 2.0 && ( eta <= 4.9 && eta >= -4.3 ) ) * (pt > 1.0   && pt <= 1.0e1) * (0.02) + \
+                         (abs(eta) > 2.0 && ( eta <= 4.9 && eta >= -4.3 ) ) * (pt > 1.0e1 && pt <= 2.0e2) * (0.04) + \
+                        (abs(eta) > 2.0 && ( eta <= 4.9 && eta >= -4.3 ) ) * (pt > 2.0e2)                * (0.05)}
+}
+
+#################################
+# Energy resolution for electrons
+#################################
+
+module MomentumSmearing ElectronMomentumSmearing {
+  set InputArray ElectronTrackingEfficiency/electrons
+  set OutputArray electrons
+
+  # set ResolutionFormula {resolution formula as a function of eta and pt}
+
+  # same as resolution formula for charged hadrons
+# taken from FCC but adjust to ep
+#the abs(eta) <= 2.0 should be the "central best" and abs(eta) >
+#2.0  and  <= 4.9 the fwd    /    <= 4.3 the bwd    (LHeC)
+#        and abs(eta) > 2.0 and <= 5.2 fwd   /   <= 5.0   the bwd    (FCC)
+
+  set ResolutionFormula {                  (abs(eta) <= 2.0) * (pt > 0.1   && pt <= 1.0)   * (0.02) + \
+                                           (abs(eta) <= 2.0) * (pt > 1.0   && pt <= 1.0e1) * (0.01) + \
+                                           (abs(eta) <= 2.0) * (pt > 1.0e1 && pt <= 2.0e2) * (0.03) + \
+                                           (abs(eta) <= 2.0) * (pt > 2.0e2)                * (0.05) + \
+                         (abs(eta) > 2.0 && ( eta <= 4.9 && eta >= -4.3 ) ) * (pt > 0.1   && pt <= 1.0)   * (0.03) + \
+                         (abs(eta) > 2.0 && ( eta <= 4.9 && eta >= -4.3 ) ) * (pt > 1.0   && pt <= 1.0e1) * (0.02) + \
+                         (abs(eta) > 2.0 && ( eta <= 4.9 && eta >= -4.3 ) ) * (pt > 1.0e1 && pt <= 2.0e2) * (0.04) + \
+                        (abs(eta) > 2.0 && ( eta <= 4.9 && eta >= -4.3 ) ) * (pt > 2.0e2)                * (0.05)}
+}
+
+
+###############################
+# Momentum resolution for muons
+###############################
+
+module MomentumSmearing MuonMomentumSmearing {
+  set InputArray MuonTrackingEfficiency/muons
+  set OutputArray muons
+
+  # set ResolutionFormula {resolution formula as a function of eta and pt}
+
+  # resolution formula for muons
+# taken from FCC
+   set ResolutionFormula {                  (abs(eta) <= 0.5) * (pt > 0.1   && pt <= 5.0)   * (0.02) + \
+                                           (abs(eta) <= 0.5) * (pt > 5.0   && pt <= 1.0e2) * (0.015) + \
+                                           (abs(eta) <= 0.5) * (pt > 1.0e2 && pt <= 2.0e2) * (0.03) + \
+                                           (abs(eta) <= 0.5) * (pt > 2.0e2)                * (0.05 + pt*1.e-4) + \
+                         (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1   && pt <= 5.0)   * (0.03) + \
+                         (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 5.0   && pt <= 1.0e2) * (0.02) + \
+                         (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 1.0e2 && pt <= 2.0e2) * (0.04) + \
+                         (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 2.0e2)                * (0.05 + pt*1.e-4) + \
+                         (abs(eta) > 1.5 && abs(eta) <= 4.0) * (pt > 0.1   && pt <= 5.0)   * (0.04) + \
+                         (abs(eta) > 1.5 && abs(eta) <= 4.0) * (pt > 5.0   && pt <= 1.0e2) * (0.035) + \
+                         (abs(eta) > 1.5 && abs(eta) <= 4.0) * (pt > 1.0e2 && pt <= 2.0e2) * (0.05) + \
+                         (abs(eta) > 1.5 && abs(eta) <= 4.0) * (pt > 2.0e2)                * (0.05 + pt*1.e-4)}
+}
+
+
+
+##############
+# Track merger
+##############
+
+module Merger TrackMerger {
+# add InputArray InputArray
+  add InputArray ChargedHadronMomentumSmearing/chargedHadrons
+  add InputArray ElectronMomentumSmearing/electrons
+  add InputArray MuonMomentumSmearing/muons
+  set OutputArray tracks
+}
+
+##################
+# LHeC Calorimeter
+##################
+
+module Calorimeter Calorimeter {
+  set ParticleInputArray ParticlePropagator/stableParticles
+  set TrackInputArray TrackMerger/tracks
+
+  set TowerOutputArray towers
+  set PhotonOutputArray photons
+
+  set EFlowTrackOutputArray eflowTracks
+  set EFlowPhotonOutputArray eflowPhotons
+  set EFlowNeutralHadronOutputArray eflowNeutralHadrons
+
+  set pi [expr {acos(-1)}]
+
+  # lists of the edges of each tower in eta and phi
+  # each list starts with the lower edge of the first tower
+  # the list ends with the higher edged of the last tower
+
+  # use a delta_phi=0.025 for 2*phi range == 252 cells
+  # use a delta_eta-0.025 for eta = -5 to 5 == 400 cells
+  # Uta 22.12.16 use eta range from Peter Kostka -4.7 - 5.2
+  set PhiBins {}
+  for {set i -126} {$i <= 126} {incr i} {
+      add PhiBins [expr {$i * $pi/126.0}]
+  }
+  foreach eta { -4.700 -4.675 -4.650 -4.625 -4.600 -4.575 -4.550 -4.525 -4.500 -4.475 -4.450 -4.425 -4.400 -4.375 -4.350 -4.325 -4.300 -4.275 -4.250 -4.225 -4.200 -4.175 -4.150 -4.125 -4.100 -4.075 -4.050 -4.025 -4.000 -3.975 -3.950 -3.925 -3.900 -3.875 -3.850 -3.825 -3.800 -3.775 -3.750 -3.725 -3.700 -3.675 -3.650 -3.625 -3.600 -3.575 -3.550 -3.525 -3.500 -3.475 -3.450 -3.425 -3.400 -3.375 -3.350 -3.325 -3.300 -3.275 -3.250 -3.225 -3.200 -3.175 -3.150 -3.125 -3.100 -3.075 -3.050 -3.025 -3.000 -2.975 -2.950 -2.925 -2.900 -2.875 -2.850 -2.825 -2.800 -2.775 -2.750 -2.725 -2.700 -2.675 -2.650 -2.625 -2.600 -2.575 -2.550 -2.525 -2.500 -2.475 -2.450 -2.425 -2.400 -2.375 -2.350 -2.325 -2.300 -2.275 -2.250 -2.225 -2.200 -2.175 -2.150 -2.125 -2.100 -2.075 -2.050 -2.025 -2.000 -1.975 -1.950 -1.925 -1.900 -1.875 -1.850 -1.825 -1.800 -1.775 -1.750 -1.725 -1.700 -1.675 -1.650 -1.625 -1.600 -1.575 -1.550 -1.525 -1.500 -1.475 -1.450 -1.425 -1.400 -1.375 -1.350 -1.325 -1.300 -1.275 -1.250 -1.225 -1.200 -1.175 -1.150 -1.125 -1.100 -1.075 -1.050 -1.025 -1.000 -0.975 -0.950 -0.925 -0.900 -0.875 -0.850 -0.825 -0.800 -0.775 -0.750 -0.725 -0.700 -0.675 -0.650 -0.625 -0.600 -0.575 -0.550 -0.525 -0.500 -0.475 -0.450 -0.425 -0.400 -0.375 -0.350 -0.325 -0.300 -0.275 -0.250 -0.225 -0.200 -0.175 -0.150 -0.125 -0.100 -0.075 -0.050 -0.025  0.000  0.025  0.050  0.075  0.100  0.125  0.150  0.175  0.200  0.225  0.250  0.275  0.300  0.325  0.350  0.375  0.400  0.425  0.450  0.475  0.500  0.525  0.550  0.575  0.600  0.625  0.650  0.675  0.700  0.725  0.750  0.775  0.800  0.825  0.850  0.875  0.900  0.925  0.950  0.975  1.000  1.025  1.050  1.075  1.100  1.125  1.150  1.175  1.200  1.225  1.250  1.275  1.300  1.325  1.350  1.375  1.400  1.425  1.450  1.475  1.500  1.525  1.550  1.575  1.600  1.625  1.650  1.675  1.700  1.725  1.750  1.775  1.800  1.825  1.850  1.875  1.900  1.925  1.950  1.975  2.000  2.025  2.050  2.075  2.100  2.125  2.150  2.175  2.200  2.225  2.250  2.275  2.300  2.325  2.350  2.375  2.400  2.425  2.450  2.475  2.500  2.525  2.550  2.575  2.600  2.625  2.650  2.675  2.700  2.725  2.750  2.775  2.800  2.825  2.850  2.875  2.900  2.925  2.950  2.975  3.000  3.025  3.050  3.075  3.100  3.125  3.150  3.175  3.200  3.225  3.250  3.275  3.300  3.325  3.350  3.375  3.400  3.425  3.450  3.475  3.500  3.525  3.550  3.575  3.600  3.625  3.650  3.675  3.700  3.725  3.750  3.775  3.800  3.825  3.850  3.875  3.900  3.925  3.950  3.975  4.000  4.025  4.050  4.075  4.100  4.125  4.150  4.175  4.200  4.225  4.250  4.275  4.300  4.325  4.350  4.375  4.400  4.425  4.450  4.475  4.500  4.525  4.550  4.575  4.600  4.625  4.650  4.675  4.700  4.725  4.750  4.775  4.800  4.825  4.850  4.875  4.900  4.925  4.950  4.975  5.00  5.025  5.050  5.075  5.100  5.125  5.150  5.175  5.200
+  } {
+      add EtaPhiBins $eta $PhiBins
+  }
+
+
+  # default energy fractions {abs(PDG code)} {Fecal Fhcal}
+  add EnergyFraction {0} {0.0 1.0}
+  # energy fractions for e, gamma and pi0
+  add EnergyFraction {11} {1.0 0.0}
+  add EnergyFraction {22} {1.0 0.0}
+  add EnergyFraction {111} {1.0 0.0}
+  # energy fractions for muon, neutrinos and neutralinos
+  add EnergyFraction {12} {0.0 0.0}
+  add EnergyFraction {13} {0.0 0.0}
+  add EnergyFraction {14} {0.0 0.0}
+  add EnergyFraction {16} {0.0 0.0}
+  add EnergyFraction {1000022} {0.0 0.0}
+  add EnergyFraction {1000023} {0.0 0.0}
+  add EnergyFraction {1000025} {0.0 0.0}
+  add EnergyFraction {1000035} {0.0 0.0}
+  add EnergyFraction {1000045} {0.0 0.0}
+  # energy fractions for K0short and Lambda
+  add EnergyFraction {310} {0.3 0.7}
+  add EnergyFraction {3122} {0.3 0.7}
+
+## no minimum p range given (Uta 22.12.16)
+## sigma_E = E* (a/sqrt(E) + b) = sqrt ( E*a^2 E +E^2*b^2 )
+## a = sampling term, b = constant term 
+# ECAL eta : 5.0 - 2.7 - -2.1 - -4.4 (subtract -0.1 in eta as safety distance to edges) 
+    set ECalResolutionFormula {  ( eta <= 5.0 && eta > 2.7 ) * sqrt(energy*0.1^2 + energy^2*0.01^2)  + \
+				     ( eta <=2.7 && eta >= -2.1 ) * sqrt(energy*0.09^2 + energy^2*0.02^2)         + \                          
+	( eta < -2.1 && eta >= -4.4 ) * sqrt(energy*0.1^2 + energy^2*0.01^2) }
+    
+#### HCAL eta : 5.1 - 2.1 - -1.7 - -4.6 (subtract -0.1 in eta as safety distance to edges) 
+#set HCalResolutionFormula {resolution formula as a function of eta and energy}
+
+    set HCalResolutionFormula {  ( eta <= 5.1 && eta > 2.1 ) * sqrt(energy*0.4^2 + energy^2*0.02^2)  + \
+				     ( eta <=2.1 && eta >= -1.7 ) * sqrt(energy*0.4^2 + energy^2*0.02^2)         + \   
+	( eta < -1.7 && eta >= -4.7 ) * sqrt(energy*0.4^2 + energy^2*0.04^2) }
+    
+}
+####################
+# Energy flow merger
+####################
+
+module Merger EFlowMerger {
+# add InputArray InputArray
+# exchange UK:  25.7.16 change back to all eflowtracks!
+#  add InputArray ImpactParameterSmearing/tracks
+## eflowTracks kills electrons for Delphes 3.3.3 and ep??
+  add InputArray Calorimeter/eflowTracks
+  add InputArray Calorimeter/eflowPhotons
+  add InputArray Calorimeter/eflowNeutralHadrons
+  set OutputArray eflow
+}
+
+###################
+# Photon efficiency
+###################
+
+module Efficiency PhotonEfficiency {
+#  set InputArray Calorimeter/eflowPhotons
+# 21.7.16 use photons
+  set InputArray Calorimeter/photons
+  set OutputArray photons
+
+  # set EfficiencyFormula {efficiency formula as a function of eta and pt}
+
+# efficiency formula for photons - same as for electrons
+# expand ad set flat
+## OLD EFFICIENCY
+## set EfficiencyFormula {  ( (eta <=4.9 && eta >= -4.3) ) * (1.0) + \
+##			       ((eta > 4.9 || eta < -4.3)) * (0.00)}
+#########################################################                   
+# OF, 20.03.24: NEW EFFICIENCY TO AVOID SOFT PHOTONS   ##
+#########################################################                   
+    set EfficiencyFormula {   (pt <= 0.5) * (0.00) + (pt > 0.5) *( (eta <=4.9 && eta >= -4.3) ) * (1.0) + \
+			       ((eta > 4.9 || eta < -4.3)) * (0.00)}
+
+} 
+
+##################
+# Photon isolation
+##################
+
+module Isolation PhotonIsolation {
+  set CandidateInputArray PhotonEfficiency/photons
+  set IsolationInputArray EFlowMerger/eflow
+
+  set OutputArray photons
+
+  set DeltaRMax 0.4
+
+  set PTMin 0.5
+
+  set PTRatioMax 0.1
+}
+
+#################
+# Electron filter
+#################
+
+module PdgCodeFilter ElectronFilter {
+  set InputArray Calorimeter/eflowTracks
+  set OutputArray electrons
+  set Invert true
+    add PdgCode {11}
+    add PdgCode {-11}
+}
+
+#################
+# Muon filter
+#################
+
+module PdgCodeFilter MuonFilter {
+  set InputArray Calorimeter/eflowTracks
+  set OutputArray muons
+  set Invert true
+    add PdgCode {13}
+    add PdgCode {-13}
+}
+
+#####################
+# Electron efficiency
+#####################
+
+module Efficiency ElectronEfficiency {
+  set InputArray ElectronFilter/electrons
+  set OutputArray electrons
+
+  # set EfficiencyFormula {efficiency formula as a function of eta and pt}
+
+  # efficiency formula for electrons
+    #  1 degree =  eta<4.7
+## OLD EFFICIENCY 
+## set EfficiencyFormula {  ( (eta <=4.9 && eta >= -4.3) ) * (1.0) + \
+##			       ((eta > 4.9 || eta < -4.3)) * (0.00)}
+#########################################################                   
+# OF, 20.03.24: NEW EFFICIENCY TO AVOID SOFT ELECTRONS ##
+#########################################################                   
+    set EfficiencyFormula {   (pt <= 0.5) * (0.00) + (pt > 0.5) *( (eta <=4.9 && eta >= -4.3) ) * (1.0) + \
+			       ((eta > 4.9 || eta < -4.3)) * (0.00)}
+
+}
+
+####################
+# Electron isolation
+####################
+
+module Isolation ElectronIsolation {
+  set CandidateInputArray ElectronEfficiency/electrons
+  set IsolationInputArray EFlowMerger/eflow
+
+  set OutputArray electrons
+
+  set DeltaRMax 0.4
+
+  set PTMin 0.5
+
+  set PTRatioMax 0.1
+}
+
+#################
+# Muon efficiency
+#################
+
+module Efficiency MuonEfficiency {
+  set InputArray MuonMomentumSmearing/muons
+ set InputArray MuonFilter/muons
+  set OutputArray muons
+
+  # set EfficiencyFormula {efficiency as a function of eta and pt}
+
+  # efficiency formula for muons
+# set to 1 for |eta|<4
+  set EfficiencyFormula {                 (abs(eta) <= 4)  * (1.0) + \
+                         (abs(eta) > 4)                                   * (0.00)}
+}
+
+################
+# Muon isolation
+################
+
+module Isolation MuonIsolation {
+  set CandidateInputArray MuonEfficiency/muons
+  set IsolationInputArray EFlowMerger/eflow
+
+  set OutputArray muons
+
+  set DeltaRMax 0.4
+
+  set PTMin 0.5
+
+  set PTRatioMax 0.1
+}
+
+###################
+# Missing ET merger
+###################
+
+module Merger MissingET {
+# add InputArray InputArray
+  add InputArray EFlowMerger/eflow
+  set MomentumOutputArray momentum
+}
+
+##################
+# Scalar HT merger
+##################
+
+module Merger ScalarHT {
+# add InputArray InputArray
+  add InputArray UniqueObjectFinder/jets
+  add InputArray UniqueObjectFinder/electrons
+  add InputArray UniqueObjectFinder/photons
+  add InputArray UniqueObjectFinder/muons
+  set EnergyOutputArray energy
+}
+
+#####################
+# MC truth jet finder
+#####################
+
+module FastJetFinder GenJetFinder {
+  set InputArray Delphes/stableParticles
+
+  set OutputArray jets
+
+  # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt
+  set JetAlgorithm 6
+  set ParameterR 0.7
+
+  set JetPTMin 3.0
+}
+
+############
+# Jet finder
+############
+
+module FastJetFinder FastJetFinder {
+# ATLAS uses towers
+#  set InputArray Calorimeter/towers
+# CMS uses eflow?
+  set InputArray EFlowMerger/eflow
+
+  set OutputArray jets
+
+  # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt
+  set JetAlgorithm 6
+  set ParameterR 0.4
+
+  set JetPTMin 1.0
+}
+
+
+##################
+# Jet Energy Scale
+##################
+
+module EnergyScale JetEnergyScale {
+  set InputArray FastJetFinder/jets
+  set OutputArray jets
+
+ # scale formula for jets
+  set ScaleFormula {1.00}
+}
+
+########################
+# GenJet Flavor Association
+########################
+
+module JetFlavorAssociation GenJetFlavorAssociation {
+  set PartonInputArray Delphes/partons
+  set ParticleInputArray Delphes/allParticles
+  set ParticleLHEFInputArray Delphes/allParticlesLHEF
+  set JetInputArray GenJetFinder/jets
+
+  set DeltaR 0.4
+  set PartonPTMin 0.5
+  set PartonEtaMax 3.0
+
+}
+
+########################
+# Jet Flavor Association
+########################
+
+module JetFlavorAssociation JetFlavorAssociation {
+
+  set PartonInputArray Delphes/partons
+  set ParticleInputArray Delphes/allParticles
+  set ParticleLHEFInputArray Delphes/allParticlesLHEF
+  set JetInputArray JetEnergyScale/jets
+
+  set DeltaR 0.4
+  set PartonPTMin 0.5
+  set PartonEtaMax 3.0
+
+}
+
+###########
+# b-tagging
+###########
+module BTagging GenBTagging {
+  set PartonInputArray Delphes/partons
+  set JetInputArray GenJetFinder/jets
+
+  set BitNumber 0
+
+  set DeltaR 0.4
+
+  set PartonPTMin 0.5
+
+  set PartonEtaMax 6.0
+
+  # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt}
+  # PDG code = the highest PDG code of a quark or gluon inside DeltaR cone around jet axis
+  # gluon's PDG code has the lowest priority
+
+  # https://twiki.cern.ch/twiki/bin/view/CMSPublic/PhysicsResultsBTV
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.001}
+
+  # efficiency formula for c-jets (misidentification rate)
+  add EfficiencyFormula {4} {0.05}
+
+  # efficiency formula for b-jets
+  add EfficiencyFormula {5} {0.75}
+}
+
+
+####################
+# standard B-tagging
+## ATTENTION : idealised values - use for cross check only
+####################
+module BTagging BTagging {
+  set PartonInputArray Delphes/partons
+  set JetInputArray JetEnergyScale/jets
+
+  set BitNumber 0
+
+  set DeltaR 0.4
+
+  set PartonPTMin 0.5
+
+  set PartonEtaMax 6.0
+
+  # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt}
+  # PDG code = the highest PDG code of a quark or gluon inside DeltaR cone around jet axis
+  # gluon's PDG code has the lowest priority
+
+  # https://twiki.cern.ch/twiki/bin/view/CMSPublic/PhysicsResultsBTV
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.001}
+
+ 
+  # efficiency formula for c-jets (misidentification rate)
+  add EfficiencyFormula {4} {0.05}
+
+  # efficiency formula for b-jets
+  add EfficiencyFormula {5} {0.75}
+
+}
+
+
+
+module TauTagging TauTagging {
+  set ParticleInputArray Delphes/allParticles
+  set PartonInputArray Delphes/partons
+  set JetInputArray JetEnergyScale/jets
+
+  set DeltaR 0.4
+
+  set TauPTMin 0.5
+
+  set TauEtaMax 6.0
+
+  # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt}
+
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.001}
+  # efficiency formula for tau-jets
+  add EfficiencyFormula {15} {0.4}
+}
+
+module TauTagging GenTauTagging {
+  set ParticleInputArray Delphes/allParticles
+  set PartonInputArray Delphes/partons
+  set JetInputArray GenJetFinder/jets
+
+  set DeltaR 0.4
+
+  set TauPTMin 0.5
+
+  set TauEtaMax 6.0
+
+  # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt}
+
+  # default efficiency formula (misidentification rate)
+  add EfficiencyFormula {0} {0.001}
+  # efficiency formula for tau-jets
+  add EfficiencyFormula {15} {0.4}
+}
+
+#####################################################
+# Find uniquely identified photons/electrons/tau/jets
+#####################################################
+
+module UniqueObjectFinder UniqueObjectFinder {
+# earlier arrays take precedence over later ones
+# add InputArray InputArray OutputArray
+  add InputArray PhotonIsolation/photons photons
+  add InputArray ElectronIsolation/electrons electrons
+  add InputArray MuonIsolation/muons muons
+  add InputArray JetEnergyScale/jets jets
+}
+
+##################
+# ROOT tree writer
+##################
+
+# tracks, towers and eflow objects are not stored by default in the output.
+# if needed (for jet constituent or other studies), uncomment the relevant
+# "add Branch ..." lines.
+
+module TreeWriter TreeWriter {
+# add Branch InputArray BranchName BranchClass
+ add Branch Delphes/allParticles Particle GenParticle
+
+#  add Branch TrackMerger/tracks Track Track
+#  add Branch Calorimeter/towers Tower Tower
+
+# add Branch Calorimeter/eflowTracks EFlowTrack Track
+# add Branch Calorimeter/eflowPhotons EFlowPhoton Tower
+# add Branch Calorimeter/eflowNeutralHadrons EFlowNeutralHadron Tower
+
+  add Branch GenJetFinder/jets GenJet Jet
+  add Branch UniqueObjectFinder/jets Jet Jet
+  add Branch UniqueObjectFinder/electrons Electron Electron
+  add Branch UniqueObjectFinder/photons Photon Photon
+  add Branch UniqueObjectFinder/muons Muon Muon
+  add Branch MissingET/momentum MissingET MissingET
+  add Branch ScalarHT/energy ScalarHT ScalarHT
+}
Index: cards/delphes_card_MuonColliderDet.tcl
===================================================================
--- cards/delphes_card_MuonColliderDet.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
+++ cards/delphes_card_MuonColliderDet.tcl	(revision d612deca94f89952da103f30d46e21c02039b8bc)
@@ -0,0 +1,1738 @@
+#######################################
+# Muon Collider Detector TARGET model
+#
+# Michele Selvaggi michele.selvaggi@cern.ch
+# Ulrike Schnoor ulrike.schnoor@cern.ch
+#
+#
+# !!! DISCLAIMER !!!
+#
+# The parameterisation of the Muon Collider
+# has to be intended as a target performance.
+# This has not been validated by full simulation.
+# Hybrid between FCC-hh and CLIC performance.
+#
+#
+#######################################
+
+#######################################
+# Order of execution of various modules
+#######################################
+
+set ExecutionPath {
+    ParticlePropagator
+    TrackMergerProp
+
+    DenseProp
+    DenseMergeTracks
+    DenseTrackFilter
+
+    ChargedHadronTrackingEfficiency
+    ElectronTrackingEfficiency
+    MuonTrackingEfficiency
+    ForwardMuonEfficiency
+
+    ChargedHadronMomentumSmearing
+    ElectronMomentumSmearing
+    MuonMomentumSmearing
+    ForwardMuonMomentumSmearing
+
+    TrackMerger
+
+    ECal
+    HCal
+
+    Calorimeter
+    EFlowMerger
+    EFlowFilter
+
+    PhotonEfficiency
+    PhotonIsolation
+
+    ElectronFilter
+    ElectronEfficiency
+    ElectronIsolation
+
+    ChargedHadronFilter
+
+    MuonEfficiency
+    MuonIsolation
+
+    UniqueObjectFinder
+
+    NeutrinoFilter
+    GenJetFinder
+
+
+    FastJetFinderKt
+    FastJetFinderVLC_R02_N2
+    FastJetFinderVLC_R02_N3
+    FastJetFinderVLC_R02_N4
+    FastJetFinderVLC_R02_N5
+    FastJetFinderVLC_R02_N6
+    FastJetFinderVLC_R05_N2
+    FastJetFinderVLC_R05_N3
+    FastJetFinderVLC_R05_N4
+    FastJetFinderVLC_R05_N5
+    FastJetFinderVLC_R05_N6
+    FastJetFinderVLC_R07_N2
+    FastJetFinderVLC_R07_N3
+    FastJetFinderVLC_R07_N4
+    FastJetFinderVLC_R07_N5
+    FastJetFinderVLC_R07_N6
+    FastJetFinderVLC_R10_N2
+    FastJetFinderVLC_R10_N3
+    FastJetFinderVLC_R10_N4
+    FastJetFinderVLC_R10_N5
+    FastJetFinderVLC_R10_N6
+    FastJetFinderVLC_R12_N2
+    FastJetFinderVLC_R12_N3
+    FastJetFinderVLC_R12_N4
+    FastJetFinderVLC_R12_N5
+    FastJetFinderVLC_R12_N6
+    FastJetFinderVLC_R15_N2
+    FastJetFinderVLC_R15_N3
+    FastJetFinderVLC_R15_N4
+    FastJetFinderVLC_R15_N5
+    FastJetFinderVLC_R15_N6
+
+    FastJetFinderVLC_R05_inclusive
+    FastJetFinderVLC_R02_inclusive
+    FastJetFinderVLC_R07_inclusive
+    FastJetFinderVLC_R10_inclusive
+    FastJetFinderVLC_R12_inclusive
+    FastJetFinderVLC_R15_inclusive
+
+    MissingET
+    GenMissingET
+
+    JetMomentumSmearing_VLCR02N2
+    JetMomentumSmearing_VLCR02N3
+    JetMomentumSmearing_VLCR02N4
+    JetMomentumSmearing_VLCR02N5
+    JetMomentumSmearing_VLCR02N6
+    JetMomentumSmearing_VLCR02_inclusive
+    JetMomentumSmearing_VLCR05N2
+    JetMomentumSmearing_VLCR05N3
+    JetMomentumSmearing_VLCR05N4
+    JetMomentumSmearing_VLCR05N5
+    JetMomentumSmearing_VLCR05N6
+    JetMomentumSmearing_VLCR05_inclusive
+    JetMomentumSmearing_VLCR07N2
+    JetMomentumSmearing_VLCR07N3
+    JetMomentumSmearing_VLCR07N4
+    JetMomentumSmearing_VLCR07N5
+    JetMomentumSmearing_VLCR07N6
+    JetMomentumSmearing_VLCR07_inclusive
+    JetMomentumSmearing_VLCR10N2
+    JetMomentumSmearing_VLCR10N3
+    JetMomentumSmearing_VLCR10N4
+    JetMomentumSmearing_VLCR10N5
+    JetMomentumSmearing_VLCR10N6
+    JetMomentumSmearing_VLCR10_inclusive
+    JetMomentumSmearing_VLCR12N2
+    JetMomentumSmearing_VLCR12N3
+    JetMomentumSmearing_VLCR12N4
+    JetMomentumSmearing_VLCR12N5
+    JetMomentumSmearing_VLCR12N6
+    JetMomentumSmearing_VLCR12_inclusive
+    JetMomentumSmearing_VLCR15N2
+    JetMomentumSmearing_VLCR15N3
+    JetMomentumSmearing_VLCR15N4
+    JetMomentumSmearing_VLCR15N5
+    JetMomentumSmearing_VLCR15N6
+    JetMomentumSmearing_VLCR15_inclusive
+
+
+    JetFlavorAssociation_R02N2
+    JetFlavorAssociation_R02N3
+    JetFlavorAssociation_R02N4
+    JetFlavorAssociation_R02N5
+    JetFlavorAssociation_R02N6
+    JetFlavorAssociation_R05N2
+    JetFlavorAssociation_R05N3
+    JetFlavorAssociation_R05N4
+    JetFlavorAssociation_R05N5
+    JetFlavorAssociation_R05N6
+
+    JetFlavorAssociation_R07N2
+    JetFlavorAssociation_R07N3
+    JetFlavorAssociation_R07N4
+    JetFlavorAssociation_R07N5
+    JetFlavorAssociation_R07N6
+
+    JetFlavorAssociation_R10N2
+    JetFlavorAssociation_R10N3
+    JetFlavorAssociation_R10N4
+    JetFlavorAssociation_R10N5
+    JetFlavorAssociation_R10N6
+
+    JetFlavorAssociation_R12N2
+    JetFlavorAssociation_R12N3
+    JetFlavorAssociation_R12N4
+    JetFlavorAssociation_R12N5
+    JetFlavorAssociation_R12N6
+
+    JetFlavorAssociation_R15N2
+    JetFlavorAssociation_R15N3
+    JetFlavorAssociation_R15N4
+    JetFlavorAssociation_R15N5
+    JetFlavorAssociation_R15N6
+
+    JetFlavorAssociation_R02_inclusive
+    JetFlavorAssociation_R05_inclusive
+    JetFlavorAssociation_R07_inclusive
+    JetFlavorAssociation_R10_inclusive
+    JetFlavorAssociation_R12_inclusive
+    JetFlavorAssociation_R15_inclusive
+
+
+    BTagging_WP50_R02N2
+    BTagging_WP70_R02N2
+    BTagging_WP90_R02N2
+    BTagging_WP50_R02N3
+    BTagging_WP70_R02N3
+    BTagging_WP90_R02N3
+    BTagging_WP50_R02N4
+    BTagging_WP70_R02N4
+    BTagging_WP90_R02N4
+    BTagging_WP50_R02N5
+    BTagging_WP70_R02N5
+    BTagging_WP90_R02N5
+    BTagging_WP50_R02N6
+    BTagging_WP70_R02N6
+    BTagging_WP90_R02N6
+    BTagging_WP50_R05N2
+    BTagging_WP70_R05N2
+    BTagging_WP90_R05N2
+    BTagging_WP50_R05N3
+    BTagging_WP70_R05N3
+    BTagging_WP90_R05N3
+    BTagging_WP50_R05N4
+    BTagging_WP70_R05N4
+    BTagging_WP90_R05N4
+    BTagging_WP50_R05N5
+    BTagging_WP70_R05N5
+    BTagging_WP90_R05N5
+    BTagging_WP50_R05N6
+    BTagging_WP70_R05N6
+    BTagging_WP90_R05N6
+    BTagging_WP50_R07N2
+    BTagging_WP70_R07N2
+    BTagging_WP90_R07N2
+    BTagging_WP50_R07N3
+    BTagging_WP70_R07N3
+    BTagging_WP90_R07N3
+    BTagging_WP50_R07N4
+    BTagging_WP70_R07N4
+    BTagging_WP90_R07N4
+    BTagging_WP50_R07N5
+    BTagging_WP70_R07N5
+    BTagging_WP90_R07N5
+    BTagging_WP50_R07N6
+    BTagging_WP70_R07N6
+    BTagging_WP90_R07N6
+    BTagging_WP50_R10N2
+    BTagging_WP70_R10N2
+    BTagging_WP90_R10N2
+    BTagging_WP50_R10N3
+    BTagging_WP70_R10N3
+    BTagging_WP90_R10N3
+    BTagging_WP50_R10N4
+    BTagging_WP70_R10N4
+    BTagging_WP90_R10N4
+    BTagging_WP50_R10N5
+    BTagging_WP70_R10N5
+    BTagging_WP90_R10N5
+    BTagging_WP50_R10N6
+    BTagging_WP70_R10N6
+    BTagging_WP90_R10N6
+    BTagging_WP50_R12N2
+    BTagging_WP70_R12N2
+    BTagging_WP90_R12N2
+    BTagging_WP50_R12N3
+    BTagging_WP70_R12N3
+    BTagging_WP90_R12N3
+    BTagging_WP50_R12N4
+    BTagging_WP70_R12N4
+    BTagging_WP90_R12N4
+    BTagging_WP50_R12N5
+    BTagging_WP70_R12N5
+    BTagging_WP90_R12N5
+    BTagging_WP50_R12N6
+    BTagging_WP70_R12N6
+    BTagging_WP90_R12N6
+    BTagging_WP50_R15N2
+    BTagging_WP70_R15N2
+    BTagging_WP90_R15N2
+    BTagging_WP50_R15N3
+    BTagging_WP70_R15N3
+    BTagging_WP90_R15N3
+    BTagging_WP50_R15N4
+    BTagging_WP70_R15N4
+    BTagging_WP90_R15N4
+    BTagging_WP50_R15N5
+    BTagging_WP70_R15N5
+    BTagging_WP90_R15N5
+    BTagging_WP50_R15N6
+    BTagging_WP70_R15N6
+    BTagging_WP90_R15N6
+    BTagging_WP50_R02_inclusive
+    BTagging_WP70_R02_inclusive
+    BTagging_WP90_R02_inclusive
+    BTagging_WP50_R05_inclusive
+    BTagging_WP70_R05_inclusive
+    BTagging_WP90_R05_inclusive
+    BTagging_WP50_R07_inclusive
+    BTagging_WP70_R07_inclusive
+    BTagging_WP90_R07_inclusive
+    BTagging_WP50_R10_inclusive
+    BTagging_WP70_R10_inclusive
+    BTagging_WP90_R10_inclusive
+    BTagging_WP50_R12_inclusive
+    BTagging_WP70_R12_inclusive
+    BTagging_WP90_R12_inclusive
+    BTagging_WP50_R15_inclusive
+    BTagging_WP70_R15_inclusive
+    BTagging_WP90_R15_inclusive
+
+
+    TauTagging_R02N2
+    TauTagging_R02N3
+    TauTagging_R02N4
+    TauTagging_R02N5
+    TauTagging_R02N6
+    TauTagging_R05N2
+    TauTagging_R05N3
+    TauTagging_R05N4
+    TauTagging_R05N5
+    TauTagging_R05N6
+    TauTagging_R07N2
+    TauTagging_R07N3
+    TauTagging_R07N4
+    TauTagging_R07N5
+    TauTagging_R07N6
+    TauTagging_R10N2
+    TauTagging_R10N3
+    TauTagging_R10N4
+    TauTagging_R10N5
+    TauTagging_R10N6
+    TauTagging_R12N2
+    TauTagging_R12N3
+    TauTagging_R12N4
+    TauTagging_R12N5
+    TauTagging_R12N6
+    TauTagging_R15N2
+    TauTagging_R15N3
+    TauTagging_R15N4
+    TauTagging_R15N5
+    TauTagging_R15N6
+    TauTagging_R02_inclusive
+    TauTagging_R05_inclusive
+    TauTagging_R07_inclusive
+    TauTagging_R10_inclusive
+    TauTagging_R12_inclusive
+    TauTagging_R15_inclusive
+
+    ScalarHT
+
+    TreeWriter
+}
+
+#################################
+# Propagate particles in cylinder
+#################################
+
+module ParticlePropagator ParticlePropagator {
+    set InputArray Delphes/stableParticles
+
+    set OutputArray stableParticles
+    set ChargedHadronOutputArray chargedHadrons
+    set ElectronOutputArray electrons
+    set MuonOutputArray muons
+
+    # radius of the magnetic field coverage in the calorimeter, in m
+    set Radius 1.5
+    # half-length of the magnetic field coverage in the calorimeter, in m
+    set HalfLength 2.31
+
+    # magnetic field, in T
+    set Bz 4.0
+}
+
+
+##############
+# Track merger
+##############
+
+module Merger TrackMergerProp {
+# add InputArray InputArray
+  add InputArray ParticlePropagator/chargedHadrons
+  add InputArray ParticlePropagator/electrons
+  add InputArray ParticlePropagator/muons
+  set OutputArray tracks
+}
+
+
+
+####################################
+# Track propagation to pseudo-pixel
+####################################
+
+module ParticlePropagator DenseProp {
+
+  set InputArray TrackMergerProp/tracks
+
+  # radius of the magnetic field coverage, in m
+  set Radius 0.45
+  set RadiusMax 1.5
+  # half-length of the magnetic field coverage, in m
+  set HalfLength 0.8
+  set HalfLengthMax 2.31
+
+  # magnetic field
+  set Bz 4.0
+}
+
+#####################
+# Dense Track merger
+#####################
+
+module Merger DenseMergeTracks {
+# add InputArray InputArray
+  add InputArray DenseProp/chargedHadrons
+  add InputArray DenseProp/electrons
+  add InputArray DenseProp/muons
+  set OutputArray tracks
+}
+
+
+######################
+#   Dense Track Filter
+######################
+
+module DenseTrackFilter DenseTrackFilter {
+
+  set TrackInputArray DenseMergeTracks/tracks
+
+  set TrackOutputArray tracks
+  set ChargedHadronOutputArray chargedHadrons
+  set ElectronOutputArray electrons
+  set MuonOutputArray muons
+
+  set EtaPhiRes 0.003
+  set EtaMax 2.5
+
+  set pi [expr {acos(-1)}]
+
+  set nbins_phi [expr {$pi/$EtaPhiRes} ]
+  set nbins_phi [expr {int($nbins_phi)} ]
+
+  set PhiBins {}
+  for {set i -$nbins_phi} {$i <= $nbins_phi} {incr i} {
+    add PhiBins [expr {$i * $pi/$nbins_phi}]
+  }
+
+  set nbins_eta [expr {$EtaMax/$EtaPhiRes} ]
+  set nbins_eta [expr {int($nbins_eta)} ]
+
+  for {set i -$nbins_eta} {$i <= $nbins_eta} {incr i} {
+    set eta [expr {$i * $EtaPhiRes}]
+    add EtaPhiBins $eta $PhiBins
+  }
+}
+
+
+
+
+####################################
+# Charged hadron tracking efficiency
+####################################
+
+module Efficiency ChargedHadronTrackingEfficiency {
+    set InputArray DenseTrackFilter/chargedHadrons
+    set OutputArray chargedHadrons
+    # tracking efficiency formula for charged hadrons
+
+    set EfficiencyFormula { (pt <= 0.5) * (0.00) +
+    (abs(eta) <= 2.0) * (pt > 0.5 && pt <= 1) * (0.90) +
+    (abs(eta) <= 2.0) * (pt > 1) * (0.95) +
+    (abs(eta) > 2.0 && abs(eta) < 2.5) * (pt > 0.5 && pt <= 1) * (0.80) +
+    (abs(eta) > 2.0 && abs(eta) < 2.5) * (pt > 1.0) * (0.85) +
+    (abs(eta) > 2.5 ) * (0.00)
+   }
+}
+
+##############################
+# Electron tracking efficiency
+##############################
+
+module Efficiency ElectronTrackingEfficiency {
+    set InputArray DenseTrackFilter/electrons
+    set OutputArray electrons
+
+    set EfficiencyFormula { (pt <= 0.5) * (0.00) +
+    (abs(eta) <= 2.0) * (pt > 0.5 && pt <= 1) * (0.90) +
+    (abs(eta) <= 2.0) * (pt > 1) * (0.95) +
+    (abs(eta) > 2.0 && abs(eta) < 2.5) * (pt > 0.5 && pt <= 1) * (0.80) +
+    (abs(eta) > 2.0 && abs(eta) < 2.5) * (pt > 1.0) * (0.85) +
+    (abs(eta) > 2.5 ) * (0.00)
+   }
+}
+
+##########################
+# Muon tracking efficiency
+##########################
+
+module Efficiency MuonTrackingEfficiency {
+    set InputArray DenseTrackFilter/muons
+    set OutputArray muons
+
+    set EfficiencyFormula { (pt <= 0.5) * (0.00) +
+    (abs(eta) <= 2.0) * (pt > 0.5 && pt <= 1) * (0.95) +
+    (abs(eta) <= 2.0) * (pt > 1) * (0.99) +
+    (abs(eta) > 2.0 && abs(eta) < 2.5) * (pt > 0.5 && pt <= 1) * (0.90) +
+    (abs(eta) > 2.0 && abs(eta) < 2.5) * (pt > 1.0) * (0.95) +
+    (abs(eta) > 2.5 ) * (0.00)
+   }
+}
+
+##########################
+# Forward Muon efficiency
+##########################
+
+## hypothetical forward muon spectrometer
+module Efficiency ForwardMuonEfficiency {
+    set InputArray ParticlePropagator/muons
+    set OutputArray muons
+
+    set EfficiencyFormula { (pt <= 0.5) * (0.00) +
+    (abs(eta) < 2.5 )                   * (0.00) +
+    (abs(eta) > 2.5 && abs(eta) < 8.0) * (pt > 0.5 && pt <= 1) * (0.90) +
+    (abs(eta) > 2.5 && abs(eta) < 8.0) * (pt > 1.0) * (0.95) +
+    (abs(eta) > 8.0 ) * (0.00)
+   }
+}
+
+
+########################################
+# Momentum resolution for charged tracks
+########################################
+
+module MomentumSmearing ChargedHadronMomentumSmearing {
+    set InputArray ChargedHadronTrackingEfficiency/chargedHadrons
+    set OutputArray chargedHadrons
+
+
+    # Resolution given in dpT/pT (from FCC-hh)
+    set ResolutionFormula {    (abs(eta) >= 0.0000 && abs(eta) < 0.1000) * (energy >= 0.0000 && energy < 1.0000) * (0.00315864) + \
+       (abs(eta) >= 0.0000 && abs(eta) < 0.1000) * (energy >= 1.0000 && energy < 2.0000) * (0.003159 + (energy-1.000000)* 0.000007) + \
+       (abs(eta) >= 0.0000 && abs(eta) < 0.1000) * (energy >= 2.0000 && energy < 5.0000) * (0.003166 + (energy-2.000000)* 0.000011) + \
+       (abs(eta) >= 0.0000 && abs(eta) < 0.1000) * (energy >= 5.0000 && energy < 10.0000) * (0.003198 + (energy-5.000000)* 0.000012) + \
+       (abs(eta) >= 0.0000 && abs(eta) < 0.1000) * (energy >= 10.0000 && energy < 100.0000) * (0.003259 + (energy-10.000000)* 0.000010) + \
+       (abs(eta) >= 0.0000 && abs(eta) < 0.1000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004173 + (energy-100.000000)* 0.000019) + \
+       (abs(eta) >= 0.0000 && abs(eta) < 0.1000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.020916 + (energy-1000.000000)* 0.000021) + \
+       (abs(eta) >= 0.0000 && abs(eta) < 0.1000) * (energy >= 10000.0000) * (0.205876*energy/10000.000000) + \
+       (abs(eta) >= 0.1000 && abs(eta) < 0.2000) * (energy >= 0.0000 && energy < 1.0000) * (0.00316278) + \
+       (abs(eta) >= 0.1000 && abs(eta) < 0.2000) * (energy >= 1.0000 && energy < 2.0000) * (0.003163 + (energy-1.000000)* 0.000006) + \
+       (abs(eta) >= 0.1000 && abs(eta) < 0.2000) * (energy >= 2.0000 && energy < 5.0000) * (0.003169 + (energy-2.000000)* 0.000010) + \
+       (abs(eta) >= 0.1000 && abs(eta) < 0.2000) * (energy >= 5.0000 && energy < 10.0000) * (0.003198 + (energy-5.000000)* 0.000011) + \
+       (abs(eta) >= 0.1000 && abs(eta) < 0.2000) * (energy >= 10.0000 && energy < 100.0000) * (0.003255 + (energy-10.000000)* 0.000010) + \
+       (abs(eta) >= 0.1000 && abs(eta) < 0.2000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004165 + (energy-100.000000)* 0.000019) + \
+       (abs(eta) >= 0.1000 && abs(eta) < 0.2000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.020917 + (energy-1000.000000)* 0.000021) + \
+       (abs(eta) >= 0.1000 && abs(eta) < 0.2000) * (energy >= 10000.0000) * (0.205952*energy/10000.000000) + \
+       (abs(eta) >= 0.2000 && abs(eta) < 0.3000) * (energy >= 0.0000 && energy < 1.0000) * (0.00320482) + \
+       (abs(eta) >= 0.2000 && abs(eta) < 0.3000) * (energy >= 1.0000 && energy < 2.0000) * (0.003205 + (energy-1.000000)* 0.000006) + \
+       (abs(eta) >= 0.2000 && abs(eta) < 0.3000) * (energy >= 2.0000 && energy < 5.0000) * (0.003211 + (energy-2.000000)* 0.000009) + \
+       (abs(eta) >= 0.2000 && abs(eta) < 0.3000) * (energy >= 5.0000 && energy < 10.0000) * (0.003238 + (energy-5.000000)* 0.000011) + \
+       (abs(eta) >= 0.2000 && abs(eta) < 0.3000) * (energy >= 10.0000 && energy < 100.0000) * (0.003294 + (energy-10.000000)* 0.000010) + \
+       (abs(eta) >= 0.2000 && abs(eta) < 0.3000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004176 + (energy-100.000000)* 0.000018) + \
+       (abs(eta) >= 0.2000 && abs(eta) < 0.3000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.020586 + (energy-1000.000000)* 0.000020) + \
+       (abs(eta) >= 0.2000 && abs(eta) < 0.3000) * (energy >= 10000.0000) * (0.202528*energy/10000.000000) + \
+       (abs(eta) >= 0.3000 && abs(eta) < 0.4000) * (energy >= 0.0000 && energy < 1.0000) * (0.00325680) + \
+       (abs(eta) >= 0.3000 && abs(eta) < 0.4000) * (energy >= 1.0000 && energy < 2.0000) * (0.003257 + (energy-1.000000)* 0.000001) + \
+       (abs(eta) >= 0.3000 && abs(eta) < 0.4000) * (energy >= 2.0000 && energy < 5.0000) * (0.003257 + (energy-2.000000)* 0.000009) + \
+       (abs(eta) >= 0.3000 && abs(eta) < 0.4000) * (energy >= 5.0000 && energy < 10.0000) * (0.003286 + (energy-5.000000)* 0.000011) + \
+       (abs(eta) >= 0.3000 && abs(eta) < 0.4000) * (energy >= 10.0000 && energy < 100.0000) * (0.003342 + (energy-10.000000)* 0.000009) + \
+       (abs(eta) >= 0.3000 && abs(eta) < 0.4000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004195 + (energy-100.000000)* 0.000017) + \
+       (abs(eta) >= 0.3000 && abs(eta) < 0.4000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.019873 + (energy-1000.000000)* 0.000019) + \
+       (abs(eta) >= 0.3000 && abs(eta) < 0.4000) * (energy >= 10000.0000) * (0.195142*energy/10000.000000) + \
+       (abs(eta) >= 0.4000 && abs(eta) < 0.5000) * (energy >= 0.0000 && energy < 1.0000) * (0.00354020) + \
+       (abs(eta) >= 0.4000 && abs(eta) < 0.5000) * (energy >= 1.0000 && energy < 2.0000) * (0.003540 + (energy-1.000000)* -0.000201) + \
+       (abs(eta) >= 0.4000 && abs(eta) < 0.5000) * (energy >= 2.0000 && energy < 5.0000) * (0.003340 + (energy-2.000000)* 0.000009) + \
+       (abs(eta) >= 0.4000 && abs(eta) < 0.5000) * (energy >= 5.0000 && energy < 10.0000) * (0.003366 + (energy-5.000000)* 0.000011) + \
+       (abs(eta) >= 0.4000 && abs(eta) < 0.5000) * (energy >= 10.0000 && energy < 100.0000) * (0.003422 + (energy-10.000000)* 0.000009) + \
+       (abs(eta) >= 0.4000 && abs(eta) < 0.5000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004265 + (energy-100.000000)* 0.000017) + \
+       (abs(eta) >= 0.4000 && abs(eta) < 0.5000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.019240 + (energy-1000.000000)* 0.000019) + \
+       (abs(eta) >= 0.4000 && abs(eta) < 0.5000) * (energy >= 10000.0000) * (0.188429*energy/10000.000000) + \
+       (abs(eta) >= 0.5000 && abs(eta) < 0.6000) * (energy >= 0.0000 && energy < 1.0000) * (0.00362672) + \
+       (abs(eta) >= 0.5000 && abs(eta) < 0.6000) * (energy >= 1.0000 && energy < 2.0000) * (0.003627 + (energy-1.000000)* -0.000223) + \
+       (abs(eta) >= 0.5000 && abs(eta) < 0.6000) * (energy >= 2.0000 && energy < 5.0000) * (0.003403 + (energy-2.000000)* 0.000008) + \
+       (abs(eta) >= 0.5000 && abs(eta) < 0.6000) * (energy >= 5.0000 && energy < 10.0000) * (0.003428 + (energy-5.000000)* 0.000010) + \
+       (abs(eta) >= 0.5000 && abs(eta) < 0.6000) * (energy >= 10.0000 && energy < 100.0000) * (0.003479 + (energy-10.000000)* 0.000009) + \
+       (abs(eta) >= 0.5000 && abs(eta) < 0.6000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004256 + (energy-100.000000)* 0.000016) + \
+       (abs(eta) >= 0.5000 && abs(eta) < 0.6000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.018471 + (energy-1000.000000)* 0.000018) + \
+       (abs(eta) >= 0.5000 && abs(eta) < 0.6000) * (energy >= 10000.0000) * (0.180531*energy/10000.000000) + \
+       (abs(eta) >= 0.6000 && abs(eta) < 0.7000) * (energy >= 0.0000 && energy < 1.0000) * (0.00386864) + \
+       (abs(eta) >= 0.6000 && abs(eta) < 0.7000) * (energy >= 1.0000 && energy < 2.0000) * (0.003869 + (energy-1.000000)* -0.000354) + \
+       (abs(eta) >= 0.6000 && abs(eta) < 0.7000) * (energy >= 2.0000 && energy < 5.0000) * (0.003515 + (energy-2.000000)* 0.000007) + \
+       (abs(eta) >= 0.6000 && abs(eta) < 0.7000) * (energy >= 5.0000 && energy < 10.0000) * (0.003536 + (energy-5.000000)* 0.000009) + \
+       (abs(eta) >= 0.6000 && abs(eta) < 0.7000) * (energy >= 10.0000 && energy < 100.0000) * (0.003583 + (energy-10.000000)* 0.000009) + \
+       (abs(eta) >= 0.6000 && abs(eta) < 0.7000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004349 + (energy-100.000000)* 0.000015) + \
+       (abs(eta) >= 0.6000 && abs(eta) < 0.7000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.017442 + (energy-1000.000000)* 0.000017) + \
+       (abs(eta) >= 0.6000 && abs(eta) < 0.7000) * (energy >= 10000.0000) * (0.169559*energy/10000.000000) + \
+       (abs(eta) >= 0.7000 && abs(eta) < 0.8000) * (energy >= 0.0000 && energy < 1.0000) * (0.00418203) + \
+       (abs(eta) >= 0.7000 && abs(eta) < 0.8000) * (energy >= 1.0000 && energy < 2.0000) * (0.004182 + (energy-1.000000)* -0.000556) + \
+       (abs(eta) >= 0.7000 && abs(eta) < 0.8000) * (energy >= 2.0000 && energy < 5.0000) * (0.003626 + (energy-2.000000)* 0.000007) + \
+       (abs(eta) >= 0.7000 && abs(eta) < 0.8000) * (energy >= 5.0000 && energy < 10.0000) * (0.003645 + (energy-5.000000)* 0.000008) + \
+       (abs(eta) >= 0.7000 && abs(eta) < 0.8000) * (energy >= 10.0000 && energy < 100.0000) * (0.003687 + (energy-10.000000)* 0.000008) + \
+       (abs(eta) >= 0.7000 && abs(eta) < 0.8000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004399 + (energy-100.000000)* 0.000013) + \
+       (abs(eta) >= 0.7000 && abs(eta) < 0.8000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.016509 + (energy-1000.000000)* 0.000016) + \
+       (abs(eta) >= 0.7000 && abs(eta) < 0.8000) * (energy >= 10000.0000) * (0.159676*energy/10000.000000) + \
+       (abs(eta) >= 0.8000 && abs(eta) < 0.9000) * (energy >= 0.0000 && energy < 1.0000) * (0.00436103) + \
+       (abs(eta) >= 0.8000 && abs(eta) < 0.9000) * (energy >= 1.0000 && energy < 2.0000) * (0.004361 + (energy-1.000000)* -0.000597) + \
+       (abs(eta) >= 0.8000 && abs(eta) < 0.9000) * (energy >= 2.0000 && energy < 5.0000) * (0.003764 + (energy-2.000000)* 0.000006) + \
+       (abs(eta) >= 0.8000 && abs(eta) < 0.9000) * (energy >= 5.0000 && energy < 10.0000) * (0.003781 + (energy-5.000000)* 0.000008) + \
+       (abs(eta) >= 0.8000 && abs(eta) < 0.9000) * (energy >= 10.0000 && energy < 100.0000) * (0.003821 + (energy-10.000000)* 0.000007) + \
+       (abs(eta) >= 0.8000 && abs(eta) < 0.9000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004495 + (energy-100.000000)* 0.000012) + \
+       (abs(eta) >= 0.8000 && abs(eta) < 0.9000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.015532 + (energy-1000.000000)* 0.000015) + \
+       (abs(eta) >= 0.8000 && abs(eta) < 0.9000) * (energy >= 10000.0000) * (0.149090*energy/10000.000000) + \
+       (abs(eta) >= 0.9000 && abs(eta) < 1.0000) * (energy >= 0.0000 && energy < 1.0000) * (0.00488279) + \
+       (abs(eta) >= 0.9000 && abs(eta) < 1.0000) * (energy >= 1.0000 && energy < 2.0000) * (0.004883 + (energy-1.000000)* -0.000969) + \
+       (abs(eta) >= 0.9000 && abs(eta) < 1.0000) * (energy >= 2.0000 && energy < 5.0000) * (0.003914 + (energy-2.000000)* 0.000006) + \
+       (abs(eta) >= 0.9000 && abs(eta) < 1.0000) * (energy >= 5.0000 && energy < 10.0000) * (0.003930 + (energy-5.000000)* 0.000007) + \
+       (abs(eta) >= 0.9000 && abs(eta) < 1.0000) * (energy >= 10.0000 && energy < 100.0000) * (0.003967 + (energy-10.000000)* 0.000007) + \
+       (abs(eta) >= 0.9000 && abs(eta) < 1.0000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004593 + (energy-100.000000)* 0.000011) + \
+       (abs(eta) >= 0.9000 && abs(eta) < 1.0000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.014592 + (energy-1000.000000)* 0.000014) + \
+       (abs(eta) >= 0.9000 && abs(eta) < 1.0000) * (energy >= 10000.0000) * (0.138764*energy/10000.000000) + \
+       (abs(eta) >= 1.0000 && abs(eta) < 1.1000) * (energy >= 0.0000 && energy < 1.0000) * (0.00513716) + \
+       (abs(eta) >= 1.0000 && abs(eta) < 1.1000) * (energy >= 1.0000 && energy < 2.0000) * (0.005137 + (energy-1.000000)* -0.001026) + \
+       (abs(eta) >= 1.0000 && abs(eta) < 1.1000) * (energy >= 2.0000 && energy < 5.0000) * (0.004111 + (energy-2.000000)* 0.000005) + \
+       (abs(eta) >= 1.0000 && abs(eta) < 1.1000) * (energy >= 5.0000 && energy < 10.0000) * (0.004125 + (energy-5.000000)* 0.000007) + \
+       (abs(eta) >= 1.0000 && abs(eta) < 1.1000) * (energy >= 10.0000 && energy < 100.0000) * (0.004159 + (energy-10.000000)* 0.000007) + \
+       (abs(eta) >= 1.0000 && abs(eta) < 1.1000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004752 + (energy-100.000000)* 0.000010) + \
+       (abs(eta) >= 1.0000 && abs(eta) < 1.1000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.013718 + (energy-1000.000000)* 0.000013) + \
+       (abs(eta) >= 1.0000 && abs(eta) < 1.1000) * (energy >= 10000.0000) * (0.128750*energy/10000.000000) + \
+       (abs(eta) >= 1.1000 && abs(eta) < 1.2000) * (energy >= 0.0000 && energy < 1.0000) * (0.00572019) + \
+       (abs(eta) >= 1.1000 && abs(eta) < 1.2000) * (energy >= 1.0000 && energy < 2.0000) * (0.005720 + (energy-1.000000)* -0.001362) + \
+       (abs(eta) >= 1.1000 && abs(eta) < 1.2000) * (energy >= 2.0000 && energy < 5.0000) * (0.004359 + (energy-2.000000)* 0.000005) + \
+       (abs(eta) >= 1.1000 && abs(eta) < 1.2000) * (energy >= 5.0000 && energy < 10.0000) * (0.004372 + (energy-5.000000)* 0.000006) + \
+       (abs(eta) >= 1.1000 && abs(eta) < 1.2000) * (energy >= 10.0000 && energy < 100.0000) * (0.004405 + (energy-10.000000)* 0.000007) + \
+       (abs(eta) >= 1.1000 && abs(eta) < 1.2000) * (energy >= 100.0000 && energy < 1000.0000) * (0.005024 + (energy-100.000000)* 0.000010) + \
+       (abs(eta) >= 1.1000 && abs(eta) < 1.2000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.013902 + (energy-1000.000000)* 0.000013) + \
+       (abs(eta) >= 1.1000 && abs(eta) < 1.2000) * (energy >= 10000.0000) * (0.129437*energy/10000.000000) + \
+       (abs(eta) >= 1.2000 && abs(eta) < 1.3000) * (energy >= 0.0000 && energy < 1.0000) * (0.00613558) + \
+       (abs(eta) >= 1.2000 && abs(eta) < 1.3000) * (energy >= 1.0000 && energy < 2.0000) * (0.006136 + (energy-1.000000)* -0.001331) + \
+       (abs(eta) >= 1.2000 && abs(eta) < 1.3000) * (energy >= 2.0000 && energy < 5.0000) * (0.004805 + (energy-2.000000)* 0.000005) + \
+       (abs(eta) >= 1.2000 && abs(eta) < 1.3000) * (energy >= 5.0000 && energy < 10.0000) * (0.004818 + (energy-5.000000)* 0.000007) + \
+       (abs(eta) >= 1.2000 && abs(eta) < 1.3000) * (energy >= 10.0000 && energy < 100.0000) * (0.004851 + (energy-10.000000)* 0.000007) + \
+       (abs(eta) >= 1.2000 && abs(eta) < 1.3000) * (energy >= 100.0000 && energy < 1000.0000) * (0.005512 + (energy-100.000000)* 0.000012) + \
+       (abs(eta) >= 1.2000 && abs(eta) < 1.3000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.016144 + (energy-1000.000000)* 0.000015) + \
+       (abs(eta) >= 1.2000 && abs(eta) < 1.3000) * (energy >= 10000.0000) * (0.151739*energy/10000.000000) + \
+       (abs(eta) >= 1.3000 && abs(eta) < 1.4000) * (energy >= 0.0000 && energy < 1.0000) * (0.00655464) + \
+       (abs(eta) >= 1.3000 && abs(eta) < 1.4000) * (energy >= 1.0000 && energy < 2.0000) * (0.006555 + (energy-1.000000)* -0.001843) + \
+       (abs(eta) >= 1.3000 && abs(eta) < 1.4000) * (energy >= 2.0000 && energy < 5.0000) * (0.004711 + (energy-2.000000)* 0.000004) + \
+       (abs(eta) >= 1.3000 && abs(eta) < 1.4000) * (energy >= 5.0000 && energy < 10.0000) * (0.004724 + (energy-5.000000)* 0.000005) + \
+       (abs(eta) >= 1.3000 && abs(eta) < 1.4000) * (energy >= 10.0000 && energy < 100.0000) * (0.004748 + (energy-10.000000)* 0.000006) + \
+       (abs(eta) >= 1.3000 && abs(eta) < 1.4000) * (energy >= 100.0000 && energy < 1000.0000) * (0.005326 + (energy-100.000000)* 0.000009) + \
+       (abs(eta) >= 1.3000 && abs(eta) < 1.4000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.013686 + (energy-1000.000000)* 0.000012) + \
+       (abs(eta) >= 1.3000 && abs(eta) < 1.4000) * (energy >= 10000.0000) * (0.125361*energy/10000.000000) + \
+       (abs(eta) >= 1.4000 && abs(eta) < 1.5000) * (energy >= 0.0000 && energy < 1.0000) * (0.00714442) + \
+       (abs(eta) >= 1.4000 && abs(eta) < 1.5000) * (energy >= 1.0000 && energy < 2.0000) * (0.007144 + (energy-1.000000)* -0.002674) + \
+       (abs(eta) >= 1.4000 && abs(eta) < 1.5000) * (energy >= 2.0000 && energy < 5.0000) * (0.004470 + (energy-2.000000)* -0.000070) + \
+       (abs(eta) >= 1.4000 && abs(eta) < 1.5000) * (energy >= 5.0000 && energy < 10.0000) * (0.004259 + (energy-5.000000)* 0.000006) + \
+       (abs(eta) >= 1.4000 && abs(eta) < 1.5000) * (energy >= 10.0000 && energy < 100.0000) * (0.004287 + (energy-10.000000)* 0.000009) + \
+       (abs(eta) >= 1.4000 && abs(eta) < 1.5000) * (energy >= 100.0000 && energy < 1000.0000) * (0.005101 + (energy-100.000000)* 0.000008) + \
+       (abs(eta) >= 1.4000 && abs(eta) < 1.5000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.012303 + (energy-1000.000000)* 0.000011) + \
+       (abs(eta) >= 1.4000 && abs(eta) < 1.5000) * (energy >= 10000.0000) * (0.110091*energy/10000.000000) + \
+       (abs(eta) >= 1.5000 && abs(eta) < 1.6000) * (energy >= 0.0000 && energy < 1.0000) * (0.00680449) + \
+       (abs(eta) >= 1.5000 && abs(eta) < 1.6000) * (energy >= 1.0000 && energy < 2.0000) * (0.006804 + (energy-1.000000)* -0.002108) + \
+       (abs(eta) >= 1.5000 && abs(eta) < 1.6000) * (energy >= 2.0000 && energy < 5.0000) * (0.004696 + (energy-2.000000)* -0.000116) + \
+       (abs(eta) >= 1.5000 && abs(eta) < 1.6000) * (energy >= 5.0000 && energy < 10.0000) * (0.004348 + (energy-5.000000)* 0.000009) + \
+       (abs(eta) >= 1.5000 && abs(eta) < 1.6000) * (energy >= 10.0000 && energy < 100.0000) * (0.004391 + (energy-10.000000)* 0.000009) + \
+       (abs(eta) >= 1.5000 && abs(eta) < 1.6000) * (energy >= 100.0000 && energy < 1000.0000) * (0.005232 + (energy-100.000000)* 0.000007) + \
+       (abs(eta) >= 1.5000 && abs(eta) < 1.6000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.011392 + (energy-1000.000000)* 0.000010) + \
+       (abs(eta) >= 1.5000 && abs(eta) < 1.6000) * (energy >= 10000.0000) * (0.097988*energy/10000.000000) + \
+       (abs(eta) >= 1.6000 && abs(eta) < 1.7000) * (energy >= 0.0000 && energy < 1.0000) * (0.00763793) + \
+       (abs(eta) >= 1.6000 && abs(eta) < 1.7000) * (energy >= 1.0000 && energy < 2.0000) * (0.007638 + (energy-1.000000)* -0.003061) + \
+       (abs(eta) >= 1.6000 && abs(eta) < 1.7000) * (energy >= 2.0000 && energy < 5.0000) * (0.004577 + (energy-2.000000)* -0.000168) + \
+       (abs(eta) >= 1.6000 && abs(eta) < 1.7000) * (energy >= 5.0000 && energy < 10.0000) * (0.004074 + (energy-5.000000)* 0.000009) + \
+       (abs(eta) >= 1.6000 && abs(eta) < 1.7000) * (energy >= 10.0000 && energy < 100.0000) * (0.004121 + (energy-10.000000)* 0.000009) + \
+       (abs(eta) >= 1.6000 && abs(eta) < 1.7000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004910 + (energy-100.000000)* 0.000006) + \
+       (abs(eta) >= 1.6000 && abs(eta) < 1.7000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.010635 + (energy-1000.000000)* 0.000009) + \
+       (abs(eta) >= 1.6000 && abs(eta) < 1.7000) * (energy >= 10000.0000) * (0.090704*energy/10000.000000) + \
+       (abs(eta) >= 1.7000 && abs(eta) < 1.8000) * (energy >= 0.0000 && energy < 1.0000) * (0.00913948) + \
+       (abs(eta) >= 1.7000 && abs(eta) < 1.8000) * (energy >= 1.0000 && energy < 2.0000) * (0.009139 + (energy-1.000000)* -0.004405) + \
+       (abs(eta) >= 1.7000 && abs(eta) < 1.8000) * (energy >= 2.0000 && energy < 5.0000) * (0.004735 + (energy-2.000000)* -0.000231) + \
+       (abs(eta) >= 1.7000 && abs(eta) < 1.8000) * (energy >= 5.0000 && energy < 10.0000) * (0.004043 + (energy-5.000000)* 0.000005) + \
+       (abs(eta) >= 1.7000 && abs(eta) < 1.8000) * (energy >= 10.0000 && energy < 100.0000) * (0.004066 + (energy-10.000000)* 0.000007) + \
+       (abs(eta) >= 1.7000 && abs(eta) < 1.8000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004739 + (energy-100.000000)* 0.000006) + \
+       (abs(eta) >= 1.7000 && abs(eta) < 1.8000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.009891 + (energy-1000.000000)* 0.000008) + \
+       (abs(eta) >= 1.7000 && abs(eta) < 1.8000) * (energy >= 10000.0000) * (0.083216*energy/10000.000000) + \
+       (abs(eta) >= 1.8000 && abs(eta) < 1.9000) * (energy >= 0.0000 && energy < 1.0000) * (0.00956747) + \
+       (abs(eta) >= 1.8000 && abs(eta) < 1.9000) * (energy >= 1.0000 && energy < 2.0000) * (0.009567 + (energy-1.000000)* -0.004497) + \
+       (abs(eta) >= 1.8000 && abs(eta) < 1.9000) * (energy >= 2.0000 && energy < 5.0000) * (0.005070 + (energy-2.000000)* -0.000331) + \
+       (abs(eta) >= 1.8000 && abs(eta) < 1.9000) * (energy >= 5.0000 && energy < 10.0000) * (0.004078 + (energy-5.000000)* 0.000004) + \
+       (abs(eta) >= 1.8000 && abs(eta) < 1.9000) * (energy >= 10.0000 && energy < 100.0000) * (0.004100 + (energy-10.000000)* 0.000006) + \
+       (abs(eta) >= 1.8000 && abs(eta) < 1.9000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004682 + (energy-100.000000)* 0.000005) + \
+       (abs(eta) >= 1.8000 && abs(eta) < 1.9000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.009157 + (energy-1000.000000)* 0.000007) + \
+       (abs(eta) >= 1.8000 && abs(eta) < 1.9000) * (energy >= 10000.0000) * (0.074702*energy/10000.000000) + \
+       (abs(eta) >= 1.9000 && abs(eta) < 2.0000) * (energy >= 0.0000 && energy < 1.0000) * (0.00964334) + \
+       (abs(eta) >= 1.9000 && abs(eta) < 2.0000) * (energy >= 1.0000 && energy < 2.0000) * (0.009643 + (energy-1.000000)* -0.003950) + \
+       (abs(eta) >= 1.9000 && abs(eta) < 2.0000) * (energy >= 2.0000 && energy < 5.0000) * (0.005694 + (energy-2.000000)* -0.000479) + \
+       (abs(eta) >= 1.9000 && abs(eta) < 2.0000) * (energy >= 5.0000 && energy < 10.0000) * (0.004256 + (energy-5.000000)* 0.000005) + \
+       (abs(eta) >= 1.9000 && abs(eta) < 2.0000) * (energy >= 10.0000 && energy < 100.0000) * (0.004281 + (energy-10.000000)* 0.000006) + \
+       (abs(eta) >= 1.9000 && abs(eta) < 2.0000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004862 + (energy-100.000000)* 0.000004) + \
+       (abs(eta) >= 1.9000 && abs(eta) < 2.0000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.008501 + (energy-1000.000000)* 0.000006) + \
+       (abs(eta) >= 1.9000 && abs(eta) < 2.0000) * (energy >= 10000.0000) * (0.062525*energy/10000.000000) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 0.0000 && energy < 1.0000) * (0.01045039) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 1.0000 && energy < 2.0000) * (0.010450 + (energy-1.000000)* -0.005379) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 2.0000 && energy < 5.0000) * (0.005072 + (energy-2.000000)* -0.000321) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 5.0000 && energy < 10.0000) * (0.004109 + (energy-5.000000)* 0.000006) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 10.0000 && energy < 100.0000) * (0.004137 + (energy-10.000000)* 0.000006) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004666 + (energy-100.000000)* 0.000005) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.008951 + (energy-1000.000000)* 0.000007) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 10000.0000) * (0.073400*energy/10000.000000) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 0.0000 && energy < 1.0000) * (0.01046694) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 1.0000 && energy < 2.0000) * (0.010467 + (energy-1.000000)* -0.005023) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 2.0000 && energy < 5.0000) * (0.005444 + (energy-2.000000)* -0.000330) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 5.0000 && energy < 10.0000) * (0.004455 + (energy-5.000000)* 0.000005) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 10.0000 && energy < 100.0000) * (0.004479 + (energy-10.000000)* 0.000004) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004883 + (energy-100.000000)* 0.000005) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.009382 + (energy-1000.000000)* 0.000008) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 10000.0000) * (0.078852*energy/10000.000000) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 0.0000 && energy < 1.0000) * (0.01090933) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 1.0000 && energy < 2.0000) * (0.010909 + (energy-1.000000)* -0.005299) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 2.0000 && energy < 5.0000) * (0.005610 + (energy-2.000000)* -0.000302) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 5.0000 && energy < 10.0000) * (0.004704 + (energy-5.000000)* 0.000005) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 10.0000 && energy < 100.0000) * (0.004730 + (energy-10.000000)* 0.000005) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 100.0000 && energy < 1000.0000) * (0.005146 + (energy-100.000000)* 0.000006) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.010323 + (energy-1000.000000)* 0.000009) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 10000.0000) * (0.088469*energy/10000.000000) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 0.0000 && energy < 1.0000) * (0.01271833) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 1.0000 && energy < 2.0000) * (0.012718 + (energy-1.000000)* -0.005764) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 2.0000 && energy < 5.0000) * (0.006954 + (energy-2.000000)* -0.000492) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 5.0000 && energy < 10.0000) * (0.005479 + (energy-5.000000)* 0.000003) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 10.0000 && energy < 100.0000) * (0.005495 + (energy-10.000000)* 0.000003) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 100.0000 && energy < 1000.0000) * (0.005774 + (energy-100.000000)* 0.000006) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.011265 + (energy-1000.000000)* 0.000009) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 10000.0000) * (0.096592*energy/10000.000000) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 0.0000 && energy < 1.0000) * (0.01515272) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 1.0000 && energy < 2.0000) * (0.015153 + (energy-1.000000)* -0.007272) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 2.0000 && energy < 5.0000) * (0.007881 + (energy-2.000000)* -0.000660) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 5.0000 && energy < 10.0000) * (0.005900 + (energy-5.000000)* 0.000003) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 10.0000 && energy < 100.0000) * (0.005914 + (energy-10.000000)* 0.000003) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 100.0000 && energy < 1000.0000) * (0.006174 + (energy-100.000000)* 0.000007) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.012486 + (energy-1000.000000)* 0.000011) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 10000.0000) * (0.108659*energy/10000.000000)
+    }
+}
+
+###################################
+# Momentum resolution for electrons
+###################################
+
+module MomentumSmearing ElectronMomentumSmearing {
+    set InputArray ElectronTrackingEfficiency/electrons
+    set OutputArray electrons
+
+    # Resolution given in dpT/pT (from FCC-hh)
+    set ResolutionFormula {    (abs(eta) >= 0.0000 && abs(eta) < 0.1000) * (energy >= 0.0000 && energy < 1.0000) * (0.00315864) + \
+       (abs(eta) >= 0.0000 && abs(eta) < 0.1000) * (energy >= 1.0000 && energy < 2.0000) * (0.003159 + (energy-1.000000)* 0.000007) + \
+       (abs(eta) >= 0.0000 && abs(eta) < 0.1000) * (energy >= 2.0000 && energy < 5.0000) * (0.003166 + (energy-2.000000)* 0.000011) + \
+       (abs(eta) >= 0.0000 && abs(eta) < 0.1000) * (energy >= 5.0000 && energy < 10.0000) * (0.003198 + (energy-5.000000)* 0.000012) + \
+       (abs(eta) >= 0.0000 && abs(eta) < 0.1000) * (energy >= 10.0000 && energy < 100.0000) * (0.003259 + (energy-10.000000)* 0.000010) + \
+       (abs(eta) >= 0.0000 && abs(eta) < 0.1000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004173 + (energy-100.000000)* 0.000019) + \
+       (abs(eta) >= 0.0000 && abs(eta) < 0.1000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.020916 + (energy-1000.000000)* 0.000021) + \
+       (abs(eta) >= 0.0000 && abs(eta) < 0.1000) * (energy >= 10000.0000) * (0.205876*energy/10000.000000) + \
+       (abs(eta) >= 0.1000 && abs(eta) < 0.2000) * (energy >= 0.0000 && energy < 1.0000) * (0.00316278) + \
+       (abs(eta) >= 0.1000 && abs(eta) < 0.2000) * (energy >= 1.0000 && energy < 2.0000) * (0.003163 + (energy-1.000000)* 0.000006) + \
+       (abs(eta) >= 0.1000 && abs(eta) < 0.2000) * (energy >= 2.0000 && energy < 5.0000) * (0.003169 + (energy-2.000000)* 0.000010) + \
+       (abs(eta) >= 0.1000 && abs(eta) < 0.2000) * (energy >= 5.0000 && energy < 10.0000) * (0.003198 + (energy-5.000000)* 0.000011) + \
+       (abs(eta) >= 0.1000 && abs(eta) < 0.2000) * (energy >= 10.0000 && energy < 100.0000) * (0.003255 + (energy-10.000000)* 0.000010) + \
+       (abs(eta) >= 0.1000 && abs(eta) < 0.2000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004165 + (energy-100.000000)* 0.000019) + \
+       (abs(eta) >= 0.1000 && abs(eta) < 0.2000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.020917 + (energy-1000.000000)* 0.000021) + \
+       (abs(eta) >= 0.1000 && abs(eta) < 0.2000) * (energy >= 10000.0000) * (0.205952*energy/10000.000000) + \
+       (abs(eta) >= 0.2000 && abs(eta) < 0.3000) * (energy >= 0.0000 && energy < 1.0000) * (0.00320482) + \
+       (abs(eta) >= 0.2000 && abs(eta) < 0.3000) * (energy >= 1.0000 && energy < 2.0000) * (0.003205 + (energy-1.000000)* 0.000006) + \
+       (abs(eta) >= 0.2000 && abs(eta) < 0.3000) * (energy >= 2.0000 && energy < 5.0000) * (0.003211 + (energy-2.000000)* 0.000009) + \
+       (abs(eta) >= 0.2000 && abs(eta) < 0.3000) * (energy >= 5.0000 && energy < 10.0000) * (0.003238 + (energy-5.000000)* 0.000011) + \
+       (abs(eta) >= 0.2000 && abs(eta) < 0.3000) * (energy >= 10.0000 && energy < 100.0000) * (0.003294 + (energy-10.000000)* 0.000010) + \
+       (abs(eta) >= 0.2000 && abs(eta) < 0.3000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004176 + (energy-100.000000)* 0.000018) + \
+       (abs(eta) >= 0.2000 && abs(eta) < 0.3000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.020586 + (energy-1000.000000)* 0.000020) + \
+       (abs(eta) >= 0.2000 && abs(eta) < 0.3000) * (energy >= 10000.0000) * (0.202528*energy/10000.000000) + \
+       (abs(eta) >= 0.3000 && abs(eta) < 0.4000) * (energy >= 0.0000 && energy < 1.0000) * (0.00325680) + \
+       (abs(eta) >= 0.3000 && abs(eta) < 0.4000) * (energy >= 1.0000 && energy < 2.0000) * (0.003257 + (energy-1.000000)* 0.000001) + \
+       (abs(eta) >= 0.3000 && abs(eta) < 0.4000) * (energy >= 2.0000 && energy < 5.0000) * (0.003257 + (energy-2.000000)* 0.000009) + \
+       (abs(eta) >= 0.3000 && abs(eta) < 0.4000) * (energy >= 5.0000 && energy < 10.0000) * (0.003286 + (energy-5.000000)* 0.000011) + \
+       (abs(eta) >= 0.3000 && abs(eta) < 0.4000) * (energy >= 10.0000 && energy < 100.0000) * (0.003342 + (energy-10.000000)* 0.000009) + \
+       (abs(eta) >= 0.3000 && abs(eta) < 0.4000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004195 + (energy-100.000000)* 0.000017) + \
+       (abs(eta) >= 0.3000 && abs(eta) < 0.4000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.019873 + (energy-1000.000000)* 0.000019) + \
+       (abs(eta) >= 0.3000 && abs(eta) < 0.4000) * (energy >= 10000.0000) * (0.195142*energy/10000.000000) + \
+       (abs(eta) >= 0.4000 && abs(eta) < 0.5000) * (energy >= 0.0000 && energy < 1.0000) * (0.00354020) + \
+       (abs(eta) >= 0.4000 && abs(eta) < 0.5000) * (energy >= 1.0000 && energy < 2.0000) * (0.003540 + (energy-1.000000)* -0.000201) + \
+       (abs(eta) >= 0.4000 && abs(eta) < 0.5000) * (energy >= 2.0000 && energy < 5.0000) * (0.003340 + (energy-2.000000)* 0.000009) + \
+       (abs(eta) >= 0.4000 && abs(eta) < 0.5000) * (energy >= 5.0000 && energy < 10.0000) * (0.003366 + (energy-5.000000)* 0.000011) + \
+       (abs(eta) >= 0.4000 && abs(eta) < 0.5000) * (energy >= 10.0000 && energy < 100.0000) * (0.003422 + (energy-10.000000)* 0.000009) + \
+       (abs(eta) >= 0.4000 && abs(eta) < 0.5000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004265 + (energy-100.000000)* 0.000017) + \
+       (abs(eta) >= 0.4000 && abs(eta) < 0.5000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.019240 + (energy-1000.000000)* 0.000019) + \
+       (abs(eta) >= 0.4000 && abs(eta) < 0.5000) * (energy >= 10000.0000) * (0.188429*energy/10000.000000) + \
+       (abs(eta) >= 0.5000 && abs(eta) < 0.6000) * (energy >= 0.0000 && energy < 1.0000) * (0.00362672) + \
+       (abs(eta) >= 0.5000 && abs(eta) < 0.6000) * (energy >= 1.0000 && energy < 2.0000) * (0.003627 + (energy-1.000000)* -0.000223) + \
+       (abs(eta) >= 0.5000 && abs(eta) < 0.6000) * (energy >= 2.0000 && energy < 5.0000) * (0.003403 + (energy-2.000000)* 0.000008) + \
+       (abs(eta) >= 0.5000 && abs(eta) < 0.6000) * (energy >= 5.0000 && energy < 10.0000) * (0.003428 + (energy-5.000000)* 0.000010) + \
+       (abs(eta) >= 0.5000 && abs(eta) < 0.6000) * (energy >= 10.0000 && energy < 100.0000) * (0.003479 + (energy-10.000000)* 0.000009) + \
+       (abs(eta) >= 0.5000 && abs(eta) < 0.6000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004256 + (energy-100.000000)* 0.000016) + \
+       (abs(eta) >= 0.5000 && abs(eta) < 0.6000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.018471 + (energy-1000.000000)* 0.000018) + \
+       (abs(eta) >= 0.5000 && abs(eta) < 0.6000) * (energy >= 10000.0000) * (0.180531*energy/10000.000000) + \
+       (abs(eta) >= 0.6000 && abs(eta) < 0.7000) * (energy >= 0.0000 && energy < 1.0000) * (0.00386864) + \
+       (abs(eta) >= 0.6000 && abs(eta) < 0.7000) * (energy >= 1.0000 && energy < 2.0000) * (0.003869 + (energy-1.000000)* -0.000354) + \
+       (abs(eta) >= 0.6000 && abs(eta) < 0.7000) * (energy >= 2.0000 && energy < 5.0000) * (0.003515 + (energy-2.000000)* 0.000007) + \
+       (abs(eta) >= 0.6000 && abs(eta) < 0.7000) * (energy >= 5.0000 && energy < 10.0000) * (0.003536 + (energy-5.000000)* 0.000009) + \
+       (abs(eta) >= 0.6000 && abs(eta) < 0.7000) * (energy >= 10.0000 && energy < 100.0000) * (0.003583 + (energy-10.000000)* 0.000009) + \
+       (abs(eta) >= 0.6000 && abs(eta) < 0.7000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004349 + (energy-100.000000)* 0.000015) + \
+       (abs(eta) >= 0.6000 && abs(eta) < 0.7000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.017442 + (energy-1000.000000)* 0.000017) + \
+       (abs(eta) >= 0.6000 && abs(eta) < 0.7000) * (energy >= 10000.0000) * (0.169559*energy/10000.000000) + \
+       (abs(eta) >= 0.7000 && abs(eta) < 0.8000) * (energy >= 0.0000 && energy < 1.0000) * (0.00418203) + \
+       (abs(eta) >= 0.7000 && abs(eta) < 0.8000) * (energy >= 1.0000 && energy < 2.0000) * (0.004182 + (energy-1.000000)* -0.000556) + \
+       (abs(eta) >= 0.7000 && abs(eta) < 0.8000) * (energy >= 2.0000 && energy < 5.0000) * (0.003626 + (energy-2.000000)* 0.000007) + \
+       (abs(eta) >= 0.7000 && abs(eta) < 0.8000) * (energy >= 5.0000 && energy < 10.0000) * (0.003645 + (energy-5.000000)* 0.000008) + \
+       (abs(eta) >= 0.7000 && abs(eta) < 0.8000) * (energy >= 10.0000 && energy < 100.0000) * (0.003687 + (energy-10.000000)* 0.000008) + \
+       (abs(eta) >= 0.7000 && abs(eta) < 0.8000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004399 + (energy-100.000000)* 0.000013) + \
+       (abs(eta) >= 0.7000 && abs(eta) < 0.8000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.016509 + (energy-1000.000000)* 0.000016) + \
+       (abs(eta) >= 0.7000 && abs(eta) < 0.8000) * (energy >= 10000.0000) * (0.159676*energy/10000.000000) + \
+       (abs(eta) >= 0.8000 && abs(eta) < 0.9000) * (energy >= 0.0000 && energy < 1.0000) * (0.00436103) + \
+       (abs(eta) >= 0.8000 && abs(eta) < 0.9000) * (energy >= 1.0000 && energy < 2.0000) * (0.004361 + (energy-1.000000)* -0.000597) + \
+       (abs(eta) >= 0.8000 && abs(eta) < 0.9000) * (energy >= 2.0000 && energy < 5.0000) * (0.003764 + (energy-2.000000)* 0.000006) + \
+       (abs(eta) >= 0.8000 && abs(eta) < 0.9000) * (energy >= 5.0000 && energy < 10.0000) * (0.003781 + (energy-5.000000)* 0.000008) + \
+       (abs(eta) >= 0.8000 && abs(eta) < 0.9000) * (energy >= 10.0000 && energy < 100.0000) * (0.003821 + (energy-10.000000)* 0.000007) + \
+       (abs(eta) >= 0.8000 && abs(eta) < 0.9000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004495 + (energy-100.000000)* 0.000012) + \
+       (abs(eta) >= 0.8000 && abs(eta) < 0.9000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.015532 + (energy-1000.000000)* 0.000015) + \
+       (abs(eta) >= 0.8000 && abs(eta) < 0.9000) * (energy >= 10000.0000) * (0.149090*energy/10000.000000) + \
+       (abs(eta) >= 0.9000 && abs(eta) < 1.0000) * (energy >= 0.0000 && energy < 1.0000) * (0.00488279) + \
+       (abs(eta) >= 0.9000 && abs(eta) < 1.0000) * (energy >= 1.0000 && energy < 2.0000) * (0.004883 + (energy-1.000000)* -0.000969) + \
+       (abs(eta) >= 0.9000 && abs(eta) < 1.0000) * (energy >= 2.0000 && energy < 5.0000) * (0.003914 + (energy-2.000000)* 0.000006) + \
+       (abs(eta) >= 0.9000 && abs(eta) < 1.0000) * (energy >= 5.0000 && energy < 10.0000) * (0.003930 + (energy-5.000000)* 0.000007) + \
+       (abs(eta) >= 0.9000 && abs(eta) < 1.0000) * (energy >= 10.0000 && energy < 100.0000) * (0.003967 + (energy-10.000000)* 0.000007) + \
+       (abs(eta) >= 0.9000 && abs(eta) < 1.0000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004593 + (energy-100.000000)* 0.000011) + \
+       (abs(eta) >= 0.9000 && abs(eta) < 1.0000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.014592 + (energy-1000.000000)* 0.000014) + \
+       (abs(eta) >= 0.9000 && abs(eta) < 1.0000) * (energy >= 10000.0000) * (0.138764*energy/10000.000000) + \
+       (abs(eta) >= 1.0000 && abs(eta) < 1.1000) * (energy >= 0.0000 && energy < 1.0000) * (0.00513716) + \
+       (abs(eta) >= 1.0000 && abs(eta) < 1.1000) * (energy >= 1.0000 && energy < 2.0000) * (0.005137 + (energy-1.000000)* -0.001026) + \
+       (abs(eta) >= 1.0000 && abs(eta) < 1.1000) * (energy >= 2.0000 && energy < 5.0000) * (0.004111 + (energy-2.000000)* 0.000005) + \
+       (abs(eta) >= 1.0000 && abs(eta) < 1.1000) * (energy >= 5.0000 && energy < 10.0000) * (0.004125 + (energy-5.000000)* 0.000007) + \
+       (abs(eta) >= 1.0000 && abs(eta) < 1.1000) * (energy >= 10.0000 && energy < 100.0000) * (0.004159 + (energy-10.000000)* 0.000007) + \
+       (abs(eta) >= 1.0000 && abs(eta) < 1.1000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004752 + (energy-100.000000)* 0.000010) + \
+       (abs(eta) >= 1.0000 && abs(eta) < 1.1000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.013718 + (energy-1000.000000)* 0.000013) + \
+       (abs(eta) >= 1.0000 && abs(eta) < 1.1000) * (energy >= 10000.0000) * (0.128750*energy/10000.000000) + \
+       (abs(eta) >= 1.1000 && abs(eta) < 1.2000) * (energy >= 0.0000 && energy < 1.0000) * (0.00572019) + \
+       (abs(eta) >= 1.1000 && abs(eta) < 1.2000) * (energy >= 1.0000 && energy < 2.0000) * (0.005720 + (energy-1.000000)* -0.001362) + \
+       (abs(eta) >= 1.1000 && abs(eta) < 1.2000) * (energy >= 2.0000 && energy < 5.0000) * (0.004359 + (energy-2.000000)* 0.000005) + \
+       (abs(eta) >= 1.1000 && abs(eta) < 1.2000) * (energy >= 5.0000 && energy < 10.0000) * (0.004372 + (energy-5.000000)* 0.000006) + \
+       (abs(eta) >= 1.1000 && abs(eta) < 1.2000) * (energy >= 10.0000 && energy < 100.0000) * (0.004405 + (energy-10.000000)* 0.000007) + \
+       (abs(eta) >= 1.1000 && abs(eta) < 1.2000) * (energy >= 100.0000 && energy < 1000.0000) * (0.005024 + (energy-100.000000)* 0.000010) + \
+       (abs(eta) >= 1.1000 && abs(eta) < 1.2000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.013902 + (energy-1000.000000)* 0.000013) + \
+       (abs(eta) >= 1.1000 && abs(eta) < 1.2000) * (energy >= 10000.0000) * (0.129437*energy/10000.000000) + \
+       (abs(eta) >= 1.2000 && abs(eta) < 1.3000) * (energy >= 0.0000 && energy < 1.0000) * (0.00613558) + \
+       (abs(eta) >= 1.2000 && abs(eta) < 1.3000) * (energy >= 1.0000 && energy < 2.0000) * (0.006136 + (energy-1.000000)* -0.001331) + \
+       (abs(eta) >= 1.2000 && abs(eta) < 1.3000) * (energy >= 2.0000 && energy < 5.0000) * (0.004805 + (energy-2.000000)* 0.000005) + \
+       (abs(eta) >= 1.2000 && abs(eta) < 1.3000) * (energy >= 5.0000 && energy < 10.0000) * (0.004818 + (energy-5.000000)* 0.000007) + \
+       (abs(eta) >= 1.2000 && abs(eta) < 1.3000) * (energy >= 10.0000 && energy < 100.0000) * (0.004851 + (energy-10.000000)* 0.000007) + \
+       (abs(eta) >= 1.2000 && abs(eta) < 1.3000) * (energy >= 100.0000 && energy < 1000.0000) * (0.005512 + (energy-100.000000)* 0.000012) + \
+       (abs(eta) >= 1.2000 && abs(eta) < 1.3000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.016144 + (energy-1000.000000)* 0.000015) + \
+       (abs(eta) >= 1.2000 && abs(eta) < 1.3000) * (energy >= 10000.0000) * (0.151739*energy/10000.000000) + \
+       (abs(eta) >= 1.3000 && abs(eta) < 1.4000) * (energy >= 0.0000 && energy < 1.0000) * (0.00655464) + \
+       (abs(eta) >= 1.3000 && abs(eta) < 1.4000) * (energy >= 1.0000 && energy < 2.0000) * (0.006555 + (energy-1.000000)* -0.001843) + \
+       (abs(eta) >= 1.3000 && abs(eta) < 1.4000) * (energy >= 2.0000 && energy < 5.0000) * (0.004711 + (energy-2.000000)* 0.000004) + \
+       (abs(eta) >= 1.3000 && abs(eta) < 1.4000) * (energy >= 5.0000 && energy < 10.0000) * (0.004724 + (energy-5.000000)* 0.000005) + \
+       (abs(eta) >= 1.3000 && abs(eta) < 1.4000) * (energy >= 10.0000 && energy < 100.0000) * (0.004748 + (energy-10.000000)* 0.000006) + \
+       (abs(eta) >= 1.3000 && abs(eta) < 1.4000) * (energy >= 100.0000 && energy < 1000.0000) * (0.005326 + (energy-100.000000)* 0.000009) + \
+       (abs(eta) >= 1.3000 && abs(eta) < 1.4000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.013686 + (energy-1000.000000)* 0.000012) + \
+       (abs(eta) >= 1.3000 && abs(eta) < 1.4000) * (energy >= 10000.0000) * (0.125361*energy/10000.000000) + \
+       (abs(eta) >= 1.4000 && abs(eta) < 1.5000) * (energy >= 0.0000 && energy < 1.0000) * (0.00714442) + \
+       (abs(eta) >= 1.4000 && abs(eta) < 1.5000) * (energy >= 1.0000 && energy < 2.0000) * (0.007144 + (energy-1.000000)* -0.002674) + \
+       (abs(eta) >= 1.4000 && abs(eta) < 1.5000) * (energy >= 2.0000 && energy < 5.0000) * (0.004470 + (energy-2.000000)* -0.000070) + \
+       (abs(eta) >= 1.4000 && abs(eta) < 1.5000) * (energy >= 5.0000 && energy < 10.0000) * (0.004259 + (energy-5.000000)* 0.000006) + \
+       (abs(eta) >= 1.4000 && abs(eta) < 1.5000) * (energy >= 10.0000 && energy < 100.0000) * (0.004287 + (energy-10.000000)* 0.000009) + \
+       (abs(eta) >= 1.4000 && abs(eta) < 1.5000) * (energy >= 100.0000 && energy < 1000.0000) * (0.005101 + (energy-100.000000)* 0.000008) + \
+       (abs(eta) >= 1.4000 && abs(eta) < 1.5000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.012303 + (energy-1000.000000)* 0.000011) + \
+       (abs(eta) >= 1.4000 && abs(eta) < 1.5000) * (energy >= 10000.0000) * (0.110091*energy/10000.000000) + \
+       (abs(eta) >= 1.5000 && abs(eta) < 1.6000) * (energy >= 0.0000 && energy < 1.0000) * (0.00680449) + \
+       (abs(eta) >= 1.5000 && abs(eta) < 1.6000) * (energy >= 1.0000 && energy < 2.0000) * (0.006804 + (energy-1.000000)* -0.002108) + \
+       (abs(eta) >= 1.5000 && abs(eta) < 1.6000) * (energy >= 2.0000 && energy < 5.0000) * (0.004696 + (energy-2.000000)* -0.000116) + \
+       (abs(eta) >= 1.5000 && abs(eta) < 1.6000) * (energy >= 5.0000 && energy < 10.0000) * (0.004348 + (energy-5.000000)* 0.000009) + \
+       (abs(eta) >= 1.5000 && abs(eta) < 1.6000) * (energy >= 10.0000 && energy < 100.0000) * (0.004391 + (energy-10.000000)* 0.000009) + \
+       (abs(eta) >= 1.5000 && abs(eta) < 1.6000) * (energy >= 100.0000 && energy < 1000.0000) * (0.005232 + (energy-100.000000)* 0.000007) + \
+       (abs(eta) >= 1.5000 && abs(eta) < 1.6000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.011392 + (energy-1000.000000)* 0.000010) + \
+       (abs(eta) >= 1.5000 && abs(eta) < 1.6000) * (energy >= 10000.0000) * (0.097988*energy/10000.000000) + \
+       (abs(eta) >= 1.6000 && abs(eta) < 1.7000) * (energy >= 0.0000 && energy < 1.0000) * (0.00763793) + \
+       (abs(eta) >= 1.6000 && abs(eta) < 1.7000) * (energy >= 1.0000 && energy < 2.0000) * (0.007638 + (energy-1.000000)* -0.003061) + \
+       (abs(eta) >= 1.6000 && abs(eta) < 1.7000) * (energy >= 2.0000 && energy < 5.0000) * (0.004577 + (energy-2.000000)* -0.000168) + \
+       (abs(eta) >= 1.6000 && abs(eta) < 1.7000) * (energy >= 5.0000 && energy < 10.0000) * (0.004074 + (energy-5.000000)* 0.000009) + \
+       (abs(eta) >= 1.6000 && abs(eta) < 1.7000) * (energy >= 10.0000 && energy < 100.0000) * (0.004121 + (energy-10.000000)* 0.000009) + \
+       (abs(eta) >= 1.6000 && abs(eta) < 1.7000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004910 + (energy-100.000000)* 0.000006) + \
+       (abs(eta) >= 1.6000 && abs(eta) < 1.7000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.010635 + (energy-1000.000000)* 0.000009) + \
+       (abs(eta) >= 1.6000 && abs(eta) < 1.7000) * (energy >= 10000.0000) * (0.090704*energy/10000.000000) + \
+       (abs(eta) >= 1.7000 && abs(eta) < 1.8000) * (energy >= 0.0000 && energy < 1.0000) * (0.00913948) + \
+       (abs(eta) >= 1.7000 && abs(eta) < 1.8000) * (energy >= 1.0000 && energy < 2.0000) * (0.009139 + (energy-1.000000)* -0.004405) + \
+       (abs(eta) >= 1.7000 && abs(eta) < 1.8000) * (energy >= 2.0000 && energy < 5.0000) * (0.004735 + (energy-2.000000)* -0.000231) + \
+       (abs(eta) >= 1.7000 && abs(eta) < 1.8000) * (energy >= 5.0000 && energy < 10.0000) * (0.004043 + (energy-5.000000)* 0.000005) + \
+       (abs(eta) >= 1.7000 && abs(eta) < 1.8000) * (energy >= 10.0000 && energy < 100.0000) * (0.004066 + (energy-10.000000)* 0.000007) + \
+       (abs(eta) >= 1.7000 && abs(eta) < 1.8000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004739 + (energy-100.000000)* 0.000006) + \
+       (abs(eta) >= 1.7000 && abs(eta) < 1.8000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.009891 + (energy-1000.000000)* 0.000008) + \
+       (abs(eta) >= 1.7000 && abs(eta) < 1.8000) * (energy >= 10000.0000) * (0.083216*energy/10000.000000) + \
+       (abs(eta) >= 1.8000 && abs(eta) < 1.9000) * (energy >= 0.0000 && energy < 1.0000) * (0.00956747) + \
+       (abs(eta) >= 1.8000 && abs(eta) < 1.9000) * (energy >= 1.0000 && energy < 2.0000) * (0.009567 + (energy-1.000000)* -0.004497) + \
+       (abs(eta) >= 1.8000 && abs(eta) < 1.9000) * (energy >= 2.0000 && energy < 5.0000) * (0.005070 + (energy-2.000000)* -0.000331) + \
+       (abs(eta) >= 1.8000 && abs(eta) < 1.9000) * (energy >= 5.0000 && energy < 10.0000) * (0.004078 + (energy-5.000000)* 0.000004) + \
+       (abs(eta) >= 1.8000 && abs(eta) < 1.9000) * (energy >= 10.0000 && energy < 100.0000) * (0.004100 + (energy-10.000000)* 0.000006) + \
+       (abs(eta) >= 1.8000 && abs(eta) < 1.9000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004682 + (energy-100.000000)* 0.000005) + \
+       (abs(eta) >= 1.8000 && abs(eta) < 1.9000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.009157 + (energy-1000.000000)* 0.000007) + \
+       (abs(eta) >= 1.8000 && abs(eta) < 1.9000) * (energy >= 10000.0000) * (0.074702*energy/10000.000000) + \
+       (abs(eta) >= 1.9000 && abs(eta) < 2.0000) * (energy >= 0.0000 && energy < 1.0000) * (0.00964334) + \
+       (abs(eta) >= 1.9000 && abs(eta) < 2.0000) * (energy >= 1.0000 && energy < 2.0000) * (0.009643 + (energy-1.000000)* -0.003950) + \
+       (abs(eta) >= 1.9000 && abs(eta) < 2.0000) * (energy >= 2.0000 && energy < 5.0000) * (0.005694 + (energy-2.000000)* -0.000479) + \
+       (abs(eta) >= 1.9000 && abs(eta) < 2.0000) * (energy >= 5.0000 && energy < 10.0000) * (0.004256 + (energy-5.000000)* 0.000005) + \
+       (abs(eta) >= 1.9000 && abs(eta) < 2.0000) * (energy >= 10.0000 && energy < 100.0000) * (0.004281 + (energy-10.000000)* 0.000006) + \
+       (abs(eta) >= 1.9000 && abs(eta) < 2.0000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004862 + (energy-100.000000)* 0.000004) + \
+       (abs(eta) >= 1.9000 && abs(eta) < 2.0000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.008501 + (energy-1000.000000)* 0.000006) + \
+       (abs(eta) >= 1.9000 && abs(eta) < 2.0000) * (energy >= 10000.0000) * (0.062525*energy/10000.000000) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 0.0000 && energy < 1.0000) * (0.01045039) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 1.0000 && energy < 2.0000) * (0.010450 + (energy-1.000000)* -0.005379) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 2.0000 && energy < 5.0000) * (0.005072 + (energy-2.000000)* -0.000321) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 5.0000 && energy < 10.0000) * (0.004109 + (energy-5.000000)* 0.000006) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 10.0000 && energy < 100.0000) * (0.004137 + (energy-10.000000)* 0.000006) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004666 + (energy-100.000000)* 0.000005) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.008951 + (energy-1000.000000)* 0.000007) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 10000.0000) * (0.073400*energy/10000.000000) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 0.0000 && energy < 1.0000) * (0.01046694) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 1.0000 && energy < 2.0000) * (0.010467 + (energy-1.000000)* -0.005023) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 2.0000 && energy < 5.0000) * (0.005444 + (energy-2.000000)* -0.000330) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 5.0000 && energy < 10.0000) * (0.004455 + (energy-5.000000)* 0.000005) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 10.0000 && energy < 100.0000) * (0.004479 + (energy-10.000000)* 0.000004) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 100.0000 && energy < 1000.0000) * (0.004883 + (energy-100.000000)* 0.000005) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.009382 + (energy-1000.000000)* 0.000008) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 10000.0000) * (0.078852*energy/10000.000000) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 0.0000 && energy < 1.0000) * (0.01090933) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 1.0000 && energy < 2.0000) * (0.010909 + (energy-1.000000)* -0.005299) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 2.0000 && energy < 5.0000) * (0.005610 + (energy-2.000000)* -0.000302) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 5.0000 && energy < 10.0000) * (0.004704 + (energy-5.000000)* 0.000005) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 10.0000 && energy < 100.0000) * (0.004730 + (energy-10.000000)* 0.000005) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 100.0000 && energy < 1000.0000) * (0.005146 + (energy-100.000000)* 0.000006) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.010323 + (energy-1000.000000)* 0.000009) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 10000.0000) * (0.088469*energy/10000.000000) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 0.0000 && energy < 1.0000) * (0.01271833) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 1.0000 && energy < 2.0000) * (0.012718 + (energy-1.000000)* -0.005764) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 2.0000 && energy < 5.0000) * (0.006954 + (energy-2.000000)* -0.000492) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 5.0000 && energy < 10.0000) * (0.005479 + (energy-5.000000)* 0.000003) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 10.0000 && energy < 100.0000) * (0.005495 + (energy-10.000000)* 0.000003) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 100.0000 && energy < 1000.0000) * (0.005774 + (energy-100.000000)* 0.000006) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.011265 + (energy-1000.000000)* 0.000009) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 10000.0000) * (0.096592*energy/10000.000000) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 0.0000 && energy < 1.0000) * (0.01515272) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 1.0000 && energy < 2.0000) * (0.015153 + (energy-1.000000)* -0.007272) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 2.0000 && energy < 5.0000) * (0.007881 + (energy-2.000000)* -0.000660) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 5.0000 && energy < 10.0000) * (0.005900 + (energy-5.000000)* 0.000003) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 10.0000 && energy < 100.0000) * (0.005914 + (energy-10.000000)* 0.000003) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 100.0000 && energy < 1000.0000) * (0.006174 + (energy-100.000000)* 0.000007) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 1000.0000 && energy < 10000.0000) * (0.012486 + (energy-1000.000000)* 0.000011) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 10000.0000) * (0.108659*energy/10000.000000)
+    }
+}
+
+###############################
+# Momentum resolution for muons
+###############################
+
+module MomentumSmearing MuonMomentumSmearing {
+    set InputArray MuonTrackingEfficiency/muons
+    set OutputArray muons
+
+    # Resolution given in dpT/pT.
+
+    set ResolutionFormula {
+
+    ( abs(eta) < 1.35 ) *
+
+    (sqrt(0.0000364164 + (
+			  3*9.06262e-8 *pt^2* cosh(
+         eta)^2 *(2.82074e-7/sin(2*atan(exp(-abs(eta))))^2 + (
+          504.525 *(1/400000000 + (0.117945* 1/cosh(eta)^2)/(
+             pt^2 *sin(2*atan(exp(-abs(eta))))^2)))/
+          sin(2*atan(exp(-abs(eta))))^2) *sin(2*atan(exp(-abs(eta))))^2)/(
+       0.00516429/sin(2*atan(exp(-abs(eta))))^2 + (
+        96868.8 *(1/400000000 + 5*(0.117945 * 1/cosh(eta)^2)/(
+           pt^2 *sin(2*atan(exp(-abs(eta))))^2)))/
+        sin(2*atan(exp(-abs(eta))))^2))
+
+    ) +
+
+    ( abs(eta) > 1.35 && abs(eta) < 2.00) *
+
+    ( 1.53846*(
+
+     (
+       (energy >= 0.0000 && energy < 1.0000) * (0.00953577) +
+    (energy >= 1.0000 && energy < 2.0000) * (0.009536 + (energy-1.000000)* -0.003793) +
+    (energy >= 2.0000 && energy < 5.0000) * (0.005742 + (energy-2.000000)* -0.000489) +
+    (energy >= 5.0000 && energy < 10.0000) * (0.004277 + (energy-5.000000)* 0.000005) +
+    (energy >= 10.0000 && energy < 20.0000) * (0.004302 + (energy-10.000000)* 0.000007) +
+    (energy >= 20.0000 && energy < 50.0000) * (0.004368 + (energy-20.000000)* 0.000007) +
+    (energy >= 50.0000 && energy < 100.0000) * (0.004581 + (energy-50.000000)* 0.000006) +
+    (energy >= 100.0000 && energy < 200.0000) * (0.004875 + (energy-100.000000)* 0.000005) +
+    (energy >= 200.0000 && energy < 500.0000) * (0.005344 + (energy-200.000000)* 0.000004) +
+    (energy >= 500.0000 && energy < 1000.0000) * (0.006395 + (energy-500.000000)* 0.000004) +
+    (energy >= 1000.0000 && energy < 2000.0000) * (0.008441 + (energy-1000.000000)* 0.000005) +
+    (energy >= 2000.0000 && energy < 5000.0000) * (0.013700 + (energy-2000.000000)* 0.000006) +
+    (energy >= 5000.0000 && energy < 10000.0000) * (0.031615 + (energy-5000.000000)* 0.000006) +
+    (energy >= 10000.0000) * (0.062437*energy/10000.000000)
+     )
+
+
+     - sqrt(0.0000364164 + (9.06262e-8 *(1.19507e-6 + 2137.54 *(1/400000000 + 0.155982/pt^2)) *pt^2)/(0.0218797 + 410407. *(1/400000000 + 0.155982/pt^2))))*abs(eta) +
+
+    3.07692*sqrt(0.0000364164 + (9.06262e-8 *(1.19507e-6 + 2137.54 *(1/400000000 + 0.155982/pt^2)) *pt^2)/(0.0218797 + 410407. *(1/400000000 + 0.155982/pt^2)))
+
+     - 2.07692*
+     (
+
+      (energy >= 0.0000 && energy < 1.0000) * (0.00953577) +
+    (energy >= 1.0000 && energy < 2.0000) * (0.009536 + (energy-1.000000)* -0.003793) +
+    (energy >= 2.0000 && energy < 5.0000) * (0.005742 + (energy-2.000000)* -0.000489) +
+    (energy >= 5.0000 && energy < 10.0000) * (0.004277 + (energy-5.000000)* 0.000005) +
+    (energy >= 10.0000 && energy < 20.0000) * (0.004302 + (energy-10.000000)* 0.000007) +
+    (energy >= 20.0000 && energy < 50.0000) * (0.004368 + (energy-20.000000)* 0.000007) +
+    (energy >= 50.0000 && energy < 100.0000) * (0.004581 + (energy-50.000000)* 0.000006) +
+    (energy >= 100.0000 && energy < 200.0000) * (0.004875 + (energy-100.000000)* 0.000005) +
+    (energy >= 200.0000 && energy < 500.0000) * (0.005344 + (energy-200.000000)* 0.000004) +
+    (energy >= 500.0000 && energy < 1000.0000) * (0.006395 + (energy-500.000000)* 0.000004) +
+    (energy >= 1000.0000 && energy < 2000.0000) * (0.008441 + (energy-1000.000000)* 0.000005) +
+    (energy >= 2000.0000 && energy < 5000.0000) * (0.013700 + (energy-2000.000000)* 0.000006) +
+    (energy >= 5000.0000 && energy < 10000.0000) * (0.031615 + (energy-5000.000000)* 0.000006) +
+    (energy >= 10000.0000) * (0.062437*energy/10000.000000)
+
+     )
+
+
+    ) +
+
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 0.0000 && energy < 1.0000) * (0.01062416) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 1.0000 && energy < 2.0000) * (0.010624 + (energy-1.000000)* -0.005532) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 2.0000 && energy < 5.0000) * (0.005092 + (energy-2.000000)* -0.000326) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 5.0000 && energy < 10.0000) * (0.004115 + (energy-5.000000)* 0.000006) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 10.0000 && energy < 20.0000) * (0.004143 + (energy-10.000000)* 0.000007) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 20.0000 && energy < 50.0000) * (0.004209 + (energy-20.000000)* 0.000007) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 50.0000 && energy < 100.0000) * (0.004413 + (energy-50.000000)* 0.000005) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 100.0000 && energy < 200.0000) * (0.004681 + (energy-100.000000)* 0.000004) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 200.0000 && energy < 500.0000) * (0.005076 + (energy-200.000000)* 0.000004) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 500.0000 && energy < 1000.0000) * (0.006270 + (energy-500.000000)* 0.000005) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 1000.0000 && energy < 2000.0000) * (0.008960 + (energy-1000.000000)* 0.000007) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 2000.0000 && energy < 5000.0000) * (0.015510 + (energy-2000.000000)* 0.000007) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 5000.0000 && energy < 10000.0000) * (0.036867 + (energy-5000.000000)* 0.000007) + \
+       (abs(eta) >= 2.0000 && abs(eta) < 2.1000) * (energy >= 10000.0000) * (0.073168*energy/10000.000000) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 0.0000 && energy < 1.0000) * (0.01007098) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 1.0000 && energy < 2.0000) * (0.010071 + (energy-1.000000)* -0.004627) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 2.0000 && energy < 5.0000) * (0.005444 + (energy-2.000000)* -0.000322) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 5.0000 && energy < 10.0000) * (0.004478 + (energy-5.000000)* 0.000005) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 10.0000 && energy < 20.0000) * (0.004501 + (energy-10.000000)* 0.000006) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 20.0000 && energy < 50.0000) * (0.004558 + (energy-20.000000)* 0.000005) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 50.0000 && energy < 100.0000) * (0.004701 + (energy-50.000000)* 0.000004) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 100.0000 && energy < 200.0000) * (0.004888 + (energy-100.000000)* 0.000003) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 200.0000 && energy < 500.0000) * (0.005213 + (energy-200.000000)* 0.000004) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 500.0000 && energy < 1000.0000) * (0.006429 + (energy-500.000000)* 0.000006) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 1000.0000 && energy < 2000.0000) * (0.009343 + (energy-1000.000000)* 0.000007) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 2000.0000 && energy < 5000.0000) * (0.016410 + (energy-2000.000000)* 0.000008) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 5000.0000 && energy < 10000.0000) * (0.039265 + (energy-5000.000000)* 0.000008) + \
+       (abs(eta) >= 2.1000 && abs(eta) < 2.2000) * (energy >= 10000.0000) * (0.078014*energy/10000.000000) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 0.0000 && energy < 1.0000) * (0.01095892) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 1.0000 && energy < 2.0000) * (0.010959 + (energy-1.000000)* -0.005458) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 2.0000 && energy < 5.0000) * (0.005501 + (energy-2.000000)* -0.000281) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 5.0000 && energy < 10.0000) * (0.004660 + (energy-5.000000)* 0.000005) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 10.0000 && energy < 20.0000) * (0.004686 + (energy-10.000000)* 0.000007) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 20.0000 && energy < 50.0000) * (0.004757 + (energy-20.000000)* 0.000006) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 50.0000 && energy < 100.0000) * (0.004937 + (energy-50.000000)* 0.000004) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 100.0000 && energy < 200.0000) * (0.005143 + (energy-100.000000)* 0.000004) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 200.0000 && energy < 500.0000) * (0.005505 + (energy-200.000000)* 0.000005) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 500.0000 && energy < 1000.0000) * (0.006975 + (energy-500.000000)* 0.000007) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 1000.0000 && energy < 2000.0000) * (0.010462 + (energy-1000.000000)* 0.000008) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 2000.0000 && energy < 5000.0000) * (0.018731 + (energy-2000.000000)* 0.000009) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 5000.0000 && energy < 10000.0000) * (0.045159 + (energy-5000.000000)* 0.000009) + \
+       (abs(eta) >= 2.2000 && abs(eta) < 2.3000) * (energy >= 10000.0000) * (0.089830*energy/10000.000000) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 0.0000 && energy < 1.0000) * (0.01279214) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 1.0000 && energy < 2.0000) * (0.012792 + (energy-1.000000)* -0.005763) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 2.0000 && energy < 5.0000) * (0.007029 + (energy-2.000000)* -0.000513) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 5.0000 && energy < 10.0000) * (0.005489 + (energy-5.000000)* 0.000003) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 10.0000 && energy < 20.0000) * (0.005503 + (energy-10.000000)* 0.000003) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 20.0000 && energy < 50.0000) * (0.005537 + (energy-20.000000)* 0.000003) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 50.0000 && energy < 100.0000) * (0.005636 + (energy-50.000000)* 0.000003) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 100.0000 && energy < 200.0000) * (0.005773 + (energy-100.000000)* 0.000003) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 200.0000 && energy < 500.0000) * (0.006060 + (energy-200.000000)* 0.000005) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 500.0000 && energy < 1000.0000) * (0.007489 + (energy-500.000000)* 0.000007) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 1000.0000 && energy < 2000.0000) * (0.011117 + (energy-1000.000000)* 0.000009) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 2000.0000 && energy < 5000.0000) * (0.019824 + (energy-2000.000000)* 0.000009) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 5000.0000 && energy < 10000.0000) * (0.047732 + (energy-5000.000000)* 0.000009) + \
+       (abs(eta) >= 2.3000 && abs(eta) < 2.4000) * (energy >= 10000.0000) * (0.094931*energy/10000.000000) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 0.0000 && energy < 1.0000) * (0.01502671) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 1.0000 && energy < 2.0000) * (0.015027 + (energy-1.000000)* -0.007177) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 2.0000 && energy < 5.0000) * (0.007850 + (energy-2.000000)* -0.000651) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 5.0000 && energy < 10.0000) * (0.005898 + (energy-5.000000)* 0.000003) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 10.0000 && energy < 20.0000) * (0.005913 + (energy-10.000000)* 0.000003) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 20.0000 && energy < 50.0000) * (0.005947 + (energy-20.000000)* 0.000003) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 50.0000 && energy < 100.0000) * (0.006039 + (energy-50.000000)* 0.000003) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 100.0000 && energy < 200.0000) * (0.006170 + (energy-100.000000)* 0.000003) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 200.0000 && energy < 500.0000) * (0.006485 + (energy-200.000000)* 0.000006) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 500.0000 && energy < 1000.0000) * (0.008140 + (energy-500.000000)* 0.000008) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 1000.0000 && energy < 2000.0000) * (0.012304 + (energy-1000.000000)* 0.000010) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 2000.0000 && energy < 5000.0000) * (0.022168 + (energy-2000.000000)* 0.000010) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 5000.0000 && energy < 10000.0000) * (0.053585 + (energy-5000.000000)* 0.000011) + \
+       (abs(eta) >= 2.4000 && abs(eta) < 2.5000) * (energy >= 10000.0000) * (0.106635*energy/10000.000000)
+    }
+}
+
+###############################
+# Momentum resolution for muons
+###############################
+
+module MomentumSmearing ForwardMuonMomentumSmearing {
+    set InputArray ForwardMuonEfficiency/muons
+    set OutputArray muons
+
+    # Resolution given in dpT/pT assume constant 10% regardless of energy
+    set ResolutionFormula {
+              (abs(eta) >= 2.5 && abs(eta) < 8.0) * (0.10)                     
+ }
+}
+
+
+##############
+# Track merger
+##############
+
+module Merger TrackMerger {
+    # add InputArray InputArray
+    add InputArray ChargedHadronMomentumSmearing/chargedHadrons
+    add InputArray ElectronMomentumSmearing/electrons
+    add InputArray MuonMomentumSmearing/muons
+    set OutputArray tracks
+}
+
+#############
+#   ECAL
+#############
+
+module SimpleCalorimeter ECal {
+    set ParticleInputArray ParticlePropagator/stableParticles
+    set TrackInputArray TrackMerger/tracks
+
+    set TowerOutputArray ecalTowers
+    set EFlowTrackOutputArray eflowTracks
+    set EFlowTowerOutputArray eflowPhotons
+
+    set IsEcal true
+
+    set EnergyMin 0.5
+    set EnergySignificanceMin 1.0
+
+    set SmearTowerCenter true
+
+    set pi [expr {acos(-1)}]
+
+    # lists of the edges of each tower in eta and phi
+    # each list starts with the lower edge of the first tower
+    # the list ends with the higher edged of the last tower
+
+    #ECAL barrel: dphi = 0.2 degree, deta=0.003 towers up to |eta| <=1.2
+    #ECAL endcaps: dphi = 0.8 degree, deta=0.02 towers up to |eta| <=2.5
+
+    #barrel:
+    #dphi = 0.2 degree towers up to eta <=1.2
+    set PhiBins {}
+    for {set i -900} {$i <= 900} {incr i} {
+	add PhiBins [expr {$i * $pi/900.0 }]
+    }
+    # 0.003 unit (5x5 mm^2) in eta up to eta <=1.2
+    for {set i -400} {$i <=400} {incr i} {
+	set eta [expr {$i * 0.003}]
+	add EtaPhiBins $eta $PhiBins
+    }
+
+    #endcaps:
+    #dphi = 0.8 degree towers for 1.2 < eta <=2.5
+    set PhiBins {}
+    for {set i -225} {$i <= 225} {incr i} {
+	add PhiBins [expr {$i * $pi/225.}]
+    }
+    #deta=0.02 units for 1.2 < |eta| <=2.5
+    #first, from -2.5 to -1.2, there will be (1.3/0.02=)65 segments
+    for {set i 1} {$i <=66} {incr i} {
+	set eta [expr {-2.52 + $i * 0.02}]
+	add EtaPhiBins $eta $PhiBins
+    }
+    #same for 1.2 to 2.5
+    for  {set i 1} {$i <=66} {incr i} {
+	set eta [expr {1.18 + $i*0.02}]
+	add EtaPhiBins $eta $PhiBins
+    }
+
+
+    # default energy fractions {abs(PDG code)} {fraction of energy deposited in ECAL}
+
+    add EnergyFraction {0} {0.0}
+    # energy fractions for e, gamma and pi0
+    add EnergyFraction {11} {1.0}
+    add EnergyFraction {22} {1.0}
+    add EnergyFraction {111} {1.0}
+    # energy fractions for muon, neutrinos and neutralinos
+    add EnergyFraction {12} {0.0}
+    add EnergyFraction {13} {0.0}
+    add EnergyFraction {14} {0.0}
+    add EnergyFraction {16} {0.0}
+    add EnergyFraction {1000022} {0.0}
+    add EnergyFraction {1000023} {0.0}
+    add EnergyFraction {1000025} {0.0}
+    add EnergyFraction {1000035} {0.0}
+    add EnergyFraction {1000045} {0.0}
+    # energy fractions for K0short and Lambda
+    add EnergyFraction {310} {0.3}
+    add EnergyFraction {3122} {0.3}
+
+    # set ECalResolutionFormula {resolution formula as a function of eta and energy}
+    set ResolutionFormula {
+	(abs(eta) <= 0.78 )  * sqrt(energy^2*0.01^2 + energy*0.156^2)+
+	(abs(eta) > 0.78 && abs(eta) <=0.83 ) * sqrt( energy^2*0.01^2 + energy*0.175^2  ) +
+	(abs(eta) <= 2.5 && abs(eta) > 0.83) * sqrt( energy^2*0.01^2 + energy*0.151^2  )}
+}
+
+#############
+#   HCAL
+#############
+
+module SimpleCalorimeter HCal {
+    set ParticleInputArray ParticlePropagator/stableParticles
+    set TrackInputArray ECal/eflowTracks
+
+    set TowerOutputArray hcalTowers
+    set EFlowTrackOutputArray eflowTracks
+    set EFlowTowerOutputArray eflowNeutralHadrons
+
+    set IsEcal false
+
+    set EnergyMin 1.0
+    set EnergySignificanceMin 1.0
+
+    set SmearTowerCenter true
+
+    set pi [expr {acos(-1)}]
+
+    # lists of the edges of each tower in eta and phi
+    # each list starts with the lower edge of the first tower
+    # the list ends with the higher edged of the last tower
+
+
+    #HCAL barrel: dphi = 1 degree, deta= 0.02 towers up to |eta| <=0.8
+    #HCAL ring: dphi = 1 degree, deta= 0.02 towers up to |eta| <=0.9
+    #HCAL endcaps: dphi = 6 degree, deta = 0.1  up to |eta| <=2.5
+    #HCAL cell sizes always 30x30 mm^2
+
+    #barrel and ring:
+    #dphi = 1 degree up to |eta| <=0.9
+    set PhiBins {}
+    for {set i -180} {$i <=180} {incr i} {
+	add PhiBins [expr {$i * $pi/180.0}]
+    }
+    #deta= 0.02 towers up to |eta| <=0.9
+    for {set i -45} {$i <=45} {incr i} {
+	set eta [expr {$i * 0.02}]
+	add EtaPhiBins $eta $PhiBins
+    }
+
+    #endcaps:
+    # dphi = 6 degree
+    set PhiBins {}
+    for {set i -30} {$i <=30} {incr i} {
+	add PhiBins [expr {$i * $pi/30.0}]
+    }
+    # deta =0.1 for 0.9 < |eta| <=2.5
+    #for -2.5 to -0.9, 21 segments
+    for {set i 1} {$i <=17} {incr i} {
+	set eta [expr {-2.5 + $i * 0.1}]
+	add EtaPhiBins $eta $PhiBins
+    }
+    #same for 0.9 to 2.5
+    for {set i 1} {$i <=17} {incr i} {
+	set eta [expr {0.8 + $i * 0.1 }]
+	add EtaPhiBins $eta $PhiBins
+    }
+
+    # default energy fractions {abs(PDG code)} {Fecal Fhcal}
+    add EnergyFraction {0} {1.0}
+    # energy fractions for e, gamma and pi0
+    add EnergyFraction {11} {0.0}
+    add EnergyFraction {22} {0.0}
+    add EnergyFraction {111} {0.0}
+    # energy fractions for muon, neutrinos and neutralinos
+    add EnergyFraction {12} {0.0}
+    add EnergyFraction {13} {0.0}
+    add EnergyFraction {14} {0.0}
+    add EnergyFraction {16} {0.0}
+    add EnergyFraction {1000022} {0.0}
+    add EnergyFraction {1000023} {0.0}
+    add EnergyFraction {1000025} {0.0}
+    add EnergyFraction {1000035} {0.0}
+    add EnergyFraction {1000045} {0.0}
+    # energy fractions for K0short and Lambda
+    add EnergyFraction {310} {0.7}
+    add EnergyFraction {3122} {0.7}
+
+    # set HCalResolutionFormula {resolution formula as a function of eta and energy}
+    #CLICdet internal studies
+    set ResolutionFormula {
+	(abs(eta)<= 0.3) * sqrt(1.38^2  + energy*0.308^2  + energy^2*0.050^2) +
+	 (abs(eta)<= 0.78 && abs(eta) > 0.3) * sqrt(1.25^2  + energy*0.322^2  + energy^2*0.048^2) +
+	 (abs(eta)<=1.099 && abs(eta) > 0.78) * sqrt(  1.159^2 + energy*0.341^2 + energy^2*0.049^2 ) +
+	 (abs(eta)<=2.5 && abs(eta)> 1.099) * sqrt( 1.09^2 + energy*0.319^2 + energy^2*0.052^2  )
+	}
+
+}
+
+#################
+# Electron filter
+#################
+
+module PdgCodeFilter ElectronFilter {
+    set InputArray HCal/eflowTracks
+    set OutputArray electrons
+    set Invert true
+    add PdgCode {11}
+    add PdgCode {-11}
+}
+
+######################
+# ChargedHadronFilter
+######################
+
+module PdgCodeFilter ChargedHadronFilter {
+    set InputArray HCal/eflowTracks
+    set OutputArray chargedHadrons
+
+    add PdgCode {11}
+    add PdgCode {-11}
+    add PdgCode {13}
+    add PdgCode {-13}
+}
+
+
+
+###################################################
+# Tower Merger (in case not using e-flow algorithm)
+###################################################
+
+module Merger Calorimeter {
+    # add InputArray InputArray
+    add InputArray ECal/ecalTowers
+    add InputArray HCal/hcalTowers
+    add InputArray MuonMomentumSmearing/muons
+    set OutputArray towers
+}
+
+
+####################
+# Energy flow merger
+####################
+
+module Merger EFlowMerger {
+    # add InputArray InputArray
+    add InputArray HCal/eflowTracks
+    add InputArray ECal/eflowPhotons
+    add InputArray HCal/eflowNeutralHadrons
+    set OutputArray eflow
+}
+
+######################
+# EFlowFilter
+######################
+
+module PdgCodeFilter EFlowFilter {
+  set InputArray EFlowMerger/eflow
+  set OutputArray eflow
+
+  add PdgCode {11}
+  add PdgCode {-11}
+  add PdgCode {13}
+  add PdgCode {-13}
+}
+
+
+###################
+# Photon efficiency
+###################
+
+module Efficiency PhotonEfficiency {
+    set InputArray ECal/eflowPhotons
+    set OutputArray photons
+
+    # set EfficiencyFormula {efficiency formula as a function of eta and pt}
+
+    # efficiency formula for photons
+    set EfficiencyFormula {
+	(energy < 2.0 ) * (0.000) +
+	(energy >= 2.0) * (abs(eta) < 0.7)*(0.94) +
+	(energy >= 2.0) * (abs(eta) >=0.7 && abs(eta) <=2.5) * (0.9)	}
+
+}
+
+
+##################
+# Photon isolation
+##################
+
+module Isolation PhotonIsolation {
+    set CandidateInputArray PhotonEfficiency/photons
+    set IsolationInputArray EFlowMerger/eflow
+
+    set OutputArray photons
+
+    set DeltaRMax 0.1
+
+    set PTMin 0.5
+
+    set PTRatioMax 0.2
+}
+
+
+#####################
+# Electron efficiency
+#####################
+
+module Efficiency ElectronEfficiency {
+    set InputArray ElectronFilter/electrons
+    set OutputArray electrons
+
+    # set EfficiencyFormula {efficiency formula as a function of eta and pt}
+
+    set EfficiencyFormula {
+	(energy < 3.0 ) * ( 0.00 ) +
+  (abs(eta) > 2.50) * ( 0.00 ) +
+	( energy >=3 && energy < 8  ) * (abs(eta) > 1.95 && abs(eta) < 2.50)  * (0.58 ) +
+	( energy >=3 && energy < 8  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * ( 0.7 ) +
+	( energy >=3 && energy < 8  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * ( 0.6 ) +
+	( energy >=3 && energy < 8  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * ( 0.7 ) +
+	( energy >=3 && energy < 8  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * ( 0.8 ) +
+	( energy >=3 && energy < 8  ) * (abs(eta) <= 0.69)                    * (0.84 ) +
+	( energy >=8 && energy < 13  ) * (abs(eta) > 1.95 && abs(eta) < 2.50)  * (  0.6 ) +
+	( energy >=8 && energy < 13  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * ( 0.76 ) +
+	( energy >=8 && energy < 13  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * ( 0.67 ) +
+	( energy >=8 && energy < 13  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * ( 0.78 ) +
+	( energy >=8 && energy < 13  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * ( 0.86 ) +
+	( energy >=8 && energy < 13  ) * (abs(eta) <= 0.69)                    * ( 0.88 ) +
+	( energy >=13 && energy < 18  ) * (abs(eta) > 1.95 && abs(eta) < 2.50) * (  0.6 ) +
+	( energy >=13 && energy < 18  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * (  0.8 ) +
+	( energy >=13 && energy < 18  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * ( 0.68 ) +
+	( energy >=13 && energy < 18  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * ( 0.84 ) +
+	( energy >=13 && energy < 18  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * ( 0.88 ) +
+	( energy >=13 && energy < 18  ) * (abs(eta) <= 0.69)                    * (  0.9 ) +
+	( energy >=18 && energy < 23  ) * (abs(eta) > 1.95 && abs(eta) < 2.50)  * (0.64 ) +
+	( energy >=18 && energy < 23  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * (0.82 ) +
+	( energy >=18 && energy < 23  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * ( 0.7 ) +
+	( energy >=18 && energy < 23  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * (0.84 ) +
+	( energy >=18 && energy < 23  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * ( 0.9 ) +
+	( energy >=18 && energy < 23  ) * (abs(eta) <= 0.69)                    * (0.92 ) +
+	( energy >= 23 && energy < 28  ) * (abs(eta) > 1.95 && abs(eta) < 2.50) * (0.64 ) +
+	( energy >= 23 && energy < 28  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * (0.86 ) +
+	( energy >= 23 && energy < 28  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * (0.74 ) +
+	( energy >= 23 && energy < 28  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * (0.87 ) +
+	( energy >= 23 && energy < 28  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * (0.91 ) +
+	( energy >= 23 && energy < 28  ) * (abs(eta) <= 0.69)                    * (0.94 ) +
+	( energy >=28 && energy < 35  ) * (abs(eta) > 1.95 && abs(eta) < 2.50)   * (0.67 ) +
+	( energy >=28 && energy < 35  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * (0.88 ) +
+	( energy >=28 && energy < 35  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * (0.78 ) +
+	( energy >=28 && energy < 35  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * ( 0.9 ) +
+	( energy >=28 && energy < 35  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * (0.94 ) +
+	( energy >=28 && energy < 35  ) * (abs(eta) <= 0.69)                    * (0.94 ) +
+	( energy >=35 && energy < 45  ) * (abs(eta) > 1.95 && abs(eta) < 2.50)  * (0.68 ) +
+	( energy >=35 && energy < 45  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * ( 0.9 ) +
+	( energy >=35 && energy < 45  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * (0.86 ) +
+	( energy >=35 && energy < 45  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * (0.92 ) +
+	( energy >=35 && energy < 45  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * (0.94 ) +
+	( energy >=35 && energy < 45  ) * (abs(eta) <= 0.69)                    * (0.96 ) +
+	( energy >=45 && energy < 80  ) * (abs(eta) > 1.95 && abs(eta) < 2.50)  * (  0.7 ) +
+	( energy >=45 && energy < 80  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * ( 0.92 ) +
+	( energy >=45 && energy < 80  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * (  0.8 ) +
+	( energy >=45 && energy < 80  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * ( 0.94 ) +
+	( energy >=45 && energy < 80  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * ( 0.96 ) +
+	( energy >=45 && energy < 80  ) * (abs(eta) <= 0.69)                    * ( 0.97 ) +
+	( energy >=80 && energy < 200  ) * (abs(eta) > 1.95 && abs(eta) < 2.50) * (0.68 ) +
+	( energy >=80 && energy < 200  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * (0.96 ) +
+	( energy >=80 && energy < 200  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * (0.84 ) +
+	( energy >=80 && energy < 200  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * (0.94 ) +
+	( energy >=80 && energy < 200  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * (0.98 ) +
+	( energy >=80 && energy < 200  ) * (abs(eta) <= 0.69)                    * (0.98 ) +
+	( energy >=200 && energy < 400  ) * (abs(eta) > 1.95 && abs(eta) < 2.50) * ( 0.68 ) +
+	( energy >=200 && energy < 400  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * ( 0.97 ) +
+	( energy >=200 && energy < 400  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * ( 0.86 ) +
+	( energy >=200 && energy < 400  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * ( 0.96 ) +
+	( energy >=200 && energy < 400  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * ( 0.98 ) +
+	( energy >=200 && energy < 400  ) * (abs(eta) <= 0.69)                    * ( 0.98 ) +
+	( energy >=400  ) * (abs(eta) > 1.95 && abs(eta) < 2.50)  * (0.68 ) +
+	( energy >=400  ) * (abs(eta) <= 1.95 && abs(eta) > 1.22) * (0.96 ) +
+	( energy >=400  ) * (abs(eta) <= 1.22 && abs(eta) > 1.1 ) * (0.82 ) +
+	( energy >=400  ) * (abs(eta) <= 1.1 && abs(eta) > 0.91 ) * (0.96 ) +
+	( energy >=400  ) * (abs(eta) <= 0.91 && abs(eta) > 0.69) * (0.98 ) +
+	( energy >=400  ) * (abs(eta) <= 0.69)                    * (0.98 )
+    }
+}
+
+####################
+# Electron isolation
+####################
+
+module Isolation ElectronIsolation {
+    set CandidateInputArray ElectronEfficiency/electrons
+    set IsolationInputArray EFlowMerger/eflow
+
+    set OutputArray electrons
+
+    set DeltaRMax 0.1
+
+    set PTMin 0.5
+
+    set PTRatioMax 0.2
+}
+
+#################
+# Muon efficiency
+#################
+
+module Efficiency MuonEfficiency {
+    set InputArray MuonMomentumSmearing/muons
+    set OutputArray muons
+
+    # set EfficiencyFormula {efficiency as a function of eta and pt}
+
+    set EfficiencyFormula {
+	(energy < 2.5 )     * (0.00) +
+	(energy>=2.5  )     * (0.999)
+    }
+}
+
+################
+# Muon isolation
+################
+
+module Isolation MuonIsolation {
+    set CandidateInputArray MuonEfficiency/muons
+    set IsolationInputArray EFlowMerger/eflow
+
+    set OutputArray muons
+
+    set DeltaRMax 0.1
+
+    set PTMin 0.5
+
+    set PTRatioMax 0.2
+}
+
+
+
+###################
+# Missing ET merger
+###################
+
+module Merger MissingET {
+    # add InputArray InputArray
+    add InputArray EFlowMerger/eflow
+    set MomentumOutputArray momentum
+}
+
+
+##################
+# Scalar HT merger
+##################
+
+module Merger ScalarHT {
+    # add InputArray InputArray
+    add InputArray EFlowMerger/eflow
+    set EnergyOutputArray energy
+}
+######################
+# EFlowFilter (UniqueObjectFinder)
+######################
+module UniqueObjectFinder UniqueObjectFinder {
+    add InputArray PhotonIsolation/photons photons
+    add InputArray ElectronIsolation/electrons electrons
+    add InputArray MuonIsolation/muons muons
+    add InputArray EFlowMerger/eflow eflow
+}
+
+#################
+# Neutrino Filter
+#################
+
+module PdgCodeFilter NeutrinoFilter {
+
+    set InputArray Delphes/stableParticles
+    set OutputArray filteredParticles
+
+    set PTMin 0.0
+
+    add PdgCode {12}
+    add PdgCode {14}
+    add PdgCode {16}
+    add PdgCode {-12}
+    add PdgCode {-14}
+    add PdgCode {-16}
+
+}
+
+
+#####################
+# MC truth jet finder
+#####################
+
+module FastJetFinder GenJetFinder {
+    set InputArray NeutrinoFilter/filteredParticles
+
+    set OutputArray jets
+
+    # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt, 7 anti-kt with winner-take-all axis (for N-subjettiness), 8 N-jettiness, 9 Valencia
+    set JetAlgorithm 9
+    set ParameterR 0.5
+
+    set JetPTMin 20.0
+}
+
+#########################
+# Gen Missing ET merger
+########################
+
+module Merger GenMissingET {
+    # add InputArray InputArray
+    add InputArray NeutrinoFilter/filteredParticles
+    set MomentumOutputArray momentum
+}
+
+
+
+############
+# Jet finder
+############
+
+module FastJetFinder FastJetFinderKt {
+    #  set InputArray Calorimeter/towers
+    set InputArray EFlowMerger/eflow
+
+    set OutputArray KTjets
+
+    # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt, 7 anti-kt with winner-take-all axis (for N-subjettiness), 8 N-jettiness, 9 Valencia
+    set JetAlgorithm 4
+    set ParameterR 0.5
+
+    set JetPTMin 20.0
+}
+
+################
+# Jet finder VLC
+################
+
+
+source MuonCollider/MuonColliderDet_JetReco.tcl
+
+
+#########################################
+# Jet Momentum Smearing to mimick overlay
+#########################################
+
+
+source MuonCollider/MuonColliderDet_JetSmearing.tcl
+
+
+
+########################
+# Jet Flavor Association
+########################
+
+source  MuonCollider/MuonColliderDet_JetFlavorAssociation.tcl
+
+###########
+# b-tagging
+###########
+# based on CLICdp-Note-2014-002
+
+source  MuonCollider/MuonColliderDet_BTagging.tcl
+
+
+#############
+# tau-tagging
+#############
+
+source MuonCollider/MuonColliderDet_TauTagging.tcl
+
+##################
+# ROOT tree writer
+##################
+
+module TreeWriter TreeWriter {
+    # add Branch InputArray BranchName BranchClass
+    add Branch Delphes/allParticles Particle GenParticle
+
+    add Branch GenJetFinder/jets GenJet Jet
+
+    add Branch FastJetFinderKt/KTjets KTjet Jet
+
+    add Branch JetMomentumSmearing_VLCR05N2/JER_VLCjetsR05N2 VLCjetR05N2 Jet
+    add Branch JetMomentumSmearing_VLCR05N3/JER_VLCjetsR05N3 VLCjetR05N3 Jet
+    add Branch JetMomentumSmearing_VLCR05N4/JER_VLCjetsR05N4 VLCjetR05N4 Jet
+    add Branch JetMomentumSmearing_VLCR05N5/JER_VLCjetsR05N5 VLCjetR05N5 Jet
+    add Branch JetMomentumSmearing_VLCR05N6/JER_VLCjetsR05N6 VLCjetR05N6 Jet
+
+    add Branch JetMomentumSmearing_VLCR07N2/JER_VLCjetsR07N2 VLCjetR07N2 Jet
+    add Branch JetMomentumSmearing_VLCR07N3/JER_VLCjetsR07N3 VLCjetR07N3 Jet
+    add Branch JetMomentumSmearing_VLCR07N4/JER_VLCjetsR07N4 VLCjetR07N4 Jet
+    add Branch JetMomentumSmearing_VLCR07N5/JER_VLCjetsR07N5 VLCjetR07N5 Jet
+    add Branch JetMomentumSmearing_VLCR07N6/JER_VLCjetsR07N6 VLCjetR07N6 Jet
+
+    add Branch JetMomentumSmearing_VLCR10N2/JER_VLCjetsR10N2 VLCjetR10N2 Jet
+    add Branch JetMomentumSmearing_VLCR10N3/JER_VLCjetsR10N3 VLCjetR10N3 Jet
+    add Branch JetMomentumSmearing_VLCR10N4/JER_VLCjetsR10N4 VLCjetR10N4 Jet
+    add Branch JetMomentumSmearing_VLCR10N5/JER_VLCjetsR10N5 VLCjetR10N5 Jet
+    add Branch JetMomentumSmearing_VLCR10N6/JER_VLCjetsR10N6 VLCjetR10N6 Jet
+
+    add Branch JetMomentumSmearing_VLCR12N2/JER_VLCjetsR12N2 VLCjetR12N2 Jet
+    add Branch JetMomentumSmearing_VLCR12N3/JER_VLCjetsR12N3 VLCjetR12N3 Jet
+    add Branch JetMomentumSmearing_VLCR12N4/JER_VLCjetsR12N4 VLCjetR12N4 Jet
+    add Branch JetMomentumSmearing_VLCR12N5/JER_VLCjetsR12N5 VLCjetR12N5 Jet
+    add Branch JetMomentumSmearing_VLCR12N6/JER_VLCjetsR12N6 VLCjetR12N6 Jet
+
+    add Branch JetMomentumSmearing_VLCR15N2/JER_VLCjetsR15N2 VLCjetR15N2 Jet
+    add Branch JetMomentumSmearing_VLCR15N3/JER_VLCjetsR15N3 VLCjetR15N3 Jet
+    add Branch JetMomentumSmearing_VLCR15N4/JER_VLCjetsR15N4 VLCjetR15N4 Jet
+    add Branch JetMomentumSmearing_VLCR15N5/JER_VLCjetsR15N5 VLCjetR15N5 Jet
+    add Branch JetMomentumSmearing_VLCR15N6/JER_VLCjetsR15N6 VLCjetR15N6 Jet
+
+    add Branch JetMomentumSmearing_VLCR02_inclusive/JER_VLCjetsR02_inclusive VLCjetR02_inclusive Jet
+    add Branch JetMomentumSmearing_VLCR05_inclusive/JER_VLCjetsR05_inclusive VLCjetR05_inclusive Jet
+    add Branch JetMomentumSmearing_VLCR07_inclusive/JER_VLCjetsR07_inclusive VLCjetR07_inclusive Jet
+    add Branch JetMomentumSmearing_VLCR10_inclusive/JER_VLCjetsR10_inclusive VLCjetR10_inclusive Jet
+    add Branch JetMomentumSmearing_VLCR12_inclusive/JER_VLCjetsR12_inclusive VLCjetR12_inclusive Jet
+    add Branch JetMomentumSmearing_VLCR15_inclusive/JER_VLCjetsR15_inclusive VLCjetR15_inclusive Jet
+
+
+    ####
+
+    add Branch GenMissingET/momentum GenMissingET MissingET
+
+    add Branch TrackMerger/tracks Track Track
+    add Branch Calorimeter/towers Tower Tower
+
+    add Branch HCal/eflowTracks EFlowTrack Track
+    add Branch ECal/eflowPhotons EFlowPhoton Tower
+    add Branch HCal/eflowNeutralHadrons EFlowNeutralHadron Tower
+
+    add Branch UniqueObjectFinder/photons Photon Photon
+    add Branch UniqueObjectFinder/electrons Electron Electron
+    add Branch UniqueObjectFinder/muons Muon Muon
+    add Branch ForwardMuonMomentumSmearing/muons ForwardMuon Muon
+
+    add Branch MissingET/momentum MissingET MissingET
+    add Branch ScalarHT/energy ScalarHT ScalarHT
+}
