All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
cafana.PyCAFAna Class Reference

Public Member Functions

def __init__
 
def CSliceVar
 
def CSpillVar
 
def SimpleSliceVar
 
def SimpleSpillVar
 
def CSliceCut
 
def CSpillCut
 
def __getattr__
 

Private Attributes

 _cppyy
 

Detailed Description

Definition at line 61 of file cafana.py.

Constructor & Destructor Documentation

def cafana.PyCAFAna.__init__ (   self,
  cppyy 
)

Definition at line 62 of file cafana.py.

62 
63  def __init__(self, cppyy):
64  self._cppyy = cppyy
def __init__
Definition: cafana.py:62

Member Function Documentation

def cafana.PyCAFAna.__getattr__ (   self,
  name 
)

Definition at line 103 of file cafana.py.

104  def __getattr__(self, name):
105  return getattr(self._cppyy.gbl.ana, name)
def __getattr__
Definition: cafana.py:103
def cafana.PyCAFAna.CSliceCut (   self,
  body 
)
Construct a new Cut given the C++ body as a string

Definition at line 87 of file cafana.py.

87 
88  def CSliceCut(self, body):
89  '''Construct a new Cut given the C++ body as a string'''
90  cut = 'pycut_'+self._cppyy.gbl.ana.UniqueName()
91  text = '#include "sbnanaobj/StandardRecord/Proxy/SRProxy.h"\nbool '+cut+'_func(const caf::SRSliceProxy* srp){\nconst caf::SRSliceProxy& sr = *srp;\n'+body+'\n}\nconst ana::Cut '+cut+'('+cut+'_func);'
92  self._cppyy.cppdef(text)
93  return getattr(self._cppyy.gbl, cut)
def CSliceCut
Definition: cafana.py:87
def cafana.PyCAFAna.CSliceVar (   self,
  body 
)
Construct a new slice Var given the C++ body as a string

Definition at line 65 of file cafana.py.

65 
66  def CSliceVar(self, body):
67  '''Construct a new slice Var given the C++ body as a string'''
68  var = 'pyvar_'+self._cppyy.gbl.ana.UniqueName()
69  text = '#include "sbnanaobj/StandardRecord/Proxy/SRProxy.h"\ndouble '+var+'_func(const caf::SRSliceProxy* srp){\nconst caf::SRSliceProxy& sr = *srp;\n'+body+'\n}\nconst ana::Var '+var+'('+var+'_func);'
70  self._cppyy.cppdef(text)
71  return getattr(self._cppyy.gbl, var)
def CSliceVar
Definition: cafana.py:65
def cafana.PyCAFAna.CSpillCut (   self,
  body 
)
Construct a new Cut given the C++ body as a string

Definition at line 94 of file cafana.py.

94 
95  def CSpillCut(self, body):
96  '''Construct a new Cut given the C++ body as a string'''
97  cut = 'pycut_'+self._cppyy.gbl.ana.UniqueName()
98  text = '#include "sbnanaobj/StandardRecord/Proxy/SRProxy.h"\nbool '+cut+'_func(const caf::SRSpillProxy* srp){\nconst caf::SRSpillProxy& sr = *srp;\n'+body+'\n}\nconst ana::Cut '+cut+'('+cut+'_func);'
99  self._cppyy.cppdef(text)
100  return getattr(self._cppyy.gbl, cut)
101 
def CSpillCut
Definition: cafana.py:94
def cafana.PyCAFAna.CSpillVar (   self,
  body 
)
Construct a new spill Var given the C++ body as a string

Definition at line 72 of file cafana.py.

72 
73  def CSpillVar(self, body):
74  '''Construct a new spill Var given the C++ body as a string'''
75  var = 'pyvar_'+self._cppyy.gbl.ana.UniqueName()
76  text = '#include "sbnanaobj/StandardRecord/Proxy/SRProxy.h"\ndouble '+var+'_func(const caf::SRSpillProxy* srp){\nconst caf::SRSpillProxy& sr = *srp;\n'+body+'\n}\nconst ana::Var '+var+'('+var+'_func);'
77  self._cppyy.cppdef(text)
78  return getattr(self._cppyy.gbl, var)
def CSpillVar
Definition: cafana.py:72
def cafana.PyCAFAna.SimpleSliceVar (   self,
  name 
)
Equivalent of the SIMPLEVAR() macro

Definition at line 79 of file cafana.py.

79 
80  def SimpleSliceVar(self, name):
81  '''Equivalent of the SIMPLEVAR() macro'''
82  return self.CSliceVar('return sr.'+name+';')
def SimpleSliceVar
Definition: cafana.py:79
def CSliceVar
Definition: cafana.py:65
def cafana.PyCAFAna.SimpleSpillVar (   self,
  name 
)
Equivalent of the SIMPLEVAR() macro

Definition at line 83 of file cafana.py.

83 
84  def SimpleSpillVar(self, name):
85  '''Equivalent of the SIMPLEVAR() macro'''
86  return self.CSpillVar('return sr.'+name+';')
def SimpleSpillVar
Definition: cafana.py:83
def CSpillVar
Definition: cafana.py:72

Member Data Documentation

cafana.PyCAFAna._cppyy
private

Definition at line 63 of file cafana.py.


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