Skip to content
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

Merged
merged 2 commits into from Mar 2, 2015

Conversation

bendavid
Copy link
Contributor

@bendavid bendavid commented Mar 1, 2015

No description provided.

…r (for identification of hard process quarks such as b's from top or higgs decays)
@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 2, 2015

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.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
If you are a L2 or a release manager you can ask for tests by saying 'please test' in the first line of a comment.
@nclopezo, @ktf you are the release manager for this.
You can merge this pull request by typing 'merge' in the first line of your comment.

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 2, 2015

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 2, 2015

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;
}
Copy link
Contributor

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?

Copy link
Contributor Author

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)

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@davidlange6
Copy link
Contributor

ah. got it - presumably there is no real need to protect against overruns of this list?

@bendavid
Copy link
Contributor Author

bendavid commented Mar 2, 2015

It's currently only called with an index here (so already explicitly kept in range)
https://github.com/bendavid/cmssw/blob/genstatusflagfixes/PhysicsTools/HepMCCandAlgos/interface/MCTruthHelper.h#L519

davidlange6 added a commit that referenced this pull request Mar 2, 2015
Some fixes for GenParticle status flags
@davidlange6 davidlange6 merged commit 3aaf9ea into cms-sw:CMSSW_7_5_X Mar 2, 2015
@ryonamin ryonamin mentioned this pull request Mar 3, 2015
bendavid pushed a commit to bendavid/cmssw that referenced this pull request Mar 10, 2015
Some fixes for GenParticle status flags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants