12 """Test implementation of pure CsI digitization and waveform fit
21 $ basf2 TestNoiseCalibration.py -- --outputFileName <name>
22 --elecNoise <float> --photoStatResolution <float>
23 [--beamBkgPath <path_to_files>]
29 from simulation
import add_simulation
30 from reconstruction
import add_reconstruction
31 from mdst
import add_mdst_output
36 parser = argparse.ArgumentParser()
38 parser.add_argument(
'--outputFileName',
40 help=
'Output file name')
42 parser.add_argument(
'--elecNoise',
45 help=
'Electronics noise energy equivalent in MeV')
47 parser.add_argument(
'--photoStatResolution',
50 help=
'Sigma for 1 MeV energy deposit')
52 parser.add_argument(
'--beamBkgPath',
53 help=
'If you want to add beam background, pass this'
54 'option with path to beam background files.')
58 args = argparser().parse_args()
60 b2.set_log_level(b2.LogLevel.ERROR)
63 mainPath = b2.create_path()
66 eventInfoSetter = b2.register_module(
'EventInfoSetter')
67 eventInfoSetter.param({
'evtNumList': [10],
70 mainPath.add_module(eventInfoSetter)
74 bgFiles = glob.glob(args.beamBkgPath +
'/*.root')
76 add_simulation(mainPath, bkgfiles=bgFiles, components=
'ECL')
78 add_simulation(mainPath, components=
'ECL')
81 add_reconstruction(mainPath)
84 eclDigitizerPureCsI = b2.register_module(
'ECLDigitizerPureCsI')
85 eclDigitizerPureCsI.param(
'Calibration', 1)
86 eclDigitizerPureCsI.param(
'elecNoise', args.elecNoise)
87 eclDigitizerPureCsI.param(
'photostatresolution',
88 args.photoStatResolution)
89 eclDigitizerPureCsI.param(
'sigmaTrigger', 0)
90 eclDigitizerPureCsI.param(
'LastRing', 12)
91 mainPath.add_module(eclDigitizerPureCsI)
94 eclCovMatrixNtuple = b2.register_module(
'EclCovMatrixNtuple')
95 eclCovMatrixNtuple.param(
'dspArrayName',
'ECLDspsPureCsI')
96 eclCovMatrixNtuple.param(
'digiArrayName',
'ECLDigitsPureCsI')
97 eclCovMatrixNtuple.param(
'outputFileName',
99 mainPath.add_module(eclCovMatrixNtuple)
101 add_mdst_output(mainPath, additionalBranches=[
'ECLDspsPureCsI'])
104 mainPath.add_module(
'Progress')