ATLAS Offline Software
Functions | Variables
makeegammaturnon Namespace Reference

Functions

def rebin (binning, data)
 
def rebin2 (binning, data1, data2)
 
def turn_on_curve (all_data, selected_data, bins)
 
def main (path)
 

Variables

 inputfile
 

Function Documentation

◆ main()

def makeegammaturnon.main (   path)

Definition at line 52 of file makeegammaturnon.py.

52 def main(path):
53  myntuple = eFEXNTupleLoader(path)
54  all_e_ET = []
55  selected_e_ET = []
56  for each in myntuple.entries():
57  each.set_class_type("e")
58  if each.is_in_crack(each.leading_l_id()):
59  continue
60  if abs(each.truth_e_eta[each.leading_l_id()]) > 2.3:
61  continue
62  all_e_ET.append(each.truth_e_ET[each.leading_l_id()])
63  matched_tobs = each.get_eg_matchedtob_id()[each.leading_l_id()]
64  selected = False
65  for i in matched_tobs:
66  if not each.eg_haveseed[i]:
67  continue
68  if each.eg_ET[i] <= 22:
69  continue
70  #if 0.025*(each.eg_wstotnum[i]/each.eg_wstotden[i])**0.5 < 0.045:
71  selected = True
72  break
73  if selected:
74  selected_e_ET.append(each.truth_e_ET[each.leading_l_id()])
75 
76  hist_height, bin_centre, hist_error = turn_on_curve(all_e_ET, selected_e_ET, range(0,100,5))
77  histplot([bin_centre], [hist_height], [hist_error], errorbar_limit=1, filename="egammatrunon")
78 
79 

◆ rebin()

def makeegammaturnon.rebin (   binning,
  data 
)

Definition at line 15 of file makeegammaturnon.py.

15 def rebin(binning, data):
16  hist, edge = np.histogram(data, binning)
17  newbin = [edge[0]]
18  total_i = 0
19  for i in range(len(hist)):
20  total_i += hist[i]
21  if total_i > 0:
22  newbin.append(edge[i+1])
23  total_i = 0
24  newbin[-1] = binning[-1]
25  return newbin
26 

◆ rebin2()

def makeegammaturnon.rebin2 (   binning,
  data1,
  data2 
)

Definition at line 27 of file makeegammaturnon.py.

27 def rebin2(binning, data1, data2):
28  hist1, edge = np.histogram(data1, binning)
29  hist2, edge = np.histogram(data2, binning)
30  newbin = [edge[0]]
31  total_1 = 0
32  total_2 = 0
33  for i in range(len(hist1)):
34  total_1 += hist1[i]
35  total_2 += hist2[i]
36  if total_1 > 0 and total_2 > 0:
37  newbin.append(edge[i+1])
38  total_1 = 0
39  total_2 = 0
40  newbin[-1] = binning[-1]
41  return newbin
42 

◆ turn_on_curve()

def makeegammaturnon.turn_on_curve (   all_data,
  selected_data,
  bins 
)

Definition at line 43 of file makeegammaturnon.py.

43 def turn_on_curve(all_data, selected_data, bins):
44  bins = rebin(bins, all_data)
45  hist_all, edges = np.histogram(all_data, bins)
46  hist_selected, edges = np.histogram(selected_data, bins)
47  bin_centre = [(edges[i] + edges[i+1])/2. for i in range(len(edges)-1)]
48  hist_height = hist_selected / hist_all
49  hist_error = ((hist_selected**0.5 / hist_all)**2. + (hist_all**0.5 * hist_selected / hist_all**2.)**2.)**0.5
50  return (hist_height, bin_centre, hist_error)
51 

Variable Documentation

◆ inputfile

makeegammaturnon.inputfile

Definition at line 89 of file makeegammaturnon.py.

makeegammaturnon.main
def main(path)
Definition: makeegammaturnon.py:52
makeegammaturnon.turn_on_curve
def turn_on_curve(all_data, selected_data, bins)
Definition: makeegammaturnon.py:43
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
makeegammaturnon.rebin
def rebin(binning, data)
Definition: makeegammaturnon.py:15
makeegammaturnon.rebin2
def rebin2(binning, data1, data2)
Definition: makeegammaturnon.py:27
plotlib.histplot
def histplot(data_x, data_y, error=None, label=None, **kwargs)
Definition: plotlib.py:17