Ejemplo n.º 1
0
def Apply_VerTexFit(path, lepton, kstar):
    if lepton == 'e':
        lep_list = ' ^e+:corrected ^e-:corrected'
    elif lepton == 'mu':
        lep_list = ' ^mu+:all ^mu-:all'
    if kstar == 'kst0':
        kstlist = ' [K*0:all -> ^K+:all ^pi-:all] '
        charge = '0'
    elif kstar == 'kst_ks':
        kstlist = ' [K*+:ks -> ^K_S0:my_ks ^pi+:all] '
        charge = '+'
    elif kstar == 'kst_pi0':
        kstlist = ' [K*+:pi0 -> ^K+:all ^pi0:all] '
        charge = '+'
  #  Jpsi = ' J/psi' + ':' +lepton+lepton
    Bmeson = 'B'+charge+':'+kstar+lepton+lepton
    chain = Bmeson+' -> ' + kstlist + lep_list
    print(purple, 'vfit:  ', cyan, chain, end)
    # perform vertex fit of J/psi candidates
   # vertex.KFit(Jpsi, conf_level=0.0, path=path)
    vertex.KFit(list_name=Bmeson,fit_type='vertex',decay_string=chain, conf_level=0.00, path=path)
Ejemplo n.º 2
0
def makeFSPs(input_file,  isdata):
    path = b2.create_path()
    inputMdstList(environmentType='default', filelist=input_file, path=path)
    printDataStore(path=path)
    # path.add_module('EventInfoPrinter')
    variables.addAlias('pi_k', 'pidPairProbabilityExpert(211, 321, ALL)')
    variables.addAlias('k_pi', 'pidPairProbabilityExpert(321, 211, ALL)')
    # electron
    impactcut = 'abs(d0)<0.5 and abs(z0)<2.0 '
    # NOTE For BtoXll skim
    # event level cuts: R2 and require a minimum number of tracks
    fillParticleList(decayString='pi+:eventShapeForSkims', cut='pt > 0.1', path=path)
    fillParticleList(decayString='gamma:eventShapeForSkims', cut='E > 0.1', path=path)
    buildEventShape(inputListNames=['pi+:eventShapeForSkims', 'gamma:eventShapeForSkims'],
                    allMoments=False,
                    foxWolfram=True,
                    harmonicMoments=False,
                    cleoCones=False,
                    thrust=False,
                    collisionAxis=False,
                    jets=False,
                    sphericity=False,
                    checkForDuplicates=False,
                    path=path)

    fillParticleList(decayString='e+:all',
                     cut=impactcut + ' and electronID > 0.5', path=path)
    # muon
    fillParticleList(decayString='mu+:all',
                     cut=impactcut + ' and muonID > 0.5', path=path)
    # pion
    fillParticleList(decayString='pi+:all',
                     cut=impactcut + ' and pi_k>0.1', path=path)
    # kaon
    fillParticleList(decayString='K+:all',
                     cut=impactcut + ' and k_pi>0.1', path=path)
    # gamma
    fillParticleList(decayString='gamma:all', cut='', path=path)
    if isdata:
        print(yellow, 'Momentum correction for FSPs', end)
        trackingMomentum(inputListNames=['mu+:all', 'e+:all', 'K+:all', 'pi+:all'], scale=1.00056, path=path)
    # Bremrecovery
    correctBremsBelle('e-:corrected', 'e-:all', 'gamma:all', True, 0.05, 0.05,
                      False, path=path)
    # Ks0
    stdKshorts( path=path)
    cutAndCopyList('K_S0:my_ks', 'K_S0:merged', 'goodBelleKshort==1', writeOut=False, path=path)
    matchMCTruth(list_name='K_S0:my_ks', path=path)
    # pi0
    stdPhotons('all', path=path)
    cutAndCopyList(
        'gamma:eff30_Jan2020',
        'gamma:all',
        '[clusterReg==1 and E>0.080] or [clusterReg==2 and E>0.030] or [clusterReg==3 and E>0.060]',
        path=path)
    reconstructDecay('pi0:all -> gamma:eff30_Jan2020 gamma:eff30_Jan2020',
                     '0.1215 < M < 0.1415 and E > 0.4 and abs(cosHelicityAngleMomentum)<0.8', path=path)
    #vertex.KFit('pi0:all', conf_level=0.0, path=path)
    vertex.KFit('pi0:all', conf_level=0.0,fit_type='mass', path=path)
    # K*0->K+ pi-
    reconstructDecay(decayString='K*0:all -> K+:all pi-:all',
                     cut='0.6 < M < 1.2', path=path)
    matchMCTruth(list_name='K*0:all', path=path)
    # K*+ -> K_s pi+
    reconstructDecay(decayString='K*+:ks -> K_S0:my_ks pi+:all',
                     cut='0.6 < M < 1.2', path=path)
    matchMCTruth(list_name='K*+:ks', path=path)
    # K*+ -> K+ pi0
    reconstructDecay(decayString='K*+:pi0 -> K+:all pi0:all',
                     cut='0.6 < M < 1.2', path=path)
    matchMCTruth(list_name='K*+:pi0', path=path)
    return path
Ejemplo n.º 3
0
                   "passesCut(clusterReg == 2 and clusterE > 0.05)")
variables.addAlias("goodBWDGamma",
                   "passesCut(clusterReg == 3 and clusterE > 0.1)")
variables.addAlias('goodGamma',
                   'passesCut(goodFWDGamma or goodBRLGamma or goodBWDGamma)')
ma.fillParticleList('gamma:brems', 'goodGamma', path=main)
ma.correctBrems('e+:corrected', 'e+:uncorrected', 'gamma:brems', path=main)
variables.addAlias('isBremsCorrected', 'extraInfo(bremsCorrected)')

# combine final state particles to form composite particles
ma.reconstructDecay('J/psi:ee -> e+:corrected e-:corrected ?addbrems',
                    cut='dM < 0.11',
                    path=main)

# perform vertex fit of J/psi candidates
vertex.KFit('J/psi:ee', conf_level=0.0, path=main)

# combine J/psi and KS candidates to form B0 candidates
ma.reconstructDecay('B0 -> J/psi:ee K_S0:merged',
                    cut='Mbc > 5.2 and abs(deltaE) < 0.3',
                    path=main)

# match reconstructed with MC particles
ma.matchMCTruth('B0', path=main)

# build the rest of the event
ma.buildRestOfEvent('B0', fillWithMostLikely=True, path=main)

# call flavor tagging
ft.flavorTagger('B0', path=main)