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

Querying quark content from Particle is difficult, is there an easier way? #264

Closed
HDembinski opened this issue Aug 27, 2020 · 7 comments
Closed

Comments

@HDembinski
Copy link
Member

Today I wanted to get all particles which have at least one strange quark. I found Particle.quarks and so I naively did:

Particle.findall(lambda p: "s" in p.quarks.lower())

However, this finds also

pi0 (uU-dD)/sqrt(2)
rho(770)0 (uU-dD)/sqrt(2)
a(2)(1320)0 (uU-dD)/sqrt(2)
rho(3)(1690)0 (uU-dD)/sqrt(2)
a(4)(1970)0 (uU-dD)/sqrt(2)
a(0)(1450)0 (uU-dD)/sqrt(2)
b(1)(1235)0 (uU-dD)/sqrt(2)
pi(2)(1670)0 (uU-dD)/sqrt(2)
a(1)(1260)0 (uU-dD)/sqrt(2)
rho(1700)0 (uU-dD)/sqrt(2)
[...]

It makes sense to me that Particle.quarks returns this, but it makes selecting particles by quark content surprisingly difficult. I would have run into the same issue if I asked for particles with a top quark.

I can work around this, no problem, but I wonder if there is an easier way to select particles by quark content, this seems like a common query.

  1. Is there a better way to select by quark content?
  2. Wouldn't it make sense to add further attributes to Particle to query strangeness, charmness, bottomness, etc?
@eduardo-rodrigues
Copy link
Member

Hans, isn't Particle.findall(lambda p: p.pdgid.has_strange) what you want?

@eduardo-rodrigues
Copy link
Member

BTW, I get many more particles via your query:

>>> len(Particle.findall(lambda p: 's' in p.quarks.lower()))
266

That's strange what you are getting.

BTW, that quarks info is one of the extra info we provide, not given via the annual .mcd files from the PDG. Let us know if you spot any place where the info is missing.

@eduardo-rodrigues
Copy link
Member

Ignore my last comment. I read too quicky. You meant "also get".

@eduardo-rodrigues
Copy link
Member

I should not that the README has example for queries according to quark content. Maybe that's not visible enough?

@eduardo-rodrigues
Copy link
Member

Happy for this to be closed, @HDembinski? Seems to me as a solved issue.

@HDembinski
Copy link
Member Author

Thank you for the proposed solution. I didn't really study the Readme, so that is on me. I think it is odd though that I cannot query everything from particle, that I have to go to .pdgid. Wouldn't it make more sense if Particle derives from PDGID?

@eduardo-rodrigues
Copy link
Member

That's a discussion in the other focused issue, whereasthe question here is dealt with within the present scope of the package, hence I'm closing. Let's continue to discuss the design of the class in #263.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants