In [ ]:
import os
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from astropy.coordinates import SkyCoord
from scipy.interpolate import spline
import ROOT
from ROOT import TFile, gROOT, gSystem, TGraphAsymmErrors
import rootnotes
import rootprint
In [ ]:
%%rootprint
rootPath=os.path.expandvars("$VEGAS")
gSystem.Load("libTreePlayer.so");
gSystem.Load("libPhysics.so");
gSystem.Load(rootPath + "/common/lib/libSP24sharedLite.so");
gSystem.Load(rootPath + "/resultsExtractor/lib/libStage6shared.so");
gSystem.Load(rootPath + "/showerReconstruction2/lib/libStage4.so");
gSystem.AddIncludePath("-Wno-unused -Wno-shadow -Wno-unused-parameter");
gROOT.ProcessLine(".L " + rootPath + "/common/include/VACommon.h");
gROOT.ProcessLine(".include " + rootPath + "/common/include/");
gROOT.ProcessLine(".include " + rootPath + "/resultsExtractor/include/");
In [ ]:
azimuth = 135
noise = 7.27
In [ ]:
filename = "/DataDrive/tables/ea_disp5t_Oct2012_ua_ATM22_GrISUDet_vegas254_7sam_050wobb_LZA_std_d1p38_MSW1p1_MSL1p3_MH7_ThetaSq0p01_Deny2.root"
eaF = TFile(filename, "read")
ea = eaF.Get("effective_areas/EffectiveArea_Azimuth_135_Zenith_65_Noise_7.27")
h = ea.pfEffArea_MC
npoints = h.GetN()
x1, y1 = [], []
for i in range(npoints):
tmpX, tmpY = ROOT.Double(0), ROOT.Double(0)
h.GetPoint(i, tmpX, tmpY)
x1.append(tmpX)
y1.append(tmpY)
x1 = np.array(x1)
y1 = np.array(y1)
In [ ]:
filename = "/DataDrive/tables/ea_Oct2012_ua_ATM22_vegasv250rc5_7sam_Alloff_s700t2_std_MSW1p1_MSL1p3_MH7_ThetaSq0p01_LZA.root"
eaF = TFile(filename, "read")
ea = eaF.Get("effective_areas/EffectiveArea_Azimuth_0_Zenith_0_Noise_7.27_AbsoluteOffset_0.5")
h = ea.pfEffArea_MC
npoints = h.GetN()
x2, y2 = [], []
for i in range(npoints):
tmpX, tmpY = ROOT.Double(0), ROOT.Double(0)
h.GetPoint(i, tmpX, tmpY)
x2.append(tmpX)
y2.append(tmpY)
x2 = np.array(x2)
y2 = np.array(y2)
In [ ]:
x1_smooth = np.linspace(x1.min(), x1.max(), 200)
order = 3
y1_smooth = spline(x1, y1, x1_smooth, order=order)
y2_smooth = spline(x2, y2, x1_smooth, order=order)
In [ ]:
plt.plot(x1_smooth, y2_smooth, ls="-", marker="", color="green", label="0")
plt.plot(x1_smooth, y1_smooth, ls="-", marker="", color="blue", label="65")
plt.semilogy(nonposy="clip")
plt.title("Effective Area vs Energy")
plt.xlabel("Energy [TeV]")
plt.ylabel(r"Effective Area [m$^2$]")
plt.xlim(xmin=0.05)
plt.ylim(ymin=10, ymax=6e5)
plt.legend(loc='center left', bbox_to_anchor=(1., 0.5))
x = np.linspace(-2, 2, 5)
labels = pow(10, x)
t = plt.xticks(x, labels)
In [ ]:
plt.plot(x1_smooth, y1_smooth, ls="-", marker="", color="blue", label="LZA")
plt.plot(x1_smooth, y2_smooth, ls="-", marker="", color="green", label="SZA")
plt.semilogy(nonposy="clip")
plt.title("Effective Area vs Energy")
plt.xlabel("Energy [TeV]")
plt.ylabel(r"Effective Area [m$^2$]")
plt.xlim(xmin=0.05)
plt.ylim(ymin=10, ymax=6e5)
plt.legend(loc='center left', bbox_to_anchor=(1., 0.5))
x = np.linspace(-2, 2, 5)
labels = pow(10, x)
t = plt.xticks(x, labels)
In [ ]:
%%rootprint
eaF.ls()
In [ ]: