ATLAS Offline Software
Loading...
Searching...
No Matches
LHETools.Record Class Reference
Inheritance diagram for LHETools.Record:
Collaboration diagram for LHETools.Record:

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, **kwargs)
 from_string (cls, string)
 to_string (self)

Public Attributes

 invalid = not (set(kwargs.keys()) == set(self.FIELD_NAMES))
 FIELD_NAMES

Detailed Description

Definition at line 16 of file LHETools.py.

Member Typedef Documentation

◆ result

Definition at line 90 of file EDM_MasterSearch.h.

Constructor & Destructor Documentation

◆ __init__()

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
STL class.

Member Function Documentation

◆ from_string()

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()

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
static std::string to_string(const std::vector< T > &v)

Member Data Documentation

◆ FIELD_NAMES

LHETools.Record.FIELD_NAMES

Definition at line 24 of file LHETools.py.

◆ invalid

LHETools.Record.invalid = not (set(kwargs.keys()) == set(self.FIELD_NAMES))

Definition at line 18 of file LHETools.py.


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