Пример #1
0
def makeDstar2D0pi(moduleName, d0Sel, config):
    __configuration_keys__ = ('CombDeltaMLower', 'CombDeltaMUpper',
                              'DeltaMLower', 'DeltaMUpper', 'DOCA',
                              'SlowPiTrackChi2DOF', 'VtxChi2DOF')
    checkConfig(__configuration_keys__, config)

    _prefitCuts = "(AM-AMAXCHILD(M,'D0'==ABSID)-145.4*MeV>%(CombDeltaMLower)s) & " \
                  "(AM-AMAXCHILD(M,'D0'==ABSID)-145.4*MeV<%(CombDeltaMUpper)s) & " \
                  "(ADOCAMAX('')<%(DOCA)s)" %config

    _motherCuts = "(M-MAXTREE('D0'==ABSID,M)-145.4*MeV>%(DeltaMLower)s) & " \
                  "(M-MAXTREE('D0'==ABSID,M)-145.4*MeV<%(DeltaMUpper)s) & " \
                  "(DOCAMAX<%(DOCA)s) & " \
                  "(VFASPF(VCHI2/VDOF)<%(VtxChi2DOF)s)" %config

    _slowPiCuts = "(TRCHI2DOF<%(SlowPiTrackChi2DOF)s)" % config

    _dstar = CombineParticles(DecayDescriptor="[D*(2010)+ -> D0 pi+]cc",
                              CombinationCut=_prefitCuts,
                              MotherCut=_motherCuts,
                              DaughtersCuts={
                                  "D0": "ALL",
                                  "pi+": _slowPiCuts
                              })

    return Selection('Dstar2D0pi_D02K3PiFor' + moduleName,
                     Algorithm=_dstar,
                     RequiredSelections=[StdAllLoosePions, d0Sel])
Пример #2
0
def makeD02K3Pi(moduleName, config):
    __configuration_keys__ = ('CombMassWin', 'MassWin', 'MaxDOCA',
                              'DauPtAllTracks', 'DauPtThreeTracks',
                              'DauPtTwoTracks', 'DauPtOneTrack', 'DauP',
                              'DauIPchi2AllTracks', 'DauIPchi2ThreeTracks',
                              'DauIPchi2TwoTracks', 'DauIPchi2OneTrack',
                              'FDchi2', 'DIRA', 'VtxChi2DOF',
                              'DauTrackChi2DOF', 'ApplyKaonPIDK', 'KaonPIDK',
                              'ApplyPionPIDK', 'PionPIDK')
    checkConfig(__configuration_keys__, config)

    _prefitCuts = "(ADAMASS('D0')<%(CombMassWin)s) & " \
                  "(ADOCAMAX('LoKi::TrgDistanceCalculator')<%(MaxDOCA)s) & " \
                  "(ANUM(BPVIPCHI2()>%(DauIPchi2AllTracks)s)==4) & " \
                  "(ANUM(BPVIPCHI2()>%(DauIPchi2ThreeTracks)s)>=3) & " \
                  "(ANUM(BPVIPCHI2()>%(DauIPchi2TwoTracks)s)>=2) & " \
                  "(ANUM(BPVIPCHI2()>%(DauIPchi2OneTrack)s)>=1) & " \
                  "(ANUM(P>%(DauP)s)==4) & " \
                  "(ANUM(PT>%(DauPtAllTracks)s)==4) & " \
                  "(ANUM(PT>%(DauPtThreeTracks)s)>=3) & " \
                  "(ANUM(PT>%(DauPtTwoTracks)s)>=2) & " \
                  "(ANUM(PT>%(DauPtOneTrack)s)>=1)" %config

    _motherCuts = "(ADMASS('D0')<%(MassWin)s) & " \
                  "(DOCAMAX<%(MaxDOCA)s) & " \
                  "(BPVVDCHI2>%(FDchi2)s) & " \
                  "(VFASPF(VCHI2/VDOF)<%(VtxChi2DOF)s)" %config

    _kaonCuts = "(TRCHI2DOF<%(DauTrackChi2DOF)s) & " \
                "(PT>%(DauPtAllTracks)s) & " \
                "(P>%(DauP)s) & " \
                "(BPVIPCHI2()>%(DauIPchi2AllTracks)s)" %config

    _pionCuts = "(TRCHI2DOF<%(DauTrackChi2DOF)s) & " \
                "(PT>%(DauPtAllTracks)s) & " \
                "(P>%(DauP)s) & " \
                "(BPVIPCHI2()>%(DauIPchi2AllTracks)s)" %config

    if config['ApplyKaonPIDK']:
        _kaonCutsOLD = copy(_kaonCuts)
        _kaonCuts = "(PIDK>%(KaonPIDK)s) & (HASRICH) & " % config
        _kaonCuts += _kaonCutsOLD

    if config['ApplyPionPIDK']:
        _pionCutsOLD = copy(_pionCuts)
        _pionCuts = "(PIDK<%(PionPIDK)s) & (HASRICH) & " % config
        _pionCuts += _pionCutsOLD

    _d0 = CombineParticles(DecayDescriptor="[D0 -> K- pi+ pi- pi+]cc",
                           CombinationCut=_prefitCuts,
                           MotherCut=_motherCuts,
                           DaughtersCuts={
                               "K+": _kaonCuts,
                               "pi+": _pionCuts
                           })
    return Selection('D02K3PiFor' + moduleName,
                     Algorithm=_d0,
                     RequiredSelections=[StdNoPIDsPions, StdNoPIDsKaons])
