Exemple #1
0
def calculateEventShapes(method, printOn=False, N=100):
    if method == 'uniformSphere':
        particles = particleGeneratorUniformSphere(N=N)
    elif method == 'uniformHemisphere':
        particles = particleGeneratorUniformHemisphere(N=N)
    elif method == 'uniformCylinder':
        particles = particleGeneratorUniformCylinder(N=N)
    elif method == 'oneBody':
        particles = particleGeneratorOneBody()
    elif method == 'twoBodyOpp':
        particles = particleGeneratorTwoBodyOpposite()
    elif method == 'twoBodyPerp':
        particles = particleGeneratorTwoBodyPerp()
    elif method == 'threeBody':
        particles = particleGeneratorThreeBody()
    elif method == 'sixBody':
        particles = particleGeneratorSixBody()
    else:
        print("Error: method '%s' not recognised" % method)
        return
    s = eventShapesUtilities.sphericityTensor(particles)
    sphericity = eventShapesUtilities.sphericity(s)
    aplanarity = eventShapesUtilities.aplanarity(s)
    C = eventShapesUtilities.C(s)
    D = eventShapesUtilities.D(s)
    circularity = eventShapesUtilities.circularity(particles)
    isotropy = eventShapesUtilities.isotropy(particles)
    if (printOn):
        print('The sphericity tensor is:')
        print(s)
        print('sphericity = %f\naplanarity = %f\nC = %f\nD = %f'
              '\ncircularity = %f\nisotropy = %f\n' %
              (sphericity, aplanarity, C, D, circularity, isotropy))
    return np.array([sphericity, aplanarity, C, D, circularity, isotropy])
Exemple #2
0
        isrJet = suepsUtilities.isrTagger(jetsAK15)
        # Boost everything to scalar's rest frame
        tracks_boosted = tracks.boost(-isrJet.p3 / isrJet.energy)
    else:
        tracks_boosted = tracks

    tracks_boosted_minus1 = suepsUtilities.removeMaxE(tracks_boosted, N=5)
    tracks_boosted_minus2 = suepsUtilities.removeMaxE(tracks_boosted, N=10)
    tracks_boosted_minus3 = suepsUtilities.removeMaxE(tracks_boosted, N=20)
    tracks_boosted_minus4 = suepsUtilities.removeMaxE(tracks_boosted, N=40)
    tracks_boosted_minus5 = suepsUtilities.removeMaxE(tracks_boosted, N=80)

    if not (tracks_boosted.size == 0):
        s = eventShapesUtilities.sphericityTensor(tracks_boosted)
        if np.isfinite(s).all():
            evtShape[ievt] = eventShapesUtilities.sphericity(s)

    if not (tracks_boosted_minus1.size == 0):
        s1 = eventShapesUtilities.sphericityTensor(tracks_boosted_minus1)
        if np.isfinite(s1).all():
            evtShape1[ievt] = eventShapesUtilities.sphericity(s1)

    if not (tracks_boosted_minus2.size == 0):
        s2 = eventShapesUtilities.sphericityTensor(tracks_boosted_minus2)
        if np.isfinite(s2).all():
            evtShape2[ievt] = eventShapesUtilities.sphericity(s2)

    if not (tracks_boosted_minus3.size == 0):
        s3 = eventShapesUtilities.sphericityTensor(tracks_boosted_minus3)
        if np.isfinite(s3).all():
            evtShape3[ievt] = eventShapesUtilities.sphericity(s3)
Exemple #3
0
    # The last copy of the scalar mediator
    scalarParticle = genParticles[(genParticles_PdgId == 25) & (genParticles_Status == 62)]

    # Define mask arrays to select the desired particles
    finalParticles = (genParticles_Status == 1) & (genParticles.pt > 1) & (abs(genParticles.eta) < 3)
    genParticles = genParticles[finalParticles]

    # Boost everything to scalar's rest frame
    genParticles_boosted1 = genParticles.boost(-scalarParticle.p3/scalarParticle.energy)
    genParticles_boosted2 = genParticles.boost(-isrJet.p3/isrJet.energy)

    s0 = eventShapesUtilities.sphericityTensor(genParticles)
    s1 = eventShapesUtilities.sphericityTensor(genParticles_boosted1)
    s2 = eventShapesUtilities.sphericityTensor(genParticles_boosted2)

    sph0[ievt] = eventShapesUtilities.sphericity(s0)
    sph1[ievt] = eventShapesUtilities.sphericity(s1)
    sph2[ievt] = eventShapesUtilities.sphericity(s2)

    apl0[ievt] = eventShapesUtilities.aplanarity(s0)
    apl1[ievt] = eventShapesUtilities.aplanarity(s1)
    apl2[ievt] = eventShapesUtilities.aplanarity(s2)

# Plot results
fig = plt.figure(figsize=(8,8))
ax = plt.gca()

#ax.hist(sph0, 25, histtype='step', label='not boosted', color='b')
#ax.hist(sph1, 25, histtype='step', label='boosted using scalar', color='r')
#ax.hist(sph2, 25, histtype='step', label='boosted using ISR jet', color='g')
#ax.set_xlabel('sphericity', fontsize=18)
Exemple #4
0
    genParticles = genParticles[finalParticles]

    # Boost everything to scalar's rest frame
    genParticles_boosted1 = genParticles.boost(-scalarParticle.p3 /
                                               scalarParticle.energy)
    genParticles_boosted2 = genParticles.boost(-isrJet.p3 / isrJet.energy)
    tracks_boosted = tracks.boost(-isrJet.p3 / isrJet.energy)

    s0 = eventShapesUtilities.sphericityTensor(genParticles)
    s1 = eventShapesUtilities.sphericityTensor(genParticles_boosted1)
    s2 = eventShapesUtilities.sphericityTensor(genParticles_boosted2)
    s3 = eventShapesUtilities.sphericityTensor(tracks)
    s4 = eventShapesUtilities.sphericityTensor(tracks_boosted)

    if variable == "sphericity":
        evtShape0[ievt] = eventShapesUtilities.sphericity(s0)
        evtShape1[ievt] = eventShapesUtilities.sphericity(s1)
        evtShape2[ievt] = eventShapesUtilities.sphericity(s2)
        evtShape3[ievt] = eventShapesUtilities.sphericity(s3)
        evtShape4[ievt] = eventShapesUtilities.sphericity(s4)
    elif variable == "aplanarity":
        evtShape0[ievt] = eventShapesUtilities.aplanarity(s0)
        evtShape1[ievt] = eventShapesUtilities.aplanarity(s1)
        evtShape2[ievt] = eventShapesUtilities.aplanarity(s2)
        evtShape3[ievt] = eventShapesUtilities.aplanarity(s3)
        evtShape4[ievt] = eventShapesUtilities.aplanarity(s4)
    elif variable == "C":
        evtShape0[ievt] = eventShapesUtilities.C(s0)
        evtShape1[ievt] = eventShapesUtilities.C(s1)
        evtShape2[ievt] = eventShapesUtilities.C(s2)
        evtShape3[ievt] = eventShapesUtilities.C(s3)
    dphi_boosted = tracks_bst.phi-isrJet_bst[0].phi
    dphi_boosted[dphi_boosted > math.pi] -= 2*math.pi
    dphi_boosted[dphi_boosted < -math.pi] += 2*math.pi


    tracks_0p1 = tracks_bst[abs(dphi_boosted)>0.1]
    tracks_0p3 = tracks_bst[abs(dphi_boosted)>0.3]
    tracks_0p5 = tracks_bst[abs(dphi_boosted)>0.5]
    tracks_0p7 = tracks_bst[abs(dphi_boosted)>0.7]

    sphTensor_0p1 = eventShapesUtilities.sphericityTensor(tracks_0p1)
    sphTensor_0p3 = eventShapesUtilities.sphericityTensor(tracks_0p3)
    sphTensor_0p5 = eventShapesUtilities.sphericityTensor(tracks_0p5)
    sphTensor_0p7 = eventShapesUtilities.sphericityTensor(tracks_0p7)

    sph_0p1[ievt] = eventShapesUtilities.sphericity(sphTensor_0p1)
    sph_0p3[ievt] = eventShapesUtilities.sphericity(sphTensor_0p3)
    sph_0p5[ievt] = eventShapesUtilities.sphericity(sphTensor_0p5)
    sph_0p7[ievt] = eventShapesUtilities.sphericity(sphTensor_0p7)

# Plot results
fig = plt.figure(figsize=(8,8))
ax = plt.gca()

#ax.plot(h_suep, 'r', label='from scalar')
#ax.plot(h_isr, 'b', label='ISR')
#ax.set_xlabel('N hardest jet')

for i in range(20):
    eff_suep[i] = 1-(np.sum(h_suep[:i]))/np.sum(h_suep)
    eff_isr[i] = np.sum(h_isr[:i])/np.sum(h_isr)
Exemple #6
0
    beta_ak4_isr_v[ievt, 2] = beta_ak4_isr[0].z
    tracks_bst = tracks.boost(-beta)
    isrJet_bst = isrJet.boost(-beta)

    # Calculate various subcases
    tracks_bst_highMult = tracks_highMult.boost(-beta)
    tracks_bst_leadPt = tracks_leadPt.boost(-beta)
    tracks_bst_leadPt_ak4_suep = tracks_leadPt.boost(-beta_ak4_suep)
    tracks_bst_leadPt_ak4_isr = tracks_leadPt.boost(-beta_ak4_isr)
    tracks_bst_noLowMult = tracks_noLowMult.boost(-beta)
    total_E = np.sum(tracks_bst.E)
    iBin = 0
    for i in np.linspace(0.001, 0.002, 6):
        tracks_relE = tracks_bst[tracks_bst.E / total_E < i]
        sphTensor_relE = eventShapesUtilities.sphericityTensor(tracks_relE)
        sph_relE[ievt, iBin] = eventShapesUtilities.sphericity(sphTensor_relE)
        iBin += 1

    # Find delta phi
    dPhi = tracks_bst.phi - isrJet_bst[0].phi
    dPhi[dPhi > math.pi] -= 2 * math.pi
    dPhi[dPhi < -math.pi] += 2 * math.pi
    iBin = 0
    for i in np.linspace(1.5, 2.0, 6):
        tracks_bst_dPhi = tracks_bst[abs(dPhi) > i]
        sphTensor_dPhi = eventShapesUtilities.sphericityTensor(tracks_bst_dPhi)
        sph_dPhi[ievt, iBin] = eventShapesUtilities.sphericity(sphTensor_dPhi)
        iBin += 1

    sphTensor_allTracks = eventShapesUtilities.sphericityTensor(tracks_bst)
    sphTensor_highMult = eventShapesUtilities.sphericityTensor(
Exemple #7
0
    genParticles_ab_0p3 = genParticles_bst[abs(dphi_boosted)>0.3]
    genParticles_ab_0p5 = genParticles_bst[abs(dphi_boosted)>0.5]
    genParticles_ab_0p7 = genParticles_bst[abs(dphi_boosted)>0.7]

    sphTensor_noCut = eventShapesUtilities.sphericityTensor(genParticles_bst)
    sphTensor_bb_0p1 = eventShapesUtilities.sphericityTensor(genParticles_bb_0p1.boost(-suepJet.p3/suepJet.energy))
    sphTensor_bb_0p3 = eventShapesUtilities.sphericityTensor(genParticles_bb_0p3.boost(-suepJet.p3/suepJet.energy))
    sphTensor_bb_0p5 = eventShapesUtilities.sphericityTensor(genParticles_bb_0p5.boost(-suepJet.p3/suepJet.energy))
    sphTensor_bb_0p7 = eventShapesUtilities.sphericityTensor(genParticles_bb_0p7.boost(-suepJet.p3/suepJet.energy))
    sphTensor_ab_0p1 = eventShapesUtilities.sphericityTensor(genParticles_ab_0p1)
    sphTensor_ab_0p3 = eventShapesUtilities.sphericityTensor(genParticles_ab_0p3)
    sphTensor_ab_0p5 = eventShapesUtilities.sphericityTensor(genParticles_ab_0p5)
    sphTensor_ab_0p7 = eventShapesUtilities.sphericityTensor(genParticles_ab_0p7)
    sphTensor_ideal = eventShapesUtilities.sphericityTensor(fromScalarParticles_bst)

    sph_noCut = eventShapesUtilities.sphericity(sphTensor_noCut)
    sph_bb_0p1 = eventShapesUtilities.sphericity(sphTensor_bb_0p1)
    sph_bb_0p3 = eventShapesUtilities.sphericity(sphTensor_bb_0p3)
    sph_bb_0p5 = eventShapesUtilities.sphericity(sphTensor_bb_0p5)
    sph_bb_0p7 = eventShapesUtilities.sphericity(sphTensor_bb_0p7)
    sph_ab_0p1 = eventShapesUtilities.sphericity(sphTensor_ab_0p1)
    sph_ab_0p3 = eventShapesUtilities.sphericity(sphTensor_ab_0p3)
    sph_ab_0p5 = eventShapesUtilities.sphericity(sphTensor_ab_0p5)
    sph_ab_0p7 = eventShapesUtilities.sphericity(sphTensor_ab_0p7)
    sph_ideal = eventShapesUtilities.sphericity(sphTensor_ideal)

    hist_noCut.fill(sph_noCut)
    hist_bb_0p1.fill(sph_bb_0p1)
    hist_bb_0p3.fill(sph_bb_0p3)
    hist_bb_0p5.fill(sph_bb_0p5)
    hist_bb_0p7.fill(sph_bb_0p7)
Exemple #8
0
    tracks_boosted_minusISR_minus10 = suepsUtilities.removeMaxE(
        tracks_boosted_minusISR, N=10)
    tracks_boosted_minusISR_minusPhi = tracks_boosted_minusISR[
        abs(tracks_boosted_minusISR.phi - isrJet_boosted.phi) > 1.0]

    s = eventShapesUtilities.sphericityTensor(tracks_boosted_minusISR)
    s1 = eventShapesUtilities.sphericityTensor(tracks_boosted_minusISR_minus10)
    s2 = eventShapesUtilities.sphericityTensor(
        tracks_boosted_minusISR_minusPhi)
    #s3 = eventShapesUtilities.sphericityTensor(tracks_boosted_minusISR_minus3)
    #s4 = eventShapesUtilities.sphericityTensor(tracks_boosted_minusISR_minus4)
    #s5 = eventShapesUtilities.sphericityTensor(tracks_boosted_minusISR_minus5)

    if variable == "sphericity":
        evtShape[ievt] = eventShapesUtilities.sphericity(s)
        evtShape1[ievt] = eventShapesUtilities.sphericity(s1)
        evtShape2[ievt] = eventShapesUtilities.sphericity(s2)
        #evtShape3[ievt] = eventShapesUtilities.sphericity(s3)
        #evtShape4[ievt] = eventShapesUtilities.sphericity(s4)
        #evtShape5[ievt] = eventShapesUtilities.sphericity(s5)
    elif variable == "aplanarity":
        evtShape[ievt] = eventShapesUtilities.aplanarity(s)
    elif variable == "C":
        evtShape[ievt] = eventShapesUtilities.C(s)
    elif variable == "D":
        evtShape[ievt] = eventShapesUtilities.D(s)
    elif variable == "circularity":
        evtShape[ievt] = eventShapesUtilities.circularity(
            tracks_boosted_minusISR)
        if ievt % 100: