Belle II Software light-2607-kasei
FSPLoader Class Reference

Public Member Functions

 __init__ (self, typing.Sequence[config.Particle] particles, config.FeiConfiguration config)
 
typing.List[str] get_fsp_lists (self)
 
pybasf2.Path reconstruct (self)
 

Public Attributes

 particles = particles
 list of config.Particle objects
 
 config = config
 config.FeiConfiguration object
 

Detailed Description

Steers the loading of FSP particles.
This does NOT include RootInput, Geometry or anything required before loading FSPs,
the user has to add this himself (because it depends on the MC campaign and if you want
to use Belle or Belle II).

Definition at line 147 of file core.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
typing.Sequence[config.Particle] particles,
config.FeiConfiguration config )
Create a new FSPLoader object
@param particles list of config.Particle objects
@param config config.FeiConfiguration object

Definition at line 155 of file core.py.

155 def __init__(self, particles: typing.Sequence[config.Particle], config: config.FeiConfiguration):
156 """
157 Create a new FSPLoader object
158 @param particles list of config.Particle objects
159 @param config config.FeiConfiguration object
160 """
161
162 self.particles = particles
163
164 self.config = config
165

Member Function Documentation

◆ get_fsp_lists()

typing.List[str] get_fsp_lists ( self)
Returns a list of FSP particle lists which are used in the FEI.
This is used to create the RootOutput module.

Definition at line 166 of file core.py.

166 def get_fsp_lists(self) -> typing.List[str]:
167 """
168 Returns a list of FSP particle lists which are used in the FEI.
169 This is used to create the RootOutput module.
170 """
171 fsps = ['K+:FSP', 'pi+:FSP', 'e+:FSP', 'mu+:FSP', 'p+:FSP', 'gamma:FSP', 'K_S0:V0', 'Lambda0:V0', 'K_L0:FSP', 'gamma:V0']
172 if b2bii.isB2BII():
173 fsps += ['pi0:FSP']
174 return fsps
175
isB2BII()
Definition b2bii.py:14

◆ reconstruct()

pybasf2.Path reconstruct ( self)
Returns pybasf2.Path which loads the FSP Particles

Definition at line 176 of file core.py.

176 def reconstruct(self) -> pybasf2.Path:
177 """
178 Returns pybasf2.Path which loads the FSP Particles
179 """
180 path = basf2.create_path()
181
182 if b2bii.isB2BII():
183 ma.fillParticleLists([('K+:FSP', ''), ('pi+:FSP', ''), ('e+:FSP', ''),
184 ('mu+:FSP', ''), ('p+:FSP', '')], writeOut=True, path=path)
185 for outputList, inputList in [('gamma:FSP', 'gamma:mdst'), ('K_S0:V0', 'K_S0:mdst'),
186 ('Lambda0:V0', 'Lambda0:mdst'), ('K_L0:FSP', 'K_L0:mdst'),
187 ('pi0:FSP', 'pi0:mdst'), ('gamma:V0', 'gamma:v0mdst')]:
188 ma.copyParticles(outputList, inputList, writeOut=True, path=path)
189 else:
190 ma.fillParticleLists([('K+:FSP', ''), ('pi+:FSP', ''), ('e+:FSP', ''),
191 ('mu+:FSP', ''), ('gamma:FSP', ''),
192 ('p+:FSP', ''), ('K_L0:FSP', '')], writeOut=True, path=path)
193 ma.fillParticleList('K_S0:V0 -> pi+ pi-', '', writeOut=True, path=path)
194 ma.fillParticleList('Lambda0:V0 -> p+ pi-', '', writeOut=True, path=path)
195 ma.fillConvertedPhotonsList('gamma:V0 -> e+ e-', '', writeOut=True, path=path)
196
197 if self.config.monitor:
198 names = ['e+', 'K+', 'pi+', 'mu+', 'gamma', 'K_S0', 'p+', 'K_L0', 'Lambda0', 'pi0']
199 filename = os.path.join(self.config.monitoring_path, 'Monitor_FSPLoader.root')
200 pdgs = {abs(pdg.from_name(name)) for name in names}
201 variables = [(f'NumberOfMCParticlesInEvent({pdg})', 100, -0.5, 99.5) for pdg in pdgs]
202 ma.variablesToHistogram('', variables=variables, filename=filename, ignoreCommandLineOverride=True, path=path)
203 return path
204
205
from_name(name)
Definition pdg.py:63

Member Data Documentation

◆ config

config = config

config.FeiConfiguration object

Definition at line 164 of file core.py.

◆ particles

particles = particles

list of config.Particle objects

Definition at line 162 of file core.py.


The documentation for this class was generated from the following file: