コード例 #1
0
def makeDefault(name,inputSel) :
    """
    B --> 4 mu selection
    should become     inclusive bb-->4 mu selection  ??
    """
    from Configurables import OfflineVertexFitter
    Detached4mu = CombineParticles("Combine"+name)
    Detached4mu.DecayDescriptor = "B_s0 -> mu+ mu- mu+ mu-"
    # Set the OfflineVertexFitter to keep the 4 tracks and not the J/Psi Kstar:
    Detached4mu.addTool( OfflineVertexFitter() )
    Detached4mu.VertexFitters.update( { "" : "OfflineVertexFitter"} )
    Detached4mu.OfflineVertexFitter.useResonanceVertex = False
    Detached4mu.ReFitPVs = True
    Detached4mu.DaughtersCuts = { "mu+" : "(TRCHI2DOF < 2.5 ) "\
                                  " & (MIPCHI2DV(PRIMARY)> 9.)"}
                                 
    Detached4mu.CombinationCut = "(ADAMASS('B_s0')<1000*MeV) "\
                                   "& (AMAXDOCA('')<0.3*mm)"
    Detached4mu.MotherCut = "(VFASPF(VCHI2/VDOF)<9) "\
                              "& (BPVDIRA > 0) "\
                              "& (BPVVDCHI2>100)"\
                              " & (M>4366.3) & (M<6366.3)"\
                              "& (BPVIPCHI2()< 25) "
    

    return Selection (name,
                      Algorithm = Detached4mu,
                      RequiredSelections = inputSel)
コード例 #2
0
def makeNoMuID(name):
    """
    default K0s2mumu selection object
    starts from Phys/StdNoPIDsMuons

    Please contact Diego Martinez Santos if you think of prescaling this line!
    
    Arguments:
    name        : name of the Selection.
    """
    from Configurables import OfflineVertexFitter
    K0s2MuMuNoMuID = CombineParticles("Comine" + name)
    K0s2MuMuNoMuID.DecayDescriptor = "KS0 -> pi+ pi-"
    # Set the OfflineVertexFitter to keep the 4 tracks and not the J/Psi Kstar:
    K0s2MuMuNoMuID.addTool(OfflineVertexFitter)
    K0s2MuMuNoMuID.VertexFitters.update({"": "OfflineVertexFitter"})
    K0s2MuMuNoMuID.OfflineVertexFitter.useResonanceVertex = False
    K0s2MuMuNoMuID.ReFitPVs = True
    K0s2MuMuNoMuID.DaughtersCuts = {
        "pi+": "(MIPCHI2DV(PRIMARY)> 100.)&(TRCHI2DOF < 5 )"
    }
    K0s2MuMuNoMuID.CombinationCut = "(ADAMASS('KS0')<100*MeV)"\
                                   "& (AMAXDOCA('')<0.3*mm)"

    K0s2MuMuNoMuID.MotherCut = "((BPVDIRA>0) & ((BPVVDSIGN*M/P) > 0.1*89.53*2.9979e-01) & (MIPDV(PRIMARY)<0.4*mm) & (M>400) & (M<600))"

    _stdNoPIDsPions = DataOnDemand(Location="Phys/StdNoPIDsPions/Particles")

    return Selection(name,
                     Algorithm=K0s2MuMuNoMuID,
                     RequiredSelections=[_stdNoPIDsPions])
コード例 #3
0
def makeDefault(name):
    """
    default Bs2mumu selection object (tighter selection a la roadmap)
    starts from Phys/StdNoPIDsMuons

    Please contact Johannes Albrecht if you think of prescaling this line!
    
    Arguments:
    name        : name of the Selection.
    """
    from Configurables import OfflineVertexFitter
    Bs2MuMuNoMuID = CombineParticles("Comine" + name)
    Bs2MuMuNoMuID.DecayDescriptor = "B_s0 -> mu+ mu-"
    # Set the OfflineVertexFitter to keep the 4 tracks and not the J/Psi Kstar:
    Bs2MuMuNoMuID.addTool(OfflineVertexFitter())
    Bs2MuMuNoMuID.VertexFitters.update({"": "OfflineVertexFitter"})
    Bs2MuMuNoMuID.OfflineVertexFitter.useResonanceVertex = False
    Bs2MuMuNoMuID.ReFitPVs = True
    Bs2MuMuNoMuID.DaughtersCuts = {
        "mu+": "(MIPCHI2DV(PRIMARY)> 25.)&(TRCHI2DOF < 4 )"
    }
    Bs2MuMuNoMuID.CombinationCut = "(ADAMASS('B_s0')<600*MeV)"\
                                   "& (AMAXDOCA('')<0.3*mm)"

    Bs2MuMuNoMuID.MotherCut = "(VFASPF(VCHI2/VDOF)<9) "\
                              "& (ADMASS('B_s0') < 600*MeV )"\
                              "& (BPVDIRA > 0) "\
                              "& (BPVVDCHI2> 225)"\
                              "& (BPVIPCHI2()< 25) "

    _stdNoPIDsMuons = DataOnDemand(Location="Phys/StdNoPIDsMuons/Particles")

    return Selection(name,
                     Algorithm=Bs2MuMuNoMuID,
                     RequiredSelections=[_stdNoPIDsMuons])
コード例 #4
0
def makeDetachedJPsi(name):
    """
    detached JPsi selection for B--> JPsi X calibration and
    normalization channels. 

    Please contact Flavio Archilli if you think of prescaling this line!

    Arguments:
    name        : name of the Selection.
    """
    from Configurables import OfflineVertexFitter
    DetachedJPsi = CombineParticles("Combine" + name)
    DetachedJPsi.DecayDescriptor = "J/psi(1S) -> e+ e-"
    DetachedJPsi.addTool(OfflineVertexFitter)
    DetachedJPsi.ParticleCombiners.update({"": "OfflineVertexFitter"})
    DetachedJPsi.OfflineVertexFitter.useResonanceVertex = False
    DetachedJPsi.ReFitPVs = True
    DetachedJPsi.DaughtersCuts = { "e+" : "(TRCHI2DOF < 3 ) "\
                                   "& (MIPCHI2DV(PRIMARY)> 25.) "\
                                   "& (PIDe > 2) "}

    DetachedJPsi.CombinationCut = "(ADAMASS('J/psi(1S)')<1000*MeV) "\
                                   "& (AMAXDOCA('')<0.3*mm)"

    DetachedJPsi.MotherCut = "(VFASPF(VCHI2)<9) "\
                             "& (ADMASS('J/psi(1S)') < 1000*MeV )"\
                             "& (BPVDIRA > 0) "\
                             "& (BPVVDCHI2>169)"

    _stdLooseElectrons = DataOnDemand(
        Location="Phys/StdLooseElectrons/Particles")

    return Selection(name,
                     Algorithm=DetachedJPsi,
                     RequiredSelections=[_stdLooseElectrons])
コード例 #5
0
def makeBu(name):
    """
    detached Bu-->JPsiK selection.

    Please contact Flavio Archilli if you think of prescaling this line!

    Arguments:
    name        : name of the Selection.
    """

    from Configurables import OfflineVertexFitter

    SelDJPsi = makeDetachedJPsi(name)

    PreselBu2JPsiKCommon = CombineParticles("PreselBu2JPsiKCommon")
    PreselBu2JPsiKCommon.DecayDescriptor = " [B+ -> J/psi(1S) K+]cc "
    PreselBu2JPsiKCommon.addTool(OfflineVertexFitter)
    PreselBu2JPsiKCommon.ParticleCombiners.update({"": "OfflineVertexFitter"})
    PreselBu2JPsiKCommon.OfflineVertexFitter.useResonanceVertex = False
    PreselBu2JPsiKCommon.ReFitPVs = True
    PreselBu2JPsiKCommon.DaughtersCuts = {
        "K+":
        "(ISLONG) & (TRCHI2DOF < 3 ) &(MIPCHI2DV(PRIMARY)>25)& (PT>250*MeV) & (TRGHOSTPROB<0.3) "
    }
    PreselBu2JPsiKCommon.CombinationCut = "(ADAMASS('B+') < 600*MeV)"
    PreselBu2JPsiKCommon.MotherCut = "(BPVIPCHI2()< 25)& (VFASPF(VCHI2)<45) "

    _kaons = DataOnDemand(Location='Phys/StdNoPIDsKaons/Particles')

    return Selection("SelBu2KJPsiee",
                     Algorithm=PreselBu2JPsiKCommon,
                     RequiredSelections=[SelDJPsi, _kaons])
コード例 #6
0
def makeK0s2mm(name):
    """
    K0s2mumu selection object
    with muon Id and wide mass window
    starts from Phys/StdLooseMuons

    Please contact Diego Martinez Santos if you think of prescaling this line!
    
    Arguments:
    name        : name of the Selection.
    """
    from Configurables import OfflineVertexFitter
    K0s2MuMu = CombineParticles("Combine" + name)
    K0s2MuMu.DecayDescriptor = "KS0 -> mu+ mu-"
    K0s2MuMu.addTool(OfflineVertexFitter)
    K0s2MuMu.VertexFitters.update({"": "OfflineVertexFitter"})
    K0s2MuMu.OfflineVertexFitter.useResonanceVertex = False
    K0s2MuMu.ReFitPVs = True
    K0s2MuMu.DaughtersCuts = {
        "mu+": "(MIPCHI2DV(PRIMARY)> 100.)&(TRCHI2DOF < 5 )"
    }
    K0s2MuMu.CombinationCut ="(ADAMASS('KS0')<1000*MeV)"\
                                   "& (AMAXDOCA('')<0.3*mm)"

    K0s2MuMu.MotherCut = "((BPVDIRA>0) & ((BPVVDSIGN*M/P) > 0.1*89.53*2.9979e-01) & (MIPDV(PRIMARY)<0.4*mm) & (M>450))"

    _stdLooseMuons = DataOnDemand(Location="Phys/StdLooseMuons/Particles")

    return Selection(name,
                     Algorithm=K0s2MuMu,
                     RequiredSelections=[_stdLooseMuons])
