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

Public Member Functions

def __init__ (self, **kwargs)
 
def from_string (cls, string)
 
def to_string (self)
 

Public Attributes

 invalid
 

Detailed Description

Definition at line 16 of file LHETools.py.

Constructor & Destructor Documentation

◆ __init__()

def LHETools.Record.__init__ (   self,
**  kwargs 
)

Definition at line 17 of file LHETools.py.

17  def __init__(self, **kwargs):
18  self.invalid = not (set(kwargs.keys()) == set(self.FIELD_NAMES))
19  self.__dict__.update({field: self.FIELD_TYPES[field](value)
20  for field, value in kwargs.items()})
21 

Member Function Documentation

◆ from_string()

def LHETools.Record.from_string (   cls,
  string 
)

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 

◆ to_string()

def LHETools.Record.to_string (   self)

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

◆ invalid

LHETools.Record.invalid

Definition at line 18 of file LHETools.py.


The documentation for this class was generated from the following file:
vtune_athena.format
format
Definition: vtune_athena.py:14
CaloClusterListBadChannel.cls
cls
Definition: CaloClusterListBadChannel.py:8
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
WriteBchToCool.update
update
Definition: WriteBchToCool.py:67