Public Member Functions | |
def | __init__ |
def | drawPlots |
def | drawCoincidence |
Public Attributes | |
canvases | |
files |
Display output plots in ROOT
Definition at line 3 of file AdViewer.py.
def DataQuality::AdViewer::AdViewer::__init__ | ( | self | ) |
def DataQuality::AdViewer::AdViewer::drawPlots | ( | self, | ||
filename | ||||
) |
Definition at line 9 of file AdViewer.py.
00011 : 00012 from ROOT import TFile, TCanvas, TH1F, TH2F, gStyle 00013 # set some style info 00014 gStyle.SetPalette(1) 00015 00016 # Open the file 00017 plotFile = TFile(filename) 00018 if not plotFile.IsOpen(): 00019 print "drawPlots: Can't open file ",filename 00020 self.files.append(plotFile) 00021 path = "adplotter/DayaBayAD1/" 00022 00023 # Draw hit pmts 00024 hitPmts = plotFile.Get(path+"DayaBayAD1_HitPmts") 00025 c1 = TCanvas("c1") 00026 hitPmts.Draw() 00027 self.canvases.append(c1) 00028 # Draw time between readouts 00029 dtReadout = plotFile.Get(path+"DayaBayAD1_DtReadout") 00030 c2 = TCanvas("c2") 00031 dtReadout.Draw() 00032 self.canvases.append(c2) 00033 # Close-up of short times between readouts 00034 dtReadoutShort = plotFile.Get(path+"DayaBayAD1_DtReadoutShort") 00035 c3 = TCanvas("c3") 00036 dtReadoutShort.Draw() 00037 self.canvases.append(c3) 00038 # ADC values from all channels 00039 adc = plotFile.Get(path+"DayaBayAD1_AdcSpectrum") 00040 c4 = TCanvas("c4") 00041 adc.Draw() 00042 self.canvases.append(c4) 00043 # TDC values from all channels 00044 tdc = plotFile.Get(path+"DayaBayAD1_TdcSpectrum") 00045 c5 = TCanvas("c5") 00046 tdc.Draw() 00047 self.canvases.append(c5) 00048 # Sum of all adc charge in each readout 00049 chargeSum = plotFile.Get(path+"DayaBayAD1_ChargeSum") 00050 c6 = TCanvas("c6") 00051 chargeSum.Draw() 00052 self.canvases.append(c6) 00053 # PMTs hit vs. total charge 00054 hitVsCharge = plotFile.Get(path+"DayaBayAD1_HitPmtVsChargeSum") 00055 c7 = TCanvas("c7") 00056 hitVsCharge.Draw("colz") 00057 self.canvases.append(c7) 00058 # Position of generated vertex 00059 vertexZRho = plotFile.Get(path+"DayaBayAD1_GenVertexZRho") 00060 c8 = TCanvas("c8") 00061 vertexZRho.Draw("colz") 00062 self.canvases.append(c8) return
def DataQuality::AdViewer::AdViewer::drawCoincidence | ( | self, | ||
filename | ||||
) |
Definition at line 63 of file AdViewer.py.
00065 : 00066 from ROOT import TFile, TCanvas, TH1F, TH2F, gStyle, TLine 00067 # set some style info 00068 gStyle.SetPalette(1) 00069 00070 # Open the file 00071 plotFile = TFile(filename) 00072 if not plotFile.IsOpen(): 00073 print "drawCoincidence: Can't open file ",filename 00074 self.files.append(plotFile) 00075 path = "adplotter/DayaBayAD1/" 00076 00077 # Sum of all adc charge in each readout 00078 chargeSum = plotFile.Get(path+"DayaBayAD1_ChargeSum") 00079 c1 = TCanvas("c1") 00080 chargeSum.SetTitle("AD charge singles spectrum for DayaBayAD1") 00081 chargeSum.Draw() 00082 self.canvases.append(c1) 00083 00084 # Draw neutron capture time 00085 dtNeutron = plotFile.Get(path+"DayaBayAD1_DtNeutronCapture") 00086 c2 = TCanvas("c2") 00087 dtNeutron.Draw() 00088 dtNeutron.Fit("expo","LL") 00089 self.canvases.append(c2) 00090 00091 # Draw prompt spectrum 00092 promptE = plotFile.Get(path+"DayaBayAD1_PromptEnergy") 00093 c3 = TCanvas("c3") 00094 promptE.Draw() 00095 self.canvases.append(c3) 00096 00097 # Draw delayed spectrum 00098 delayedE = plotFile.Get(path+"DayaBayAD1_DelayedEnergy") 00099 c4 = TCanvas("c4") 00100 delayedE.Draw() 00101 self.canvases.append(c4) 00102 00103 # Draw delayed vs. prompt spectrum 00104 delayedVsPromptE = plotFile.Get(path+"DayaBayAD1_DelayedVsPromptEnergy") 00105 c5 = TCanvas("c5") 00106 self.canvases.append(c5) 00107 delayedVsPromptE.SetMarkerStyle(8) 00108 delayedVsPromptE.SetMarkerColor(4) 00109 delayedVsPromptE.SetMarkerSize(0.5) 00110 delayedVsPromptE.Draw() 00111 # Draw signal box 00112 line = TLine() 00113 line.SetLineWidth(2) 00114 line.SetLineColor(2) 00115 line.SetLineStyle(2) 00116 line.DrawLine(0.7,6.,0.7,10.) 00117 line.DrawLine(8.0,6.,8.0,10.) 00118 line.DrawLine(0.7,6.,8.0,6.) 00119 line.DrawLine(0.7,10.,8.0,10.) 00120
Definition at line 6 of file AdViewer.py.
Definition at line 7 of file AdViewer.py.