Comments (10)
Thanks @admorris for creating this work task / enhancement idea following our chats within LHCb. Thanks also for the links. I was not aware of all of those and this is bound to be interested and relevant.
You know already that I like the idea of the extension since specifications of decays such as B0 -> pi+ pi-
make sense and are very much used in Flavour Physics experiments. We should try and provide at least a basis "for everyone", as generic as possible. Once we integrate with the rest then all package functionality can be exploited for free ...
On the spot I would say that it would make sense to draft something say as a descriptor/
submodule under
https://github.com/scikit-hep/decaylanguage/tree/master/src/decaylanguage, in the same way that we have dec/
to deal with .dec decay files and decay
to define decay chain classes.
@henryiii, I hope you also like these ideas :-).
We should try and see if Belle-II colleagues could be interested in this. Let me start by pinging usual suspects such as @daritter and @GiacomoXT (feel free to ping other colleagues).
from decaylanguage.
We can also think about doing matching and substitution (which we also have functionality for in the Ntuple Wizard) but there it's less clear to me how easy it is to support different conventions from different experiments/packages.
This is indeed a bit trickier. Depends on how much can be generic and how much needs to be experiment specific. Else we can have things defined via a sort of "backend", and using for example the "LHCb backend" would bring in some functionality not necessarily available generically. Just thinking out loud here.
from decaylanguage.
Hi @admorris, shall we try and move forward with this nice addition? Such a module will be super useful also for run-3 DaVinci, hence I'm very keen. Let me know whether you will have a bit of time for this. I'm happy to help.
from decaylanguage.
In #331 I add a function that writes "LHCb-style" decay descriptors e.g. D*+ -> (D0 -> K- pi+) pi+
I identify 3 things that could be made configurable:
->
arrow (vs=>
,-->
etc)- round braces without internal spaces
()
for sub-decays (can foresee[]
,{}
... plus versions with spacing) - mother of sub-decay within braces, i.e.
(D0 -> K- pi+)
vsD0 (-> K- pi+)
from decaylanguage.
I guess to allow for the most flexibility, this could be achieved with some kind of global configuration where the user specifies format-strings with named variables:
# LHCb LoKi style
descriptor_config = {
"decay_pattern": "{mother} -> {daughters}",
"sub_decay_pattern": "({mother} -> {daughters})",
}
# Belle DecayString style
descriptor_config = {
"decay_pattern": "{mother} -> {daughters}",
"sub_decay_pattern": "[{mother} -> {daughters}]",
}
# Some other style
descriptor_config = {
"decay_pattern": "{mother} --> {daughters}",
"sub_decay_pattern": "{mother} (--> {daughters})",
}
from decaylanguage.
Yes, sounds simple enough to me. Good idea!
from decaylanguage.
The configuration is implemented in abc1bfd
I chose to make a class with __enter__
and __exit__
methods so you can do with
statements:
>>> with DescriptorFormat("{mother} --> {daughters}", "[{mother} --> {daughters}]"): dc.to_string()
...
'D*+ --> [D0 --> [K_S0 --> pi+ pi-] [pi0 --> gamma gamma]] pi+'
>>> with DescriptorFormat("{mother} => {daughters}", "{mother} (=> {daughters})"): dc.to_string();
...
'D*+ => D0 (=> K_S0 (=> pi+ pi-) pi0 (=> gamma gamma)) pi+'
>>> dc.to_string()
'D*+ -> (D0 -> (K_S0 -> pi+ pi-) (pi0 -> gamma gamma)) pi+'
Or call DescriptorFormat.set_config
directly (which checks that the provided patterns contain the correct named-wildcards)
from decaylanguage.
Very nice, thank you!
from decaylanguage.
So, is this completed?
from decaylanguage.
Hi @ryuwd from across an LHCb-internal discussion where this is relevant ;-).
The work (modulo little enhancements possible) is done in one direction but the reverse-problem implementation is missing.
For an example from a "DecayLanguage" decay chain to a descriptor see https://github.com/scikit-hep/decaylanguage/blob/master/tests/utils/test_utilities.py. What we now miss, handy for LHCb, is that you pick up an arbitrarily complex descriptor and spit out the decaying particle and chains with subdecays. As said, a lot already exists in the LHCb Ntuple Wizard but needs some work to be exported out to everyone.
[As you see I continue developing stuff but have limited bandwidth ;-) @admorris made a significant contribution in these matters 👍 !]
from decaylanguage.
Related Issues (20)
- ModelAlias support HOT 27
- Replace pydot with graphviz HOT 7
- Remove constraint on Lark version and update to most recent ones HOT 3
- Update importlib.resources usage HOT 7
- CI clean-up + enhancement needed
- Either or type decay chains HOT 7
- Numbers in decay models are parsed as parameters HOT 1
- tox --> nox now? HOT 7
- _repr_svg_() is deprecated from graphviz v0.19 HOT 4
- Test notebooks in the CI
- Dead link in readme HOT 2
- How to extract branching fractions? HOT 9
- Add a CITATION.cff file
- Adapt to Lark 1.x
- restore AmpGen2GooFit conversion HOT 6
- Functionality to create multiple decay descriptors from a dict when particles have multiple decay modes HOT 4
- New version? HOT 2
- Enhance test suite to verify all EvtGen models HOT 1
- Update README for recently added functionality
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from decaylanguage.