11"""Pure CsI simulation for the ECL
17 Mdst file named
'Ecl_Pure.mdst.root'
20 $ basf2 EclPureCsIExample.py [-- --withBkg]
27from simulation import add_simulation
28from reconstruction import add_reconstruction
33 parser = argparse.ArgumentParser()
35 parser.add_argument('--withBkg',
38 help=
'Add beam background'
39 'Default is False i.e. no beam background.')
43args = argparser().parse_args()
46mainPath = b2.create_path()
49eventInfoSetter = b2.register_module(
'EventInfoSetter')
50eventInfoSetter.param({
'evtNumList': [1000],
53mainPath.add_module(eventInfoSetter)
56b2.set_random_seed(123456)
59particleGun = b2.register_module(
'ParticleGun')
63 'momentumGeneration':
'fixed',
64 'momentumParams': [.1],
65 'thetaGeneration':
'uniform',
66 'thetaParams': [13., 150.],
67 'phiGeneration':
'uniform',
68 'phiParams': [0., 360.],
69 'vertexGeneration':
'uniform',
70 'xVertexParams': [0., 0.],
71 'yVertexParams': [0., 0.],
72 'zVertexParams': [0., 0.],
74particleGun.param(param_particleGun)
75mainPath.add_module(particleGun)
79 bgFiles = glob.glob(os.environ[
'BELLE2_BACKGROUND_DIR'] +
'*.root')
81 add_simulation(mainPath, bkgfiles=bgFiles)
84 add_simulation(mainPath)
87add_reconstruction(mainPath)
90eclDigitizerPureCsI = b2.register_module(
'ECLDigitizerPureCsI')
91eclDigitizerPureCsI.param(
'adcTickFactor', 8)
92eclDigitizerPureCsI.param(
'sigmaTrigger', 0.)
93eclDigitizerPureCsI.param(
'elecNoise', 1.3)
94eclDigitizerPureCsI.param(
'photostatresolution', 0.4)
95eclDigitizerPureCsI.param(
'sigmaTrigger', 0)
96eclDigitizerPureCsI.param(
'LastRing', 12)
97eclDigitizerPureCsI.param(
'NoCovMatrix', 1)
98eclDigitizerPureCsI.param(
'Background', 0)
99mainPath.add_module(eclDigitizerPureCsI)
102eclDigitCalibratorPureCsI = b2.register_module(
'ECLDigitCalibratorPureCsI')
104eclDigitCalibratorPureCsI.param(
'simulatePure', 1)
105mainPath.add_module(eclDigitCalibratorPureCsI)
108eclCRFinderPureCsI = b2.register_module(
'ECLCRFinderPureCsI')
109mainPath.add_module(eclCRFinderPureCsI)
112eclLocalMaximumFinderPureCsI = b2.register_module(
'ECLLocalMaximumFinderPureCsI')
113mainPath.add_module(eclLocalMaximumFinderPureCsI)
116eclSplitterN1PureCsI = b2.register_module(
'ECLSplitterN1PureCsI')
117mainPath.add_module(eclSplitterN1PureCsI)
120eclSplitterN2PureCsI = b2.register_module(
'ECLSplitterN2PureCsI')
121mainPath.add_module(eclSplitterN2PureCsI)
124eclShowerCorrectorPureCsI = b2.register_module(
'ECLShowerCorrectorPureCsI')
125mainPath.add_module(eclShowerCorrectorPureCsI)
128eclShowerCalibratorPureCsI = b2.register_module(
'ECLShowerCalibratorPureCsI')
129mainPath.add_module(eclShowerCalibratorPureCsI)
132eclShowerShapePureCsI = b2.register_module(
'ECLShowerShapePureCsI')
133mainPath.add_module(eclShowerShapePureCsI)
136eclCovarianceMatrixPureCsI = b2.register_module(
'ECLCovarianceMatrixPureCsI')
137mainPath.add_module(eclCovarianceMatrixPureCsI)
140eclFinalizerPureCsI = b2.register_module(
'ECLFinalizerPureCsI')
141mainPath.add_module(eclFinalizerPureCsI)
144mcMatcherECLClustersPureCsI = b2.register_module(
'MCMatcherECLClustersPureCsI')
145mainPath.add_module(mcMatcherECLClustersPureCsI)
148eclDataAnalysis = b2.register_module(
'ECLDataAnalysis')
149eclDataAnalysis.param(
'writeToRoot', 1)
150eclDataAnalysis.param(
'rootFileName',
'Ecl_Pure_CsI_Example.root')
151eclDataAnalysis.param(
'doSimulation', 0)
152eclDataAnalysis.param(
'doTracking', 1)
153eclDataAnalysis.param(
'doPureCsIStudy', 1)
154mainPath.add_module(eclDataAnalysis)
157outputFile = b2.register_module(
'RootOutput')
158outputFile.param(
'outputFileName',
'Ecl_Pure.mdst.root')
159mainPath.add_module(outputFile)
162mainPath.add_module(
'Progress')