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


Python Wrappers.SelectionSequence类代码示例

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


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

示例1: add_mc_unbiased_sequence

    def add_mc_unbiased_sequence(self, decayDesc, arrow = '==>',
                                 toolList = ["TupleToolPropertime",
                                             "TupleToolKinematic",
                                             "TupleToolGeometry",
                                             "TupleToolEventInfo",
                                             "TupleToolPrimaries",
                                             "TupleToolPid",
                                             "TupleToolANNPID",
                                             "TupleToolTrackInfo",
                                             "TupleToolRecoStats",],
                                 mcToolList = ['TupleToolMCTruth',
                                               'TupleToolMCBackgroundInfo',
                                               'MCTupleToolPrompt'],
                                 L0List = [],
                                 HLT1List = [],
                                 HLT2List = [],
                                 strippingList = []) :
        sel = build_mc_unbiased_selection(decayDesc, arrow)
        selseq = SelectionSequence(decayDesc.get_full_alias() + '_MCSeq',
                                   TopSelection = sel)
        seq = selseq.sequence()
        seq.Members.insert(0, CheckPV())
        dtt = DecayTreeTuple(decayDesc.get_full_alias() + '_MCTuple',
                             Decay = decayDesc.to_string(carets = True),
                             Inputs = [sel.outputLocation()], 
                             ToolList = [])
        dtt.addBranches(decayDesc.branches())
        headBranch = getattr(dtt, decayDesc.get_alias())

        dtt.configure_tools(toolList = toolList,
                            mcToolList = mcToolList,
                            L0List = L0List,
                            HLT1List = HLT1List,
                            HLT2List = HLT2List,
                            strippingList = strippingList,
                            headBranch = headBranch)

        lokituple = headBranch.addTupleTool('LoKi::Hybrid::TupleTool')
        lokituple.Preambulo = ['from LoKiPhysMC.decorators import *',
                               'from LoKiPhysMC.functions import mcMatch']
        mcmatch = 'switch(mcMatch({0!r}), 1, 0)'.format(decayDesc.to_string(carets = False,
                                                                            arrow = '==>'))
        lokituple.Variables = {'mcMatch' : mcmatch}


        seq.Members.append(dtt)
        self.UserAlgorithms.append(seq)

        mcdtt = MCDecayTreeTuple(decayDesc.get_full_alias() + '_MCDecayTreeTuple')
        mcdtt.Decay = decayDesc.to_string(arrow = arrow, carets = True)
        self.UserAlgorithms.append(mcdtt)

        return seq
开发者ID:MannyMoo,项目名称:gaudi-script-builder,代码行数:53,代码来源:AppConfig.py

示例2: select

    def select(self):
        """
        Get data and selection
        """

        from PhysSelPython.Wrappers import Selection, SelectionSequence, DataOnDemand, AutomaticData

        # from StandardParticles import StdLooseMuons, StdLooseKaons
        from Configurables import FilterDesktop, CombineParticles, OfflineVertexFitter, LoKi__HDRFilter
        from GaudiKernel.PhysicalConstants import c_light

        evtPreselectors = []

        if dataSample.isPrescaled != False:
            if dataSample.isPrescaled == True:
                dataSample.isPrescaled = 0.1
            prescaler = DeterministicPrescaler("Prescaler", AcceptFraction=dataSample.isPrescaled)
            evtPreselectors.append(prescaler)

        # # Stripping filter
        strippingFilter = LoKi__HDRFilter(
            "StripPassFilter",
            Code="HLT_PASS('Stripping" + self.lineName + "Decision')",
            Location="/Event/Strip/Phys/DecReports",
        )
        evtPreselectors.append(strippingFilter)

        stripped_data = AutomaticData(Location=self.lineLocation)

        # Trigger selection
        # from Configurables import TisTosParticleTagger
        # _tisTosFilter = TisTosParticleTagger( self.name + "Triggered" )
        # _tisTosFilter.TisTosSpecs = { 'L0Global%TUS' : 0,
        #                               'L0Global%TIS' : 0,
        #                               }
        # for trigger in trigger_list:
        #     for tistos in ['TIS', 'TUS']:
        #         _tisTosFilter.TisTosSpecs['{0}%{1}'.format(trigger, tistos)] = 0

        # triggered_data =  Selection( self.name+'TriggerSelection',
        #                              Algorithm = _tisTosFilter,
        #                              RequiredSelections = [ stripped_data ],
        #                              )

        Candidate_selection = stripped_data  # triggered_data

        self.sequence = SelectionSequence(
            "Seq" + self.name, TopSelection=Candidate_selection, EventPreSelector=evtPreselectors
        )
