15 B mass model
Renata Kopecná edited this page 2022-03-08 12:47:19 +01:00

Introduction

The B mass fit is performed by the functions defined in MassFit.cpp. In this file, the main function massFit is defined. This function is rather complex with many parameters as we tried a lot of mass models.

The fit model is based on RooFit.

Before executing any part of the selection code involving the mass fit, it is needed to compile the files with the classes needed for the fit.

Table of Contents

Mass Fit compilation

Recompile mass fit

root
 .L BmassShape/SignalType.cpp+
 .L BmassShape/SignalPdf.cpp+
 .L BmassShape/BackgroundType.cpp+
 .L BmassShape/BackgroundPdf.cpp+
 .L BmassShape/ParamValues.cpp+
 .L MassFit.cpp+
 .q

There might be some warning about unitialized variables, just ignore those.

Adding double crystal ball and ExpGauss to RooFit

Standard RooFit does not include a double crystal ball or ExpGaus function used to descibe partialy reconstructed background. Thanks go to Flavio for pointing me to the RooDoubleCB code and helping with the compilation!

RooDoubleCB compilation

Run

cd Code/Selection/RooFit/RooDoubleCB/
root
.L RooDoubleCB.cpp+
.q

If you do not compile the RooDoubleCB before running the MassFit for the first time, the code will compile but later throw an error it cannot find macro ./RooFit/RooDoubleCB/RooDoubleCB_cpp.so.

RooExpAndGauss compilation

This will fail if you already sourced ROOT or python described here. You might have to restart the enviroment (easiest is to log out and in)

cd Code/Selection/RooFit/RooExpAndGauss/
make 

Recompile Mass Fit

Now we need to link the RooFit models to MassFit.cpp by recompiling it in ROOT

root
 .L MassFit.cpp+
 .q

Fit model description

The fit is defined in the massFit function in MassFit.cpp. The user can decide

  • What year, polarity and Run to fit
  • What sample (data, MC, PHSP, inclusive MC) to fit
  • What selection to fit (stripped, preselected, set cut on MVA response, random subset of a selection, remove multiple candidates)
  • What Q2 range to fit (below Jpsi/Jpsi/rare/all)
  • Whether to constrain of fix the parameters to MC
  • Whether to use LL or DD tracks
  • Wheter to use sWeights or special weights calculated from efficiencis
  • Reduce verbosity/saving
  • What truth-matching to use
  • Mass range for the yield calculation
  • Apply additional cut on a variable (eg when scanning the B mass fit in different cos(thetak) bins)

Signal

The signal can fully turned off or be described by

  • Left-sided Crystal Ball
  • Right-sided Crystal Ball
  • Two Crystal Balls
  • Both-sided Crystal Ball
  • Gaussian
  • Double Gaussian

The fixed/starting parameters are saved in ParamValues.cpp.

Background

The signal can fully turned off or be described by

  • Exponential
  • Double Exponential
  • Exponential + ExpGaus
  • One Crystal Ball + single exponential

The fixed/starting parameters are saved in ParamValues.cpp.

Source files

BackgroundPdf Class

BackgroundType Class

ParamValues Class

SignalPdf Class

SignalType Class