BaseObject("mZ2_high-m4l_2mu2e", rebin=5, histName="mZ2_2mu2e"), BaseObject("mZ2_4mu", rebin=10, histName="mZ2_4mu"), BaseObject("mZ2_low-m4l_4mu", rebin=10, histName="mZ2_4mu"), BaseObject("mZ2_mid-m4l_4mu", rebin=10, histName="mZ2_4mu"), BaseObject("mZ2_high-m4l_4mu", rebin=10, histName="mZ2_4mu"), BaseObject("mZ2_2e2mu", rebin=10, histName="mZ2_2e2mu"), BaseObject("mZ2_low-m4l_2e2mu", rebin=10, histName="mZ2_2e2mu"), BaseObject("mZ2_mid-m4l_2e2mu", rebin=10, histName="mZ2_2e2mu"), BaseObject("mZ2_high-m4l_2e2mu", rebin=10, histName="mZ2_2e2mu"), ] drawFit = True rebin = 5 # _____________________________________________________________________________ || inputFile = ROOT.TFile(inputPath, "READ") mkdir_p(os.path.dirname(outputDir)) if drawFit: c = ROOT.TCanvas() outputFile = ROOT.TFile(os.path.join(outputDir, outFileName), "RECREATE") for bin in binList: histName = bin.histName inputHist = inputFile.Get(histName).Clone() inputHistClone = inputHist.Clone() inputNormHist = inputFile.Get(bin.name) inputHist.Rebin(bin.rebin) inputHist.Fit("landau") func = inputHist.GetFunction("landau") func.SetName(bin.name + "_shape") outputHist = inputNormHist.Clone(bin.name + "_shapehist") for ibin in range(1, inputNormHist.GetNbinsX() + 1): x_value = inputNormHist.GetXaxis().GetBinCenter(ibin) outputHist.SetBinContent(
# ________________________________________________________________________________________________ || signals = [SignalModel("HToZdZd_M" + str(m), m) for m in mass_points] bins = [ BaseObject("MuMu", histName="MuMu", x_width=0.02, y_width=0.02), BaseObject("ElMu", histName="ElMu", x_width=0.05, y_width=0.02), BaseObject("ElEl", histName="ElEl", x_width=0.05, y_width=0.05), BaseObject("MuEl", histName="MuEl", x_width=0.02, y_width=0.05), ] # ________________________________________________________________________________________________ || print("Input directory: " + inputDir) print("Output directory: " + outputDir) print("Mass points: " + ", ".join([str(s.centre) for s in signals])) mkdir_p(outputDir) for power in fitlist: for b in bins: if (makePlot): c = ROOT.TCanvas() if (makeTFile): outFile = ROOT.TFile( os.path.join(outputDir, b.histName + "_" + power + ".root"), "RECREATE") x_points = [] err_points = [] y_points = [] for sig in signals: fName = os.path.join(inputDir, sig.sig_name, TFileName) f = ROOT.TFile(fName, "READ")
cfgFileName = sys.argv[1] cfgAbsFilePath = os.path.abspath(cfgFileName) file = open(cfgFileName, 'r') cfg = imp.load_source('UFNTuple.__cfg_to_run__', cfgFileName, file) commands = """ cd {base_path} source setup_hpg.sh UFNTuple {cfg_path} """.format( base_path=os.environ["BASE_PATH"], cfg_path=cfgAbsFilePath, ) script_file_name = os.path.join(cfg.outputInfo.outputDir, cfg.slurm_job_name + ".cfg") mkdir_p(cfg.outputInfo.outputDir) worker = SLURMWorker() worker.make_sbatch_script( script_file_name, cfg.slurm_job_name, cfg.slurm_email, cfg.slurm_ntasks, cfg.slurm_mem, cfg.slurm_time, cfg.outputInfo.outputDir, commands, n_core=cfg.nCores, ) worker.sbatch_submit(script_file_name)