开发者ID:gdujany,项目名称:phi2KsKs,代码行数:49,代码来源:Rootuplizer.py

示例3: SubstitutePID

# Change mass hypothesis
newDecay = "DECTREE('B_s0 -> (phi(1020) -> K+ K-) (f_0(980) -> K+ K-)')"
_SubstituteB0 = SubstitutePID( name = "_SubstituteB0"
                             , Code = " DECTREE('B0 -> (phi(1020) -> K+ K-) (rho(770)0 -> pi+ pi-)') " 
                             , Substitutions = { 'Beauty -> (phi(1020) -> K+ K-) ^(rho(770)0 -> X+ X-)' : 'f_0(980)'
                                               , 'Beauty -> (phi(1020) -> K+ K-) (X0 -> ^pi+ X-)' : 'K+'
                                               , 'Beauty -> (phi(1020) -> K+ K-) (X0 -> X+ ^pi-)' : 'K-'
                                               , 'Beauty -> (phi(1020) -> K+ K-) (X0 -> X+ X-)' : 'B_s0'
                                               }
                             )
_ddChangeSel = Selection( "_ddChangeSel"
                        , Algorithm = _SubstituteB0
                        , RequiredSelections = [_strippingOutput]
                        )
selSeq = SelectionSequence("selseqname", TopSelection = _ddChangeSel)
# Create Decay Tree Tuple #####################################################
from Configurables import DecayTreeTuple
from DecayTreeTuple.Configuration import *
tuple = DecayTreeTuple()
tuple.Inputs = [ selSeq.outputLocation() ]
#tuple.Inputs = [ strippingline ]

from Configurables import BackgroundCategory
from Configurables import TupleToolTrigger, TupleToolRecoStats, TupleToolTrackIsolation, TupleToolTagging, TupleToolTISTOS

# Universal tools
tuple.ToolList += [ "TupleToolGeometry"
                  , "TupleToolKinematic"
                  , "TupleToolPropertime"
#                  , "TupleToolPrimaries"
开发者ID:abmorris,项目名称:BsphiKK,代码行数:30,代码来源:DaVinci-Opts_12.py

示例4: selection

# Stream and stripping line we want to use
stream = 'AllStreams'
line = 'D2hhCompleteEventPromptDst2D2RSLine'
tesLoc = '/Event/{0}/Phys/{1}/Particles'.format(stream, line)

# get the selection(s) created by the stripping
strippingSels = [DataOnDemand(Location=tesLoc)]

# create a selection using the substitution algorithm
selSub = Selection(
    'Dst2D0pi_D02pipi_Sel',
    Algorithm=subs,
    RequiredSelections=strippingSels
)

selSeq = SelectionSequence('SelSeq', TopSelection=selSub)

# Create an ntuple to capture D*+ decays from the new selection
from Configurables import DecayTreeTuple
dtt = DecayTreeTuple('TupleDstToD0pi_D0Topipi')
dtt.Inputs = [selSeq.outputLocation()]
# note the redefined decay of the D0
dtt.Decay = '[D*(2010)+ -> ^(D0 -> ^pi- ^pi+) ^pi+]CC'

# add our new selection and the tuple into the sequencer
from Configurables import GaudiSequencer, DaVinci
seq = GaudiSequencer('MyTupleSeq')
seq.Members += [selSeq.sequence()]
seq.Members += [dtt]
DaVinci().appendToMainSequence([seq])
开发者ID:goi42,项目名称:LbJpsipPi,代码行数:30,代码来源:DataXb2JpsiLK.py

示例5: CombineParticles

combineAB = CombineParticles('CombineAB')
combineAB.DecayDescriptor = "B_s0 -> D_s- D_s+"
combineAB.MotherCut = "ALL"
combineAB.Preambulo = [
    "from LoKiPhysMC.decorators import *",
    "from PartProp.Nodes import CC" ]

selectionA = Selection("FakeDsPlusSel",
                        Algorithm = combineA,
                        RequiredSelections=[_kaons, _pions])

selectionB = Selection("FakeDsMinusSel",
                        Algorithm = combineB,
                        RequiredSelections=[_kaons, _pions])

selASelectionSequence = SelectionSequence('FakeDsPlus', TopSelection = selectionA)
selBSelectionSequence = SelectionSequence('FakeDsMinus', TopSelection = selectionB)

selectionAB = Selection("FakeBsSel",
                        Algorithm = combineAB,
                        RequiredSelections=[DataOnDemand(Location=selASelectionSequence.outputLocation()),
                                            DataOnDemand(Location=selBSelectionSequence.outputLocation())])
                                            
selABSelectionSequence = SelectionSequence('FakeBs', TopSelection = selectionAB)


from Configurables import FitDecayTrees
fitD2KKP = FitDecayTrees ( 
    "fitD2KKP" , 
    Code = "DECTREE('B_s0 -> (D_s+ -> K+ K- pi+) (D_s- -> K- K+ pi-)')",
    MassConstraints = [ 'D_s+', 'D_s-' ], 
开发者ID:ibab,项目名称:lhcb-merge-event,代码行数:31,代码来源:merge.py

示例6: CombineParticles

# #----Selection /\b -> J/psi /\-------------------
# _Lb2JpsiL = CombineParticles( "_Lb2JpsiL",
#                               DecayDescriptor = "[Lambda_b0 -> J/psi(1S) Lambda0]cc",
#                               CombinationCut = "AM < 6000. * MeV",
#                               
#                               ReFitPVs        = True )

# Lb2JpsiL  = Selection( "Lb2JpsiL",
#                       Algorithm          = _Lb2JpsiL ,
#                       RequiredSelections = [ Jpsi2MuMu, FilterL ] )

### Gaudi sequence
# SeqL2ppi = SelectionSequence("SeqL2ppi", TopSelection = L2ppi)
# seq = SeqL2ppi.sequence()
SeqFilterL = SelectionSequence("SeqFilterL", TopSelection = FilterL)
seq = SeqFilterL.sequence()

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

# DaVinci().appendToMainSequence( [sc.sequence() ] )   # Append the stripping selection sequence to DaVinci

from Configurables import  OfflineVertexFitter

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

开发者ID:goi42,项目名称:LbJpsipPi,代码行数:28,代码来源:Xb2JpsiLKMC.py

示例7: configure

def configure(datafiles, catalogs=[], castor=True, params=None):
    """
    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/AllStreams/Phys/FullDSTDiMuonDiMuonHighMassLine/Particles')
        """
    )

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

    from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence

    #
    # defimuon in stripping DST
    #
    # DiMuLocation  =
    # '/Event/Dimuon/Phys/FullDSTDiMuonDiMuonHighMassLine/Particles'
    DiMuLocation = '/Event/AllStreams/Phys/FullDSTDiMuonDiMuonHighMassLine/Particles'

    from PhysSelPython.Wrappers import AutomaticData
    DiMuData = AutomaticData(Location=DiMuLocation)

    # =========================================================================
    # Upsilon -> mumu, cuts by  Giulia Manca
    # ========================================================================
    from GaudiConfUtils.ConfigurableGenerators import FilterDesktop
    UpsAlg = FilterDesktop(
        Code="""
        ( M > 7 * GeV ) &
        DECTREE   ('Meson -> mu+ mu-'  )                      &
        CHILDCUT( 1 , HASMUON & ISMUON )                      &
        CHILDCUT( 2 , HASMUON & ISMUON )                      &
        ( MINTREE ( 'mu+' == ABSID , PT ) > 1 * GeV         ) &
        ( MAXTREE ( ISBASIC & HASTRACK , TRCHI2DOF ) < 4    ) &
        ( MINTREE ( ISBASIC & HASTRACK , CLONEDIST ) > 5000 ) &
        ( VFASPF  ( VPCHI2 ) > 0.5/100 )
        & ( abs ( BPV ( VZ    ) ) <  0.5 * meter     )
        & (       BPV ( vrho2 )   < ( 10 * mm ) ** 2 )
        """,
        Preambulo=[
            "vrho2 = VX**2 + VY**2"
        ],
        ReFitPVs=True
    )

    UpsSel = Selection(
        'UpsSel',
        Algorithm=UpsAlg,
        RequiredSelections=[DiMuData]
    )

    # =========================================================================
    # chi_b -> Upsilon gamma
    # ========================================================================
    from GaudiConfUtils.ConfigurableGenerators import CombineParticles
    ChibCombine = CombineParticles(
        DecayDescriptor="chi_b1(1P) ->  J/psi(1S) gamma",
        DaughtersCuts={
            "gamma": " ( 350 * MeV < PT ) & ( CL > 0.01 )  "
        },
        CombinationCut="""
        ( AM - AM1 ) < 3 * GeV
        """,
        MotherCut=" PALL",
        #
        # we are dealing with photons!
        #
        ParticleCombiners={
        '': 'LoKi::VertexFitter'
        }
    )
    from StandardParticles import StdLooseAllPhotons  # needed for chi_b
    ChibSel1 = Selection(
        'PreSelChib',
        Algorithm=ChibCombine,
        RequiredSelections=[UpsSel, StdLooseAllPhotons]
    )
    from GaudiConfUtils.ConfigurableGenerators import Pi0Veto__Tagger
    TagAlg = Pi0Veto__Tagger(
        ExtraInfoIndex=25001,  # should be unique!
        MassWindow=20 * MeV,  # cut on delta-mass
        MassChi2=-1,  # no cut for chi2(mass)
    )
    ChibSel2 = Selection(
        'Chi_b',
        Algorithm=TagAlg,
#.........这里部分代码省略.........
开发者ID:mazurov,项目名称:chib,代码行数:101,代码来源:mctuples.py

示例8: DataOnDemand

dz=DataOnDemand(turbo_loc.format(dz_line))
pions = DataOnDemand('Phys/StdAllNoPIDsPions/Particles')


dst = CombineParticles('DstToD0pi',
                        DecayDescriptors=['[D*(2010)+ -> D0 pi+]cc'],
                        CombinationCut=("AM - ACHILD(M,1) < 800*MeV"),
                        MotherCut="(VFASPF(VCHI2/VDOF) < 6)") 

dst_sel = Selection(
    'Sel_DstToD0pi',
    Algorithm=dst,
    RequiredSelections=[dz, pions]
)
dst_selseq = SelectionSequence(
    'SelSeq_DstToD0pi',
    TopSelection=dst_sel
)

dtt_dst = DecayTreeTuple('TupleDstToD0pi_D0ToKpi_PersistReco')
dtt_dst.addTupleTool('TupleToolTrackInfo')
dtt_dst.Inputs = dst_selseq.outputLocations()
dtt_dst.Decay = '[D*(2010)+ -> ^(D0 -> ^K- ^pi+) ^pi+]CC'
dtt_dst.addBranches({
    'Dst': '[D*(2010)+ -> (D0 -> K- pi+) pi+]CC',
    'Dst_pi': '[D*(2010)+ -> (D0 -> K- pi+) ^pi+]CC',
    'D0': '[D*(2010)+ -> ^(D0 -> K- pi+) pi+]CC',
    'D0_K': '[D*(2010)+ -> (D0 -> ^K- pi+) pi+]CC',
    'D0_pi': '[D*(2010)+ -> (D0 -> K- ^pi+) pi+]CC',
})

dstar_hybrid = dtt_dst.Dst.addTupleTool('LoKi::Hybrid::TupleTool/LoKi_Dstar')
开发者ID:jenniferzon,项目名称:impactkit-proceedings,代码行数:32,代码来源:persistreco1.py

示例9: DECTREE

                            Code = " DECTREE('[(B+ -> eta_prime pi+),(B- -> eta_prime pi-) ]') " , 
                            Substitutions = { 
                                'B+ -> eta_prime  ^pi+'  : 'K+', 
                                'B- -> eta_prime  ^pi-'  : 'K-',
                            }
)
                         

B2EtapKSel = Selection("B2EtapKSel", Algorithm = SubKToPi, RequiredSelections = [B2etap_piSub])

#B2EtapKSeq = SelectionSequence("B2EtapKSeq", TopSelection = B2EtapKSel)

#Code="(M>4800 *MeV) & (M<5700 *MeV) & (VFASPF(VCHI2/VDOF)<9.) & (PT> 1500.*MeV)"
B2EtapKFil= FilterDesktop("B2EtapKFil",  Code="(M>4800 *MeV) & (M<5700 *MeV) & (VFASPF(VCHI2/VDOF)<9.)")# & (PT> 1500.*MeV)") 
B2EtapKFil_Sel= Selection('B2EtapKFil_Sel', Algorithm=B2EtapKFil, RequiredSelections=[B2EtapKSel])
B2EtapKFil_Seq = SelectionSequence("B2etap_pi_FilSeq", TopSelection =B2EtapKFil_Sel) 




# Fill Tuple
from Configurables import DecayTreeTuple

tuple = DecayTreeTuple("B2_ETAPK")

 
tuple.ToolList += [
       "TupleToolGeometry",
       "TupleToolPhotonInfo",
       "TupleToolPid",
       "TupleToolMCTruth",
开发者ID:Williams224,项目名称:davinci-scripts,代码行数:31,代码来源:B2_EtapK_tuplemaker.py

示例10: configure


#.........这里部分代码省略.........
    ( MIPCHI2DV()  > 9.    ) 
    """ 
    
    from GaudiConfUtils.ConfigurableGenerators import FilterDesktop
    _alg_pi  = FilterDesktop (
        ##
        Code = _PionCut_ ,
        ##
        )
    
    from PhysSelPython.Wrappers  import Selection
    from StandardParticles       import StdAllNoPIDsPions as input_pions 
    pions  = Selection (
        "SelPiForBQ"                       ,
        Algorithm          =  _alg_pi      ,
        RequiredSelections = [ input_pions ]  
        )
    
    from GaudiConfUtils.ConfigurableGenerators import FilterDesktop
    _alg_k  = FilterDesktop (
        ##
        Code = _KaonCut_ ,
        ##
        )
    
    from PhysSelPython.Wrappers  import Selection
    from StandardParticles       import StdAllNoPIDsKaons as input_kaons 
    kaons  = Selection (
        "SelKForBQ"      ,
        Algorithm          =   _alg_k      ,
        RequiredSelections = [ input_kaons ]  
        )
    
    
    def _kaons_   ( self ) : return kaons 
    def _pions_   ( self ) : return pions 
    
    #
    ## get the selections 
    #
    
    for s in [ PsiX ]  :
        s.pions   = _pions_
        s.kaons   = _kaons_
        
    logger.warning ( "Redefine PsiX.kaons          " )
    logger.warning ( "Redefine PsiX.kaons          " )

        
    psix   = PsiX   ( 'PsiX'  , {} )


    for s in [ psix.psi_pi() ] :
        
        a = s.algorithm ()
        a.ParticleCombiners = { '' : 'LoKi::VertexFitter:PUBLIC' } 
        
        
    from PhysSelPython.Wrappers import      SelectionSequence    
    sel_seq = SelectionSequence ( 'B2PsiPi'   , psix . psi_pi   () )
    

    the_year = '2012'
    davinci = DaVinci (
        DataType      = the_year ,
        InputType     = 'DST'    ,
        Simulation    = True     ,
        PrintFreq     = 1000     ,
        EvtMax        = -1       , 
        HistogramFile = 'DVHistos.root' ,
        TupleFile     = 'DVNtuples.root' ,
        Lumi          = True ,
        ##
        # MC : 
        ## SIMCOND : 'Sim08-20130503-1', 'Sim08-20130503-1-vc-md100'
        #
        DDDBtag   = "Sim08-20130503-1"         ,
        CondDBtag = "Sim08-20130503-1-vc-md100"    
        )
    
    
    my_name = "Bplus"
    from Configurables import GaudiSequencer
    
    davinci.UserAlgorithms = [ sel_seq.sequence() , my_name ] 
    
    setData ( datafiles , catalogs , castor )
    
    gaudi = appMgr()
    
    print 'seq.outputLocation()= ', sel_seq.outputLocation()    # Phys/SelPsi3KPiForPsiX/Particles
    alg = Jpsi_mu(
        my_name               ,   ## Algorithm name
        Inputs = [
        sel_seq.outputLocation()
        ] ,
        PP2MCs = [ 'Relations/Rec/ProtoP/Charged' ]
        )

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

示例11: OfflineVertexFitter

                              ReFitPVs        = True )



#---- Refit vertices with Jpsi mass constraint----------------
#_Lb2JpsipK.addTool( OfflineVertexFitter() )
#_Lb2JpsipK.VertexFitters.update( { "" : "OfflineVertexFitter"} )
#_Lb2JpsipK.OfflineVertexFitter.applyDauMassConstraint = True


Lb2JpsiS  = Selection( "Lb2JpsiS",
                      Algorithm          = _Lb2JpsiS ,
                      RequiredSelections = [ Jpsi2MuMu, S2L0g, FilterL ] )

### Gaudi sequence
SeqLb2JpsiS = SelectionSequence("SeqLb2JpsiS", TopSelection = Lb2JpsiS)
seq = SeqLb2JpsiS.sequence()

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

from Configurables import  OfflineVertexFitter

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


tuple = DecayTreeTuple( "Lb2JpsiSTree" )
tuple.Inputs = [ SeqLb2JpsiS.outputLocation() ]
开发者ID:goi42,项目名称:LbJpsipPi,代码行数:31,代码来源:DataXb2JpsiS.py

示例12: execute

def execute(simulation=True,
            turbo=True,
            decay_descriptor="J/psi(1S) -> mu- mu+"):
    # Configure all the unpacking, algorithms, tags and input files
    appConf = ApplicationMgr()
    appConf.ExtSvc+= ['ToolSvc', 'DataOnDemandSvc', LoKiSvc()]

    ConfigTarFileAccessSvc().File = 'config.tar'
    
    dv = DaVinci()
    dv.DataType = "2012"

    lhcbApp = LHCbApp()
    lhcbApp.Simulation = simulation
    CondDB().Upgrade = False
    
    dtt = DecayTreeTuple("Early2015")
    if turbo:
        tesla_prefix = "Hlt2DiMuonJPsi"
        dtt.Inputs = ["/Event/"+tesla_prefix+"/Particles"]
        dtt.InputPrimaryVertices = "/Event/"+tesla_prefix+"/Primary"
        dtt.WriteP2PVRelations = False

    else:
        LHCbApp().DDDBtag = "dddb-20140729"
        polarity = "u"
        LHCbApp().CondDBtag = "sim-20140730-vc-m%s100"%polarity
        muons = AutomaticData(Location="Phys/StdAllLooseMuons/Particles")

        jpsi = CombineParticles('MyJPsi')
        jpsi.DecayDescriptors = [decay_descriptor]
        jpsi.CombinationCut = "(AM < 7100.0 *GeV)"
        jpsi.DaughtersCuts = {"": "ALL", "mu+": "ALL", "mu-": "ALL"}
        jpsi.MotherCut = "(VFASPF(VCHI2/VDOF) < 999999.0)"
        
        code = """
('J/psi(1S)' == ID) &
in_range(2.990*GeV, M, 3.210*GeV) &
DECTREE('%s') &
CHILDCUT(1, HASMUON & ISMUON) &
CHILDCUT(2, HASMUON & ISMUON) &
(MINTREE('mu+' == ABSID, PT) > 700*MeV) &
(MAXTREE(ISBASIC & HASTRACK, TRCHI2DOF) < 5) &
(MINTREE(ISBASIC & HASTRACK, CLONEDIST) > 5000) &
(VFASPF(VPCHI2) > 0.5/100) &
(abs(BPV(VZ)) <  0.5*meter) &
(BPV(vrho2) < (10*mm)**2)
"""%(decay_descriptor)
        # similar to the HLT2 line
        code = """
(ADMASS('J/psi(1S)')< 120*MeV) &
DECTREE('%s') &
(PT>0*MeV) &
(MAXTREE('mu-'==ABSID,TRCHI2DOF) < 4) &
(MINTREE('mu-'==ABSID,PT)> 0*MeV) &
(VFASPF(VCHI2PDOF)< 25)
"""%(decay_descriptor)
        filter_jpsi = FilterDesktop("MyFilterJPsi",
                                    Code=code,
                                    Preambulo=["vrho2 = VX**2 + VY**2"],
                                    ReFitPVs=True,
                                    #IgnoreP2PVFromInputLocations=True,
                                    #WriteP2PVRelations=True
                                    )
        
        jpsi_sel = Selection("SelMyJPsi", Algorithm=jpsi, RequiredSelections=[muons])
        filter_jpsi_sel = Selection("SelFilterMyJPsi",
                                    Algorithm=filter_jpsi,
                                    RequiredSelections=[jpsi_sel])
        jpsi_seq = SelectionSequence("SeqMyJPsi", TopSelection=filter_jpsi_sel)
        dtt.Inputs = [jpsi_seq.outputLocation()]
    
    # Overwriting default list of TupleTools
    dtt.ToolList = ["TupleToolKinematic",
                    "TupleToolPid",
                    "TupleToolEventInfo",
                    "TupleToolMCBackgroundInfo",
                    "TupleToolMCTruth",
                    #"MCTupleToolHierarchy",
                    #"MCTupleToolPID",
                    "TupleToolGeometry",
                    "TupleToolTISTOS",
                    # with turbo this crashes
                    #"TupleToolTrackInfo",
                    "TupleToolTrigger",
                    ]
    tlist = ["L0HadronDecision", "L0MuonDecision",
             "L0DiMuonDecision", "L0ElectronDecision",
             "L0PhotonDecision",
             "Hlt1DiMuonHighMassDecision", "Hlt1DiMuonLowMassDecision",
             "Hlt1TrackMuonDecision", "Hlt1TrackAllL0Decision",
             "Hlt2DiMuonJPsiDecision", "Hlt2SingleMuonDecision",
             ]
    
    dtt.addTool(TupleToolTrigger, name="TupleToolTrigger")
    dtt.addTool(TupleToolTISTOS, name="TupleToolTISTOS")
    # Get trigger info
    dtt.TupleToolTrigger.Verbose = True
    dtt.TupleToolTrigger.TriggerList = tlist
    dtt.TupleToolTISTOS.Verbose = True
#.........这里部分代码省略.........
开发者ID:betatim,项目名称:potential-spice,代码行数:101,代码来源:davinci-turbo-job.py

示例13: configure

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

    ## needed for job configuration
    from Configurables import DaVinci

    the_year = "2011"

    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'
        elif hasInFile(datafiles, 'Stripping20r1'):
            the_year = '2011'
        elif hasInFile(datafiles, 'Stripping20r1p1'):
            the_year = '2011'
        elif hasInFile(datafiles, 'Stripping20r0p1'):
            the_year = '2012'
        elif hasInFile(datafiles, 'MC11'):
            the_year = '2011'
        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)

    W_Location = '/Event/AllStreams/Phys/WMuLine/Particles'
    from PhysSelPython.Wrappers import AutomaticData
    W_Strip = AutomaticData(Location=W_Location)

    EW_preambulo = [
        "pion_cuts  = in_range ( 300 * MeV , PT , 10 * GeV ) & ( CLONEDIST > 5000 ) & ( TRCHI2DOF < 5 ) & ( TRGHOSTPROB < 0.5 ) & ( PERR2/P2 < 0.05**2 ) ",
        "ptCone_    =  SUMCONE (   0.25 , PT , '/Event/Phys/StdAllLoosePions/Particles'               )",
        "ptCone_2   =  SUMCONE (   0.25 , PT , '/Event/Phys/StdAllLoosePions/Particles'   , pion_cuts )",
        "etCone_    =  SUMCONE (   0.25 , PT , '/Event/Phys/StdLooseAllPhotons/Particles'             )",
        "ptCone     =    SINFO (  55001 , ptCone_  , True ) ",
        "ptCone2    =    SINFO (  55003 , ptCone_2 , True ) ",
        "etCone     =    SINFO (  55002 , etCone_  , True ) ",
    ]

    # ========================================================================
    # good W
    # ========================================================================
    from GaudiConfUtils.ConfigurableGenerators import FilterDesktop
    gW = FilterDesktop(
        Preambulo=EW_preambulo,
        Code="""
        in_range ( 15 * GeV , PT , 100 * GeV ) &
        ( -1e+10 * GeV < ptCone  ) &
        ( -1e+10 * GeV < ptCone2 ) &
        ( -1e+10 * GeV < etCone  ) 
        """
    )
    from PhysSelPython.Wrappers import Selection
    W_Data = Selection(
        'W',
        Algorithm=gW,
        RequiredSelections=[W_Strip]
    )

    from PhysSelPython.Wrappers import SelectionSequence
    seq = SelectionSequence("Wseq", TopSelection=W_Data)

    # counters
    from Configurables import LoKi__CounterAlg as CounterAlg
    cnt = CounterAlg(
        'CharmEWCounters',
        Location="Counters/CharmEW",
        Preambulo=[
            "from LoKiPhys.decorators import *",
            "from LoKiCore.functions  import *",
            "pion_cuts  = in_range ( 300 * MeV , PT , 120 * GeV ) & ( CLONEDIST > 5000 ) & ( TRCHI2DOF < 5 ) ",
            "gamma_cuts = in_range ( 300 * MeV , PT ,  10 * GeV )  ",
#.........这里部分代码省略.........
开发者ID:bmcharek,项目名称:Bu2JpsiKKpi,代码行数:101,代码来源:MCW.py

示例14: configure


#.........这里部分代码省略.........
    from GaudiConfUtils.ConfigurableGenerators import CombineParticles

    # ========================================================================
    # B -> J/psi + K pi pi
    # ========================================================================
    from GaudiConfUtils.ConfigurableGenerators import CombineParticles
    bc_Kpp = CombineParticles(
        DecayDescriptor='[B+ -> J/psi(1S) K+ pi+ pi-]cc',
        #
        Preambulo=Preambulo,
        DaughtersCuts={
            "J/psi(1S)": " in_range( 3.096 * GeV - 45 * MeV , M , 3.096 * GeV + 45 * MeV ) "
        },
        #
        CombinationCut="""
        in_range ( 5.0 * GeV , AM ,  5.6 * GeV ) 
        """ ,
        #
        MotherCut="""
        in_range  ( 5.1 * GeV , M , 5.5 * GeV ) &
        ( PT      > 1 * GeV          ) &
        ( chi2vx  <  49              ) &
        in_range ( 150 * micrometer , ctau , 1000 * micrometer ) 
        """ ,
        #
        ParticleCombiners={'': 'LoKi::VertexFitter'},
        ReFitPVs=True
    )
    #
    from PhysSelPython.Wrappers import Selection
    Bc_Kpp = Selection(
        'PsiKpp',
        Algorithm=bc_Kpp,
        RequiredSelections=[jpsi, pions, kaons]
    )

    # ========================================================================
    # B -> J/psi + K
    # ========================================================================
    from GaudiConfUtils.ConfigurableGenerators import CombineParticles
    bc_K = CombineParticles(
        DecayDescriptor='[ B+ -> J/psi(1S) K+ ]cc',
        #
        Preambulo=Preambulo,
        DaughtersCuts={
            "J/psi(1S)": " in_range( 3.096 * GeV - 45 * MeV , M , 3.096 * GeV + 45 * MeV ) "
        },
        #
        CombinationCut="""
        in_range ( 5.0 * GeV , AM ,  5.6 * GeV ) 
        """ ,
        #
        MotherCut="""
        in_range  ( 5.1 * GeV , M , 5.5 * GeV ) &
        ( PT      > 1 * GeV          ) &
        ( chi2vx  <  16              ) &
        in_range ( 150 * micrometer , ctau , 1000 * micrometer ) 
        """ ,
        ParticleCombiners={'': 'LoKi::VertexFitter'},
        ReFitPVs=True
    )
    #
    Bc_K = Selection(
        'PsiK',
        Algorithm=bc_K,
        RequiredSelections=[jpsi, kaons]
    )

    from PhysSelPython.Wrappers import SelectionSequence
    Seq_Kpp = SelectionSequence("PSIKPP", TopSelection=Bc_Kpp)
    Seq_K = SelectionSequence("PSIK", TopSelection=Bc_K)

    from Configurables import GaudiSequencer
    davinci.UserAlgorithms = [
        GaudiSequencer(
            'K', Members=[Seq_K  .sequence(), 'B2PsiK']),
        GaudiSequencer('KPP', Members=[Seq_Kpp.sequence(), 'B2PsiKpp'])
    ]

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

    #
    # start Gaudi
    #
    gaudi = appMgr()

    #
    algKpp = B2Kpp(
        'B2PsiKpp',  # Algorithm name ,
        Inputs=[Seq_Kpp.outputLocation()]
    )
    algK = B2K(
        'B2PsiK',  # Algorithm name ,
        Inputs=[Seq_K  .outputLocation()]
    )

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

示例15: SelectionSequence

    tup.B0.addTool( LoKi_B0 )
    tup.B0.ToolList += ["LoKi::Hybrid::TupleTool/LoKi_B0"]
    tup.Jpsi.addTool( LoKi_Jpsi )
    tup.Jpsi.ToolList += ["LoKi::Hybrid::TupleTool/LoKi_Jpsi"]
    tup.muplus.addTool( LoKi_Mu )
    tup.muplus.ToolList += ["LoKi::Hybrid::TupleTool/LoKi_Mu"]
    tup.muminus.addTool( LoKi_Mu )
    tup.muminus.ToolList += ["LoKi::Hybrid::TupleTool/LoKi_Mu"]
    for particle in [ tup.B0 ]:
        particle.addTool(TISTOSTool, name = "TISTOSTool")
        particle.ToolList += [ "TupleToolTISTOS/TISTOSTool" ]



from PhysSelPython.Wrappers import SelectionSequence
rd_SEQ = SelectionSequence  ( 'DATA'  , rd_selection )


###################### DAVINCI SETTINGS ############################################

lum = True
sim = False

if MODE == 'MC':
    lum = False
    sim = True

daVinci = DaVinci (
      EvtMax             = EVTMAX
    , RootInTES          = rootInTES
    , InputType          = "MDST"
开发者ID:kgizdov,项目名称:jpsi_omega,代码行数:31,代码来源:data_2011.py


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