コード例 #7
0
def makeXibc (localname, _RequiredSelections ,config=default_config['CONFIG']):
  _xibcLc = CombineParticles(localname + "Xibc2LcJpsiAlgorithm")
  _xibcLc.DecayDescriptor = "[Xi_bc+ -> J/psi(1S) Lambda_c+]cc"
  _xibcLc.CombinationCut = ("(ADAMASS('Xi_bc+') < %(Xibc_MassWindow)s) " 
#                          "(AMAXCHILD(TRGHP, ISBASIC) < %(GlobalGhostProb_Max)s)"
                        ) % config
  _xibcLc.MotherCut = ("(VFASPF(VCHI2/VDOF)<%(Xibc_ENDVERTEXCHI2)s)" +
                        " & (MIPDV(PRIMARY) < %(Xibc_MINPVIP)s)") % config #MINIPCUT disabled
    
  return Selection (name = localname+'XibcLcSelection', Algorithm = _xibcLc,
                      RequiredSelections = _RequiredSelections)
コード例 #8
0
def makeXibc0(localname, _RequiredSelections, config=default_name):

    _xibc = CombineParticles(localname + "xibc2xijpsi")
    _xibc.DecayDescriptor = "[Xi_bc0 -> Xi_c0 J/psi(1S)]cc"
    _xibc.CombinationCut = "ADAMASS('Xi_bc0') < %(Xibc0_MassWindow)s" % config
    _xibc.MotherCut = (
        "(VFASPF(VCHI2/VDOF)< %(Xibc0_ENDVERTEXCHI2)s)") % config

    #Selection
    return Selection(localname + "SelLooseXibc0",
                     Algorithm=_xibc,
                     RequiredSelections=_RequiredSelections)
コード例 #9
0
def makeDetachedDimuons(name, config, inputSel):
    """
    KS0->mumu selection
    """
    comboCuts = LoKiCuts(['ASUMPT', 'AMAXDOCA'], config).code()
    momCuts = LoKiCuts(['VCHI2DOF', 'BPVVDCHI2'], config).code()
    KS2MuMu = CombineParticles("Combine" + name)
    KS2MuMu.DecayDescriptor = 'KS0 -> mu+ mu-'
    KS2MuMu.CombinationCut = comboCuts
    KS2MuMu.MotherCut = momCuts

    return Selection(name, Algorithm=KS2MuMu, RequiredSelections=inputSel)
コード例 #10
0
    def makeDiJet(self, _name):

        DiJet = CombineParticles("Combine" + _name)
        DiJet.DecayDescriptor = "[H+ -> CELLjet CELLjet mu+]cc"
        DiJet.ParticleCombiners = {"": "LoKi::VertexFitter"}
        DiJet.addTool(LoKi__VertexFitter, name="LoKi::VertexFitter")
        vfitter = getattr(DiJet, "LoKi::VertexFitter")
        vfitter.Jets = ""

        DiJet.DaughtersCuts = {
            "CELLjet": " (PT > %(min_jet_pT)s * GeV ) " % self._config
        }

        DiJet.Preambulo = [
            "from GaudiKernel.SystemOfUnits import degree",
            "eta_1 = ACHILDFUN(1,ETA)",
            "eta_2 = ACHILDFUN(2,ETA)",
            "eta_3 = ACHILDFUN(3,ETA)",
            "phi_1 = ACHILDFUN(1,PHI)",
            "phi_2 = ACHILDFUN(2,PHI)",
            "phi_3 = ACHILDFUN(3,PHI)",

            ##
            "deta_13 = eta_1 - eta_3",
            "deta_23 = eta_2 - eta_3",

            ##
            "dphi_13 = phi_1 - phi_3 ",
            "dphi_23 = phi_2 - phi_3",

            ##
            "dphi_13 = switch ( dphi_13 >  180 * degree ,  dphi_13 - 180 * degree , dphi_13 ) ",
            "dphi_13 = switch ( dphi_13 < -180 * degree ,  dphi_13 + 180 * degree , dphi_13 ) ",
            "dphi_23 = switch ( dphi_23 >  180 * degree ,  dphi_23 - 180 * degree , dphi_23 ) ",
            "dphi_23 = switch ( dphi_23 < -180 * degree ,  dphi_23 + 180 * degree , dphi_23 ) ",

            ##
            "dr_13 = sqrt(deta_13**2 + dphi_13**2)",
            "dr_23 = sqrt(deta_23**2 + dphi_23**2)",
        ]

        DiJet.CombinationCut = "AALLSAMEBPV "\
                               "& ( dr_13 > %(dr_lepton_jet)s )"\
                               "& ( dr_23 > %(dr_lepton_jet)s )" %self._config

        DiJet.MotherCut = "ALL"

        requiredSelections = [self.sel_Wmu, StdJets]

        return Selection("Sel" + _name,
                         Algorithm=DiJet,
                         RequiredSelections=requiredSelections)
コード例 #11
0
    def _create_dijets(self,
                       inputs,
                       cut1=-1,
                       cut2=-1,
                       cut3=-1,
                       cut4=-1,
                       PT=25 * GeV,
                       LeadingPT=0):
        pre = ["COSDPHI = cos(ACHILD(PHI,1) - ACHILD(PHI,2))"]
        cmb_cuts = "(abs(ACHILD(BPV(VZ),1)-ACHILD(BPV(VZ),2))<1e-6)  & (COSDPHI < %s) " % self._config[
            "DIJET"]["MAX_COSDPHI"]
        label = ""
        if (cut1 > -1 or cut2 > -1):
            cmb_cuts += "& ((  (ACHILD(PINFO(9990,0),1)>" + str(
                cut1) + ") &  (ACHILD(PINFO(9990,0),2)>" + str(
                    cut2) + "))  |    ((ACHILD(PINFO(9990,0),2)>" + str(
                        cut1) + ") &  (ACHILD(PINFO(9990,0),1)>" + str(
                            cut2) + "))) "
            label += "T"
        if (cut3 > -1 or cut4 > -1):
            cmb_cuts += "& ((  (ACHILD(PINFO(9991,0),1)>" + str(
                cut3) + ") &  (ACHILD(PINFO(9991,0),2)>" + str(
                    cut4) + "))  |    ((ACHILD(PINFO(9991,0),2)>" + str(
                        cut3) + ") &  (ACHILD(PINFO(9991,0),1)>" + str(
                            cut4) + "))) "
            label += "PS"
        if (cut3 > -1 and cut1 > -1):
            cmb_cuts += "& ((  (ACHILD(PINFO(9990,0),1)>" + str(
                cut1) + ") &  (ACHILD(PINFO(9991,0),2)>" + str(
                    cut3) + "))  |    ((ACHILD(PINFO(9990,0),2)>" + str(
                        cut3) + ") &  (ACHILD(PINFO(9991,0),1)>" + str(
                            cut1) + "))) "
            label += "TPS"
        dijets = CombineParticles(
            "DiJetCreatation" + str(PT) + str(LeadingPT) + str(cut1) +
            str(cut2) + str(cut3) + str(cut4),
            ParticleCombiners={"": "LoKi::VertexFitter"},
            DecayDescriptor="H_10 -> CELLjet CELLjet",
            DaughtersCuts={"CELLjet": "(PT > " + str(PT) + ")"},
            #                             % self._config["JET"]["MIN_PT"]},
            Preambulo=pre,
            CombinationCut=cmb_cuts,
            MotherCut="INTREE((ABSID=='CELLjet')&(PT>" + str(LeadingPT) + "))")
        dijets.addTool(LoKi__VertexFitter, name="LoKi::VertexFitter")
        vfitter = getattr(dijets, "LoKi::VertexFitter")
        vfitter.Jets = ""

        return Selection(self._name + label + "PT" + str(PT).split('*')[0] +
                         "LePT" + str(LeadingPT).split('*')[0] + "Selection",
                         Algorithm=dijets,
                         RequiredSelections=inputs)
コード例 #12
0
def makeKPiPiPiMassMeas(name, config):
    """
    Line for the selection of K+ -> pi+ pi+ pi-,  
    Before prescaling this line, please contact the authors listed above
    
    Arguments:
    name        : name of the Selection.
    config      : dictionary of tunable cuts 
    """

    from Configurables import OfflineVertexFitter
    KPiPiPi = CombineParticles("Combine" + name)
    KPiPiPi.DecayDescriptor = "[K+ -> pi+ pi+ pi-]cc"
    KPiPiPi.addTool(OfflineVertexFitter)

    KPiPiPi.ParticleCombiners.update({"": "OfflineVertexFitter"})
    KPiPiPi.OfflineVertexFitter.useResonanceVertex = False
    KPiPiPi.DaughtersCuts = {
        "pi+":
        "(P>1000) & (MIPCHI2DV(PRIMARY) > 25.0) & (TRCHI2DOF<5) & (TRGHOSTPROB < 0.3)"
    }
    KPiPiPi.CombinationCut = "(ADAMASS('K+') < %(KMassWinMassMeas)s *MeV) & (AMAXDOCA('')< %(KMaxDOCAMassMeas)s *mm)" % config

    KPiPiPi.MotherCut ="(PT> %(KMinPTMassMeas)s) & (ADMASS('K+') < %(KMassWinMassMeas)s *MeV) & (BPVDIRA > %(KMinDIRAMassMeas)s)"\
                        "& (VFASPF(VCHI2) < %(KVtxChi2MassMeas)s) & (BPVVDCHI2 > %(KMinVDChi2MassMeas)s) & (BPVIPCHI2()< %(KMaxIpChi2MassMeas)s )"%config

    _stdAllLoosePions = DataOnDemand(
        Location="Phys/StdAllLoosePions/Particles")

    return Selection(name,
                     Algorithm=KPiPiPi,
                     RequiredSelections=[_stdAllLoosePions])
コード例 #13
0
def makeDimuon(name,inputSel) :
    """
    dimuon selection
    """
    from Configurables import OfflineVertexFitter
    Dimuon = CombineParticles("Combine"+name)
    Dimuon.DecayDescriptor = "[J/psi(1S) -> mu+ mu-]cc"
    Dimuon.addTool( OfflineVertexFitter() )
    Dimuon.VertexFitters.update( { "" : "OfflineVertexFitter"} )

    Dimuon.DaughtersCuts = { "mu+" : "(TRCHI2DOF < 2.0 ) "\
                                  " & (MIPCHI2DV(PRIMARY)> 4.)"\
                                  " & (P> 3000.*MeV)"}

    Dimuon.CombinationCut =   " (AMAXDOCA('')<0.3*mm) "


 
    Dimuon.MotherCut = "(VFASPF(VCHI2/VDOF)<12.) "\
			"& (BPVVDZ > 0.) " \
                         "& (M < 2500.)"


    return Selection (name,
                      Algorithm = Dimuon,
                      RequiredSelections = inputSel)
コード例 #14
0
def makeBs2Kst_0Kst_0(name, Kst_0sel, BMassWin, BVCHI2, BDOCA, BIPCHI2,
                      BFDistanceCHI2, SumPT, BDIRA):
    """
       Create and return a Bs -> Kstar_0(1430)(Kpi) anti-Kstar_0(1430)(Kpi) Selection object.
       Arguments:
       name           : name of the Selection.
       Kst_0sel       : Kst_0(1430) -> K+pi- Selection object.
       BMassWin       : Bs invariant mass window around PDG mass value (MeV).
       BVCHI2         : Maximum Bs vertex chi2 per degree of freedom.
       BDOCA          : Maximum Bs DOCA.
       BFDistanceCHI2 : Minimum Bs Flight Distance chi2.
       SumPT          : Sum|pT| of the daughters.
       """

    _motherCuts = " (VFASPF(VCHI2/VDOF) < %(BVCHI2)s) & (MIPCHI2DV(PRIMARY)< %(BIPCHI2)s) & (BPVVDCHI2 > %(BFDistanceCHI2)s) & (BPVDIRA > %(BDIRA)s)" % locals(
    )
    _combinationCut = "(ADAMASS('B_s0') < %(BMassWin)s *MeV) & (AMAXDOCA('')< %(BDOCA)s *mm) "\
                      "& ( (AMINCHILD(PT,ID=='K+') + AMINCHILD(PT,ID=='K-') + AMINCHILD(PT,ID=='pi-') + AMINCHILD(PT,ID=='pi+'))> %(SumPT)s *MeV)" % locals()

    _Bs = CombineParticles('_' + name)
    _Bs.DecayDescriptor = "B_s0 -> K*_0(1430)0 K*_0(1430)~0"
    _Bs.CombinationCut = _combinationCut
    _Bs.MotherCut = _motherCuts

    _Bs.ReFitPVs = True

    _Bs.addTool(OfflineVertexFitter)
    #       _Bs.VertexFitters.update( { "" : "OfflineVertexFitter"} )
    _Bs.ParticleCombiners.update({"": "OfflineVertexFitter"
                                  })  # Fix for DaVinci v32r0 by A.Poluektov
    _Bs.OfflineVertexFitter.useResonanceVertex = False

    return Selection(name, Algorithm=_Bs, RequiredSelections=[Kst_0sel])
コード例 #15
0
    def ChiC(self, name, inputSelJPsi, inputSelGamma, mMinChiCRaw, mMaxChiCRaw, mMinChiCFit, mMaxChiCFit):

        combCut   = "(AM > %(mMinChiCRaw)s *GeV) & (AM < %(mMaxChiCRaw)s*GeV)"  % locals()
        motherCut = "(MM > %(mMinChiCFit)s *GeV) & (MM < %(mMaxChiCFit)s*GeV)"  % locals()
        
        ChiC                  = CombineParticles("ChiC"+name)
        ChiC.DecayDescriptor  = "chi_c1(1P) -> J/psi(1S) gamma"
        ChiC.CombinationCut   = combCut
        ChiC.MotherCut        = motherCut
        ChiC.ParticleCombiners.update( { "" : "OfflineVertexFitter:PUBLIC"}  )
        
        ChiCSel = Selection(name+"_ChiCSel", Algorithm = ChiC, RequiredSelections = [inputSelJPsi, inputSelGamma])

        return ChiCSel
コード例 #16
0
def makeB2TauMu(name):
    """
    Please contact Johannes Albrecht if you think of prescaling this line!
    
    Arguments:
    name        : name of the Selection.
    """
    
    from Configurables import OfflineVertexFitter
    Bs2TauMu = CombineParticles("Combine"+name)
    Bs2TauMu.DecayDescriptors = ["[B_s0 -> tau+ mu-]cc","[B_s0 -> tau+ mu+]cc"]
    # Set the OfflineVertexFitter to keep the 4 tracks and not the J/Psi Kstar:
    Bs2TauMu.addTool( OfflineVertexFitter )
    Bs2TauMu.ParticleCombiners.update( { "" : "OfflineVertexFitter"} )
    Bs2TauMu.OfflineVertexFitter.useResonanceVertex = False
    #Bs2TauMu.ReFitPVs = True
    Bs2TauMu.DaughtersCuts = { "mu+" : "(MIPCHI2DV(PRIMARY)> 25.)&(TRCHI2DOF < 3 ) & (TRGHOSTPROB<0.3)"}

    Bs2TauMu.CombinationCut = "(ADAMASS('B_s0')<1200*MeV)"\
                            "& (AMAXDOCA('')<0.3*mm)"

    Bs2TauMu.MotherCut = "(VFASPF(VCHI2/VDOF)<9) "\
                              "& (ADMASS('B_s0') < 1200*MeV )"\
                              "& (BPVDIRA > 0) "\
                              "& (BPVVDCHI2> 225)"\
                              "& (BPVIPCHI2()< 25) "
    
    from CommonParticles import StdLooseDetachedTau, StdLooseDipion
    _stdLooseMuons = DataOnDemand(Location = "Phys/StdLooseMuons/Particles")
    _stdLooseDetachedTaus= DataOnDemand(Location = "Phys/StdLooseDetachedTau3pi/Particles")

    return Selection (name,
                      Algorithm = Bs2TauMu,
                      RequiredSelections = [ _stdLooseMuons,_stdLooseDetachedTaus])
コード例 #17
0
def makeBs2KstKst(name, Kstsel, BMassWin, BVCHI2, BDOCA, BIPCHI2):
    """
       Create and return a Bs -> Kstar (Kpi) anti-Kstar (Kpi) Selection object.
       Arguments:
       name        : name of the Selection.
       Kstsel      : Kst -> K+pi- Selection object.
       BMassWin    : Bs invariant mass window around PDG mass value (MeV).
       BVCHI2      : Maximum Bs vertex chi2 per degree of freedom.
       BDOCA       : Maximum Bs DOCA.
       """

    _motherCuts = " (VFASPF(VCHI2/VDOF) < %(BVCHI2)s) & (MIPCHI2DV(PRIMARY)< %(BIPCHI2)s)" % locals(
    )
    _combinationCut = "(ADAMASS('B_s0') < %(BMassWin)s *MeV) & (AMAXDOCA('')< %(BDOCA)s *mm)" % locals(
    )

    _Bs = CombineParticles('_' + name)
    _Bs.DecayDescriptor = "B_s0 -> K*(892)0 K*(892)~0"
    _Bs.CombinationCut = _combinationCut
    _Bs.MotherCut = _motherCuts

    _Bs.ReFitPVs = True

    _Bs.addTool(OfflineVertexFitter)
    #       _Bs.VertexFitters.update( { "" : "OfflineVertexFitter"} )
    _Bs.ParticleCombiners.update({"": "OfflineVertexFitter"
                                  })  # Fix for DaVinci v32r0 by A.Poluektov
    _Bs.OfflineVertexFitter.useResonanceVertex = False

    return Selection(name, Algorithm=_Bs, RequiredSelections=[Kstsel])
コード例 #18
0
def makeBd2JPsiKst(name, JPsisel, Kstsel, BMassWin, BVCHI2, BDOCA, BIPCHI2):
    """
       Create and return a Bd -> JPsi(mumu) Kstar (Kpi) Selection object.
       Arguments:
       name        : name of the Selection.
       JPsisel     : JPsi -> mu+ mu- Selection object.
       Kstsel      : Kst -> K+pi- Selection object.
       BMassWin    : Bd invariant mass window around PDG mass value (MeV).
       BVCHI2      : Maximum Bd vertex chi2 per degree of freedom.
       BDOCA       : Maximum Bd DOCA.
       """

    _motherCuts = " (VFASPF(VCHI2/VDOF) < %(BVCHI2)s) & (MIPCHI2DV(PRIMARY)< %(BIPCHI2)s)" % locals(
    )
    _combinationCut = "(ADAMASS('B_s0') < %(BMassWin)s *MeV) & (AMAXDOCA('')< %(BDOCA)s *mm)" % locals(
    )

    _Bd = CombineParticles('_' + name)
    _Bd.DecayDescriptor = "[B0 -> J/psi(1S) K*(892)0]cc"
    _Bd.CombinationCut = _combinationCut
    _Bd.MotherCut = _motherCuts

    _Bd.ReFitPVs = True

    _Bd.addTool(OfflineVertexFitter)
    #       _Bd.VertexFitters.update( { "" : "OfflineVertexFitter"} )
    _Bd.ParticleCombiners.update({"": "OfflineVertexFitter"
                                  })  # Fix for DaVinci v32r0 by A.Poluektov
    _Bd.OfflineVertexFitter.useResonanceVertex = False

    return Selection(name, Algorithm=_Bd, RequiredSelections=[JPsisel, Kstsel])
