Example #1
0
for Infile in Jinfile:
    from Raw_text_to_Tree_root import Raw_text_to_Tree_root
    To_Tree = Raw_text_to_Tree_root(Infile, ".")

    #    from Tree_to_D1H_CutnGenerate import REGENERATE_TREE_WITH_CUT
    #    NEW_Tree_PATH = REGENERATE_TREE_WITH_CUT(To_Tree,".")
    NEW_Tree_PATH = To_Tree

    #from Tree_to_D2H_Convert import CONVERT_WORKING2D
    from Tree_to_D1H_Convert import CONVERT_WORKING
    HistROOT_PATH = CONVERT_WORKING(NEW_Tree_PATH, "")
    #CONVERT_WORKING2D(NEW_Tree_PATH,"")

    sys.path.append(
        "/Users/leejunho/Desktop/git/python3Env/group_study/fruit_team/ROOT/Project/functions/rootHist_TXT/func"
    )
    from D1H_rootHist_TXT_conversion import D1H_roothist_to_txt
    TXT_FILE_LIST = D1H_roothist_to_txt(HistROOT_PATH, "")

    sys.path.append(
        "/Users/leejunho/Desktop/git/python3Env/group_study/project_pre/func")
    from c1_basic_statistic import *
    from c2_basic_histo_plotting import Basic_histo
    from c3_Fit_Gaus_histo_plotting import Fit_Gaus_histo
    for Input_file in TXT_FILE_LIST:
        print("The file Name is :", Input_file)
        Basic_histo(Input_file)
        Fit_Gaus_histo(Input_file)

#    gBenchmark.Show("All in One")
from c4_Fit_Poisson_histo_plotting import Fit_Poisson_histo
from c5_single_sample_mean_Zdistribution import Fit_Sample_Gaus_histo
from c5_single_sample_mean_Tdistribution import t_distribution
from c7_single_sample_variance_distribution import Sample_Variance
#for Input_file in TXT_FILE_LIST:
for ij in range(len(TXT_FILE_LIST)):
    print("The file Name is :", TXT_FILE_LIST[ij])
    #    MODE = most_frequent_bin(TXT_FILE_LIST[ij]);      print("MODE :",MODE)
    #    DATA_RANGE = c1_data_range(TXT_FILE_LIST[ij]);    print("DATA_RANGE :",DATA_RANGE)
    #    MEDIAN = c1_median(TXT_FILE_LIST[ij]);            print("MEDIAN :",MEDIAN)
    #    Total_ENTRY = c1_total_ENTRY(TXT_FILE_LIST[ij]);  print("Total_ENTRY :",Total_ENTRY)
    #    MEAN = c1_mean(TXT_FILE_LIST[ij]);                print("MEAN :",MEAN)
    #    VARIANCE = c1_variance(TXT_FILE_LIST[ij]);        print("VARIANCE :",VARIANCE)
    #    STD = c1_standard_deviation(TXT_FILE_LIST[ij]);   print("STD :",STD)
    #    print("\n")
    Basic_histo(TXT_FILE_LIST[ij], TXT_FILE_LIST_largeBin[ij])
    #    Fit_Poisson_histo(TXT_FILE_LIST[ij], TXT_FILE_LIST_largeBin[ij])
    Fit_Sample_Gaus_histo(TXT_FILE_LIST[ij],
                          TXT_FILE_LIST_largeBin[ij],
                          exp_Mean_error=10)
    #    t_distribution(TXT_FILE_LIST[ij], TXT_FILE_LIST_largeBin[ij], Show_T=True, Show_sample=True, Show_Gaus=False)
    t_distribution(TXT_FILE_LIST[ij],
                   TXT_FILE_LIST_largeBin[ij],
                   Show_T=True,
                   Show_sample=True,
                   Show_Gaus=True)
    Sample_Variance(TXT_FILE_LIST[ij], TXT_FILE_LIST_largeBin[ij])

#os.system("rm -rf python_plots")
#os.system("rm -rf python_hist_texts")
os.system("mkdir python_plots")
Example #3
0
import sys
import numpy as np
sys.path.append("../functions")

Project1 = "project1_1M.txt"
'''
from c2_basic_histo_plotting import Basic_histo
Basic_histo(Project1)

from c3_Fit_Gaus_histo_plotting import Fit_Gaus_histo
Fit_Gaus_histo(Project1,"a")
'''

from c3_statistics_man import *
print(n_frequent_bin(Project1, 0.5))

filename = "project1_1M.txt"
infile = open("project1_1M.txt")
list_file = []
for line in infile:
    binN, ibin, fbin, entry = line.split()
    list_file.append([int(binN), float(ibin), float(fbin), float(entry)])

l = [x[0] for x in list_file]
entry = [x[3] for x in list_file]
p1 = 0.025
p2 = 0.975
total_entry = sum(entry)
print(total_entry)
s_entry = 0
for i in l: