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.

300 lines
11 KiB

  1. // Renata Kopecna
  2. #ifndef CONSTANTS_HH
  3. #define CONSTANTS_HH
  4. #include <sys/stat.h>
  5. #include <iostream>
  6. #include <vector>
  7. #include <TMath.h>
  8. //general constnats
  9. const double MY_PI = TMath::Pi();
  10. const double C_PWAVE = 9.0/32.0/MY_PI;
  11. const double C_SWAVE = 3.0/16.0/MY_PI;
  12. const double ONE_SIGMA = 0.683;
  13. const double TWO_SIGMAS = 0.9773;
  14. const double THREE_SIGMAS = 0.9987;
  15. const int DEFAULT_TREE_INT = -1; //Used when initializing doubles in trees
  16. const double DEFAULT_TREE_VAL = -100.0; //Used when initializing doubles in trees
  17. const double DEFAULT_TREE_ERR = 0.0; //Used when initializing error of doubles in trees
  18. //Set binning scheme
  19. const double Q2_MIN_RANGE = 0.25; //Not necesarilly connected to get_TheQ2binsmin, used only when the full q2 range is used, eg for plotting
  20. const double Q2_MAX_RANGE = 18.0;
  21. const double Q2_MAX_RANGE_B0 = 19.0;
  22. //Not necesarilly connected to get_TheQ2binsmax, used only when the full q2 range is used, eg for plotting
  23. std::vector<double> get_TheQ2binsmin(int nBins, bool Reference);
  24. std::vector<double> get_TheQ2binsmax(int nBins, bool Reference);
  25. //List excluded Q2 regions
  26. const std::vector<std::vector<double>> EXCLUDED_Q2 ={
  27. {0.98,1.1}, //meaning events with q^2 in 0.98-1.1 will not be considered
  28. {8.0,11.0},
  29. {12.5,15}
  30. };
  31. const int NBINS_DEFAULT = 4; //used as a default number of q2 bins
  32. //Set resolution
  33. std::vector<std::vector<double>> get_resolution();
  34. //Set limits of the angles
  35. const double CTL_MIN = -1.0;
  36. const double CTL_MAX = +1.0;
  37. const double CTK_MIN = -1.0;
  38. const double CTK_MAX = +0.8;
  39. const double PHI_MIN = -TMath::Pi();
  40. const double PHI_MAX = +TMath::Pi();
  41. //Set the maximum number of folding ID, useful for loops
  42. const double MAX_FOLDING = 5;
  43. //Ranges of the angles, always max-min
  44. double CTL_RANGE();
  45. double CTK_RANGE();
  46. double PHI_RANGE();
  47. double Q2_RANGE_FULL();
  48. double RANGE_3D(); //ctl*ctk*phi range
  49. double RANGE_4D(); //ctl*ctk*phi*q2 range
  50. const int nANGLES = 3;
  51. const std::vector<std::string> ANGLES = {"ctl", "ctk", "phi"};
  52. //This *could* be in design.hh, but then it has to be sourced everywhere and this is just easier
  53. const std::vector<std::string> latex_angles = {"cos(#Theta_{L})", "cos(#Theta_{K})", "#phi"};
  54. const std::vector<std::string> latex_2angles = {"\\ctl", "\\ctk", "$\\phi$"};
  55. //////////////////////////////////
  56. // Fitter options //
  57. //////////////////////////////////
  58. //Set number of used cores
  59. const int NCORES = 8;
  60. const double MIG_MAX_CALLS = 100000000.0;
  61. const double MIG_TOLERANCE = 0.1; //TODO
  62. // The default tolerance in TMinuit is 0.1
  63. // The minimization will stop when the estimated vertical distance to the minimum (EDM) is less than 0.001*[tolerance]*UP(see SET ERR)
  64. //////////////////////////////////
  65. // Basic paths //
  66. //////////////////////////////////
  67. //Set decay string and main path
  68. const std::string DECAY_NAME = "KplusPi0Resolved";//"KshortPiplus"
  69. const std::string CONFIG_PHSP_WEIGHT = "config/phspweightq2.root";
  70. //////////////////////////////////
  71. // plotting //
  72. //////////////////////////////////
  73. const bool PLOT_THISTHESIS_TAG = true;
  74. const std::string THISTHESIS_TAG = "this thesis";
  75. const int PLOT_NBINS_MB = 100;
  76. const int PLOT_NBINS_MKSTAR = 50;
  77. const int PLOT_NBINS_ANGLES = 20;
  78. //When plotting, the pdf is plotted as a very fine TH1D,
  79. //PLOT_NBINS_RATIO says how many times more bins is there in the pdf compared to the data bins
  80. const int PLOT_NBINS_RATIO = 20;
  81. //////////////////////////////////
  82. // PDG masses //
  83. //////////////////////////////////
  84. const Double_t PDGMASS_B_PLUS = 5279.29;
  85. const Double_t PDGMASS_B_ZERO = 5279.61;
  86. const Double_t PDGMASS_J_PSI = 3096.90;
  87. const Double_t PDGMASS_PSI_2S = 3686.10;
  88. const Double_t PDGMASS_K_STAR_PLUS = 891.66;
  89. const Double_t K_ONE_PLUS = 1272.0;
  90. const Double_t PDGMASS_K_PLUS = 493.68;
  91. const Double_t PDGMASS_K_SHORT = 497.61;
  92. const Double_t PDGMASS_PI_PLUS = 139.57;
  93. const Double_t PDGMASS_PI_ZERO = 134.98;
  94. const Double_t PDGMASS_MU = 105.66;
  95. const Double_t PDGMASS_GAMMA = 0.0;
  96. //Decay specific PDG masses
  97. const Double_t PDGMASS_K_STAR = PDGMASS_K_STAR_PLUS;
  98. const Double_t PDGMASS_KST_KAON = PDGMASS_K_PLUS;
  99. const Double_t PDGMASS_KST_PION = PDGMASS_PI_ZERO;
  100. const Double_t PDGMASS_B = PDGMASS_B_PLUS;
  101. //Set mass range and window of the B mass
  102. const double B_MASS_LOW = 5150.0;
  103. const double B_MASS_HIGH = 5800.0;
  104. //CAREFUL when initializing the m_b parameter:
  105. //the min and max set also the fit range, so it should be always
  106. //set to B_MASS_LOW and B_MASS_HIGH
  107. //The tight window is used for plotting the very signal only region
  108. const double B_MASS_TIGHT_WINDOW = 100; //David had 50
  109. //Set the cuts from where we have only background
  110. const double B_MASS_HIGH_BKG = PDGMASS_B_PLUS + 100;
  111. const double B_MASS_LOW_BKG = PDGMASS_B_PLUS - 100;
  112. const double B_MASS_HIGH_BKG_REF = PDGMASS_B_PLUS + 350;
  113. const double B_MASS_LOW_BKG_REF = 5150;
  114. const double KPI_MASS_MIN = PDGMASS_K_STAR-100.;
  115. const double KPI_MASS_MAX = PDGMASS_K_STAR+100.;
  116. //////////////////////////////////
  117. // PARTICLE IDs //
  118. //////////////////////////////////
  119. const int ID_B_PLUS = +521;
  120. const int ID_B_ZERO = +511;
  121. const int ID_K_STAR_PLUS = +323;
  122. const int ID_K_STAR_ZERO = +313;
  123. const int ID_K_PLUS = +321;
  124. const int ID_K_SHORT = +310;
  125. const int ID_PI_PLUS = +211;
  126. const int ID_PI_ZERO = +111;
  127. const int ID_GAMMA = +22;
  128. const int ID_MU_PLUS = -13;
  129. const int ID_MU_MINUS = +13;
  130. const int ID_J_PSI = +443;
  131. const int ID_RHO_ZERO = +113;
  132. const int ID_K_ONE_PLUS = +10323; // K1(1270)+
  133. const int ID_K_ONE_PLUS_1400 = +20323; // K1(1400)+
  134. const int ID_K_ONE_PLUS_1410 = +100323; // K1(1410)+
  135. const int ID_K_ONE_ZERO = 10313; // K0(1270)+
  136. const int ID_ELECTRON = -11;
  137. //////////////////////////////////
  138. // Angular correction //
  139. //////////////////////////////////
  140. //Modify this after being done with scannig the corrections
  141. const bool IS_PHI_EVEN = true;
  142. const int ORDER_COSTHETAL = 3;
  143. const int ORDER_COSTHETAK = 6;
  144. const int ORDER_PHI = 1;
  145. const int ORDER_Q2 = 7;
  146. //////////////////////////
  147. // Reweighting //
  148. //////////////////////////
  149. //Descides at what 1/weight you reject events
  150. //Large weights result in large errorbars and can be a source of fluctuations
  151. const double EFF_CUTOFF = 0.01;
  152. //////////////////////////////////
  153. // Idk why, but here are pies //
  154. //////////////////////////////////
  155. const double M_4_PI = 1.2732395447351626861510701069801; // 4/Pi
  156. const double M_SQRTPI = 1.7724538509055160272981674833411; // sqrt(Pi)
  157. const double M_SQRT2PI = 2.5066282746310005024157652848111; // sqrt(2Pi)
  158. const double M_SQRT_PI_2= 1.2533141373155002512078826424055; // sqrt(Pi/2)
  159. const double M_SQRT_2_PI= 0.79788456080286535587989211986876; // sqrt(2/Pi)
  160. const double M_1_SQRTPI = 0.56418958354775628694807945156077; // 1/sqrt(Pi)
  161. const double m_2_SQRTPI = 1.1283791670955125738961589031216; // 2/sqrt(Pi)
  162. //M_2_SQRTPI is defined in math.h, see https://stackoverflow.com/questions/52796736/why-does-c-define-m-2-sqrtpi-constant-in-math-h
  163. const double M_SQRT_2PI = 0.39894228040143267793994605993438; // 1/sqrt(2Pi)
  164. const double M_SQRT_2 = 0.70710678118654752440084436210485; // sqrt(1/2)
  165. const double M_2PI = 6.2831853071795864769252867665590; // 2Pi
  166. const double M_4PI = 12.5663706143591729538505735331180; //4Pi
  167. //////////////////////////
  168. // Fit parameters //
  169. //////////////////////////
  170. //Set default values for most parameters
  171. //These values can be set individually, but it is good to have some default starting points
  172. //Check the definitions in bu2kstarmumu_parameters!
  173. const double PAR_ANG_RANGE = 1.0; //Default range for all angular observables
  174. const double PAR_SIGMA = 30.0; //[MeV]
  175. const double PAR_SIGMA_LOW = 25.0; //[MeV]
  176. const double PAR_SIGMA_HIGH = 50.0; //[MeV]
  177. const double PAR_TAU = 100.0;
  178. const double PAR_TAU_SCALE = 100.0; //Tau range is then par_tau/scale to par_tau*scale
  179. const double PAR_LAMBDA = -0.0001;
  180. const double PAR_LAMBDA_SCALE = 100.0; //Lambda range is then par_lambda*scale to par_lambda/scale
  181. const double PAR_NTRESHOLD = 1.5;
  182. const double PAR_KSTAR_WIDTH = 50.0; //[MeV]
  183. const double PAR_K1_WIDTH = 270.0; //[MeV]
  184. const double PAR_N_SIG = 150.0;
  185. const double PAR_N_BKG = 500.0; //f_sig is init as PAR_N_SIG/(PAR_N_SIG+PAR_N_BKG)
  186. //If you want to have only 1 exponential in bkg, set to false
  187. const double FIX_FM = true;
  188. const double DOUBLE_CB = true; //Just always use double CB, it is not like anyone is going to switch this halfway through the code
  189. //This string contains parameters that are varied when fitting bkg
  190. //TODO: optimize at some point
  191. std::vector<std::string> PAR_BKG_STRING(int folding, int nCtl, int nCtk);
  192. //Init values of said parameters
  193. //CAREFUL!!!! HAS TO BE THE SAME AS PAR_BKG_STRING!!!!
  194. std::vector<double> init_bkg(int folding, int nCtl, int nCtk);
  195. //////////////////////////////////
  196. // Main Fit Parameters //
  197. //////////////////////////////////
  198. //Number of angular terms: 12 for P wave, 6 for S wave
  199. const int NTERMS_P = 12;
  200. const int NTERMS_S = 6;
  201. const int NTERMS = NTERMS_S + NTERMS_P; //If no s Wave ever, one can also set it to 12 and save some memory
  202. //Fraction of events in each subset
  203. std::vector<std::vector<double> > fracs(int nBins);
  204. //Init default parameters
  205. std::vector<double> init_n_signal(int nBins);
  206. std::vector<double> init_n_bckgnd(int nBins);
  207. std::vector<double> init_f_lambda(int nBins);
  208. std::vector<double> get_f_subset(int nPDFs);
  209. //Used in EventNumbers
  210. const std::vector<std::vector<double> > sig_unblinded = { //Set only for 8 bins and 4 pdfs //TODO
  211. {5.86168, 13.9418, 54.4478, 27.3012},
  212. {2.36522, 1.09800, 31.7908, 13.7227},
  213. {8.99630, 6.53635, 14.4187, 12.2178},
  214. {14.0240, 8.82742, 62.4731, 23.5189},
  215. {5.11878, 7.85420, 59.2977, 32.3194},
  216. {17.7802, 12.8009, 39.0769, 40.8969},
  217. {19.8873, 12.7440, 81.8400, 29.7622},
  218. {3.73514, 7.56100, 32.8754, 31.5777}
  219. };
  220. const std::vector<std::vector<double> > bkg_unblinded = { //Set only for 8 bins and 4 pdfs //TODO
  221. {18.6849, 10.7306, 130.508, 26.1523},
  222. {28.8699, 11.4018, 152.795, 26.1676},
  223. {36.0865, 7.24722, 196.480, 35.0536},
  224. {39.2519, 22.7192, 163.944, 61.0158},
  225. {65.1688, 19.2037, 165.299, 48.0148},
  226. {19.5884, 16.5293, 88.6190, 46.0676},
  227. {17.2658, 14.1666, 42.6978, 34.5553},
  228. {17.6887, 20.2719, 41.7393, 26.3643}
  229. };
  230. std::vector<std::vector<double>> init_angular_params(int nBins, bool NP, bool isReference);
  231. std::vector<std::vector<double>> init_angular_params_MC(int nBins);
  232. std::vector<std::vector<double>> init_angular_params_zeros(int nBins);
  233. std::vector<std::vector<double>> init_mass_params_MC(int nBins, int nPDF);
  234. //Jpsi results from B+->K*(Kspi+)mumu
  235. std::vector<double> init_angular_params_RefFromDavid();
  236. //obtain parameter ranges and stepsize for (most) parameters
  237. double GetParamStepsize(std::string);
  238. std::vector<double> GetParamRange(std::string);
  239. #endif // CONSTANTS_HH