コード例 #19
0
    def makeSidebandRegion(self, name):
        """
        K0s2pi0mumu selection object in sideband region. 
        Arguments:
        name        : name of the Selection
        """
        from Configurables import OfflineVertexFitter
        K0s2Pi0MuMu2 = CombineParticles("Combine" + name)
        K0s2Pi0MuMu2.DecayDescriptor = "KS0 -> pi0 J/psi(1S)"
        K0s2Pi0MuMu2.addTool(OfflineVertexFitter)
        K0s2Pi0MuMu2.ParticleCombiners.update({"": "OfflineVertexFitter"})
        K0s2Pi0MuMu2.OfflineVertexFitter.useResonanceVertex = False
        K0s2Pi0MuMu2.ReFitPVs = True


        K0s2Pi0MuMu2.CombinationCut = "  (AM > %(KSsidebminMass)s * MeV)"\
                                      "& (AM < %(KSsidebmaxMass)s * MeV)" %self.config


        K0s2Pi0MuMu2.MotherCut = "((BPVDIRA> %(KSdira)s ) "\
                                 "& ((BPVVDSIGN*M/P) > %(KSlife)s*2.9979e-01) "\
                                 "& (MIPDV(PRIMARY)<%(KSip)s*mm) "\
                                 "& (M> %(KSsidebminMass)s * MeV) "\
                                 "& ( (M< %(KSsidebmaxMass)s * MeV) ))" %self.config

        return Selection(
            name,
            Algorithm=K0s2Pi0MuMu2,
            RequiredSelections=[self.PseudoJPsiSel, self._stdLoosePi0s])
コード例 #20
0
def makeD2MuMuMuMu(name, inputSel):
    """
    D --> 4 mu selection
    """
    from Configurables import OfflineVertexFitter
    D2MuMuMuMu = CombineParticles("Combine" + name)

    D2MuMuMuMu.DecayDescriptor = "D0 -> mu+ mu- mu+ mu-"
    D2MuMuMuMu.addTool(OfflineVertexFitter)
    D2MuMuMuMu.ParticleCombiners.update({"": "OfflineVertexFitter"})

    D2MuMuMuMu.DaughtersCuts = { "mu+" : "(TRCHI2DOF < 3.0 ) "\
                                  " & (MIPCHI2DV(PRIMARY)> 4.)"\
                                 " & (TRGHOSTPROB<0.3) "\
                                  " & (P> 3000.*MeV)"}

    D2MuMuMuMu.CombinationCut =  "(ADAMASS('D0')<300*MeV) "\
                                 "& (AMAXDOCA('')<0.2*mm) "


    D2MuMuMuMu.MotherCut = "(VFASPF(VCHI2/VDOF)<12.) "\
         "& (BPVVDZ > 0.) " \
         "& (MIPCHI2DV(PRIMARY) < 25. )"

    return Selection(name, Algorithm=D2MuMuMuMu, RequiredSelections=inputSel)
コード例 #21
0
def makeB2ee(name):
    """
    Please contact Johannes Albrecht if you think of prescaling this line!
    
    Arguments:
    name        : name of the Selection.
    """

    from Configurables import OfflineVertexFitter
    Bs2ee = CombineParticles("Combine" + name)
    Bs2ee.DecayDescriptor = "B_s0 -> e+ e-"
    # Set the OfflineVertexFitter to keep the 4 tracks and not the J/Psi Kstar:
    Bs2ee.addTool(OfflineVertexFitter())
    Bs2ee.VertexFitters.update({"": "OfflineVertexFitter"})
    Bs2ee.OfflineVertexFitter.useResonanceVertex = False
    #Bs2ee.ReFitPVs = True
    Bs2ee.DaughtersCuts = {"e+": "(MIPCHI2DV(PRIMARY)> 25.)&(TRCHI2DOF < 4 )"}

    Bs2ee.CombinationCut = "(ADAMASS('B_s0')<600*MeV)"\
                            "& (AMAXDOCA('')<0.3*mm)"

    Bs2ee.MotherCut = "(VFASPF(VCHI2/VDOF)<9) "\
                              "& (ADMASS('B_s0') < 600*MeV )"\
                              "& (BPVDIRA > 0) "\
                              "& (BPVVDCHI2> 225)"\
                              "& (BPVIPCHI2()< 25) "

    _stdLooseElectrons = DataOnDemand(
        Location="Phys/StdLooseElectrons/Particles")

    return Selection(name,
                     Algorithm=Bs2ee,
                     RequiredSelections=[_stdLooseElectrons])
コード例 #22
0
def makeBs2PhiKst(name, Phisel, Kstsel, BMassWin, BVCHI2, BDOCA):
    """
       Create and return a Bs -> Phi (KK) Kstar (Kpi) Selection object.
       Arguments:
       name        : name of the Selection.
       Phisel      : Phi -> K+K- Selection object.
       Kstsel      : Kst -> K+pi- Selection object.
       BMassWin    : Bs invariant mass window around PDG mass value (MeV).
       BVCHI2      : Maximum Bs vertex chi2 per degree of freedom.
       BDOCA       : Maximum Bs DOCA.
       """

    _motherCuts = "(VFASPF(VCHI2/VDOF) < %(BVCHI2)s)" % locals()
    _combinationCut = "(ADAMASS('B_s0') < %(BMassWin)s *MeV) & (AMAXDOCA('')< %(BDOCA)s *mm)" % locals(
    )

    _Bs = CombineParticles('_' + name)
    _Bs.DecayDescriptor = "[B_s0 -> phi(1020) K*(892)~0]cc"
    _Bs.CombinationCut = _combinationCut
    _Bs.MotherCut = _motherCuts

    _Bs.ReFitPVs = True

    _Bs.addTool(OfflineVertexFitter())
    _Bs.VertexFitters.update({"": "OfflineVertexFitter"})
    _Bs.OfflineVertexFitter.useResonanceVertex = False

    return Selection(name, Algorithm=_Bs, RequiredSelections=[Phisel, Kstsel])
コード例 #23
0
 def makeB2LpDDMVA( self,  name, config ):
     """
     Select B -> Lambda~0 p+ event by MVA selcetion
     """
     from Configurables import CombineParticles as CP
     #Selection
     _B = CP("B2LpDDMVA")
     _daugPtSumCut   = "(APT1>%s*MeV)"                   % config['B_DD_PTMin']
     _maxDocaChi2Cut = "(ACUTDOCACHI2(%s,''))"            % config['BDaug_DD_maxDocaChi2']
     _daugMaxPtIPCut = "(AVAL_MAX(MIPDV(PRIMARY),PT)>%s)" % config['BDaug_MaxPT_IP']
     #_B.DecayDescriptors = [ "B- -> p~- ( Lambda0 -> p+ pi- )", "B+ -> p+ ( Lambda~0 -> p~- pi+ )" ]
     _B.DecayDescriptors = [ "B- -> p~- Lambda0", "B+ -> p+ Lambda~0" ]
     _B.CombinationCut = "(ADAMASS('B-')<500*MeV)&"+_maxDocaChi2Cut+'&'+_daugPtSumCut+'&'+_daugMaxPtIPCut
     _B.MotherCut = "VALUE('LoKi::Hybrid::DictValue/MVAResponse')>  %s" % config['MVAResponseDD']
     #_B.MotherCut = 'ALL'
     # get the Lambda's to filter
     _stdLambdaDD = DataOnDemand(Location = "Phys/StdLooseLambdaDD/Particles")
     
     # make the filter
     _filterLambdaDD = FilterDesktop( Code = "ALL" )
     
     #Configure tool
     from MVADictHelpers import addTMVAclassifierValue
     xmldir = "$TMVAWEIGHTSROOT/data/"
     #xmldir = "./"
     
     Vars =    {"log(B_LoKi_VCHI2NDOF)" : "log(VFASPF(VCHI2))",
                "log(B_LoKi_BPVIPCHI2)"       : "log(MIPCHI2DV(PRIMARY))",
                "B_LoKi_BPVDIRA"             : "BPVDIRA",
                "log(B_LoKi_FDwrtPV)"           : "log(VFASPF(VMINVDDV(PRIMARY)))",
                "log(B_LoKi_FDChi2)"      : "log(BPVVDCHI2)",
                "log(B_LoKi_PT)"           : "log(PT)",
                "log(pB_LoKi_PT)"          : "log(CHILD(PT,1))",
                "log(pL_LoKi_PT)"          : "log(CHILD( CHILD(PT,1) ,2))",
                "log(L_LoKi_P)"           : "log(CHILD(P,2))",
                "log(L_LoKi_Mass)"            : "log(ADMASS('Lambda0'))",
                "log(L_LoKi_VtxChi2)" : "log(CHILD(VFASPF(VCHI2),2))",
                "log(L_LoKi_FDChi2)"      : "log(CHILD(BPVVDCHI2,2))",
                "log(pL_LoKi_TrkChi2)"     : "log(CHILD(CHILD(TRCHI2DOF,2),2))",
                "log(pi_LoKi_TrkChi2)"     : "log(CHILD(CHILD(TRCHI2DOF,1),2))",
                                   }
     
     addTMVAclassifierValue(Component = _B ,
                            XMLFile = xmldir+"B2pLambda_DD_BDT_v1r4.xml",
                            Variables = Vars,
                            ToolName = "MVAResponse",
                            )
     return Selection (name, Algorithm = _B, RequiredSelections = [_stdLambdaDD, StdLooseProtons  ])
コード例 #24
0
def build_mc_unbiased_selection(decayDesc, arrow = '==>') :
    preamble = [ "from LoKiPhysMC.decorators import *" , "from LoKiPhysMC.functions import mcMatch" ]
    decayDesc.set_carets(False)
    decayDescCC = decayDesc.copy()
    decayDescCC.cc = True
    algname = decayDesc.get_full_alias() + '_MCSel'
    if algname in selections :
        return selections[algname]
    if not decayDesc.daughters :
        alg = FilterDesktop(algname + '_Filter')
        if decayDesc.particle.name in mcbasicinputs :
            inputsel = mcbasicinputs[decayDesc.particle.name]
        else :
            conj = decayDesc.conjugate()
            if conj.particle.name in mcbasicinputs :
                inputsel = mcbasicinputs[conj.particle.name]
            else :
                raise ValueError("Can't find MC basic input for particle " + repr(decayDesc.particle.name))
        alg.Code = 'mcMatch({0!r})'.format(decayDescCC.to_string(arrow))
        alg.Preambulo = preamble
        sel = Selection(algname,
                        Algorithm = alg,
                        RequiredSelections = [inputsel])
        selections[algname] = sel
        return sel
    inputs = []
    daughtercuts = {}
    for daughter in decayDescCC.daughters :
        originaldaughtercc = daughter.cc
        daughter.cc = True
        sel = build_mc_unbiased_selection(daughter, arrow)
        daughter.cc = originaldaughtercc
        inputs.append(sel)
        #daughter.caret = True
        #daughtercuts[daughter.particle.name] = 'mcMatch({0!r})'.format(decayDescCC.to_string(arrow))
        #daughter.caret = False
    #comb = nCombiners[len(decayDesc.daughters)](algname + '_Comb')
    comb = CombineParticles(algname + '_Comb')
    # CombineParticles uses small cc, so set ishead = False
    comb.DecayDescriptors = [decayDesc.to_string(depth = 1, ishead = False)]
    comb.MotherCut = 'mcMatch({0!r})'.format(decayDescCC.to_string(arrow))
    comb.Preambulo = preamble
    comb.DaughtersCuts = daughtercuts
    sel = Selection(algname,
                    Algorithm = comb,
                    RequiredSelections = inputs)
    selections[algname] = sel
    return sel
コード例 #25
0
    def makeLambdac2PHH(self, name, inputSel, decDescriptors):
        """Return a Selection instance for a Lambda_c+ -> p+ h- h+ decay.

        Keyword arguments:
        name -- Name to give the Selection instance
        inputSel -- List of inputs passed to Selection.RequiredSelections
        decDescriptors -- List of decay descriptors for CombineParticles
        """
        lclPreambulo = ['from math import cos']

        combCuts = ("(ADAMASS('Lambda_c+') < {0[Comb_ADAMASS_WIN]})"
                    '& (AMAXCHILD(PT) > {0[Daug_1of3_PT_MIN]})'
                    '& (AMAXCHILD(BPVIPCHI2()) > {0[Daug_1of3_BPVIPCHI2_MIN]})'
                    '& (ANUM(PT > {0[Daug_2of3_PT_MIN]}) >= 2)'
                    '& (ANUM(BPVIPCHI2() > {0[Daug_2of3_BPVIPCHI2_MIN]}) >= 2)'
                    "& (ACUTDOCA({0[Comb_ADOCAMAX_MAX]}, ''))").format(
                        self.config)

        lambdacCuts = (
            '(VFASPF(VCHI2/VDOF) < {0[Lambdac_VCHI2VDOF_MAX]})'
            '& ({0[Lambdac_PVDispCut]})'
            '& (BPVDIRA > cos({0[Lambdac_acosBPVDIRA_MAX]}))').format(
                self.config)

        _Lambdac = CombineParticles(name='Combine{0}'.format(name),
                                    DecayDescriptors=decDescriptors,
                                    Preambulo=lclPreambulo,
                                    CombinationCut=combCuts,
                                    MotherCut=lambdacCuts)

        return Selection(name, Algorithm=_Lambdac, RequiredSelections=inputSel)
コード例 #26
0
def LbMaker(_combName,config,_RequiredSelections,_decayDescriptors):
    preambulo = ['PXLC = ACHILD(PX,1)',
                 'PYLC = ACHILD(PY,1)',
                 'PZLC = ACHILD(PZ,1)',
                 'ELC  = ACHILD(E,1)',
                 'PXPIPI = ACHILD(CHILD(PX,2),2)',
                 'PYPIPI = ACHILD(CHILD(PY,2),2)',
                 'PZPIPI = ACHILD(CHILD(PZ,2),2)',
                 'EPIPI = ACHILD(CHILD(E,2),2)',
                 'MLCPIPI = sqrt((EPIPI+ELC)**2 - (PXPIPI+PXLC)**2 - (PYPIPI+PYLC)**2 - (PZPIPI+PZLC)**2)',
                 'DELTA_MASS_LC = MLCPIPI - ACHILD(M,1)']
    comb = CombineParticles(name="Comb"+_combName,
                            DecayDescriptors = _decayDescriptors,
                            Preambulo = preambulo,
                            CombinationCut = "(DELTA_MASS_LC < %(Lc2Kpi_DeltaMass_MAX)s *MeV)"\
                            "& (AM > %(Lc2Kpi_B_MASS_MIN)s *MeV)  & (AM < %(Lc2Kpi_B_MASS_MAX)s *MeV)"\
                            "& (ACUTDOCACHI2(%(Lc2Kpi_B_DOCACHI2_MAX)s,''))" % config,
                            MotherCut = "(M > %(Lc2Kpi_B_MASS_MIN)s  *MeV) & (M < %(Lc2Kpi_B_MASS_MAX)s  *MeV)"\
                            "& (MINTREE((ABSID=='Lambda_c+'),VFASPF(VZ)) - MINTREE((ABSID=='K*(892)-'),VFASPF(VZ)) > %(Lc2Kpi_DZ)s *mm )"\
                            "& (VFASPF(VCHI2/VDOF) < %(Lc2Kpi_B_VCHI2NDF_MAX)s)"
                            "& (BPVDIRA> %(Lc2Kpi_B_DIRA_MIN)s)"\
                            "& (BPVVDCHI2 > %(Lc2Kpi_B_FDCHI2_MIN)s)" %config)
    sel = Selection("Sel"+_combName,
                    Algorithm = comb,
                    RequiredSelections = _RequiredSelections)
    if config["Lc2Kpi_REQUIRE_TOS"] == True:
        sel_Hlt1TOS = TOSFilter( "Sel"+_combName+"_Hlt1TOS"
                                 ,sel
                                 ,"Hlt1.*Decision%TOS")
        sel_Hlt2TOS = TOSFilter( "Sel"+_combName+"_Hlt2TOS"
                                 ,sel_Hlt1TOS
                                 ,"Hlt2.*Decision%TOS")
        return sel_Hlt2TOS
    else:
        return sel
コード例 #27
0
    def makeDiJetGamma(self, _name, loose=0):

        DiJetGamma = CombineParticles("Combine" + _name)
        DiJetGamma.DecayDescriptor = "H_20 -> H_10 gamma"
        DiJetGamma.ParticleCombiners = {'': 'LoKi::VertexFitter:PUBLIC'}

        DiJetGamma.MotherCut = "ALL"

        if loose:
            requiredSelections = [self.sel_PhotonLoose, self.sel_DiJetLoose]
        else:
            requiredSelections = [self.sel_Photon, self.sel_DiJet]

        return Selection("Sel" + _name,
                         Algorithm=DiJetGamma,
                         RequiredSelections=requiredSelections)
コード例 #28
0
def makeXic2KLam(name,
                 inputSel,
                 Daug_All_PT_MIN,
                 Daug_1of3_PT_MIN,
                 Daug_P_MIN,
                 Daug_TRCHI2DOF_MAX,
                 Proton_PIDp_MIN,
                 K_IPCHI2_MIN,
                 Comb_MASS_MIN,
                 Comb_MASS_MAX,
                 Comb_ADOCAMAX_MAX,
                 Xic_PT_MIN,
                 Xic_BPVDIRA_MIN,
                 Xic_BPVLTIME_MAX,
                 Xic_BPVLTIME_MIN,
                 decDescriptors=["[Lambda_c+ -> K+ Lambda0]cc"]):


    combCuts = "(AM > %(Comb_MASS_MIN)s)" \
               "& (AM < %(Comb_MASS_MAX)s)" \
               "& (AMAXCHILD(PT) > %(Daug_1of3_PT_MIN)s)" % locals()

    xicCuts = "(PT > %(Xic_PT_MIN)s)" % locals()

    _XicLam = CombineParticles(DecayDescriptors=decDescriptors,
                               CombinationCut=combCuts,
                               MotherCut=xicCuts)

    return Selection(name, Algorithm=_XicLam, RequiredSelections=inputSel)
コード例 #29
0
    def makeEtap(self, name, config):

        _massCut = "(ADAMASS('eta_prime')<%s*MeV)" % config[
            'eta_prime_MassWindow']
        _PTCut = "(PT>%s*MeV)" % config['eta_prime_PT']
        _vtxCut = "(VFASPF(VCHI2/VDOF)<%s)" % config['eta_prime_vtxChi2']
        _docaCut = "(ACUTDOCA(%s,''))" % config['eta_prime_DOCA']
        _track_PT = "(PT>%s*MeV)" % config['Trk_PT']
        _track_Chi2 = "(TRCHI2DOF<%s)" % config['Trk_Chi2']
        _track_GPCut = "(TRGHOSTPROB<%s)" % config['Trk_GP']

        _allCuts = _PTCut + '&' + _vtxCut
        _trackCuts = _track_PT + '&' + _track_Chi2 + '&' + _track_GPCut
        _combCuts = _massCut + '&' + _docaCut

        _etap = CombineParticles("etap",
                                 DecayDescriptors=[
                                     "eta_prime -> gamma pi+ pi-",
                                     "eta_prime -> eta pi+ pi-"
                                 ],
                                 CombinationCut=_combCuts,
                                 MotherCut=_allCuts,
                                 DaughtersCuts={
                                     "pi+": _trackCuts,
                                     "pi-": _trackCuts
                                 },
                                 ParticleCombiners={'': "LoKi::VertexFitter"})

        self.selEtap = Selection(name,
                                 Algorithm=_etap,
                                 RequiredSelections=[self.daughters])
