Esempio n. 1
0
def main():
    log.basicConfig(level=log.INFO)  # Set logging level
    PDF.set_default_mpl_format()
    input_dir = "/home/jakob/DESY/MountPoints/DUST/TGCAnalysis/SampleProduction/NewMCProduction/4f_WW_sl/PrEWInput"
    output_dir = input_dir + "/shape_checks/WWShapePlots"

    log.info("Looking in dir: {}".format(input_dir))
    for file_path in tqdm(IOSH.find_files(input_dir, ".csv"), desc="files"):
        if "tau" in file_path:
            continue  # Skipping tau distributions, not use right now
        plot_WW_distr(file_path, output_dir)
def main():
    log.basicConfig(level=log.INFO)  # Set logging level
    PDF.set_default_mpl_format()
    input_dir = "/home/jakob/DESY/MountPoints/DUST/TGCAnalysis/SampleProduction"+\
                "/NewMCProduction/2f_Z_l/PrEWInput/MuAcc_costheta_0.9925"
    output_dir = input_dir + "/shape_checks/2fShapePlots"

    log.info("Looking in dir: {}".format(input_dir))
    for file_path in tqdm(IOSH.find_files(input_dir, ".csv"), desc="files"):
        if not "2f_mu" in file_path:
            continue  # Only draw mumu distributions
        plot_mumu_distr(file_path, output_dir)
import Plotting.Naming as PN
import Shape.ShapeFunctions as SSF
import Shape.ShapeTesting as SST

log.basicConfig(level=log.INFO) # Set logging level
PDF.set_default_mpl_format()
MCLumi = 5000 # MC Statistics is 5ab^-1

input_dir = "/home/jakob/DESY/MountPoints/DUST/TGCAnalysis/SampleProduction/NewMCProduction/2f_Z_l/PrEWInput/MuAcc_costheta_0.9925"
# input_dir = "/home/jakob/DESY/MountPoints/DUST/TGCAnalysis/SampleProduction/NewMCProduction/2f_Z_l/PrEWInput/MuAcc_costheta_0.9925/TrueAngle"

output_dir = input_dir + "/shape_checks"
IOSH.create_dir(output_dir)

log.info("Looking in dir: {}".format(input_dir))
for file_path in IOSH.find_files(input_dir, ".csv"):
  # Read the input file
  base_name = os.path.basename(file_path).replace(".csv","")
  log.info("Reading file: {}.csv".format(base_name))
  reader = IOR.Reader(file_path)

  # Get the pandas dataframe for the cut histograms
  angle = "costh_f_star_true" if "TrueAngle" in input_dir else "costh_f_star"
  df = reader["Data"]
  bin_vals = np.array(df["Cross sections"])
  bin_middles = np.array(df["BinCenters:{}".format(angle)])
  edges_min = np.array(df["BinLow:{}".format(angle)])
  edges_max = np.array(df["BinUp:{}".format(angle)])
  bin_width = edges_max[0] - edges_min[0]

  # Rescale to MC Lumi