MINT2
Public Member Functions | Protected Attributes | List of all members
AmpsPdfFlexiFastCPV_mod Class Reference
Inheritance diagram for AmpsPdfFlexiFastCPV_mod:
MINT::PdfBase< IDalitzEvent > IDalitzPdf MINT::IPdf< IDalitzEvent > MINT::IReturnRealForEvent< IDalitzEvent > MINT::IReturnRealForEvent< IDalitzEvent > MINT::IPdf< IDalitzEvent > MINT::IReturnRealForEvent< IDalitzEvent > MINT::IReturnRealForEvent< IDalitzEvent >

Public Member Functions

void parametersChanged ()
 
void beginFit ()
 
void endFit ()
 
void printIntegralVals ()
 
double un_normalised_noPs (IDalitzEvent &evt)
 
virtual double getVal (IDalitzEvent &evt)
 
virtual double getVal_withPs (IDalitzEvent &evt)
 
virtual double getVal_noPs (IDalitzEvent &evt)
 
virtual double getVal (IDalitzEvent *evt)
 
virtual double getVal_withPs (IDalitzEvent *evt)
 
virtual double getVal_noPs (IDalitzEvent *evt)
 
virtual DalitzHistoSet histoSet ()
 
void doFinalStatsAndSaveForAmp12 (MINT::Minimiser *min=0, const std::string &fname="FitAmpResults", const std::string &fnameROOT="fitFractions")
 
 AmpsPdfFlexiFastCPV_mod (AmpsPdfFlexiFast *amps1, AmpsPdfFlexiFast *amps2, AmpsPdfFlexiFast *ampsSum, MINT::FitParameter &r, MINT::FitParameter &delta, MINT::FitParameter &gamma, MINT::FitParameter &tau, MINT::FitParameter &dGamma, MINT::FitParameter &dm, MINT::FitParameter &eff_tag, MINT::FitParameter &w)
 
- Public Member Functions inherited from MINT::PdfBase< IDalitzEvent >
 PdfBase ()
 
 PdfBase (const PdfBase< IDalitzEvent > &)
 
virtual double RealVal (IDalitzEvent &evt)
 
virtual double getNewVal (IDalitzEvent &evt)
 
virtual ~PdfBase ()
 
- Public Member Functions inherited from MINT::IPdf< IDalitzEvent >
virtual void Gradient (IDalitzEvent &evt, std::vector< double > &grad, MINT::MinuitParameterSet *mps)
 
virtual bool useAnalyticGradient ()
 
- Public Member Functions inherited from MINT::IReturnRealForEvent< IDalitzEvent >
virtual ~IReturnRealForEvent ()
 

Protected Attributes

AmpsPdfFlexiFast_amps1
 
AmpsPdfFlexiFast_amps2
 
AmpsPdfFlexiFast_ampsSum
 
FitParameter_r
 
FitParameter_delta
 
FitParameter_gamma
 
FitParameter_tau
 
FitParameter_dGamma
 
FitParameter_dm
 
FitParameter_eff_tag
 
FitParameter_w
 
double _intA
 
double _intAbar
 
complex< double > _intAAbar
 
RooRealVar * _r_t
 
RooRealVar * _r_dt
 
RooCategory * _r_q
 
RooRealVar * _r_mistag
 
RooCategory * _r_f
 
RooRealVar * _r_scale_mean_dt
 
RooRealVar * _r_scale_sigma_dt
 
RooAbsPdf * _pdf_sigma_t
 
RooAbsPdf * _pdf_omega_os
 
RooAbsPdf * _pdf_omega_ss
 
RooCubicSplineFun_spline
 
RooGaussEfficiencyModel_efficiency
 
NamedParameter< double > _min_TAU
 
NamedParameter< double > _max_TAU
 
DecRateCoeff_Bd_cos_coeff
 
DecRateCoeff_Bd_cosh_coeff
 
DecRateCoeff_Bd_sin_coeff
 
DecRateCoeff_Bd_sinh_coeff
 

Additional Inherited Members

