ATLAS Offline Software
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
LHETools.Particle Class Reference
Inheritance diagram for LHETools.Particle:
Collaboration diagram for LHETools.Particle:

Public Member Functions

def mothers (self)
 
def daughters (self)
 
def index (self)
 
def from_string (cls, string)
 
def to_string (self)
 

Public Attributes

 invalid
 

Static Public Attributes

list FIELD_NAMES
 
dictionary FIELD_TYPES
 
string FMT = "{pdg_id:8d} {status:5d} {mother0:5d} {mother1:5d} {colour0:5d} {colour1:5d} {px: .9E} {py: .9E} {pz: .9E} {e: .9E} {m: .9E} {lifetime: .5E} {spin: .3E}"
 

Detailed Description

Definition at line 57 of file LHETools.py.

Member Function Documentation

◆ daughters()

def LHETools.Particle.daughters (   self)

Definition at line 88 of file LHETools.py.

88  def daughters(self):
89  self_id = self.index() + 1
90  for p in self.event:
91  if p.mother0 <= self_id <= p.mother1:
92  yield p
93 

◆ from_string()

def LHETools.Record.from_string (   cls,
  string 
)
inherited

Definition at line 23 of file LHETools.py.

23  def from_string(cls, string):
24  if len(cls.FIELD_NAMES) != len(string.split()):
25  LHEToolsLog.warning("Inconsistent number of fields in lhe file line:")
26  LHEToolsLog.warning(string)
27  return cls()
28  try:
29  return cls(**dict(zip(cls.FIELD_NAMES, string.split())))
30  except:
31  LHEToolsLog.warning("Impossible to interpret lhe file line:")
32  LHEToolsLog.warning(string)
33  return cls()
34 

◆ index()

def LHETools.Particle.index (   self)

Definition at line 94 of file LHETools.py.

94  def index(self):
95  return self.event.particles.index(self)
96 
97 

◆ mothers()

def LHETools.Particle.mothers (   self)

Definition at line 84 of file LHETools.py.

84  def mothers(self):
85  return (self.event.particles[mo]
86  for mo in xrange(self.mother0 - 1, self.mother1))
87 

◆ to_string()

def LHETools.Record.to_string (   self)
inherited

Definition at line 35 of file LHETools.py.

35  def to_string(self):
36  return self.FMT.format(**{field: getattr(self, field) for field in self.FIELD_NAMES}) if not self.invalid else ""
37 
38 

Member Data Documentation

◆ FIELD_NAMES

list LHETools.Particle.FIELD_NAMES
static
Initial value:
= [
'pdg_id', 'status', 'mother0', 'mother1', 'colour0', 'colour1', 'px',
'py', 'pz', 'e', 'm', 'lifetime', 'spin'
]

Definition at line 59 of file LHETools.py.

◆ FIELD_TYPES

dictionary LHETools.Particle.FIELD_TYPES
static
Initial value:
= {
'pdg_id': int,
'status': int,
'mother0': int,
'mother1': int,
'colour0': int,
'colour1': int,
'px': float,
'py': float,
'pz': float,
'e': float,
'm': float,
'lifetime': float,
'spin': float
}

Definition at line 65 of file LHETools.py.

◆ FMT

string LHETools.Particle.FMT = "{pdg_id:8d} {status:5d} {mother0:5d} {mother1:5d} {colour0:5d} {colour1:5d} {px: .9E} {py: .9E} {pz: .9E} {e: .9E} {m: .9E} {lifetime: .5E} {spin: .3E}"
static

Definition at line 82 of file LHETools.py.

◆ invalid

LHETools.Record.invalid
inherited

Definition at line 18 of file LHETools.py.


The documentation for this class was generated from the following file:
xrange
void xrange(TH1 *h, bool symmetric)
Definition: computils.cxx:516
vtune_athena.format
format
Definition: vtune_athena.py:14
CaloClusterListBadChannel.cls
cls
Definition: CaloClusterListBadChannel.py:8
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
DeMoScan.index
string index
Definition: DeMoScan.py:364