ComPWA / polarimetry

Polarimetry for the decay Λc → p K π
https://compwa.github.io/polarimetry
Apache License 2.0
5 stars 1 forks source link

FEAT: implement `masses` and `invariants` attributes #339

Closed redeboer closed 5 months ago

redeboer commented 5 months ago

Closes #336

redeboer commented 5 months ago

@mmikhasenko I added the snippets from our discussion in #336 on the main page. A few things I don't like:

mmikhasenko commented 5 months ago

Thanks! Agree with everything you say.

redeboer commented 5 months ago
  • The notebook with serialisation seems better place for it.

Okay good idea, moving the snippet to a new section there.

  • I should update the root file: same items look indeed strange

Well it's just an example, I'll generate one with generate_phasespace_sample() and post it here so it can be downloaded in the example

from zipfile import ZipFile
import uproot
import polarimetry
from polarimetry.data import generate_phasespace_sample

model = polarimetry.published_model()
phsp = generate_phasespace_sample(model.decay, n_events=8, seed=0)
with uproot.recreate("lc2pkpi_phsp.root") as root_file:
    root_file["Lc2ppiK"] = {
        "msq_piK": phsp["sigma1"],
        "msq_Kp": phsp["sigma2"],
    }
with ZipFile("lc2pkpi_phsp.zip", "w") as zip_file:
    zip_file.write("lc2pkpi_phsp.root")

lc2pkpi_phsp.zip

  • With a call from the module, to avoid user guessing on internal assumptions and names

Yeah would have to provide a small function to do that, but should be doable.