From dbc632c832f26a0b715977723bd69881a097c673 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Fri, 27 Nov 2015 08:42:28 +0100
Subject: [PATCH] established Vn thresholds (TrigHIHypo-00-00-75)

	* established Vn thresholds
	* TrigHIHypo-00-00-75

2015-11-18 Tomasz Bold
	* tunes from first data
	* TrigHIHypo-00-00-74
---
 .../TrigHIHypo/python/UltraCentralHypos.py    |  18 +-
 .../TrigHIHypo/python/VnHypos.py              | 204 ++++++------------
 2 files changed, 77 insertions(+), 145 deletions(-)

diff --git a/Trigger/TrigHypothesis/TrigHIHypo/python/UltraCentralHypos.py b/Trigger/TrigHypothesis/TrigHIHypo/python/UltraCentralHypos.py
index 97dd9a3176981..cf8f0b8dec78f 100644
--- a/Trigger/TrigHypothesis/TrigHIHypo/python/UltraCentralHypos.py
+++ b/Trigger/TrigHypothesis/TrigHIHypo/python/UltraCentralHypos.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
 from TrigHIHypo.TrigHIHypoConf import UltraCentralHypo
-
+from AthenaCommon.SystemOfUnits import GeV
 from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig
 class UltraCentralMonitoring(TrigGenericMonitoringToolConfig):
     def __init__ (self, name="UltraCentralMonitoring"):
@@ -10,11 +10,11 @@ class UltraCentralMonitoring(TrigGenericMonitoringToolConfig):
         self.Histograms += [ defineHistogram('FCalTotalEt',
                                              type='TH1F',
                                              title="Total ET in FCal; ET [MeV]",
-                                             xbins = 900, xmin=-500000.0, xmax=8500000)]
+                                             xbins = 900, xmin=-500000.0, xmax=8500*GeV)]
         self.Histograms += [ defineHistogram('FCalTotalEtPassing',
                                              type='TH1F',
                                              title="Total ET in FCal for passing events; ET [MeV]",
-                                             xbins = 900, xmin=-500000.0, xmax=8500000)]
+                                             xbins = 900, xmin=-500000.0, xmax=8500*GeV)]
 
 
 class UltraCentral(UltraCentralHypo):
@@ -34,6 +34,12 @@ class UltraCentral_PT(UltraCentralHypo):
         self.AthenaMonTools += [UltraCentralMonitoring(name="UltraCentralMonitoring")]
 
 
-UCC_th = {"th1": UltraCentral("UCCHypo_th1", 6000.0, 10000.0), 
-          "th2": UltraCentral("UCCHypo_th2", 6500.0, 10000.0), 
-          "th3": UltraCentral("UCCHypo_th3", 7000.0, 10000.0) }
+UCC_th = {"th1": UltraCentral("UCCHypo_th1", 4172*GeV, 10000.0*GeV), 
+          "th2": UltraCentral("UCCHypo_th2", 4326*GeV, 10000.0*GeV), 
+          "th3": UltraCentral("UCCHypo_th3", 4500*GeV, 10000.0*GeV) }
+
+
+
+
+
+
diff --git a/Trigger/TrigHypothesis/TrigHIHypo/python/VnHypos.py b/Trigger/TrigHypothesis/TrigHIHypo/python/VnHypos.py
index 183882c2ce87a..46eb3235e3952 100644
--- a/Trigger/TrigHypothesis/TrigHIHypo/python/VnHypos.py
+++ b/Trigger/TrigHypothesis/TrigHIHypo/python/VnHypos.py
@@ -2,7 +2,7 @@
 
 from TrigHIHypo.TrigHIHypoConf import VnHypo
 
-from AthenaCommon.SystemOfUnits import TeV
+from AthenaCommon.SystemOfUnits import TeV,GeV
 from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig
 class VnMonitoring(TrigGenericMonitoringToolConfig):
     def __init__ (self, name="VnMonitoring", harmonic=1):
