当前位置: 首页>>代码示例>>Python>>正文


Python Filters.LoKi_Filters类代码示例

本文整理汇总了Python中PhysConf.Filters.LoKi_Filters的典型用法代码示例。如果您正苦于以下问题:Python LoKi_Filters类的具体用法?Python LoKi_Filters怎么用?Python LoKi_Filters使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了LoKi_Filters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: configure_common

def configure_common(rootInTES,
                     datafiles,
                     catalogs=[],
                     castor=False):
    """
    Job configuration 
    """

    from Configurables import DaVinci  # needed for job configuration
    from Configurables import EventSelector  # needed for job configuration
    from Configurables import FileCatalog  # needed for job configuration
    from Configurables import NTupleSvc  # needed for job configuration

    from PhysConf.Filters import LoKi_Filters

    fltrs = LoKi_Filters(
        STRIP_Code="""
        HLT_PASS_RE ( 'Stripping.*CharmAndDiMuon.*Decision' ) |
        HLT_PASS_RE ( 'Stripping.*DiMuonAndCharm.*Decision' ) |
        HLT_PASS_RE ( 'Stripping.*DiCharm.*Decision'        ) | 
        HLT_PASS_RE ( 'Stripping.*DoubleDiMuon.*Decision'   ) 
        """
    )
    filters = fltrs.filters('Filters')
    # filters.reverse()

    davinci = DaVinci(
        DataType='2011',
        InputType='MDST',
        Simulation=False,
        PrintFreq=1000,
        EventPreFilters=filters,
        EvtMax=-1,
        #
        HistogramFile='2xCharm_Histos.root',
        TupleFile='2xCharm.root',
        #
        Lumi=True,
        #
    )

    from Configurables import CondDB
    CondDB(UseLatestTags=["2011"],
           ## UseOracle     = True
           )

    # from Configurables import Gaudi__IODataManager as IODataManager
    # IODataManager().AgeLimit = 2

    # ------- decoding set-up start ----------
    from Bender.MicroDST import uDstConf
    uDstConf(rootInTES)
    logger.info("Configure RootInTES:  %s " % rootInTES)
    # ------- decoding set-up end  -----------

    # come back to Bender
    setData(datafiles, catalogs, castor)

    return SUCCESS
开发者ID:bmcharek,项目名称:Bu2JpsiKKpi,代码行数:59,代码来源:Alg.py

示例2: configure

def configure(datafiles, catalogs=[], params={}, castor=False):
    from Configurables import DaVinci
    from Configurables import EventSelector

    from PhysConf.Filters import LoKi_Filters

    fltrs = LoKi_Filters(
        VOID_Code="""
        0 < CONTAINS ('/Event/PSIX/Phys/SelPsi3KPiForPsiX/Particles')
        """
    )
    filters = fltrs.filters('Filters')

    daVinci = DaVinci(
        DataType=params['year'],
        PrintFreq=1000,
        EvtMax=-1,
        #
        TupleFile='Bu2JpsiKpipi.root',
        EventPreFilters=filters,
        #
        Lumi=True,
        #RootInTES = 'PSIX'
        #
    )

    from Configurables import Gaudi__IODataManager as IODataManager
    IODataManager().AgeLimit = 2

    # define input data
    setData(datafiles, catalogs, castor)

    #
    # Dynamic Configuration: Jump into the wonderful world of GaudiPython
    #

    # get the actual application manager (create if needed)
    gaudi = appMgr()

    # create local algorithm:
    alg = Bu2JpsiKpipi(
        'JpsiKpipi',
        # input particles :
        RootInTES='/Event/PSIX',
        Inputs=['Phys/SelPsi3KPiForPsiX/Particles']
    )
    mainSeq = gaudi.algorithm('GaudiSequencer/DaVinciUserSequence', True)
    mainSeq.Members += [alg.name()]

    # gaudi.addAlgorithm ( alg )

    return SUCCESS
开发者ID:sashabaranov,项目名称:Bu2JpsiKKpi,代码行数:52,代码来源:Bu2JpsiKpipi.py

示例3: configure_Ups

