A-A-Abdelhamid / LLP_Sleptons_RPV_SUSY

Here you can find MadGraph5 cards, diagrams, logs, plots, and code used in the project
2 stars 1 forks source link

High Pt Muons and Final Status Muons #4

Closed A-A-Abdelhamid closed 1 year ago

A-A-Abdelhamid commented 1 year ago

As discussed in our meeting, the code that goes down the decay chain to get muons with status ==1 was not structured in a way to only go down a muon line and not a photon line. Thus it might have ignored a few muons coming from smuon decays, and instead picked up muons from photon pair production.

def get_final_muon_descendant(particle):
    """
    Get the final state muon descendant of a given particle.

    """
    # Check if the particle itself is a final state muon
    if particle.status == 1 and abs(particle.pid) == 13:
        return particle
    # If the particle has an end vertex, check its descendants recursively
    elif particle.end_vertex:
        for p in particle.end_vertex.particles_out:
            final_muon = get_final_muon_descendant(p)
            if final_muon is not None:
                return final_muon
    # If the particle is not a final state muon and does not have an end vertex, return None
    return None

And then is called in

# Check if the particle is a muon produced by a decaying 2000013 or -2000013
        if abs(particle.pid) == 13 and particle.production_vertex and any(p.pid in [2000013, -2000013] for p in particle.production_vertex.particles_in):
            # Get the final muon descendant of the muon
            final_muon = get_final_muon_descendant(particle)
            if final_muon is not None:
                muons.append(final_muon)
                if final_muon.momentum.pt()> 65:
                  histSignalPt.Fill(final_muon.momentum.pt())
A-A-Abdelhamid commented 1 year ago

To solve this issue, I added this line to the functionand abs(particle.pid) == 13 to make it only go down the muon decay line:

def get_final_muon_descendant(particle):

    """
    Get the final state muon descendant of a given particle.
    """

    # Check if the particle itself is a final state muon

    if particle.status == 1 and abs(particle.pid) == 13:
        return particle

    # If the particle is a muon and has an end vertex, check its descendants recursively

    elif particle.end_vertex and abs(particle.pid) == 13:
        for p in particle.end_vertex.particles_out:
            final_muon = get_final_muon_descendant(p)
            if final_muon is not None:
                return final_muon

    # If the particle is not a final state muon and does not have an end vertex, return None

    return None
A-A-Abdelhamid commented 1 year ago

This is the output after updating the code:

pt_NonSignal_Cut

We are still getting the same muons with high Pt. I looked into the event with muon_Pt ~ 500 GeV

A-A-Abdelhamid commented 1 year ago

Here is the event:

event

And here is the muon with Pt ~ 0.49 TeV:

Screenshot 2023-07-25 at 2 08 49 PM

As strange as it seems, it is pair produced by a photon! The actual muon from the smuon decay is marked in green, the suspicious 0.49 TeV muon is circled in red

A-A-Abdelhamid commented 1 year ago

@trholmes Could you please take a look at this issue? This is the weird muon with pt ~0.5 TeV

I will look at the events with the other 7 muons that were not produced directly by a smuon decay and have pt> 65 GeV