コード例 #30
0
def makeTheta2PKS0(name,
                   inputSel,
                   Daug_All_PT_MIN,
                   Daug_1of3_PT_MIN,
                   Daug_P_MIN,
                   Daug_TRCHI2DOF_MAX,
                   Proton_PIDp_MIN,
                   K_IPCHI2_MIN,
                   Comb_MASS_MIN,
                   Comb_MASS_MAX,
                   Comb_ADOCAMAX_MAX,
                   Xic_PT_MIN,
                   Xic_BPVDIRA_MIN,
                   Xic_BPVLTIME_MAX,
                   Xic_BPVLTIME_MIN,
                   decDescriptors=["[Lambda_c+ -> p+ KS0]cc"]):

    combCuts = "(((AM > %(Comb_MASS_MIN)s)" \
               "& (AM < 1600 * MeV))" \
               "| ((AM > 2242 * MeV)" \
               "& (AM <  %(Comb_MASS_MAX)s)))" \
               "& (AMAXCHILD(PT) > %(Daug_1of3_PT_MIN)s)" % locals()

    thetaCuts = "(PT > %(Xic_PT_MIN)s) & (MIPDV(PRIMARY)< 0.4 * mm)" % locals()

    _ThetaKS0 = CombineParticles(DecayDescriptors=decDescriptors,
                                 CombinationCut=combCuts,
                                 MotherCut=thetaCuts)

    return Selection(name, Algorithm=_ThetaKS0, RequiredSelections=inputSel)
コード例 #31
0
    def makeSigmac2LambdacPi(self, name, inputSel, decDescriptors):
        """Return a Selection instance for a Sigma_c -> Lambda_c+ pi decay.

        The selection is motivated in precisely the same way as a D*+ -> D0 pi+
        selection, i.e. take a Lambda_c+, attach a pion, and make some vertex
        quality requirement.
        Keyword arguments:
        name -- Name to give the Selection instance
        inputSel -- List of inputs passed to Selection.RequiredSelections
        decDescriptors -- List of decay descriptors for CombineParticles
        """
        combCuts = '((AM - AM1) < {0[Sigmac_AMDiff_MAX]})'.format(self.config)

        dstarCuts = '(VFASPF(VCHI2/VDOF) < {0[Sigmac_VCHI2VDOF_MAX]})'.format(
            self.config
        )

        _Sigmac = CombineParticles(
            name='Combine{0}'.format(name),
            DecayDescriptors=decDescriptors,
            CombinationCut=combCuts,
            MotherCut=dstarCuts
        )

        return Selection(name, Algorithm=_Sigmac, RequiredSelections=inputSel)
コード例 #32
0
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
    dtt.TupleToolTISTOS.TriggerList = tlist

    from Configurables import TupleToolMCTruth, MCTupleToolHierarchy
    dtt.addTool(TupleToolMCBackgroundInfo,
                name="TupleToolMCBackgroundInfo")
    dtt.TupleToolMCBackgroundInfo.Verbose = True
    dtt.addTool(MCTupleToolHierarchy,
                name="MCTupleToolHierarchy")
    dtt.MCTupleToolHierarchy.Verbose = True
    dtt.addTool(TupleToolMCTruth,
                name="TupleToolMCTruth")
    dtt.TupleToolMCTruth.Verbose = True

    if turbo:
        assoc_seq = TeslaTruthUtils.associateSequence(tesla_prefix, False)
        ChargedPP2MC(tesla_prefix+"ProtoAssocPP").OutputLevel = 1
        
        assoc_seq.Members.insert(0, PatLHCbID2MCParticle())

        from Configurables import MuonCoord2MCParticleLink
        muon_coords = MuonCoord2MCParticleLink("TeslaMuonCoordLinker")
        assoc_seq.Members.insert(1, muon_coords)
    
        TrackAssociator("TeslaAssocTr").DecideUsingMuons = True
        
        relations = TeslaTruthUtils.getRelLoc(tesla_prefix)

    else:
        relations = "Relations/Rec/ProtoP/Charged"


    TeslaTruthUtils.makeTruth(dtt,
                              relations,
                              ["MCTupleToolKinematic",
                               "MCTupleToolHierarchy",
                               "MCTupleToolPID",
                               ]
                              )
    
    
    dtt.Decay = mark(2, mark(3, decay_descriptor)) #"J/psi(1S) -> ^mu- ^mu+"
    
    dtt.addBranches({"X": "^(%s)"%(decay_descriptor),
                     "muplus": mark(3, decay_descriptor),#"J/psi(1S) -> mu- ^mu+",
                     "muminus": mark(2, decay_descriptor),#"J/psi(1S) -> ^mu- mu+",
                     })
    
    x_preamble = ["DZ = VFASPF(VZ) - BPV(VZ)",
                  ]
    x_vars = {"ETA": "ETA",
              "Y": "Y",
              "PHI": "PHI",
              "VPCHI2": "VFASPF(VPCHI2)",
              "DELTAZ": "DZ",
              # DZ * M / PZ / c with c in units of mm/s
              # XXX should this be the PDG mass or measured mass?
              #"TZ": "DZ*M / PZ / 299792458000.0", #seconds
              "TZ": "DZ*3096.916 / PZ/299792458000.0*(10**12)", #ps
              "minpt": "MINTREE('mu+' == ABSID, PT)",
              "minclonedist": "MINTREE(ISBASIC & HASTRACK, CLONEDIST)",
              "maxtrchi2dof": "MAXTREE(ISBASIC & HASTRACK, TRCHI2DOF)",
              }
    muon_vars = {"ETA": "ETA",
                 "Y": "Y",
                 "PHI": "PHI",
                 "CHARGE": "Q",
                 "CLONEDIST": "CLONEDIST",
                 "TRCHI2DOF": "TRCHI2DOF",
                 }
    
    loki_X = dtt.X.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_X")
    loki_X.Variables = x_vars
    loki_X.Preambulo = x_preamble
    
    loki_mup = dtt.muplus.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_MuPlus")
    loki_mup.Variables = muon_vars
    #dtt.muplus.addTupleTool("TupleToolGeometry")
    
    loki_mum = dtt.muminus.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_MuMinus")
    loki_mum.Variables = muon_vars
    #dtt.muminus.addTupleTool("TupleToolGeometry")
    
    dv.TupleFile = "DVNtuples.root"
    if turbo:
        dv.UserAlgorithms = [assoc_seq, dtt]

    else:
        assocpp = ChargedPP2MC("TimsChargedPP2MC")
        assocpp.OutputLevel = 1
        dv.UserAlgorithms = [jpsi_seq.sequence(), assocpp, dtt]
コード例 #33
0
pion_list= FilterInTrees( 'pion_list', Code = "'pi+'==ABSID")   
pion_Sel = Selection ( "pion_Sel" , Algorithm =pion_list  , RequiredSelections = [ AutomaticData(Location = location)  ] )
pion_Seq = SelectionSequence("pion_Seq", TopSelection = pion_Sel)




from StandardParticles import StdLooseAllPhotons


PhotonFilter = FilterDesktop("PhotonFilter", Code="(PT > 300.*MeV) & (CL > 0.1)")
PhotonSel    = Selection('PhotonSel', Algorithm=PhotonFilter, RequiredSelections=[StdLooseAllPhotons])



my_etap = CombineParticles("my_etap")
my_etap.DecayDescriptor = "eta_prime -> rho(770)0 gamma"
my_etap.MotherCut = "(ADMASS('eta_prime') < 100.*MeV)" # & (PT > 1500.*MeV) & (P > 4000.*MeV) " #& (VFASPF(VCHI2/VDOF) < 9.)" #   "ALL" #  
my_etap_Sel = Selection("my_etap_Sel", 
                            Algorithm = my_etap, 
                          # RequiredSelections = [rho_Sel,StdLooseAllPhotons]) 
                            RequiredSelections = [rho_Sel,PhotonSel])
#my_etap_Seq = SelectionSequence("my_etap_Seq", TopSelection = my_etap_Sel)



