-
Notifications
You must be signed in to change notification settings - Fork 16
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
Support for decay descriptors #200
Comments
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 On the spot I would say that it would make sense to draft something say as a @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). |
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. |
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. |
In #331 I add a function that writes "LHCb-style" decay descriptors e.g. I identify 3 things that could be made configurable:
|
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})",
} |
Yes, sounds simple enough to me. Good idea! |
The configuration is implemented in abc1bfd I chose to make a class with >>> 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 |
Very nice, thank you! |
So, is this completed? |
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. [As you see I continue developing stuff but have limited bandwidth ;-) @admorris made a significant contribution in these matters 👍 !] |
As part of the LHCb Ntuple Wizard project, we have implemented decay descriptor parsing (and rendering) using pyparsing. I would like to port this over to
decaylanguage
and make it easy to add different "grammars" used by different experiments/software packages.Example grammars:
LoKi
decay descriptorsDecayDescriptor
classKFParticle
, used in sPHENIXWe 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.
The text was updated successfully, but these errors were encountered: