Flavor tagging

3.4.5. Flavor tagging#

How can we distinguish between a \(B^0\) and a \(\bar B^0\)? This is not as simple as the case where we have a \(B^+\) vs a \(B^-\) and can just consider the charge of the particles. Yet determining this “flavor” of the \(B\) meson is crucial to look into CP violation.

This is where the Flavor Tagger comes in. Used in an analysis, where we have reconstructed a signal \(B_\text{sig}\), the Flavor Tagger looks at the ROE of the \(B_\text{sig}\) (i.e. at the \(B_\text{tag}\)) and applies machine learning techniques (also called multivariate analysis) to determine the flavor of the \(B_\text{tag}\). In this lesson we will not train this model ourselves, but rather use pre-computed weights. So where do we get them?

Luckily, such sets of weights are contained in the conditions database. That means that we only need to use a specific global tag (if you forgot what that is, consult this page again: Conditions Database Overview).

Exercise

Add a line to your previous steering file that adds the latest global tag. For this you need to call the prepend_globaltag method of the basf2.conditions object (which is an instance of the ConditionsConfiguration class). To get the latest analysis global tag, you can call modularAnalysis.getAnalysisGlobaltag.

Good! Now we have the weights and we have already created the ROE, so we can start right away!

Exercise

Call the flavorTagger.flavorTagger function (you need to specify your path and your particle list).

Exercise

Add the flavor_tagging variable collection to your output variables

Exercise

Run your steering file!

Good! Now let’s talk about the output of the flavor tagger. This is the value \(q\cdot r\), where \(q=-1\) corresponds to a \(\bar B^0\) and \(q=+1\) to \(B^0\). \(r\) is called the dilution factor. It’s 0 if the algorithm can’t decide between both options for \(q\) and 1 if the algorithm is certain about its decision.

The variable FBDT_qrCombined is the \(q\cdot r\) result of one of the models of the Flavor Tagger (a fast boosted decision tree). It can also be NaN to signal that not a single charged track in the ROE was found, so that the algorithm can’t work.

Part of the variables you just added was also qrMC for the “true” (MC level) flavor of the \(B_\text{tag}\). It can take the numbers \(\pm 1\), as well as 0 (no flavor defined in the MC) and \(\pm 2\) (some problems with MC matching in the ROE).

That means that we can check how well our flavor tagger performed by comparing it to FBDT_qrCombined!

Exercise (optional)

Plot a histogram of FBDT_qrCombined and qrMC.

Exercise

Only consider candidates with clearly defined MC level flavor tag. Compare the output of qrMC to that of FBDT_qrCombined.

Key points

  • The flavor tagger is used to discriminate between \(B_\text{tag}^0\) and \(\bar B_\text{tag}^0\)

  • The output is of the form \(\pm 1\) times the confidence between 0 and 1.

Authors of this lesson

Kilian Lieret