- Protected Member Functions inherited from MINT::IReturnRealForEvent< IDalitzEvent >
 IReturnRealForEvent ()
 

Detailed Description

Definition at line 622 of file BsDsKpipi_TD_ampFit.cpp.

Constructor & Destructor Documentation

◆ AmpsPdfFlexiFastCPV_mod()

AmpsPdfFlexiFastCPV_mod::AmpsPdfFlexiFastCPV_mod ( AmpsPdfFlexiFast amps1,
AmpsPdfFlexiFast amps2,
AmpsPdfFlexiFast ampsSum,
MINT::FitParameter r,
MINT::FitParameter delta,
MINT::FitParameter gamma,
MINT::FitParameter tau,
MINT::FitParameter dGamma,
MINT::FitParameter dm,
MINT::FitParameter eff_tag,
MINT::FitParameter w 
)
inline

Definition at line 772 of file BsDsKpipi_TD_ampFit.cpp.

774  :
775  _amps1(amps1),_amps2(amps2),_ampsSum(ampsSum),_r(r),_delta(delta),_gamma(gamma),_tau(tau),_dGamma(dGamma),_dm(dm),_eff_tag(eff_tag),_w(w),
776  _intA(-1),_intAbar(-1),_intAAbar(-1),_min_TAU("min_TAU", 0.4), _max_TAU("max_TAU", 10.)
777  {
778  // Init B2DX parameters
779  _r_t = new RooRealVar("t", "time", _min_TAU, _max_TAU);
780  _r_dt = new RooRealVar("dt", "per-candidate time resolution estimate",0., 0.25);
781  _r_mistag = new RooRealVar("mistag", "mistag",0.);
782  _r_f = new RooCategory("qf", "qf");
783  _r_f->defineType("h+", +1);
784  _r_f->defineType("h-", -1);
785  _r_f->setRange("Range_p","h+");
786  _r_f->setRange("Range_m","h-");
787  _r_q = new RooCategory("qt", "qt");
788  _r_q->defineType("B+", +1);
789  _r_q->defineType("B-", -1) ;
790  _r_q->defineType("untagged", 0);
791 
792  _cosh_coeff = new DecRateCoeff_Bd("cosh_coeff",
793  "cosh_coeff",
795  *_r_f,
796  RooRealConstant::value(1.),
797  RooRealConstant::value(1.),
798  *_r_q,
799  *_r_mistag,
800  RooRealConstant::value(0.),
801  RooRealConstant::value(1.),
802  RooRealConstant::value(0.),
803  RooRealConstant::value(0.),
804  RooRealConstant::value(0.),
805  RooRealConstant::value(_eff_tag),
806  RooRealConstant::value(0.),
807  RooRealConstant::value(0.),
808  RooRealConstant::value(0.));
809 
810  _cos_coeff = new DecRateCoeff_Bd("cos_coeff",
811  "cos_coeff",
813  *_r_f,
814  RooRealConstant::value(1.),
815  RooRealConstant::value(-1.),
816  *_r_q,
817  *_r_mistag,
818  RooRealConstant::value(0.),
819  RooRealConstant::value(1.),
820  RooRealConstant::value(0.),
821  RooRealConstant::value(0.),
822  RooRealConstant::value(0.),
823  RooRealConstant::value(_eff_tag),
824  RooRealConstant::value(0.),
825  RooRealConstant::value(0.),
826  RooRealConstant::value(0.));
827 
828  _sinh_coeff = new DecRateCoeff_Bd("sinh_coeff",
829  "sinh_coeff",
831  *_r_f,
832  RooRealConstant::value(-2.),
833  RooRealConstant::value(-2.),
834  *_r_q,
835  *_r_mistag,
836  RooRealConstant::value(0.),
837  RooRealConstant::value(1.),
838  RooRealConstant::value(0.),
839  RooRealConstant::value(0.),
840  RooRealConstant::value(0.),
841  RooRealConstant::value(_eff_tag),
842  RooRealConstant::value(0.),
843  RooRealConstant::value(0.),
844  RooRealConstant::value(0.));
845 
846  _sin_coeff = new DecRateCoeff_Bd("sin_coeff",
847  "sin_coeff",
849  *_r_f,
850  RooRealConstant::value(2.),
851  RooRealConstant::value(-2.),
852  *_r_q,
853  *_r_mistag,
854  RooRealConstant::value(0.),
855  RooRealConstant::value(1.),
856  RooRealConstant::value(0.),
857  RooRealConstant::value(0.),
858  RooRealConstant::value(0.),
859  RooRealConstant::value(_eff_tag),
860  RooRealConstant::value(0.),
861  RooRealConstant::value(0.),
862  RooRealConstant::value(0.));
863  // Init pdf for sigma_t
864  _pdf_sigma_t = new RooGenericPdf("pdf_sigma_t","pow(7. / @1, 7) / 720. * pow(@0, 6) * exp(-7. * @0 / @1)",RooArgList(*_r_dt, RooRealConstant::value(0.04)));
865 
866  }
NamedParameter< double > _max_TAU
cosh/sinh/cos/sin coefficients in decay rate equations
NamedParameter< double > _min_TAU

Member Function Documentation

◆ beginFit()

void AmpsPdfFlexiFastCPV_mod::beginFit ( )
inlinevirtual

Reimplemented from MINT::PdfBase< IDalitzEvent >.

Definition at line 674 of file BsDsKpipi_TD_ampFit.cpp.

◆ doFinalStatsAndSaveForAmp12()

void AmpsPdfFlexiFastCPV_mod::doFinalStatsAndSaveForAmp12 ( MINT::Minimiser min = 0,
const std::string &  fname = "FitAmpResults",
const std::string &  fnameROOT = "fitFractions" 
)
inline

Definition at line 765 of file BsDsKpipi_TD_ampFit.cpp.

765  {
768  _amps1->doFinalStatsAndSave(min,((string)fname+".txt").c_str(),((string)fnameROOT+".root").c_str());
769  _amps2->doFinalStatsAndSave(min,((string)fname+"_CC.txt").c_str(),((string)fnameROOT+"_CC.root").c_str());
770  }
void doFinalStatsAndSave(MINT::Minimiser *min=0, const std::string &fname="FitAmpResults.txt", const std::string &fnameROOT="fitFractions.root")

◆ endFit()

void AmpsPdfFlexiFastCPV_mod::endFit ( )
inlinevirtual

Reimplemented from MINT::PdfBase< IDalitzEvent >.

Definition at line 678 of file BsDsKpipi_TD_ampFit.cpp.

◆ getVal() [1/2]

virtual double AmpsPdfFlexiFastCPV_mod::getVal ( IDalitzEvent evt)
inlinevirtual

Implements IDalitzPdf.

Definition at line 720 of file BsDsKpipi_TD_ampFit.cpp.

720  {
721 
722  const double f = static_cast<double>((int)evt.getValueFromVector(4));
723  const double val = un_normalised_noPs(evt);
724 
725  double r = (double)_r; // * sqrt(_intA/_intAbar);
726  const double Gamma = 1./((double) _tau);
727  const complex<double> phase_diff = polar((double)r,((double) _delta -(double)_gamma*f)/360.*2*pi);
728  const double int_interference = (phase_diff*_intAAbar).real();
729 
730  const complex<double> phase_diff_m = polar((double)r,((double) _delta + (double)_gamma)/360.*2*pi);
731  const complex<double> int_interference_m = phase_diff_m * _intAAbar ;
732 
733  const complex<double> phase_diff_p = polar((double)r,((double) _delta -(double)_gamma)/360.*2*pi);
734  const complex<double> int_interference_p = phase_diff_p * _intAAbar ;
735 
736 
737  if(_intA == -1 ){
738  cout << "AmpsPdfFlexiFastCPV:: _norm = -1, should not have happened." << endl;
739  throw "can't deal with that";
740  }
741 
742  //return val/(( _cosh_coeff->analyticalIntegral(1) * (_intA + r* r * _intAbar) * 4.*Gamma + _sinh_coeff->analyticalIntegral(1) * (int_interference_m.real() + int_interference_p.real())/4. * 2. * _dGamma )/ (4.*Gamma*Gamma-_dGamma*_dGamma));
743 
744  return val/(( _cosh_coeff->analyticalIntegral(1) * (_intA + r* r * _intAbar) * 4.*Gamma + _sinh_coeff->analyticalIntegral(1) * int_interference/2. * 2. * _dGamma )/ (4.*Gamma*Gamma-_dGamma*_dGamma))*2.;
745  }
double un_normalised_noPs(IDalitzEvent &evt)
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
static const double pi
virtual double getValueFromVector(unsigned int i) const =0

◆ getVal() [2/2]

virtual double AmpsPdfFlexiFastCPV_mod::getVal ( IDalitzEvent evt)
inlinevirtual

Implements IDalitzPdf.

Definition at line 750 of file BsDsKpipi_TD_ampFit.cpp.

750  {
751  if(0 == evt) return 0;
752  return getVal(*evt);
753  }
virtual double getVal(IDalitzEvent &evt)

◆ getVal_noPs() [1/2]

virtual double AmpsPdfFlexiFastCPV_mod::getVal_noPs ( IDalitzEvent evt)
inlinevirtual

Implements IDalitzPdf.

Definition at line 748 of file BsDsKpipi_TD_ampFit.cpp.

748 {return getVal(evt);}
virtual double getVal(IDalitzEvent &evt)

◆ getVal_noPs() [2/2]

virtual double AmpsPdfFlexiFastCPV_mod::getVal_noPs ( IDalitzEvent evt)
inlinevirtual

Implements IDalitzPdf.

Definition at line 758 of file BsDsKpipi_TD_ampFit.cpp.

758  {
759  if(0 == evt) return 0;
760  return getVal_noPs(*evt);
761  }
virtual double getVal_noPs(IDalitzEvent &evt)

◆ getVal_withPs() [1/2]

virtual double AmpsPdfFlexiFastCPV_mod::getVal_withPs ( IDalitzEvent evt)
inlinevirtual

Implements IDalitzPdf.

Definition at line 747 of file BsDsKpipi_TD_ampFit.cpp.

747 {return getVal(evt);}
virtual double getVal(IDalitzEvent &evt)

◆ getVal_withPs() [2/2]

virtual double AmpsPdfFlexiFastCPV_mod::getVal_withPs ( IDalitzEvent evt)
inlinevirtual

Implements IDalitzPdf.

Definition at line 754 of file BsDsKpipi_TD_ampFit.cpp.

754  {
755  if(0 == evt) return 0;
756  return getVal_withPs(*evt);
757  }
virtual double getVal_withPs(IDalitzEvent &evt)

◆ histoSet()

virtual DalitzHistoSet AmpsPdfFlexiFastCPV_mod::histoSet ( )
inlinevirtual

Implements IDalitzPdf.

Definition at line 763 of file BsDsKpipi_TD_ampFit.cpp.

763 {return _ampsSum->histoSet();}
virtual DalitzHistoSet histoSet() const

◆ parametersChanged()

void AmpsPdfFlexiFastCPV_mod::parametersChanged ( )
inlinevirtual

◆ printIntegralVals()

void AmpsPdfFlexiFastCPV_mod::printIntegralVals ( )
inline

Definition at line 683 of file BsDsKpipi_TD_ampFit.cpp.

683  {
684  cout << "intSum = " << _ampsSum->getIntegralValue() << endl;
685  cout << "intA = " << _intA << endl;
686  cout << "intAbar = " << _intAbar << endl;
687  cout << "intAAbar = " << _intAAbar.real() << endl;
688  }

◆ un_normalised_noPs()

double AmpsPdfFlexiFastCPV_mod::un_normalised_noPs ( IDalitzEvent evt)
inline

Definition at line 690 of file BsDsKpipi_TD_ampFit.cpp.

