MINT2
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
HadronicParameters Class Reference

#include <HadronicParameters.h>

Classes

class  Bin
 Hadronic parameters in a bin of phase space. More...
 
class  EventBinInfo
 Info on the bin of an Event - output of IPhaseBin::binInfo. Caches as much as possible for efficiency. More...
 
class  ModelBinning3Body
 Phase binning class for 3-body decays using the line s13=s23 to determine favoured/suppressed. More...
 
class  ModelPhaseBinning
 Class for determining if an event lives in a +ve or -ve bin. More...
 
class  PhaseBinningBase
 Interface class for determining which bin an event lives in. More...
 

Public Types

typedef MINT::counted_ptr< FitAmpSumModelPtr
 
typedef std::deque< BinBins
 A set of bins. More...
 
typedef MINT::counted_ptr< PhaseBinningBaseBinningPtr
 Pointer to the binning scheme. More...
 

Public Member Functions

 HadronicParameters (const Bins &, BinningPtr)
 Initialise from a predetermined set of bins. More...
 
 HadronicParameters (BinningPtr)
 Initialise from a binning scheme. More...
 
 HadronicParameters (const std::string &, const std::string &fname="")
 Initialise from a config file. More...
 
const PhaseBinningBasebinning () const
 Get the binning scheme. More...
 
HadronicParameters::BinningPtr binningPtr () const
 Get a pointer to the binning scheme. More...
 
const Binbin (IDalitzEvent &) const
 Get the bin for a DalitzEvent. More...
 
const Binbin (unsigned) const
 Get a bin by number. More...
 
void add (IDalitzEvent &, double weight=1.)
 Add a DalitzEvent. More...
 
void add (const DalitzEventPattern &, TRandom3 &, unsigned)
 Add a number of DalitzEvents generated from flat phase space. More...
 
void add (const DalitzEventPattern &, TRandom3 &)
 Add a DalitzEvent generated from flat phase space. More...
 
std::pair< double, double > integral () const
 Get the integral over phase space. More...
 
std::pair< double, double > normalise (double norm=1., double normBar=1.)
 Normalise the parameters. More...
 
void Print (const std::string &, std::ostream &os=std::cout) const
 Print the parameters. More...
 
void write (const std::string &, const std::string &) const
 Write to a file. More...
 

Static Public Member Functions

static BinningPtr getPhaseBinning (const std::string &, const std::string &fname="")
 Get the PhaseBinning type. More...
 

Private Attributes

Bins m_bins
 
BinningPtr m_phaseBinning
 

Detailed Description

Class describing the hadronic parameters in bins of phase difference.

Definition at line 16 of file HadronicParameters.h.

Member Typedef Documentation

◆ BinningPtr

Pointer to the binning scheme.

Definition at line 155 of file HadronicParameters.h.

◆ Bins

typedef std::deque<Bin> HadronicParameters::Bins

A set of bins.

Definition at line 153 of file HadronicParameters.h.

◆ ModelPtr

Definition at line 18 of file HadronicParameters.h.

Constructor & Destructor Documentation

◆ HadronicParameters() [1/3]

HadronicParameters::HadronicParameters ( const Bins bins,
BinningPtr  phaseBinning 
)

Initialise from a predetermined set of bins.

Definition at line 335 of file HadronicParameters.cpp.

336  :
337  m_bins(bins),
338  m_phaseBinning(phaseBinning)
339 {}

◆ HadronicParameters() [2/3]

HadronicParameters::HadronicParameters ( BinningPtr  phaseBinning)

Initialise from a binning scheme.

Definition at line 341 of file HadronicParameters.cpp.

341  :
342  m_bins(phaseBinning->nBins, HadronicParameters::Bin()),
343  m_phaseBinning(phaseBinning)
344 {}
Hadronic parameters in a bin of phase space.

◆ HadronicParameters() [3/3]

HadronicParameters::HadronicParameters ( const std::string &  ,
const std::string &  fname = "" 
)

Initialise from a config file.

Member Function Documentation

◆ add() [1/3]

void HadronicParameters::add ( IDalitzEvent evt,
double  weight = 1. 
)

Add a DalitzEvent.

Definition at line 363 of file HadronicParameters.cpp.

363  {
364  EventBinInfo binNo = m_phaseBinning->binInfo(evt) ;
365  DalitzEvent cpEvt(evt) ;
366  cpEvt.CP_conjugateYourself() ;
367  EventBinInfo cpBinNo = m_phaseBinning->binInfo(cpEvt) ;
368  if(binNo.isPlus())
369  m_bins.at(binNo.binNumber-1).add(binNo, cpBinNo, weight) ;
370  else
371  m_bins.at(cpBinNo.binNumber-1).add(cpBinNo, binNo, weight) ;
372 }
virtual EventBinInfo binInfo(IDalitzEvent &) const =0

◆ add() [2/3]

void HadronicParameters::add ( const DalitzEventPattern pat,
TRandom3 &  rndm,
unsigned  nevt 
)

Add a number of DalitzEvents generated from flat phase space.

Definition at line 374 of file HadronicParameters.cpp.

374  {
375  for(unsigned i = 0 ; i < nevt ; ++i)
376  add(pat, rndm) ;
377 }
void add(IDalitzEvent &, double weight=1.)
Add a DalitzEvent.

◆ add() [3/3]

void HadronicParameters::add ( const DalitzEventPattern pat,
TRandom3 &  rndm 
)

Add a DalitzEvent generated from flat phase space.

Definition at line 379 of file HadronicParameters.cpp.

