Index: cards/ILCgen/ILCgen_BTagging_50.tcl
===================================================================
--- cards/ILCgen/ILCgen_BTagging_50.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_BTagging_50.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_BTagging_70.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_BTagging_80.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_BTagging_N.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -0,0 +1,106 @@
+###################################
+# 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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_BeamCalEfficiency.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -0,0 +1,13 @@
+# 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 {efficiency formula as a function of eta and pt}
+
+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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_BeamCalF_Binning.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_BeamCalR_Binning.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_BeamCal_EnergyFractions.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -0,0 +1,22 @@
+#P.Sopicki
+  # default energy fractions {abs(PDG code)} {fraction of energy deposited in BeamCal}
+
+  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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_BeamCal_Resolution.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -0,0 +1,10 @@
+# P.Sopicki, corrected by A.F.Zarnecki
+# BeamCal resolution
+
+# set ResolutionFormula {resolution formula as a function of eta and energy}
+
+  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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_CTagging_20.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_CTagging_30.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_CTagging_55.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_CTagging_N.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -0,0 +1,106 @@
+###################################
+# 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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_ChrgHadMomentumSmearing.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -0,0 +1,22 @@
+
+# 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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_ChrgHadTrackingEff.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -0,0 +1,19 @@
+
+# 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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_ECAL_Binning.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_ECAL_EnergyFractions.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -0,0 +1,20 @@
+#P.Sopicki
+# default energy fractions {abs(PDG code)} {fraction in ECAL or LumiCal}
+  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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_ECAL_Resolution.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 {resolution formula as a function of eta and energy}
+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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_ElectronEfficiency.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -0,0 +1,11 @@
+
+  # set EfficiencyFormula {efficiency formula as a function of eta and pt}
+
+# 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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_ElectronIsolation.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_ElectronMomentumSmearing.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -0,0 +1,22 @@
+
+# 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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_ElectronTrackingEff.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -0,0 +1,19 @@
+
+# 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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_GenJetFinder.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_HCAL_Binning.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_HCAL_EnergyFractions.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -0,0 +1,20 @@
+#P.Sopicki
+# default energy fractions {abs(PDG code)} {fraction in HCAL or LHCAL}
+  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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_HCAL_Resolution.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -0,0 +1,9 @@
+# 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 {resolution formula as a function of eta and energy}
+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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_JetFinder.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_JetFinder_N.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_JetFlavourAssoc.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_JetFlavourAssoc_N.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_LHCalF_Binning.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_LHCalR_Binning.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_LumiCalF_Binning.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_LumiCalR_Binning.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_MuonEfficiency.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_MuonIsolation.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_MuonMomentumSmearing.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -0,0 +1,22 @@
+
+# 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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_MuonTrackingEff.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -0,0 +1,19 @@
+
+# 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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_PhotonEfficiency.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -0,0 +1,10 @@
+
+  # 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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_PhotonIsolation.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_Propagator.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_TauTagging.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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 cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/ILCgen/ILCgen_TauTagging_N.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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/delphes_card_ILCgen.tcl
===================================================================
--- cards/delphes_card_ILCgen.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
+++ cards/delphes_card_ILCgen.tcl	(revision cbeb9b2e2da323a5672fb05fc42153f4c375ad16)
@@ -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
+
+}
+