690  {
691  const double t = (double) evt.getValueFromVector(0);
692  const double dt = (double) evt.getValueFromVector(1);
693  const double q = static_cast<double>((int)evt.getValueFromVector(2));
694  const double w = (double) evt.getValueFromVector(3);
695  const double f = static_cast<double>((int)evt.getValueFromVector(4));
696  _r_t->setVal(t);
697  _r_dt->setVal(dt);
698  _r_q->setIndex(q);
699  _r_mistag->setVal(w);
700  _r_f->setIndex(f);
701 
702  //const double e_eff = fabs(q)*_eff_tag + (1.-fabs(q))*(1.-_eff_tag);
703  double r = (double)_r; // * sqrt(_intA/_intAbar);
704  const complex<double> phase_diff = polar((double)r,((double) _delta -(double)_gamma*f)/360.*2*pi);
705 
706  const std::complex<double> amp = _amps1->ComplexVal_un_normalised_noPs(evt) ;
707  const std::complex<double> amp_bar = _amps2->ComplexVal_un_normalised_noPs(evt) * phase_diff;
708 
709  const double val = exp(-fabs(t)/(double)_tau) *
710  (
711  (norm(amp) + norm(amp_bar))*cosh((double)_dGamma/2.*t)* _cosh_coeff->evaluate()
712  +(norm(amp) - norm(amp_bar)) *cos((double)_dm*t) * _cos_coeff->evaluate()
713  +real(amp_bar*conj(amp))*sinh((double)_dGamma/2.*t) * _sinh_coeff->evaluate()
714  +imag(amp_bar*conj(amp))*sin((double)_dm*t) * _sin_coeff->evaluate()
715  );
716 
717  return val;
718  }
static const double pi
Double_t evaluate() const
virtual double getValueFromVector(unsigned int i) const =0
std::complex< double > ComplexVal_un_normalised_noPs(IDalitzEvent &evt)

Member Data Documentation

◆ _amps1

AmpsPdfFlexiFast* AmpsPdfFlexiFastCPV_mod::_amps1
protected

Definition at line 626 of file BsDsKpipi_TD_ampFit.cpp.

◆ _amps2

AmpsPdfFlexiFast* AmpsPdfFlexiFastCPV_mod::_amps2
protected

Definition at line 627 of file BsDsKpipi_TD_ampFit.cpp.

◆ _ampsSum

AmpsPdfFlexiFast* AmpsPdfFlexiFastCPV_mod::_ampsSum
protected

Definition at line 628 of file BsDsKpipi_TD_ampFit.cpp.

◆ _cos_coeff

DecRateCoeff_Bd* AmpsPdfFlexiFastCPV_mod::_cos_coeff
protected

Definition at line 662 of file BsDsKpipi_TD_ampFit.cpp.

◆ _cosh_coeff

DecRateCoeff_Bd* AmpsPdfFlexiFastCPV_mod::_cosh_coeff
protected

Definition at line 663 of file BsDsKpipi_TD_ampFit.cpp.

◆ _delta

FitParameter& AmpsPdfFlexiFastCPV_mod::_delta
protected

Definition at line 631 of file BsDsKpipi_TD_ampFit.cpp.

◆ _dGamma

FitParameter& AmpsPdfFlexiFastCPV_mod::_dGamma
protected

Definition at line 635 of file BsDsKpipi_TD_ampFit.cpp.

◆ _dm

FitParameter& AmpsPdfFlexiFastCPV_mod::_dm
protected

Definition at line 636 of file BsDsKpipi_TD_ampFit.cpp.

◆ _eff_tag

FitParameter& AmpsPdfFlexiFastCPV_mod::_eff_tag
protected

Definition at line 637 of file BsDsKpipi_TD_ampFit.cpp.

◆ _efficiency

RooGaussEfficiencyModel* AmpsPdfFlexiFastCPV_mod::_efficiency
protected

Definition at line 658 of file BsDsKpipi_TD_ampFit.cpp.

◆ _gamma

FitParameter& AmpsPdfFlexiFastCPV_mod::_gamma
protected

Definition at line 632 of file BsDsKpipi_TD_ampFit.cpp.

◆ _intA

double AmpsPdfFlexiFastCPV_mod::_intA
protected

Definition at line 640 of file BsDsKpipi_TD_ampFit.cpp.

◆ _intAAbar

complex<double> AmpsPdfFlexiFastCPV_mod::_intAAbar
protected

Definition at line 642 of file BsDsKpipi_TD_ampFit.cpp.

◆ _intAbar

double AmpsPdfFlexiFastCPV_mod::_intAbar
protected

Definition at line 641 of file BsDsKpipi_TD_ampFit.cpp.

◆ _max_TAU

NamedParameter<double> AmpsPdfFlexiFastCPV_mod::_max_TAU
protected

Definition at line 660 of file BsDsKpipi_TD_ampFit.cpp.

◆ _min_TAU

NamedParameter<double> AmpsPdfFlexiFastCPV_mod::_min_TAU
protected

Definition at line 659 of file BsDsKpipi_TD_ampFit.cpp.

◆ _pdf_omega_os

RooAbsPdf* AmpsPdfFlexiFastCPV_mod::_pdf_omega_os
protected

Definition at line 654 of file BsDsKpipi_TD_ampFit.cpp.

◆ _pdf_omega_ss

RooAbsPdf* AmpsPdfFlexiFastCPV_mod::_pdf_omega_ss
protected

Definition at line 655 of file BsDsKpipi_TD_ampFit.cpp.

◆ _pdf_sigma_t

RooAbsPdf* AmpsPdfFlexiFastCPV_mod::_pdf_sigma_t
protected

Definition at line 653 of file BsDsKpipi_TD_ampFit.cpp.

◆ _r

FitParameter& AmpsPdfFlexiFastCPV_mod::_r
protected

Definition at line 630 of file BsDsKpipi_TD_ampFit.cpp.

◆ _r_dt

RooRealVar* AmpsPdfFlexiFastCPV_mod::_r_dt
protected

Definition at line 646 of file BsDsKpipi_TD_ampFit.cpp.

◆ _r_f

RooCategory* AmpsPdfFlexiFastCPV_mod::_r_f
protected

Definition at line 649 of file BsDsKpipi_TD_ampFit.cpp.

◆ _r_mistag

RooRealVar* AmpsPdfFlexiFastCPV_mod::_r_mistag
protected

Definition at line 648 of file BsDsKpipi_TD_ampFit.cpp.

◆ _r_q

RooCategory* AmpsPdfFlexiFastCPV_mod::_r_q
protected

Definition at line 647 of file BsDsKpipi_TD_ampFit.cpp.

◆ _r_scale_mean_dt

RooRealVar* AmpsPdfFlexiFastCPV_mod::_r_scale_mean_dt
protected

Definition at line 651 of file BsDsKpipi_TD_ampFit.cpp.

◆ _r_scale_sigma_dt

RooRealVar* AmpsPdfFlexiFastCPV_mod::_r_scale_sigma_dt
protected

Definition at line 652 of file BsDsKpipi_TD_ampFit.cpp.

◆ _r_t

RooRealVar* AmpsPdfFlexiFastCPV_mod::_r_t
protected

Definition at line 645 of file BsDsKpipi_TD_ampFit.cpp.

◆ _sin_coeff

DecRateCoeff_Bd* AmpsPdfFlexiFastCPV_mod::_sin_coeff
protected

Definition at line 664 of file BsDsKpipi_TD_ampFit.cpp.

◆ _sinh_coeff

DecRateCoeff_Bd* AmpsPdfFlexiFastCPV_mod::_sinh_coeff
protected

Definition at line 665 of file BsDsKpipi_TD_ampFit.cpp.

◆ _spline

RooCubicSplineFun* AmpsPdfFlexiFastCPV_mod::_spline
protected

Definition at line 657 of file BsDsKpipi_TD_ampFit.cpp.

◆ _tau

FitParameter& AmpsPdfFlexiFastCPV_mod::_tau
protected

Definition at line 634 of file BsDsKpipi_TD_ampFit.cpp.

◆ _w

FitParameter& AmpsPdfFlexiFastCPV_mod::_w
protected

Definition at line 638 of file BsDsKpipi_TD_ampFit.cpp.


The documentation for this class was generated from the following file: