Belle II Software  release-08-01-10
DecayHashMap Class Reference

Public Member Functions

def __init__ (self, rootfile, removeRadiativeGammaFlag=False)
 
def get_string (self, decayHash, decayHashExtended)
 
def get_original_decay (self, decayHash, decayHashExtended)
 
def get_reconstructed_decay (self, decayHash, decayHashExtended)
 
def print_hash (self, decayHash, decayHashExtended)
 

Private Attributes

 _string
 Dict Int -> DecayStrings.
 
 _forest
 Dict Int -> Reconstructed DecayTree.
 

Detailed Description

DecayHashMap using the C++ implementation of DecayTree and DecayNode

Definition at line 49 of file decayHash.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  rootfile,
  removeRadiativeGammaFlag = False 
)
Constructor

Definition at line 54 of file decayHash.py.

54  def __init__(self, rootfile, removeRadiativeGammaFlag=False):
55  """Constructor"""
56  # Always avoid the top-level 'import ROOT'.
57  import ROOT # noqa
58  with uproot.open(rootfile) as rf:
59  trees = rf.keys()
60  assert len(trees) == 1
61  ntuple = rf[trees[0]].arrays(library='np')
62  # self._removeGammaFlag = removeRadiativeGammaFlag
63 
64  self._string = {}
65 
66  self._forest = {}
67  for decayHash, decayHashExtended, decayString in zip(
68  ntuple['decayHash'], ntuple['decayHashExtended'], ntuple['decayString']):
69  decayInt = ROOT.Belle2.DecayForest.decayHashFloatToInt(decayHash, decayHashExtended)
70  if decayInt in self._string:
71  continue
72  self._string[decayInt] = decayString
73  self._forest[decayInt] = ROOT.Belle2.DecayForest(decayString, True, removeRadiativeGammaFlag)
74 

Member Function Documentation

◆ get_original_decay()

def get_original_decay (   self,
  decayHash,
  decayHashExtended 
)
Return original (MC) DecayTree given the decayHash and decayHashExtended
@param decayHash output of extraInfo(decayHash)
@param decayHashExtended output of extraInfo(decayHashExtended)

Definition at line 85 of file decayHash.py.

◆ get_reconstructed_decay()

def get_reconstructed_decay (   self,
  decayHash,
  decayHashExtended 
)
Return reconstructed DecayTree given the decayHash and decayHashExtended
@param decayHash output of extraInfo(decayHash)
@param decayHashExtended output of extraInfo(decayHashExtended)

Definition at line 95 of file decayHash.py.

◆ get_string()

def get_string (   self,
  decayHash,
  decayHashExtended 
)
Return DecayString given the decayHash and decayHashExtended
@param decayHash output of extraInfo(decayHash)
@param decayHashExtended output of extraInfo(decayHashExtended)

Definition at line 75 of file decayHash.py.

◆ print_hash()

def print_hash (   self,
  decayHash,
  decayHashExtended 
)
Print the DecayString in a fancy way given the decayHash and decayHashExtended
@param decayHash output of extraInfo(decayHash)
@param decayHashExtended output of extraInfo(decayHashExtended)

Definition at line 105 of file decayHash.py.


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