12 """Pure CsI simulation for the ECL
18 Mdst file named 'Ecl_Pure.mdst.root'
21 $ basf2 EclPureCsIExample.py [-- --withBkg]
28 from simulation
import add_simulation
29 from reconstruction
import add_reconstruction
34 parser = argparse.ArgumentParser()
36 parser.add_argument(
'--withBkg',
39 help=
'Add beam background'
40 'Default is False i.e. no beam background.')
44 args = argparser().parse_args()
47 mainPath = b2.create_path()
50 eventInfoSetter = b2.register_module(
'EventInfoSetter')
51 eventInfoSetter.param({
'evtNumList': [1000],
54 mainPath.add_module(eventInfoSetter)
57 b2.set_random_seed(123456)
60 particleGun = b2.register_module(
'ParticleGun')
64 'momentumGeneration':
'fixed',
65 'momentumParams': [.1],
66 'thetaGeneration':
'uniform',
67 'thetaParams': [13., 150.],
68 'phiGeneration':
'uniform',
69 'phiParams': [0., 360.],
70 'vertexGeneration':
'uniform',
71 'xVertexParams': [0., 0.],
72 'yVertexParams': [0., 0.],
73 'zVertexParams': [0., 0.],
75 particleGun.param(param_particleGun)
76 mainPath.add_module(particleGun)
80 bgFiles = glob.glob(os.environ[
'BELLE2_BACKGROUND_DIR'] +
'*.root')
82 add_simulation(mainPath, bkgfiles=bgFiles)
85 add_simulation(mainPath)
88 add_reconstruction(mainPath)
91 eclDigitizerPureCsI = b2.register_module(
'ECLDigitizerPureCsI')
92 eclDigitizerPureCsI.param(
'adcTickFactor', 8)
93 eclDigitizerPureCsI.param(
'sigmaTrigger', 0.)
94 eclDigitizerPureCsI.param(
'elecNoise', 1.3)
95 eclDigitizerPureCsI.param(
'photostatresolution', 0.4)
96 eclDigitizerPureCsI.param(
'sigmaTrigger', 0)
97 eclDigitizerPureCsI.param(
'LastRing', 12)
98 eclDigitizerPureCsI.param(
'NoCovMatrix', 1)
99 eclDigitizerPureCsI.param(
'Background', 0)
100 mainPath.add_module(eclDigitizerPureCsI)
103 eclDigitCalibratorPureCsI = b2.register_module(
'ECLDigitCalibratorPureCsI')
105 eclDigitCalibratorPureCsI.param(
'simulatePure', 1)
106 mainPath.add_module(eclDigitCalibratorPureCsI)
109 eclCRFinderPureCsI = b2.register_module(
'ECLCRFinderPureCsI')
110 mainPath.add_module(eclCRFinderPureCsI)
113 eclLocalMaximumFinderPureCsI = b2.register_module(
'ECLLocalMaximumFinderPureCsI')
114 mainPath.add_module(eclLocalMaximumFinderPureCsI)
117 eclSplitterN1PureCsI = b2.register_module(
'ECLSplitterN1PureCsI')
118 mainPath.add_module(eclSplitterN1PureCsI)
121 eclSplitterN2PureCsI = b2.register_module(
'ECLSplitterN2PureCsI')
122 mainPath.add_module(eclSplitterN2PureCsI)
125 eclShowerCorrectorPureCsI = b2.register_module(
'ECLShowerCorrectorPureCsI')
126 mainPath.add_module(eclShowerCorrectorPureCsI)
129 eclShowerCalibratorPureCsI = b2.register_module(
'ECLShowerCalibratorPureCsI')
130 mainPath.add_module(eclShowerCalibratorPureCsI)
133 eclShowerShapePureCsI = b2.register_module(
'ECLShowerShapePureCsI')
134 mainPath.add_module(eclShowerShapePureCsI)
137 eclCovarianceMatrixPureCsI = b2.register_module(
'ECLCovarianceMatrixPureCsI')
138 mainPath.add_module(eclCovarianceMatrixPureCsI)
141 eclFinalizerPureCsI = b2.register_module(
'ECLFinalizerPureCsI')
142 mainPath.add_module(eclFinalizerPureCsI)
145 mcMatcherECLClustersPureCsI = b2.register_module(
'MCMatcherECLClustersPureCsI')
146 mainPath.add_module(mcMatcherECLClustersPureCsI)
149 eclDataAnalysis = b2.register_module(
'ECLDataAnalysis')
150 eclDataAnalysis.param(
'writeToRoot', 1)
151 eclDataAnalysis.param(
'rootFileName',
'Ecl_Pure_CsI_Example.root')
152 eclDataAnalysis.param(
'doSimulation', 0)
153 eclDataAnalysis.param(
'doTracking', 1)
154 eclDataAnalysis.param(
'doPureCsIStudy', 1)
155 mainPath.add_module(eclDataAnalysis)
158 outputFile = b2.register_module(
'RootOutput')
159 outputFile.param(
'outputFileName',
'Ecl_Pure.mdst.root')
160 mainPath.add_module(outputFile)
163 mainPath.add_module(
'Progress')