@@ -11,23 +11,11 @@ class VnMonitoring(TrigGenericMonitoringToolConfig):
         self.Histograms += [ defineHistogram('TotalEt',
                                              type='TH1F',
                                              title="Total ET; ET [MeV]",
-                                             xbins = 100, xmin=0.0, xmax=8.5*TeV)]
+                                             xbins = 100, xmin=0.0, xmax=6.5*TeV)]
         self.Histograms += [ defineHistogram('TotalEtPassing',
                                              type='TH1F',
                                              title="Total ET for passing events; ET [MeV]",
-                                             xbins = 100, xmin=0.0, xmax=8.5*TeV)]
-
-
-        # self.Histograms += [ defineHistogram('icent',
-        #                                      type='TH1F',
-        #                                      title="Centrality bin if checked events;centrality[%]",
-        #                                      xbins = 101, xmin=-0.5, xmax=100.5)]
-
-
-        # self.Histograms += [ defineHistogram('icentPassing',
-        #                                      type='TH1F',
-        #                                      title="Centrality bin of passing events;centrality[%]",
-        #                                      xbins = 101, xmin=-0.5, xmax=100.5)]
+                                             xbins = 100, xmin=0.0, xmax=6.5*TeV)]
 
 
         self.Histograms += [ defineHistogram('q',
@@ -44,7 +32,7 @@ class VnMonitoring(TrigGenericMonitoringToolConfig):
         self.Histograms += [ defineHistogram('TotalEt, decision',
                                              type='TH2F',
                                              title="(all row 0) (passing row 1); FCal Et",
-                                             xbins = 100, xmin=0.0, xmax=8.5*TeV,
+                                             xbins = 100, xmin=0.0, xmax=6.5*TeV,
                                              ybins=2, ymin=-0.5, ymax=1.5) ]
 
 class VnBootstrap(TrigGenericMonitoringToolConfig):
@@ -55,8 +43,8 @@ class VnBootstrap(TrigGenericMonitoringToolConfig):
         self.Histograms += [ defineHistogram('TotalEt, q',
                                              type='TH2F',
                                              title="q%d vs Fcal of all events" % harmonic,
-                                             xbins=200, xmin=0.0, xmax=8.5*TeV,
-                                             ybins=50, ymin=0, ymax=0.25) ]            
+                                             xbins=100, xmin=200*GeV, xmax=5.*TeV,
+                                             ybins=100, ymin=0, ymax=0.2) ]            
 
 class QZeroMonitoring(TrigGenericMonitoringToolConfig):
     def __init__ (self, name="QZeroMonitoring", harmonic=1, qmax=0.3):
@@ -65,94 +53,76 @@ class QZeroMonitoring(TrigGenericMonitoringToolConfig):
 
 #        self.Histograms += [ defineHistogram('TotalEt, qnx', type="TH2F", title="TotalEt[TeV];q_{%d x 0};q_{x0}" % harmonic, xbins=100, xmin=0, xmax=4.5*TeV, ybins=30, ymin=-qmax, ymax=qmax) ]
 #        self.Histograms += [ defineHistogram('TotalEt, qny', type="TH2F", title="TotalEt[TeV];q_{%d y 0};q_{y0}" % harmonic, xbins=100, xmin=0, xmax=4.5*TeV, ybins=30, ymin=-qmax, ymax=qmax) ]
