11"""Dump digit information for pure CsI vs CsI(Tl)
12 using 'ParticleGun' to generate single particles
13 enabling pure CsI digitization
14 dump useful
in a flat ntuple + enriched mdst
17 $ basf2 ECLPureCsIStudy.py -- --momentum <number>
18 --fileNamePrefix <name> --elecNoise <number>
19 --photoStatResolution <number>
20 [--beamBkgPath <path_to_files> --pdgCode <integer>]
26from simulation import add_simulation
27from reconstruction import add_reconstruction
28from mdst import add_mdst_output
29from beamparameters import add_beamparameters
34 parser = argparse.ArgumentParser()
36 parser.add_argument('--momentum',
39 help=
'Fixed momentum of particle equivalent in GeV')
41 parser.add_argument(
'--fileNamePrefix',
43 help=
'Output file name')
45 parser.add_argument(
'--elecNoise',
48 help=
'Electronics noise energy equivalent in MeV')
50 parser.add_argument(
'--photoStatResolution',
53 help=
'Sigma for 1 MeV energy deposit')
55 parser.add_argument(
'--beamBkgPath',
56 help=
'If you want to add beam background, pass this'
57 'option with path to beam background files.')
59 parser.add_argument(
'--pdgCode',
61 help=
'PDG code of particle'
62 ' For more information:'
63 'http://pdg.lbl.gov/2019/reviews/rpp2018-rev-monte-carlo-numbering.pdf')
67args = argparser().parse_args()
70mainPath = b2.create_path()
73eventInfoSetter = b2.register_module(
'EventInfoSetter')
74mainPath.add_module(eventInfoSetter)
78 particleGun = b2.register_module(
'ParticleGun')
80 'pdgCodes': [args.pdgCode],
82 'momentumGeneration':
'fixed',
83 'momentumParams': [args.momentum],
84 'thetaGeneration':
'uniform',
85 'thetaParams': [13.0, 30.0],
86 'phiGeneration':
'uniform',
87 'phiParams': [0., 360.],
88 'vertexGeneration':
'uniform',
89 'xVertexParams': [0.0, 0.0],
90 'yVertexParams': [0.0, 0.0],
91 'zVertexParams': [0.0, 0.0],
93 particleGun.param(param_particleGun)
94 mainPath.add_module(particleGun)
97 beamparameters = add_beamparameters(mainPath,
'Y4S')
98 evtGenInput = b2.register_module(
'EvtGenInput')
99 mainPath.add_module(evtGenInput)
103 bgFiles = glob.glob(args.beamBkgPath +
'/*.root')
105 add_simulation(mainPath, bkgfiles=bgFiles)
107 add_simulation(mainPath)
110add_reconstruction(mainPath, components=
'ECL')
113eclDigitizerPureCsI = b2.register_module(
'ECLDigitizerPureCsI')
114eclDigitizerPureCsI.param(
'adcTickFactor', 8)
115eclDigitizerPureCsI.param(
'sigmaTrigger', 0.)
116eclDigitizerPureCsI.param(
'elecNoise',
118eclDigitizerPureCsI.param(
'photostatresolution',
119 args.photoStatResolution)
120eclDigitizerPureCsI.param(
'sigmaTrigger', 0)
121eclDigitizerPureCsI.param(
'LastRing', 12)
122eclDigitizerPureCsI.param(
'NoCovMatrix', 1)
124 eclDigitizerPureCsI.param(
'Background', 1)
125mainPath.add_module(eclDigitizerPureCsI)
128eclDigitCalibratorPureCsI = b2.register_module(
'ECLDigitCalibratorPureCsI')
129mainPath.add_module(eclDigitCalibratorPureCsI)
132eclReconstructorPureCsI = b2.register_module(
'ECLReconstructorPureCsI')
133mainPath.add_module(eclReconstructorPureCsI)
136eclDigiStudy = b2.register_module(
'ECLDigiStudy')
137eclDigiStudy.param(
'outputFileName',
138 args.fileNamePrefix +
'_digi')
139mainPath.add_module(eclDigiStudy)
148 filename=args.fileNamePrefix +
'.mdst.root',
151 'ECLClustersPureCsI',
157 'ECLCalDigitsPureCsI',
158 'ECLDigitsPureCsIToECLDspsPureCsI',
159 'ECLDigitsPureCsIToECLHits'])
162mainPath.add_module(
'ProgressBar')
165mainPath.add_module(
'Progress')