379  {
380  DalitzEvent evt(pat, (TRandom*)&rndm) ;
381  add(evt) ;
382 }
void add(IDalitzEvent &, double weight=1.)
Add a DalitzEvent.

◆ bin() [1/2]

const HadronicParameters::Bin & HadronicParameters::bin ( IDalitzEvent evt) const

Get the bin for a DalitzEvent.

Definition at line 354 of file HadronicParameters.cpp.

354  {
355  int binNo = abs(m_phaseBinning->binNumber(evt)) ;
356  return m_bins.at(binNo-1) ;
357 }

◆ bin() [2/2]

const HadronicParameters::Bin & HadronicParameters::bin ( unsigned  i) const

Get a bin by number.

Definition at line 359 of file HadronicParameters.cpp.

359  {
360  return m_bins.at(i-1) ;
361 }

◆ binning()

const HadronicParameters::PhaseBinningBase & HadronicParameters::binning ( ) const

Get the binning scheme.

Definition at line 436 of file HadronicParameters.cpp.

436  {
437  return *m_phaseBinning ;
438 }

◆ binningPtr()

HadronicParameters::BinningPtr HadronicParameters::binningPtr ( ) const

Get a pointer to the binning scheme.

Definition at line 440 of file HadronicParameters.cpp.

440  {
441  return m_phaseBinning ;
442 }

◆ getPhaseBinning()

HadronicParameters::BinningPtr HadronicParameters::getPhaseBinning ( const std::string &  ,
const std::string &  fname = "" 
)
static

Get the PhaseBinning type.

Definition at line 426 of file HadronicParameters.cpp.

426  {
427  NamedParameter<string> type(name + "_binning_type", fname.c_str()) ;
428  string strtype(type) ;
429  if(strtype == string("model"))
430  return BinningPtr(ModelPhaseBinning::fromConfig(name, fname)) ;
431  if(strtype == string("model3body"))
432  return BinningPtr(ModelBinning3Body::fromConfig(name, fname)) ;
433  throw invalid_argument("Unknown binning type: " + strtype) ;
434 }
static MINT::counted_ptr< PhaseBinningBase > fromConfig(const std::string &, const std::string &fname="")
MINT::counted_ptr< PhaseBinningBase > BinningPtr
Pointer to the binning scheme.
static MINT::counted_ptr< PhaseBinningBase > fromConfig(const std::string &, const std::string &fname="")

◆ integral()

pair< double, double > HadronicParameters::integral ( ) const

Get the integral over phase space.

Definition at line 384 of file HadronicParameters.cpp.

384  {
385  double norm = 0. ;
386  double normBar = 0. ;
387  for(const auto& bin : m_bins){
388  norm += bin.Fplus() + bin.Fminus() ;
389  normBar += bin.Fbarplus() + bin.Fbarminus() ;
390  }
391  return pair<double, double>(norm, normBar) ;
392 }
double Fminus() const
Get the magnitude sq in the suppressed region.
double Fplus() const
Get the magnitude sq in the favoured region.
double Fbarminus() const
Get the magnitude sq in the suppressed region, for the CP-conjugate decay.
const Bin & bin(IDalitzEvent &) const
Get the bin for a DalitzEvent.
double Fbarplus() const
Get the magnitude sq in the favoured region, for the CP-conjugate decay.

◆ normalise()

pair< double, double > HadronicParameters::normalise ( double  norm = 1.,
double  normBar = 1. 
)

Normalise the parameters.

Definition at line 394 of file HadronicParameters.cpp.

394  {
395  for(auto& bin : m_bins){
396  bin.setNorm(1.) ;
397  bin.setNormBar(1.) ;
398  }
399  pair<double, double> norm = integral() ;
400  norm.first /= _norm ;
401  norm.second /= _normBar ;
402  for(auto& bin : m_bins){
403  bin.setNorm(norm.first) ;
404  bin.setNormBar(norm.second) ;
405  }
406  return norm ;
407 }
void setNormBar(double)
Set the normalisation, for the CP-conjugate decay.
void setNorm(double)
Set the normalisation.
std::pair< double, double > integral() const
Get the integral over phase space.
const Bin & bin(IDalitzEvent &) const
Get the bin for a DalitzEvent.

◆ Print()

void HadronicParameters::Print ( const std::string &  ,
std::ostream &  os = std::cout 
) const

Print the parameters.

Definition at line 409 of file HadronicParameters.cpp.

409  {
410  m_phaseBinning->Print(name, os) ;
411  unsigned i = 1 ;
412  for(const auto& bin : m_bins){
413  bin.Print(name, i, os) ;
414  i += 1 ;
415  }
416 }
void Print(const std::string &name, unsigned, std::ostream &os=std::cout) const
Print the parameters.
virtual void Print(const std::string &, std::ostream &os=std::cout) const =0
const Bin & bin(IDalitzEvent &) const
Get the bin for a DalitzEvent.

◆ write()

void HadronicParameters::write ( const std::string &  ,
const std::string &   
) const

Write to a file.

Definition at line 418 of file HadronicParameters.cpp.

418  {
419  ofstream fout ;
420  fout.open(fname) ;
421  Print(name, fout) ;
422  fout.close() ;
423 }
void Print(const std::string &, std::ostream &os=std::cout) const
Print the parameters.

Member Data Documentation

◆ m_bins

Bins HadronicParameters::m_bins
private

Definition at line 195 of file HadronicParameters.h.

◆ m_phaseBinning

BinningPtr HadronicParameters::m_phaseBinning
private

Definition at line 196 of file HadronicParameters.h.


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