Skip to content

Moore-B2OC branch: More lines + structure

Mikkel Bjorn requested to merge B2OC-Mikkel into Moore-B2OC

Hi, I have 1) added a few more lines to the B2OC branch, and 2) restructured the code a bit; it is really just a small tweak on structure that was already set up in the Moore-B2OC branch (which is the one being merged into!).

A few points

  1. Moved the full definition of the D->hhh decay into the DBuilder. I think the D builder should make an array of fully predefined, default D decays available, so the decay should not be configured from the B builder. (Then these can potentially be reconfigured when defining a line by using alternative arguments, but this should of course be avoided as much as possible.)
  2. For adding the D->Kshh decays, I have made a generic D->3body builder, that is then used to make the D->Kshh. If we agree on a standard set of variables to cut on for D-> n body decays, I think this can simplify the code a lot, when adding more D decays. The cut values need not all be shared between decays, and since everything can be overriden in the line definition, we don't really restrict any flexibility (unless we want to, at a later point, in which case it will be easier). I think that structure is worth thinking about for all the D decays.
  3. The B2DD and B2Dh builder functions only differed in their input particles and decay descriptors, so for now I have promoted those to input arguments and merged the functions to avoid code duplication. As you can see, one then supplies the information directly in the line definition, instead of having multiple B maker functions:
@hlt2_line_builder('Hlt2B2OCB02DKD2HHHLine')
def b02dk_d2hhh_line():
   bachelor = basic.make_b2oc_kaons()
   d = d_builder.make_b2oc_dplus_to_hhh()
   return prefilters() + [
       b_builder.make_b2x(
           particles=[d, bachelor], descriptors=['B0 -> D- K+'])
   ]

This has a number of benefits I think:

  • It is easy to see exactly what decay is built in a given line. Before the line definition was essentially a wrapper
  • It is super easy to tweak things for one line, and one line only (if wanted)
  • Before, the B2Dh function really did 3 things: it defined a D decay, and it defined two different lines. Now the D decay definition is moved to the D builder, and the line definitions to where the actual lines are defined. Thereby I don't risk messing things up for a bunch of lines, when changing one line. This also avoids the if statement, and more potential if statements to come, when extending from B0 to B+ decays, etc
  • if we at some point want a dedicated B -> DD maker (or indeed any other dedicated B decay makers) that is still super easy to do, and can reuse almost all the code from the B -> X builder:
def make_specialised_b_decay(particles):
      descriptor = <some specific descriptor>
      return make_b2x(particles, descriptor = descriptor, some_var = new_default_value)
  1. I think it makes sense to have a B builder module that is completely analogous to the D builder = a module that builds decays. And then elsewhere define the lines. For now, I put all of the lines in one place, but I think the definitions should be split by line family, as was suggested in the CT&S meeting (they can still all use the same B builder module though, since now the unique feature of each line are defined in the line, instead of in the B decay builder.

Let me know what you think!

Edited by Alessandro Bertolin

Merge request reports