CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList Class Reference
Inheritance diagram for Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList:

Public Member Functions

def __init__ (self, list=None)
 
def addParticle (self, ids, names, particleData)
 
def getDefaultId (self, id)
 
def getDefaultName (self, name)
 
def getIdFromName (self, name)
 
def getList (self)
 
def getNameFromId (self, id)
 
def getParticleDataFromId (self, id)
 
def isBosonId (self, id)
 
def isGluonId (self, id)
 
def isHiggsId (self, id)
 
def isLeptonId (self, id)
 
def isPhotonId (self, id)
 
def isQuarkId (self, id)
 
def isSusyId (self, id)
 
def setList (self, list)
 

Private Attributes

 _list
 

Detailed Description

Class for generic handling particle ids, names and properties.

Multiple ids can be mapped to multiple names of particle.
First name/id in the list is the default name. But additional names/ids can be given.
An examples can be found in the defaultParticleDataList.

Definition at line 10 of file ParticleDataList.py.

Constructor & Destructor Documentation

def Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList.__init__ (   self,
  list = None 
)
A list of particle ids and names can be given to the constructor.

Definition at line 17 of file ParticleDataList.py.

17  def __init__(self, list=None):
18  """ A list of particle ids and names can be given to the constructor.
19  """
20  self._list = []
21  if list != None:
22  self._list = list
23 

Member Function Documentation

def Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList.addParticle (   self,
  ids,
  names,
  particleData 
)
Add a paricle with (multiple) ids and names to the list.

Definition at line 30 of file ParticleDataList.py.

References Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList._list.

30  def addParticle(self, ids, names, particleData):
31  """ Add a paricle with (multiple) ids and names to the list.
32  """
33  if not (isinstance(ids,list) and isinstance(names,list)):
34  raise TypeError("addParticle needs to lists as input: e.g. [1,-1],['d','dbar']")
35  self._list += [(ids, names, particleData)]
36 
def Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList.getDefaultId (   self,
  id 
)
Return the default (first in list) id given any of the particle's ids.

Definition at line 45 of file ParticleDataList.py.

References Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList._list.

45  def getDefaultId(self, id):
46  """ Return the default (first in list) id given any of the particle's ids.
47  """
48  for items in self._list:
49  if id in items[0]:
50  return items[0][0]
51  return id
52 
def Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList.getDefaultName (   self,
  name 
)
Return the default (first in list) name given any of the particle's names.

Definition at line 37 of file ParticleDataList.py.

References Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList._list.

37  def getDefaultName(self, name):
38  """ Return the default (first in list) name given any of the particle's names.
39  """
40  for items in self._list:
41  if name in items[1]:
42  return items[1][0]
43  return name
44 
def Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList.getIdFromName (   self,
  name 
)
Return the default (first in list) id given any of the particle's names.

Definition at line 53 of file ParticleDataList.py.

References Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList._list.

53  def getIdFromName(self, name):
54  """ Return the default (first in list) id given any of the particle's names.
55  """
56  for items in self._list:
57  if name in items[1]:
58  return items[0][0]
59  return 0
60 
def Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList.getList (   self)
def Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList.getNameFromId (   self,
  id 
)
Return the default (first in list) name given any of the particle's ids.

Definition at line 61 of file ParticleDataList.py.

References Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList._list.

61  def getNameFromId(self, id):
62  """ Return the default (first in list) name given any of the particle's ids.
63  """
64  for items in self._list:
65  if id in items[0]:
66  return items[1][0]
67  return "unknown"
68 
def Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList.getParticleDataFromId (   self,
  id 
)

Definition at line 69 of file ParticleDataList.py.

References Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList._list.

69  def getParticleDataFromId(self, id):
70  for items in self._list:
71  if id in items[0]:
72  return items[2]
73 
def Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList.isBosonId (   self,
  id 
)

Definition at line 83 of file ParticleDataList.py.

References funct.abs().

83  def isBosonId(self, id):
84  return abs(id) in [21, 9, 22, 23, 24, 25, 32, 33, 34, 35, 36, 37]
85 
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList.isGluonId (   self,
  id 
)

Definition at line 80 of file ParticleDataList.py.

References funct.abs().

80  def isGluonId(self, id):
81  return abs(id) in [21, 9]
82 
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList.isHiggsId (   self,
  id 
)

Definition at line 89 of file ParticleDataList.py.

References funct.abs().

89  def isHiggsId(self, id):
90  return abs(id) in [25, 35, 36, 37]
91 
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList.isLeptonId (   self,
  id 
)

Definition at line 77 of file ParticleDataList.py.

References funct.abs().

77  def isLeptonId(self, id):
78  return abs(id) in [11, 12, 13, 14, 15, 16]
79 
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList.isPhotonId (   self,
  id 
)

Definition at line 86 of file ParticleDataList.py.

86  def isPhotonId(self, id):
87  return id == 22
88 
def Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList.isQuarkId (   self,
  id 
)

Definition at line 74 of file ParticleDataList.py.

References funct.abs().

74  def isQuarkId(self, id):
75  return abs(id) in [1, 2, 3, 4, 5, 6]
76 
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList.isSusyId (   self,
  id 
)

Definition at line 92 of file ParticleDataList.py.

References funct.abs().

92  def isSusyId(self, id):
93  return abs(id) in [1000001, 1000002, 1000003, 1000004, 1000005, 1000006, 1000011, 1000012, 1000013, 1000014, 1000015, 1000016, 2000001, 2000002, 2000003, 2000004, 2000005, 2000006, 2000011, 2000013, 1000021, 1000022, 1000023, 1000024, 1000025, 1000035, 1000037, 1000039]
94 
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList.setList (   self,
  list 
)

Member Data Documentation

Vispa.Plugins.EdmBrowser.ParticleDataList.ParticleDataList._list
private