Пример #3
0
def filterPi0(pi0Conf):

    __configuration_keys__ = ("pi0PT_min", "pi0P_min")
    checkConfig(__configuration_keys__, pi0Conf)

    particleFilter = FilterDesktop(
        Code="(PT > %(pi0PT_min)s) & (P > %(pi0P_min)s)" % locals()["pi0Conf"])
    return Selection("filteredPi0s",
                     Algorithm=particleFilter,
                     RequiredSelections=[StdLooseMergedPi0])
Пример #4
0
def filterK(KConf):

    __configuration_keys__ = ("K+PT_min", "K+P_min", "K+IPChi2_min",
                              "K+PID_min")
    checkConfig(__configuration_keys__, KConf)

    cutString = "(PT > %(K+PT_min)s) & (P > %(K+P_min)s)"\
                " & (MIPCHI2DV(PRIMARY) > %(K+IPChi2_min)s)"\
                " & (PIDK > %(K+PID_min)s)" % locals()["KConf"]
    particleFilter = FilterDesktop(Code=cutString)
    return Selection("filteredK",
                     Algorithm=particleFilter,
                     RequiredSelections=[StdNoPIDsKaons])
Пример #5
0
def filterKS0(KS0Conf):

    __configuration_keys__ = ("KSPT_min", "KSP_min", "KSMass_delta",
                              "KSVChi2DOF_max", "KSIPChi2_min")
    checkConfig(__configuration_keys__, KS0Conf)

    cutString = "(PT > %(KSPT_min)s) & (P > %(KSP_min)s)"\
                " & (ADMASS('KS0') < %(KSMass_delta)s)"\
                " & (VFASPF(VCHI2PDOF) < %(KSVChi2DOF_max)s)"\
                " & (MIPCHI2DV(PRIMARY) > %(KSIPChi2_min)s)" % locals()["KS0Conf"]
    particleFilter = FilterDesktop(Code=cutString)
    return Selection("filteredKS0",
                     Algorithm=particleFilter,
                     RequiredSelections=[StdLooseKsLL])
Пример #6
0
def makeD2hhh(moduleName, config):

    __configuration_keys__ = ("DauChi2Max", "DauPtMin", "DauPMin",
                              "DauMIPChi2Min", "PtMin", "CombDMass", "DMass",
                              "VtxChi2Max", "VDChi2Min", "MaxDauMIPChi2",
                              "DIRAMin", "DOCAMax", "IPChi2Min")

    checkConfig(__configuration_keys__, config)

    StdPi = StdNoPIDsPions
    StdK = StdNoPIDsKaons

    Daughtercut = "((TRCHI2DOF<%(DauChi2Max)s) & " \
    "(PT > %(DauPtMin)s*MeV) & (P > %(DauPMin)s*MeV) & " \
    "(MIPCHI2DV(PRIMARY) > %(DauMIPChi2Min)s))" % config

    D2Kpipi = CombineParticles()
    D2Kpipi.DecayDescriptors = ["[D+ -> K- pi+ pi+]cc"]
    D2Kpipi.DaughtersCuts = {"pi+": Daughtercut, "K+": Daughtercut}

    D2Kpipi.CombinationCut = \
    "((ADAMASS('D+') < %(CombDMass)s*MeV) | (ADAMASS('D_s+') < %(CombDMass)s*MeV)) & " \
    "(APT>%(PtMin)s*MeV) & " \
    "(AMAXDOCA('LoKi::TrgDistanceCalculator') < %(DOCAMax)s) & " \
    "AHASCHILD(((ABSID == 'K+') | (ABSID == 'pi+')) & (MIPCHI2DV(PRIMARY) > %(MaxDauMIPChi2)s))" \
    % config

    D2Kpipi.MotherCut = "((ADMASS('D+') < %(DMass)s*MeV) | (ADMASS('D_s+') < %(DMass)s*MeV))" \
    "& (VFASPF(VCHI2/VDOF)<%(VtxChi2Max)s) & (BPVVDCHI2 > %(VDChi2Min)s) & (BPVDIRA > %(DIRAMin)s) & (BPVIPCHI2() > %(IPChi2Min)s)" % config

    D2KpipiSel = Selection("D2KpipiFor" + moduleName,
                           Algorithm=D2Kpipi,
                           RequiredSelections=[StdPi, StdK])

    D2KKpi = copy(D2Kpipi)
    D2KKpi.DecayDescriptors = ["[D+ -> K- K+ pi+]cc"]
    D2KKpiSel = Selection("D2KKpiFor" + moduleName,
                          Algorithm=D2KKpi,
                          RequiredSelections=[StdPi, StdK])

    DSel = MergedSelection("D2hhhFor" + moduleName,
                           RequiredSelections=[D2KpipiSel, D2KKpiSel])

    return DSel
Пример #7
0
def makeB2Kpi0Line(name, conf, lineConf, decayDescriptor, daughtersCuts,
                   daughterIsoDicts, inputs):

    __configuration_keys__ = ("prescale", "Hlt1Filter", "Hlt2Filter",
                              "BMass_min", "BMass_max", "ASumPT_min",
                              "BPT_min", "MTDOCAChi2_max")
    checkConfig(__configuration_keys__, lineConf)

    _combCuts = "(in_range(%(BMass_min)s, AM, %(BMass_max)s))"\
                " & (ASUM(PT)> %(ASumPT_min)s)" % locals()["lineConf"]
    _motherCuts = "(PT>%(BPT_min)s)"\
                  " & (MTDOCACHI2(1)<%(MTDOCAChi2_max)s)" % locals()["lineConf"]
    combiner = CombineParticles(DecayDescriptor=decayDescriptor,
                                MotherCut=_motherCuts,
                                CombinationCut=_combCuts,
                                DaughtersCuts=daughtersCuts,
                                ParticleCombiners={"": "ParticleAdder"})

    selector = Selection(name + "Selection",
                         Algorithm=combiner,
                         RequiredSelections=inputs)

    return StrippingLine(name + "Line",
                         prescale=lineConf["prescale"],
                         L0DU=conf["L0Filter"],
                         HLT1=lineConf["Hlt1Filter"],
                         HLT2=lineConf["Hlt2Filter"],
                         FILTER=conf["pi0VoidFilter"],
                         checkPV=conf["checkPV"],
                         RequiredRawEvents=["Calo"],
                         selection=selector,
                         RelatedInfoTools=[
                             relInfoCVDict(1.7, daughterIsoDicts),
                             relInfoCVDict(1.35, daughterIsoDicts),
                             relInfoCVDict(1.0, daughterIsoDicts),
                             relInfoVtxDict(daughterIsoDicts),
                             relInfoNeutralCVDict(1.7, daughterIsoDicts),
                             relInfoNeutralCVDict(1.35, daughterIsoDicts),
                             relInfoNeutralCVDict(1.0, daughterIsoDicts),
                         ])
