Update 'FCNC Fitter'

Renata Kopecná 2022-02-04 18:03:46 +01:00
parent 5ffc2b1819
commit 26be2f50e7

@ -7,7 +7,7 @@ FCNC fitter was originally written by Christoph Langenbruch. Then, it was modifi
* [File structure](#file-structure) * [File structure](#file-structure)
* [Running](#running) * [Running](#running)
## Compilation # Compilation
The compilation is done by using cmake. The include of [spdlog](#spdlog) and all the libraries is done in `CMakeLists.txt`. When you install [spdlog](#spdlog), check the path is properly included! The compilation is done by using cmake. The include of [spdlog](#spdlog) and all the libraries is done in `CMakeLists.txt`. When you install [spdlog](#spdlog), check the path is properly included!
Compile the code with a simple Compile the code with a simple
@ -19,7 +19,7 @@ bash cmake.sh
Or just run the code using the [[amazing python tool for running the code|Running the FCNC fitter]], it will take care of the compilation automatically. Or just run the code using the [[amazing python tool for running the code|Running the FCNC fitter]], it will take care of the compilation automatically.
## spdlog # spdlog
Spdlog is a fast logging library. It is made for C++ and consists only of headers. Spdlog is used in FCNCfitter now, as the previous version only used two levels of verbosity (verbose and super verbose) using basic prints. To run the current version of the FCNC fitter it is required to be installed. Spdlog is a fast logging library. It is made for C++ and consists only of headers. Spdlog is used in FCNCfitter now, as the previous version only used two levels of verbosity (verbose and super verbose) using basic prints. To run the current version of the FCNC fitter it is required to be installed.
The github repository can be found at The github repository can be found at
@ -41,7 +41,7 @@ set(SPDLOG_INCLUDE_DIR "$/yourPath/spdlog/include/")
set(SPDLOG_INCLUDE_DIR_TWO "/yourPath/spdlog/include/spdlog/") set(SPDLOG_INCLUDE_DIR_TWO "/yourPath/spdlog/include/spdlog/")
``` ```
## Output # Output
There are possible 6 levels of verbosity, which follows the spdlog standard. The levels have different color codes There are possible 6 levels of verbosity, which follows the spdlog standard. The levels have different color codes
@ -54,10 +54,10 @@ There are possible 6 levels of verbosity, which follows the spdlog standard. The
| 4) Error | red | Prints only error messages | | 4) Error | red | Prints only error messages |
| 5) Critical | full red | Prints only very serious error messages, the program should end/or crash after such message | | 5) Critical | full red | Prints only very serious error messages, the program should end/or crash after such message |
## Known issues # Known issues
The running per year is not working flawlessly as it wasn't really ever used. The paths are sometimes wrongly configured due to this and hence the loading of files sometimes fails. The running per year is not working flawlessly as it wasn't really ever used. The paths are sometimes wrongly configured due to this and hence the loading of files sometimes fails.
## Running # Running
For the detailed explanation of possible parameters, [[click here|Running-the-FCNC-fitter]]. For the detailed explanation of possible parameters, [[click here|Running-the-FCNC-fitter]].
@ -95,9 +95,10 @@ python run.py -dontCompile -Run 12 -v 2 -fit -Ref -nBins 1
* Then, fit the angular background distributions (upper B+ mass sideband) using a chebyschev polynomial. * Then, fit the angular background distributions (upper B+ mass sideband) using a chebyschev polynomial.
* The last step is to fit the data, J/psi channel in 4 dimensions (B+ mass, cos(thetal), cos(thetak), phi) * The last step is to fit the data, J/psi channel in 4 dimensions (B+ mass, cos(thetal), cos(thetak), phi)
## Parameters and constants # Tuple conversion
# Parameters and constants
### Constants ## Constants
The constants are saved in constants.hh and constants.cc. The constants are saved in constants.hh and constants.cc.
@ -128,7 +129,7 @@ In `constants.hh` global variables are included:
* Parameter values * Parameter values
* Quite some obsolete constants from the Kspi+ analysis * Quite some obsolete constants from the Kspi+ analysis
### Parameters ## Parameters
The class definition of the parameters used in the fitter is in `parameters.cc`. The class consist of The class definition of the parameters used in the fitter is in `parameters.cc`. The class consist of
* current value * current value
@ -142,16 +143,25 @@ The class definition of the parameters used in the fitter is in `parameters.cc`.
* *
The parameters used in the fitter are then defined in `bu2kstarmumu_parameters.hh`. The functions defined there inititialize the parameters either to the defualt or based on the given fit model. The functions can also load parameters from files, which is handy when fixing parameters to the reference channel or when generating toys. Helper functions used to retrieve the data from files are also defined there. The parameters used in the fitter are then defined in `bu2kstarmumu_parameters.hh`. The functions defined there inititialize the parameters either to the defualt or based on the given fit model. The functions can also load parameters from files, which is handy when fixing parameters to the reference channel or when generating toys. Helper functions used to retrieve the data from files are also defined there.
## Fit models # Fit models
There are many options how to put together the model that has to be fit. Therefore, separate files with definitions of the model for given case are saved in given source files. The files that were actually used are listed in the neat table below. For the full details, [consult my thesis](http://www.physi.uni-heidelberg.de/Publications/thesis_Kopecna_final.pdf).
The easiest way | File name | Description |
|-----------|-------------|
| backgroundfit.cc | Performs the fit of the background only: taken from upper mass sideband, functions are chebyshev polynomial for angles and exponential for the B+ mass. |
| genlvlfit.cc | Loads the generator level tuple and performs the full angular fit. |
| mainfit.cc | Fits the data in 4 dimensions: B+ mass and the three angles. Be careful when running on rare data, the blinding might not be set perfectly as it never got to actually run the code |
| massfit.cc | Fits the B+ and K*+ masses. B+ mass is fitted using double sided Crystal Ball, K*+ uses the LASS parametrization |
| mcfit.cc | Performs the monte carlo fit: there is no background contribution. Fit is performed in 4D: B+ mass and the angles |
| toysfit.cc | Fits the distributions from toys. |
## Toys generation
## Running scripts # Toys generation
# Running jobs on condor
# Angular acceptance
## File structure # File structure
Currently, the file structure is as follows. All the `.cc` source files also have their corresponding header with the same `name.hh`. Currently, the file structure is as follows. All the `.cc` source files also have their corresponding header with the same `name.hh`.
* bu2kstarmumu.cc: The main * bu2kstarmumu.cc: The main
@ -185,7 +195,7 @@ Currently, the file structure is as follows. All the `.cc` source files also hav
* backgroundfit.cc * backgroundfit.cc
* feldman_cousins.cc (**Never used**) * feldman_cousins.cc (**Never used**)
* genlvlvfit.cc * genlvlvfit.cc
* likelihoodscan.cc (Never used **TODO**) * likelihoodscan.cc (**Never used**)
* mainfit.cc * mainfit.cc
* massfit.cc * massfit.cc
* mcfit.cc * mcfit.cc