Belle II Software development
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 146 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 154 of file core.py.

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

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 165 of file core.py.

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

◆ reconstruct()

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

Definition at line 175 of file core.py.

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

Member Data Documentation

◆ config

config = config

config.FeiConfiguration object

Definition at line 163 of file core.py.

◆ particles

particles = particles

list of config.Particle objects

Definition at line 161 of file core.py.


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