Opened 5 years ago
Last modified 5 years ago
#1413 new How to
Question about Particle and Selecting Certain Events
Reported by: | usernew | Owned by: | |
---|---|---|---|
Priority: | critical | Milestone: | |
Component: | Delphes code | Version: | Delphes 3 |
Keywords: | select event particle genparticle | Cc: |
Description
Hello,
I am generating a collision event.
I would like to know how can I select events that contain z bosons and furthermore only select events that have three z bosons and then select only a pair of z bosons at a time.
I tried looking at Example1.C to get an idea. I have written this down so far:
if(branchParticle->GetEntries() >= 3)
{
if(TMath::Abs(gen->PID==23))
{
z1 = (GenParticle *) branchParticle->At(0);
z2 = (GenParticle *) branchParticle->At(2);
histzmass->Fill(((z1->P4()) + (z2->P4())).M());
}
}
However, one mistake I notice is that I do not think this only selects a pair of z bosons at a time because I can write At(0) and At(5) even though I thought I specified with
if(branchParticle->GetEntries() >= 3) that I am looking at an event with three bosons. What does At() actually do then and how can I properly achieve what I am looking for?
Thank you very much!
Also, how would you match mother particle with daughter particle. I.e. how do you know which daughter particle came from which mother particle.