Functions | Variables
drawSensitivitySummaries_simplevars Namespace Reference

Functions

def myfunc (x, par)
 
def GetPercentile (histo, X)
 
def GetMinimum (histo)
 
def GetFractionAtMoreThanXSigma (histo, X)
 

Variables

bool use_realistic_powers = True
 
bool use_fixed_scale = True
 
list tempgraphs = []
 
list amounts_varied = [0,50,90,200,500]
 
list modes = ["fhc","rhc"]
 
list nus = ["numu","numubar","nuenuebar"]
 
list vars = ["0to0p5GeVPlus10per","0p5to1GeVPlus10per","1to2GeVPlus10per","2to3GeVPlus10per","3to4GeVPlus10per","4to5GeVPlus10per","5to6GeVPlus10per","6to7GeVPlus10per","7to8GeVPlus10per","8to9GeVPlus10per","9to10GeVPlus10per","10to15GeVPlus10per","15to20GeVPlus10per","20to120GeVPlus10per"]
 
list bin_centers = [0.25,0.75,1.5,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5,12.5,17.5]
 
 bin_centers_array = array.array('d',bin_centers)
 
list hierarchies = ["nh","ih"]
 
list plotvars = ["cp_75thpercentile","mh_minimum"]
 
 outfile = ROOT.TFile("temp.root","RECREATE");
 
list medians = [[],[],[]]
 
list baseline_medians = []
 
 mixing_param = plotvar[0:2]
 
 baseline_file = ROOT.TFile("/lbne/data/users/lblpwg_tools/FastMC_Data/outputs/ljf26/Sensitivity_Plots/ProtonP120GeV_"+hierarchy+"_"+mixing_param+"_histos.root");
 
 var = vars[i]+str(amount_varied)
 
string file_prefix = mode+nu+var+"_"
 
 t_file = ROOT.TFile("/lbne/data/users/lblpwg_tools/FastMC_Data/outputs/ljf26/Sensitivity_Plots/"+file_prefix+"_histos.root");
 
 c1 = ROOT.TCanvas(file_prefix);
 
list t_graphs = []
 
list line_styles = [1,2,3]
 
list line_colors = [1,2,4]
 
 temp = ROOT.TGraph(len(bin_centers_array),bin_centers_array,array.array('d',medians[i]));
 
string nu_string = "#nu_{#mu}"
 
 leg = ROOT.TLegend(0.45,0.3,0.85,0.55);
 
list sensitivity_changes = []
 
list flux_changes = []
 
 variation = amounts_varied[variation_iter]
 
 temp_file = ROOT.TFile("/lbne/data/users/ljf26/fluxfiles/sensitivity_comps_"+str(variation)+"_2Feb2015.root");
 
 mygraph = temp_file.Get(plotvar+"_"+mode+"_"+nu+"_"+hierarchy)
 
list temps = []
 
list lines = []
 
list tempfuncs = []
 
int xlow = -20
 
int xhigh = 600
 
int maximum = 1
 
int minimum = 1
 
 myrange = ROOT.TMath.Max(ROOT.TMath.Abs(maximum),ROOT.TMath.Abs(minimum));
 
 title = ROOT.gPad.GetPrimitive("title");
 
int iter_100 = -1
 
int iter_110 = -1
 
tuple slope = (sensitivity_changes[bin_iter][iter_110]-sensitivity_changes[bin_iter][iter_100])/(flux_changes[bin_iter][iter_110]-flux_changes[bin_iter][iter_100]);
 
 y_int = sensitivity_changes[bin_iter][iter_110]-slope*flux_changes[bin_iter][iter_110];
 
 ylow_line = slope*xlow+y_int
 
 yhigh_line = slope*xhigh+y_int
 
 xlow_line = xlow
 
 xhigh_line = xhigh
 
string scale_string = "fixedScale"
 

Function Documentation

def drawSensitivitySummaries_simplevars.GetFractionAtMoreThanXSigma (   histo,
  X 
)

Definition at line 49 of file drawSensitivitySummaries_simplevars.py.

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

Definition at line 42 of file drawSensitivitySummaries_simplevars.py.

42 def GetMinimum(histo):
43  min = 99999
44  for i in range(0,histo.GetNbinsX()):
45  if histo.GetBinContent(i+1) < min:
46  min = histo.GetBinContent(i+1)
47  return min
48 
def drawSensitivitySummaries_simplevars.GetPercentile (   histo,
  X 
)

Definition at line 13 of file drawSensitivitySummaries_simplevars.py.

