Functions | Variables
drawSensitivitySummaries Namespace Reference

Functions

def GetMedian (histo)
 
def GetPercentile (histo, X)
 
def GetPercentileCheck (histo, X)
 
def GetFractionAtMoreThanXSigma (histo, X)
 
def GetMinimum (histo)
 

Variables

bool use_realistic_powers = True
 
int sigma = 3
 
list energies = [20,30,40,50,60,70,80,90,100,120,130]
 
 energies_array = array.array('d',energies)
 
list nh_cp_medians = [[],[],[]]
 
list ih_cp_medians = [[],[],[]]
 
list nh_cp_75thpercentiles = [[],[],[]]
 
list ih_cp_75thpercentiles = [[],[],[]]
 
list nh_cp_3sigmafracs = [[],[],[]]
 
list ih_cp_3sigmafracs = [[],[],[]]
 
list nh_cp_5sigmafracs = [[],[],[]]
 
list ih_cp_5sigmafracs = [[],[],[]]
 
list nh_mh_minimums = [[],[],[]]
 
list ih_mh_minimums = [[],[],[]]
 
 nh_cp_file = ROOT.TFile("/lbne/data/users/lblpwg_tools/FastMC_Data/outputs/ljf26/Sensitivity_Plots/ProtonP"+str(energy)+"GeV_nh_cp_histos.root");
 
 ih_cp_file = ROOT.TFile("/lbne/data/users/lblpwg_tools/FastMC_Data/outputs/ljf26/Sensitivity_Plots/ProtonP"+str(energy)+"GeV_ih_cp_histos.root");
 
 nh_mh_file = ROOT.TFile("/lbne/data/users/lblpwg_tools/FastMC_Data/outputs/ljf26/Sensitivity_Plots/ProtonP"+str(energy)+"GeV_nh_mh_histos.root");
 
 ih_mh_file = ROOT.TFile("/lbne/data/users/lblpwg_tools/FastMC_Data/outputs/ljf26/Sensitivity_Plots/ProtonP"+str(energy)+"GeV_ih_mh_histos.root");
 
 c_nh_cp_m = ROOT.TCanvas("nh_cp_m");
 
 c_ih_cp_m = ROOT.TCanvas("ih_cp_m");
 
 c_nh_cp_p = ROOT.TCanvas("nh_cp_p");
 
 c_ih_cp_p = ROOT.TCanvas("ih_cp_p");
 
 c_nh_cp_3 = ROOT.TCanvas("nh_cp_3");
 
 c_ih_cp_3 = ROOT.TCanvas("ih_cp_3");
 
 c_nh_cp_5 = ROOT.TCanvas("nh_cp_5");
 
 c_ih_cp_5 = ROOT.TCanvas("ih_cp_5");
 
 c_nh_mh = ROOT.TCanvas("nh_mh");
 
 c_ih_mh = ROOT.TCanvas("ih_mh");
 
list nh_cp_mgraphs = []
 
list ih_cp_mgraphs = []
 
list nh_cp_pgraphs = []
 
list ih_cp_pgraphs = []
 
list nh_cp_3graphs = []
 
list ih_cp_3graphs = []
 
list nh_cp_5graphs = []
 
list ih_cp_5graphs = []
 
list nh_mh_mgraphs = []
 
list ih_mh_mgraphs = []
 
list line_styles = [1,2,3]
 
list line_colors = [1,2,4]
 
 temp = ROOT.TGraph(len(energies),energies_array,array.array('d',nh_cp_medians[i]));
 
 leg = ROOT.TLegend(0.45,0.2,0.85,0.45);
 

Function Documentation

def drawSensitivitySummaries.GetFractionAtMoreThanXSigma (   histo,
  X 
)

Definition at line 50 of file drawSensitivitySummaries.py.

51  n = histo.GetNbinsX();
52 
53  greaterThanX = 0.0;
54  total = 0.0;
55 
56  for i in range(0,n):
57  total = total + float(histo.GetBinWidth(i+1));
58  if(histo.GetBinContent(i+1)>=X):
59  greaterThanX = greaterThanX + float(histo.GetBinWidth(i+1));
60 
61  return greaterThanX/total;
62 
63 
if(!yymsg) yymsg
def drawSensitivitySummaries.GetMedian (   histo)

Definition at line 5 of file drawSensitivitySummaries.py.

5 def GetMedian(histo):
6  n = histo.GetNbinsX();
7  x = []
8  y = []
9 
10  for i in range(0,n):
11  x.append(histo.GetBinCenter(i+1));
12  y.append(histo.GetBinContent(i+1));
13  y_array = array.array('d',y)
14 
15  return ROOT.TMath.Median(n,y_array);
16 
def drawSensitivitySummaries.GetMinimum (   histo)

Definition at line 64 of file drawSensitivitySummaries.py.

64 def GetMinimum(histo):
65  min = 99999
66  for i in range(0,histo.GetNbinsX()):
67  if histo.GetBinContent(i+1) < min:
68  min = histo.GetBinContent(i+1)
69  return min
70 
71 
72 
def drawSensitivitySummaries.GetPercentile (   histo,
  X 
)

Definition at line 17 of file drawSensitivitySummaries.py.

17 def GetPercentile(histo,X):
18  n = histo.GetNbinsX();
19  x = []
20  y = []
21 
22  for i in range(0,n):
23  x.append(histo.GetBinCenter(i+1));
24  y.append(histo.GetBinContent(i+1));
25  y_array = array.array('d',y)
26 
27  percentiles = array.array('d',[0.0]);
28  probs = array.array('d',[1-float(X)/100.0])
29 
30  ROOT.TMath.Quantiles(n,1,y_array,percentiles,probs,False);
31  return percentiles[0]
32 
def drawSensitivitySummaries.GetPercentileCheck (   histo,
  X 
)

Definition at line 33 of file drawSensitivitySummaries.py.

33 def GetPercentileCheck(histo,X):
34  n = histo.GetNbinsX();
35  x = []
36  y = []
37 
38  for i in range(0,n):
39  x.append(histo.GetBinCenter(i+1));
40  y.append(histo.GetBinContent(i+1));
41  y.sort()
42  print y
43  pos = float(100-X)/100.0 * n;
44  if ROOT.TMath.Floor(pos)==pos:
45  return y[pos]
46  else:
47  i = ROOT.TMath.FloorNint(pos)
48  return (y[i]+y[i+1])/2
49 

Variable Documentation

drawSensitivitySummaries.c_ih_cp_3 = ROOT.TCanvas("ih_cp_3");

Definition at line 156 of file drawSensitivitySummaries.py.

drawSensitivitySummaries.c_ih_cp_5 = ROOT.TCanvas("ih_cp_5");

Definition at line 158 of file drawSensitivitySummaries.py.

drawSensitivitySummaries.c_ih_cp_m = ROOT.TCanvas("ih_cp_m");

Definition at line 152 of file drawSensitivitySummaries.py.

drawSensitivitySummaries.c_ih_cp_p = ROOT.TCanvas("ih_cp_p");

Definition at line 154 of file drawSensitivitySummaries.py.

drawSensitivitySummaries.c_ih_mh = ROOT.TCanvas("ih_mh");

Definition at line 161 of file drawSensitivitySummaries.py.

drawSensitivitySummaries.c_nh_cp_3 = ROOT.TCanvas("nh_cp_3");

Definition at line 155 of file drawSensitivitySummaries.py.

drawSensitivitySummaries.c_nh_cp_5 = ROOT.TCanvas("nh_cp_5");

Definition at line 157 of file drawSensitivitySummaries.py.

drawSensitivitySummaries.c_nh_cp_m = ROOT.TCanvas("nh_cp_m");

Definition at line 151 of file drawSensitivitySummaries.py.

drawSensitivitySummaries.c_nh_cp_p = ROOT.TCanvas("nh_cp_p");