preambulo=[
"rho_px= CHILD (PX,1,1 ) " ,
"rho_py=CHILD  (PY,1,1 )" ,
"rho_pz=CHILD (PZ,1,1 ) ",
"rho_E= CHILD (E,1,1 ) " ,
コード例 #34
0
def configure ( inputdata        ,    ## the list of input files  
                catalogs = []    ,    ## xml-catalogs (filled by GRID)
                castor   = False ,    ## use the direct access to castor/EOS ? 
                params   = {}    ) :

    ## configure  Track <--> MC relation table  
    import LoKiPhysMC.Track2MC_Configuration
    import LoKiMC.MC
    
    ## import DaVinci 
    from Configurables import DaVinci, GaudiSequencer
    ## delegate the actual configurtaion to DaVinci 
    dv = DaVinci ( DataType   = '2011' ,
                   InputType  = 'MDST',
                   Lumi = True,
                   Simulation = True,
                   DDDBtag="MC11-20111102",
                   CondDBtag="sim-20111111-vc-md100",
                   HistogramFile = "mcd02kpi_tracks7_histo.root",
                   TupleFile = "mcd02kpi_tracks7_ntuple.root",
                   PrintFreq = 1000)
    

    from Configurables import DecayTreeTuple, FilterDesktop, TupleToolGeometry, CombineParticles
    from Configurables import MCDecayTreeTuple, TupleToolMCTruth, MCTupleToolHierarchy
    from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence, DataOnDemand
    from Configurables import CheckPV
    

    # First using CombineParticle to create the D0
    ################################################################################
    #from StandardParticles import  StdAllNoPIDsPions, StdAllNoPIDsKaons
    _pions = DataOnDemand(Location='Phys/StdAllNoPIDsPions/Particles')
    _kaons = DataOnDemand(Location='Phys/StdAllNoPIDsKaons/Particles')

    _d2kpi = CombineParticles("d2kpi")
    _d2kpi.DecayDescriptor = "[D0 -> K- pi+]cc"
    _d2kpi.DaughtersCuts = { "K-"  : "(PT > 500.0) & (0.0 < PIDK)",
                             "pi+" : "(PT > 500.0) & (5.0 > PIDK)",
                             "K+"  : "(PT > 500.0) & (0.0 < PIDK)",
                             "pi-" : "(PT > 500.0) & (5.0 > PIDK) " }
    _d2kpi.MotherCut = "(VFASPF(VCHI2/VDOF)<10)"
    _d2kpi.CombinationCut = "(ADAMASS('D0') < 50.0)"
    _d2kpi.Preambulo = [ 
        "from LoKiPhysMC.decorators import *" ,
        "from PartProp.Nodes import CC"      ]
    #_d2kpi.ReFitPVs = True

    SelD2KPi = Selection( "SelD2KPi",
                          Algorithm= _d2kpi,
                          RequiredSelections=[_pions,_kaons] ) 
    
    SeqD2KPi = SelectionSequence('SeqD2KPi',TopSelection = SelD2KPi)

    
    # Now the CheckPV method to filter algorithms
    c = CheckPV("OnePV")
    c.MinPVs = 1

    # And a sequencer to put them together
    gseq = GaudiSequencer()
    gseq.Members = [ c, SeqD2KPi.sequence() ]
    
    ## define the input data
    setData  ( inputdata , catalogs , castor )
    
    ## get/create application manager
    gaudi = appMgr() 
    
    #
    ## modify/update the configuration:
    #
    
    ## (1) create the algorithm
    alg = TrackFilter( 'TrackFilter' )
    
    #seq = createSequencer()
    ## (2) replace the list of top level algorithm by
    #     new list, which contains only *THIS* algorithm
    gaudi.setAlgorithms( [ gseq, alg ] )
             
    return SUCCESS
コード例 #35
0
ファイル: dump.py プロジェクト: ibab/lhcb-merge-event
GaudiPersistency()
importOptions("data_local.py")

#Truth matched commonparticles: 
_kaons = DataOnDemand(Location='Phys/StdMCKaons/Particles')
_pions = DataOnDemand(Location='Phys/StdMCPions/Particles')

#
# MC matching
#

matchD2KKPi = "(mcMatch('[D_s+  ==> K- K+ pi+]CC'))"
#matchKaons = "(mcMatch('[K+]cc'))"
#matchPions = "(mcMatch('[pi+]cc'))"

_d2kkpi = CombineParticles("d2kkpi")
_d2kkpi.DecayDescriptor = "D_s- -> K- K+ pi-"
#_d2kkpi.DaughtersCuts = { "pi+" : matchPions, "K+" : matchKaons}
_d2kkpi.MotherCut = matchD2KKPi
_d2kkpi.Preambulo = [
    "from LoKiPhysMC.decorators import *",
    "from PartProp.Nodes import CC" ]

SelD2KKPi = Selection( "SelD2KKPi",
                        Algorithm = _d2kkpi,
                        RequiredSelections=[_kaons,_pions])  

dumpAlg = DumpAddr(OutputFile='eventaddr.txt', ObjectPath='/Event')
SeqD2KKPi = SelectionSequence('MCFilter',TopSelection = SelD2KKPi, PostSelectionAlgs=[dumpAlg])

tuple = DecayTreeTuple("out")
コード例 #36
0
from Configurables import CombineParticles, DecayTreeTuple
from PhysSelPython.Wrappers import Selection, SelectionSequence, DataOnDemand

#Truth matched commonparticles: 
_mainkaons = DataOnDemand(Location='Phys/StdMCKaons/Particles')
_mainpions = DataOnDemand(Location='Phys/StdMCPions/Particles')

#
# MC matching
#

matchD2KKPi = "(mcMatch('D_s+  ==> K- K+ pi+'))"
#matchKaons = "(mcMatch('[K+]cc'))"
#matchPions = "(mcMatch('[pi+]cc'))"

_maind2kkpi = CombineParticles("d2kkpiMain")
_maind2kkpi.DecayDescriptor = "D_s+ -> K+ K- pi+"
#_d2kkpi.DaughtersCuts = { "pi+" : matchPions, "K+" : matchKaons}
_maind2kkpi.MotherCut = matchD2KKPi
_maind2kkpi.Preambulo = [
    "from LoKiPhysMC.decorators import *",
    "from PartProp.Nodes import CC" ]

selD2KKPiMain = Selection( "DsPlusCandidates",
                            Algorithm = _maind2kkpi,
                            RequiredSelections=[_mainkaons, _mainpions])  

seqD2KKPiMain = SelectionSequence('MCFilterMain',TopSelection = selD2KKPiMain)

maintuple = DecayTreeTuple("out")
maintuple.Decay = "[D_s+ -> K- K+ pi+]CC"
コード例 #37
0
from Configurables import CombineParticles, DecayTreeTuple
from PhysSelPython.Wrappers import Selection, SelectionSequence, DataOnDemand

# Selection for other loop
_otherKaons = DataOnDemand(Location='/Event/NewEvent/Phys/OtherAllKaons/Particles')
_otherPions = DataOnDemand(Location='/Event/NewEvent/Phys/OtherAllPions/Particles')
_otherd2kkpi = CombineParticles("otherd2kkpi", InputPrimaryVertices="/Event/NewEvent/Rec/Vertex/Primary")
_otherd2kkpi.DecayDescriptor = "D_s- -> K- K+ pi-"
_otherd2kkpi.MotherCut = "(mcMatch('D_s-  ==> K- K+ pi-', ['/Event/NewEvent/Relations/NewEvent/Rec/ProtoP/Charged'], '/Event/NewEvent/MC/Particles'))"
_otherd2kkpi.Preambulo = [
    "from LoKiPhysMC.decorators import *",
    "from PartProp.Nodes import CC" ]

selD2KKPiOther = Selection("DsMinusCandidates",
                           Algorithm = _otherd2kkpi,
                           RequiredSelections=[_otherKaons, _otherPions],
                           OutputBranch="NewEvent/Phys")

#selD2KKPiOther.OutputLevel = 1

seqD2KKPiOther = SelectionSequence('MCFilterOther', TopSelection = selD2KKPiOther)

othertuple = DecayTreeTuple("Ds2KKPiTuple", RootInTES='/Event/NewEvent')
othertuple.Decay = "[D_s+ -> K- K+ pi+]CC"
#othertuple.Inputs = [seqD2KKPi.outputLocation()]
othertuple.Inputs = ['Phys/SelD2KKPiOther/Particles']
othertuple.ToolList = []
from Configurables import MCMatchObjP2MCRelator

othertuple.addTupleTool('TupleToolKinematic')
コード例 #38
0
    evtPreselectors.append(prescaler)

###############

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

# Muons and kaons
looseMuons = DataOnDemand(Location = 'Phys/StdLooseMuons/Particles')
looseKaons = DataOnDemand(Location = 'Phys/StdLooseKaons/Particles')
loosePions = DataOnDemand(Location = 'Phys/StdLoosePions/Particles')


# Select Phi
recoPhi = CombineParticles("Phi2KK")
recoPhi.DecayDescriptor = 'phi(1020) -> K+ K-'
recoPhi.DaughtersCuts = {"K+": "(ISLONG) & (TRCHI2DOF < 3 ) & (TRGHOSTPROB<0.3) & ( BPVIPCHI2 () >  9 ) & (PT>300*MeV) & (PIDK > 5)",
                         "K-": "(ISLONG) & (TRCHI2DOF < 3 ) & (TRGHOSTPROB<0.3) & ( BPVIPCHI2 () >  9 ) & (PT>300*MeV) & (PIDK > 5)"}
recoPhi.CombinationCut =  "(ADAMASS('phi(1020)')<10*MeV)"
recoPhi.MotherCut = " ( VFASPF(VCHI2) < 10 ) & (MIPCHI2DV(PRIMARY)> 16.)"

# Very loose version for testing
# recoPhi = CombineParticles("Phi2KK")
# recoPhi.DecayDescriptor = 'phi(1020) -> K+ K-'
# recoPhi.DaughtersCuts = {"K+": "(ISLONG) & (TRCHI2DOF < 3 ) & (TRGHOSTPROB<0.3) & ( BPVIPCHI2 () >  9 ) & (PT>300*MeV) & (PIDK > -5)",
#                          "K-": "(ISLONG) & (TRCHI2DOF < 3 ) & (TRGHOSTPROB<0.3) & ( BPVIPCHI2 () >  9 ) & (PT>300*MeV) & (PIDK > -5)"}
# recoPhi.CombinationCut =  "(ADAMASS('phi(1020)')<35*MeV)"
# recoPhi.MotherCut = " ( VFASPF(VCHI2) < 25 ) & (MIPCHI2DV(PRIMARY)> 4.)"

コード例 #39
0
ファイル: Dsphi2KsKs_nobias.py プロジェクト: gdujany/phi2KsKs
            " & (BPVDIRA > %(KS_DD_DIRA_MIN)s)" %config


KsLL = Selection( "Sel_KsLL",
                  Algorithm = FilterDesktop(name = "KsLLFilter", Code = KsLLCuts ),
                  RequiredSelections = [StdLooseKsLL])
                  #RequiredSelections = [DataOnDemand(Location = 'Phys/StdLooseKsLL/Particles')])
KsDD = Selection( "Sel_KsDD",
                  Algorithm = FilterDesktop(name = "KsDDFilter", Code = KsDDCuts ),
                  RequiredSelections = [StdLooseKsDD])
                  #RequiredSelections = [DataOnDemand(Location = 'Phys/StdLooseKsDD/Particles')])

Ks = MergedSelection("Ks", RequiredSelections = [KsLL, KsDD])


Phi = CombineParticles("Phi2KsKs")
Phi.DecayDescriptor = 'phi(1020) -> KS0 KS0'
#Cuts from the stripping line
Phi.CombinationCut =  "( (ACHILDCUT(CHILDCUT(ISLONG,1),1)) | (ACHILDCUT(CHILDCUT(ISLONG,1),2)) ) &  (APT > %(Phi_PT_MIN)s *MeV) & (ADAMASS('phi(1020)')<%(Phi_MASS_RANGE)s +30*MeV) & (ACUTDOCACHI2(%(Phi_DOCACHI2_MAX)s,''))" %config
Phi.MotherCut = "(ADMASS('phi(1020)')<%(Phi_MASS_RANGE)s*MeV) & (VFASPF(VCHI2/VDOF) < %(Phi_VCHI2NDOF_MAX)s)" %config

 
Phi_Sel = Selection(name = "Sel_Phi2KsKs",
                Algorithm = Phi,
                RequiredSelections = [Ks])#[StdLooseKsDD,StdLooseKsLL])



Ds = CombineParticles("Ds2PhiPi")

Ds.DecayDescriptor = '[D_s+ -> phi(1020) pi+]cc'
コード例 #40
0
            " & (BPVDIRA > %(KS_DD_DIRA_MIN)s)" %config


KsLL = Selection( "Sel_KsLL",
                  Algorithm = FilterDesktop(name = "KsLLFilter", Code = KsLLCuts ),
                  RequiredSelections = [StdLooseKsLL])
                  #RequiredSelections = [DataOnDemand(Location = 'Phys/StdLooseKsLL/Particles')])
KsDD = Selection( "Sel_KsDD",
                  Algorithm = FilterDesktop(name = "KsDDFilter", Code = KsDDCuts ),
                  RequiredSelections = [StdLooseKsDD])
                  #RequiredSelections = [DataOnDemand(Location = 'Phys/StdLooseKsDD/Particles')])

Ks = MergedSelection("Ks", RequiredSelections = [KsLL, KsDD])


Phi = CombineParticles("Phi2KsKs")
Phi.DecayDescriptor = 'phi(1020) -> KS0 KS0'
#Cuts from the stripping line
Phi.CombinationCut =  "( (ACHILDCUT(CHILDCUT(ISLONG,1),1)) | (ACHILDCUT(CHILDCUT(ISLONG,1),2)) ) & (APT > %(Phi_PT_MIN)s *MeV) & (AM < %(Phi_MASS_MAX)s + 30*MeV) & (ACUTDOCACHI2(%(Phi_DOCACHI2_MAX)s,''))" %config
Phi.MotherCut = "(M < %(Phi_MASS_MAX)s *MeV) & (VFASPF(VCHI2/VDOF) < %(Phi_VCHI2NDOF_MAX)s) & (MIPCHI2DV(PRIMARY) < %(Phi_IPCHI2_MAX)s)" %config

Phi_Sel = Selection(name = "Sel_Phi2KsKs",
                Algorithm = Phi,
                RequiredSelections = [Ks])#[StdLooseKsDD,StdLooseKsLL])



Ds = CombineParticles("Ds2PhiPi")

Ds.DecayDescriptor = '[D_s+ -> phi(1020) pi+]cc'
Ds.CombinationCut =  " (APT > %(Dp_PT_MIN)s *MeV) & (ADAMASS(1920*MeV) < %(Dp_MASS_WIN)s + 30*MeV) & (ACUTDOCACHI2(%(Dp_DOCACHI2_MAX)s,''))" %config#"( (ACHILDCUT(CHILDCUT(ISLONG,1),1)) | (ACHILDCUT(CHILDCUT(ISLONG,1),2)) ) &"
コード例 #41
0
# Build CombineParticles for Lambda_c decay, then Lambda_b decay
lc_decay_template = "[Lambda_c+ -> p+ {0} {1}]cc"
lc_mother_template = "(mcMatch('[Lambda_c+ ==> p+ {0} {1}]CC'))"
lc_daughters_template = {
    "p+": "mcMatch('[Lambda_c+ ==> ^p+ {0} {1}]CC')",
    "h1": "mcMatch('[Lambda_c+ ==> p+ ^{0} {1}]CC')",
    "h2": "mcMatch('[Lambda_c+ ==> p+ {0} ^{1}]CC')"
}
lc_combine_template = CombineParticles(
    "CombineCheatedLcpTophh",
    Preambulo=[
      "from LoKiPhysMC.decorators import *" ,
      "from LoKiPhysMC.functions import mcMatch"
    ],
    DecayDescriptor=lc_decay_template,
    Inputs=[
      "Phys/StdAllNoPIDsPions",
      "Phys/StdAllNoPIDsKaons",
      "Phys/StdAllNoPIDsProtons"
    ],
    DaughtersCuts=lc_daughters_template,
    CombinationCut="AALL",
    MotherCut=lc_mother_template
)
# Lambda_b templates
lb_decay_template = "[Lambda_b0 -> Lambda_c+ {0}]cc"
lb_mother_template = "(mcMatch('[Lambda_b0 --> Lambda_c+ {0} ...]CC'))"
lb_daughters_template = {
    "mu+": "(mcMatch('[Lambda_b0 --> Lambda_c+ ^{0} ...]CC'))"
}
lb_combine_template = CombineParticles(
    "CombineCheatedLb0ToLcpmu",
コード例 #42
0
ファイル: opts.old.py プロジェクト: MannyMoo/ganga
from os import environ
import GaudiKernel.SystemOfUnits as Units
from Gaudi.Configuration import *
from Configurables import CombineParticles, PhysDesktop
from Configurables import LoKi__Hybrid__PlotTool as PlotTool

importOptions("$DAVINCIROOT/options/DaVinciCommon.opts")

ApplicationMgr().TopAlg += ["GaudiSequencer/TutorialSeq"]

jpsi2mumu = CombineParticles("Jpsi2MuMu")
jpsi2mumu.addTool(PhysDesktop())
jpsi2mumu.PhysDesktop.InputLocations = ["Phys/StdLooseMuons"]
jpsi2mumu.DecayDescriptor = "J/psi(1S) -> mu+ mu-"
jpsi2mumu.DaughtersCuts = {"mu+": "ALL", "mu-": "ALL"}
jpsi2mumu.CombinationCut = "ADAMASS('J/psi(1S)')<30"
jpsi2mumu.MotherCut = "(VFASPF(VCHI2/VDOF)<100)"
GaudiSequencer("TutorialSeq").Members.append(jpsi2mumu)

phi2kk = CombineParticles("Phi2KK")
phi2kk.addTool(PhysDesktop())
phi2kk.PhysDesktop.InputLocations = ["Phys/StdLooseKaons"]
phi2kk.DecayDescriptor = "phi(1020) -> K+ K-"
phi2kk.CombinationCut = "ADAMASS('phi(1020)')<50"
phi2kk.MotherCut = "(VFASPF(VCHI2/VDOF)<100)"
GaudiSequencer("TutorialSeq").Members.append(phi2kk)

bs2jpsiphi = CombineParticles("Bs2JpsiPhi")
bs2jpsiphi.addTool(PhysDesktop())
bs2jpsiphi.PhysDesktop.InputLocations = ["Phys/Jpsi2MuMu", "Phys/Phi2KK"]
bs2jpsiphi.DecayDescriptor = "B_s0 -> phi(1020) J/psi(1S)"
コード例 #43
0
ファイル: DownKs.py プロジェクト: adendek/DownstreamTracking
######################################################################################################
# central settings
#
simulation     = False
year           = "2016"
magnetPolarity = "Down"
######################################################################################################
# if you are setting something wrong, it should die here...
if year not in [ "2016" ]:
    raise RuntimeError(year + " is not a valid year")
if magnetPolarity not in ["Up", "Down"]:
    raise RuntimeError(magnetPolarity + " is not a valid magnet polarity")

######################################################################################################
from Configurables import CombineParticles
KsPiPi= CombineParticles("KsPiPi")
KsPiPi.DecayDescriptor =  "KS0 -> pi+ pi-"
KsPiPi.CombinationCut = "ADAMASS('KS0')<100*MeV"
KsPiPi.MotherCut = "(VFASPF(VCHI2/VDOF)<10)"
KsPiPi.DaughtersCuts = { "pi+" : "ALL",
                         "pi-" : "ALL" }
KsPiPi.MotherCut = "(M > 400) & (M < 600) & (BPVVDCHI2 > 100.) & (VFASPF(VCHI2/VDOF) < 10)"
from PhysSelPython.Wrappers import Selection
from StandardParticles import StdNoPIDsDownPions, StdLoosePions
LooseKsPiPi = Selection("SelLooseKsPiPi", 
                        Algorithm = KsPiPi, 
                        RequiredSelections = [StdNoPIDsDownPions ])
                        #RequiredSelections = [StdLoosePions])

from PhysSelPython.Wrappers import SelectionSequence
SeqKsPiPi = SelectionSequence('SeqKsPiPi', TopSelection = LooseKsPiPi)
コード例 #44
0
ファイル: merge.py プロジェクト: ibab/lhcb-merge-event
mergedKaons = NoPIDsParticleMaker('MergedKaons'
                                 , Particle = "kaon"
                                 , Input = "MergedEvent/Rec/ProtoP/Charged"
                                 , Output = "Phys/MergedKaons/Particles"
                                 , WriteP2PVRelations = False
                                 , InputPrimaryVertices = "Rec/Vertex/Primary"
                                 )

createEvent.Members.append(mergedPions)
createEvent.Members.append(mergedKaons)

_kaons = DataOnDemand(Location='/Event/Phys/MergedPions/Particles')
_pions = DataOnDemand(Location='/Event/Phys/MergedKaons/Particles')

combineA = CombineParticles('CombineA')
combineA.DecayDescriptor = "D_s+ -> K+ K- pi+"
combineA.MotherCut = "(mcMatch('D_s+  ==> K+ K- pi+', ['/Event/MergedEvent/Relations/MergedEvent/Rec/ProtoP/Charged'], '/Event/MergedEvent/MC/Particles'))"
combineA.Preambulo = [
    "from LoKiPhysMC.decorators import *",
    "from PartProp.Nodes import CC" ]

combineB = CombineParticles('CombineB')
combineB.DecayDescriptor = "D_s- -> K- K+ pi-"
combineB.MotherCut = "(mcMatch('D_s-  ==> K- K+ pi-', ['/Event/MergedEvent/Relations/MergedEvent/Rec/ProtoP/Charged'], '/Event/MergedEvent/MC/Particles'))"
combineB.Preambulo = [
    "from LoKiPhysMC.decorators import *",
    "from PartProp.Nodes import CC" ]
#combineB.OutputLevel = 1

combineAB = CombineParticles('CombineAB')