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
fitBL_cfg.py
Go to the documentation of this file.
1import HpstrConf
2import baseConfig as base
3import os
4
5def timeSample_callback(options, opt, value, parser):
6 setattr(parser.values, options.dest, value.split(','))
7
8#To fit 2d histograms from file, provide a list of strings that match histograms of interest
9#If attempting to run over all layers, aka by not specifying the Layer number, RAM requirements may crash the program.
10base.parser.add_argument('-l', '--layer', type=str, dest="layer", default="",
11 help="To run on all layers, leave default. To select specific layer: L<n><T/B>")
12
13base.parser.add_argument('-thresh', '--thresh', type=str, dest="thresholdsFileIn",
14 help="Load online thresholds file used to set apv channel threshold. Required for fitting!")
15
16#Choose the RMS value that indicates a "dead" channel. This is a channel with low RMS compared to other channels, and varies based on Run
17base.parser.add_argument("-deadRMS", '--deadRMS', type=int, dest="deadRMS",
18 help="Define dead channel by setting low RMS threshold", metavar="deadRMS", default=150)
19
20base.parser.add_argument("-b", "--rebin", type=int, dest="rebin",
21 help="rebin factor.", metavar="rebin", default=1)
22
23base.parser.add_argument("-minStats", '--minStats', type=int, dest="minStats",
24 help="Offline fitting requires a minimum number of stats to fit channel", metavar="minStats", default=1200)
25
26options = base.parser.parse_args()
27
28# Use the input file to set the output file name
29lcio_file = options.inFilename[0]
30root_file = options.outFilename
31
32print('LCIO file: %s' % lcio_file)
33print('Root file: %s' % root_file)
34
35# Use the input file to set the output file name
36histo_file = options.inFilename[0]
37layer = options.layer
38
40
41p.run_mode = 2
42p.skip_events = options.skip_events
43p.max_events = options.nevents
44
45# Library containing processors
46p.libraries.append("libprocessors.so")
47
48
51
52fitBL = HpstrConf.Processor('fitBL', 'SvtBlFitHistoProcessor')
53
54
57fitBL.parameters["histCfg"] = os.environ['HPSTR_BASE']+'/analysis/plotconfigs/svt/SvtBlFits.json'
58fitBL.parameters["rawhitsHistCfg"] = os.environ['HPSTR_BASE']+'/analysis/plotconfigs/svt/baselinefits/rawSvtHits.json'
59fitBL.parameters["layer"] = options.layer
60fitBL.parameters["rebin"] = options.rebin
61fitBL.parameters["minStats"] = options.minStats
62fitBL.parameters["deadRMS"] = options.deadRMS
63fitBL.parameters["thresholdsFileIn"] = options.thresholdsFileIn
64fitBL.parameters["debug"] = options.debug
65
66# Sequence which the processors will run.
67p.sequence = [fitBL]
68
69p.input_files = [histo_file]
70p.output_files = [root_file]
71
72p.printProcess()
Process python class.
Definition HpstrConf.py:20
Processor python class.
Definition HpstrConf.py:4
timeSample_callback(options, opt, value, parser)
Definition fitBL_cfg.py:5