diff --git a/cflm/RootPlot_1D.py b/cflm/RootPlot_1D.py deleted file mode 100644 index 641a1b21c4506840bf08ccd8d54c8fa3d918bf1c..0000000000000000000000000000000000000000 --- a/cflm/RootPlot_1D.py +++ /dev/null @@ -1,27 +0,0 @@ -import ROOT - -data = [] -low = 0 -up = 70 -nbins = 70 - -def RootPlot_1D(): - with open('./xxx_100_sic.txt', 'r') as file: - for line in file: - columns = line.split() - data.append(float(columns[2])) # X position : 1 // Z position :2 // Y position : 3 #// - - h = ROOT.TH1F("histogram", "Z position Distribution", 70, 0, 70) #// - - for value in data: - h.Fill(value) - - h.GetXaxis().SetTitle("Z position (mm)") #// - h.GetYaxis().SetTitle("Event/{:.3f}".format((up - low) / nbins)) - - c = ROOT.TCanvas("canvas", "Canvas Title", 800, 600) - h.Draw() - - c.SaveAs("RootPlot100sic_Z.png") #// - - c.Draw() diff --git a/cflm/RootPlot_2D.py b/cflm/RootPlot_2D.py deleted file mode 100644 index 7406d73e8f5b3089e69fbdd881e61115b0f086ae..0000000000000000000000000000000000000000 --- a/cflm/RootPlot_2D.py +++ /dev/null @@ -1,74 +0,0 @@ -import ROOT -from array import array - -X_position = [] -Z_position = [] -colors = [] -column = [] - -def RootPlot_2D(): - c1 = ROOT.TCanvas("c1", "Hit position distribution", 200, 10, 700, 500) - mg = ROOT.TMultiGraph() - gr1 = ROOT.TGraph() - gr2 = ROOT.TGraph() - gr3 = ROOT.TGraph() - gr4 = ROOT.TGraph() - - with open('raser/cflm/xxx_200_air.txt', 'r') as file: - for line in file: - columns = line.split() - column.append(columns[0]) - X_position.append(float(columns[1])) - Z_position.append(float(columns[2])) - if columns[0] == 'gamma': - colors.append(ROOT.kGreen) - elif columns[0] == 'e-': - colors.append(ROOT.kRed) - elif columns[0] == 'e+': - colors.append(ROOT.kBlue) - else: - colors.append(ROOT.kBlack) - - for i in range(len(X_position)): - particle = column[i] - if particle == 'gamma': - gr1.SetMarkerStyle(20) - gr1.SetMarkerColor(ROOT.kBlack) - gr1.SetPoint(i, X_position[i], Z_position[i]) - elif particle == 'e-': - gr2.SetMarkerStyle(22) - gr2.SetMarkerColor(ROOT.kBlack) - gr2.SetPoint(i, X_position[i], Z_position[i]) - elif particle == 'e+': - gr3.SetMarkerStyle(24) - gr3.SetMarkerColor(ROOT.kBlack) - gr3.SetPoint(i, X_position[i], Z_position[i]) - else: - gr4.SetMarkerStyle(28) - gr4.SetMarkerColor(ROOT.kBlack) - gr4.SetPoint(i, X_position[i], Z_position[i]) - - mg.Add(gr1) - mg.Add(gr2) - mg.Add(gr3) - mg.Add(gr4) - - mg.GetXaxis().SetTitle("X position (mm)") - mg.GetYaxis().SetTitle("Z position (mm)") - - mg.Draw("AP") - - legend = ROOT.TLegend(0.7, 0.2, 0.9, 0.4) - legend.AddEntry(gr1, "#gamma", "p").SetMarkerColor(ROOT.kGreen) - legend.AddEntry(gr2, "e^{-}", "p").SetMarkerColor(ROOT.kRed) - legend.AddEntry(gr3, "e^{+}", "p").SetMarkerColor(ROOT.kBlue) - legend.AddEntry(gr4, "Other", "p").SetMarkerColor(ROOT.kBlack) - - legend.SetBorderSize(0) - legend.SetFillColor(0) - legend.SetTextSize(0.03) - - legend.Draw() - - - c1.SaveAs("RootPlot100air_2D.png") \ No newline at end of file diff --git a/cflm/__init__.py b/cflm/__init__.py index 42495fe683486e8c8be7f9a4551ef00d098fd6b8..1991874e904d9d54568877c6310f3fb1441253dc 100644 --- a/cflm/__init__.py +++ b/cflm/__init__.py @@ -15,9 +15,6 @@ def main(kwargs): if label == 'cflm': from . import cflm cflm.main() - if label == 'RootPlot_1D': - from . import RootPlot_1D - RootPlot_1D.RootPlot_1D() if label == 'GetSignal': from . import get_signal get_signal.get_signal()