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

[Feature] expose weight calculation of events as method #20

Open
jonas-eschle opened this issue May 31, 2019 · 6 comments
Open

[Feature] expose weight calculation of events as method #20

jonas-eschle opened this issue May 31, 2019 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@jonas-eschle
Copy link
Contributor

jonas-eschle commented May 31, 2019

It could be useful to have a method that returns the event weights, or more direct, that tells whether something is inside or outside the phasespace (as @abhijitm08 asked for). I think it goes well into the scope of phasespace, most of all since the Particle knows everything it has to know.

My idea: extract the pdk function, expose it (https://github.com/zfit/phasespace/blob/master/phasespace/phasespace.py#L343). Make sure it returns something negative (or 0) if it is not allowed. The selection (a tf.where(weights > 0, ...) itself may be done on the user site and does not have to be part of Particle.

What do you think, @apuignav?

@jonas-eschle jonas-eschle added the enhancement New feature or request label May 31, 2019
@apuignav
Copy link
Contributor

It's interesting, but I'm not sure exposing PDK is the correct way. PDK is internal, and doesn't give a full answer to things directly. Maybe it's better to add a method in Particle, something like inside_phasespace?

@jonas-eschle
Copy link
Contributor Author

Not the pdk itself, but the recursively called. Because the generation of the events and the weights are actually independent, knowing the masses is enough, right?

But yes, we can also have this directly, even inside. We can also use this then to create advanced Space in zfit

@apuignav
Copy link
Contributor

I am not sure how to implement inside, but I think it'd be a killer feature. Would masses be enough or do we need 4-momenta? If I understand correctly, what we want is that given a certain input (masses or 4-momenta, not sure yet) the GenParticle can tell us if that particular input is possible given the decay, is that right?

@abhijitm08
Copy link

I think given the 4-mom of all the final state particle, P_i, that are all calculated in the mother rest frame. We just need to ensure sum{P_i} = P_{mother} = (Mass_{mother}, 0, 0, 0).

@apuignav
Copy link
Contributor

Yup, that would be nice because it would open the door to doing nice things with Dalitz. But for example, in the Dalitz it's enough to have the masses, so I'm not sure how I would deal with that...

@abhijitm08
Copy link

For Dalitz, if you want to just uses masses then you can ensure they are within phase space using Eq48.23a and 48.23b: http://pdg.lbl.gov/2017/reviews/rpp2017-rev-kinematics.pdf

And you can also build the 4-mom of the final state particles in the mother rest frame. Here you can calculate the mag of particle 3-mom in mother rest frame using 48.21b for all final states and since it is Dalitz where oreintation does not matter you can set the angle between each of the particles in the mother rest frame to be 120 degrees.

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

No branches or pull requests

3 participants