ATLAS Offline Software
Loading...
Searching...
No Matches
python.samplers.ParticleSampler Class Reference
Inheritance diagram for python.samplers.ParticleSampler:
Collaboration diagram for python.samplers.ParticleSampler:

Public Types

typedef HLT::TypeInformation::for_each_type_c< typenameEDMLIST::map, my_functor, my_result<>, my_arg< HLT::TypeInformation::get_cont, CONTAINER > >::type result

Public Member Functions

 __init__ (self, pid=999, mom=NullMomSampler(), n=1, pos=PosSampler(0, 0, 0))
 pid (self)
 pid (self, x)
 n (self)
 n (self, x)
 shoot (self)
 __call__ (self)

Public Attributes

 pid = pid
 mom = mom
 n = n
 pos = pos
 massdict = MASSES
 Pass mass info to the v4 sampler and set same generated mass.
bool mass_override = True

Protected Attributes

 _pid = mksampler(x)
 _n = mksampler(x)

Detailed Description

A simple N-independent-particle sampler.

Definition at line 853 of file samplers.py.

Member Typedef Documentation

◆ result

Definition at line 90 of file EDM_MasterSearch.h.

Constructor & Destructor Documentation

◆ __init__()

python.samplers.ParticleSampler.__init__ ( self,
pid = 999,
mom = NullMomSampler(),
n = 1,
pos = PosSampler(0, 0, 0) )

Definition at line 858 of file samplers.py.

861 pos=PosSampler(0, 0, 0)): # noqa: B008 (re-using same ConstSampler)
862 self.pid = pid
863 self.mom = mom
864 self.n = n
865 self.pos = pos
866 self.massdict = MASSES
867 self.mass_override = True
868

Member Function Documentation

◆ __call__()

python.samplers.Sampler.__call__ ( self)
inherited
This is the call method that will actually be used (so that normal
functions can also be passed in as samplers).

Definition at line 17 of file samplers.py.

17 def __call__(self):
18 """This is the call method that will actually be used (so that normal
19 functions can also be passed in as samplers)."""
20 return self.shoot()
21

◆ n() [1/2]

python.samplers.ParticleSampler.n ( self)

Definition at line 878 of file samplers.py.

878 def n(self):
879 "Particle number sampler"
880 return self._n

◆ n() [2/2]

python.samplers.ParticleSampler.n ( self,
x )

Definition at line 882 of file samplers.py.

882 def n(self, x):
883 self._n = mksampler(x)
884

◆ pid() [1/2]

python.samplers.ParticleSampler.pid ( self)

Definition at line 870 of file samplers.py.

870 def pid(self):
871 "Particle ID code sampler"
872 return self._pid

◆ pid() [2/2]

python.samplers.ParticleSampler.pid ( self,
x )

Definition at line 874 of file samplers.py.

874 def pid(self, x):
875 self._pid = mksampler(x)
876

◆ shoot()

python.samplers.ParticleSampler.shoot ( self)

Reimplemented from python.samplers.Sampler.

Definition at line 885 of file samplers.py.

885 def shoot(self):
886 "Return a vector of sampled particles"
887 numparticles = self.n()
888 rtn = []
889 for i in range(numparticles):
890
891 pid = self.pid()
892 p = SampledParticle(pid)
893
894 if self.mass_override and abs(pid) in self.massdict:
895 m = self.massdict[abs(pid)]
896 self.mom.mass = m
897 p.mass = m
898 # TODO: Should the particle generated_mass be set from the sampler by default?
899
900 p.mom = self.mom()
901 p.pos = self.pos()
902
903 rtn.append(p)
904 return rtn

Member Data Documentation

◆ _n

python.samplers.ParticleSampler._n = mksampler(x)
protected

Definition at line 883 of file samplers.py.

◆ _pid

python.samplers.ParticleSampler._pid = mksampler(x)
protected

Definition at line 875 of file samplers.py.

◆ mass_override

bool python.samplers.ParticleSampler.mass_override = True

Definition at line 867 of file samplers.py.

◆ massdict

python.samplers.ParticleSampler.massdict = MASSES

Pass mass info to the v4 sampler and set same generated mass.

Definition at line 866 of file samplers.py.

◆ mom

python.samplers.ParticleSampler.mom = mom

Definition at line 863 of file samplers.py.

◆ n

python.samplers.ParticleSampler.n = n

Definition at line 864 of file samplers.py.

◆ pid

python.samplers.ParticleSampler.pid = pid

Definition at line 862 of file samplers.py.

◆ pos

python.samplers.ParticleSampler.pos = pos

Definition at line 865 of file samplers.py.


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