-        self.Histograms += [ defineHistogram('TotalEt, qnx', type="TProfile", title="FCal Event q0x;TotalEt[TeV];q_{%d x 0}" % harmonic, xbins=100, xmin=0, xmax=8.5*TeV) ]
-        self.Histograms += [ defineHistogram('TotalEt, qny', type="TProfile", title="FCal Event q0y;TotalEt[TeV];q_{%d y 0}" % harmonic, xbins=100, xmin=0, xmax=8.5*TeV) ]
-
-_EtCuts=[
-    3.4432, 3.2977, 3.1648, 3.0400, 2.9222, 2.8101, 2.7033, 2.6014, 2.5038, 2.4104, 
-    2.3208, 2.2343, 2.1516, 2.0715, 1.9941, 1.9194, 1.8473, 1.7776, 1.7100, 1.6448, 
-    1.5815, 1.5203, 1.4610, 1.4034, 1.3479, 1.2939, 1.2417, 1.1910, 1.1418, 1.0942, 
-    1.0482, 1.0036, 0.9604, 0.9185, 0.8780, 0.8388, 0.8009, 0.7642, 0.7288, 0.6946, 
-    0.6615, 0.6295, 0.5987, 0.5689, 0.5401, 0.5126, 0.4859, 0.4604, 0.4357, 0.4120, 
-    0.3892, 0.3674, 0.3465, 0.3265, 0.3073, 0.2889, 0.2714, 0.2546, 0.2387, 0.2235,
-    0.2090, 0.1953, 0.1822, 0.1698, 0.1582, 0.1471, 0.1366, 0.1268, 0.1175, 0.1088] 
-#    0.1005, 0.0928, 0.0856, 0.0789, 0.0725, 0.0666, 0.0611, 0.0559, 0.0511, 0.0467, 
-#    0.0425, 0.0386, 0.0350, 0.0316, 0.0285, 0.0256, 0.0229, 0.0203, 0.0180, 0.0158, 
-#    0.0137, 0.0118, 0.0100, 0.0083, 0.0067, 0.0051, 0.0033, -0.0085,    -1,     -2 ]
+        self.Histograms += [ defineHistogram('TotalEt, qnx', type="TProfile", title="FCal Event q0x;TotalEt[TeV];q_{%d x 0}" % harmonic, xbins=100, xmin=0, xmax=6.5*TeV) ]
+        self.Histograms += [ defineHistogram('TotalEt, qny', type="TProfile", title="FCal Event q0y;TotalEt[TeV];q_{%d y 0}" % harmonic, xbins=100, xmin=0, xmax=6.5*TeV) ]
+
+# _EtCuts=[
+#     3.4432, 3.2977, 3.1648, 3.0400, 2.9222, 2.8101, 2.7033, 2.6014, 2.5038, 2.4104, 
+#     2.3208, 2.2343, 2.1516, 2.0715, 1.9941, 1.9194, 1.8473, 1.7776, 1.7100, 1.6448, 
+#     1.5815, 1.5203, 1.4610, 1.4034, 1.3479, 1.2939, 1.2417, 1.1910, 1.1418, 1.0942, 
+#     1.0482, 1.0036, 0.9604, 0.9185, 0.8780, 0.8388, 0.8009, 0.7642, 0.7288, 0.6946, 
+#     0.6615, 0.6295, 0.5987, 0.5689, 0.5401, 0.5126, 0.4859, 0.4604, 0.4357, 0.4120, 
+#     0.3892, 0.3674, 0.3465, 0.3265, 0.3073, 0.2889, 0.2714, 0.2546, 0.2387, 0.2235,
+#     0.2090, 0.1953, 0.1822, 0.1698, 0.1582, 0.1471, 0.1366, 0.1268, 0.1175, 0.1088] 
+# #    0.1005, 0.0928, 0.0856, 0.0789, 0.0725, 0.0666, 0.0611, 0.0559, 0.0511, 0.0467, 
+# #    0.0425, 0.0386, 0.0350, 0.0316, 0.0285, 0.0256, 0.0229, 0.0203, 0.0180, 0.0158, 
+# #    0.0137, 0.0118, 0.0100, 0.0083, 0.0067, 0.0051, 0.0033, -0.0085,    -1,     -2 ]
     
+_EtCuts_v2=[ x*1e-3 for x in reversed(range(300, 6050, 50)) ] # equidistant bins
+_EtCuts_v3=[ x*1e-3 for x in reversed(range(400, 6050, 50)) ]
+
 
 
 ########################################################################################
 # V2
 
+q2xshift=0.0036
+q2yshift=-0.00034
+
 class V2Hypo(VnHypo):
     __slots__ = []
     def __init__(self, name):
         super( VnHypo, self ).__init__( name )
         self.FlowHarmonic = 2
-        self.CentralityBins=_EtCuts
-        self.QxShifts = [-0.0018]*len(_EtCuts)
-        self.QyShifts = [0.00235]*len(_EtCuts)
+        self.CentralityBins=_EtCuts_v2
+        self.QxShifts = [q2xshift]*len(_EtCuts_v2)
+        self.QyShifts = [q2yshift]*len(_EtCuts_v2)
         self.AthenaMonTools += [VnMonitoring(name="VnMonitoring", harmonic=self.FlowHarmonic)]
         
 V2_th16 = V2Hypo("V2_th16")
 V2_th16.AthenaMonTools += [QZeroMonitoring(name="QZeroMonitoring", harmonic=2, qmax=2), VnBootstrap(name="V2Bootstrap", harmonic=2)]
 V2_th16.CentralityBins=[-0.5]
 V2_th16.QThresholds=[1e3]
-V2_th16.QxShifts=[-0.0018]
-V2_th16.QyShifts=[0.00235]
+V2_th16.QxShifts=[q2xshift]
+V2_th16.QyShifts=[q2yshift]
 
 
+def generateVnThresholds(a,b,c, etbins):
+    return [ a - b*et +c*pow(et, 2)  for et in etbins]
+    
+# thresholds mappint
+#      %v2     %v3
+#15    2.5     2.5
+#14    5       5 
+#13    10      10
+#10    1       1 
+#5     0.5     20
+
 V2_th15 = V2Hypo("V2_th15")            
-V2_th15.QThresholds = [
-    0.04191472, 0.04611506, 0.05070368, 0.05525005, 0.05956044, 0.06377603, 0.06757076, 0.07141442, 0.07484658, 0.07827399,
-    0.08138302, 0.08443090, 0.08749046, 0.09026565, 0.09284734, 0.09575570, 0.09815926, 0.10060653, 0.10314960, 0.10541277,
-    0.10768567, 0.10996160, 0.11181823, 0.11407777, 0.11610788, 0.11806158, 0.12004893, 0.12192925, 0.12378947, 0.12521300,
-    0.12690738, 0.12856935, 0.13006979, 0.13180589, 0.13319614, 0.13467550, 0.13616520, 0.13715249, 0.13887462, 0.13980920,
-    0.14137965, 0.14236223, 0.14387861, 0.14472203, 0.14566352, 0.14722109, 0.14780941, 0.14888270, 0.14993528, 0.15029726,
-    0.15193151, 0.15289912, 0.15375809, 0.15493656, 0.15573826, 0.15691238, 0.15828855, 0.15946312, 0.16061241, 0.16239769,
-    0.16372376, 0.16534476, 0.16677584, 0.16850459, 0.17127948, 0.17388474, 0.17683791, 0.18003190, 0.18252463, 0.18646950 ]
+V2_th15.QThresholds = generateVnThresholds(0.144638, 0.0239043, -0.000368144, _EtCuts_v2)
 
 V2_th14 = V2Hypo("V2_th14")            
