def main(): parser = OptionParser(__doc__) parser.add_option("-c", "--centre-of-mass-energy", dest="CoM", default=13, type=int, help="set the centre of mass energy for analysis. Default = 13 [TeV]") parser.add_option('-d', '--debug', dest="debug", action="store_true", help="Print the debug information") (options, _) = parser.parse_args() centre_of_mass_energy = options.CoM # set global variables debug = options.debug if debug: log.setLevel(log.DEBUG) measurement_config = XSectionConfig(centre_of_mass_energy) categories = ['QCD_shape'] categories.extend(measurement_config.categories_and_prefixes.keys()) categories.extend(measurement_config.rate_changing_systematics_names) categories.extend([measurement_config.vjets_theory_systematic_prefix + systematic for systematic in measurement_config.generator_systematics if not ('mass' in systematic or 'hadronisation' in systematic or 'NLO' in systematic)]) for variable in measurement_config.variables: for category in categories: for channel in ['electron', 'muon']: if channel == 'electron' and (category == 'Muon_down' or category == 'Muon_up'): continue elif channel == 'muon' and (category == 'Electron_down' or category == 'Electron_up'): continue create_measurement( centre_of_mass_energy, category, variable, channel, phase_space='FullPS', norm_method='background_subtraction') # and the visible phase space create_measurement( centre_of_mass_energy, category, variable, channel, phase_space='VisiblePS', norm_method='background_subtraction')
@mylog.trace() def print_systematics(channel, options): pass def process_values(values): value, error = values value = int(round(value, 0)) error = int(ceil(error)) return '{0} +- {1}'.format(value, error) if __name__ == "__main__": if DEBUG: log.setLevel(log.DEBUG) if TESTRUN: import doctest doctest.testmod() if PROFILE: import cProfile import pstats profile_filename = 'src.cross_section_measurement.05b_make_tables_profile.txt' cProfile.run('main()', profile_filename) statsfile = open("profile_stats.txt", "wb") p = pstats.Stats(profile_filename, stream=statsfile) stats = p.strip_dirs().sort_stats('cumulative') stats.print_stats() statsfile.close() sys.exit(0) sys.exit(main())
filename = json_file.split('/')[-1] # remove type string category = filename.replace('_shape_systematic', '') category = category.replace('_rate_systematic', '') # remove file ending category = category.replace('.json', '') return category if __name__ == '__main__': tools.ROOT_utils.set_root_defaults() options, args = parse_options() # set global variables debug = options.debug if debug: log.setLevel(log.DEBUG) measurement_config = XSectionConfig(options.CoM) # caching of variables for shorter access translate_options = measurement_config.translate_options variable = options.variable output_path = options.path if options.closure_test: output_path += '/closure_test/' output_path += options.closure_test_type + '/' main()