New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some fixes for GenParticle status flags #8006
Conversation
…W appears in tau decay chain
…r (for identification of hard process quarks such as b's from top or higgs decays)
A new Pull Request was created by @bendavid (Josh Bendavid) for CMSSW_7_5_X. Some fixes for GenParticle status flags It involves the following packages: PhysicsTools/HepMCCandAlgos @cmsbuild, @vadler, @nclopezo, @monttj can you please review it and eventually sign? Thanks. |
const HepMC::GenParticle *mother(const HepMC::GenParticle &p) { | ||
return p.production_vertex() && p.production_vertex()->particles_in_size() ? *p.production_vertex()->particles_in_const_begin() : 0; | ||
const HepMC::GenParticle *mother(const HepMC::GenParticle &p, unsigned int imoth) { | ||
return p.production_vertex() && p.production_vertex()->particles_in_size() ? *(p.production_vertex()->particles_in_const_begin() + imoth) : 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bendavid - i'm not following this last line - the meaning o imoth seems to be the pdgId?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, imoth is the index of the mother in the list of mothers. (Yes, genparticles can have more than one mother)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this really is supposed to be pointer arithmetic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so why “15”, which I had assumed was the pdgId of a tau?
On Mar 2, 2015, at 6:07 PM, Josh Bendavid notifications@github.com wrote:
In PhysicsTools/HepMCCandAlgos/interface/MCTruthHelper.h:
}
/////////////////////////////////////////////////////////////////////////////
- const HepMC::GenParticle *mother(const HepMC::GenParticle &p) {
- return p.production_vertex() && p.production_vertex()->particles_in_size() ? *p.production_vertex()->particles_in_const_begin() : 0;
- const HepMC::GenParticle *mother(const HepMC::GenParticle &p, unsigned int imoth) {
- return p.production_vertex() && p.production_vertex()->particles_in_size() ? *(p.production_vertex()->particles_in_const_begin() + imoth) : 0;
}No, imoth is the index of the mother in the list of mothers. (Yes, genparticles can have more than one mother)
—
Reply to this email directly or view it on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, where is this function called with 15?
There is "findDecayedMother" which is a different function, and there the input parameter is indeed a pdg id.
ah. got it - presumably there is no real need to protect against overruns of this list? |
It's currently only called with an index here (so already explicitly kept in range) |
Some fixes for GenParticle status flags
Some fixes for GenParticle status flags
No description provided.