-V2_th14.QThresholds = [
-    0.03740692, 0.04116810, 0.04545774, 0.04978427, 0.05381647, 0.05780035, 0.06150938, 0.06502882, 0.06840641, 0.07157117,
-    0.07462977, 0.07752905, 0.08048036, 0.08311171, 0.08561221, 0.08829189, 0.09058074, 0.09290209, 0.09525025, 0.09752058,
-    0.09962006, 0.10161234, 0.10341367, 0.10560787, 0.10730175, 0.10925008, 0.11100601, 0.11258404, 0.11448869, 0.11578678,
-    0.11732854, 0.11888919, 0.12023879, 0.12177366, 0.12294116, 0.12431220, 0.12560723, 0.12653579, 0.12792569, 0.12901417,
-    0.13015490, 0.13092390, 0.13218627, 0.13310909, 0.13368765, 0.13515237, 0.13565964, 0.13643195, 0.13731707, 0.13755190,
-    0.13881262, 0.13958677, 0.14049571, 0.14123980, 0.14214018, 0.14310421, 0.14399007, 0.14472858, 0.14572510, 0.14694505,
-    0.14817286, 0.14934388, 0.15074964, 0.15224148, 0.15406875, 0.15624562, 0.15855588, 0.16130813, 0.16366821, 0.16679789]
+V2_th14.QThresholds = generateVnThresholds(0.134306, 0.0213092, -0.00069103, _EtCuts_v2)
 
 V2_th13 = V2Hypo("V2_th13")
-V2_th13.QThresholds = [
-    0.03369209, 0.03702664, 0.04105366, 0.04512280, 0.04898601, 0.05274932, 0.05634842, 0.05972964, 0.06296631, 0.06596177,
-    0.06889848, 0.07174880, 0.07443841, 0.07701042, 0.07937586, 0.08189047, 0.08405642, 0.08630061, 0.08845864, 0.09069694,
-    0.09252004, 0.09447184, 0.09625928, 0.09827007, 0.09992091, 0.10160523, 0.10313811, 0.10475168, 0.10651546, 0.10770607,
-    0.10912950, 0.11056081, 0.11175559, 0.11313010, 0.11419941, 0.11535331, 0.11644248, 0.11742683, 0.11856678, 0.11948365,
-    0.12044438, 0.12122086, 0.12215803, 0.12299531, 0.12359963, 0.12461479, 0.12519437, 0.12589656, 0.12640619, 0.12652450,
-    0.12758604, 0.12823390, 0.12902428, 0.12950793, 0.13015903, 0.13081517, 0.13158970, 0.13228616, 0.13299210, 0.13391917,
-    0.13489480, 0.13573733, 0.13701996, 0.13826900, 0.13978851, 0.14144086, 0.14341581, 0.14543296, 0.14777784, 0.15048885 ]
+V2_th13.QThresholds = generateVnThresholds(0.12048, 0.0172576, -0.0011478, _EtCuts_v2)
 
 
 V2_th10 = V2Hypo("V2_th10")
-V2_th10.QThresholds = [
-    0.02456593, 0.02710698, 0.03018641, 0.03358774, 0.03690612, 0.04018757, 0.04331899, 0.04624952, 0.04911163, 0.05175626,
-    0.05429614, 0.05681480, 0.05915455, 0.06145126, 0.06352471, 0.06558050, 0.06751687, 0.06946219, 0.07116317, 0.07301096,
-    0.07473862, 0.07623948, 0.07772971, 0.07936991, 0.08074884, 0.08203129, 0.08337427, 0.08457865, 0.08590268, 0.08688067,
-    0.08790616, 0.08895349, 0.08983001, 0.09080941, 0.09160074, 0.09246965, 0.09323261, 0.09387214, 0.09453908, 0.09510010,
-    0.09569952, 0.09615510, 0.09661647, 0.09704839, 0.09739449, 0.09783472, 0.09812786, 0.09841986, 0.09854587, 0.09853124,
-    0.09904759, 0.09904453, 0.09943918, 0.09952868, 0.09974287, 0.09992959, 0.10024795, 0.10043963, 0.10067878, 0.10106615,
-    0.10156120, 0.10191574, 0.10239000, 0.10346732, 0.10411693, 0.10515329, 0.10619578, 0.10754704, 0.10909007, 0.11065415]
+V2_th10.QThresholds = generateVnThresholds(0.158364, 0.0281745, 0.000147842, _EtCuts_v2)
 
 V2_th5 = V2Hypo("V2_th5")
-V2_th5.QThresholds = [
-    0.01152187, 0.01270212, 0.01427261, 0.01614444, 0.01816674, 0.02030926, 0.02235199, 0.02443076, 0.02647653, 0.02841883,
-    0.03031866, 0.03212026, 0.03367812, 0.03534181, 0.03688820, 0.03836156, 0.03970004, 0.04101713, 0.04218514, 0.04342612,
-    0.04451595, 0.04564459, 0.04653276, 0.04751842, 0.04827223, 0.04901434, 0.04987785, 0.05047411, 0.05112942, 0.05155760,
-    0.05199677, 0.05249420, 0.05275774, 0.05316372, 0.05341638, 0.05362832, 0.05379064, 0.05392448, 0.05390332, 0.05398988,
-    0.05376352, 0.05386630, 0.05376211, 0.05365150, 0.05327507, 0.05306196, 0.05291635, 0.05272638, 0.05234656, 0.05197630,
-    0.05177545, 0.05146717, 0.05131771, 0.05104530, 0.05069041, 0.05047863, 0.05023809, 0.05006885, 0.04991808, 0.04974556,
-    0.04975665, 0.04967587, 0.04980033, 0.04989947, 0.05007853, 0.05049705, 0.05075333, 0.05126722, 0.05196336, 0.05258261]
+V2_th5.QThresholds =  generateVnThresholds(0.165639, 0.0295911, 0.00035603, _EtCuts_v2)
 
 
 V2_th = {16: V2_th16, 15: V2_th15, 14: V2_th14, 13: V2_th13, 10: V2_th10, 5: V2_th5 }
@@ -162,86 +132,49 @@ def V2(names, threshold):
 
 V2_th1_veto = V2Hypo("V2_th1_veto")
 V2_th1_veto.UpperLimit=True
-V2_th1_veto.QThresholds = [
-    0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
-    0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
-    0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
-    0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
-    0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
-    0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
-    0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]
+V2_th1_veto.QThresholds = generateVnThresholds(0.0330088, -0.00256366, -0.00233638, _EtCuts_v2)
 
 
 ########################################################################################
 # V3
+q3xshift=-0.0017
+q3yshift=0.0013
+
+
+
 class V3Hypo(VnHypo):
     __slots__ = []
     def __init__(self, name):
         super( VnHypo, self ).__init__( name )
         self.FlowHarmonic = 3
-        self.CentralityBins = _EtCuts
-        self.QxShifts = [-0.00265]*len(_EtCuts)
-        self.QyShifts =  [0.00063]*len(_EtCuts)
+        self.CentralityBins = _EtCuts_v3
+        self.QxShifts = [q3xshift]*len(_EtCuts_v3)
+        self.QyShifts =  [q3yshift]*len(_EtCuts_v3)
         self.AthenaMonTools += [VnMonitoring(name="VnMonitoring", harmonic=self.FlowHarmonic)]
         
 V3_th16 =V3Hypo("V3_th16")
 V3_th16.CentralityBins=[-0.5]
 V3_th16.QThresholds=[1e3]
-V3_th16.QxShifts=[-0.00265]
-V3_th16.QyShifts=[0.00063]
+V3_th16.QxShifts=[q3xshift]
+V3_th16.QyShifts=[q3yshift]
 
-V3_th16.AthenaMonTools += [QZeroMonitoring(name="QZeroMonitoring", harmonic=3, qmax=2), VnBootstrap(name="V2Bootstrap", harmonic=3)]
+V3_th16.AthenaMonTools += [QZeroMonitoring(name="QZeroMonitoring", harmonic=3, qmax=2), VnBootstrap(name="V3Bootstrap", harmonic=3)]
 
 V3_th15 = V3Hypo("V3_th15")
-V3_th15.QThresholds = [
-    0.03513726, 0.03631165, 0.03768844, 0.03883054, 0.03998376, 0.04092407, 0.04179109, 0.04274018, 0.04352490, 0.04433323,
-    0.04516572, 0.04593598, 0.04662202, 0.04739382, 0.04812554, 0.04876814, 0.04945114, 0.05029320, 0.05089141, 0.05157609,
-    0.05237819, 0.05300589, 0.05369290, 0.05445137, 0.05498160, 0.05570349, 0.05642555, 0.05738593, 0.05796521, 0.05882787,
-    0.05945357, 0.06036532, 0.06111191, 0.06201032, 0.06262266, 0.06357719, 0.06450997, 0.06532997, 0.06638774, 0.06736332,
-    0.06810985, 0.06934437, 0.07048565, 0.07144058, 0.07270906, 0.07389598, 0.07521759, 0.07672595, 0.07795843, 0.07923040,
-    0.08104803, 0.08258906, 0.08434631, 0.08628569, 0.08804863, 0.09028343, 0.09265420, 0.09449524, 0.09728277, 0.10010242,
-    0.10267729, 0.10556075, 0.10890142, 0.11205775, 0.11587236, 0.12006067, 0.12365335, 0.12807378, 0.13233773, 0.13720867]
+V3_th15.QThresholds = generateVnThresholds(0.0680338, 0.0128576, 0.000901204, _EtCuts_v3)
 
 V3_th14 = V3Hypo("V3_th14")
-V3_th14.QThresholds = [
-    0.03145231, 0.03250667, 0.03370961, 0.03482182, 0.03576010, 0.03665307, 0.03744825, 0.03818750, 0.03902529, 0.03976378,
-    0.04047929, 0.04113197, 0.04171997, 0.04242770, 0.04307200, 0.04370316, 0.04424203, 0.04498447, 0.04551745, 0.04620108,
-    0.04685380, 0.04754202, 0.04808879, 0.04874075, 0.04923942, 0.04994072, 0.05059545, 0.05140947, 0.05202366, 0.05269323,
-    0.05326716, 0.05396427, 0.05470992, 0.05540092, 0.05614920, 0.05687878, 0.05767440, 0.05845856, 0.05935791, 0.06028135,
-    0.06093463, 0.06202404, 0.06293931, 0.06384036, 0.06491368, 0.06609845, 0.06717581, 0.06855721, 0.06959983, 0.07087797,
-    0.07228808, 0.07378565, 0.07529536, 0.07695675, 0.07857301, 0.08047163, 0.08255730, 0.08442803, 0.08672302, 0.08897797,
-    0.09151220, 0.09400259, 0.09685481, 0.09966639, 0.10291793, 0.10634085, 0.10965937, 0.11345894, 0.11736003, 0.12153300]
+V3_th14.QThresholds = generateVnThresholds(0.0632529, 0.0135102, 0.00102213, _EtCuts_v3)
 
 V3_th13 = V3Hypo("V3_th13")
-V3_th13.QThresholds = [
-    0.02834278, 0.02932029, 0.03040146, 0.03139097, 0.03222971, 0.03304867, 0.03379216, 0.03443726, 0.03519771, 0.03586084,
-    0.03646914, 0.03700551, 0.03759770, 0.03816923, 0.03872765, 0.03938810, 0.03989251, 0.04058628, 0.04110593, 0.04162897,
-    0.04226823, 0.04286611, 0.04338859, 0.04392474, 0.04442766, 0.04500271, 0.04562443, 0.04628337, 0.04683776, 0.04746674,
-    0.04802371, 0.04864336, 0.04923175, 0.04998771, 0.05058432, 0.05134264, 0.05193576, 0.05278254, 0.05343913, 0.05431317,
-    0.05491400, 0.05594055, 0.05670502, 0.05747659, 0.05851677, 0.05952113, 0.06044754, 0.06162962, 0.06263566, 0.06372098,
-    0.06505761, 0.06644779, 0.06771427, 0.06913746, 0.07076386, 0.07227259, 0.07415294, 0.07584718, 0.07778545, 0.07980494,
-    0.08201443, 0.08435533, 0.08689617, 0.08942477, 0.09222490, 0.09515650, 0.09832809, 0.10157795, 0.10503367, 0.10876363]
+V3_th13.QThresholds = generateVnThresholds(0.0549295, 0.0111602, 0.0006531, _EtCuts_v3)
 
 V3_th10 = V3Hypo("V3_th10")