Definition at line 153 of file drawSensitivitySummaries.py.

drawSensitivitySummaries.c_nh_mh = ROOT.TCanvas("nh_mh");

Definition at line 160 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.energies = [20,30,40,50,60,70,80,90,100,120,130]

Definition at line 75 of file drawSensitivitySummaries.py.

drawSensitivitySummaries.energies_array = array.array('d',energies)

Definition at line 76 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.ih_cp_3graphs = []

Definition at line 168 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.ih_cp_3sigmafracs = [[],[],[]]

Definition at line 83 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.ih_cp_5graphs = []

Definition at line 170 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.ih_cp_5sigmafracs = [[],[],[]]

Definition at line 85 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.ih_cp_75thpercentiles = [[],[],[]]

Definition at line 81 of file drawSensitivitySummaries.py.

drawSensitivitySummaries.ih_cp_file = ROOT.TFile("/lbne/data/users/lblpwg_tools/FastMC_Data/outputs/ljf26/Sensitivity_Plots/ProtonP"+str(energy)+"GeV_ih_cp_histos.root");

Definition at line 110 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.ih_cp_medians = [[],[],[]]

Definition at line 79 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.ih_cp_mgraphs = []

Definition at line 164 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.ih_cp_pgraphs = []

Definition at line 166 of file drawSensitivitySummaries.py.

drawSensitivitySummaries.ih_mh_file = ROOT.TFile("/lbne/data/users/lblpwg_tools/FastMC_Data/outputs/ljf26/Sensitivity_Plots/ProtonP"+str(energy)+"GeV_ih_mh_histos.root");

Definition at line 138 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.ih_mh_mgraphs = []

Definition at line 172 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.ih_mh_minimums = [[],[],[]]

Definition at line 87 of file drawSensitivitySummaries.py.

drawSensitivitySummaries.leg = ROOT.TLegend(0.45,0.2,0.85,0.45);

Definition at line 336 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.line_colors = [1,2,4]

Definition at line 175 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.line_styles = [1,2,3]

Definition at line 174 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.nh_cp_3graphs = []

Definition at line 167 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.nh_cp_3sigmafracs = [[],[],[]]

Definition at line 82 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.nh_cp_5graphs = []

Definition at line 169 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.nh_cp_5sigmafracs = [[],[],[]]

Definition at line 84 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.nh_cp_75thpercentiles = [[],[],[]]

Definition at line 80 of file drawSensitivitySummaries.py.

drawSensitivitySummaries.nh_cp_file = ROOT.TFile("/lbne/data/users/lblpwg_tools/FastMC_Data/outputs/ljf26/Sensitivity_Plots/ProtonP"+str(energy)+"GeV_nh_cp_histos.root");

Definition at line 90 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.nh_cp_medians = [[],[],[]]

Definition at line 78 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.nh_cp_mgraphs = []

Definition at line 163 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.nh_cp_pgraphs = []

Definition at line 165 of file drawSensitivitySummaries.py.

drawSensitivitySummaries.nh_mh_file = ROOT.TFile("/lbne/data/users/lblpwg_tools/FastMC_Data/outputs/ljf26/Sensitivity_Plots/ProtonP"+str(energy)+"GeV_nh_mh_histos.root");

Definition at line 130 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.nh_mh_mgraphs = []

Definition at line 171 of file drawSensitivitySummaries.py.

list drawSensitivitySummaries.nh_mh_minimums = [[],[],[]]

Definition at line 86 of file drawSensitivitySummaries.py.

int drawSensitivitySummaries.sigma = 3

Definition at line 73 of file drawSensitivitySummaries.py.

drawSensitivitySummaries.temp = ROOT.TGraph(len(energies),energies_array,array.array('d',nh_cp_medians[i]));

Definition at line 178 of file drawSensitivitySummaries.py.

bool drawSensitivitySummaries.use_realistic_powers = True

Definition at line 3 of file drawSensitivitySummaries.py.