Index: cards/CLIC/CLICdet_BeamCalF_Binning.tcl
===================================================================
--- cards/CLIC/CLICdet_BeamCalF_Binning.tcl	(revision 150ff646dd0aece56ed1a0e4318adfae09eb954e)
+++ cards/CLIC/CLICdet_BeamCalF_Binning.tcl	(revision 150ff646dd0aece56ed1a0e4318adfae09eb954e)
@@ -0,0 +1,29 @@
+# A.F.Zarnecki, based on ILCDelphes implementation
+
+set pi [expr {acos(-1)} ]
+
+# BeamCal eta range 4.0 - 5.3 -> 2.099-0.572 =1.527deg
+#
+# Inner part (4.5-5.3):  1.273-0.347 = 0.926 deg
+# 360/0.0973/cosh(5.3) = ~36 => 32 bins (taking key hole into account!!!)
+#
+# Outer part (4.0-4.5):  2.099-1.273 = 0.826 deg
+# 360/0.0973/cosh(4.4) = ~90 => 90 bins
+# Front part
+
+  set PhiBins {}
+  for {set i -45} {$i <= 45} {incr i} {
+    add PhiBins [expr {$i * $pi/45.0} ]
+  }
+  for {set i 0} {$i <= 10} {incr i} {
+    set eta [expr {4.0 + $i * 0.4999/10.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
+  set PhiBins {}
+  for {set i -16} {$i <= 16} {incr i} {
+    add PhiBins [expr {$i * $pi/18.0} ]
+  }
+  for {set i 0} {$i <= 10} {incr i} {
+    set eta [expr {4.5 + $i * 0.8/10.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
Index: cards/CLIC/CLICdet_BeamCalR_Binning.tcl
===================================================================
--- cards/CLIC/CLICdet_BeamCalR_Binning.tcl	(revision 150ff646dd0aece56ed1a0e4318adfae09eb954e)
+++ cards/CLIC/CLICdet_BeamCalR_Binning.tcl	(revision 150ff646dd0aece56ed1a0e4318adfae09eb954e)
@@ -0,0 +1,29 @@
+# A.F.Zarnecki, based on ILCDelphes implementation
+
+set pi [expr {acos(-1)} ]
+
+# BeamCal eta range 4.0 - 5.3 -> 2.099-0.572 =1.527deg
+#
+# Inner part (4.5-5.3):  1.273-0.347 = 0.926 deg
+# 360/0.0973/cosh(5.3) = ~36 => 32 bins (taking key hole into account!!!)
+#
+# Outer part (4.0-4.5):  2.099-1.273 = 0.826 deg
+# 360/0.0973/cosh(4.4) = ~90 => 90 bins
+# Rear part
+
+  set PhiBins {}
+  for {set i -45} {$i <= 45} {incr i} {
+    add PhiBins [expr {$i * $pi/45.0}]
+  }
+  for {set i 0} {$i <= 10} {incr i} {
+    set eta [expr {-4.0 - $i * 0.4999/10.0}]
+    add EtaPhiBins $eta $PhiBins
+  }
+  set PhiBins {}
+  for {set i -16} {$i <= 16} {incr i} {
+    add PhiBins [expr {$i * $pi/18.0}]
+  }
+  for {set i 0} {$i <= 10} {incr i} {
+    set eta [expr {-4.5 - $i * 0.8/10.0}]
+    add EtaPhiBins $eta $PhiBins
+  }
Index: cards/CLIC/CLICdet_BeamCal_Efficiency_Stage3.tcl
===================================================================
--- cards/CLIC/CLICdet_BeamCal_Efficiency_Stage3.tcl	(revision 150ff646dd0aece56ed1a0e4318adfae09eb954e)
+++ cards/CLIC/CLICdet_BeamCal_Efficiency_Stage3.tcl	(revision 150ff646dd0aece56ed1a0e4318adfae09eb954e)
@@ -0,0 +1,16 @@
+# Efficiency formula for photons/electrons in BeamCal
+# Based on CLICdp-Note-2018-005 (Fig. 69)
+# A.F.Zarnecki
+
+set EfficiencyFormula {
+    (energy  < 400 )                                                         * (0.00) +
+    (energy >= 400 )                 * (abs(eta) <= 4.00 )                   * (0.00) +
+    (energy >= 400 && energy < 800 ) * (abs(eta) > 4.00 && abs(eta) <= 4.15) * (0.00144 * energy - 0.16) +
+    (energy >= 800 )                 * (abs(eta) > 4.00 && abs(eta) <= 4.15) * (0.99) +
+    (energy >= 400 && energy < 800 ) * (abs(eta) > 4.15 && abs(eta) <= 4.70) * (0.99 + (0.0016*energy-1.2796290)*(abs(eta)-4.15)) +
+    (energy >= 800 )                 * (abs(eta) > 4.15 && abs(eta) <= 4.70) * (0.99) +
+    (energy >= 400 && energy < 800 ) * (abs(eta) > 4.70 && abs(eta) <= 5.30) * (0.00) +
+    (energy >= 800 )                 * (abs(eta) > 4.70 && abs(eta) <= 5.30) *
+    (1.- pow(1.-min(pow((5.35-abs(eta))/0.95,0.55),1.0),max(0.0029*energy-0.13,1.0))) * (0.98) +
+    (energy >= 400 )                 * (abs(eta) > 5.30 )                    * (0.00)
+  }
Index: cards/CLIC/CLICdet_BeamCal_EnergyFractions.tcl
===================================================================
--- cards/CLIC/CLICdet_BeamCal_EnergyFractions.tcl	(revision 150ff646dd0aece56ed1a0e4318adfae09eb954e)
+++ cards/CLIC/CLICdet_BeamCal_EnergyFractions.tcl	(revision 150ff646dd0aece56ed1a0e4318adfae09eb954e)
@@ -0,0 +1,20 @@
+# As for ECAL
+
+  add EnergyFraction {0} {0.0}
+  # energy fractions for e, gamma and pi0
+  add EnergyFraction {11} {1.0}
+  add EnergyFraction {22} {1.0}
+  add EnergyFraction {111} {1.0}
+  # energy fractions for muon, neutrinos and neutralinos
+  add EnergyFraction {12} {0.0}
+  add EnergyFraction {13} {0.0}
+  add EnergyFraction {14} {0.0}
+  add EnergyFraction {16} {0.0}
+  add EnergyFraction {1000022} {0.0}
+  add EnergyFraction {1000023} {0.0}
+  add EnergyFraction {1000025} {0.0}
+  add EnergyFraction {1000035} {0.0}
+  add EnergyFraction {1000045} {0.0}
+  # energy fractions for K0short and Lambda
+  add EnergyFraction {310} {0.3}
+  add EnergyFraction {3122} {0.3}
Index: cards/CLIC/CLICdet_BeamCal_Resolution_Stage3.tcl
===================================================================
--- cards/CLIC/CLICdet_BeamCal_Resolution_Stage3.tcl	(revision 150ff646dd0aece56ed1a0e4318adfae09eb954e)
+++ cards/CLIC/CLICdet_BeamCal_Resolution_Stage3.tcl	(revision 150ff646dd0aece56ed1a0e4318adfae09eb954e)
@@ -0,0 +1,6 @@
+# A.F.Zarnecki
+# BeamCal resolution at 3TeV from CLICdp-Note-2018-005 (Fig. 72)
+
+  set ResolutionFormula {
+             energy*0.11
+  }
Index: cards/CLIC/CLICdet_LumiCalF_Binning.tcl
===================================================================
--- cards/CLIC/CLICdet_LumiCalF_Binning.tcl	(revision 150ff646dd0aece56ed1a0e4318adfae09eb954e)
+++ cards/CLIC/CLICdet_LumiCalF_Binning.tcl	(revision 150ff646dd0aece56ed1a0e4318adfae09eb954e)
@@ -0,0 +1,15 @@
+# Copy of ILCDelphes implementation by P.Sopicki
+
+set pi [expr {acos(-1)} ]
+
+# LumiCal eta range 3.0 - 4.0 (no beam crossing boost)
+# Front part
+set PhiBins {}
+  for {set i -24} {$i <= 24} {incr i} {
+    add PhiBins [expr {$i * $pi/24.0} ]
+  }
+
+for {set i 0} {$i <= 64} {incr i} {
+    set eta [expr {3.0 + $i * 1.0/64.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
Index: cards/CLIC/CLICdet_LumiCalR_Binning.tcl
===================================================================
--- cards/CLIC/CLICdet_LumiCalR_Binning.tcl	(revision 150ff646dd0aece56ed1a0e4318adfae09eb954e)
+++ cards/CLIC/CLICdet_LumiCalR_Binning.tcl	(revision 150ff646dd0aece56ed1a0e4318adfae09eb954e)
@@ -0,0 +1,15 @@
+# Copy of ILCDelphes implementation by P.Sopicki
+
+set pi [expr {acos(-1)} ]
+
+# LumiCal eta range 3.0 - 4.0 (no beam crossing boost)
+# Rear part
+set PhiBins {}
+  for {set i -24} {$i <= 24} {incr i} {
+    add PhiBins [expr {$i * $pi/24.0} ]
+  }
+
+for {set i 0} {$i <= 64} {incr i} {
+    set eta [expr {-4.0 + $i * 1.0/64.0} ]
+    add EtaPhiBins $eta $PhiBins
+  }
Index: cards/CLIC/CLICdet_LumiCal_Efficiency_Stage3.tcl
===================================================================
--- cards/CLIC/CLICdet_LumiCal_Efficiency_Stage3.tcl	(revision 150ff646dd0aece56ed1a0e4318adfae09eb954e)
+++ cards/CLIC/CLICdet_LumiCal_Efficiency_Stage3.tcl	(revision 150ff646dd0aece56ed1a0e4318adfae09eb954e)
@@ -0,0 +1,25 @@
+# Efficiency formula for photons/electrons in LumiCal at 3 TeV
+# Based on CLICdp-Note-2018-005 (Fig. 65)
+# A.F.Zarnecki
+
+set EfficiencyFormula {
+    (energy < 10 ) *                                                       (0.00) +
+    (energy >= 10 ) * (abs(eta) <= 3.0 ) *                                 (0.00) +
+    (energy >= 10 && energy < 50 ) *  (abs(eta) > 3.00 && abs(eta) <= 3.22) *
+                             pow(0.99 - 3.60283*(3.22-abs(eta)), 50./energy)      +
+    (energy >= 50 ) *                 (abs(eta) > 3.00 && abs(eta) <= 3.22) *
+                               (0.99 - 3.60283*(3.22-abs(eta)))                   +
+    (energy >= 10 && energy < 60 ) *  (abs(eta) > 3.22 && abs(eta) <= 3.37) *
+                                 (0.899781 +  0.0510312 * log10(energy))          +
+    (energy >= 60 ) *                 (abs(eta) > 3.22 && abs(eta) <= 3.37) *
+                                 (0.99)                                           +
+    (energy >= 10 && energy < 98 ) *  (abs(eta) > 3.37 && abs(eta) <= 3.55) *
+                                 (0.252111 +  0.37063 * log10(energy))            +
+    (energy >= 98 ) *                 (abs(eta) > 3.37 && abs(eta) <= 3.55) *
+                                 (0.99)                                           +
+    (energy >= 10 && energy < 98 ) *  (abs(eta) > 3.55 && abs(eta) <= 4.00) *
+     (1.- pow(1.-pow((4.4-abs(eta))/0.9,exp(2.60527-0.0139161*energy)),4.0)) * (0.252111 +  0.37063  * log10(energy)) +
+    (energy >= 98 ) *                 (abs(eta) > 3.55 && abs(eta) <= 4.00) *
+     (1.- pow(1.-pow((4.4-abs(eta))/0.9,exp(2.60527-0.0139161*energy)),4.0)) * (0.99) +
+    (energy >= 10 ) * (abs(eta) > 4.0 ) *                                  (0.00)
+  }
Index: cards/CLIC/CLICdet_LumiCal_EnergyFractions.tcl
===================================================================
--- cards/CLIC/CLICdet_LumiCal_EnergyFractions.tcl	(revision 150ff646dd0aece56ed1a0e4318adfae09eb954e)
+++ cards/CLIC/CLICdet_LumiCal_EnergyFractions.tcl	(revision 150ff646dd0aece56ed1a0e4318adfae09eb954e)
@@ -0,0 +1,20 @@
+# As for ECAL
+
+  add EnergyFraction {0} {0.0}
+  # energy fractions for e, gamma and pi0
+  add EnergyFraction {11} {1.0}
+  add EnergyFraction {22} {1.0}
+  add EnergyFraction {111} {1.0}
+  # energy fractions for muon, neutrinos and neutralinos
+  add EnergyFraction {12} {0.0}
+  add EnergyFraction {13} {0.0}
+  add EnergyFraction {14} {0.0}
+  add EnergyFraction {16} {0.0}
+  add EnergyFraction {1000022} {0.0}
+  add EnergyFraction {1000023} {0.0}
+  add EnergyFraction {1000025} {0.0}
+  add EnergyFraction {1000035} {0.0}
+  add EnergyFraction {1000045} {0.0}
+  # energy fractions for K0short and Lambda
+  add EnergyFraction {310} {0.3}
+  add EnergyFraction {3122} {0.3}
Index: cards/CLIC/CLICdet_LumiCal_Resolution_Stage3.tcl
===================================================================
--- cards/CLIC/CLICdet_LumiCal_Resolution_Stage3.tcl	(revision 150ff646dd0aece56ed1a0e4318adfae09eb954e)
+++ cards/CLIC/CLICdet_LumiCal_Resolution_Stage3.tcl	(revision 150ff646dd0aece56ed1a0e4318adfae09eb954e)
@@ -0,0 +1,6 @@
+# A.F.Zarnecki
+# LumiCal energy resolution at 3TeV from CLICdp-Note-2018-005 (Fig. 68) 
+
+  set ResolutionFormula {
+           sqrt(40.9 + energy*0.356624) 
+  }