Пример #8
0
def makeBu2rho0rhoPlus(name,
                       config,
                       tracks,
                       pi0s,
                       merged=True,
                       upstream=False,
                       refit=True):
    __configuration_keys__ = (
        "rhoCombMassMax",
        "rhoCombMassMin",
        "rhoMothMassMax",
        "rhoMothMassMin",
        "rho0MinVChi2Dof",
        "pi0ResMinCL",
        "pi0ResMinP",
        "pi0ResMinPT",
        "piPRhoPResMinIPChi2",
        "rho0ResMinIPChi2",
        "rho0ResMinFDChi2",
        "rhoPResMinP",
        "rhoPResMinPT",
        "BuResCombMassWindow",
        "BuResMaxTrIPChi2Min",
        "BuResMaxTrPTMin",
        "BuResSumTrPTMin",
        "BuResMinVChi2Dof",
        "BuResMothMassWindow",
        "BuResMinFDChi2",
        "BuResMaxIPChi2",
        "BuResMinDira",
        "BuResMinPT",
        "pi0MgdMinPT",
        "piPRhoPMgdMinPT",
        "rho0MgdDauMinPT",
        "rho0MgdMinIPChi2",
        "rho0MgdMinFDChi2",
        "rho0MgdMaxTrIPChi2Min",
        "BuMgdCombMassMin",
        "BuMgdCombMassMax",
        "BuMgdMaxTrIPChi2Min",
        "BuMgdMinFDChi2",
        "BuMgdMaxIPChi2",
        "BuMgdMinVChi2Dof",
        "BuMgdMothMassMin",
        "BuMgdMothMassMax",
        "BuMgdMinDira",
        "BuMgdMinPT",
    )

    checkConfig(__configuration_keys__, config)

    ### -------------------------------------------------------------------------
    rho0 = makeRho0("rho0For" + name, config, tracks, merged=merged)
    rhoP = makeRhoP("rhoPFor" + name, config, tracks, pi0s, merged=merged)
    ### -------------------------------------------------------------------------
    combCuts = "(ADAMASS('B0') < %(BuResCombMassWindow)s)"\
               " & (APT > %(BuResMinPT)s)" % locals()["config"]

    motherCuts = "(SUMTREE('pi+'==ABSID,PT) > %(BuResSumTrPTMin)s)"\
                 " & (ADMASS('B+') < %(BuResMothMassWindow)s)"\
                 " & (MAXTREE('pi+'==ABSID,MIPCHI2DV(PRIMARY))"\
                 " > %(BuResMaxTrIPChi2Min)s)"\
                 " & (MAXTREE('pi+'==ABSID,PT) > %(BuResMaxTrPTMin)s)"\
                 " & (BPVVDCHI2 > %(BuResMinFDChi2)s)"\
                 " & (MIPCHI2DV(PRIMARY) < %(BuResMaxIPChi2)s)"\
                 " & (BPVDIRA > %(BuResMinDira)s)"\
                 " & (VFASPF(VCHI2/VDOF) < %(BuResMinVChi2Dof)s)"\
                 % locals()["config"]
    ### -------------------------------------------------------------------------
    if merged:
        combCuts = "(AM > %(BuMgdCombMassMin)s) & (AM < %(BuMgdCombMassMax)s)"\
                   " & (APT > %(BuMgdMinPT)s)"\
                   % locals()["config"]
        motherCuts = "(MAXTREE('pi+'==ABSID,MIPCHI2DV(PRIMARY))"\
                     " > %(BuMgdMaxTrIPChi2Min)s)"\
                     " & (M > %(BuMgdMothMassMin)s) & (M < %(BuMgdMothMassMax)s)"\
                     " & (BPVVDCHI2 > %(BuMgdMinFDChi2)s)"\
                     " & (MIPCHI2DV(PRIMARY) < %(BuMgdMaxIPChi2)s)"\
                     " & (BPVDIRA > %(BuMgdMinDira)s)"\
                     " & (VFASPF(VCHI2/VDOF) < %(BuMgdMinVChi2Dof)s)"\
                     % locals()["config"]
    ### -------------------------------------------------------------------------
    if upstream:
        motherCuts = "(INTREE( HASTRACK & ISUP )) & " + motherCuts
    ### -------------------------------------------------------------------------
    Bu = CombineParticles(DecayDescriptor="[B+ -> rho(770)0 rho(770)+]cc",
                          CombinationCut=combCuts,
                          MotherCut=motherCuts,
                          ReFitPVs=refit,
                          ParticleCombiners={"": "OfflineVertexFitter"})
    ### -------------------------------------------------------------------------
    daughters = [rho0, rhoP]
    return (Selection(name + "Sel", Algorithm=Bu,
                      RequiredSelections=daughters), daughters)