1289 int seed = RandomSeed + step;
1290 ranLux.SetSeed((
int)seed);
1298 std::string inputFile = InputFileName;
1299 bool generateNew = (std::string) InputFileName ==
"";
1300 std::cout <<
"InputFileName: " << InputFileName << std::endl;
1306 NamedParameter<string> IntegratorEventFile(
"IntegratorEventFile", (std::string)
"SignalIntegrationEvents.root", (
char*) 0);
1307 TString integratorEventFile = (string) IntegratorEventFile;
1308 if(EvtGenTest) integratorEventFile.ReplaceAll(
".root",(
"_" +
anythingToString(seed) +
".root").c_str() );
1316 cout <<
" got event pattern: " << pat << endl;
1366 fas_tmp.getVal(eventListPhsp[0]);
1367 fas_tmp.normalizeAmps(eventListPhsp);
1372 fasCC.CPConjugateSameFitParameters();
1373 fasCC.CConjugateFinalStateSameFitParameters();
1378 fas.multiply(r_K1_plus);
1379 fasCC.multiply(r_K1_minus);
1393 AddScaledAmpsToList(fas_tmp, fas, fasCC,
"NonResV0(->Ds-,pi+),K*(892)0(->K+,pi-)", r_3_plus, r_3_minus );
1394 AddScaledAmpsToList(fas_tmp, fas, fasCC,
"NonResS0(->Ds-,pi+),K*(892)0(->K+,pi-)", r_3_plus, r_3_minus );
1395 AddScaledAmpsToList(fas_tmp, fas, fasCC,
"NonResV0(->Ds-,K+),sigma10(->pi+,pi-)", r_3_plus, r_3_minus );
1405 vector<double> k_gen =
coherenceFactor(fas,fasCC,(
double)r, (
double)delta,eventListPhsp);
1409 fas_sum.addAsList(fasCC,1.);
1410 fas_sum.getVal(eventListPhsp[0]);
1412 AmpsPdfFlexiFast ampsSig(pat, &fas, 0, integPrecision,integMethod, (std::string) integratorEventFile);
1413 AmpsPdfFlexiFast ampsSigCC(pat, &fasCC, 0, integPrecision,integMethod, (std::string) integratorEventFile);
1414 AmpsPdfFlexiFast ampsSum(pat, &fas_sum, 0, integPrecision,integMethod, (std::string) integratorEventFile);
1417 AmpsPdfFlexiFastCPV pdf(&sSig,&sSigCC,&sSum, r, delta, gamma, tau, dGamma, dm, eff_tag, mistag );
1421 time_t startTime = time(0);
1423 TFile* fileTD= TFile::Open(
"dummy.root",
"RECREATE");
1426 TTree *tree =
new TTree(
"TD",
"TD");
1429 tree->Branch(
"t",&t,
"t/D");
1430 tree->Branch(
"dt",&dt,
"dt/D");
1431 tree->Branch(
"q",&q,
"q/I");
1432 tree->Branch(
"w",&w,
"w/D");
1433 tree->Branch(
"f",&f,
"f/I");
1440 fasGen.getVal(eventListPhsp[0]);
1441 fasGen.normalizeAmps(eventListPhsp);
1446 for(
int i = 0; i < Nevents; i++){
1449 t = ranLux.Exp(tau);
1450 dt = ranLux.Uniform(0.,0.25);
1453 const double q_rand = ranLux.Uniform();
1455 if (q_rand < 1./3.) q = -1;
1456 if (q_rand > 2./3.) q = 1;
1460 const double f_rand = ranLux.Uniform();
1461 if(f_rand < 0.5)f = 1;
1474 evt.setValueInVector(0, t);
1475 evt.setValueInVector(1, dt);
1476 evt.setValueInVector(2, q);
1477 evt.setValueInVector(3, w);
1478 evt.setValueInVector(4, f);
1481 const double pdfVal = pdf.un_normalised_noPs(evt);
1485 const double height = ranLux.Uniform(0,maxVal);
1487 if( pdfVal > maxVal ){
1488 std::cout <<
"ERROR: PDF above determined maximum." << std::endl;
1489 std::cout << pdfVal <<
" > " << maxVal << std::endl;
1491 pdf_max = pdf_max * 2.;
1495 if( height < pdfVal ){
1497 if(f==1)eventList_f.
Add(evt);
1498 else eventList_fbar.
Add(evt);
1505 cout <<
" Generated " << Nevents <<
" Events. Took " << (time(0) - startTime)/60 <<
" mins "<< endl;
1511 TFile* file= TFile::Open(((std::string) OutputRootFile).c_str(),
"UPDATE");
1513 tree->CloneTree()->Write();
1520 cout <<
"reading events from file " << inputFile << endl;
1522 TFile *_InputFile = TFile::Open(inputFile.c_str());
1523 TTree* in_tree, *in_treeTD;
1524 in_tree=dynamic_cast<TTree*>(_InputFile->Get(
"DalitzEventList"));
1526 in_treeTD=dynamic_cast<TTree*>(_InputFile->Get(
"TD"));
1529 in_treeTD->SetBranchAddress(
"t",&t);
1530 in_treeTD->SetBranchAddress(
"dt",&dt);
1531 in_treeTD->SetBranchAddress(
"q",&q);
1532 in_treeTD->SetBranchAddress(
"w",&w);
1533 in_treeTD->SetBranchAddress(
"f",&f);
1537 if(in_treeTD->GetEntries() != in_tree->GetEntries()){cout <<
"ERROR: Different number of DalitzEvents and time information " << endl;
throw "crash"; }
1539 for (
unsigned int i = 0; i < in_treeTD->GetEntries(); i++) {
1540 in_treeTD->GetEntry(i);
1542 eventList[i].setValueInVector(0, t);
1543 eventList[i].setValueInVector(1, dt);
1544 eventList[i].setValueInVector(2, q);
1545 eventList[i].setValueInVector(3, w);
1546 eventList[i].setValueInVector(4, f);
1548 if(f==1)eventList_f.
Add(eventList[i]);
1549 else eventList_fbar.
Add(eventList[i]);
1552 cout <<
" I've got " << eventList.
size() <<
" events." << endl;
1553 _InputFile->Close();
1557 Neg2LL fcn(pdf, eventList_f);
1558 Neg2LL fcn_bar(pdf, eventList_fbar);
1560 Neg2LL neg2LL(pdf, eventList);
1566 mini.printResultVsInput();
1570 TFile* paraFile =
new TFile(((
string)OutputDir+
"pull_"+
anythingToString((
int)seed)+
".root").c_str(),
"RECREATE");
1573 TTree* tree =
new TTree(
"Coherence",
"Coherence");
1574 double r_val,delta_val,gamma_val,k_val,n2ll;
1575 TBranch* br_r = tree->Branch(
"r", &r_val,
"r_val/D" );
1576 TBranch* br_delta = tree->Branch(
"delta", &delta_val,
"delta_val/D" );
1577 TBranch* br_gamma = tree->Branch(
"gamma", &gamma_val,
"gamma_val/D" );
1578 TBranch* br_k = tree->Branch(
"k", &k_val,
"k_val/D" );
1579 TBranch* br_n2ll = tree->Branch(
"n2ll", &n2ll,
"n2ll/D" );
1581 double r_val_t,delta_val_t,gamma_val_t,k_val_t,n2ll_t;
1582 TBranch* br_r_t = tree->Branch(
"r_t", &r_val_t,
"r_val_t/D" );
1583 TBranch* br_delta_t = tree->Branch(
"delta_t", &delta_val_t,
"delta_val_t/D" );
1584 TBranch* br_gamma_t = tree->Branch(
"gamma_t", &gamma_val_t,
"gamma_val_t/D" );
1585 TBranch* br_k_t = tree->Branch(
"k_t", &k_val_t,
"k_val_t/D" );
1586 TBranch* br_n2ll_t = tree->Branch(
"n2ll_t", &n2ll_t,
"n2ll_t/D" );
1588 double r_val_t_fixed_k,delta_val_t_fixed_k,gamma_val_t_fixed_k,k_val_t_fixed_k,n2ll_t_fixed_k;
1589 TBranch* br_r_t_fixed_k = tree->Branch(
"r_t_fixed_k", &r_val_t_fixed_k,
"r_val_t_fixed_k/D" );
1590 TBranch* br_delta_t_fixed_k = tree->Branch(
"delta_t_fixed_k", &delta_val_t_fixed_k,
"delta_val_t_fixed_k/D" );
1591 TBranch* br_gamma_t_fixed_k = tree->Branch(
"gamma_t_fixed_k", &gamma_val_t_fixed_k,
"gamma_val_t_fixed_k/D" );
1592 TBranch* br_k_t_fixed_k = tree->Branch(
"k_t_fixed_k", &k_val_t_fixed_k,
"k_val_t_fixed_k/D" );
1593 TBranch* br_n2ll_t_fixed_k = tree->Branch(
"n2ll_t_fixed_k", &n2ll_t_fixed_k,
"n2ll_t_fixed_k/D" );
1595 double r_val_time_integrated,delta_val_time_integrated,gamma_val_time_integrated,k_val_time_integrated,n2ll_time_integrated;
1596 TBranch* br_r_time_integrated = tree->Branch(
"r_time_integrated", &r_val_time_integrated,
"r_val_time_integrated/D" );
1597 TBranch* br_delta_time_integrated = tree->Branch(
"delta_time_integrated", &delta_val_time_integrated,
"delta_val_time_integrated/D" );
1598 TBranch* br_gamma_time_integrated = tree->Branch(
"gamma_time_integrated", &gamma_val_time_integrated,
"gamma_val_time_integrated/D" );
1599 TBranch* br_k_time_integrated = tree->Branch(
"k_time_integrated", &k_val_time_integrated,
"k_val_time_integrated/D" );
1600 TBranch* br_n2ll_time_integrated = tree->Branch(
"n2ll_time_integrated", &n2ll_time_integrated,
"n2ll_time_integrated/D" );
1602 TBranch* br_seed = tree->Branch(
"seed", &seed,
"seed/I" );
1604 MinuitParameterSet::getDefaultSet()->fillNtp(paraFile, ntp);
1607 n2ll = neg2LLSum.getVal();
1609 for(
unsigned int i=0; i < MinuitParameterSet::getDefaultSet()->size(); i++){
1610 if(0 == MinuitParameterSet::getDefaultSet()->getParPtr(i))
continue;
1611 if(
A_is_in_B(
"gamma",MinuitParameterSet::getDefaultSet()->getParPtr(i)->name()))gamma_val = MinuitParameterSet::getDefaultSet()->getParPtr(i)->mean();
1614 vector<double> k_fit =
coherenceFactor(fas,fasCC,(
double)r, (
double)delta,eventListPhsp);
1617 delta_val = k_fit[2];
1620 pdf.doFinalStatsAndSaveForAmp12(&mini,((
string)OutputDir+
"FitAmpResults_rand_"+
anythingToString((
int)seed)).c_str(),((
string)OutputDir+
"fitFractions_"+
anythingToString((
int)seed)).c_str());
1624 for(
unsigned int i=0; i < MinuitParameterSet::getDefaultSet()->size(); i++){
1625 if(0 == MinuitParameterSet::getDefaultSet()->getParPtr(i))
continue;
1626 MinuitParameterSet::getDefaultSet()->getParPtr(i)->setCurrentFitVal(MinuitParameterSet::getDefaultSet()->getParPtr(i)->meanInit());
1629 AmpsPdfFlexiFastCPV_time_integrated pdf_time_integrated(&sSig,&sSigCC,&sSum, r, delta, gamma, tau, dGamma, dm, eff_tag, mistag );
1630 Neg2LL fcn_time_integrated(pdf_time_integrated, eventList_f);
1631 Neg2LL fcn_bar_time_integrated(pdf_time_integrated, eventList_fbar);
1632 Neg2LLSum neg2LLSum_time_integrated(&fcn_time_integrated,&fcn_bar_time_integrated);
1633 Minimiser mini_time_integrated(&neg2LLSum_time_integrated);
1634 mini_time_integrated.doFit();
1635 mini_time_integrated.printResultVsInput();
1637 n2ll_time_integrated = neg2LLSum_time_integrated.getVal();
1639 for(
unsigned int i=0; i < MinuitParameterSet::getDefaultSet()->size(); i++){
1640 if(0 == MinuitParameterSet::getDefaultSet()->getParPtr(i))
continue;
1641 if(
A_is_in_B(
"gamma",MinuitParameterSet::getDefaultSet()->getParPtr(i)->name()))gamma_val_time_integrated = MinuitParameterSet::getDefaultSet()->getParPtr(i)->mean();
1644 vector<double> k_fit_time_integrated =
coherenceFactor(fas,fasCC,(
double)r, (
double)delta,eventListPhsp);
1645 r_val_time_integrated = k_fit_time_integrated[0];
1646 k_val_time_integrated = k_fit_time_integrated[1];
1647 delta_val_time_integrated = k_fit_time_integrated[2];
1651 for(
unsigned int i=0; i < MinuitParameterSet::getDefaultSet()->size(); i++){
1652 if(0 == MinuitParameterSet::getDefaultSet()->getParPtr(i))
continue;
1653 MinuitParameterSet::getDefaultSet()->getParPtr(i)->setCurrentFitVal(MinuitParameterSet::getDefaultSet()->getParPtr(i)->meanInit());
1656 for(
unsigned int i=0; i < MinuitParameterSet::getDefaultSet()->size(); i++){
1657 if(0 == MinuitParameterSet::getDefaultSet()->getParPtr(i))
continue;
1658 if(
A_is_in_B(
"_Re",MinuitParameterSet::getDefaultSet()->getParPtr(i)->name())){
1659 MinuitParameterSet::getDefaultSet()->unregister(MinuitParameterSet::getDefaultSet()->getParPtr(i));
1662 else if(
A_is_in_B(
"_Im",MinuitParameterSet::getDefaultSet()->getParPtr(i)->name())){
1663 MinuitParameterSet::getDefaultSet()->unregister(MinuitParameterSet::getDefaultSet()->getParPtr(i));
1666 else if(
A_is_in_B(
"ratio",MinuitParameterSet::getDefaultSet()->getParPtr(i)->name())){
1667 MinuitParameterSet::getDefaultSet()->unregister(MinuitParameterSet::getDefaultSet()->getParPtr(i));
1674 TimePdf_mod t_pdf(r2,delta,gamma,k,tau,dGamma,dm,eff_tag,mistag );
1675 Neg2LL fcn_t(t_pdf, eventList_f);
1676 Neg2LL fcn_t_bar(t_pdf, eventList_fbar);
1677 Neg2LLSum neg2LLSum_t(&fcn_t,&fcn_t_bar);
1681 mini_t.printResultVsInput();
1682 n2ll_t = neg2LLSum_t.getVal();
1684 for(
unsigned int i=0; i < MinuitParameterSet::getDefaultSet()->size(); i++){
1685 if(0 == MinuitParameterSet::getDefaultSet()->getParPtr(i))
continue;
1686 if(
A_is_in_B(
"gamma",MinuitParameterSet::getDefaultSet()->getParPtr(i)->name()))gamma_val_t= MinuitParameterSet::getDefaultSet()->getParPtr(i)->mean();
1687 if(
A_is_in_B(
"ratio2",MinuitParameterSet::getDefaultSet()->getParPtr(i)->name()))r_val_t= MinuitParameterSet::getDefaultSet()->getParPtr(i)->mean();
1688 if(
A_is_in_B(
"delta",MinuitParameterSet::getDefaultSet()->getParPtr(i)->name()))delta_val_t= MinuitParameterSet::getDefaultSet()->getParPtr(i)->mean();
1689 if(
A_is_in_B(
"kappa",MinuitParameterSet::getDefaultSet()->getParPtr(i)->name()))k_val_t= MinuitParameterSet::getDefaultSet()->getParPtr(i)->mean();
1692 for(
unsigned int i=0; i < MinuitParameterSet::getDefaultSet()->size(); i++){
1693 if(0 == MinuitParameterSet::getDefaultSet()->getParPtr(i))
continue;
1694 MinuitParameterSet::getDefaultSet()->getParPtr(i)->setCurrentFitVal(MinuitParameterSet::getDefaultSet()->getParPtr(i)->meanInit());
1696 k.setCurrentFitVal(k_gen[1]);
1699 mini_t.printResultVsInput();
1700 n2ll_t_fixed_k = neg2LLSum_t.getVal();
1702 for(
unsigned int i=0; i < MinuitParameterSet::getDefaultSet()->size(); i++){
1703 if(0 == MinuitParameterSet::getDefaultSet()->getParPtr(i))
continue;
1704 if(
A_is_in_B(
"gamma",MinuitParameterSet::getDefaultSet()->getParPtr(i)->name()))gamma_val_t_fixed_k= MinuitParameterSet::getDefaultSet()->getParPtr(i)->mean();
1705 if(
A_is_in_B(
"ratio2",MinuitParameterSet::getDefaultSet()->getParPtr(i)->name()))r_val_t_fixed_k= MinuitParameterSet::getDefaultSet()->getParPtr(i)->mean();
1706 if(
A_is_in_B(
"delta",MinuitParameterSet::getDefaultSet()->getParPtr(i)->name()))delta_val_t_fixed_k= MinuitParameterSet::getDefaultSet()->getParPtr(i)->mean();
1707 if(
A_is_in_B(
"kappa",MinuitParameterSet::getDefaultSet()->getParPtr(i)->name()))k_val_t_fixed_k= MinuitParameterSet::getDefaultSet()->getParPtr(i)->mean();
1713 tree->SetDirectory(paraFile);
1719 cout <<
"Now plotting:" << endl;
1727 TH1D* h_t =
new TH1D(
"",
";t (ps);Events (norm.) ",nBinst,0,6);
1728 TH1D* s_Kpipi =
new TH1D(
"",
";#left[m^{2}(K^{+} #pi^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0.8,12);
1729 TH1D* s_Kpi =
new TH1D(
"",
";#left[m^{2}(K^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0.,4);
1730 TH1D* s_pipi =
new TH1D(
"",
";#left[m^{2}(#pi^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0,2);
1731 TH1D* s_Dspipi =
new TH1D(
"",
";#left[m^{2}(D_{s}^{-} #pi^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0,30);
1732 TH1D* s_DsK =
new TH1D(
"",
";#left[m^{2}(D_{s}^{-} K^{+})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0,30) ;
1733 TH1D* s_DsKpi =
new TH1D(
"",
";#left[m^{2}(D_{s}^{-} K^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,5,30);
1734 TH1D* s_Dspi =
new TH1D(
"",
";#left[m^{2}(D_{s}^{-} #pi^{+})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0,25);
1735 TH1D* s_Dspim =
new TH1D(
"",
";#left[m^{2}(D_{s}^{-} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0,25);
1737 for (
int i=0; i<eventList.
size(); i++) {
1738 h_t->Fill(eventList[i].getValueFromVector(0));
1739 s_Kpipi->Fill(eventList[i].sij(s234)/(
GeV*
GeV));
1740 s_Kpi->Fill(eventList[i].
s(2,4)/(
GeV*
GeV));
1741 s_pipi->Fill(eventList[i].
s(3,4)/(
GeV*
GeV));
1742 s_Dspipi->Fill(eventList[i].sij(s134)/(
GeV*
GeV));
1743 s_DsK->Fill(eventList[i].
s(1,2)/(
GeV*
GeV));
1744 s_DsKpi->Fill(eventList[i].sij(s124)/(
GeV*
GeV));
1745 s_Dspi->Fill(eventList[i].
s(1,3)/(
GeV*
GeV));
1746 s_Dspim->Fill(eventList[i].
s(1,4)/(
GeV*
GeV));
1749 TH1D* h_t_fit =
new TH1D(
"",
";t",nBinst,0,6);
1750 TH1D* h_t_fit_mp =
new TH1D(
"",
";t",nBinst,0,6);
1751 TH1D* h_t_fit_0p =
new TH1D(
"",
";t",nBinst,0,6);
1752 TH1D* h_t_fit_pp =
new TH1D(
"",
";t",nBinst,0,6);
1753 TH1D* h_t_fit_mm =
new TH1D(
"",
";t",nBinst,0,6);
1754 TH1D* h_t_fit_0m =
new TH1D(
"",
";t",nBinst,0,6);
1755 TH1D* h_t_fit_pm =
new TH1D(
"",
";t",nBinst,0,6);
1757 TH1D* s_Kpipi_fit =
new TH1D(
"",
";#left[m^{2}(K^{+} #pi^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0.8,12);
1758 TH1D* s_Kpi_fit =
new TH1D(
"",
";#left[m^{2}(K^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0.,4);
1759 TH1D* s_pipi_fit =
new TH1D(
"",
";#left[m^{2}(K^{+} #pi^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0,2);
1760 TH1D* s_Dspipi_fit =
new TH1D(
"",
";#left[m^{2}(D_{s}^{-} #pi^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0,30);
1761 TH1D* s_DsK_fit =
new TH1D(
"",
";#left[m^{2}(D_{s}^{-} K^{+})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0,30);
1762 TH1D* s_DsKpi_fit =
new TH1D(
"",
";#left[m^{2}(D_{s}^{-} K^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,5,30);
1763 TH1D* s_Dspi_fit =
new TH1D(
"",
";#left[m^{2}(D_{s}^{-} #pi^{+})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0,25);
1764 TH1D* s_Dspim_fit =
new TH1D(
"",
";#left[m^{2}(D_{s}^{-} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0,25);
1766 TH1D* s_Kpipi_fitBs =
new TH1D(
"",
";#left[m^{2}(K^{+} #pi^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0.8,3.5);
1767 TH1D* s_Kpi_fitBs =
new TH1D(
"",
";#left[m^{2}(K^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0.3,2.);
1768 TH1D* s_pipi_fitBs =
new TH1D(
"",
";#left[m^{2}(K^{+} #pi^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0,2);
1769 TH1D* s_Dspipi_fitBs =
new TH1D(
"",
";#left[m^{2}(D_{s}^{-} #pi^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",20,4,25);
1770 TH1D* s_DsK_fitBs =
new TH1D(
"",
";#left[m^{2}(D_{s}^{-} K^{+})#right] (GeV^{2}/c^{4});Events (norm.) ",20,4,26);
1772 TH1D* s_Kpipi_fitBsbar =
new TH1D(
"",
";#left[m^{2}(K^{+} #pi^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0.8,3.5);
1773 TH1D* s_Kpi_fitBsbar =
new TH1D(
"",
";#left[m^{2}(K^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0.3,2.);
1774 TH1D* s_pipi_fitBsbar =
new TH1D(
"",
";#left[m^{2}(K^{+} #pi^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0,2);
1775 TH1D* s_Dspipi_fitBsbar =
new TH1D(
"",
";#left[m^{2}(D_{s}^{-} #pi^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",20,4,25);
1776 TH1D* s_DsK_fitBsbar =
new TH1D(
"",
";#left[m^{2}(D_{s}^{-} K^{+})#right] (GeV^{2}/c^{4});Events (norm.) ",20,4,26);
1778 TH1D* s_Kpipi_fit_notag =
new TH1D(
"",
";#left[m^{2}(K^{+} #pi^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0.8,3.5);
1779 TH1D* s_Kpi_fit_notag =
new TH1D(
"",
";#left[m^{2}(K^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0.3,2.);
1780 TH1D* s_pipi_fit_notag =
new TH1D(
"",
";#left[m^{2}(K^{+} #pi^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",nBins,0,2);
1781 TH1D* s_Dspipi_fit_notag =
new TH1D(
"",
";#left[m^{2}(D_{s}^{-} #pi^{+} #pi^{-})#right] (GeV^{2}/c^{4});Events (norm.) ",20,4,25);
1782 TH1D* s_DsK_fit_notag =
new TH1D(
"",
";#left[m^{2}(D_{s}^{-} K^{+})#right] (GeV^{2}/c^{4});Events (norm.) ",20,4,26);
1787 for(
int i = 0; i < 2000000; i++){
1789 const double t = ranLux.Exp(tau);
1790 const double dt = ranLux.Uniform(0.00001,0.25);
1791 const double w = mistag;
1799 evt.setValueInVector(1, dt);
1800 evt.setValueInVector(3, w);
1802 evt.setValueInVector(2, -1);
1803 evt.setValueInVector(4, 1);
1804 double weight_mp = pdf.un_normalised_noPs(evt)*evt.getWeight()/evt.getGeneratorPdfRelativeToPhaseSpace()/exp(-fabs(t)/(tau));
1806 evt.setValueInVector(2, 0);
1807 evt.setValueInVector(4, 1);
1808 double weight_0p = pdf.un_normalised_noPs(evt)*evt.getWeight()/evt.getGeneratorPdfRelativeToPhaseSpace()/exp(-fabs(t)/(tau));
1810 evt.setValueInVector(2, 1);
1811 evt.setValueInVector(4, 1);
1812 double weight_pp = pdf.un_normalised_noPs(evt)*evt.getWeight()/evt.getGeneratorPdfRelativeToPhaseSpace()/exp(-fabs(t)/(tau));
1814 evt.setValueInVector(2, -1);
1815 evt.setValueInVector(4, -1);
1816 double weight_mm = pdf.un_normalised_noPs(evt)*evt.getWeight()/evt.getGeneratorPdfRelativeToPhaseSpace()/exp(-fabs(t)/(tau));
1818 evt.setValueInVector(2, 0);
1819 evt.setValueInVector(4, -1);
1820 double weight_0m = pdf.un_normalised_noPs(evt)*evt.getWeight()/evt.getGeneratorPdfRelativeToPhaseSpace()/exp(-fabs(t)/(tau));
1822 evt.setValueInVector(2, 1);
1823 evt.setValueInVector(4, -1);
1824 double weight_pm = pdf.un_normalised_noPs(evt)*evt.getWeight()/evt.getGeneratorPdfRelativeToPhaseSpace()/exp(-fabs(t)/(tau));
1826 double weight = weight_mp + weight_0p + weight_pp + weight_mm + weight_0m + weight_pm ;
1828 h_t_fit->Fill(t,weight);
1829 h_t_fit_mp->Fill(t,weight_mp);
1830 h_t_fit_0p->Fill(t,weight_0p);
1831 h_t_fit_pp->Fill(t,weight_pp);
1832 h_t_fit_mm->Fill(t,weight_mm);
1833 h_t_fit_0m->Fill(t,weight_0m);
1834 h_t_fit_pm->Fill(t,weight_pm);
1836 double weight_B = fas.RealVal(evt)*evt.getWeight()/evt.getGeneratorPdfRelativeToPhaseSpace();
1837 double weight_Bbar = fasCC.RealVal(evt)*evt.getWeight()/evt.getGeneratorPdfRelativeToPhaseSpace();
1838 double weight_notag = weight_Bbar+ (double)r * (
double)r * weight_Bbar;
1840 const complex<double> phase_diff = polar((
double)r, (
double)delta/360.*2*
pi);
1841 double weight_coherence = std::abs(conj(fas.getVal(evt)) * fasCC.getVal(evt)*phase_diff) *evt.getWeight()/evt.getGeneratorPdfRelativeToPhaseSpace();
1843 s_Kpipi_fit->Fill(evt.sij(s234)/(
GeV*
GeV),weight);
1844 s_Kpi_fit->Fill(evt.s(2,4)/(
GeV*
GeV),weight);
1845 s_pipi_fit->Fill(evt.s(3,4)/(
GeV*
GeV),weight);
1846 s_Dspipi_fit->Fill(evt.sij(s134)/(
GeV*
GeV),weight);
1847 s_DsK_fit->Fill(evt.s(1,2)/(
GeV*
GeV),weight);
1848 s_DsKpi_fit->Fill(evt.sij(s124)/(
GeV*
GeV),weight);
1849 s_Dspi_fit->Fill(evt.s(1,3)/(
GeV*
GeV),weight);
1850 s_Dspim_fit->Fill(evt.s(1,4)/(
GeV*
GeV),weight);
1852 s_Kpipi_fitBs->Fill(evt.sij(s234)/(
GeV*
GeV),weight_B);
1853 s_Kpi_fitBs->Fill(evt.s(2,4)/(
GeV*
GeV),weight_B);
1854 s_pipi_fitBs->Fill(evt.s(3,4)/(
GeV*
GeV),weight_B);
1855 s_Dspipi_fitBs->Fill(evt.sij(s134)/(
GeV*
GeV),weight_B);
1856 s_DsK_fitBs->Fill(evt.s(1,2)/(
GeV*
GeV),weight_B);
1858 s_Kpipi_fitBsbar->Fill(evt.sij(s234)/(
GeV*
GeV),weight_Bbar);
1859 s_Kpi_fitBsbar->Fill(evt.s(2,4)/(
GeV*
GeV),weight_Bbar);
1860 s_pipi_fitBsbar->Fill(evt.s(3,4)/(
GeV*
GeV),weight_Bbar);
1861 s_Dspipi_fitBsbar->Fill(evt.sij(s134)/(
GeV*
GeV),weight_Bbar);
1862 s_DsK_fitBsbar->Fill(evt.s(1,2)/(
GeV*
GeV),weight_Bbar);
1864 s_Kpipi_fit_notag->Fill(evt.sij(s234)/(
GeV*
GeV),weight_notag);
1865 s_Kpi_fit_notag->Fill(evt.s(2,4)/(
GeV*
GeV),weight_notag);
1866 s_pipi_fit_notag->Fill(evt.s(3,4)/(
GeV*
GeV),weight_notag);
1867 s_Dspipi_fit_notag->Fill(evt.sij(s134)/(
GeV*
GeV),weight_notag);
1868 s_DsK_fit_notag->Fill(evt.s(1,2)/(
GeV*
GeV),weight_notag);
1872 TCanvas* c =
new TCanvas();
1874 h_t->SetLineColor(kBlack);
1875 h_t->DrawNormalized(
"e1",1);
1876 h_t_fit->SetLineColor(kBlue);
1877 h_t_fit->SetLineWidth(3);
1878 h_t_fit->DrawNormalized(
"histcsame",1);
1880 c->Print(((
string)OutputDir+
"h_t.eps").c_str());
1882 c->Print(((
string)OutputDir+
"h_t_log.eps").c_str());
1885 h_t->SetLineColor(kBlack);
1886 h_t->DrawNormalized(
"e1",1);
1887 h_t_fit->SetLineColor(kBlack);
1888 h_t_fit->SetLineWidth(3);
1889 h_t_fit->DrawNormalized(
"histcsame",1);
1891 h_t_fit_pm->SetLineColor(kBlue);
1892 h_t_fit_pm->SetLineWidth(3);
1893 h_t_fit_pm->DrawNormalized(
"histcsame",0.5*0.5*eff_tag);
1894 h_t_fit_mm->SetLineColor(kBlue);
1895 h_t_fit_mm->SetLineWidth(3);
1896 h_t_fit_mm->SetLineStyle(kDashed);
1897 h_t_fit_mm->DrawNormalized(
"histcsame",0.5*0.5*eff_tag);
1899 h_t_fit_pp->SetLineColor(kRed);
1900 h_t_fit_pp->SetLineWidth(3);
1901 h_t_fit_pp->DrawNormalized(
"histcsame",0.5*0.5*eff_tag);
1902 h_t_fit_mp->SetLineColor(kRed);
1903 h_t_fit_mp->SetLineWidth(3);
1904 h_t_fit_mp->SetLineStyle(kDashed);
1905 h_t_fit_mp->DrawNormalized(
"histcsame",0.5*0.5*eff_tag);
1907 h_t_fit_0p->SetLineColor(kGreen);
1908 h_t_fit_0p->SetLineWidth(3);
1909 h_t_fit_0p->DrawNormalized(
"histcsame",0.5*0.5*(1.-eff_tag));
1910 h_t_fit_0m->SetLineColor(kGreen);
1911 h_t_fit_0m->SetLineWidth(3);
1912 h_t_fit_0m->SetLineStyle(kDashed);
1913 h_t_fit_0m->DrawNormalized(
"histcsame",0.5*0.5*(1.-eff_tag));
1915 c->Print(((
string)OutputDir+
"h_t_2.eps").c_str());
1917 c->Print(((
string)OutputDir+
"h_t_2_log.eps").c_str());
1920 TLegend leg_t(0,0,1,1,
"");
1921 leg_t.SetLineStyle(0);
1922 leg_t.SetLineColor(0);
1923 leg_t.SetFillColor(0);
1925 leg_t.SetTextColor(1);
1927 leg_t.SetTextAlign(12);
1929 leg_t.AddEntry(h_t_fit_pm,
"B_{s} #rightarrow D_{s}^{-} K^{+} #pi^{+} #pi^{-}",
"l");
1930 leg_t.AddEntry(h_t_fit_mm,
"#bar{B}_{s} #rightarrow D_{s}^{-} K^{+} #pi^{+} #pi^{-}",
"l");
1931 leg_t.AddEntry(h_t_fit_0m,
"Untagged #rightarrow D_{s}^{-} K^{+} #pi^{+} #pi^{-}",
"l");
1932 leg_t.AddEntry(h_t_fit_mp,
"#bar{B}_{s} #rightarrow D_{s}^{+} K^{-} #pi^{-} #pi^{+}",
"l");
1933 leg_t.AddEntry(h_t_fit_pp,
"B_{s} #rightarrow D_{s}^{+} K^{-} #pi^{-} #pi^{+}",
"l");
1934 leg_t.AddEntry(h_t_fit_0p,
"Untagged #rightarrow D_{s}^{+} K^{-} #pi^{-} #pi^{+}",
"l");
1936 c->Print(((
string)OutputDir+
"leg_t.eps").c_str());
1938 s_Kpipi->SetLineColor(kBlack);
1939 s_Kpipi->DrawNormalized(
"e1",1);
1940 s_Kpipi_fit->SetLineColor(kBlue);
1941 s_Kpipi_fit->SetLineWidth(3);
1942 s_Kpipi_fit->DrawNormalized(
"histcsame",1);
1943 c->Print(((
string)OutputDir+
"s_Kpipi.eps").c_str());
1945 s_Kpipi->SetLineColor(kBlack);
1946 s_Kpipi->DrawNormalized(
"e1",1);
1947 s_Kpipi_fit->SetLineColor(kBlack);
1948 s_Kpipi_fit->SetLineWidth(3);
1949 s_Kpipi_fit->DrawNormalized(
"histcsame",1);
1950 s_Kpipi_fitBs->SetLineColor(kRed);
1951 s_Kpipi_fitBs->SetLineWidth(3);
1952 s_Kpipi_fitBs->SetLineStyle(kDashed);
1953 s_Kpipi_fitBs->DrawNormalized(
"histcsame",1./(1.+k_fit[0]*k_fit[0])*eff_tag);
1954 s_Kpipi_fitBsbar->SetLineWidth(3);
1955 s_Kpipi_fitBsbar->SetLineColor(kBlue);
1956 s_Kpipi_fitBsbar->SetLineStyle(kDashed);
1957 s_Kpipi_fitBsbar->DrawNormalized(
"histcsame",k_fit[0]*k_fit[0]/(1.+k_fit[0]*k_fit[0])*eff_tag);
1958 s_Kpipi_fit_notag->SetLineWidth(3);
1959 s_Kpipi_fit_notag->SetLineColor(kMagenta);
1960 s_Kpipi_fit_notag->SetLineStyle(kDashed);
1961 s_Kpipi_fit_notag->DrawNormalized(
"histcsame",(1.-eff_tag));
1962 c->Print(((
string)OutputDir+
"s_Kpipi_2.eps").c_str());
1965 s_Kpi->SetLineColor(kBlack);
1966 s_Kpi->DrawNormalized(
"e1",1);
1967 s_Kpi_fit->SetLineColor(kBlue);
1968 s_Kpi_fit->SetLineWidth(3);
1969 s_Kpi_fit->DrawNormalized(
"histcsame",1);
1970 c->Print(((
string)OutputDir+
"s_Kpi.eps").c_str());
1972 s_Kpi->SetLineColor(kBlack);
1973 s_Kpi->DrawNormalized(
"e1",1);
1974 s_Kpi_fit->SetLineColor(kBlack);
1975 s_Kpi_fit->SetLineWidth(3);
1976 s_Kpi_fit->DrawNormalized(
"histcsame",1);
1977 s_Kpi_fitBs->SetLineColor(kRed);
1978 s_Kpi_fitBs->SetLineWidth(3);
1979 s_Kpi_fitBs->SetLineStyle(kDashed);
1980 s_Kpi_fitBs->DrawNormalized(
"histcsame",1./(1.+k_fit[0]*k_fit[0])*eff_tag);
1981 s_Kpi_fitBsbar->SetLineWidth(3);
1982 s_Kpi_fitBsbar->SetLineColor(kBlue);
1983 s_Kpi_fitBsbar->SetLineStyle(kDashed);
1984 s_Kpi_fitBsbar->DrawNormalized(
"histcsame",k_fit[0]*k_fit[0]/(1.+k_fit[0]*k_fit[0])*eff_tag);
1985 s_Kpi_fit_notag->SetLineWidth(3);
1986 s_Kpi_fit_notag->SetLineColor(kMagenta);
1987 s_Kpi_fit_notag->SetLineStyle(kDashed);
1988 s_Kpi_fit_notag->DrawNormalized(
"histcsame",(1.-eff_tag));
1989 c->Print(((
string)OutputDir+
"s_Kpi_2.eps").c_str());
1991 s_pipi->SetLineColor(kBlack);
1992 s_pipi->DrawNormalized(
"e1",1);
1993 s_pipi_fit->SetLineColor(kBlue);
1994 s_pipi_fit->SetLineWidth(3);
1995 s_pipi_fit->DrawNormalized(
"histcsame",1);
1996 c->Print(((
string)OutputDir+
"s_pipi.eps").c_str());
1998 s_pipi->SetLineColor(kBlack);
1999 s_pipi->DrawNormalized(
"e1",1);
2000 s_pipi_fit->SetLineColor(kBlack);
2001 s_pipi_fit->SetLineWidth(3);
2002 s_pipi_fit->DrawNormalized(
"histcsame",1);
2003 s_pipi_fitBs->SetLineColor(kRed);
2004 s_pipi_fitBs->SetLineWidth(3);
2005 s_pipi_fitBs->SetLineStyle(kDashed);
2006 s_pipi_fitBs->DrawNormalized(
"histcsame",1./(1.+k_fit[0]*k_fit[0])*eff_tag);
2007 s_pipi_fitBsbar->SetLineWidth(3);
2008 s_pipi_fitBsbar->SetLineColor(kBlue);
2009 s_pipi_fitBsbar->SetLineStyle(kDashed);
2010 s_pipi_fitBsbar->DrawNormalized(
"histcsame",k_fit[0]*k_fit[0]/(1.+k_fit[0]*k_fit[0])*eff_tag);
2011 s_pipi_fit_notag->SetLineWidth(3);
2012 s_pipi_fit_notag->SetLineColor(kMagenta);
2013 s_pipi_fit_notag->SetLineStyle(kDashed);
2014 s_pipi_fit_notag->DrawNormalized(
"histcsame",(1.-eff_tag));
2015 c->Print(((
string)OutputDir+
"s_pipi_2.eps").c_str());
2017 s_Dspipi->SetLineColor(kBlack);
2018 s_Dspipi->DrawNormalized(
"e1",1);
2019 s_Dspipi_fit->SetLineColor(kBlue);
2020 s_Dspipi_fit->SetLineWidth(3);
2021 s_Dspipi_fit->DrawNormalized(
"histcsame",1);
2022 c->Print(((
string)OutputDir+
"s_Dspipi.eps").c_str());
2024 s_Dspipi->SetLineColor(kBlack);
2025 s_Dspipi->DrawNormalized(
"e1",1);
2026 s_Dspipi_fit->SetLineColor(kBlack);
2027 s_Dspipi_fit->SetLineWidth(3);
2028 s_Dspipi_fit->DrawNormalized(
"histcsame",1);
2029 s_Dspipi_fitBs->SetLineColor(kRed);
2030 s_Dspipi_fitBs->SetLineWidth(3);
2031 s_Dspipi_fitBs->SetLineStyle(kDashed);
2032 s_Dspipi_fitBs->DrawNormalized(
"histcsame",1./(1.+k_fit[0]*k_fit[0])*eff_tag);
2033 s_Dspipi_fitBsbar->SetLineWidth(3);
2034 s_Dspipi_fitBsbar->SetLineColor(kBlue);
2035 s_Dspipi_fitBsbar->SetLineStyle(kDashed);
2036 s_Dspipi_fitBsbar->DrawNormalized(
"histcsame",k_fit[0]*k_fit[0]/(1.+k_fit[0]*k_fit[0])*eff_tag);
2037 s_Dspipi_fit_notag->SetLineWidth(3);
2038 s_Dspipi_fit_notag->SetLineColor(kMagenta);
2039 s_Dspipi_fit_notag->SetLineStyle(kDashed);
2040 s_Dspipi_fit_notag->DrawNormalized(
"histcsame",(1.-eff_tag));
2041 c->Print(((
string)OutputDir+
"s_Dspipi_2.eps").c_str());
2044 s_DsK->SetLineColor(kBlack);
2045 s_DsK->DrawNormalized(
"e1",1);
2046 s_DsK_fit->SetLineColor(kBlue);
2047 s_DsK_fit->SetLineWidth(3);
2048 s_DsK_fit->DrawNormalized(
"histcsame",1);
2049 c->Print(((
string)OutputDir+
"s_DsK.eps").c_str());
2051 s_DsK->SetLineColor(kBlack);
2052 s_DsK->DrawNormalized(
"e1",1);
2053 s_DsK_fit->SetLineColor(kBlack);
2054 s_DsK_fit->SetLineWidth(3);
2055 s_DsK_fit->DrawNormalized(
"histcsame",1);
2056 s_DsK_fitBs->SetLineColor(kRed);
2057 s_DsK_fitBs->SetLineWidth(3);
2058 s_DsK_fitBs->SetLineStyle(kDashed);
2059 s_DsK_fitBs->DrawNormalized(
"histcsame",1./(1.+k_fit[0]*k_fit[0])*eff_tag);
2060 s_DsK_fitBsbar->SetLineWidth(3);
2061 s_DsK_fitBsbar->SetLineColor(kBlue);
2062 s_DsK_fitBsbar->SetLineStyle(kDashed);
2063 s_DsK_fitBsbar->DrawNormalized(
"histcsame",k_fit[0]*k_fit[0]/(1.+k_fit[0]*k_fit[0])*eff_tag);
2064 s_DsK_fit_notag->SetLineWidth(3);
2065 s_DsK_fit_notag->SetLineColor(kMagenta);
2066 s_DsK_fit_notag->SetLineStyle(kDashed);
2067 s_DsK_fit_notag->DrawNormalized(
"histcsame",(1.-eff_tag));
2068 c->Print(((
string)OutputDir+
"s_DsK_2.eps").c_str());
2070 s_DsKpi->SetLineColor(kBlack);
2071 s_DsKpi->DrawNormalized(
"e1",1);
2072 s_DsKpi_fit->SetLineColor(kBlue);
2073 s_DsKpi_fit->SetLineWidth(3);
2074 s_DsKpi_fit->DrawNormalized(
"histcsame",1);
2075 c->Print(((
string)OutputDir+
"s_DsKpi.eps").c_str());
2077 s_Dspi->SetLineColor(kBlack);
2078 s_Dspi->DrawNormalized(
"e1",1);
2079 s_Dspi_fit->SetLineColor(kBlue);
2080 s_Dspi_fit->SetLineWidth(3);
2081 s_Dspi_fit->DrawNormalized(
"histcsame",1);
2082 c->Print(((
string)OutputDir+
"s_Dspi.eps").c_str());
2084 s_Dspim->SetLineColor(kBlack);
2085 s_Dspim->DrawNormalized(
"e1",1);
2086 s_Dspim_fit->SetLineColor(kBlue);
2087 s_Dspim_fit->SetLineWidth(3);
2088 s_Dspim_fit->DrawNormalized(
"histcsame",1);
2089 c->Print(((
string)OutputDir+
"s_Dspim.eps").c_str());
2094 cout <<
"Now doing 2D scan:" << endl;
2096 double scanMin=0, scanMax=360;
2097 double nSigmaZoom = 2;
2098 double scanMinGammaZoom=min(gamma.meanInit(), gamma.mean()) - nSigmaZoom*gamma.err();
2099 double scanMaxGammaZoom=max(gamma.meanInit(), gamma.mean()) + nSigmaZoom*gamma.err();
2100 double scanMinDeltaZoom=min(delta.meanInit(), delta.mean()) - nSigmaZoom*delta.err();
2101 double scanMaxDeltaZoom=max(delta.meanInit(), delta.mean()) + nSigmaZoom*delta.err();
2102 double gammaZoomRange = scanMaxGammaZoom - scanMinGammaZoom;
2103 double deltaZoomRange = scanMaxDeltaZoom - scanMinDeltaZoom;
2105 TFile* scanFile =
new TFile(
"scan.root",
"RECREATE");
2106 TH2D* scanHisto =
new TH2D(
"scan",
"; #gamma [deg]; #delta [deg]", scanBins, scanMin, scanMax, scanBins, scanMin, scanMax);
2107 TH2D* scanHistoP =
new TH2D(
"scanP",
"; #gamma [deg]; #delta [deg]", scanBins, scanMin, scanMax, scanBins, scanMin, scanMax);
2108 TH2D* scanHistoM =
new TH2D(
"scanM" ,
"; #gamma [deg]; #delta [deg]", scanBins, scanMin, scanMax, scanBins, scanMin, scanMax);
2109 TH2D* scanZoomHisto =
new TH2D(
"scanZoom",
"; #gamma [deg]; #delta [deg]", scanBins, scanMinGammaZoom, scanMaxGammaZoom, scanBins, scanMinDeltaZoom, scanMaxDeltaZoom);
2111 double scanMinLL=-9999;
2112 double scanMinLLP=-9999;
2113 double scanMinLLM=-9999;
2114 double scanMinLLZ=-9999;
2116 for(
int i=0; i < scanBins; i++){
2117 double gamma_value = ((double)i+0.5)*360/((double)scanBins);
2118 gamma.setCurrentFitVal(gamma_value);
2119 for(
int j=0; j < scanBins; j++){
2120 double delta_value = ((double)j+0.5)*360/((double)scanBins);
2121 delta.setCurrentFitVal(delta_value);
2123 double v = neg2LLSum.getNewVal();
2124 if( (i==0 && j==0) || v < scanMinLL) scanMinLL=v;
2125 scanHisto->Fill(gamma_value, delta_value, v);
2127 double vP = fcn.getNewVal();
2128 if( (i==0 && j==0) || vP < scanMinLLP) scanMinLLP=vP;
2129 scanHistoP->Fill(gamma_value, delta_value, vP);
2131 double vM = fcn_bar.getNewVal();
2132 if( (i==0 && j==0) || vM < scanMinLLM) scanMinLLM=vM;
2133 scanHistoM->Fill(gamma_value, delta_value, vM);
2136 for(
int i=0; i < scanBins; i++){
2137 double gamma_value = scanMinGammaZoom + ((double)i+0.5) * gammaZoomRange/((double)scanBins);
2138 gamma.setCurrentFitVal(gamma_value);
2139 for(
int j=0; j < scanBins; j++){
2140 double delta_value = scanMinDeltaZoom + ((double)j+0.5) * deltaZoomRange/((double)scanBins);
2141 delta.setCurrentFitVal(delta_value);
2142 double v = neg2LLSum.getNewVal();
2144 if( (i==0 && j==0) || v < scanMinLLZ) scanMinLLZ=v;
2146 scanZoomHisto->Fill(gamma_value, delta_value, v);
2150 for(
int i=0; i < scanBins; i++){
2151 double gamma_value = ((double)i+0.5)*360/((double)scanBins);
2152 for(
int j=0; j < scanBins; j++){
2153 double delta_value = ((double)j+0.5)*360/((double)scanBins);
2154 scanHisto->Fill(gamma_value, delta_value, -scanMinLL);
2155 scanHistoP->Fill(gamma_value, delta_value, -scanMinLLP);
2156 scanHistoM->Fill(gamma_value, delta_value, -scanMinLLM);
2159 for(
int i=0; i < scanBins; i++){
2160 double gamma_value = scanMinGammaZoom + ((double)i+0.5) * gammaZoomRange/((double)scanBins);
2161 for(
int j=0; j < scanBins; j++){
2162 double delta_value = scanMinDeltaZoom + ((double)j+0.5) * deltaZoomRange/((double)scanBins);
2163 scanZoomHisto->Fill(gamma_value, delta_value, -scanMinLLZ);
2168 scanHistoP->Write();
2169 scanHistoM->Write();
2170 scanZoomHisto->Write();
2173 cout<<
"done 2-D scan" << endl;
virtual bool Add(const EVENT_TYPE &evt)
void AddScaledAmpsToList(FitAmpSum &fas_tmp, FitAmpSum &fas, FitAmpSum &fasCC, std::string name, counted_ptr< IReturnComplex > &r_plus, counted_ptr< IReturnComplex > &r_minus)
static void AutogenerateFitFile(const std::string &fname="protoFitAmplitudeFile.txt", const DalitzEventPattern &pat=DalitzEventPattern::NoPattern)
virtual void setValueInVector(unsigned int i, double value)
std::vector< double > coherenceFactor(FitAmpSum &fas, FitAmpSum &fas_bar, double r, double delta, DalitzEventList &eventList)
bool A_is_in_B(const std::string &a, const std::string &b)
bool fromNtuple(TTree *ntp)
virtual double getGeneratorPdfRelativeToPhaseSpace() const
virtual unsigned int size() const
std::string anythingToString(const T &anything)
bool saveAsNtuple(const std::string &fname="DalitzEvents.root") const
int generatePhaseSpaceEvents(int NumEvents, const DalitzEventPattern &pat, TRandom *rnd=0)