diff --git a/FCNC-Fitter.md b/FCNC-Fitter.md index bf4d13e..2f1843a 100644 --- a/FCNC-Fitter.md +++ b/FCNC-Fitter.md @@ -57,6 +57,100 @@ There are possible 6 levels of verbosity, which follows the spdlog standard. The ## 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. +## Running + +For the detailed explanation of possible parameters, [[click here|Running-the-FCNC-fitter]]. + +For quickly running everything, run the following commands + +``` +python run.py -convert -all -Run 1 +python run.py -dontCompile -convert -all -Run 2 +python run.py -dontCompile -MC -angCorr -Run 1 -scan +python run.py -dontCompile -MC -angCorr -Run 2 -scan +python run.py -dontCompile -MC -angCorr -Run 1 +python run.py -dontCompile -MC -angCorr -Run 2 +python run.py -dontCompile -MC -angRes -Run 1 +python run.py -dontCompile -MC -angRes -Run 2 +python run.py -dontCompile -MC -Run 12 -fit -Ref -nBins 1 +python run.py -dontCompile -MC -Run 12 -fit -nBins 5 +python run.py -dontCompile -Run 12 -v 2 -fit -Ref -nBins 1 -genMC -Ref +python run.py -dontCompile -Run 12 -v 2 -fit -nBins 5 -genMC +python run.py -dontCompile -Data -Run 12 -fit -Ref -nBins 1 -massDim +python run.py -dontCompile -Data -Run 12 -fit -nBins 5 -massDim +python run.py -dontCompile -Data -Run 12 -fit -Ref -nBins 1 -bkgOnly -upper +python run.py -dontCompile -Data -Run 12 -fit -nBins 5 -onlyBkg -upper +python run.py -dontCompile -Run 12 -v 2 -fit -Ref -nBins 1 +``` + +**TODO** Create PHSP weights + +* First, it compiles the code and prepares the tuples with Run 1. +* Then, since we already compiled the code, we use the -dontCompile option for running the next commands. +* We prepare the tuples for Run2. Then, it scans the order of polynomial used for the PHSP angular description. +* Next step is to create the angular acceptance weights using the optimal polynomial. +* Then, the signal Monte Carlo sample is fitted: first fit the reference channel, then the signal channel. +* After this step is done, it fits the generator level Mont sample in the J/psi Q2 bin and rare channel in 5 Q2 bins. +* The next step is to fit the data in the B+ and K*+ masses: first, fit the J/psi channel, then the rare channel in the 5 bins. +* 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) + +## Parameters and constants + +### Constants + +The constants are saved in constants.hh and constants.cc. + + +The constants in `constants.cc` are functions either returning a combination of global constants in `constants.hh`, such as + +``` +double CTL_RANGE(){ + return CTL_MAX - CTL_MIN; +} +``` + +or returns values depending on number of bins, either the Q2 edges of the bins or the S and P observables. + +It also contains a function returning a vector of strings with the names of the background parameters depending on the folding and the order of the used polynomial. + +In `constants.hh` global variables are included: +* Mathematical constants (1 sigma = 0.638, pi, ... ) +* Q2 ranges +* Angle ranges +* (LaTeX) names +* Plotting options +* PDG masses +* Mass windows +* [Particle IDs](http://pdg.lbl.gov/2019/reviews/rpp2019-rev-monte-carlo-numbering.pdf) +* Angular correction orders +* Weighting options +* Parameter values +* Quite some obsolete constants from the Kspi+ analysis + +### Parameters + +The class definition of the parameters used in the fitter is in `parameters.cc`. The class consist of +* current value +* star value +* previous value +* error +* upper error +* lower error +* previous upper error +* previous lower error +* +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 + +The easiest way + + +## Toys generation + +## Running scripts + ## File structure Currently, the file structure is as follows. All the `.cc` source files also have their corresponding header with the same `name.hh`. @@ -106,42 +200,3 @@ Currently, the file structure is as follows. All the `.cc` source files also hav * ReferencePlots.cc * RunningScripts.cc * ScriptHelpers.cc - - -## Running - -For the detailed explanation of possible parameters, [[click here|Running-the-FCNC-fitter]]. - -For quickly running everything, run the following commands - -``` -python run.py -convert -all -Run 1 -python run.py -dontCompile -convert -all -Run 2 -python run.py -dontCompile -MC -angCorr -Run 1 -scan -python run.py -dontCompile -MC -angCorr -Run 2 -scan -python run.py -dontCompile -MC -angCorr -Run 1 -python run.py -dontCompile -MC -angCorr -Run 2 -python run.py -dontCompile -MC -angRes -Run 1 -python run.py -dontCompile -MC -angRes -Run 2 -python run.py -dontCompile -MC -Run 12 -fit -Ref -nBins 1 -python run.py -dontCompile -MC -Run 12 -fit -nBins 5 -python run.py -dontCompile -Run 12 -v 2 -fit -Ref -nBins 1 -genMC -Ref -python run.py -dontCompile -Run 12 -v 2 -fit -nBins 5 -genMC -python run.py -dontCompile -Data -Run 12 -fit -Ref -nBins 1 -massDim -python run.py -dontCompile -Data -Run 12 -fit -nBins 5 -massDim -python run.py -dontCompile -Data -Run 12 -fit -Ref -nBins 1 -bkgOnly -upper -python run.py -dontCompile -Data -Run 12 -fit -nBins 5 -onlyBkg -upper -python run.py -dontCompile -Run 12 -v 2 -fit -Ref -nBins 1 -``` - -**TODO** Create PHSP weights - -* First, it compiles the code and prepares the tuples with Run 1. -* Then, since we already compiled the code, we use the -dontCompile option for running the next commands. -* We prepare the tuples for Run2. Then, it scans the order of polynomial used for the PHSP angular description. -* Next step is to create the angular acceptance weights using the optimal polynomial. -* Then, the signal Monte Carlo sample is fitted: first fit the reference channel, then the signal channel. -* After this step is done, it fits the generator level Mont sample in the J/psi Q2 bin and rare channel in 5 Q2 bins. -* The next step is to fit the data in the B+ and K*+ masses: first, fit the J/psi channel, then the rare channel in the 5 bins. -* 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) \ No newline at end of file