Example #1
0
def _decorate(name=_name):
    """
    Make the decoration of functions and predicates
    """
    import LoKiMC.decorators as _LMC
    import LoKiPhys.decorators as _LRC
    import LoKiCore.decorators as _L
    _decorated = _decorate1(name)
    _decorated |= _decorate2(name)

    ## (re) decorate pids (Comparison with strings, integers and ParticleID objects:
    for t in (_LMC.MCID, _LMC.MCABSID, _LRC.ID, _LRC.ABSID):
        t = type(t)
        _L.decoratePID(t, LoKi.Dicts.PIDOps(t))
        _decorated.add(t)

    ##
    return _decorated  ## RETURN
Example #2
0
def _decorate(name=_name):
    """Make a decoration fo functions and predicates
    """
    import LoKiCore.decorators as _LoKiCore
    p = 'const LHCb::Particle*'
    v = 'const LHCb::VertexBase*'

    # "function" : Particle -> double

    _decorated = _LoKiCore.getAndDecorateFunctions(
        name,  ## module name  
        LoKi.Functor(p, 'double'),  ## the base
        LoKi.Dicts.ExtFunCalls(LHCb.Particle),  ## call-traits
        LoKi.Dicts.FuncOps(p, p))  ## operators&operations

    # "function" : Vertex -> double
    _decorated != _LoKiCore.getAndDecorateFunctions(
        name,  ## moduel name  
        LoKi.Functor(v, 'double'),  ## the base
        LoKi.Dicts.ExtFunCalls(LHCb.VertexBase),  ## call-traits
        LoKi.Dicts.FuncOps(v, v))  ## operators&operations

    # "predicate/cut" :  Particle -> bool
    _decorated != _LoKiCore.getAndDecoratePredicates(
        name,  ## module name  
        LoKi.Functor(p, bool),  ## the base
        LoKi.Dicts.ExtCutCalls(LHCb.Particle),  ## call-traits
        LoKi.Dicts.CutsOps(p, p))  ## operators&operations

    # "predicate/cut" :  Vertex -> bool
    _decorated != _LoKiCore.getAndDecoratePredicates(
        name,  ## module name  
        LoKi.Functor(v, bool),  ## the base
        LoKi.Dicts.ExtCutCalls(LHCb.VertexBase),  ## call-traits
        LoKi.Dicts.CutsOps(v, v))  ## operators&operations

    # (re)decorate pids (Comparison with strings, integers and ParticleID objects:
    for t in (_LoKiPhys.ID, _LoKiPhys.ABSID):
        t = type(t)
        _LoKiCore.decoratePID(t, LoKi.Dicts.PIDOps(t))
        _decorated.add(t)
    ##
    return _decorated  ## RETURN
Example #3
0
def _decorate ( name = _name ) :
    """
    Make the decoration of all objects from this module
    """
    import LoKiCore.decorators as _LoKiCore
    _mcp = 'const LHCb::MCParticle*'
    _mcv = 'const LHCb::MCVertex*'
    #_vp  = std.vector( _mcp )
    #_vv  = std.vector( _mcv )
    #_vd  = std.vector( 'double' )
    _vp  = 'std::vector<const LHCb::MCParticle*>' ## std.vector( _mcp )
    _vv  = 'std::vector<const LHCb::MCVertex*>'   ## std.vector( _mcv )
    _vd  = 'std::vector<double>'                  ## std.vector( 'double' )
    #
    
    # MCParticle -> double
    
    _decorated = _LoKiCore.getAndDecorateFunctions ( 
        name                                   , ## modulr name  
        LoKi.Functor   (_mcp,'double')         , ## the base
        LoKi.Dicts.FunCalls (LHCb.MCParticle)  , ## call-traits
        LoKi.Dicts.FuncOps  (_mcp,_mcp)        ) ## operators&operations
    
    # MCVertex -> double
    
    _decorated != _LoKiCore.getAndDecorateFunctions ( 
        name                                   , ## moduel name  
        LoKi.Functor   (_mcv,'double')         , ## the base
        LoKi.Dicts.FunCalls (LHCb.MCVertex)    , ## call-traits
        LoKi.Dicts.FuncOps  (_mcv,_mcv)        ) ## operators&operations
    
    # MCParticle -> bool
    
    _decorated != _LoKiCore.getAndDecoratePredicates  (
        name                                   , ## module name  
        LoKi.Functor   (_mcp,bool)             , ## the base
        LoKi.Dicts.CutCalls (LHCb.MCParticle)  , ## call-traits
        LoKi.Dicts.CutsOps  (_mcp,_mcp)        ) ## operators&operations
    
    # MCVertex -> bool
    
    _decorated != _LoKiCore.getAndDecoratePredicates  (
        name                                   , ## module name  
        LoKi.Functor   (_mcv,bool)             , ## the base
        LoKi.Dicts.CutCalls (LHCb.MCVertex)    , ## call-traits
        LoKi.Dicts.CutsOps  (_mcv,_mcv)        ) ## operators&operations

    ## functional part:
    
    # vector<T> -> vector<double>
    
    _decorated |= _LoKiCore.getAndDecorateMaps (
        name                                   , ## moduel name  
        LoKi.Functor   (_vp,_vd)               , ## the base
        LoKi.Dicts.MapsOps(_mcp)               ) ## call-traits
    _decorated |= _LoKiCore.getAndDecorateMaps (
        name                                   , ## moduel name  
        LoKi.Functor   (_vv,_vd)               , ## the base
        LoKi.Dicts.MapsOps(_mcv)               ) ## call-traits

    # vector<T> -> vector<T>

    _decorated |= _LoKiCore.getAndDecoratePipes (
        name                                   , ## module name  
        LoKi.Functor   (_vp,_vp)               , ## the base
        LoKi.Dicts.PipeOps(_mcp,_mcp)          ) ## call-traits
    _decorated |= _LoKiCore.getAndDecoratePipes (
        name                                   , ## module name  
        LoKi.Functor   (_vv,_vv)               , ## the base
        LoKi.Dicts.PipeOps(_mcv,_mcv)          ) ## call-traits

    # vector<T> -> double
    
    _decorated |= _LoKiCore.getAndDecorateFunVals ( 
        name                                   , ## module name  
        LoKi.Functor   (_vp,'double')          , ## the base
        LoKi.Dicts.FunValOps(_mcp)             ) ## call-traits
    _decorated |= _LoKiCore.getAndDecorateFunVals ( 
        name                                   , ## module name  
        LoKi.Functor   (_vv,'double')          , ## the base
        LoKi.Dicts.FunValOps(_mcv)             ) ## call-traits

    # vector<T> -> bool

    _decorated |= _LoKiCore.getAndDecorateCutVals ( 
        name                                   , ## module name  
        LoKi.Functor   (_vp,bool)              , ## the base
        LoKi.Dicts.CutValOps(_mcp)             ) ## call-traits
    _decorated |= _LoKiCore.getAndDecorateCutVals ( 
        name                                   , ## module name  
        LoKi.Functor   (_vv,bool)              , ## the base
        LoKi.Dicts.CutValOps(_mcv)             ) ## call-traits

     #sources : void -> vector<T>

    _decorated |= _LoKiCore.getAndDecorateSources  (  
        name                                   , ## module name  
        LoKi.Functor   ('void',_vp)            , ## the base
        LoKi.Dicts.SourceOps(_mcp,_mcp)        ) ## call-traits
    _decorated |= _LoKiCore.getAndDecorateSources  (  
        name                                   , ## module name  
        LoKi.Functor   ('void',_vv)            , ## the base
        LoKi.Dicts.SourceOps(_mcv,_mcv)        ) ## call-traits


    ## primitive voids:

    _decorated |= _LoKiCore.getAndDecoratePrimitiveVoids ( name ) 
    
    
    ## decorate pids (Comparison with strings, integers and ParticleID objects:
    for t in ( MCID , MCABSID ) :
        t = type ( t ) 
        _LoKiCore.decoratePID ( t , LoKi.Dicts.PIDOps ( t ) )
        _decorated.add ( t )

        
    return _decorated
Example #4
0
def _decorate(name=_name):
    """ Make the decoration of all objects fomr this module """
    import LoKiCore.decorators as _LoKiCore
    _gp = 'const HepMC::GenParticle*'
    _gv = 'const HepMC::GenVertex*'

    ## _vgp = std.vector ( _gp      )
    ## _vgv = std.vector ( _gv      )
    ## _vd  = std.vector ( 'double' )

    _vgp = 'std::vector<const HepMC::GenParticle*>'
    _vgv = 'std::vector<const HepMC::GenVertex*>'
    _vd = 'std::vector<double>'

    # T -> double

    _decorated = _LoKiCore.getAndDecorateFunctions(
        name,  ## moduel name  
        LoKi.Functor(_gp, 'double'),  ## the base
        LoKi.Dicts.FunCalls(HepMC.GenParticle),  ## call-traits
        LoKi.Dicts.FuncOps(_gp, _gp))  ## operators&operations

    _decorated |= _LoKiCore.getAndDecorateFunctions(
        name,  ## module name  
        LoKi.Functor(_gv, 'double'),  ## the base
        LoKi.Dicts.FunCalls(HepMC.GenVertex),  ## call-traits
        LoKi.Dicts.FuncOps(_gv, _gv))  ## operators&operations

    # T -> bool

    _decorated |= _LoKiCore.getAndDecoratePredicates(
        name,  ## module name  
        LoKi.Functor(_gp, bool),  ## the base
        LoKi.Dicts.CutCalls(HepMC.GenParticle),  ## call-traits
        LoKi.Dicts.CutsOps(_gp, _gp))  ## operators&operations

    _decorated |= _LoKiCore.getAndDecoratePredicates(
        name,  ## module name  
        LoKi.Functor(_gv, bool),  ## the base
        LoKi.Dicts.CutCalls(HepMC.GenVertex),  ## call-traits
        LoKi.Dicts.CutsOps(_gv, _gv))  ## operators&operations

    # functional part

    # map: vector<T> -> vector<double>

    _decorated |= _LoKiCore.getAndDecorateMaps(
        name,  ## moduel name  
        LoKi.Functor(_vgp, _vd),  ## the base
        LoKi.Dicts.MapsOps(_gp))  ## call-traits
    _decorated |= _LoKiCore.getAndDecorateMaps(
        name,  ## moduel name  
        LoKi.Functor(_vgv, _vd),  ## the base
        LoKi.Dicts.MapsOps(_gv))  ## call-traits

    # pipe: vector<T> -> vector<T>

    _decorated |= _LoKiCore.getAndDecoratePipes(
        name,  ## module name  
        LoKi.Functor(_vgp, _vgp),  ## the base
        LoKi.Dicts.PipeOps(_gp, _gp))  ## call-traits
    _decorated |= _LoKiCore.getAndDecoratePipes(
        name,  ## module name  
        LoKi.Functor(_vgv, _vgv),  ## the base
        LoKi.Dicts.PipeOps(_gv, _gv))  ## call-traits

    # vector<T> -> double

    _decorated |= _LoKiCore.getAndDecorateFunVals(
        name,  ## module name  
        LoKi.Functor(_vgp, 'double'),  ## the base
        LoKi.Dicts.FunValOps(_gp))  ## call-traits
    _decorated |= _LoKiCore.getAndDecorateFunVals(
        name,  ## module name  
        LoKi.Functor(_vgv, 'double'),  ## the base
        LoKi.Dicts.FunValOps(_gv))  ## call-traits

    # vector<T> -> bool

    _decorated |= _LoKiCore.getAndDecorateCutVals(
        name,  ## module name  
        LoKi.Functor(_vgp, bool),  ## the base
        LoKi.Dicts.CutValOps(_gp))  ## call-traits

    _decorated |= _LoKiCore.getAndDecorateCutVals(
        name,  ## module name  
        LoKi.Functor(_vgv, bool),  ## the base
        LoKi.Dicts.CutValOps(_gv))  ## call-traits

    #sources : void -> vector<T>

    _decorated |= _LoKiCore.getAndDecorateSources(
        name,  ## module name  
        LoKi.Functor('void', _vgp),  ## the base
        LoKi.Dicts.SourceOps(_gp, _gp))  ## call-traits

    _decorated |= _LoKiCore.getAndDecorateSources(
        name,  ## module name  
        LoKi.Functor('void', _vgv),  ## the base
        LoKi.Dicts.SourceOps(_gv, _gv))  ## call-traits

    # decorate pids (Comparison with strings, integers and ParticleID objects:
    for t in (GID, GABSID):
        t = type(t)
        _LoKiCore.decoratePID(t, LoKi.Dicts.PIDOps(t))
        _decorated.add(t)
    ##
    return _decorated  ## RETURN
