Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
PhysicsTools
Heppy
python
physicsutils
TauDecayModes.py
Go to the documentation of this file.
1
2
class
TauDecayModes
(
object
):
3
4
def
__init__
(self):
5
self.
_decayModes
()
6
7
def
_decayModes
(self):
8
'''Builds the internal dictionaries from the enum defined in
9
http://cmslxr.fnal.gov/lxr/source/DataFormats/TauReco/interface/PFTau.h'''
10
tmp = [
11
'kNull'
,
12
'kOneProng0PiZero'
,
13
'kOneProng1PiZero'
,
14
'kOneProng2PiZero'
,
15
'kOneProng3PiZero'
,
16
'kOneProngNPiZero'
,
17
'kTwoProng0PiZero'
,
18
'kTwoProng1PiZero'
,
19
'kTwoProng2PiZero'
,
20
'kTwoProng3PiZero'
,
21
'kTwoProngNPiZero'
,
22
'kThreeProng0PiZero'
,
23
'kThreeProng1PiZero'
,
24
'kThreeProng2PiZero'
,
25
'kThreeProng3PiZero'
,
26
'kThreeProngNPiZero'
,
27
'kRareDecayMode'
28
]
29
self.
decayModes
=
dict
( (index-1, name)
for
index, name
in
enumerate( tmp ) )
30
self.
decayModeNames
=
dict
( (value, key)
for
key, value \
31
in
self.decayModes.iteritems() )
32
33
def
intToName
( self, anInt ):
34
'''Returns the decay mode name corresponding to an int.'''
35
return
self.
decayModes
[ anInt ]
36
37
def
nameToInt
( self, aName ):
38
'''Returns the decay mode int corresponding to a name.'''
39
return
self.
decayModeNames
[ aName ]
40
41
def
__str__
(self):
42
return
str( self.
decayModes
)
43
44
tauDecayModes =
TauDecayModes
()
45
46
if
__name__ ==
'__main__'
:
47
48
dec =
TauDecayModes
()
49
print
dec
50
51
print
0, dec.intToName(0)
52
print
'kThreeProng0PiZero'
, dec.nameToInt(
'kThreeProng0PiZero'
)
python.multivaluedict.dict
dict
Definition:
multivaluedict.py:25
TauDecayModes.TauDecayModes.__str__
def __str__
Definition:
TauDecayModes.py:41
TauDecayModes.TauDecayModes.intToName
def intToName
Definition:
TauDecayModes.py:33
TauDecayModes.TauDecayModes.nameToInt
def nameToInt
Definition:
TauDecayModes.py:37
TauDecayModes.TauDecayModes._decayModes
def _decayModes
Definition:
TauDecayModes.py:7
TauDecayModes.TauDecayModes.__init__
def __init__
Definition:
TauDecayModes.py:4
TauDecayModes.TauDecayModes.decayModeNames
decayModeNames
Definition:
TauDecayModes.py:30
dbtoconf.object
list object
Definition:
dbtoconf.py:77
TauDecayModes.TauDecayModes
Definition:
TauDecayModes.py:2
TauDecayModes.TauDecayModes.decayModes
decayModes
Definition:
TauDecayModes.py:29
Generated for CMSSW Reference Manual by
1.8.5