Angular analysis of B+->K*+(K+pi0)mumu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

282 lines
12 KiB

  1. /**
  2. * @file bu2kstarmumu_parameters.hh
  3. * @author Christoph Langenbruch, Renata Kopecna
  4. * @date 2009-03-18
  5. *
  6. */
  7. #ifndef BU2KSTARMUMU_PARAMETERS_H
  8. #define BU2KSTARMUMU_PARAMETERS_H
  9. #include <parameters.hh>
  10. #include <options.hh>
  11. #include <assert.h>
  12. //Simple struct to see whether fix or constrain a parameter
  13. struct fixConstr{
  14. bool fix = false;
  15. bool constrain = false;
  16. //Constructor
  17. fixConstr(bool b_fix, bool b_constr);
  18. };
  19. namespace fcnc {
  20. ///class that implements the different parameter sets for Bd -> Kstar mu mu
  21. class bu2kstarmumu_parameters: public parameters {
  22. private:
  23. ///adds all parameters to the params vector
  24. void add_parameters();
  25. options* opts;
  26. public:
  27. ///constructor uses toy challenge version 1 data as default
  28. bu2kstarmumu_parameters(options* o);
  29. ///use default B+ values
  30. /// //THIS IS SOMETHING EVERY ANALYSIS HAS TO CHANGE ON THEIR OWN!
  31. void use_default_bkg(); //Just reset bkg, useful in the code down the line
  32. void use_default_observables(); //Reset S-wave observables, useful in the code down the line
  33. void use_default();
  34. //simple and quick loading and saving of parameters to/from txt file
  35. void load_param_values(std::string filename);
  36. void load_param(std::string filename, std::string parname);
  37. int get_param_from_rootfile(std::string fileName, std::vector<std::string> names, int PDF, int bin, fixConstr FC);
  38. //Fix parameter to a value from a root file
  39. int fix_param_from_rootfile(std::string fileName, std::vector<std::string> names, int PDF, int bin);
  40. //Constrain parameter to a value from a root file
  41. int constrain_param_from_rootfile(std::string fileName, std::vector<std::string>names, int PDF, int bin);
  42. //Initialize parameter from a root file and let if float as it wishes
  43. int load_param_from_rootfile(std::string fileName,std::vector<std::string> names, int PDF, int bin);
  44. //TODO: remove as it is obsolete when done with pulls.cc
  45. void load_only_bckgnd_param_values(std::string filename);
  46. void load_only_Bmass_param_values(std::string filename);
  47. //Initialize parameters in the fit
  48. void init_mass_parameters(int PDF, int nBins, int bin, double defaultStepSize);
  49. void init_angular_background_parameters(bool fitReference, double stepsize);
  50. void init_kpi_background_parameters(bool fitReference, double stepsize);
  51. void init_mkpi_pWave_parameters(bool fitReference, double stepsize);
  52. void init_mkpi_sWave_parameters(bool fitReference, double stepsize);
  53. void init_mass_background_parameters(int nBins, int bin, bool useLambda);
  54. void init_angular_parameters(int nBins, int bin, double stepsize, double scale, bool blind);
  55. void init_Bmass(std::string fileName, int PDF, double stepSize, fixConstr FC);
  56. void init_ang_parameters_fromRefDavid(double stepsize, double scale, bool blind);
  57. void init_sWave_parameters(double stepsize);
  58. void save_param_values(std::string filename);
  59. //Effective q2
  60. parameter eff_q2 = parameter("eff_q2", "{q^{2}}_eff");
  61. //Number of signal/background events
  62. parameter n_sig = parameter("n_sig", "N_\\mathrm{sig}");
  63. parameter n_bkg = parameter("n_bkg", "N_\\mathrm{bkg}");
  64. //Fraction of signal events, effectivelly (nsig/(nsig+nbkg)))
  65. parameter f_sig = parameter("f_sig", "f_\\mathrm{sig}");
  66. //The B massneeds the full range of the B-mass fit,
  67. //as it decides the range of the data used in the fit
  68. parameter m_b = parameter("m_b", "m_{B^{+}}");
  69. //All mass parameters
  70. parameter m_res_1 = parameter("m_res_1", "f_{CB}");
  71. parameter m_scale = parameter("m_scale", "s_\\mathrm{m}");
  72. parameter m_sigma_1 = parameter("m_sigma_1", "#sigma_{1}^{CB}");
  73. parameter m_sigma_2 = parameter("m_sigma_2", "#sigma_{2}^{CB}");
  74. parameter alpha_1 = parameter("alpha_1", "#alpha_{1}^{CB}");
  75. parameter alpha_2 = parameter("alpha_2", "#alpha_{2}^{CB}");
  76. parameter n_1 = parameter("n_1", "n_{1}^{CB}");
  77. parameter n_2 = parameter("n_2", "n_{2}^{CB}");
  78. //These are for exponential background, either exp(-lambda*x) or exp(x/tau) 
  79. parameter fm_tau = parameter("fm_tau", "f_{m,#tau}");
  80. parameter m_lambda = parameter("m_lambda", "\\lambda_\\mathrm{m}");
  81. parameter m_lambda_2 = parameter("m_lambda_2", "\\lambda_\\mathrm{m,2}");
  82. parameter m_tau = parameter("m_tau", "#tau_{m,1}");
  83. parameter m_tau_2 = parameter("m_tau_2", "#tau_{m,2}");
  84. //Kstar related parameters /
  85. parameter mkstar = parameter("mkst","m(K^{*+})");
  86. parameter mkstarplus = parameter("mkstz","m(K^{*+}_{x})"); //K1+ resonances
  87. parameter mkstp = parameter("mkstp", "m(K^+\\pi^0)"); //TODO
  88. parameter gammakstar = parameter("gammakstar", "\\Gamma(K^{*+})"); //Width of K*
  89. parameter gammakstarplus = parameter("gamkstp", "\\Gamma(K^+\\pi^0)"); //Width of K1
  90. //parameter gamkstp = parameter("gamkstp", "\\Gamma(K^+\\pi^0)");
  91. //Afb and FL, S- and P- parameters are in S_pars(int) and P_pars(int)
  92. parameter fl = parameter("Fl", "F_{L}");
  93. parameter afb = parameter("Afb", "A_{FB}");
  94. //double exponential bkg
  95. parameter Fl = parameter("Fl", "F_{L}");
  96. parameter S1s = parameter("S1s", "S_{1s}");
  97. parameter S3 = parameter("S3", "S_{3}");
  98. parameter S4 = parameter("S4", "S_{4}");
  99. parameter S5 = parameter("S5", "S_{5}");
  100. parameter Afb = parameter("Afb", "A_{FB}");
  101. parameter S6s = parameter("S6s", "S_{6s}");
  102. parameter S7 = parameter("S7", "S_{7}");
  103. parameter S8 = parameter("S8", "S_{8}");
  104. parameter S9 = parameter("S9", "S_{9}");
  105. //less FF dependent variables P_i
  106. parameter P1 = parameter("P1", "P_{1}");//=2*S3/(1-Fl)
  107. parameter P2 = parameter("P2", "P_{2}");//=0.5*S6/(1-Fl)
  108. parameter P3 = parameter("P3", "P_{3}");//=-S9/(1-Fl)
  109. parameter P4 = parameter("P4", "P_{4}^{\\prime}");//=S4/sqrt(Fl Ft)
  110. parameter P5 = parameter("P5", "P_{5}^{\\prime}");//=S5/sqrt(Fl Ft)
  111. parameter P6 = parameter("P6", "P_{6}^{\\prime}");//=S7/sqrt(Fl Ft)
  112. parameter P8 = parameter("P8", "P_{8}^{\\prime}");//=S8/sqrt(Fl Ft)
  113. //S-wave parameters
  114. parameter FS = parameter("FS" ,"F_{S}");
  115. parameter SS1 = parameter("SS1","S_{S1}");
  116. parameter SS2 = parameter("SS2","S_{S2}");
  117. parameter SS3 = parameter("SS3","S_{S3}");
  118. parameter SS4 = parameter("SS4","S_{S4}");
  119. parameter SS5 = parameter("SS5","S_{S5}");
  120. //More Kstar related parameters
  121. parameter asphase = parameter("asphase", "arg(A_{S})");
  122. //Control the K* shape; one is ~p(K*) and one is ~1/p(K*),
  123. parameter a = parameter("a", "a");
  124. parameter r = parameter("r", "r");
  125. //Related to kappa(800), or f(800), it changed name apparently
  126. //Essentially a wide resonance
  127. parameter mf800 = parameter("mf800","m(f_{800})");
  128. parameter gammaf800 = parameter("gamf800","\\Gamma(f_{800})");
  129. parameter f800mag = parameter("f800mag","|f_{800}|");
  130. parameter f800phase = parameter("f800phase","arg(f_{800})");
  131. //R (also refered to as d in the literature)
  132. //is a parameter in the mkpi parameterisation.
  133. //It refers to the effective hadronic size
  134. //See L861f (page 66) of https://cds.cern.ch/record/2318554/files/LHCb-ANA-2018-022.pdf
  135. parameter R = parameter("R", "R");
  136. //As a standard this is the radius of a B messon
  137. //Background parameters
  138. //Polynomial of maximal order of four
  139. //Each parameter correspons to x^n
  140. //Eg cbkgctl1 and cbkgctl3 are non-zero, rest is zero means polynomial
  141. // x^1 + x^3
  142. //ctl
  143. parameter cbkgctl0 = parameter("cbkgctl0", "c_{bkg}^{0}(cos#Theta_{L})");
  144. parameter cbkgctl1 = parameter("cbkgctl1", "c_{bkg}^{1}(cos#Theta_{L})");
  145. parameter cbkgctl2 = parameter("cbkgctl2", "c_{bkg}^{2}(cos#Theta_{L})");
  146. parameter cbkgctl3 = parameter("cbkgctl3", "c_{bkg}^{3}(cos#Theta_{L})");
  147. parameter cbkgctl4 = parameter("cbkgctl4", "c_{bkg}^{4}(cos#Theta_{L})");
  148. //ctk
  149. parameter cbkgctk0 = parameter("cbkgctk0", "c_{bkg}^{0}(cos#Theta_{K})");
  150. parameter cbkgctk1 = parameter("cbkgctk1", "c_{bkg}^{1}(cos#Theta_{K})");
  151. parameter cbkgctk2 = parameter("cbkgctk2", "c_{bkg}^{2}(cos#Theta_{K})");
  152. parameter cbkgctk3 = parameter("cbkgctk3", "c_{bkg}^{3}(cos#Theta_{K})");
  153. parameter cbkgctk4 = parameter("cbkgctk4", "c_{bkg}^{4}(cos#Theta_{K})");
  154. parameter cbkgctk5 = parameter("cbkgctk5", "c_{bkg}^{5}(cos#Theta_{K})");
  155. parameter cbkgctk6 = parameter("cbkgctk6", "c_{bkg}^{6}(cos#Theta_{K})");
  156. //phi
  157. parameter cbkgphi0 = parameter("cbkgphi0", "c_{bkg}^{0}(#phi)");
  158. parameter cbkgphi1 = parameter("cbkgphi1", "c_{bkg}^{0}(#phi)");
  159. parameter cbkgphi2 = parameter("cbkgphi2", "c_{bkg}^{0}(#phi)");
  160. parameter cbkgphi3 = parameter("cbkgphi3", "c_{bkg}^{0}(#phi)");
  161. parameter cbkgphi4 = parameter("cbkgphi4", "c_{bkg}^{0}(#phi)");
  162. //mkpi
  163. parameter cbkgmkpi0 = parameter("cbkgmkpi0", "c_{bkg}^{0}(m_{K#pi})");
  164. parameter cbkgmkpi1 = parameter("cbkgmkpi1", "c_{bkg}^{1}(m_{K#pi})");
  165. parameter cbkgmkpi2 = parameter("cbkgmkpi2", "c_{bkg}^{2}(m_{K#pi})");
  166. parameter cbkgmkpi3 = parameter("cbkgmkpi3", "c_{bkg}^{3}(m_{K#pi})");
  167. parameter cbkgmkpi4 = parameter("cbkgmkpi4", "c_{bkg}^{4}(m_{K#pi})");
  168. //Fancy background to mkpi in the p^2 dimension
  169. parameter cswavemkpi0 = parameter("cswavemkpi0", "c_{S}^{0}(m_{K#pi})");
  170. parameter cswavemkpi1 = parameter("cswavemkpi1", "c_{S}^{1}(m_{K#pi})");
  171. parameter cswavemkpi2 = parameter("cswavemkpi2", "c_{S}^{2}(m_{K#pi})");
  172. parameter cswavemkpi3 = parameter("cswavemkpi3", "c_{S}^{3}(m_{K#pi})");
  173. parameter cswavemkpi4 = parameter("cswavemkpi4", "c_{S}^{4}(m_{K#pi})");
  174. parameter cbkgp20 = parameter("cbkgp20", "c_{bkg}^{0}(p^{2})");
  175. parameter cbkgp21 = parameter("cbkgp21", "c_{bkg}^{1}(p^{2})");
  176. parameter cbkgp22 = parameter("cbkgp22", "c_{bkg}^{2}(p^{2})");
  177. parameter cbkgp23 = parameter("cbkgp23", "c_{bkg}^{3}(p^{2})");
  178. parameter cbkgp24 = parameter("cbkgp24", "c_{bkg}^{4}(p^{2})");
  179. //Nobody used this ever, probably not even in the PDF
  180. parameter nthreshold = parameter("nthreshold", "n_{thr.}");
  181. double J1s() const {
  182. return 3.0/4.0*(1.0-J1c()); // 3/4*(1-F_L)
  183. };
  184. double J1c() const {
  185. if (opts->fit_pprimes) assert(opts->fit_fl);
  186. if (opts->fit_fl) return Fl();
  187. else return 1.0-4.0/3.0*S1s();
  188. };
  189. double J2s() const {
  190. return J1s()/3.0; //1/4(1-F_L)
  191. };
  192. double J2c() const {
  193. return -J1c(); //-F_L
  194. };
  195. double J3() const {//P1;//=S3/(1-Fl) correction P1=2S3/(1-FL)
  196. if (opts->fit_pprimes) return 0.5*P1()*(1.0-J1c());
  197. else return S3();
  198. };
  199. double J4() const {//P4;//=S4/sqrt(Fl Ft)
  200. if (opts->fit_pprimes) return P4()*sqrt(J1c()*(1.0-J1c()));
  201. else return S4();
  202. };
  203. double J5() const {//P5;//=S5/sqrt(Fl Ft)
  204. if (opts->fit_pprimes) return P5()*sqrt(J1c()*(1.0-J1c()));
  205. else return S5();
  206. };
  207. double J6s() const {//P2;//=S6/(1-Fl) correction P2=0.5*S6s/(1-FL)
  208. if (opts->fit_pprimes) return 2.0*P2()*(1.0-J1c());
  209. else if (opts->fit_afb) return 4.0/3.0*Afb();
  210. else return S6s();
  211. };
  212. double J6c() const {
  213. return 0.0;
  214. };
  215. double J7() const {//P6;//=S7/sqrt(Fl Ft)
  216. if (opts->fit_pprimes) return P6()*sqrt(J1c()*(1.0-J1c()));
  217. else return S7();
  218. };
  219. double J8() const {//P8;//=S8/sqrt(Fl Ft)
  220. if (opts->fit_pprimes) return P8()*sqrt(J1c()*(1.0-J1c()));
  221. else return S8();
  222. };
  223. double J9() const {//P3;//=S9/(1-Fl) correction P3=-S9/(1-FL)
  224. if (opts->fit_pprimes) return -P3()*(1.0-J1c());
  225. else return S9();
  226. };
  227. };
  228. }
  229. //Returns value or error of a parameter from a rootFile
  230. double get_param_value_from_rootfile(std::string fileName, std::string names, int PDF, int bin);
  231. double get_param_error_from_rootfile(std::string fileName, std::string names, int PDF, int bin);
  232. //Returns a scaled number of events in given bin from total number of events in data
  233. double eventsInBin_fraction(int bin, int run, int nBins, bool fromRef);
  234. //Returns a scaled number of events in given bin from total number of events
  235. //Eg I want to have 1000 events in 4 bins and 2 pdfs, it generates 155 signal + 100 bkg events in bin1, 125+120 in bin2, 180 + 50 in bin3 and 200+70 in bin4 as random example
  236. void EventNumbers(unsigned int bin, unsigned int pdf,
  237. double & fraction, unsigned int & eventnumbers,unsigned int TotalEvents,
  238. unsigned int bins, unsigned int pdfs);
  239. #endif