Namespaces | Functions | Variables
makeFocusingCovariance.py File Reference

Go to the source code of this file.

Namespaces

 makeFocusingCovariance
 

Functions

def makeFocusingCovariance.GetCorrelation (cov_matrix)
 

Variables

bool makeFocusingCovariance.small_bins = False
 
string makeFocusingCovariance.beam_config = "opt"
 
list makeFocusingCovariance.shifts = []
 
list makeFocusingCovariance.cv = []
 
list makeFocusingCovariance.uncertainties = ["HornCurrent","WaterThickness","DecayPipeRadius","Horn1XShift","Horn1XTilt"]
 
list makeFocusingCovariance.uncertainty_titles = ["Horn Current","Water Layer","Decay Pipe Radius","Horn 1 Trans. Offset","Horn 1 Tilt"]
 
string makeFocusingCovariance.indir = "/dune/app/users/pmadigan/beam_sim/ToleranceStudy/"
 
list makeFocusingCovariance.files = ["table_ND_numu.csv","table_ND_numubar.csv","table_ND_nue.csv","table_ND_nuebar.csv","table_ND_numubar.csv","table_ND_numu.csv","table_ND_nuebar.csv","table_ND_nue.csv","table_FD_numu.csv","table_FD_numubar.csv","table_FD_nue.csv","table_FD_nuebar.csv","table_FD_numubar.csv","table_FD_numu.csv","table_FD_nuebar.csv","table_FD_nue.csv"]
 
 makeFocusingCovariance.f_temp = open(indir+afile)
 
 makeFocusingCovariance.lines = f_temp.readlines()
 
 makeFocusingCovariance.temp = lines[i].split(",")[7:]
 
int makeFocusingCovariance.line_iter = -1
 
float makeFocusingCovariance.scale = 1.0
 
list makeFocusingCovariance.temp_2 = []
 
int makeFocusingCovariance.nbins = 7
 
tuple makeFocusingCovariance.new_shift = (temp[12]/100*cv[12]+temp[13]/100*cv[13])/(cv[12]+cv[13])
 
list makeFocusingCovariance.temp_uncertainties = ["Target","BeamSigma","BeamOffsetX","TargetDensity"]
 
list makeFocusingCovariance.sigmas = ["0p5mm","1p7mm","0p5mm","1p8156gcm3"]
 
 makeFocusingCovariance.unc_iter2 = temp_uncertainties.index(uncertainty)
 
list makeFocusingCovariance.detectors = ["ND","FD"]
 
list makeFocusingCovariance.modes = ["neutrino","antineutrino"]
 
list makeFocusingCovariance.flavors = ["numu","numubar","nue","nuebar"]
 
 makeFocusingCovariance.varied_file = ROOT.TFile("/dune/data/users/ljf26/fluxfiles/g4lbne/v3r4p3/QGSP_BERT/CP_run15_12388_80GeV_"+uncertainty+sigmas[unc_iter2]+"/"+mode+"/flux/histos_g4lbne_v3r4p3_QGSP_BERT_CP_run15_12388_80GeV_"+uncertainty+sigmas[unc_iter2]+"_"+mode+"_LBNE"+detector+"_fastmc.root")
 
 makeFocusingCovariance.varied_histo = varied_file.Get(flavor+"_flux")
 
 makeFocusingCovariance.nominal_file = ROOT.TFile("/dune/data/users/ljf26/fluxfiles/g4lbne/v3r4p2/QGSP_BERT/CP_run15_12388_80GeV/"+mode+"/flux/histos_g4lbne_v3r4p2_QGSP_BERT_CP_run15_12388_80GeV_"+mode+"_LBNE"+detector+"_fastmc.root")
 
 makeFocusingCovariance.nominal_histo = nominal_file.Get(flavor+"_flux")
 
list makeFocusingCovariance.varied_bins = [0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,7 ,8,12,16,20,40,100]
 
 makeFocusingCovariance.baffle_scraping_file = ROOT.TFile("/dune/data/users/ljf26/fluxfiles/g4lbne/v3r4p3/QGSP_BERT/CP_run15_12388_80GeV_BaffleScraping/"+mode+"/flux/histos_g4lbne_v3r4p3_QGSP_BERT_CP_run15_12388_80GeV_BaffleScraping_"+mode+"_LBNE"+detector+"_fastmc.root")
 
 makeFocusingCovariance.baffle_scraping_histo = baffle_scraping_file.Get(flavor+"_flux")
 
list makeFocusingCovariance.baffle_bins = [0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,7 ,8,12,16,20,40,100]
 
 makeFocusingCovariance.unc_iter = uncertainties.index(uncertainty)
 
 makeFocusingCovariance.error = ROOT.TH1D("Focusing_Error","Focusing_Error",nbins,0.5,nbins+0.5)
 
 makeFocusingCovariance.covariance = ROOT.TH2D("Focusing_Covariance","Focusing_Covariance",nbins,0.5,nbins+0.5,nbins,0.5,nbins+0.5)
 
 makeFocusingCovariance.c1 = ROOT.TCanvas("c1","",1000,800)
 
 makeFocusingCovariance.latex0 = ROOT.TLatex( 0.5, 0.93, "Flux Alignment Fractional Covariance Matrix" );
 
 makeFocusingCovariance.latex1 = ROOT.TLatex( 0.24, 0.035, "Near Detector" );
 
 makeFocusingCovariance.latex2 = latex1.Clone()
 
 makeFocusingCovariance.latex3 = latex1.Clone()
 
 makeFocusingCovariance.latex4 = latex1.Clone()
 
 makeFocusingCovariance.latex5 = ROOT.TLatex(0.2,0.08,"#nu Mode")
 
 makeFocusingCovariance.latex6 = latex5.Clone()
 
 makeFocusingCovariance.latex7 = latex5.Clone()
 
 makeFocusingCovariance.latex8 = latex5.Clone()
 
 makeFocusingCovariance.latex9 = ROOT.TLatex(0.085,0.21,"#nu Mode")
 
 makeFocusingCovariance.latex10 = latex9.Clone()
 
 makeFocusingCovariance.latex11 = latex9.Clone()
 
 makeFocusingCovariance.latex12 = latex9.Clone()
 
 makeFocusingCovariance.latex13 = ROOT.TLatex( 0.16, 0.124, "#nu_{#mu}" );
 
 makeFocusingCovariance.latex14 = ROOT.TLatex( 0.225, 0.124, "#bar{#nu}_{#mu}" );
 
 makeFocusingCovariance.latex15 = ROOT.TLatex( 0.27, 0.124, "#nu_{e}" );
 
 makeFocusingCovariance.latex16 = ROOT.TLatex( 0.295, 0.124, "#bar{#nu}_{e}" );
 
 makeFocusingCovariance.latex17 = ROOT.TLatex( 0.34, 0.124, "#nu_{#mu}" );
 
 makeFocusingCovariance.latex18 = ROOT.TLatex( 0.405, 0.124, "#bar{#nu}_{#mu}" );
 
 makeFocusingCovariance.latex19 = ROOT.TLatex( 0.45, 0.124, "#nu_{e}" );
 
 makeFocusingCovariance.latex20 = ROOT.TLatex( 0.475, 0.124, "#bar{#nu}_{e}" );
 
 makeFocusingCovariance.latex21 = ROOT.TLatex( 0.52, 0.124, "#nu_{#mu}" );
 
 makeFocusingCovariance.latex22 = ROOT.TLatex( 0.585, 0.124, "#bar{#nu}_{#mu}" );
 
 makeFocusingCovariance.latex23 = ROOT.TLatex( 0.631, 0.124, "#nu_{e}" );
 
 makeFocusingCovariance.latex24 = ROOT.TLatex( 0.654, 0.124, "#bar{#nu}_{e}" );
 
 makeFocusingCovariance.latex25 = ROOT.TLatex( 0.70, 0.124, "#nu_{#mu}" );
 
 makeFocusingCovariance.latex26 = ROOT.TLatex( 0.77, 0.124, "#bar{#nu}_{#mu}" );
 
 makeFocusingCovariance.latex27 = ROOT.TLatex( 0.81, 0.124, "#nu_{e}" );
 
 makeFocusingCovariance.latex28 = ROOT.TLatex( 0.835, 0.124, "#bar{#nu}_{e}" );
 
 makeFocusingCovariance.latex29 = ROOT.TLatex( 0.11,0.18, "#nu_{#mu}" );
 
 makeFocusingCovariance.latex30 = ROOT.TLatex( 0.11,0.25, "#bar{#nu}_{#mu}" );
 
 makeFocusingCovariance.latex31 = ROOT.TLatex( 0.11,0.295, "#nu_{e}" );
 
 makeFocusingCovariance.latex32 = ROOT.TLatex( 0.11,0.32, "#bar{#nu}_{e}" );
 
 makeFocusingCovariance.latex33 = ROOT.TLatex( 0.11,0.37, "#nu_{#mu}" );
 
 makeFocusingCovariance.latex34 = ROOT.TLatex( 0.11,0.435, "#bar{#nu}_{#mu}" );
 
 makeFocusingCovariance.latex35 = ROOT.TLatex( 0.11,0.48, "#nu_{e}" );
 
 makeFocusingCovariance.latex36 = ROOT.TLatex( 0.11,0.505, "#bar{#nu}_{e}" );
 
 makeFocusingCovariance.latex37 = ROOT.TLatex( 0.11,0.56, "#nu_{#mu}" );
 
 makeFocusingCovariance.latex38 = ROOT.TLatex( 0.11,0.62, "#bar{#nu}_{#mu}" );
 
 makeFocusingCovariance.latex39 = ROOT.TLatex( 0.11,0.67, "#nu_{e}" );
 
 makeFocusingCovariance.latex40 = ROOT.TLatex( 0.11,0.70, "#bar{#nu}_{e}" );
 
 makeFocusingCovariance.latex41 = ROOT.TLatex( 0.11,0.75, "#nu_{#mu}" );
 
 makeFocusingCovariance.latex42 = ROOT.TLatex( 0.11,0.81, "#bar{#nu}_{#mu}" );
 
 makeFocusingCovariance.latex43 = ROOT.TLatex( 0.11,0.855, "#nu_{e}" );
 
 makeFocusingCovariance.latex44 = ROOT.TLatex( 0.11,0.88, "#bar{#nu}_{e}" );
 
list makeFocusingCovariance.line_locations = [19.5,38.5,45.5,52.5,71.5,90.5,97.5,104.5,123.5,142.5,149.5,156.5,175.5,194.5,201.5]
 
 makeFocusingCovariance.line_1 = ROOT.TLine(19.5,0.5,19.5,208)
 
 makeFocusingCovariance.line_2 = ROOT.TLine(38.5,0.5,38.5,208)
 
 makeFocusingCovariance.line_3 = ROOT.TLine(45.5,0.5,45.5,208)
 
 makeFocusingCovariance.line_4 = ROOT.TLine(52.5,0.5,52.5,208)
 
 makeFocusingCovariance.line_5 = ROOT.TLine(71.5,0.5,71.5,208)
 
 makeFocusingCovariance.line_6 = ROOT.TLine(90.5,0.5,90.5,208)
 
 makeFocusingCovariance.line_7 = ROOT.TLine(97.5,0.5,97.5,208)
 
 makeFocusingCovariance.line_8 = ROOT.TLine(104.5,0.5,104.5,208)
 
 makeFocusingCovariance.line_9 = ROOT.TLine(123.5,0.5,123.5,208)
 
 makeFocusingCovariance.line_10 = ROOT.TLine(142.5,0.5,142.5,208)
 
 makeFocusingCovariance.line_11 = ROOT.TLine(149.5,0.5,149.5,208)
 
 makeFocusingCovariance.line_12 = ROOT.TLine(156.5,0.5,156.5,208)
 
 makeFocusingCovariance.line_13 = ROOT.TLine(175.5,0.5,175.5,208)
 
 makeFocusingCovariance.line_14 = ROOT.TLine(194.5,0.5,194.5,208)
 
 makeFocusingCovariance.line_15 = ROOT.TLine(201.5,0.5,201.5,208)
 
 makeFocusingCovariance.lineb_1 = ROOT.TLine(0.5,19.5,208,19.5)
 
 makeFocusingCovariance.lineb_2 = ROOT.TLine(0.5,38.5,208,38.5)
 
 makeFocusingCovariance.lineb_3 = ROOT.TLine(0.5,45.5,208,45.5)
 
 makeFocusingCovariance.lineb_4 = ROOT.TLine(0.5,52.5,208,52.5)
 
 makeFocusingCovariance.lineb_5 = ROOT.TLine(0.5,71.5,208,71.5)
 
 makeFocusingCovariance.lineb_6 = ROOT.TLine(0.5,90.5,208,90.5)
 
 makeFocusingCovariance.lineb_7 = ROOT.TLine(0.5,97.5,208,97.5)
 
 makeFocusingCovariance.lineb_8 = ROOT.TLine(0.5,104.5,208,104.5)
 
 makeFocusingCovariance.lineb_9 = ROOT.TLine(0.5,123.5,208,123.5)
 
 makeFocusingCovariance.lineb_10 = ROOT.TLine(0.5,142.5,208,142.5)
 
 makeFocusingCovariance.lineb_11 = ROOT.TLine(0.5,149.5,208,149.5)
 
 makeFocusingCovariance.lineb_12 = ROOT.TLine(0.5,156.5,208,156.5)
 
 makeFocusingCovariance.lineb_13 = ROOT.TLine(0.5,175.5,208,175.5)
 
 makeFocusingCovariance.lineb_14 = ROOT.TLine(0.5,194.5,208,194.5)
 
 makeFocusingCovariance.lineb_15 = ROOT.TLine(0.5,201.5,208,201.5)
 