-V3_th10.QThresholds = [
-    0.02074531, 0.02145897, 0.02228237, 0.02301473, 0.02360970, 0.02423087, 0.02473839, 0.02527057, 0.02579544, 0.02625824,
-    0.02669040, 0.02718450, 0.02759504, 0.02805876, 0.02847736, 0.02888053, 0.02930169, 0.02972249, 0.03015431, 0.03054604,
-    0.03099934, 0.03142078, 0.03180675, 0.03222236, 0.03263580, 0.03310038, 0.03347943, 0.03397417, 0.03432652, 0.03474711,
-    0.03520419, 0.03564476, 0.03612604, 0.03664080, 0.03712176, 0.03764959, 0.03810427, 0.03869109, 0.03917495, 0.03963449,
-    0.04030404, 0.04088789, 0.04156942, 0.04213730, 0.04282697, 0.04356019, 0.04421862, 0.04504711, 0.04575066, 0.04657452,
-    0.04758276, 0.04847542, 0.04940923, 0.05046994, 0.05162767, 0.05273932, 0.05400297, 0.05524006, 0.05667901, 0.05813043,
-    0.05973098, 0.06136851, 0.06310639, 0.06498229, 0.06694045, 0.06903552, 0.07129551, 0.07363774, 0.07608264, 0.07869995]
+V3_th10.QThresholds = generateVnThresholds(0.0777345, 0.0161675, 0.00145098, _EtCuts_v3)
 
 
 V3_th5 = V3Hypo("V3_th5")
-V3_th5.QThresholds = [
-    0.00974650, 0.01012176, 0.01047111, 0.01081774, 0.01114023, 0.01138964, 0.01164953, 0.01188304, 0.01216446, 0.01237966,
-    0.01255039, 0.01280590, 0.01301388, 0.01322910, 0.01344230, 0.01361435, 0.01380289, 0.01400183, 0.01420787, 0.01439984,
-    0.01457295, 0.01474650, 0.01497169, 0.01514007, 0.01535275, 0.01558957, 0.01580883, 0.01603826, 0.01615232, 0.01639025,
-    0.01659857, 0.01677398, 0.01698643, 0.01724901, 0.01751300, 0.01770783, 0.01792217, 0.01819036, 0.01846457, 0.01865521,
-    0.01899191, 0.01922260, 0.01952033, 0.01977060, 0.02015563, 0.02045772, 0.02079796, 0.02118420, 0.02152966, 0.02184471,
-    0.02233095, 0.02278487, 0.02320926, 0.02371055, 0.02421957, 0.02468717, 0.02531956, 0.02590177, 0.02660782, 0.02722072,
-    0.02794078, 0.02873716, 0.02950178, 0.03038695, 0.03132688, 0.03225487, 0.03325466, 0.03438586, 0.03552826, 0.03671435]
+V3_th5.QThresholds = generateVnThresholds(0.0456977, 0.00745393, -2.59157e-05,  _EtCuts_v3)
 
 V3_th = {16: V3_th16, 15: V3_th15, 14: V3_th14, 13: V3_th13, 10: V3_th10, 5: V3_th5 }
 def V3(names, threshold):
@@ -250,11 +183,4 @@ def V3(names, threshold):
 
 V3_th1_veto = V3Hypo("V3_th1_veto")
 V3_th1_veto.UpperLimit=True
-V3_th1_veto.QThresholds = [
-    0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
-    0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
-    0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
-    0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
-    0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
-    0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
-    0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]
+V3_th1_veto.QThresholds = generateVnThresholds(0.0118349, 0.00241723, 0.000276767, _EtCuts_v3)
-- 
GitLab