Example #5
0
def _decorate(name=_name):
    """
    Make the decoration of all objects from this module
    """

    import LoKiCore.decorators as _LoKiCore

    p = 'const LHCb::Particle*'
    v = 'const LHCb::VertexBase*'
    d = 'double'
    _vp = 'std::vector<const LHCb::Particle*>'  ## std.vector( p )
    _vv = 'std::vector<const LHCb::VertexBase*>'  ## std.vector( v )
    _vd = 'std::vector<double>'  ## std.vector( 'double' )
    #_vp  = std.vector( p )
    #_vv  = std.vector( v )
    #_vd  = std.vector( 'double' )
    #

    # "function" : Particle -> double
    _decorated = _LoKiCore.getAndDecorateFunctions(
        name,  ## module name                                   , ## the base 
        LoKi.Functor(p, 'double'),  ## the base
        LoKi.Dicts.FunCalls(LHCb.Particle),  ## call-traits
        LoKi.Dicts.FuncOps(p, p))  ## operators&operations

    # "function" : Vertex -> double
    _decorated |= _LoKiCore.getAndDecorateFunctions(
        name,  ## module name  
        LoKi.Functor(v, 'double'),  ## the base
        LoKi.Dicts.FunCalls(LHCb.VertexBase),  ## call-traits
        LoKi.Dicts.FuncOps(v, v))  ## operators&operations

    # "predicate/cut" :  Particle -> bool
    _decorated |= _LoKiCore.getAndDecoratePredicates(
        name,  ## module name  
        LoKi.Functor(p, bool),  ## the base
        LoKi.Dicts.CutCalls(LHCb.Particle),  ## call-traits
        LoKi.Dicts.CutsOps(p, p))  ## operators&operations

    # "predicate/cut" :  Vertex -> bool
    _decorated |= _LoKiCore.getAndDecoratePredicates(
        name,  ## moduel name  
        LoKi.Functor(v, bool),  ## the base
        LoKi.Dicts.CutCalls(LHCb.VertexBase),  ## call-traits
        LoKi.Dicts.CutsOps(v, v))  ## operators&operations

    # =========================================================================
    ## functional part:
    # =========================================================================

    # "map" : vector<T> -> vector<double>
    _decorated |= _LoKiCore.getAndDecorateMaps(
        name,  ## module name  
        LoKi.Functor(_vp, _vd),  ## the base
        LoKi.Dicts.MapsOps(p))  ## call-traits
    _decorated |= _LoKiCore.getAndDecorateMaps(
        name,  ## module name  
        LoKi.Functor(_vv, _vd),  ## the base
        LoKi.Dicts.MapsOps(v))  ## call-traits

    # "pipe" : vector<T> -> vector<T>
    _decorated |= _LoKiCore.getAndDecoratePipes(
        name,  ## module name  
        LoKi.Functor(_vp, _vp),  ## the base
        LoKi.Dicts.PipeOps(p, p))  ## call-traits
    _decorated |= _LoKiCore.getAndDecoratePipes(
        name,  ## module name  
        LoKi.Functor(_vv, _vv),  ## the base
        LoKi.Dicts.PipeOps(v, v))  ## call-traits

    # "funval" : vector<T> -> double
    _decorated |= _LoKiCore.getAndDecorateFunVals(
        name,  ## module name  
        LoKi.Functor(_vp, 'double'),  ## the base
        LoKi.Dicts.FunValOps(p))  ## call-traits
    _decorated |= _LoKiCore.getAndDecorateFunVals(
        name,  ## module name  
        LoKi.Functor(_vv, 'double'),  ## the base
        LoKi.Dicts.FunValOps(v))  ## call-traits

    # "cutval" : vector<T> -> bool
    _decorated |= _LoKiCore.getAndDecorateCutVals(
        name,  ## module name  
        LoKi.Functor(_vp, bool),  ## the base
        LoKi.Dicts.CutValOps(p))  ## call-traits
    _decorated |= _LoKiCore.getAndDecorateCutVals(
        name,  ## module name  
        LoKi.Functor(_vv, bool),  ## the base
        LoKi.Dicts.CutValOps(v))  ## call-traits

    # 'source' : void -> vector<T>
    _decorated |= _LoKiCore.getAndDecorateSources(
        name,  ## module name  
        LoKi.Functor('void', _vp),  ## the base
        LoKi.Dicts.SourceOps(p, p))  ## call-traits
    _decorated |= _LoKiCore.getAndDecorateSources(
        name,  ## module name  
        LoKi.Functor('void', _vv),  ## the base
        LoKi.Dicts.SourceOps(v, v))  ## call-traits

    # 'infos'
    _decorated |= _LoKiCore.getAndDecorateInfos(
        name,  ## module name
        LoKi.Functor(p, 'double'),  ## the base 
        LoKi.Dicts.InfoOps(p))  ## methods
    _decorated |= _LoKiCore.getAndDecorateInfos(
        name,  ## module name
        LoKi.Functor(v, 'double'),  ## the base 
        LoKi.Dicts.InfoOps(v))  ## methods

    ## void primitives
    _decorated |= _LoKiCore.getAndDecoratePrimitiveVoids(name)

    # decorate pids (Comparison with strings, integers and ParticleID objects:
    for t in (ID, ABSID):
        t = type(t)
        _LoKiCore.decoratePID(t, LoKi.Dicts.PIDOps(t))
        _decorated.add(t)
    ##
    return _decorated