13 def GetPercentile(histo,X):
14  n = histo.GetNbinsX();
15  x = []
16  y = []
17 
18  for i in range(0,n):
19  x.append(histo.GetBinCenter(i+1));
20  y.append(histo.GetBinContent(i+1));
21  y_array = array.array('d',y)
22 
23  percentiles = array.array('d',[0.0]);
24  probs = array.array('d',[1-float(X)/100.0])
25 
26  ROOT.TMath.Quantiles(n,1,y_array,percentiles,probs,False);
27  return percentiles[0]
28 
29 
30 
31  n = histo.GetNbinsX();
32  x = []
33  y = []
34 
35  for i in range(0,n):
36  x.append(histo.GetBinCenter(i+1));
37  y.append(histo.GetBinContent(i+1));
38  y_array = array.array('d',y)
39 
40  return ROOT.TMath.Median(n,y_array);
41 
def drawSensitivitySummaries_simplevars.myfunc (   x,
  par 
)

Definition at line 10 of file drawSensitivitySummaries_simplevars.py.

10 def myfunc(x, par):
11  return tempgraphs[int(par[0])].Eval(x[0]);
12 

Variable Documentation

list drawSensitivitySummaries_simplevars.amounts_varied = [0,50,90,200,500]

Definition at line 63 of file drawSensitivitySummaries_simplevars.py.

drawSensitivitySummaries_simplevars.baseline_file = ROOT.TFile("/lbne/data/users/lblpwg_tools/FastMC_Data/outputs/ljf26/Sensitivity_Plots/ProtonP120GeV_"+hierarchy+"_"+mixing_param+"_histos.root");

Definition at line 89 of file drawSensitivitySummaries_simplevars.py.

list drawSensitivitySummaries_simplevars.baseline_medians = []

Definition at line 87 of file drawSensitivitySummaries_simplevars.py.

list drawSensitivitySummaries_simplevars.bin_centers = [0.25,0.75,1.5,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5,12.5,17.5]

Definition at line 70 of file drawSensitivitySummaries_simplevars.py.

drawSensitivitySummaries_simplevars.bin_centers_array = array.array('d',bin_centers)

Definition at line 71 of file drawSensitivitySummaries_simplevars.py.

drawSensitivitySummaries_simplevars.c1 = ROOT.TCanvas(file_prefix);

Definition at line 152 of file drawSensitivitySummaries_simplevars.py.

string drawSensitivitySummaries_simplevars.file_prefix = mode+nu+var+"_"

Definition at line 117 of file drawSensitivitySummaries_simplevars.py.

list drawSensitivitySummaries_simplevars.flux_changes = []

Definition at line 246 of file drawSensitivitySummaries_simplevars.py.

list drawSensitivitySummaries_simplevars.hierarchies = ["nh","ih"]

Definition at line 72 of file drawSensitivitySummaries_simplevars.py.

drawSensitivitySummaries_simplevars.iter_100 = -1

Definition at line 318 of file drawSensitivitySummaries_simplevars.py.

drawSensitivitySummaries_simplevars.iter_110 = -1

Definition at line 319 of file drawSensitivitySummaries_simplevars.py.

drawSensitivitySummaries_simplevars.leg = ROOT.TLegend(0.45,0.3,0.85,0.55);

Definition at line 202 of file drawSensitivitySummaries_simplevars.py.

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

Definition at line 157 of file drawSensitivitySummaries_simplevars.py.

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

Definition at line 156 of file drawSensitivitySummaries_simplevars.py.

list drawSensitivitySummaries_simplevars.lines = []

Definition at line 266 of file drawSensitivitySummaries_simplevars.py.

float drawSensitivitySummaries_simplevars.maximum = 1

Definition at line 279 of file drawSensitivitySummaries_simplevars.py.

list drawSensitivitySummaries_simplevars.medians = [[],[],[]]

Definition at line 85 of file drawSensitivitySummaries_simplevars.py.

float drawSensitivitySummaries_simplevars.minimum = 1

Definition at line 280 of file drawSensitivitySummaries_simplevars.py.

drawSensitivitySummaries_simplevars.mixing_param = plotvar[0:2]

Definition at line 88 of file drawSensitivitySummaries_simplevars.py.

list drawSensitivitySummaries_simplevars.modes = ["fhc","rhc"]

Definition at line 65 of file drawSensitivitySummaries_simplevars.py.

drawSensitivitySummaries_simplevars.mygraph = temp_file.Get(plotvar+"_"+mode+"_"+nu+"_"+hierarchy)

Definition at line 259 of file drawSensitivitySummaries_simplevars.py.

drawSensitivitySummaries_simplevars.myrange = ROOT.TMath.Max(ROOT.TMath.Abs(maximum),ROOT.TMath.Abs(minimum));

Definition at line 287 of file drawSensitivitySummaries_simplevars.py.

string drawSensitivitySummaries_simplevars.nu_string = "#nu_{#mu}"

Definition at line 163 of file drawSensitivitySummaries_simplevars.py.

list drawSensitivitySummaries_simplevars.nus = ["numu","numubar","nuenuebar"]

Definition at line 66 of file drawSensitivitySummaries_simplevars.py.

drawSensitivitySummaries_simplevars.outfile = ROOT.TFile("temp.root","RECREATE");

Definition at line 79 of file drawSensitivitySummaries_simplevars.py.

list drawSensitivitySummaries_simplevars.plotvars = ["cp_75thpercentile","mh_minimum"]

Definition at line 74 of file drawSensitivitySummaries_simplevars.py.

string drawSensitivitySummaries_simplevars.scale_string = "fixedScale"

Definition at line 352 of file drawSensitivitySummaries_simplevars.py.

list drawSensitivitySummaries_simplevars.sensitivity_changes = []

Definition at line 245 of file drawSensitivitySummaries_simplevars.py.

tuple drawSensitivitySummaries_simplevars.slope = (sensitivity_changes[bin_iter][iter_110]-sensitivity_changes[bin_iter][iter_100])/(flux_changes[bin_iter][iter_110]-flux_changes[bin_iter][iter_100]);

Definition at line 328 of file drawSensitivitySummaries_simplevars.py.

drawSensitivitySummaries_simplevars.t_file = ROOT.TFile("/lbne/data/users/lblpwg_tools/FastMC_Data/outputs/ljf26/Sensitivity_Plots/"+file_prefix+"_histos.root");

Definition at line 119 of file drawSensitivitySummaries_simplevars.py.

list drawSensitivitySummaries_simplevars.t_graphs = []

Definition at line 154 of file drawSensitivitySummaries_simplevars.py.

drawSensitivitySummaries_simplevars.temp = ROOT.TGraph(len(bin_centers_array),bin_centers_array,array.array('d',medians[i]));

Definition at line 161 of file drawSensitivitySummaries_simplevars.py.

drawSensitivitySummaries_simplevars.temp_file = ROOT.TFile("/lbne/data/users/ljf26/fluxfiles/sensitivity_comps_"+str(variation)+"_2Feb2015.root");

Definition at line 258 of file drawSensitivitySummaries_simplevars.py.

list drawSensitivitySummaries_simplevars.tempfuncs = []

Definition at line 267 of file drawSensitivitySummaries_simplevars.py.

list drawSensitivitySummaries_simplevars.tempgraphs = []

Definition at line 7 of file drawSensitivitySummaries_simplevars.py.

list drawSensitivitySummaries_simplevars.temps = []

Definition at line 265 of file drawSensitivitySummaries_simplevars.py.

drawSensitivitySummaries_simplevars.title = ROOT.gPad.GetPrimitive("title");

Definition at line 308 of file drawSensitivitySummaries_simplevars.py.

bool drawSensitivitySummaries_simplevars.use_fixed_scale = True

Definition at line 5 of file drawSensitivitySummaries_simplevars.py.

bool drawSensitivitySummaries_simplevars.use_realistic_powers = True

Definition at line 3 of file drawSensitivitySummaries_simplevars.py.

drawSensitivitySummaries_simplevars.var = vars[i]+str(amount_varied)

Definition at line 114 of file drawSensitivitySummaries_simplevars.py.

drawSensitivitySummaries_simplevars.variation = amounts_varied[variation_iter]

Definition at line 252 of file drawSensitivitySummaries_simplevars.py.

list drawSensitivitySummaries_simplevars.vars = ["0to0p5GeVPlus10per","0p5to1GeVPlus10per","1to2GeVPlus10per","2to3GeVPlus10per","3to4GeVPlus10per","4to5GeVPlus10per","5to6GeVPlus10per","6to7GeVPlus10per","7to8GeVPlus10per","8to9GeVPlus10per","9to10GeVPlus10per","10to15GeVPlus10per","15to20GeVPlus10per","20to120GeVPlus10per"]

Definition at line 68 of file drawSensitivitySummaries_simplevars.py.

int drawSensitivitySummaries_simplevars.xhigh = 600

Definition at line 274 of file drawSensitivitySummaries_simplevars.py.

tuple drawSensitivitySummaries_simplevars.xhigh_line = xhigh

Definition at line 333 of file drawSensitivitySummaries_simplevars.py.

int drawSensitivitySummaries_simplevars.xlow = -20

Definition at line 273 of file drawSensitivitySummaries_simplevars.py.

tuple drawSensitivitySummaries_simplevars.xlow_line = xlow

Definition at line 332 of file drawSensitivitySummaries_simplevars.py.

drawSensitivitySummaries_simplevars.y_int = sensitivity_changes[bin_iter][iter_110]-slope*flux_changes[bin_iter][iter_110];

Definition at line 329 of file drawSensitivitySummaries_simplevars.py.

float drawSensitivitySummaries_simplevars.yhigh_line = slope*xhigh+y_int

Definition at line 331 of file drawSensitivitySummaries_simplevars.py.

float drawSensitivitySummaries_simplevars.ylow_line = slope*xlow+y_int

Definition at line 330 of file drawSensitivitySummaries_simplevars.py.