def configure_Ups(datafiles, catalogs=[], castor=False):
    """
    Job configuration 
    """
    ## needed for job configuration
    from Configurables import DaVinci

    from PhysConf.Filters import LoKi_Filters

    fltrs = LoKi_Filters(
        STRIP_Code="""
        HLT_PASS_RE ( 'Stripping.*DiMuonHighMass.*Decision'  )
        """,
        VOID_Code="""
        ( 0.5 < CONTAINS ( '/Event/Dimuon/Phys/FullDSTDiMuonDiMuonHighMassLine/Particles' ) ) & 
        ( 0.5 < CONTAINS ( '/Event/Rec/Vertex/Primary'                                    ) )         
        """
    )
    filters = fltrs.filters('Filters')
    filters.reverse()

    davinci = DaVinci(
        DataType='2011',
        InputType='DST',
        Simulation=False,
        PrintFreq=1000,
        EventPreFilters=filters,
        EvtMax=-1,
        #
        HistogramFile='TrgEff_Histos.root',
        TupleFile='TrgEff.root',
        #
        Lumi=True,
        #
    )

    from Configurables import CondDB
    CondDB(UseLatestTags=["2011"])

    #
    # come back to Bender
    #
    setData(datafiles, catalogs, castor)

    gaudi = appMgr()

    # for t in ( 'TrgEff.L0TriggerTisTos',
    #           'TrgEff.TriggerTisTos'  ) :
    #
    #    t1 = gaudi.tool ( t )
    #    t1.TOSFracMuon     =  0.01
    #    t1.PropertiesPrint = True

    alg = TrgUpsEff(
        'TrgEff',  # Algorithm name ,
        Inputs=[
            '/Event/Dimuon/Phys/FullDSTDiMuonDiMuonHighMassLine/Particles']
    )
    #
    mainSeq = gaudi.algorithm('GaudiSequencer/DaVinciUserSequence', True)
    mainSeq.Members += [alg.name()]

    return SUCCESS
开发者ID:bmcharek,项目名称:Bu2JpsiKKpi,代码行数:63,代码来源:TrgEff.py

示例4: configure


#.........这里部分代码省略.........
    bc_pi = CombineParticles(
        DecayDescriptor='[B_c+ -> J/psi(1S) pi+ ]cc',
        #
        Preambulo=Preambulo,
        DaughtersCuts={
            "J/psi(1S)": " M < 4.0 * GeV "
        },
        #
        CombinationCut="""
        in_range ( 5.9 * GeV , AM ,  6.6 * GeV ) 
        """ ,
        #
        MotherCut="""
        ( chi2vx  < 16              ) &
        ( ctau    > 50 * micrometer ) 
        """ ,
        ParticleCombiners={'': 'LoKi::VertexFitter'},
        ReFitPVs=True
    )
    #
    Bc_1p = Selection(
        'Psi1Pi',
        Algorithm=bc_pi,
        RequiredSelections=[jpsi, pions]
    )

    from PhysSelPython.Wrappers import SelectionSequence

    Bc_1PI = SelectionSequence("PSIPi", TopSelection=Bc_1p)
    Bc_3PI = SelectionSequence("PSI3Pi", TopSelection=Bc_3p)
    Bc_Ds = SelectionSequence("PSIDs", TopSelection=BDs_sel)

    # Read only fired events to speed up
    from PhysConf.Filters import LoKi_Filters
    fltrs = LoKi_Filters(
        STRIP_Code="HLT_PASS_RE('Stripping.*DiMuonJpsi2MuMuDeta.*')",
        VOID_Code="""
        0.5 < CONTAINS('%s')
        """ % jpsi_location
    )

    # =====================================================================
    from Configurables import DaVinci  # needed for job configuration

    the_year = '2011'

    davinci = DaVinci(
        EventPreFilters=fltrs.filters('FilterMC'),
        DataType=the_year,
        InputType='DST',
        Simulation=True,
        PrintFreq=1000,
        EvtMax=-1,
        #
        HistogramFile='BcMC_Histos.root',
        TupleFile='BcMC.root',
        ## HistogramFile = 'BcMC1pi_Histos.root' ,
        ## TupleFile     = 'BcMC1pi.root'        ,
        #
        # for Ds
        #DDDBtag   = 'MC2011-20120727'          ,
        #CondDBtag = 'MC2011-20120727-vc-mu100' ,
        #
        # for  pi
        # DDDBtag   =  'MC11-20111102' ,
        # CondDBtag =  'sim-20111111-vc-md100' ,
开发者ID:bmcharek,项目名称:Bu2JpsiKKpi,代码行数:67,代码来源:MCBc.py

示例5: configure


#.........这里部分代码省略.........
        """
        Pions for   B -> psi X lines
        """
        from GaudiConfUtils.ConfigurableGenerators import FilterDesktop
        ## from StandardParticles                     import StdAllLoosePions as inpts
        from StandardParticles                     import StdNoPIDsPions   as inpts
        ##
        return self.make_selection (
            'Pion'                 ,
            FilterDesktop          ,
            [ inpts ]              ,
            Code = self['PionCut'] ,
        )

    jpsi_name = 'FullDSTDiMuonJpsi2MuMuDetachedLine'
    psi2_name = 'FullDSTDiMuonPsi2MuMuDetachedLine'

    from PhysSelPython.Wrappers import AutomaticData
    jpsi  = AutomaticData ( '/Event/AllStreams/Phys/%s/Particles' % jpsi_name )
    psi2s = AutomaticData ( '/Event/AllStreams/Phys/%s/Particles' % psi2_name )
    #
    ## merged selectoon for J/psi & psi'
    #
    from PhysSelPython.Wrappers import MergedSelection
    psis = MergedSelection (
        'SelDetachedPsisForBandQ' ,
        RequiredSelections = [ jpsi ]
    )

    def _psi_ ( self ) :
        """
        psi(') -> mu+ mu-
        """
        return psis


    PSIX.pions = _pions_
    PSIX.kaons = _kaons_
    PSIX.psi   = _psi_

    ## use builder
    builder = PSIX ( 'PsiX' , builder_configuration  )



    from PhysSelPython.Wrappers import SelectionSequence

    psi3k      = SelectionSequence ( 'Psi3K'       , builder.psi_3K   () )
    psi3kpi    = SelectionSequence ( 'Psi3Kpi'     , builder.psi_3Kpi () )

    from PhysConf.Filters import LoKi_Filters
    fltrs   = LoKi_Filters (
        STRIP_Code = """
            HLT_PASS_RE('Stripping.*FullDSTDiMuonJpsi2MuMuDetachedLine.*')
        """
    )

    davinci = DaVinci(
        EventPreFilters = fltrs.filters('WG'),
        InputType     = 'DST'    ,
        Simulation    = True     ,
        PrintFreq     = 1000     ,
        EvtMax        = -1       ,
        Lumi          = True     ,
        DataType = params['Year'],
        DDDBtag = params['DDDB'],
        CondDBtag = params['SIMCOND'],
        # HistogramFile = 'DVHistos.root' ,
        TupleFile     = 'output_kpipi.root' ,
    )

    from Configurables import GaudiSequencer
    # seq   = GaudiSequencer('SEQ1', Members=[psi3k.sequence()])
    seq   = GaudiSequencer('SEQ2', Members=[psi3kpi.sequence()])


    my_name = "Bplus"


    davinci.UserAlgorithms = [ my_name ]

    setData ( datafiles , catalogs , castor )

    gaudi = appMgr()

    from StandardParticles import StdAllNoPIDsPions, StdAllNoPIDsKaons

    # create local algorithm:
    alg = MCAnalysisAlgorithm(
        my_name,
        Inputs = [
            StdAllNoPIDsPions.outputLocation(),
            StdAllNoPIDsKaons.outputLocation(),
            '/Event/AllStreams/Phys/%s/Particles' % jpsi_name
        ] ,
        PP2MCs = [ 'Relations/Rec/ProtoP/Charged' ],
        ReFitPVs = True
    )

    return SUCCESS
开发者ID:sashabaranov,项目名称:Bu2JpsiKKpi,代码行数:101,代码来源:loop.py

示例6: configure

def configure(datafiles, catalogs=[], params={}, castor=False):

    from Configurables import DaVinci
    from Configurables import EventSelector

    from PhysConf.Filters import LoKi_Filters

    fltrs = LoKi_Filters(
        VOID_Code="""
        0 < CONTAINS ('/Event/PSIX/Phys/SelPsi3KForPsiX/Particles')
        """
    )
    filters = fltrs.filters('Filters')

    the_year = '2011'

    daVinci = DaVinci(
        #
        EventPreFilters = filters ,
        #
        DataType  = params['year'] ,
        InputType = 'MDST' ,
        RootInTES = 'PSIX' ,
        #
        PrintFreq =  1000  ,
        EvtMax    =    -1  ,
        #
        TupleFile='Bu2JpsiKKK.root',
        #
        Lumi=True
        #
        )

    daVinci.UserAlgorithms = [ 'JpsiKKK' ]

    from Configurables import CondDB
    CondDB ( LatestGlobalTagByDataType = the_year )

    #
    ## define input data
    #
    setData(datafiles, catalogs, castor)

    #
    ## suppress some extra printput
    #
    from BenderTools.Utils import silence
    silence()

    #
    ## get the actual application manager (create if needed)
    #
    gaudi = appMgr()

    #
    ## create local algorithm:
    #
    alg = Bu2JpsiKKK (
        'JpsiKKK',
        # input particles :
        RootInTES='/Event/PSIX',
        Inputs=['Phys/SelPsi3KForPsiX/Particles']
        )

    return SUCCESS
开发者ID:sashabaranov,项目名称:Bu2JpsiKKpi,代码行数:65,代码来源:Bu2JpsiKKK.py

示例7: importOptions

#-------------------------------------------------------------------------
from Configurables import DaVinci

from Configurables import  OfflineVertexFitter

from Configurables import  DecayTreeTuple, MCDecayTreeTuple
importOptions("Xb2JpsiXTree.py")


tuple = DecayTreeTuple( "Lb2JpsiSTree" )
tuple.Inputs = [ SeqLb2JpsiS.outputLocation() ]



from PhysConf.Filters import LoKi_Filters
fltrs = LoKi_Filters(STRIP_Code = "(HLT_PASS_RE('StrippingFullDSTDiMuonJpsi2MuMuDetachedLineDecision'))" )

from Configurables import DaVinci
DaVinci().Simulation   = False
DaVinci().EvtMax = -1                        # Number of events
DaVinci().EventPreFilters = fltrs.filters('Filter')
DaVinci().UserAlgorithms = [ seq, tuple  ]
from Configurables import CondDB
#CondDB(UseOracle = True)
#importOptions("$APPCONFIGOPTS/DisableLFC.py")
#CondDB().IgnoreHeartBeat = True
DaVinci().DataType = "2012"
#DaVinci().DDDBtag   = "head-20110914"
#DaVinci().CondDBtag = "head-20111102"
DaVinci().TupleFile = "DVNtuples.root"
DaVinci().PrintFreq = 10000
开发者ID:goi42,项目名称:LbJpsipPi,代码行数:31,代码来源:DataXb2JpsiS.py

示例8: configure

def configure(datafiles,
              catalogs=[],
              castor=False,
              params={}):
    """
    Job configuration 
    """

    ## needed for job configuration
    from Configurables import DaVinci

    the_year = "2012"

    from BenderTools.Parser import hasInFile

    if params:
        the_year = params['Year']
        logger.info('Year is set from params to be %s ' % the_year)
    else:
        if hasInFile(datafiles, 'Collision11'):
            the_year = '2011'
        elif hasInFile(datafiles, 'Collision12'):
            the_year = '2012'
        elif hasInFile(datafiles, 'Collision13'):
            the_year = '2013'
        elif hasInFile(datafiles, 'Stripping17'):
            the_year = '2011'
        elif hasInFile(datafiles, 'Stripping13'):
            the_year = '2011'
        elif hasInFile(datafiles, 'Stripping15'):
            the_year = '2011'
        elif hasInFile(datafiles, 'Stripping19'):
            the_year = '2012'
        logger.info('Year is set from files  to be %s ' % the_year)

    #
    # check
    #
    if '2011' == the_year and hasInFile(datafiles, 'Collision12'):
        raise AttributeError, 'Invalid Year %s ' % the_year
    if '2012' == the_year and hasInFile(datafiles, 'Collision11'):
        raise AttributeError, 'Invalid Year %s ' % the_year

    logger.info('Use the Year = %s ' % the_year)

    rootInTES = '/Event/Charm'

    # Read only fired events to speed up
    from PhysConf.Filters import LoKi_Filters
    fltrs = LoKi_Filters(
        STRIP_Code="""
        HLT_PASS_RE( 'Stripping.*DsLamCForPromptCharm.*' ) 
        """
    )

    dv = DaVinci(
        EventPreFilters=fltrs.filters('Filters'),
        DataType=the_year,
        InputType='MDST',
        RootInTES=rootInTES,
        Simulation=False,
        PrintFreq=1000,
        EvtMax=-1,
        #
        HistogramFile='LB_Histos.root',
        TupleFile='LB.root',
        #
        Lumi=True,
        #
    )

    dv.UserAlgorithms = ['LB']

    from Configurables import CondDB
    CondDB(LatestGlobalTagByDataType=the_year)

    from BenderTools.Utils import silence
    silence()

    #
    # come back to Bender
    #
    setData(datafiles, catalogs, castor)

    #
    # start Gaudi
    #
    gaudi = appMgr()
    alg = LB(
        'LB',
        RootInTES=rootInTES,
        Inputs=['Phys/DsLamCForPromptCharm/Particles']
    )
    return SUCCESS
开发者ID:bmcharek,项目名称:Bu2JpsiKKpi,代码行数:94,代码来源:Lb.py

示例9: configure

def configure(datafiles, catalogs=[]):
    """
    Job configuration 
    """

    ## needed for job configuration
    from Configurables import DaVinci
    ## needed for job configuration
    from Configurables import EventSelector
    ## needed for job configuration
    from GaudiConf.Configuration import FileCatalog
    ## needed for job configuration
    from GaudiConf.Configuration import NTupleSvc

    from PhysConf.Filters import LoKi_Filters

    fltrs = LoKi_Filters(
        STRIP_Code="""
        HLT_PASS_RE ( 'Stripping.*DiMuonInc.*Decision'  )
        """,
        VOID_Code="""
        0.5 < CONTAINS ('/Event/Leptonic/Phys/MicroDSTDiMuonDiMuonIncLine/Particles' )
        """
    )
    filters = fltrs.filters('Filters')
    filters.reverse()

    davinci = DaVinci(
        DataType='2011',
        InputType='MDST',
        Simulation=False,
        PrintFreq=1000,
        EventPreFilters=filters,
        EvtMax=-1,
        #
        HistogramFile='MuPidEff_Histos.root',
        TupleFile='MuPidEff.root',
        #
        Lumi=True,
        #
    )

    from Configurables import CondDB
    CondDB(UseLatestTags=["2011"],
           UseOracle=True
           )

    # from Configurables import Gaudi__IODataManager as IODataManager
    # IODataManager().AgeLimit = 2

    # configure TIS-TOS
    rootInTES = '/Event/Leptonic'

    # ------- decoding set-up start ----------

    ## from MicroDSTConf.TriggerConfUtils import configureL0AndHltDecoding
    # configureL0AndHltDecoding(rootInTES)

    # ------- decoding set-up end  -----------

    # come back to Bender

    setData(datafiles, catalogs)

    gaudi = appMgr()

    alg = MuPidEff(
        'MuPidEff',  # Algorithm name ,
        RootInTES=rootInTES,
        Inputs=['Phys/MicroDSTDiMuonDiMuonIncLine/Particles']
    )
    #
    mainSeq = gaudi.algorithm('GaudiSequencer/DaVinciUserSequence', True)
    mainSeq.Members += [alg.name()]

    return SUCCESS
开发者ID:bmcharek,项目名称:Bu2JpsiKKpi,代码行数:76,代码来源:MuPidEff.py

示例10: stripMicroDSTStreamConf

SelDSTWriterConf = {'default': stripMicroDSTStreamConf(pack=False)}
SelDSTWriterElements = {'default': stripMicroDSTElements(pack=False)}

udstWriter = SelDSTWriter(
    "MyMicroDSTWriter",
    StreamConf=SelDSTWriterConf,
    MicroDSTElements=SelDSTWriterElements,
    OutputFileSuffix='PsiC',
    SelectionSequences=[B_ALL]
)

# Read only fired events to speed up
from PhysConf.Filters import LoKi_Filters
fltrs = LoKi_Filters(
    STRIP_Code="HLT_PASS_RE('Stripping.*DiMuonJpsi2MuMuDeta.*')",
    VOID_Code="""
    0.5 < CONTAINS('%s')
    """ % Jpsi_location
)
#
# protection agains ``corrupted'' Stripping 17b DIMUON.DST
fltrs_0 = LoKi_Filters(
    VOID_Code="""
    ( EXISTS ( '/Event/DAQ/RawEvent') | EXISTS('/Event/Trigger/RawEvent' ) ) 
    & EXISTS ( '/Event/Strip/Phys/DecReports') 
    """
)

## the_year = "2011"
the_year = "2012"

from Configurables import DaVinci
开发者ID:bmcharek,项目名称:Bu2JpsiKKpi,代码行数:32,代码来源:WriteBc.py

示例11: configure

def configure(datafiles, catalogs=[], castor=True, params={}):
    """
    Configure the job
    """

    from Configurables import DaVinci  # needed for job configuration
    from Configurables import EventSelector  # needed for job configuration
    from Configurables import NTupleSvc

    from PhysConf.Filters import LoKi_Filters

    fltrs = LoKi_Filters(
        STRIP_Code="""
        HLT_PASS_RE ( 'Stripping.*DiMuonHighMass.*Decision' )
        """,
        VOID_Code="""
        0 < CONTAINS (
            '/Event/Dimuon/Phys/FullDSTDiMuonDiMuonHighMassLine/Particles')
        """
    )

    filters = fltrs.filters('Filters')
    filters.reverse()

    the_year = params["year"]

    davinci = DaVinci(  # noqa
        DataType=the_year,
        InputType='MDST',
        HistogramFile="chib_histos.root",
        TupleFile="chib_tuples.root",
        PrintFreq=1000,
        Lumi=True,
        EvtMax=-1
    )
    from Configurables import CondDB
    CondDB(LatestGlobalTagByDataType=the_year)

    #=========================================================================
    # RootInTES = '/Event/ChiB'
    # RootInTES = '/Event/Bottomonia'
    RootInTES = '/Event/BOTTOM'
    #=========================================================================
    from BenderTools.MicroDST import uDstConf
    uDstConf(RootInTES)
    # =========================================================================
    from Configurables import Gaudi__IODataManager as IODataManager
    IODataManager().AgeLimit = 2
    # =========================================================================
    from Configurables import TrackScaleState
    state_scale = TrackScaleState('StateScale', RootInTES='/Event/BOTTOM')
    # =========================================================================
    davinci.UserAlgorithms = [
        state_scale,
        "ChibAlg",
        "UpsilonAlg"
    ]
    # =========================================================================
    # come back to Bender
    setData(datafiles, catalogs, castor)
    gaudi = appMgr()
    alg_chib = Chib(
        'ChibAlg',  # Algorithm name ,
        # input particles
        RootInTES=RootInTES,
        Inputs=[
            # 'Phys/Chi_b/Particles'
            'Phys/ChiB/Particles'
        ],
        # take care about the proper particle combiner
        ParticleCombiners={'': 'LoKi::VertexFitter'}
    )
    alg_upsilon = Upsilon(
        'UpsilonAlg',  # Algorithm name ,
        # input particles
        RootInTES=RootInTES,
        Inputs=[
            'Phys/Upsilon/Particles'
        ],
        # take care about the proper particle combiner
        ParticleCombiners={'': 'LoKi::VertexFitter'}
    )

    # =========================================================================
    # mainSeq = gaudi.algorithm('GaudiSequencer/DaVinciUserSequence', True)
    # mainSeq.Members += [state_scale, alg_chib.name(), alg_upsilon.name()]
    # =========================================================================
    return SUCCESS
开发者ID:mazurov,项目名称:chib,代码行数:88,代码来源:tuples.py

示例12: configure

def configure(datafiles,
              catalogs=[],
              castor=False,
              params={}):
    """
    Job configuration 
    """

    ## needed for job configuration
    from Configurables import DaVinci

    from BenderTools.Parser import hasInFile

    the_year = "2011"

    if params:
        the_year = params['Year']
        logger.info('Year is set from params to be %s ' % the_year)
    else:
        if hasInFile(datafiles, 'Collision11'):
            the_year = '2011'
        elif hasInFile(datafiles, 'Collision12'):
            the_year = '2012'
        elif hasInFile(datafiles, 'Stripping17'):
            the_year = '2011'
        elif hasInFile(datafiles, 'Stripping13'):
            the_year = '2011'
        elif hasInFile(datafiles, 'Stripping15'):
            the_year = '2011'
        elif hasInFile(datafiles, 'Stripping17'):
            the_year = '2011'
        elif hasInFile(datafiles, 'Stripping19'):
            the_year = '2012'
        logger.info('Year is set from files  to be %s ' % the_year)

    #
    # check
    #
    if '2011' == the_year and hasInFile(datafiles, 'Collision12'):
        raise AttributeError, 'Invalid Year %s ' % the_year
    if '2012' == the_year and hasInFile(datafiles, 'Collision11'):
        raise AttributeError, 'Invalid Year %s ' % the_year

    logger.info('Use the Year = %s ' % the_year)

    rootInTES = '/Event/PSIX'

    # Read only fired events to speed up
    from PhysConf.Filters import LoKi_Filters
    fltrs = LoKi_Filters(
        VOID_Code="""
        ( CONTAINS('/Event/PSIX/Phys/SelPsiKForPsiX/Particles'  ) > 0.5 ) |
        ( CONTAINS('/Event/PSIX/Phys/SelPsiPiForPsiX/Particles' ) > 0.5 ) 
        """
    )

    davinci = DaVinci(
        EventPreFilters=fltrs.filters('Filters'),
        DataType=the_year,
        InputType='MDST',
        RootInTES=rootInTES,
        Simulation=False,
        PrintFreq=1000,
        EvtMax=-1,
        #
        HistogramFile='Bc_Histos.root',
        TupleFile='Bc.root',
        #
        Lumi=True,
        #
    )

    from BenderTools.Utils import silence
    silence()

    from Configurables import TrackScaleState
    state_scale = TrackScaleState('StateScale')
    davinci.UserAlgorithms = [
        state_scale,
        'B2K',
        'B2P'
    ]

    from Configurables import CondDB
    CondDB(LatestGlobalTagByDataType=the_year)

    #
    # come back to Bender
    #
    setData(datafiles, catalogs, castor)

    #
    # start Gaudi
    #
    gaudi = appMgr()

    #
    alg1 = B2PsiH(
        'B2K',  # Algorithm name ,
        RootInTES=rootInTES,
#.........这里部分代码省略.........
开发者ID:bmcharek,项目名称:Bu2JpsiKKpi,代码行数:101,代码来源:BcT.py

示例13: stripMicroDSTElements

SelDSTWriterElements = {'default': stripMicroDSTElements(pack=False)}

udstWriter = SelDSTWriter(
    "MyDSTWriter",
    StreamConf=SelDSTWriterConf,
    MicroDSTElements=SelDSTWriterElements,
    OutputFileSuffix='BX',
    SelectionSequences=[b_seq]
)

#
# Read only fired events to speed up
#
from PhysConf.Filters import LoKi_Filters
fltrs1 = LoKi_Filters(
    STRIP_Code=" HLT_PASS_RE('Stripping.*%s.*') " % jpsi_name
)
fltrs2 = LoKi_Filters(
    VOID_Code="""
    ( RECSUMMARY (  0 , -1 ) > 0.5 ) & 
    ( RECSUMMARY ( 10 , -1 ) < 500 ) & 
    ( RECSUMMARY ( 13 , -1 ) < 500 )
    """
)

##the_year = "2011"
the_year = "2012"

from Configurables import DaVinci
dv = DaVinci(
    EventPreFilters=fltrs1.filters(
开发者ID:bmcharek,项目名称:Bu2JpsiKKpi,代码行数:31,代码来源:WriteX.py

示例14: configure

def configure(datafiles,
              catalogs=[],
              castor=False,
              params={}):
    """
    Job configuration 
    """

    ## needed for job configuration
    from Configurables import DaVinci

    from BenderTools.Parser import hasInFile

    the_year = "2011"

    if params:
        the_year = params['Year']
        logger.info('Year is set from params to be %s ' % the_year)
    else:
        if hasInFile(datafiles, 'Collision11'):
            the_year = '2011'
        elif hasInFile(datafiles, 'Collision12'):
            the_year = '2012'
        elif hasInFile(datafiles, 'Stripping17'):
            the_year = '2011'
        elif hasInFile(datafiles, 'Stripping13'):
            the_year = '2011'
        elif hasInFile(datafiles, 'Stripping15'):
            the_year = '2011'
        elif hasInFile(datafiles, 'Stripping17'):
            the_year = '2011'
        elif hasInFile(datafiles, 'Stripping19'):
            the_year = '2012'
        logger.info('Year is set from files  to be %s ' % the_year)

    #
    # check
    #
    if '2011' == the_year and hasInFile(datafiles, 'Collision12'):
        raise AttributeError, 'Invalid Year %s ' % the_year
    if '2012' == the_year and hasInFile(datafiles, 'Collision11'):
        raise AttributeError, 'Invalid Year %s ' % the_year

    logger.info('Use the Year = %s ' % the_year)

    rootInTES = '/Event/Charm'

    from PhysConf.Filters import LoKi_Filters
    fltrs = LoKi_Filters(
        STRIP_Code="""
        HLT_PASS_RE ( 'Stripping.*Xicc.*ForPromptCharm.*' ) 
        """
    )

    davinci = DaVinci(
        DataType=the_year,
        EventPreFilters=fltrs.filters('Filters'),
        InputType='MDST',
        RootInTES=rootInTES,
        Simulation=False,
        PrintFreq=1000,
        EvtMax=-1,
        #
        HistogramFile='Xic_Histos.root',
        TupleFile='Xic.root',
        #
        Lumi=True,
        #
    )

    from BenderTools.Utils import silence
    silence()

    from Configurables import TrackScaleState
    state_scale = TrackScaleState(
        'StateScale',
    )

    davinci.UserAlgorithms = [state_scale, 'Xi1', 'Xi2']

    from Configurables import CondDB
    CondDB(LatestGlobalTagByDataType=the_year)

    #
    # come back to Bender
    #
    setData(datafiles, catalogs, castor)

    #
    # start Gaudi
    #
    gaudi = appMgr()

    #
    alg1 = Xicc(
        'Xi1',  # Algorithm name ,
        RootInTES=rootInTES,
        Inputs=['Phys/Xicc+ForPromptCharm/Particles']
    )

#.........这里部分代码省略.........
开发者ID:bmcharek,项目名称:Bu2JpsiKKpi,代码行数:101,代码来源:Xicc.py

示例15: configure

def configure(datafiles, catalogs=[]):
    """
    Job configuration 
    """

    ## needed for job configuration
    from Configurables import DaVinci
    ## needed for job configuration
    from Configurables import EventSelector
    ## needed for job configuration
    from GaudiConf.Configuration import FileCatalog
    ## needed for job configuration
    from GaudiConf.Configuration import NTupleSvc

    from PhysConf.Filters import LoKi_Filters

    fltrs = LoKi_Filters(
        #
        MC_Preambulo=[
            "from LoKiCore.functions import in_range, count, has ",
            "from GaudiKernel.SystemOfUnits import GeV",
            "from_B   = MCINANCESTORS ( BEAUTY )",
            "pt_d_cut = in_range ( 2 * GeV , MCPT , 12 * GeV )  ",
            "y_d_cut  = in_range ( 2       , MCY  , 4.0      )  ",
            "pt_j_cut =                      MCPT < 12 * GeV    ",
            "y_j_cut  = in_range ( 2       , MCY  , 4.5      )  ",
            "d0       = 'D0'        == MCABSID ",
            # MCDECTREE ( '[ D0         -> K- pi+     ]CC') " ,
            "dp       = 'D+'        == MCABSID ",
            # MCDECTREE ( '[ D+        --> K- pi+ pi+ ]CC') " ,
            "ds       = 'D_s+'      == MCABSID ",
            # MCDECTREE ( '[ D_s+      --> K- K+  pi+ ]CC') " ,
            "lc       = 'Lambda_c+' == MCABSID ",
            # MCDECTREE ( '[ Lambda_c+ --> p+ K-  pi+ ]CC') " ,
            # MCDECTREE ( '  J/psi(1S)  => mu+ mu-'       ) " ,
            "psi      = 'J/psi(1S)' == MCABSID ",
            "psi_B    = psi   & from_B ",
            "charm    = ( d0 | dp | ds | lc ) ",
            "charm_B  = charm & from_B ",
        ],
        #
        # di-charm mode
        #
# MC_Code    = """
        ##         has ( BEAUTY )
        # &
        ##         ( 1.5 < count ( y_d_cut & pt_d_cut & charm_B ) )
# """
        #
        # dimuon & charm
        #
# MC_Code    = """
        ##         has ( BEAUTY )
        # &
        ##         ( 0.5 < count ( y_d_cut & pt_d_cut & charm_B ) )
        # &
        ##         ( 0.5 < count ( y_j_cut & pt_j_cut & psi_B   ) )
# """
        #
        # alltogather
        #
        MC_Code="""
        has ( BEAUTY )
        &
        ( 1.5 < count (
        ( y_d_cut & pt_d_cut & charm_B ) |
        ( y_j_cut & pt_j_cut &   psi_B ) ) ) 
        """
    )

    filters = fltrs.filters('Filters')
    filters.reverse()

    davinci = DaVinci(
        DataType='2011',
        InputType='DST',
        Simulation=True,
        PrintFreq=1000,
        #EventPreFilters = filters ,
        EvtMax=-1,
        #
        HistogramFile='2xCharm_fromB_Histos.root',
        TupleFile='2xCharm_fromB.root',
        #
        Lumi=False
        #
    )

    # come back to Bender
    setData(datafiles, catalogs)

    gaudi = appMgr()

    alg = MCB2(
        #
        'MCB2',  # Algorithm name
        #
        Inputs=[],
        #
        PP2MCs=[]
#.........这里部分代码省略.........
开发者ID:bmcharek,项目名称:Bu2JpsiKKpi,代码行数:101,代码来源:MCB2.py


注:本文中的PhysConf.Filters.LoKi_Filters类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。