MINT2
HadronicParameters.h
Go to the documentation of this file.
1 #ifndef __HADRONICPARAMETERS_H__
2 #define __HADRONICPARAMETERS_H__
3 
4 #include <Mint/DalitzEvent.h>
5 #include <Mint/counted_ptr.h>
6 #include <Mint/FitAmpSum.h>
7 #include <complex>
8 #include <deque>
9 #include <utility>
10 #include <iostream>
11 
12 class TRandom3 ;
13 
17  public :
19 
21  class EventBinInfo {
22  public :
23  // Should I use a counted_ptr?
25  std::complex<double> amp ;
26  std::complex<double> ampBar ;
27  double F ;
28  double Fbar ;
29  int binNumber ;
30 
32  int binSign() const ;
34  bool isPlus() const ;
35  } ;
38  public :
39  PhaseBinningBase(unsigned nBins) ;
40  virtual EventBinInfo binInfo(IDalitzEvent&) const = 0 ;
41  virtual std::string type() const = 0 ;
42  virtual void Print(const std::string&, std::ostream& os = std::cout) const = 0 ;
43  virtual ~PhaseBinningBase() {} ;
44  const unsigned nBins ;
45  int binNumber(IDalitzEvent&) const ;
46  virtual bool operator==(const PhaseBinningBase&) const ;
47  bool operator!=(const PhaseBinningBase&) const ;
48  } ;
51  public :
52  ModelPhaseBinning(ModelPtr, ModelPtr, unsigned) ;
53  virtual ~ModelPhaseBinning() {} ;
54  virtual EventBinInfo binInfo(IDalitzEvent&) const override ;
55  virtual std::string type() const override ;
56  virtual void Print(const std::string&, std::ostream& os = std::cout) const override ;
58  fromConfig(const std::string&, const std::string& fname = "") ;
59  // TODO: implement this - not really sure how best to check that the models are the same.
60  //virtual bool operator==(const PhaseBinningBase&) const override ;
61  protected :
62  virtual bool isFavoured(const double, const double, IDalitzEvent&) const ;
65  } ;
68  public :
69  ModelBinning3Body(ModelPtr, ModelPtr, unsigned) ;
70  virtual ~ModelBinning3Body() {} ;
71  virtual std::string type() const override ;
73  fromConfig(const std::string&, const std::string& fname = "") ;
74  protected :
75  virtual bool isFavoured(const double, const double, IDalitzEvent&) const override ;
76  } ;
78  class Bin {
79  private :
81  double m_Fplus ;
83  double m_Fminus ;
85  std::complex<double> m_X ;
87  double m_Fbarplus ;
89  double m_Fbarminus ;
91  std::complex<double> m_Xbar ;
93  double m_sumw ;
95  double m_sumw2 ;
97  double m_norm ;
99  double m_normBar ;
100 
102  double _R(double, double, double, const std::complex<double>&, const std::complex<double>&,
103  double, double, const std::complex<double>&, const std::complex<double>&) const ;
104  public :
106  Bin(double, double, const std::complex<double>&, double, double, const std::complex<double>&,
107  double norm = 1., double normbar = 1., double sumw = 1., double sumw2 = 1.) ;
109  Bin() ;
111  Bin(const std::string&, unsigned, const std::string& fname = "") ;
112 
114  void add(const EventBinInfo&, const EventBinInfo&, double weight = 1.) ;
116  double Fplus() const ;
118  double Fminus() const ;
120  std::complex<double> Xplus() const ;
122  std::complex<double> Xminus() const ;
124  double Fbarplus() const ;
126  double Fbarminus() const ;
128  std::complex<double> Xbarplus() const ;
130  std::complex<double> Xbarminus() const ;
132  double getNorm() const ;
134  void setNorm(double) ;
136  double getNormBar() const ;
138  void setNormBar(double) ;
140  void Print(const std::string& name, unsigned, std::ostream& os=std::cout) const ;
142  static std::string getName(const std::string&, unsigned) ;
143 
145  double R(double, double, double, const std::complex<double>&, const std::complex<double>&) const ;
148  double Rbar(double, double, double, const std::complex<double>&, const std::complex<double>&) const ;
149 
150  } ;
151 
153  typedef std::deque<Bin> Bins ;
156 
162  HadronicParameters(const std::string&, const std::string& fname = "") ;
163 
165  const PhaseBinningBase& binning() const ;
168 
170  const Bin& bin(IDalitzEvent&) const ;
172  const Bin& bin(unsigned) const ;
173 
175  void add(IDalitzEvent&, double weight = 1.) ;
177  void add(const DalitzEventPattern&, TRandom3&, unsigned) ;
179  void add(const DalitzEventPattern&, TRandom3&) ;
180 
182  std::pair<double, double> integral() const ;
183 
185  std::pair<double, double> normalise(double norm = 1., double normBar = 1.) ;
187  void Print(const std::string&, std::ostream& os = std::cout) const ;
189  void write(const std::string&, const std::string&) const ;
190 
192  static BinningPtr getPhaseBinning(const std::string&, const std::string& fname = "") ;
193 
194  private :
197 } ;
198 
199 #endif
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 > 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.
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
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.
MINT::counted_ptr< FitAmpSum > ModelPtr
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.
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.
bool operator!=(const PhaseBinningBase &) const
double Fbarminus() const
Get the magnitude sq in the suppressed region, for the CP-conjugate decay.
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 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
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...