int makeFocusingCovariance.NRGBs = 3
 
int makeFocusingCovariance.NCont = 999
 
list makeFocusingCovariance.stops = [ 0.00, 0.50, 1.00];
 
list makeFocusingCovariance.red = [ 0.00, 1.00, 1.00];
 
list makeFocusingCovariance.green = [ 0.00, 1.00, 0.00];
 
list makeFocusingCovariance.blue = [ 1.00, 1.00, 0.00];
 
 makeFocusingCovariance.correlation = GetCorrelation(covariance)
 
string makeFocusingCovariance.small_bins_string = ""
 
 makeFocusingCovariance.f = ROOT.TFile("focusing_covariance_"+beam_config+small_bins_string+".root","RECREATE")
 
list makeFocusingCovariance.plots = ["numu_neutrino_ND","numubar_neutrino_ND","nue_neutrino_ND","nuebar_neutrino_ND","numu_antineutrino_ND","numubar_antineutrino_ND","nue_antineutrino_ND","nuebar_antineutrino_ND","numu_neutrino_FD","numubar_neutrino_FD","nue_neutrino_FD","nuebar_neutrino_FD","numu_antineutrino_FD","numubar_antineutrino_FD","nue_antineutrino_FD","nuebar_antineutrino_FD"]
 
list makeFocusingCovariance.start_indices = [0,19,38,45,52,71,90,97,104,123,142,149,156,175,194,201]
 
list makeFocusingCovariance.error_bins = [0,2,4,6,8,10]
 
list makeFocusingCovariance.error_hists = []
 
list makeFocusingCovariance.total_uncertainties = [0]*(len(error_bins)-1)
 
 makeFocusingCovariance.temp_hist = ROOT.TH1D(uncertainty_titles[i],uncertainty_titles[i],len(error_bins)-1,array.array('d',error_bins))
 
list makeFocusingCovariance.colors = [2,ROOT.kOrange+3,6,ROOT.kOrange+7,ROOT.kGreen+2,3,ROOT.kAzure+7,ROOT.kBlue-4,7,ROOT.kViolet+1,13,15,17,19]
 
 makeFocusingCovariance.leg = ROOT.TLegend(0.57,0.5,0.92,0.85)