8 vector<double>
_blindingPars(
unsigned long seed,
double range,
unsigned long offset){
10 return vector<double>();
11 vector<double> pars(3, seed + offset);
18 double _deltaz_Re,
double deltaz_Re_step,
double _deltaz_Im,
double deltaz_Im_step,
19 unsigned long blindingSeed,
double zBlindRange,
double deltazBlindRange) :
20 zcp_Re(
"zcp_Re",
FitParameter::FIT, _zcp_Re, zcp_Re_step, 0., 0., this,
22 zcp_Im(
"zcp_Im",
FitParameter::FIT, _zcp_Im, zcp_Im_step, 0., 0., this,
24 deltaz_Re(
"deltaz_Re",
FitParameter::FIT, _deltaz_Re, deltaz_Re_step, 0., 0., this,
26 deltaz_Im(
"deltaz_Im",
FitParameter::FIT, _deltaz_Im, deltaz_Im_step, 0., 0., this,
32 zcp_Re(
"zcp_Re", fname.c_str(), this,
FitParameter::FIT),
33 zcp_Im(
"zcp_Im", fname.c_str(), this,
FitParameter::FIT),
34 deltaz_Re(
"deltaz_Re", fname.c_str(), this,
FitParameter::FIT),
35 deltaz_Im(
"deltaz_Im", fname.c_str(), this,
FitParameter::FIT)
61 pair<complex<double>, complex<double> >
BinFlipParSet::fromXY(
double x,
double y,
double magqoverp,
double phi) {
62 complex<double> z(-y, -x) ;
63 complex<double> qoverp = polar(magqoverp, phi) ;
64 complex<double> poverq = pow(qoverp, -1) ;
65 complex<double>
zcp = z * (qoverp + poverq) / 2. ;
66 complex<double>
deltaz = z * (qoverp - poverq) / 2. ;
73 m_zcp(fitPars->unblindZcp()),
74 m_dz(fitPars->unblindDeltaz())
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 ;
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) ;
111 double dsigma = sqrt(ichi2 - chi2) ;
112 if(dsigma <= nSigmaRange)
113 hscan.SetBinContent(i1, i2, dsigma) ;
115 hscan.SetBinContent(i1, i2, 0.) ;
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) ;
126 xtitle =
"#delta " + xtitle ;
127 ytitle =
"#delta " + ytitle ;
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) ;
148 m_hadronicPars(hadronicPars),
149 m_timeBinning(timeBins)
155 const string& hadronicParsName,
const string& timeBinsName,
156 const string& fname) :
158 m_hadronicPars(hadronicParsName, fname),
159 m_timeBinning(timeBinsName, fname)
170 throw invalid_argument(
"The phase binning of the hadronic parameters and binned data don't match!") ;
192 unsigned iPhaseBin = 1 ;
193 for(
auto& binhistos : histos) {
194 TH1F& rminus = binhistos[2] ;
195 TH1F& rplus = binhistos[5] ;
196 TH1F& rdiff = binhistos[6] ;
197 TH1F rminusfit = TH1F(rminus) ;
198 rminusfit.SetName((
string(rminus.GetName()) +
"_fit").c_str()) ;
199 TH1F rplusfit = TH1F(rplus) ;
200 rplusfit.SetName((
string(rplus.GetName()) +
"_fit").c_str()) ;
201 TH1F rdifffit = TH1F(rdiff) ;
202 rdifffit.SetName((
string(rdiff.GetName()) +
"_fit").c_str()) ;
208 double rdiff = rplus-rminus ;
209 rminusfit.SetBinContent(iTimeBin+1, rminus) ;
210 rminusfit.SetBinError(iTimeBin+1, 0.) ;
211 rplusfit.SetBinContent(iTimeBin+1, rplus) ;
212 rplusfit.SetBinError(iTimeBin+1, 0.) ;
213 rdifffit.SetBinContent(iTimeBin+1, rdiff) ;
214 rdifffit.SetBinError(iTimeBin+1, 0.) ;
216 binhistos.push_back(rminusfit) ;
217 binhistos.push_back(rplusfit) ;
218 binhistos.push_back(rdifffit) ;
227 for(
auto& binhistos : histos)
228 for(
auto& histo : binhistos)
248 chi2 += flipper->getVal() ;
255 flipper->parametersChanged() ;
std::deque< std::deque< TH1F > > plotsVsTime(const std::string &) const
unsigned nBinsPhase() const
virtual void parametersChanged() override
BinFlipParSet(double, double, double, double, double, double, double, double, unsigned long blindingSeed=0, double zBlindRange=0., double deltazBlindRange=0.)
BinFlipParSet * m_fitPars
TH2D scan2D(unsigned, unsigned, float nSigmaRange=5., unsigned nBins=300, bool zeroCentre=true, float scale=1.)
std::complex< double > unblindDeltaz() const
TimeBinning m_timeBinning
std::complex< double > m_zcp
double blindedMean() const
const PhaseBinningBase & binning() const
Get the binning scheme.
virtual double getVal() override
IMinuitParameter * getParPtr(unsigned int i)
void savePlotsVsTime(const std::string &, TFile &) const
BinFlipChi2Base(BinFlipParSet *)
std::complex< double > unblindZcp() const
BinFlipChi2(BinFlipParSet *, const HadronicParameters &, const TimeBinning &)
vector< double > _blindingPars(unsigned long seed, double range, unsigned long offset)
MINT::FitParameter zcp_Re
virtual const std::string & name() const
static std::pair< std::complex< double >, std::complex< double > > fromXY(double, double, double, double)
virtual void parametersChanged() override
MINT::FitParameter deltaz_Re
BinFlipChi2Simul(BinFlipChi2 *, BinFlipChi2 *)
std::complex< double > deltaz() const
MINT::FitParameter zcp_Im
virtual void setCurrentFitVal(double fv)
std::complex< double > zcp() const
double meanUnmixedTime(unsigned) const
virtual double getCurrentFitVal() const
double meanUnmixedTime2(unsigned) const
const Bin & bin(IDalitzEvent &) const
Get the bin for a DalitzEvent.
void checkPhaseBinning() const
BinFlipParSet * getBinFlipParSet()
HadronicParameters::BinningPtr phaseBinning() const
double chiSquared(unsigned, unsigned, double, double) const
std::complex< double > m_dz
double getLifetime() const
std::deque< std::deque< TH1F > > plotsVsTime(const std::string &) const
double Rbar(double, double, double, const std::complex< double > &, const std::complex< double > &) const
virtual double getVal() override
MINT::FitParameter deltaz_Im
HadronicParameters m_hadronicPars
std::deque< BinFlipChi2 * > BinFlippers
unsigned nBinsTime() const
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...