MINT2
Public Member Functions | Protected Attributes | List of all members
BinFlipChi2Base Class Reference

#include <BinFlipChi2.h>

Inheritance diagram for BinFlipChi2Base:
MINT::Minimisable MINT::IMinimisable BinFlipChi2 BinFlipChi2Simul

Public Member Functions

 BinFlipChi2Base (BinFlipParSet *)
 
virtual void parametersChanged () override
 
TH2D scan2D (unsigned, unsigned, float nSigmaRange=5., unsigned nBins=300, bool zeroCentre=true, float scale=1.)
 
BinFlipParSetgetBinFlipParSet ()
 
- Public Member Functions inherited from MINT::Minimisable
 Minimisable (MinuitParameterSet *mps=0)
 
 Minimisable (const Minimisable &other)
 
virtual ~Minimisable ()
 
void setPset (MinuitParameterSet *mps)
 
MinuitParameterSetgetParSet ()
 
virtual void beginFit ()
 
virtual void endFit ()
 
double getVal ()=0
 
double getNewVal ()
 
- Public Member Functions inherited from MINT::IMinimisable
virtual void Gradient (std::vector< double > &grad)
 
virtual bool useAnalyticGradient ()
 
virtual void setUseAnalyticGradient (bool useAnalyticGradient)
 
virtual ~IMinimisable ()
 

Protected Attributes

BinFlipParSetm_fitPars
 
std::complex< double > m_zcp
 
std::complex< double > m_dz
 

Detailed Description

Definition at line 37 of file BinFlipChi2.h.

Constructor & Destructor Documentation

◆ BinFlipChi2Base()

BinFlipChi2Base::BinFlipChi2Base ( BinFlipParSet fitPars)

Definition at line 70 of file BinFlipChi2.cpp.

70  :
71  Minimisable(fitPars),
72  m_fitPars(fitPars),
73  m_zcp(fitPars->unblindZcp()),
74  m_dz(fitPars->unblindDeltaz())
75 {}
BinFlipParSet * m_fitPars
Definition: BinFlipChi2.h:45
std::complex< double > unblindDeltaz() const
Definition: BinFlipChi2.cpp:57
std::complex< double > m_zcp
Definition: BinFlipChi2.h:46
std::complex< double > unblindZcp() const
Definition: BinFlipChi2.cpp:53
Minimisable(MinuitParameterSet *mps=0)
Definition: Minimisable.cpp:6
std::complex< double > m_dz
Definition: BinFlipChi2.h:47

Member Function Documentation

◆ getBinFlipParSet()

BinFlipParSet * BinFlipChi2Base::getBinFlipParSet ( )

Definition at line 141 of file BinFlipChi2.cpp.

141  {
142  return m_fitPars ;
143 }
BinFlipParSet * m_fitPars
Definition: BinFlipChi2.h:45

◆ parametersChanged()

void BinFlipChi2Base::parametersChanged ( )
overridevirtual

Reimplemented from MINT::Minimisable.

Reimplemented in BinFlipChi2Simul.

Definition at line 77 of file BinFlipChi2.cpp.

77  {
80 }
BinFlipParSet * m_fitPars
Definition: BinFlipChi2.h:45
std::complex< double > unblindDeltaz() const
Definition: BinFlipChi2.cpp:57
std::complex< double > m_zcp
Definition: BinFlipChi2.h:46
std::complex< double > unblindZcp() const
Definition: BinFlipChi2.cpp:53
std::complex< double > m_dz
Definition: BinFlipChi2.h:47

◆ scan2D()

TH2D BinFlipChi2Base::scan2D ( unsigned  ip1,
unsigned  ip2,
float  nSigmaRange = 5.,
unsigned  nBins = 300,
bool  zeroCentre = true,
float  scale = 1. 
)

Definition at line 82 of file BinFlipChi2.cpp.

83  {
86  const double v1 = p1->getCurrentFitVal() ;
87  const double v2 = p2->getCurrentFitVal() ;
88  const double s1 = p1->err() ;
89  const double s2 = p2->err() ;
90  double v1min = v1 - s1 * nSigmaRange ;
91  double v1max = v1 + s1 * nSigmaRange ;
92  double v2min = v2 - s2 * nSigmaRange ;
93  double v2max = v2 + s2 * nSigmaRange ;
94  if(zeroCentre){
95  v1min -= v1 ;
96  v1max -= v1 ;
97  v2min -= v2 ;
98  v2max -= v2 ;
99  }
100  TH2D hscan(("deltachi2_" + p2->name() + "_vs_" + p1->name()).c_str(), "",
101  nBins, v1min*scale, v1max*scale, nBins, v2min*scale, v2max*scale) ;
102  const double chi2 = getVal() ;
103  for(unsigned i1 = 1 ; i1 < nBins + 1 ; ++i1){
104  double iv1 = hscan.GetXaxis()->GetBinCenter(i1) ;
105  for(unsigned i2 = 1 ; i2 < nBins + 1 ; ++i2){
106  double iv2 = hscan.GetYaxis()->GetBinCenter(i2) ;
107  p1->setCurrentFitVal(iv1) ;
108  p2->setCurrentFitVal(iv2) ;
110  double ichi2 = getVal() ;
111  double dsigma = sqrt(ichi2 - chi2) ;
112  if(dsigma <= nSigmaRange)
113  hscan.SetBinContent(i1, i2, dsigma) ;
114  else
115  hscan.SetBinContent(i1, i2, 0.) ;
116  }
117  }
118 
119  vector<string> titles(1, "Re(z_{CP})") ;
120  titles.push_back("Im(z_{CP})") ;
121  titles.push_back("Re(#Delta z)") ;
122  titles.push_back("Im(#Delta z)") ;
123  string xtitle = titles.at(ip1) ;
124  string ytitle = titles.at(ip2) ;
125  if(zeroCentre){
126  xtitle = "#delta " + xtitle ;
127  ytitle = "#delta " + ytitle ;
128  }
129  hscan.SetXTitle(xtitle.c_str()) ;
130  hscan.SetYTitle(ytitle.c_str()) ;
131  hscan.SetZTitle("N. #sigma") ;
132  hscan.SetContour(nSigmaRange) ;
133  hscan.SetStats(false) ;
134 
135  p1->setCurrentFitVal(v1) ;
136  p2->setCurrentFitVal(v2) ;
138  return hscan ;
139 }
virtual void parametersChanged() override
Definition: BinFlipChi2.cpp:77
BinFlipParSet * m_fitPars
Definition: BinFlipChi2.h:45
IMinuitParameter * getParPtr(unsigned int i)
virtual const std::string & name() const
Definition: FitParameter.h:144
virtual void setCurrentFitVal(double fv)
virtual double getCurrentFitVal() const
double err() const
double getVal()=0

Member Data Documentation

◆ m_dz

std::complex<double> BinFlipChi2Base::m_dz
protected

Definition at line 47 of file BinFlipChi2.h.

◆ m_fitPars

BinFlipParSet* BinFlipChi2Base::m_fitPars
protected

Definition at line 45 of file BinFlipChi2.h.

◆ m_zcp

std::complex<double> BinFlipChi2Base::m_zcp
protected

Definition at line 46 of file BinFlipChi2.h.


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