MINT2
TimePdfMaster.h
Go to the documentation of this file.
1 #ifndef TIMEPDFMASTER_HH
2 #define TIMEPDFMASTER_HH
3 // author: Philippe d'Argent
4 
5 #include <complex>
6 #include <vector>
7 #include <iostream>
8 
9 #include <TH1D.h>
10 #include <TCanvas.h>
11 #include <TRandom3.h>
12 
15 #include "Mint/DalitzEvent.h"
16 #include "Mint/FitParRef.h"
17 #include "Mint/FitParDependent.h"
18 #include "Mint/IFitParRegister.h"
19 //#include "Mint/CachedByEvent.h"
20 
21 #include "RooConstVar.h"
22 #include "RooAbsReal.h"
23 #include "RooUniform.h"
24 #include "RooRealVar.h"
25 #include "RooRealConstant.h"
26 #include "RooCategory.h"
27 #include "RooDataHist.h"
28 #include "RooHistPdf.h"
29 #include "RooBDecay.h"
30 #include "RooEffProd.h"
31 #include "RooProdPdf.h"
32 #include "RooProduct.h"
33 #include "RooGaussModel.h"
34 #include "RooMCStudy.h"
35 
37 #include "Mint/RooCubicSplineFun.h"
38 #include "Mint/RooCubicSplinePdf.h"
39 #include "Mint/DecRateCoeff_Bd.h"
40 #include "Mint/TimePdfIntegrator.h"
41 
42 
43 enum basisType {
45  , sinBasis=13, cosBasis=23
46  , sinhBasis=63, coshBasis=53 };
47 
48 using namespace std;
49 using namespace RooFit ;
50 using namespace MINT;
51 
53 {
54  protected:
55 
56  // Fit parameters
60 
65 
76 
84 
92 
95 
97  RooRealVar* _r_t;
98  RooRealVar* _r_dt;
99  RooRealVar* _r_dt_scaled;
100  RooCategory* _r_q_OS;
101  RooRealVar* _r_eta_OS;
102  RooCategory* _r_q_SS;
103  RooRealVar* _r_eta_SS;
104  RooCategory* _r_f;
105  RooCategory* _r_run;
106  RooCategory* _r_trigger;
107 
108  RooRealVar* _r_tau;
109  RooRealVar* _r_dGamma;
110  RooRealVar* _r_dm;
111 
112  RooRealVar* _r_scale_mean_dt;
113  RooRealVar* _r_offset_sigma_dt;
114  RooRealVar* _r_scale_sigma_dt;
115  RooRealVar* _r_scale_sigma_2_dt;
116 
117  RooRealVar* _r_c0;
118  RooRealVar* _r_c1;
119  RooRealVar* _r_c2;
120  RooRealVar* _r_c3;
121  RooRealVar* _r_c4;
122  RooRealVar* _r_c5;
123  RooRealVar* _r_c6;
124  RooRealVar* _r_c7;
125  RooRealVar* _r_c8;
126  RooRealVar* _r_c9;
127  RooFormulaVar* _coeff_last;
128 
129  RooRealVar* _r_p0_os;
130  RooRealVar* _r_p1_os;
131  RooRealVar* _r_delta_p0_os;
132  RooRealVar* _r_delta_p1_os;
133  RooRealVar* _r_avg_eta_os;
134  RooRealVar* _r_tageff_os;
135  RooRealVar* _r_tageff_asym_os;
136  RooRealVar* _r_p0_ss;
137  RooRealVar* _r_p1_ss;
138  RooRealVar* _r_delta_p0_ss;
139  RooRealVar* _r_delta_p1_ss;
140  RooRealVar* _r_avg_eta_ss;
141  RooRealVar* _r_tageff_ss;
142  RooRealVar* _r_tageff_asym_ss;
143 
144  RooRealVar* _r_production_asym;
145  RooRealVar* _r_detection_asym;
146 
147  // Acceptance function
149  RooProduct* _splinePdf;
151 
152  // CP coefficients
153  RooRealVar* _r_norm;
154  RooRealVar* _r_norm_bar;
155  RooRealVar* _r_C;
156  RooRealVar* _r_C_bar;
157  RooRealVar* _r_D;
158  RooRealVar* _r_D_bar;
159  RooRealVar* _r_S;
160  RooRealVar* _r_S_bar;
161 
162  // Decay rate coefficients
167 
168  // Time pdf integrators
173 
174  // Marginal pdfs
176  TFile* _f_pdfs;
177 
178  TH1D* _h_dt;
179  RooDataHist* _r_h_dt;
180  RooAbsPdf* _pdf_sigma_t;
181 
182  TH1D* _h_q_f;
183  TH1D* _h_q_OS;
184  TH1D* _h_q_SS;
185 
186  RooAbsPdf* _pdf_eta_OS;
187  TH1D* _h_eta_OS;
188  RooDataHist* _r_h_eta_OS;
189 
190  RooAbsPdf* _pdf_eta_SS;
191  TH1D* _h_eta_SS;
192  RooDataHist* _r_h_eta_SS;
193 
194  // Limits
199 
200  //
201  RooBDecay* _samplingPdf_t;
202  RooBDecay* _fitPdf_t;
203  RooGaussModel* _resmodel;
204  RooEffProd* _samplingPdf_t_eff;
205  RooProdPdf* _samplingPdf;
206  RooProdPdf* _fitPdf;
207  RooDataSet* _protoData;
208  RooMCStudy* _sampleGen;
209 
210  public:
212  ,const MINT::FitParameter& offset_sigma_dt, const MINT::FitParameter& scale_mean_dt, const MINT::FitParameter& scale_sigma_dt, const MINT::FitParameter& scale_sigma_2_dt
213  ,const MINT::FitParameter& c0, const MINT::FitParameter& c1, const MINT::FitParameter& c2
214  ,const MINT::FitParameter& c3, const MINT::FitParameter& c4, const MINT::FitParameter& c5
215  ,const MINT::FitParameter& c6, const MINT::FitParameter& c7, const MINT::FitParameter& c8
216  ,const MINT::FitParameter& c9,
217  const MINT::FitParameter& p0_os, const MINT::FitParameter& p1_os, const MINT::FitParameter& delta_p0_os, const MINT::FitParameter& delta_p1_os,
218  const MINT::FitParameter& avg_eta_os, const MINT::FitParameter& tageff_os, const MINT::FitParameter& tageff_asym_os,
219  const MINT::FitParameter& p0_ss, const MINT::FitParameter& p1_ss, const MINT::FitParameter& delta_p0_ss, const MINT::FitParameter& delta_p1_ss,
220  const MINT::FitParameter& avg_eta_ss, const MINT::FitParameter& tageff_ss, const MINT::FitParameter& tageff_asym_ss,
221  const MINT::FitParameter& production_asym, const MINT::FitParameter& detection_asym, string marginalPdfsPrefix ):
222  _Gamma(Gamma),
223  _dGamma(dGamma),
224  _dm(dm),
225  _offset_sigma_dt(offset_sigma_dt),
226  _scale_mean_dt(scale_mean_dt),
227  _scale_sigma_dt(scale_sigma_dt),
228  _scale_sigma_2_dt(scale_sigma_2_dt),
229  _c0(c0),
230  _c1(c1),
231  _c2(c2),
232  _c3(c3),
233  _c4(c4),
234  _c5(c5),
235  _c6(c6),
236  _c7(c7),
237  _c8(c8),
238  _c9(c9),
239  _p0_os(p0_os),
240  _p1_os(p1_os),
241  _delta_p0_os(delta_p0_os),
242  _delta_p1_os(delta_p1_os),
243  _avg_eta_os(avg_eta_os),
244  _tageff_os(tageff_os),
245  _tageff_asym_os(tageff_asym_os),
246  _p0_ss(p0_ss),
247  _p1_ss(p1_ss),
248  _delta_p0_ss(delta_p0_ss),
249  _delta_p1_ss(delta_p1_ss),
250  _avg_eta_ss(avg_eta_ss),
251  _tageff_ss(tageff_ss),
252  _tageff_asym_ss(tageff_asym_ss),
253  _production_asym(production_asym),
254  _detection_asym(detection_asym),
255  _marginalPdfsPrefix(marginalPdfsPrefix),
256  _min_TAU("min_TAU", 0.4),
257  _max_TAU("max_TAU", 10.),
258  _min_TAUERR("min_TAUERR", 0.),
259  _max_TAUERR("max_TAUERR", 0.1)
260  {
262 
263  // Observables
264  _r_t = new RooRealVar("t", "t", _min_TAU, _max_TAU);
265  _r_dt = new RooRealVar("dt", "dt",_min_TAUERR,_max_TAUERR);
266  _r_f = new RooCategory("qf", "qf");
267  _r_f->defineType("h+", +1);
268  _r_f->defineType("h-", -1);
269  _r_f->setRange("Range_p","h+");
270  _r_f->setRange("Range_m","h-");
271  _r_q_OS = new RooCategory("q_OS", "q_OS");
272  _r_q_OS->defineType("B+", +1);
273  _r_q_OS->defineType("B-", -1) ;
274  _r_q_OS->defineType("untagged", 0);
275  _r_eta_OS = new RooRealVar("eta_OS", "eta_OS",0.,0.5);
276  _r_q_SS = new RooCategory("q_SS", "q_SS");
277  _r_q_SS->defineType("B+", +1);
278  _r_q_SS->defineType("B-", -1) ;
279  _r_q_SS->defineType("untagged", 0);
280  _r_eta_SS = new RooRealVar("eta_SS", "eta_SS",0.,0.5);
281  _r_run = new RooCategory("run", "run");
282  _r_run->defineType("Run1", 1);
283  _r_run->defineType("Run2", 2);
284  _r_trigger = new RooCategory("trigger", "trigger");
285  _r_trigger->defineType("t0", 0);
286  _r_trigger->defineType("t1", 1);
287 
288  // Fit parameters
289  _r_tau = new RooRealVar("tau", "tau",1./_Gamma);
290  _r_dGamma = new RooRealVar("dGamma", "dGamma",_dGamma);
291  _r_dm = new RooRealVar("dm", "dm",_dm);
292 
293  _r_scale_mean_dt = new RooRealVar("scale_mean_dt", "scale_mean_dt", _scale_mean_dt);
294  _r_offset_sigma_dt = new RooRealVar("offset_sigma_dt", "offset_sigma_dt", _offset_sigma_dt);
295  _r_scale_sigma_dt = new RooRealVar("scale_sigma_dt", "scale_sigma_dt", _scale_sigma_dt);
296  _r_scale_sigma_2_dt = new RooRealVar("scale_sigma_2_dt", "scale_sigma_2_dt", _scale_sigma_2_dt);
297 
298  _r_c0 = new RooRealVar("coeff_0", "coeff_0",_c0);
299  _r_c1 = new RooRealVar("coeff_1", "coeff_1",_c1);
300  _r_c2 = new RooRealVar("coeff_2", "coeff_2",_c2);
301  _r_c3 = new RooRealVar("coeff_3", "coeff_3",_c3);
302  _r_c4 = new RooRealVar("coeff_4", "coeff_4",_c4);
303  _r_c5 = new RooRealVar("coeff_5", "coeff_5",_c5);
304  _r_c6 = new RooRealVar("coeff_6", "coeff_6",_c6);
305  _r_c7 = new RooRealVar("coeff_7", "coeff_7",_c7);
306  _r_c8 = new RooRealVar("coeff_8", "coeff_8",_c8);
307  _r_c9 = new RooRealVar("coeff_9", "coeff_9",_c9);
308 
309  _r_p0_os = new RooRealVar("p0_os", "p0_os",_p0_os);
310  _r_p1_os = new RooRealVar("p1_os", "p1_os",_p1_os);
311  _r_delta_p0_os = new RooRealVar("delta_p0_os", "delta_p0_os",_delta_p0_os);
312  _r_delta_p1_os = new RooRealVar("delta_p1_os", "delta_p1_os",_delta_p1_os);
313  _r_avg_eta_os = new RooRealVar("avg_eta_os", "avg_eta_os",_avg_eta_os);
314  _r_tageff_os = new RooRealVar("tageff_os", "tageff_os",_tageff_os);
315  _r_tageff_asym_os = new RooRealVar("tageff_asym_os", "tageff_asym_os",_tageff_asym_os);
316  _r_p0_ss = new RooRealVar("p0_ss", "p0_ss",_p0_ss);
317  _r_p1_ss = new RooRealVar("p1_ss", "p1_ss",_p1_ss);
318  _r_delta_p0_ss = new RooRealVar("delta_p0_ss", "delta_p0_ss",_delta_p0_ss);
319  _r_delta_p1_ss = new RooRealVar("delta_p1_ss", "delta_p1_ss",_delta_p1_ss);
320  _r_avg_eta_ss = new RooRealVar("avg_eta_ss", "avg_eta_ss",_avg_eta_ss);
321  _r_tageff_ss = new RooRealVar("tageff_ss", "tageff_ss",_tageff_ss);
322  _r_tageff_asym_ss= new RooRealVar("tageff_asym_ss", "tageff_asym_ss",_tageff_asym_ss);
323 
324  _r_production_asym = new RooRealVar("production_asym", "production_asym",_production_asym);
325  _r_detection_asym = new RooRealVar("detection_asym", "detection_asym",_detection_asym);
326 
328  vector<RooRealVar*> v_coeff;
329  v_coeff.push_back(_r_c0);
330  v_coeff.push_back(_r_c1);
331  v_coeff.push_back(_r_c2);
332  v_coeff.push_back(_r_c3);
333  v_coeff.push_back(_r_c4);
334  v_coeff.push_back(_r_c5);
335  v_coeff.push_back(_r_c6);
336  v_coeff.push_back(_r_c7);
337  v_coeff.push_back(_r_c8);
338  v_coeff.push_back(_r_c9);
339 
340  //SPLINE KNOTS
341  NamedParameter<double> knot_positions("knot_positions", 0.5, 1., 1.5, 2., 3., 6., 9.5);
342  vector<double> myBinning = knot_positions.getVector();
343 
344  RooArgList tacc_list;
345  for(int i= 0; i<= myBinning.size(); i++){
346  tacc_list.add(*v_coeff[i]);
347  }
348 
349  _coeff_last = new RooFormulaVar(("coeff_"+anythingToString((int)myBinning.size()+1)).c_str(),("coeff_"+anythingToString((int)myBinning.size()+1)).c_str(), "@0 + ((@0-@1)/(@2-@3)) * (@4 - @2)", RooArgList(RooRealConstant::value(1.0), *tacc_list.find(("coeff_"+anythingToString((int)myBinning.size()-1)).c_str()) , RooRealConstant::value(myBinning[myBinning.size()-1]), RooRealConstant::value(myBinning[myBinning.size()-2]), RooRealConstant::value(_r_t->getMax()) ));
350 
351  tacc_list.add(*_coeff_last);
352 
353  // Cubic spline function
354  _spline = new RooCubicSplineFun("spline", "spline", *_r_t, myBinning, tacc_list);
355  //_splinePdf = new RooCubicSplinePdf("splinePdf", "splinePdf", *_r_t, myBinning, tacc_list);
356  _splinePdf = new RooProduct("splinePdf", "splinePdf", RooArgList(*_spline,RooRealConstant::value(0.1)));
357 
358  //_efficiency = new RooGaussEfficiencyModel("resmodel", "resmodel", *_r_t, *_spline, RooRealConstant::value(0.), *_r_dt, *_r_scale_mean_dt, *_r_scale_sigma_dt );
359  _r_dt_scaled = (RooRealVar*) new RooFormulaVar( "r_dt_scaled","r_dt_scaled", "@0+@1*@2+@3*@2*@2",RooArgList(*_r_offset_sigma_dt,*_r_scale_sigma_dt,*_r_dt,*_r_scale_sigma_2_dt));
360  _efficiency = new RooGaussEfficiencyModel("resmodel", "resmodel", *_r_t, *_spline, RooRealConstant::value(0.), *_r_dt_scaled, *_r_scale_mean_dt, RooRealConstant::value(1.) );
361 
362  // CP coefficients
363  _r_norm = new RooRealVar("norm", "norm",1);
364  _r_norm_bar = new RooRealVar("norm_bar", "norm_bar",1);
365  _r_C = new RooRealVar("C", "C",1);
366  _r_C_bar = new RooRealVar("Cbar", "Cbar",-1);
367  //_r_C_bar= (RooRealVar*) new RooFormulaVar("Cbar","-1. * @0",RooArgList(*_r_C));
368  _r_D= new RooRealVar("D", "D",0);
369  _r_D_bar= new RooRealVar("Dbar", "Dbar",0);
370  _r_S= new RooRealVar("S", "S",0);
371  _r_S_bar= new RooRealVar("Sbar", "Sbar",0);
372 
374  _cosh_coeff = new DecRateCoeff_Bd("cosh_coeff",
375  "cosh_coeff",
377  *_r_f,
378  *_r_norm,
379  *_r_norm_bar,
380  *_r_q_OS,
381  *_r_eta_OS,
382  *_r_p0_os,
383  *_r_p1_os,
384  *_r_delta_p0_os,
385  *_r_delta_p1_os,
386  *_r_avg_eta_os,
387  *_r_tageff_os,
388  *_r_tageff_asym_os,
389  *_r_q_SS,
390  *_r_eta_SS,
391  *_r_p0_ss,
392  *_r_p1_ss,
393  *_r_delta_p0_ss,
394  *_r_delta_p1_ss,
395  *_r_avg_eta_ss,
396  *_r_tageff_ss,
397  *_r_tageff_asym_ss,
398  *_r_production_asym,
399  *_r_detection_asym );
400 
401  _cos_coeff = new DecRateCoeff_Bd("cos_coeff",
402  "cos_coeff",
404  *_r_f,
405  *_r_C,
406  *_r_C_bar,
407  *_r_q_OS,
408  *_r_eta_OS,
409  *_r_p0_os,
410  *_r_p1_os,
411  *_r_delta_p0_os,
412  *_r_delta_p1_os,
413  *_r_avg_eta_os,
414  *_r_tageff_os,
415  *_r_tageff_asym_os,
416  *_r_q_SS,
417  *_r_eta_SS,
418  *_r_p0_ss,
419  *_r_p1_ss,
420  *_r_delta_p0_ss,
421  *_r_delta_p1_ss,
422  *_r_avg_eta_ss,
423  *_r_tageff_ss,
424  *_r_tageff_asym_ss,
425  *_r_production_asym,
426  *_r_detection_asym );
427 
428  _sinh_coeff = new DecRateCoeff_Bd("sinh_coeff",
429  "sinh_coeff",
431  *_r_f,
432  *_r_D,
433  *_r_D_bar,
434  *_r_q_OS,
435  *_r_eta_OS,
436  *_r_p0_os,
437  *_r_p1_os,
438  *_r_delta_p0_os,
439  *_r_delta_p1_os,
440  *_r_avg_eta_os,
441  *_r_tageff_os,
442  *_r_tageff_asym_os,
443  *_r_q_SS,
444  *_r_eta_SS,
445  *_r_p0_ss,
446  *_r_p1_ss,
447  *_r_delta_p0_ss,
448  *_r_delta_p1_ss,
449  *_r_avg_eta_ss,
450  *_r_tageff_ss,
451  *_r_tageff_asym_ss,
452  *_r_production_asym,
453  *_r_detection_asym );
454 
455  _sin_coeff = new DecRateCoeff_Bd("sin_coeff",
456  "sin_coeff",
458  *_r_f,
459  *_r_S,
460  *_r_S_bar,
461  *_r_q_OS,
462  *_r_eta_OS,
463  *_r_p0_os,
464  *_r_p1_os,
465  *_r_delta_p0_os,
466  *_r_delta_p1_os,
467  *_r_avg_eta_os,
468  *_r_tageff_os,
469  *_r_tageff_asym_os,
470  *_r_q_SS,
471  *_r_eta_SS,
472  *_r_p0_ss,
473  *_r_p1_ss,
474  *_r_delta_p0_ss,
475  *_r_delta_p1_ss,
476  *_r_avg_eta_ss,
477  *_r_tageff_ss,
478  *_r_tageff_asym_ss,
479  *_r_production_asym,
480  *_r_detection_asym );
481 
483  _cosh_term = new TimePdfIntegrator(coshBasis,_efficiency,
484  _Gamma,_dGamma,_dm,
485  _offset_sigma_dt, _scale_mean_dt, _scale_sigma_dt, _scale_sigma_2_dt
486  ,_c0, _c1, _c2
487  ,_c3, _c4, _c5
488  ,_c6, _c7, _c8
489  ,_c9);
490  _cos_term = new TimePdfIntegrator(cosBasis,_efficiency,
491  _Gamma,_dGamma,_dm,
492  _offset_sigma_dt, _scale_mean_dt, _scale_sigma_dt, _scale_sigma_2_dt
493  ,_c0, _c1, _c2
494  ,_c3, _c4, _c5
495  ,_c6, _c7, _c8
496  ,_c9);
497  _sinh_term = new TimePdfIntegrator(sinhBasis,_efficiency,
498  _Gamma,_dGamma,_dm,
499  _offset_sigma_dt, _scale_mean_dt, _scale_sigma_dt, _scale_sigma_2_dt
500  ,_c0, _c1, _c2
501  ,_c3, _c4, _c5
502  ,_c6, _c7, _c8
503  ,_c9);
504  _sin_term = new TimePdfIntegrator(sinBasis,_efficiency,
505  _Gamma,_dGamma,_dm,
506  _offset_sigma_dt, _scale_mean_dt, _scale_sigma_dt, _scale_sigma_2_dt
507  ,_c0, _c1, _c2
508  ,_c3, _c4, _c5
509  ,_c6, _c7, _c8
510  ,_c9);
511 
513  cout << (string)_marginalPdfsPrefix << endl;
514  if((string)_marginalPdfsPrefix == "Uniform"){
515  _pdf_sigma_t = (RooAbsPdf*) (new RooUniform("pdf_sigma_t","pdf_sigma_t",*_r_dt));
516  _pdf_eta_OS = (RooAbsPdf*) (new RooUniform("pdf_eta_OS","pdf_eta_OS",*_r_eta_OS));
517  _pdf_eta_SS = (RooAbsPdf*) (new RooUniform("pdf_eta_SS","pdf_eta_SS",*_r_eta_SS));
518  }
519  else {
520  _f_pdfs = new TFile("Mistag_pdfs.root","OPEN");
521 
522  _h_dt = new TH1D( *((TH1D*) _f_pdfs->Get(("h_dt_norm_"+(string)_marginalPdfsPrefix).c_str())));
523  // RooHistPdf doesn't like negative or 0 bins (can happen due to sweights), set them to a small positive number
524  _h_dt->Smooth();
525  for(int i= 1 ; i<=_h_dt->GetNbinsX(); i++){
526  if(_h_dt->GetBinContent(i) <= 0.)_h_dt->SetBinContent(i,0.000000001*_h_dt->GetMaximum());
527  }
528  _r_h_dt = new RooDataHist("r_h_dt","r_h_dt",*_r_dt,_h_dt);
529  _pdf_sigma_t = (RooAbsPdf*) (new RooHistPdf("pdf_sigma_t","pdf_sigma_t",*_r_dt,*_r_h_dt));
530 
531  _h_eta_OS = new TH1D( *((TH1D*) _f_pdfs->Get(("h_w_OS_norm_"+(string)_marginalPdfsPrefix).c_str())));
532  _h_eta_OS->Smooth();
533  for(int i= 1 ; i<=_h_eta_OS->GetNbinsX(); i++){
534  if(_h_eta_OS->GetBinContent(i) <= 0.)_h_eta_OS->SetBinContent(i,0.000000001*_h_eta_OS->GetMaximum());
535  }
536  _r_h_eta_OS = new RooDataHist("r_eta_OS","r_eta_OS",*_r_eta_OS,_h_eta_OS);
537  _pdf_eta_OS = (RooAbsPdf*) (new RooHistPdf("pdf_eta_OS","pdf_eta_OS",*_r_eta_OS,*_r_h_eta_OS));
538 
539  _h_eta_SS = new TH1D( *((TH1D*) _f_pdfs->Get(("h_w_SS_norm_"+(string)_marginalPdfsPrefix).c_str())));
540  _h_eta_SS->Smooth();
541  for(int i= 1 ; i<=_h_eta_SS->GetNbinsX(); i++){
542  if(_h_eta_SS->GetBinContent(i) <= 0.)_h_eta_SS->SetBinContent(i,0.000000001*_h_eta_SS->GetMaximum());
543  }
544  _r_h_eta_SS = new RooDataHist("r_eta_SS","r_eta_SS",*_r_eta_SS,_h_eta_SS);
545  _pdf_eta_SS = (RooAbsPdf*) (new RooHistPdf("pdf_eta_SS","pdf_eta_SS",*_r_eta_SS,*_r_h_eta_SS));
546 
547 // _h_q_f = new TH1D( *((TH1D*) _f_pdfs->Get(("h_q_f_norm_"+(string)_marginalPdfsPrefix).c_str())));
548 // _h_q_OS = new TH1D( *((TH1D*) _f_pdfs->Get(("h_q_OS_norm_"+(string)_marginalPdfsPrefix).c_str())));
549 // _h_q_SS = new TH1D( *((TH1D*) _f_pdfs->Get(("h_q_SS_norm_"+(string)_marginalPdfsPrefix).c_str())));
550  }
551 
552  _resmodel = new RooGaussModel("resmodel", "resmodel", *_r_t, RooRealConstant::value(0.), *_r_dt_scaled);
553 
554  _samplingPdf_t = new RooBDecay(("samplingPdf_t"+(string)_marginalPdfsPrefix).c_str(), ("samplingPdf_t"+(string)_marginalPdfsPrefix).c_str(),
555  *_r_t,*_r_tau, *_r_dGamma,
556  *_cosh_coeff,*_sinh_coeff,*_cos_coeff,*_sin_coeff,
557  *_r_dm, *_resmodel, RooBDecay::SingleSided);
558 
559  _samplingPdf_t_eff = new RooEffProd(("samplingPdf_t_eff"+(string)_marginalPdfsPrefix).c_str(), ("samplingPdf_t_eff"+(string)_marginalPdfsPrefix).c_str(),
560  *_samplingPdf_t, *_splinePdf);
561 
562  _samplingPdf = new RooProdPdf(("samplingPdf"+(string)_marginalPdfsPrefix).c_str(),("samplingPdf"+(string)_marginalPdfsPrefix).c_str(),
563  RooArgSet(*_pdf_sigma_t,*_pdf_eta_OS,*_pdf_eta_SS),Conditional(RooArgSet(*_samplingPdf_t_eff),RooArgSet(*_r_t,*_r_f,*_r_q_OS,*_r_q_SS)));
564 
565 
566  _fitPdf_t = new RooBDecay(("fitPdf_t"+(string)_marginalPdfsPrefix).c_str(), ("fitPdf_t"+(string)_marginalPdfsPrefix).c_str(),
567  *_r_t,*_r_tau, *_r_dGamma,
568  *_cosh_coeff,*_sinh_coeff,*_cos_coeff,*_sin_coeff,
569  *_r_dm, *_efficiency, RooBDecay::SingleSided);
570 
571  _fitPdf = new RooProdPdf(("fitPdf"+(string)_marginalPdfsPrefix).c_str(),("fitPdf"+(string)_marginalPdfsPrefix).c_str(),
572  RooArgSet(*_pdf_sigma_t,*_pdf_eta_OS,*_pdf_eta_SS),Conditional(RooArgSet(*_fitPdf_t),RooArgSet(*_r_t,*_r_f,*_r_q_OS,*_r_q_SS)));
573 
574  _sampleGen = 0;
575  }
576 
577  RooDataSet* sampleEvents(int N = 10000){
578  if(_sampleGen == 0){
579  _protoData = new RooDataSet("protoData","protoData",RooArgSet(*_r_dt,*_r_eta_OS,*_r_eta_SS));
580  int N_proto = N > 100000 ? N : 100000;
581  for(int i = 0 ; i < N; i++){
582  _r_dt->setVal(_h_dt->GetRandom());
583  _r_eta_OS->setVal(_h_eta_OS->GetRandom());
584  _r_eta_SS->setVal(_h_eta_SS->GetRandom());
585  _protoData->add(RooArgSet(*_r_dt,*_r_eta_OS,*_r_eta_SS));
586  }
587  _sampleGen = new RooMCStudy(*_samplingPdf,RooArgSet(*_r_t,*_r_q_OS,*_r_q_SS,*_r_f),ProtoData(*_protoData,kFALSE,kTRUE));
588  }
589  _sampleGen->generate(1,N,kTRUE);
590  RooDataSet* data = (RooDataSet*)_sampleGen->genData(0);
591  return data;
592  }
593 
594  vector<double> getRandom_marginalVals(){
595  vector<double> vals;
596  vals.push_back(_h_dt->GetRandom());
597  vals.push_back(_h_eta_OS->GetRandom());
598  vals.push_back(_h_eta_SS->GetRandom());
599  return vals;
600  }
601 
602  void fillProtoData(double dt, int f, int q_OS, double eta_OS, int q_SS, double eta_SS){
603  _r_dt->setVal(dt);
604  _r_q_SS->setIndex(q_SS);
605  _r_q_OS->setIndex(q_OS);
606  _r_f->setIndex(f);
607  _r_eta_OS->setVal(eta_OS);
608  _r_eta_SS->setVal(eta_SS);
609  _protoData->add(RooArgSet(*_r_dt,*_r_f,*_r_q_OS,*_r_eta_OS,*_r_q_SS,*_r_eta_SS));
610  }
611 
613  setAllObservablesAndFitParameters(evt);
614  return _fitPdf->getVal(RooArgSet(*_r_t,*_r_dt,*_r_eta_OS,*_r_eta_SS,*_r_f,*_r_q_OS,*_r_q_SS));
615  }
616 
618  return _cosh_coeff->evaluate() * _cosh_term->getVal(evt).real();
619  }
620 
622  return _cosh_coeff->analyticalIntegral(2) * _cosh_term->getVal(evt).imag();
623  }
624 
626  return _sinh_coeff->evaluate() * _sinh_term->getVal(evt).real();
627  }
628 
630  return _sinh_coeff->analyticalIntegral(2) * _sinh_term->getVal(evt).imag();
631  }
632 
634  return _cos_coeff->evaluate() * _cos_term->getVal(evt).real();
635  }
636 
638  return _cos_coeff->analyticalIntegral(2) * _cos_term->getVal(evt).imag();
639  }
640 
642  return _sin_coeff->evaluate() * _sin_term->getVal(evt).real();
643  }
644 
646  return _sin_coeff->analyticalIntegral(2) * _sin_term->getVal(evt).imag();
647  }
648 
650  return _cosh_coeff->evaluate();
651  }
652 
654  return _cos_coeff->evaluate();
655  }
656 
658  return _sinh_coeff->evaluate();
659  }
660 
662  return _sin_coeff->evaluate();
663  }
664 
666  const int q_OS = (int)evt.getValueFromVector(3);
667  const int q_SS = (int)evt.getValueFromVector(5);
668 
669  /*
670  // check norm
671  TRandom3 r(0);
672  double sum1 = 0.;
673  double sum2 = 0.;
674  double sum3 = 0.;
675 
676  for (int i=0; i < 1000000; i++) {
677  _r_eta_OS->setVal(r.Uniform(0,0.5));
678  _r_eta_SS->setVal(r.Uniform(0,0.5));
679  _r_dt->setVal(r.Uniform(0,0.1));
680  sum1 += _pdf_eta_OS->getVal(RooArgSet(*_r_eta_OS));
681  sum2 += _pdf_eta_SS->getVal(RooArgSet(*_r_eta_SS));
682  sum3 += _pdf_sigma_t->getVal(RooArgSet(*_r_dt));
683  }
684  cout << "norm = " << 0.5 * sum1/1000000. << endl;
685  cout << "norm = " << 0.5 * sum2/1000000. << endl;
686  cout << "norm = " << 0.1 * sum3/1000000. << endl;
687  throw "";
688  */
689 
690  return _pdf_sigma_t->getVal(RooArgSet(*_r_dt))
691  * ( abs(q_OS) * _pdf_eta_OS->getVal(RooArgSet(*_r_eta_OS)) + ( 1. - abs(q_OS)) * 1./0.5 )
692  * ( abs(q_SS) * _pdf_eta_SS->getVal(RooArgSet(*_r_eta_SS)) + ( 1. - abs(q_SS)) * 1./0.5 );
693  }
694 
696  return _pdf_sigma_t->getVal(RooArgSet(*_r_dt)) * _pdf_eta_OS->getVal(RooArgSet(*_r_eta_OS)) * _pdf_eta_SS->getVal(RooArgSet(*_r_eta_SS));
697  }
698 
700  return _spline->getVal();
701  }
702 
703  double get_tau_Val(){
704  return (double) 1./_Gamma;
705  }
706 
707  double get_dm_Val(){
708  return (double)_dm;
709  }
710 
711  double get_dGamma_Val(){
712  return (double)_dGamma;
713  }
714 
715  std::pair<double, double> getCalibratedMistag_OS(IDalitzEvent& evt){
716  return _cosh_coeff->calibrate(evt.getValueFromVector(4), _avg_eta_os, _p0_os, _p1_os, _delta_p0_os, _delta_p1_os);
717  }
718 
719  std::pair<double, double> getCalibratedMistag_OS(double& eta_OS){
720  return _cosh_coeff->calibrate(eta_OS, _avg_eta_os, _p0_os, _p1_os, _delta_p0_os, _delta_p1_os);
721  }
722 
723  std::pair<double, double> getCalibratedMistag_OS(IDalitzEvent& evt,double& avg_eta_os,double& p0_os,double& p1_os,double& delta_p0_os,double& delta_p1_os ){
724  return _cosh_coeff->calibrate(evt.getValueFromVector(4), avg_eta_os, p0_os, p1_os, delta_p0_os, delta_p1_os);
725  }
726 
727  std::pair<double, double> getCalibratedMistag_SS(IDalitzEvent& evt){
728  return _cosh_coeff->calibrate(evt.getValueFromVector(6), _avg_eta_ss, _p0_ss, _p1_ss, _delta_p0_ss, _delta_p1_ss);
729  }
730 
731  std::pair<double, double> getCalibratedMistag_SS(IDalitzEvent& evt,double& avg_eta_ss,double& p0_ss,double& p1_ss,double& delta_p0_ss,double& delta_p1_ss ){
732  return _cosh_coeff->calibrate(evt.getValueFromVector(6), avg_eta_ss, p0_ss, p1_ss, delta_p0_ss, delta_p1_ss);
733  }
734 
735  std::pair<double, double> getCalibratedMistag(double eta,double avg_eta,double p0,double p1,double delta_p0,double delta_p1 ){
736  return _cosh_coeff->calibrate(eta, avg_eta, p0, p1, delta_p0, delta_p1);
737  }
738 
739  std::pair<double, double> getCalibratedMistag_SS(double& eta_SS){
740  return _cosh_coeff->calibrate(eta_SS, _avg_eta_ss, _p0_ss, _p1_ss, _delta_p0_ss, _delta_p1_ss);
741  }
742 
743  double getCalibratedResolution(double& dt){
744  return _offset_sigma_dt + _scale_sigma_dt * dt + _scale_sigma_2_dt * dt *dt;
745  }
746 
747  double getCalibratedResolution(double& dt,double& scale_sigma_dt,double& scale_sigma_2_dt){
748  return _offset_sigma_dt + scale_sigma_dt * dt + scale_sigma_2_dt * dt *dt;
749  }
750 
752  std::cout << "TimePDfIntegrator depends on these fitParameters:" << std::endl;
753  _cosh_term->listFitParDependencies(std::cout);
754  //std::cout << "TimePDfMaster depends on these fitParameters (sinh):" << std::endl;
755  //_sinh_term->listFitParDependencies(std::cout);
756  //std::cout << "" << std::endl;
757  }
758 
760  _r_tau->setVal(1./_Gamma);
761  _r_dGamma->setVal(_dGamma);
762  _r_dm->setVal(_dm);
763 
764  _r_scale_mean_dt->setVal(_scale_mean_dt);
765  _r_offset_sigma_dt->setVal(_offset_sigma_dt);
766  _r_scale_sigma_dt->setVal(_scale_sigma_dt);
767  _r_scale_sigma_2_dt->setVal(_scale_sigma_2_dt);
768  _r_c0->setVal(_c0);
769  _r_c1->setVal(_c1);
770  _r_c2->setVal(_c2);
771  _r_c3->setVal(_c3);
772  _r_c4->setVal(_c4);
773  _r_c5->setVal(_c5);
774  _r_c6->setVal(_c6);
775  _r_c7->setVal(_c7);
776  _r_c8->setVal(_c8);
777  _r_c9->setVal(_c9);
778 
779  _r_p0_os->setVal(_p0_os);
780  _r_p1_os->setVal(_p1_os);
781  _r_delta_p0_os->setVal(_delta_p0_os);
782  _r_delta_p1_os->setVal(_delta_p1_os);
783  _r_avg_eta_os->setVal(_avg_eta_os);
784  _r_tageff_os->setVal(_tageff_os);
785  _r_tageff_asym_os->setVal(_tageff_asym_os);
786  _r_p0_ss->setVal(_p0_ss);
787  _r_p1_ss->setVal(_p1_ss);
788  _r_delta_p0_ss->setVal(_delta_p0_ss);
789  _r_delta_p1_ss->setVal(_delta_p1_ss);
790  _r_avg_eta_ss->setVal(_avg_eta_ss);
791  _r_tageff_ss->setVal(_tageff_ss);
792  _r_tageff_asym_ss->setVal(_tageff_asym_ss);
793 
794  _r_production_asym->setVal(_production_asym);
795  _r_detection_asym->setVal(_detection_asym);
796  }
797 
799  const double t = (double) evt.getValueFromVector(0);
800  const double dt = (double) evt.getValueFromVector(1);
801  const int f = (int)evt.getValueFromVector(2);
802  const int q_OS = (int)evt.getValueFromVector(3);
803  const double eta_OS = (double) evt.getValueFromVector(4);
804  const int q_SS = (int)evt.getValueFromVector(5);
805  const double eta_SS = (double) evt.getValueFromVector(6);
806 
807  _r_t->setVal(t);
808  _r_dt->setVal(dt);
809  _r_f->setIndex(f);
810  _r_q_OS->setIndex(q_OS);
811  _r_eta_OS->setVal(eta_OS);
812  _r_q_SS->setIndex(q_SS);
813  _r_eta_SS->setVal(eta_SS);
814  }
815 
817  _r_t->setVal(1./_Gamma);
818  if((string)_marginalPdfsPrefix == "Uniform")_r_dt->setVal(1./_Gamma/100.);
819  else _r_dt->setVal(_h_dt->GetMean());
820  _r_f->setIndex((int)evt.getValueFromVector(2));
821  _r_q_OS->setIndex(0);
822  if((string)_marginalPdfsPrefix == "Uniform")_r_eta_OS->setVal(0.);
823  else _r_eta_OS->setVal(_h_eta_OS->GetMean());
824  _r_q_SS->setIndex(0);
825  if((string)_marginalPdfsPrefix == "Uniform")_r_eta_SS->setVal(0.);
826  else _r_eta_SS->setVal(_h_eta_SS->GetMean());
827  }
828 
829  void setCP_coeff(double norm, double norm_bar,double C,double C_bar,double D,double D_bar,double S,double S_bar ){
830  _r_norm->setVal(norm);
831  _r_norm_bar->setVal(norm_bar);
832  _r_C->setVal(C);
833  _r_C_bar->setVal(C_bar);
834  _r_D->setVal(D);
835  _r_D_bar->setVal(D_bar);
836  _r_S->setVal(S);
837  _r_S_bar->setVal(S_bar);
838  }
839 
840  vector<double> getCP_coeff(){
841 
842  vector<double> vals;
843  vals.push_back(_r_norm->getVal());
844  vals.push_back(_r_norm_bar->getVal());
845  vals.push_back(_r_C->getVal());
846  vals.push_back(_r_C_bar->getVal());
847  vals.push_back(_r_D->getVal());
848  vals.push_back(_r_D_bar->getVal());
849  vals.push_back(_r_S->getVal());
850  vals.push_back(_r_S_bar->getVal());
851 
852  return vals;
853  }
854 
856  setAllObservables(evt);
857  setAllFitParameters();
858  }
859 
860  TH1D* plotSpline(){
861  setAllFitParameters();
862  TH1D *h_spline = new TH1D("", ";t (ps);Efficiency (a.u.)", 100, _min_TAU, _max_TAU);
863  for (int i = 1; i<=h_spline->GetNbinsX(); i++) {
864  _r_t->setVal(h_spline->GetXaxis()->GetBinCenter(i));
865  h_spline->SetBinContent(i,_spline->getVal());
866  }
867  TCanvas* c = new TCanvas();
868  h_spline->SetLineColor(kRed);
869  h_spline->SetLineWidth(5);
870 
871  h_spline->SetMinimum(0.);
872  h_spline->SetMaximum(1.2);
873 
874  h_spline->Draw("histc");
875  c->Print("spline.eps");
876  return h_spline;
877  }
878 
879  virtual ~TimePdfMaster(){
880  // Plot acceptance
881  TH1D* h_spline = plotSpline();
882  TCanvas* c = new TCanvas();
883  h_spline->SetLineColor(kRed);
884  h_spline->Draw("histc");
885  c->Print("spline.eps");
886  //c->Print("spline.pdf");
887  }
888 
889 };
890 
891 #endif
892 //
double get_cosh_coeff_Val(IDalitzEvent &evt)
RooRealVar * _r_p1_os
RooRealVar * _r_eta_OS
double get_spline_Val(IDalitzEvent &evt)
RooRealVar * _r_scale_mean_dt
RooRealVar * _r_avg_eta_os
RooCategory * _r_trigger
RooRealVar * _r_avg_eta_ss
const MINT::FitParameter & _tageff_asym_ss
Definition: TimePdfMaster.h:91
virtual std::complex< double > getVal(IDalitzEvent &evt)
void setAllObservables(IDalitzEvent &evt)
vector< double > getRandom_marginalVals()
RooRealVar * _r_tageff_os
RooMCStudy * _sampleGen
std::pair< double, double > getCalibratedMistag_SS(IDalitzEvent &evt)
double get_tau_Val()
const MINT::FitParameter & _c8
Definition: TimePdfMaster.h:74
double get_marginalPdfs_Val(IDalitzEvent &evt)
RooRealVar * _r_c9
RooFormulaVar * _coeff_last
const MINT::FitParameter & _detection_asym
Definition: TimePdfMaster.h:94
RooRealVar * _r_delta_p0_os
double get_dm_Val()
const MINT::FitParameter & _tageff_asym_os
Definition: TimePdfMaster.h:83
const MINT::FitParameter & _avg_eta_ss
Definition: TimePdfMaster.h:89
RooRealVar * _r_c6
const MINT::FitParameter & _p1_ss
Definition: TimePdfMaster.h:86
RooRealVar * _r_eta_SS
RooCategory * _r_run
RooRealVar * _r_c0
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
const MINT::FitParameter & _dm
Definition: TimePdfMaster.h:59
string _marginalPdfsPrefix
const MINT::FitParameter & _delta_p1_ss
Definition: TimePdfMaster.h:88
RooRealVar * _r_D
NamedParameter< double > _max_TAU
const MINT::FitParameter & _dGamma
Definition: TimePdfMaster.h:58
RooDataHist * _r_h_eta_OS
RooGaussModel * _resmodel
double get_cosh_term_Integral(IDalitzEvent &evt)
void setCP_coeff(double norm, double norm_bar, double C, double C_bar, double D, double D_bar, double S, double S_bar)
Double_t evaluate() const
const MINT::FitParameter & _c5
Definition: TimePdfMaster.h:71
TimePdfIntegrator * _sinh_term
std::pair< double, double > getCalibratedMistag_OS(IDalitzEvent &evt, double &avg_eta_os, double &p0_os, double &p1_os, double &delta_p0_os, double &delta_p1_os)
TimePdfMaster(const MINT::FitParameter &Gamma, const MINT::FitParameter &dGamma, const MINT::FitParameter &dm, const MINT::FitParameter &offset_sigma_dt, const MINT::FitParameter &scale_mean_dt, const MINT::FitParameter &scale_sigma_dt, const MINT::FitParameter &scale_sigma_2_dt, const MINT::FitParameter &c0, const MINT::FitParameter &c1, const MINT::FitParameter &c2, const MINT::FitParameter &c3, const MINT::FitParameter &c4, const MINT::FitParameter &c5, const MINT::FitParameter &c6, const MINT::FitParameter &c7, const MINT::FitParameter &c8, const MINT::FitParameter &c9, const MINT::FitParameter &p0_os, const MINT::FitParameter &p1_os, const MINT::FitParameter &delta_p0_os, const MINT::FitParameter &delta_p1_os, const MINT::FitParameter &avg_eta_os, const MINT::FitParameter &tageff_os, const MINT::FitParameter &tageff_asym_os, const MINT::FitParameter &p0_ss, const MINT::FitParameter &p1_ss, const MINT::FitParameter &delta_p0_ss, const MINT::FitParameter &delta_p1_ss, const MINT::FitParameter &avg_eta_ss, const MINT::FitParameter &tageff_ss, const MINT::FitParameter &tageff_asym_ss, const MINT::FitParameter &production_asym, const MINT::FitParameter &detection_asym, string marginalPdfsPrefix)
RooRealVar * _r_delta_p0_ss
RooRealVar * _r_tau
RooRealVar * _r_p0_os
RooRealVar * _r_offset_sigma_dt
RooRealVar * _r_tageff_ss
RooRealVar * _r_delta_p1_ss
double get_cos_term_Val(IDalitzEvent &evt)
RooEffProd * _samplingPdf_t_eff
double getCalibratedResolution(double &dt)
RooRealVar * _r_p0_ss
RooRealVar * _r_c3
RooBDecay * _samplingPdf_t
RooRealVar * _r_c8
DecRateCoeff_Bd * _cos_coeff
const MINT::FitParameter & _tageff_ss
Definition: TimePdfMaster.h:90
double get_marginalPdfs_product(IDalitzEvent &evt)
const MINT::FitParameter & _c4
Definition: TimePdfMaster.h:70
NamedParameter< double > _max_TAUERR
RooRealVar * _r_C
double get_sinh_term_Integral(IDalitzEvent &evt)
double getSamplingPdfVal(IDalitzEvent &evt)
double getCalibratedResolution(double &dt, double &scale_sigma_dt, double &scale_sigma_2_dt)
const MINT::FitParameter & _delta_p0_ss
Definition: TimePdfMaster.h:87
double get_sinh_coeff_Val(IDalitzEvent &evt)
RooRealVar * _r_c2
DecRateCoeff_Bd * _sin_coeff
basisType
Definition: TimePdfMaster.h:43
RooRealVar * _r_t
Cast of MINT parameters to B2DX parameters.
Definition: TimePdfMaster.h:97
const MINT::FitParameter & _c1
Definition: TimePdfMaster.h:67
const MINT::FitParameter & _tageff_os
Definition: TimePdfMaster.h:82
const MINT::FitParameter & _scale_sigma_dt
Definition: TimePdfMaster.h:63
std::pair< double, double > getCalibratedMistag_OS(double &eta_OS)
RooRealVar * _r_S
const MINT::FitParameter & _p0_os
Definition: TimePdfMaster.h:77
RooRealVar * _r_delta_p1_os
RooDataHist * _r_h_eta_SS
void setAllFitParameters()
std::pair< double, double > calibrate(double eta, double avg_eta, double p0, double p1, double delta_p0, double delta_p1) const
RooDataHist * _r_h_dt
double get_sin_term_Integral(IDalitzEvent &evt)
RooCubicSplineFun * _spline
RooRealVar * _r_detection_asym
RooRealVar * _r_norm_bar
const MINT::FitParameter & _c6
Definition: TimePdfMaster.h:72
RooCategory * _r_q_OS
const MINT::FitParameter & _Gamma
Definition: TimePdfMaster.h:57
void fillProtoData(double dt, int f, int q_OS, double eta_OS, int q_SS, double eta_SS)
void setAllObservablesToMean(IDalitzEvent &evt)
std::pair< double, double > getCalibratedMistag(double eta, double avg_eta, double p0, double p1, double delta_p0, double delta_p1)
TimePdfIntegrator * _sin_term
RooProdPdf * _samplingPdf
RooRealVar * _r_dGamma
const MINT::FitParameter & _scale_mean_dt
Definition: TimePdfMaster.h:62
const MINT::FitParameter & _c7
Definition: TimePdfMaster.h:73
const MINT::FitParameter & _p0_ss
Definition: TimePdfMaster.h:85
RooRealVar * _r_C_bar
RooRealVar * _r_dt
Definition: TimePdfMaster.h:98
TimePdfIntegrator * _cosh_term
void listFitParDependencies()
double get_sin_term_Val(IDalitzEvent &evt)
const std::vector< T > & getVector() const
double get_cosh_term_Val(IDalitzEvent &evt)
RooRealVar * _r_tageff_asym_os
const MINT::FitParameter & _delta_p1_os
Definition: TimePdfMaster.h:80
DecRateCoeff_Bd * _sinh_coeff
RooRealVar * _r_production_asym
virtual double getValueFromVector(unsigned int i) const =0
double get_sin_coeff_Val(IDalitzEvent &evt)
RooDataSet * sampleEvents(int N=10000)
const MINT::FitParameter & _avg_eta_os
Definition: TimePdfMaster.h:81
RooRealVar * _r_S_bar
const MINT::FitParameter & _offset_sigma_dt
Definition: TimePdfMaster.h:61
const MINT::FitParameter & _production_asym
Definition: TimePdfMaster.h:93
NamedParameter< double > _min_TAUERR
const MINT::FitParameter & _c9
Definition: TimePdfMaster.h:75
RooRealVar * _r_c5
RooRealVar * _r_c7
vector< double > getCP_coeff()
std::string anythingToString(const T &anything)
Definition: Utils.h:62
double get_sinh_term_Val(IDalitzEvent &evt)
double get_cos_term_Integral(IDalitzEvent &evt)
RooCategory * _r_q_SS
const MINT::FitParameter & _c2
Definition: TimePdfMaster.h:68
RooBDecay * _fitPdf_t
const MINT::FitParameter & _c0
Definition: TimePdfMaster.h:66
RooRealVar * _r_dt_scaled
Definition: TimePdfMaster.h:99
RooRealVar * _r_scale_sigma_2_dt
RooRealVar * _r_c1
cosh/sinh/cos/sin coefficients in decay rate equations
RooGaussEfficiencyModel * _efficiency
const MINT::FitParameter & _delta_p0_os
Definition: TimePdfMaster.h:79
virtual ~TimePdfMaster()
RooProdPdf * _fitPdf
RooAbsPdf * _pdf_sigma_t
RooRealVar * _r_dm
const MINT::FitParameter & _scale_sigma_2_dt
Definition: TimePdfMaster.h:64
RooAbsPdf * _pdf_eta_SS
RooAbsPdf * _pdf_eta_OS
DecRateCoeff_Bd * _cosh_coeff
RooDataSet * _protoData
RooRealVar * _r_tageff_asym_ss
std::pair< double, double > getCalibratedMistag_SS(double &eta_SS)
RooCategory * _r_f
RooRealVar * _r_p1_ss
const MINT::FitParameter & _c3
Definition: TimePdfMaster.h:69
RooProduct * _splinePdf
RooRealVar * _r_scale_sigma_dt
RooRealVar * _r_norm
double get_dGamma_Val()
RooRealVar * _r_D_bar
TimePdfIntegrator * _cos_term
RooRealVar * _r_c4
void setAllObservablesAndFitParameters(IDalitzEvent &evt)
const MINT::FitParameter & _p1_os
Definition: TimePdfMaster.h:78
double get_cos_coeff_Val(IDalitzEvent &evt)
TH1D * plotSpline()
std::pair< double, double > getCalibratedMistag_SS(IDalitzEvent &evt, double &avg_eta_ss, double &p0_ss, double &p1_ss, double &delta_p0_ss, double &delta_p1_ss)
NamedParameter< double > _min_TAU
void listFitParDependencies(std::ostream &os=std::cout) const
std::pair< double, double > getCalibratedMistag_OS(IDalitzEvent &evt)