def getComLineArgs(): parser = UserInput.getDefaultParser() parser.add_argument("-s", "--selection", type=str, required=True, help="Specificy selection level to run over") parser.add_argument("--latex", action='store_true', help='table in latex format') parser.add_argument("-r", "--object_restrict", type=str, default="", help="Use modified object file") parser.add_argument("-b", "--branches", type=str, default="all", help="List (separate by commas) of names of branches " "in root and config file to plot") parser.add_argument("-m", "--make_cut", type=str, default="", help="Enter a valid root cut string to apply") parser.add_argument( "--blinding", type=list, default=[ "Mass < 400", "Pt < 200", "mjj < 500", "dEtajj < 2.5", "MTWZ < 400" ], help="Blinding cuts to apply (only to that distribution)") return parser.parse_args()
def getComLineArgs(): parser = UserInput.getDefaultParser() parser.add_argument("-s", "--selection", type=str, required=True, help="Specificy selection level to run over") parser.add_argument("-r", "--object_restrict", type=str, default="", help="Use modified object file") parser.add_argument( "-b", "--branches", type=str, default="all", help="List (separate by commas) of names of branches " "in root and config file to plot", ) parser.add_argument("-m", "--make_cut", type=str, default="", help="Enter a valid root cut string to apply") parser.add_argument("--ratio_text", default="", type=str, help="Ratio text") parser.add_argument( "-t", "--extra_text", type=str, default="", help="Extra text to be added below (above) the legend" ) parser.add_argument("--extra_text_above", action="store_true", help="Position extra text above the legend") parser.add_argument( "--folder_name", type=str, default="", help="Folder name to save plots in (default is current time)" ) parser.add_argument("--simulation", action="store_true", help="Write 'Simulation' in CMS style text") parser.add_argument("--no_overflow", action="store_true", help="No overflow bin") parser.add_argument("--no_scalefactors", action="store_true", help="No scale factors") parser.add_argument("--scaleymax", type=float, default=1.0, help="Scale default ymax by this amount") parser.add_argument("--scaleymin", type=float, default=1.0, help="Scale default ymin by this amount") parser.add_argument("--scalelegy", type=float, default=1.0, help="Scale default legend entry size by this amount") parser.add_argument("--ratio_range", nargs=2, default=[0.5, 1.5], help="Ratio min ratio max (default 0.5 1.5)") parser.add_argument("--scalexmax", type=float, default=1.0, help="Scale default xmax by this amount") return parser.parse_args()
def getComLineArgs(): parser = UserInput.getDefaultParser() parser.add_argument("-s", "--selection", type=str, required=True, help="Specificy selection level to run over") parser.add_argument("-b", "--branches", type=str, default="all", help="List (separate by commas) of names of branches " "in root and config file to plot") parser.add_argument("--systematics", type=str, required=True, help="Specificy systematics to plot") return parser.parse_args()
def getComLineArgs(): parser = UserInput.getDefaultParser() parser.add_argument("-s", "--selection", type=str, required=True, help="Specificy selection level to run over") parser.add_argument("--backgroundOnly", action='store_true', help="Use background only fit rather than s+b") parser.add_argument("--noCR", action='store_true', help="Remove control region from fit distribution") parser.add_argument("-b", "--branches", type=str, default="all", help="List (separate by commas) of names of branches " "in root and config file to plot") return parser.parse_args()
# Channels should be ordered the same way as passed to the histogram # Thus bin 0 is the underflow, bin 1 is total, and bin 2 # is the first bin with channel content (mmm/emm/eem/eee by default) yield_info[chan] = getFormattedYieldAndError(hist, i + 2, sigfigs) yield_info["Total Yield"] = getFormattedYieldAndError(hist, 1, sigfigs) yield_table.add_row( [formatted_names[hist.GetName().replace("_standalone", "")]] + yield_info.values()) with open("temp.txt", "a") as log_file: log_file.write(yield_table.get_latex_string()) ROOT.gROOT.SetBatch(True) path = "/cms/kdlong" if "hep.wisc.edu" in os.environ['HOSTNAME'] else \ "/afs/cern.ch/user/k/kelong/work" parser = UserInput.getDefaultParser() parser.add_argument("-s", "--selection", type=str, required=True, help="Specificy selection level to run over") parser.add_argument("-m", "--make_cut", type=str, default="", help="Enter a valid root cut string to apply") args = parser.parse_args() if args.hist_file == "": ROOT.TProof.Open('workers=12') dataset_manager = "%s/AnalysisDatasetManager" % path
import Utilities.helper_functions as helper from Utilities import CutFlowDefinitions import os def getMonteCarloStack(cutflow_maker, filelist): hist_stack = ROOT.THStack("cutflow", "") for plot_set in filelist: hist = cutflow_maker.getHist(plot_set) hist_stack.Add(hist) return hist_stack ROOT.gROOT.SetBatch(True) ROOT.TProof.Open('workers=12') path = "/cms/kdlong" if "hep.wisc.edu" in os.environ['HOSTNAME'] else \ "/afs/cern.ch/user/k/kelong/work" parser = UserInput.getDefaultParser() args = parser.parse_args() cutflow_maker = CutFlowDefinitions.getWZCutFlow( "%s/AnalysisDatasetManager" % path, "full" ) cutflow_maker.setLuminosity(1340) cutflow_maker.setStates(["eee", "mmm", "emm", "eem"]) filelist = ["ttbar", "st", "ttv", "vvv", "ww", "zz", "dy-filt", "zg-filt", "wz"] if args.files_to_plot == "all" else \ [x.strip() for x in args.files_to_plot.split(",")] data_hist = cutflow_maker.getHist("data") hist_stack = getMonteCarloStack(cutflow_maker, filelist) hist_stack.Draw() hist_stack.GetXaxis().SetLabelSize(0.4*8/9) print "Now stack is %s" % hist_stack