10   return binNumber > 0 ? 1 : -1 ;
    14   return binNumber > 0 ;
    22   return binInfo(evt).binNumber ;
    26   return other.
nBins == nBins && other.
type() == type() ;
    30   return !(operator==(other)) ;
    52   binNo.
amp = m_model->ComplexVal(evt) ;
    53   binNo.
ampBar = m_cpmodel->ComplexVal(evt) ;
    54   binNo.
F = norm(binNo.
amp) ;
    56   double phasediff = arg(binNo.
amp/binNo.
ampBar) ;
    61   if(!isFavoured(binNo.
F, binNo.
Fbar, evt))
    64     phasediff += 2. * TMath::Pi() ;
    65   binNo.
binNumber = (int(phasediff * nBins/2./TMath::Pi() + 0.5) % nBins + 1) ;
    67   if(binNo.
Fbar > binNo.
F)
    73   string name = _name + 
"_binning_" ;
    74   os << name << 
"type\t" << type() << endl ;
    75   os << name << 
"nBins\t" << nBins << endl ;
    76   os << name << 
"eventPattern" ;
    77   for(
const auto& ipat : m_model->getAmpPtr(0)->getTreePattern().getVectorOfInts())
    80   os << name << 
"cpEventPattern" ;
    81   for(
const auto& ipat : m_cpmodel->getAmpPtr(0)->getTreePattern().getVectorOfInts())
    87                                          const string& fname) {
    88   string name = _name + 
"_binning_" ;
   113   return "model3body" ;
   118   int i1(1), i2(2), i3(3) ;
   120   for(
unsigned i = 1 ; i < pat.
size() ; ++i){
   121     if(pat[i].charge() > 0)
   123     else if(pat[i].charge() < 0)
   128   double s13 = evt.
s(i1, i3) ;
   129   double s23 = evt.
s(i2, i3) ;
   134                                          const string& fname) {
   135   string name = _name + 
"_binning_" ;
   148                  double _Fbarplus, 
double _Fbarminus, 
const complex<double>& Xbar,
   149                  double norm, 
double normBar, 
double sumw, 
double sumw2) :
   150   m_Fplus(_Fplus * sumw * norm),
   151   m_Fminus(_Fminus * sumw * norm),
   153   m_Fbarplus(_Fbarplus * sumw * normBar),
   154   m_Fbarminus(_Fbarminus * sumw * normBar),
   161   m_X *= sqrt(Fplus() * Fminus()) * sumw * norm ;
   162   m_Xbar *= sqrt(Fbarplus() * Fbarminus()) * sumw * normBar ;
   190   string name = 
getName(_name, number) ;
   224   m_Fplus += evtPlus.
F * weight ;
   225   m_Fminus += evtMinus.
F * weight ;
   226   m_Fbarplus += evtMinus.
Fbar * weight ;
   227   m_Fbarminus += evtPlus.
Fbar * weight ;
   228   m_X += conj(evtPlus.
amp) * evtPlus.
ampBar * weight ;
   229   m_Xbar += conj(evtMinus.
ampBar) * evtMinus.
amp * weight ;
   231   m_sumw2 += weight*weight ;
   235   return m_Fplus / m_sumw / m_norm ;
   239   return m_Fminus / m_sumw / m_norm ;
   243   return m_X / m_sumw / sqrt(Fplus() * Fbarminus()) / m_norm ;
   247   return conj(Xplus()) ;
   251   return m_Fbarplus / m_sumw / m_normBar ;
   255   return m_Fbarminus / m_sumw / m_normBar ;
   259   return m_Xbar / m_sumw / sqrt(Fbarplus() * Fminus()) / m_normBar ;
   263   return conj(Xbarplus()) ;
   283   string name = getName(_name, number) ;
   284   complex<double> Xp = Xplus() ;
   285   complex<double> Xbarp = Xbarplus() ;
   287   os << name << 
"_Fplus\t" << Fplus() << endl ;
   288   os << name << 
"_Fminus\t" << Fminus() << endl ;
   289   os << name << 
"_Xplus_Re\t" << Xp.real() << endl ;
   290   os << name << 
"_Xplus_Im\t" << Xp.imag() << endl ;
   291   os << name << 
"_Fbarplus\t" << Fbarplus() << endl ;
   292   os << name << 
"_Fbarminus\t" << Fbarminus() << endl ;
   293   os << name << 
"_Xbarplus_Re\t" << Xbarp.real() << endl ;
   294   os << name << 
"_Xbarplus_Im\t" << Xbarp.imag() << endl ;
   295   os << name << 
"_sumw\t" << m_sumw << endl ;
   296   os << name << 
"_sumw2\t" << m_sumw2 << endl ;
   297   os << name << 
"_norm\t" << m_norm << endl ;
   298   os << name << 
"_normBar\t" << m_normBar << endl ;
   303   sstr << name << 
"_bin_" << number ;
   308                   const complex<double>& zcp, 
const complex<double>& dz)
 const {
   309   complex<double> sumz(zcp + dz) ;
   310   return _R(t, t2, lifetime, zcp, dz, Fplus(), Fminus(), Xplus(), sumz) ;
   314                      const complex<double>& zcp, 
const complex<double>& dz)
 const {
   315   complex<double> sumz(zcp - dz) ;
   316   return _R(t, t2, lifetime, zcp, dz, Fbarplus(), Fbarminus(), Xbarplus(), sumz) ;
   320                    const complex<double>& zcp, 
const complex<double>& dz,
   321                    double _Fplus, 
double _Fminus,
   322                    const complex<double>& X, 
const complex<double>& sumz)
 const {
   324   t2 /= lifetime * lifetime ;
   325   double r = _Fminus/_Fplus ;
   326   double term1 = (1 + 0.25 * t2 * (zcp*zcp - dz*dz).real()) ;
   327   double term2 = 0.25 * t2 * norm(sumz) ;
   328   double term3 = sqrt(r) * t * (conj(X) * sumz).real() ;
   329   double numerator = r * term1 + term2 + term3 ;
   330   double term4 = sqrt(r) * t * (X * sumz).real() ;
   331   double denominator = term1 + r * term2 + term4 ;
   332   return numerator/denominator ;
   343   m_phaseBinning(phaseBinning)
   351     m_bins.push_back(Bin(name, i, fname)) ;  
   356   return m_bins.at(binNo-1) ;
   375   for(
unsigned i = 0 ; i < nevt ; ++i)
   386   double normBar = 0. ;
   391   return pair<double, double>(norm, normBar) ;
   399   pair<double, double> norm = 
integral() ;
   400   norm.first /= _norm ;
   401   norm.second /= _normBar ;
   428   string strtype(type) ;
   429   if(strtype == 
string(
"model"))
   431   if(strtype == 
string(
"model3body"))
   433   throw invalid_argument(
"Unknown binning type: " + strtype) ;
 double getNorm() const
Get the normalisation.
double Fminus() const
Get the magnitude sq in the suppressed region.
std::complex< double > Xbarplus() const
Get the cross term for the favoured region, for the CP-conjugate decay.
void Print(const std::string &name, unsigned, std::ostream &os=std::cout) const
Print the parameters.
std::complex< double > m_Xbar
Cross term, for the CP-conjugate decay.
void Print(const std::string &, std::ostream &os=std::cout) const
Print the parameters.
std::complex< double > Xbarminus() const
Get the cross term for the suppressed region, for the CP-conjugate decay.
static BinningPtr getPhaseBinning(const std::string &, const std::string &fname="")
Get the PhaseBinning type.
double Fplus() const
Get the magnitude sq in the favoured region.
std::complex< double > amp
virtual void CP_conjugateYourself()
std::complex< double > Xplus() const
Get the cross term for the favoured region.
std::complex< double > m_X
Cross term.
virtual std::string type() const override
void setNormBar(double)
Set the normalisation, for the CP-conjugate decay.
static std::string getName(const std::string &, unsigned)
Get the name string.
virtual void Print(const std::string &, std::ostream &os=std::cout) const =0
HadronicParameters::BinningPtr binningPtr() const
Get a pointer to the binning scheme.
double m_Fbarminus
Magnitude sq. in the suppressed region, for the CP-conjugate decay.
const PhaseBinningBase & binning() const
Get the binning scheme.
ModelBinning3Body(ModelPtr, ModelPtr, unsigned)
Bin()
Initialise an empty bin.
double m_normBar
The normalisation scale for the CP-conjugate decay.
double m_Fminus
Magnitude sq. in the suppressed region.
Hadronic parameters in a bin of phase space.
static MINT::counted_ptr< PhaseBinningBase > fromConfig(const std::string &, const std::string &fname="")
double m_norm
The normalisation scale. - Are there potentially issues with having different normalisation for D0 an...
double m_sumw
Sum of weights.
virtual std::string type() const =0
Class for determining if an event lives in a +ve or -ve bin.
int binNumber(IDalitzEvent &) const
Phase binning class for 3-body decays using the line s13=s23 to determine favoured/suppressed.
Info on the bin of an Event - output of IPhaseBin::binInfo. Caches as much as possible for efficiency...
double m_sumw2
Sum of weights sq.
std::pair< double, double > normalise(double norm=1., double normBar=1.)
Normalise the parameters.
void add(const EventBinInfo &, const EventBinInfo &, double weight=1.)
Add a DalitzEvent and its conjugate.
double m_Fbarplus
Magnitude sq. in the favoured region, for the CP-conjugate decay.
void setNorm(double)
Set the normalisation.
virtual void Print(const std::string &, std::ostream &os=std::cout) const override
BinningPtr m_phaseBinning
HadronicParameters(const Bins &, BinningPtr)
Initialise from a predetermined set of bins.
ModelPhaseBinning(ModelPtr, ModelPtr, unsigned)
std::complex< double > Xminus() const
Get the cross term for the suppressed region.
Interface class for determining which bin an event lives in.
virtual bool isFavoured(const double, const double, IDalitzEvent &) const
void add(IDalitzEvent &, double weight=1.)
Add a DalitzEvent.
int binSign() const
Get the bin sign, +1 or -1.
std::complex< double > ampBar
virtual bool isFavoured(const double, const double, IDalitzEvent &) const override
double m_Fplus
Magnitude sq. in the favoured region.
void write(const std::string &, const std::string &) const
Write to a file.
std::pair< double, double > integral() const
Get the integral over phase space.
virtual const DalitzEventPattern & eventPattern() const =0
bool operator!=(const PhaseBinningBase &) const
double Fbarminus() const
Get the magnitude sq in the suppressed region, for the CP-conjugate decay.
unsigned int size() const
virtual EventBinInfo binInfo(IDalitzEvent &) const override
const Bin & bin(IDalitzEvent &) const
Get the bin for a DalitzEvent.
MINT::counted_ptr< PhaseBinningBase > BinningPtr
Pointer to the binning scheme.
virtual std::string type() const override
virtual double s(unsigned int i, unsigned int j) const =0
virtual EventBinInfo binInfo(IDalitzEvent &) const =0
std::deque< Bin > Bins
A set of bins.
bool isPlus() const
Check if the event is in a +ve bin.
double Fbarplus() const
Get the magnitude sq in the favoured region, for the CP-conjugate decay.
double Rbar(double, double, double, const std::complex< double > &, const std::complex< double > &) const
static MINT::counted_ptr< PhaseBinningBase > fromConfig(const std::string &, const std::string &fname="")
double _R(double, double, double, const std::complex< double > &, const std::complex< double > &, double, double, const std::complex< double > &, const std::complex< double > &) const
Get the expected ratio of events (suppressed)/(favoured) at the given time for the given mixing param...
virtual bool operator==(const PhaseBinningBase &) const
PhaseBinningBase(unsigned nBins)
double getNormBar() const
Get the normalisation, for the CP-conjugate decay.
double R(double, double, double, const std::complex< double > &, const std::complex< double > &) const
Get expected ratio of events (suppressed)/(favoured) at the given time for the given mixing parameter...