449 std::pair<double, double> calibrated_mistag_os =
calibrate(eta_os, avg_eta_os, p0_os, p1_os, delta_p0_os, delta_p1_os);
450 std::pair<double, double> calibrated_mistag_ss =
calibrate(eta_ss, avg_eta_ss, p0_ss, p1_ss, delta_p0_ss, delta_p1_ss);
452 double eta_os_b = calibrated_mistag_os.first;
453 double eta_os_bbar = calibrated_mistag_os.second;
454 double eta_ss_b = calibrated_mistag_ss.first;
455 double eta_ss_bbar = calibrated_mistag_ss.second;
458 if(coeff_type ==
kCos){
460 if(tag_os == 0)
return cp_coeff * (1 + detection_asym) * (tageff_asym_os - 2 * production_asym * (1 - tageff_os));
461 else return 1.0 * cp_coeff * (1 + detection_asym) * (tag_os * tageff_os - 0.5 * tageff_asym_os
462 - production_asym * (tageff_os - 0.5 * tag_os * tageff_asym_os
463 - tag_os * tageff_os * (eta_os_b - eta_os_bbar)
464 + 0.5 * tag_os * tageff_asym_os * (eta_os_b + eta_os_bbar))
465 - tageff_os * tag_os * (eta_os_b + eta_os_bbar)
466 + 0.5 * tageff_asym_os * tag_os * (eta_os_b - eta_os_bbar) );
468 else if(finalstate == -1){
469 if(tag_os == 0)
return cp_coeff_bar * (1 - detection_asym) * (tageff_asym_os - 2 * production_asym * (1 - tageff_os));
470 else return 1.0 * cp_coeff_bar * (1 - detection_asym) * (tag_os * tageff_os - 0.5 * tageff_asym_os
471 - production_asym * (tageff_os - 0.5 * tag_os * tageff_asym_os
472 - tag_os * tageff_os * (eta_os_b - eta_os_bbar)
473 + 0.5 * tag_os * tageff_asym_os * (eta_os_b + eta_os_bbar))
474 - tageff_os * tag_os * (eta_os_b + eta_os_bbar)
475 + 0.5 * tageff_asym_os * tag_os * (eta_os_b - eta_os_bbar) );
478 std::cout <<
"ERROR\t" <<
"DecRateCoeff_Bd::evaluate(...): No valid finalstate!" << std::endl;
482 if(coeff_type ==
kSin){
484 if(tag_os == 0)
return cp_coeff * (1 + detection_asym) * (tageff_asym_os - 2 * production_asym * (1 - tageff_os));
485 else return -1.0 * cp_coeff * (1 + detection_asym) * (tag_os * tageff_os - 0.5 * tageff_asym_os
486 - production_asym * (tageff_os - 0.5 * tag_os * tageff_asym_os
487 - tag_os * tageff_os * (eta_os_b - eta_os_bbar)
488 + 0.5 * tag_os * tageff_asym_os * (eta_os_b + eta_os_bbar))
489 - tageff_os * tag_os * (eta_os_b + eta_os_bbar)
490 + 0.5 * tageff_asym_os * tag_os * (eta_os_b - eta_os_bbar) );
492 else if(finalstate == -1){
493 if(tag_os == 0)
return cp_coeff_bar * (1 - detection_asym) * (tageff_asym_os - 2 * production_asym * (1 - tageff_os));
494 else return -1.0 * cp_coeff_bar * (1 - detection_asym) * (tag_os * tageff_os - 0.5 * tageff_asym_os
495 - production_asym * (tageff_os - 0.5 * tag_os * tageff_asym_os
496 - tag_os * tageff_os * (eta_os_b - eta_os_bbar)
497 + 0.5 * tag_os * tageff_asym_os * (eta_os_b + eta_os_bbar))
498 - tageff_os * tag_os * (eta_os_b + eta_os_bbar)
499 + 0.5 * tageff_asym_os * tag_os * (eta_os_b - eta_os_bbar) );
502 std::cout <<
"ERROR\t" <<
"DecRateCoeff_Bd::evaluate(...): No valid finalstate!" << std::endl;
506 if(coeff_type ==
kSinh){
508 if(tag_os == 0)
return cp_coeff * (1 + detection_asym) * (2 * (1 - tageff_os) - tageff_asym_os * production_asym);
509 else return 1.0 * cp_coeff * (1 + detection_asym) * (tageff_os - 0.5 * tag_os * tageff_asym_os
510 - tag_os * production_asym * (tageff_os - 0.5 * tag_os * tageff_asym_os
511 - tageff_os * (eta_os_b + eta_os_bbar)
512 + 0.5 * tageff_asym_os * (eta_os_b - eta_os_bbar))
513 - tageff_os * tag_os * (eta_os_b - eta_os_bbar)
514 + 0.5 * tageff_asym_os * tag_os * (eta_os_b + eta_os_bbar) );
516 else if(finalstate == -1){
517 if(tag_os == 0)
return cp_coeff_bar * (1 - detection_asym) * (2 * (1 - tageff_os) - tageff_asym_os * production_asym);
518 else return 1.0 * cp_coeff_bar * (1 - detection_asym) * (tageff_os - 0.5 * tag_os * tageff_asym_os
519 - tag_os * production_asym * (tageff_os - 0.5 * tag_os * tageff_asym_os
520 - tageff_os * (eta_os_b + eta_os_bbar)
521 + 0.5 * tageff_asym_os * (eta_os_b - eta_os_bbar))
522 - tageff_os * tag_os * (eta_os_b - eta_os_bbar)
523 + 0.5 * tageff_asym_os * tag_os * (eta_os_b + eta_os_bbar) );
526 std::cout <<
"ERROR\t" <<
"DecRateCoeff_Bd::evaluate(...): No valid finalstate!" << std::endl;
530 if(coeff_type ==
kCosh){
532 if(tag_os == 0)
return cp_coeff * (1 + detection_asym) * (2 * (1 - tageff_os) - tageff_asym_os * production_asym);
533 else return cp_coeff * (1 + detection_asym) * (tageff_os - 0.5 * tag_os * tageff_asym_os
534 - tag_os * production_asym * (tageff_os - 0.5 * tag_os * tageff_asym_os
535 - tageff_os * (eta_os_b + eta_os_bbar)
536 + 0.5 * tageff_asym_os * (eta_os_b - eta_os_bbar))
537 - tageff_os * tag_os * (eta_os_b - eta_os_bbar)
538 + 0.5 * tageff_asym_os * tag_os * (eta_os_b + eta_os_bbar) );
540 else if(finalstate == -1){
541 if(tag_os == 0)
return cp_coeff_bar * (1 - detection_asym) * (2 * (1 - tageff_os) - tageff_asym_os * production_asym);
542 else return cp_coeff_bar * (1 - detection_asym) * (tageff_os - 0.5 * tag_os * tageff_asym_os
543 - tag_os * production_asym * (tageff_os - 0.5 * tag_os * tageff_asym_os
544 - tageff_os * (eta_os_b + eta_os_bbar)
545 + 0.5 * tageff_asym_os * (eta_os_b - eta_os_bbar))
546 - tageff_os * tag_os * (eta_os_b - eta_os_bbar)
547 + 0.5 * tageff_asym_os * tag_os * (eta_os_b + eta_os_bbar) );
550 std::cout <<
"ERROR\t" <<
"DecRateCoeff_Bd::evaluate(...): No valid finalstate!" << std::endl;
555 std::cout <<
"ERROR\t" <<
"DecRateCoeff_Bd::evaluate(...): No valid finalstate!" << std::endl;
562 double difference = 0;
564 double tageff_os_b = tageff_os - 0.5 * tageff_asym_os;
565 double tageff_os_bbar = tageff_os + 0.5 * tageff_asym_os;
567 double tageff_ss_b = tageff_ss - 0.5 * tageff_asym_ss;
568 double tageff_ss_bbar = tageff_ss + 0.5 * tageff_asym_ss;
570 if( tag_os == 0 && tag_ss == 0) {
571 sum = (1 - tageff_os_b - tageff_ss_b + tageff_os_b * tageff_ss_b) + (1 - tageff_os_bbar - tageff_ss_bbar + tageff_os_bbar * tageff_ss_bbar);
572 difference = (1 - tageff_os_b - tageff_ss_b + tageff_os_b * tageff_ss_b) - (1 - tageff_os_bbar - tageff_ss_bbar + tageff_os_bbar * tageff_ss_bbar);
574 else if(tag_os == 0 && tag_ss != 0){
575 sum = 0.5 * tageff_ss_b * (1 - tageff_os_b + tag_ss * (1 - tageff_os_b - 2 * eta_ss_b + 2 * eta_ss_b * tageff_os_b))
576 + 0.5 * tageff_ss_bbar * (1 - tageff_os_bbar - tag_ss * (1 - tageff_os_bbar - 2 * eta_ss_bbar + 2 * eta_ss_bbar * tageff_os_bbar));
577 difference = 0.5 * tageff_ss_b * (1 - tageff_os_b + tag_ss * (1 - tageff_os_b - 2 * eta_ss_b + 2 * eta_ss_b * tageff_os_b))
578 - 0.5 * tageff_ss_bbar * (1 - tageff_os_bbar - tag_ss * (1 - tageff_os_bbar - 2 * eta_ss_bbar + 2 * eta_ss_bbar * tageff_os_bbar));
580 else if(tag_ss == 0 && tag_os != 0){
581 sum = 0.5 * tageff_os_b * (1 - tageff_ss_b + tag_os * (1 - tageff_ss_b - 2 * eta_os_b + 2 * eta_os_b * tageff_ss_b))
582 + 0.5 * tageff_os_bbar * (1 - tageff_ss_bbar - tag_os * (1 - tageff_ss_bbar - 2 * eta_os_bbar + 2 * eta_os_bbar * tageff_ss_bbar));
583 difference = 0.5 * tageff_os_b * (1 - tageff_ss_b + tag_os * (1 - tageff_ss_b - 2 * eta_os_b + 2 * eta_os_b * tageff_ss_b))
584 - 0.5 * tageff_os_bbar * (1 - tageff_ss_bbar - tag_os * (1 - tageff_ss_bbar - 2 * eta_os_bbar + 2 * eta_os_bbar * tageff_ss_bbar));
586 else if(tag_ss != 0 && tag_os != 0){
587 sum = 0.25 * tageff_os_b * tageff_ss_b * (1 + tag_ss * (1 - 2 * eta_ss_b) + tag_os * (1 - 2 * eta_os_b)
588 + tag_os * tag_ss * (1 - 2 * eta_os_b - 2 * eta_ss_b + 4 * eta_os_b * eta_ss_b))
589 + 0.25 * tageff_os_bbar * tageff_ss_bbar * (1 - tag_ss * (1 - 2 * eta_ss_bbar) - tag_os * (1 - 2 * eta_os_bbar)
590 + tag_os * tag_ss * (1 - 2 * eta_os_bbar - 2 * eta_ss_bbar + 4 * eta_os_bbar * eta_ss_bbar));
591 difference = 0.25 * tageff_os_b * tageff_ss_b * (1 + tag_ss * (1 - 2 * eta_ss_b) + tag_os * (1 - 2 * eta_os_b)
592 + tag_os * tag_ss * (1 - 2 * eta_os_b - 2 * eta_ss_b + 4 * eta_os_b * eta_ss_b))
593 - 0.25 * tageff_os_bbar * tageff_ss_bbar * (1 - tag_ss * (1 - 2 * eta_ss_bbar) - tag_os * (1 - 2 * eta_os_bbar)
594 + tag_os * tag_ss * (1 - 2 * eta_os_bbar - 2 * eta_ss_bbar + 4 * eta_os_bbar * eta_ss_bbar));
597 std::cout <<
"ERROR\t" <<
"DecRateCoeff_Bd::evaluate(...): No valid tag combination!" << std::endl;
602 if (coeff_type ==
kSin){
604 return -1.0 * (1 + detection_asym) * cp_coeff * ( difference - production_asym * sum );
606 else if(finalstate==-1){
607 return -1.0 * (1 - detection_asym) * cp_coeff_bar * ( difference - production_asym * sum );
610 std::cout <<
"ERROR\t" <<
"DecRateCoeff_Bd::evaluate(...): No valid finalstate!" << std::endl;
614 else if (coeff_type ==
kCos){
616 return +1.0 * (1 + detection_asym) * cp_coeff * ( difference - production_asym * sum );
618 else if(finalstate==-1){
619 return +1.0 * (1 - detection_asym) * cp_coeff_bar * ( difference - production_asym * sum );
622 std::cout <<
"ERROR\t" <<
"DecRateCoeff_Bd::evaluate(...): No valid finalstate!" << std::endl;
626 else if (coeff_type ==
kSinh){
628 return 1.0 * (1 + detection_asym) * cp_coeff * ( sum - production_asym * difference );
630 else if(finalstate==-1){
631 return 1.0 * (1 - detection_asym) * cp_coeff_bar * ( sum - production_asym * difference );
634 std::cout <<
"ERROR\t" <<
"DecRateCoeff_Bd::evaluate(...): No valid finalstate!" << std::endl;
638 else if (coeff_type ==
kCosh){
640 return +1.0 * (1 + detection_asym) * cp_coeff * ( sum - production_asym * difference );
642 else if(finalstate==-1){
643 return +1.0 * (1 - detection_asym) * cp_coeff_bar * ( sum - production_asym * difference );
646 std::cout <<
"ERROR\t" <<
"DecRateCoeff_Bd::evaluate(...): No valid finalstate!" << std::endl;
651 std::cout <<
"ERROR\t" <<
"DecRateCoeff_Bd::evaluate(...): No valid coefficient type!" << std::endl;
std::pair< double, double > calibrate(double eta, double avg_eta, double p0, double p1, double delta_p0, double delta_p1) const