hpstr
The Heavy Photon Search Toolkit for Reconstruction (hpstr) provides an interface to physics data from the HPS experiment saved in the LCIO format and converts it into an ROOT based format.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
bhResSystematics_cfg.py
Go to the documentation of this file.
1import HpstrConf
2import sys
3import baseConfig
4
5parser = baseConfig.parser
6
7parser.add_argument("-s", "--spec", type=str, dest="mass_spec",
8 help="Name of mass spectrum histogram.", metavar="mass_spec",
9 default="mass_tweak__p_tot_min_cut")
10parser.add_argument("-m", "--mass", type=int, dest="mass_hypo",
11 help="Mass hypothesis in MeV.", metavar="mass_hypo", default=145)
12parser.add_argument("-p", "--poly", type=int, dest="poly_order",
13 help="Polynomial order of background model.", metavar="poly_order", default=3)
14parser.add_argument("-w", "--win", type=int, dest="win_factor",
15 help="Window factor for determining fit window size.", metavar="win_factor", default=11)
16parser.add_argument("-M", "--bkg_model", type=int, dest="bkg_model", default="1",
17 help="The type of background fit model. 0 = Chebyshev; 1 = Exponential Chebyshev; 2 = Legendre; 3 = Exponential Legendre.", metavar="bkg_model")
18parser.add_argument("-N", "--num_iterations", type=int, dest="num_iters",
19 help="Number of iterations to run.", metavar="num_iters", default=1000)
20parser.add_argument("-S", "--res_sigma", type=float, dest="res_sigma",
21 help="Width of the Guassian distriubtion of the mass resolution.", metavar="res_sigma", default=0.05)
22parser.add_argument("-f", "--func_file", type=str, dest="function_file",
23 help="The name of the file containing the mass resolution error parameterization function.", metavar="function_file", default="")
24parser.add_argument("-F", "--func_name", type=str, dest="function_name",
25 help="The name of the function object that describes the mass resolution parameterization.", metavar="function_name", default="")
26parser.add_argument("-u", "--num_toys", type=int, dest="num_toys",
27 help="Number of toys to generate.", metavar="num_toys", default=1000)
28parser.add_argument("-U", "--num_toy_iterations", type=int, dest="toy_num_iters",
29 help="Number of iterations to run.", metavar="toy_num_iters", default=100)
30
31options = parser.parse_args()
32
33# Use the input file to set the output file name
34histo_file = options.inFilename
35mass_hypo = options.mass_hypo/1000.0
36poly_order = options.poly_order
37win_factor = options.win_factor
38out_file = '%s/bhResSys_m%iw%ip%i.root' % (options.outDir, options.mass_hypo, win_factor, poly_order)
39
40print('Input File: %s' % histo_file)
41print('Output File: %s' % out_file)
42
44
45p.run_mode = 2
46p.skip_events = options.skip_events
47p.max_events = options.nevents
48
49# Library containing processors
50p.add_library("libprocessors")
51
52
55
56bhressys = HpstrConf.Processor('bhtoys', 'BhMassResSystematicsProcessor')
57
58
62bhressys.parameters["debug"] = 1
63bhressys.parameters["seed"] = 0
64bhressys.parameters["massSpectrum"] = options.mass_spec
65bhressys.parameters["mass_hypo"] = mass_hypo
66bhressys.parameters["poly_order"] = poly_order
67bhressys.parameters["win_factor"] = win_factor
68bhressys.parameters["bkg_model"] = options.bkg_model
69bhressys.parameters["num_iters"] = options.num_iters
70bhressys.parameters["res_sigma"] = options.res_sigma
71bhressys.parameters["function_file"] = options.function_file
72bhressys.parameters["function_name"] = options.function_name
73bhressys.parameters["num_toys"] = options.num_toys
74bhressys.parameters["toy_num_iters"] = options.toy_num_iters
75
76# Sequence which the processors will run.
77p.sequence = [bhressys]
78
79p.input_files = [histo_file]
80p.output_files = [out_file]
81
82p.printProcess()
Process python class.
Definition HpstrConf.py:20
Processor python class.
Definition HpstrConf.py:4