12 """Dump digit information for pure CsI vs CsI(Tl)
13 using 'ParticleGun' to generate single particles
14 enabling pure CsI digitization
15 dump useful in a flat ntuple + enriched mdst
18 $ basf2 ECLPureCsIStudy.py -- --momentum <number>
19 --fileNamePrefix <name> --elecNoise <number>
20 --photoStatResolution <number>
21 [--beamBkgPath <path_to_files> --pdgCode <integer>]
27 from simulation
import add_simulation
28 from reconstruction
import add_reconstruction
29 from mdst
import add_mdst_output
30 from beamparameters
import add_beamparameters
35 parser = argparse.ArgumentParser()
37 parser.add_argument(
'--momentum',
40 help=
'Fixed momentum of particle equivalent in GeV')
42 parser.add_argument(
'--fileNamePrefix',
44 help=
'Output file name')
46 parser.add_argument(
'--elecNoise',
49 help=
'Electronics noise energy equivalent in MeV')
51 parser.add_argument(
'--photoStatResolution',
54 help=
'Sigma for 1 MeV energy deposit')
56 parser.add_argument(
'--beamBkgPath',
57 help=
'If you want to add beam background, pass this'
58 'option with path to beam background files.')
60 parser.add_argument(
'--pdgCode',
62 help=
'PDG code of particle'
63 ' For more information:'
64 'http://pdg.lbl.gov/2019/reviews/rpp2018-rev-monte-carlo-numbering.pdf')
68 args = argparser().parse_args()
71 mainPath = b2.create_path()
74 eventInfoSetter = b2.register_module(
'EventInfoSetter')
75 mainPath.add_module(eventInfoSetter)
79 particleGun = b2.register_module(
'ParticleGun')
81 'pdgCodes': [args.pdgCode],
83 'momentumGeneration':
'fixed',
84 'momentumParams': [args.momentum],
85 'thetaGeneration':
'uniform',
86 'thetaParams': [13.0, 30.0],
87 'phiGeneration':
'uniform',
88 'phiParams': [0., 360.],
89 'vertexGeneration':
'uniform',
90 'xVertexParams': [0.0, 0.0],
91 'yVertexParams': [0.0, 0.0],
92 'zVertexParams': [0.0, 0.0],
94 particleGun.param(param_particleGun)
95 mainPath.add_module(particleGun)
98 beamparameters = add_beamparameters(mainPath,
'Y4S')
99 evtGenInput = b2.register_module(
'EvtGenInput')
100 mainPath.add_module(evtGenInput)
104 bgFiles = glob.glob(args.beamBkgPath +
'/*.root')
106 add_simulation(mainPath, bkgfiles=bgFiles)
108 add_simulation(mainPath)
111 add_reconstruction(mainPath, components=
'ECL')
114 eclDigitizerPureCsI = b2.register_module(
'ECLDigitizerPureCsI')
115 eclDigitizerPureCsI.param(
'adcTickFactor', 8)
116 eclDigitizerPureCsI.param(
'sigmaTrigger', 0.)
117 eclDigitizerPureCsI.param(
'elecNoise',
119 eclDigitizerPureCsI.param(
'photostatresolution',
120 args.photoStatResolution)
121 eclDigitizerPureCsI.param(
'sigmaTrigger', 0)
122 eclDigitizerPureCsI.param(
'LastRing', 12)
123 eclDigitizerPureCsI.param(
'NoCovMatrix', 1)
125 eclDigitizerPureCsI.param(
'Background', 1)
126 mainPath.add_module(eclDigitizerPureCsI)
129 eclDigitCalibratorPureCsI = b2.register_module(
'ECLDigitCalibratorPureCsI')
130 mainPath.add_module(eclDigitCalibratorPureCsI)
133 eclReconstructorPureCsI = b2.register_module(
'ECLReconstructorPureCsI')
134 mainPath.add_module(eclReconstructorPureCsI)
137 eclDigiStudy = b2.register_module(
'ECLDigiStudy')
138 eclDigiStudy.param(
'outputFileName',
139 args.fileNamePrefix +
'_digi')
140 mainPath.add_module(eclDigiStudy)
149 filename=args.fileNamePrefix +
'.mdst.root',
152 'ECLClustersPureCsI',
158 'ECLCalDigitsPureCsI',
159 'ECLDigitsPureCsIToECLDspsPureCsI',
160 'ECLDigitsPureCsIToECLHits'])
163 mainPath.add_module(
'ProgressBar')
166 mainPath.add_module(
'Progress')