11"""Test implementation of pure CsI digitization and waveform fit
20 $ basf2 TestNoiseCalibration.py -- --outputFileName <name>
21 --elecNoise <float> --photoStatResolution <float>
22 [--beamBkgPath <path_to_files>]
28from simulation import add_simulation
29from reconstruction import add_reconstruction
30from mdst import add_mdst_output
35 parser = argparse.ArgumentParser()
37 parser.add_argument('--outputFileName',
39 help=
'Output file name')
41 parser.add_argument(
'--elecNoise',
44 help=
'Electronics noise energy equivalent in MeV')
46 parser.add_argument(
'--photoStatResolution',
49 help=
'Sigma for 1 MeV energy deposit')
51 parser.add_argument(
'--beamBkgPath',
52 help=
'If you want to add beam background, pass this'
53 'option with path to beam background files.')
57args = argparser().parse_args()
59b2.set_log_level(b2.LogLevel.ERROR)
62mainPath = b2.create_path()
65eventInfoSetter = b2.register_module(
'EventInfoSetter')
66eventInfoSetter.param({
'evtNumList': [10],
69mainPath.add_module(eventInfoSetter)
73 bgFiles = glob.glob(args.beamBkgPath +
'/*.root')
75 add_simulation(mainPath, bkgfiles=bgFiles, components=
'ECL')
77 add_simulation(mainPath, components=
'ECL')
80add_reconstruction(mainPath)
83eclDigitizerPureCsI = b2.register_module(
'ECLDigitizerPureCsI')
84eclDigitizerPureCsI.param(
'Calibration', 1)
85eclDigitizerPureCsI.param(
'elecNoise', args.elecNoise)
86eclDigitizerPureCsI.param(
'photostatresolution',
87 args.photoStatResolution)
88eclDigitizerPureCsI.param(
'sigmaTrigger', 0)
89eclDigitizerPureCsI.param(
'LastRing', 12)
90mainPath.add_module(eclDigitizerPureCsI)
93eclCovMatrixNtuple = b2.register_module(
'EclCovMatrixNtuple')
94eclCovMatrixNtuple.param(
'dspArrayName',
'ECLDspsPureCsI')
95eclCovMatrixNtuple.param(
'digiArrayName',
'ECLDigitsPureCsI')
96eclCovMatrixNtuple.param(
'outputFileName',
98mainPath.add_module(eclCovMatrixNtuple)
100add_mdst_output(mainPath, additionalBranches=[
'ECLDspsPureCsI'])
103mainPath.add_module(
'Progress')