Skip to content

Commit

Permalink
Plot BG.
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiSchluter committed Oct 22, 2011
1 parent c41bf2b commit 2df6f28
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 27 deletions.
2 changes: 1 addition & 1 deletion draw.C
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
c= new TCanvas; c->Divide(3,2);
c->cd(1); h0->Draw(); hDwaveRe->Draw("same");
c->cd(1); h0->Draw(); hDwaveRe->Draw("same"); hDwaveBG->Draw("same");
c->cd(2); h2->Draw(); hPwaveRe->Draw("same");
c->cd(3); h3->Draw(); hPwaveIm->Draw("same");
//c->cd(4); hPhaseD->Draw();
Expand Down
64 changes: 38 additions & 26 deletions fitModel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ using namespace std;

class fitModelEtaPi : public fitModel {
public:
fitModelEtaPi() : mass(0), Dwave(0), Pwave(0), Gwave(0) {};
fitModelEtaPi() : mass(0), Dwave(0), DwaveBG(0), Pwave(0), Gwave(0), GwaveBG(0) {};
void evaluateAt(double mass_, const std::vector<double>& x);
std::complex<double> valueForWave(const char* name) const;
private:
double mass;
std::complex<double> phaseD;
std::complex<double> Dwave;
std::complex<double> DwaveBG;
std::complex<double> Pwave;
std::complex<double> Gwave;
std::complex<double> GwaveBG;
};

void
Expand All @@ -33,13 +35,13 @@ fitModelEtaPi::evaluateAt(double mass_, const vector<double>& x)

const double *par = &x[1];
Dwave = 0;
double Dbg = pow(phaseSpace, 2+.5+2)/mass*exp(-x[19]*phaseSpace*phaseSpace)*x[20]*(1 + mass*x[21] + mass*mass*x[22]);
DwaveBG = x[0]*pow(phaseSpace, 2+.5+2)/mass*exp(-x[19]*phaseSpace*phaseSpace)*x[20]*(1 + mass*x[21] + mass*mass*x[22]);
if (par[0] > 0 && par[1] > 0 && par[2] > par[0] && par[3] > 0 && mass > 0.77 + mPi)
Dwave = x[0]*(sqrt(mass)*BWcoupled(mass*mass, mPi, mEta, mPi, 0.77, par[0], par[1], 2, 2, 0.15/0.85)
+ Dbg
//+ (complex<double>(par[4], par[5])
// *BW(mass*mass, m1, m2, 2, par[2], par[3]))
);
Dwave = (x[0]*sqrt(mass)*BWcoupled(mass*mass, mPi, mEta, mPi, 0.77, par[0], par[1], 2, 2, 0.15/0.85)
+ DwaveBG
//+ (complex<double>(par[4], par[5])
// *BW(mass*mass, m1, m2, 2, par[2], par[3]))
);
phaseD = 1;
if (abs(Dwave) != 0)
phaseD = Dwave / abs(Dwave);
Expand All @@ -53,13 +55,13 @@ fitModelEtaPi::evaluateAt(double mass_, const vector<double>& x)

par = &x[13];
Gwave = 0;
double Gbg = pow(phaseSpace, 4+.5+2)/mass*exp(-x[23]*phaseSpace*phaseSpace)*(x[24] + mass*x[25] + mass*mass*x[26]);
GwaveBG = complex<double>(x[11],x[12])*pow(phaseSpace, 4+.5+2)/mass*exp(-x[23]*phaseSpace*phaseSpace)*(x[24] + mass*x[25] + mass*mass*x[26]);
if (par[0] > 0 && par[1] > 0 && par[2] > par[0] && par[3] > 0)
Gwave = complex<double>(x[11],x[12])*sqrt(mass)*(BW(mass*mass, m1, m2, 4, par[0], par[1])
+ Gbg
//+ (complex<double>(par[4], par[5])
// *BW(mass*mass, m1, m2, 4, par[2], par[3]))
);
Gwave = (complex<double>(x[11],x[12])*sqrt(mass)*BW(mass*mass, m1, m2, 4, par[0], par[1])
+ GwaveBG
//+ (complex<double>(par[4], par[5])
// *BW(mass*mass, m1, m2, 4, par[2], par[3]))
);
Gwave /= phaseD;
}

Expand All @@ -69,28 +71,34 @@ fitModelEtaPi::valueForWave(const char* name) const
{
if (!strcmp(name, "D+"))
return Dwave;
else if (!strcmp(name, "D+BG"))
return DwaveBG;
else if (!strcmp(name, "phaseD"))
return phaseD;
else if (!strcmp(name, "P+"))
return Pwave;
else if (!strcmp(name, "G+"))
return Gwave;
else if (!strcmp(name, "G+BG"))
return GwaveBG;

cerr << "unknown wave '" << name << "' requested" << endl;
exit(1);
}

class fitModelEtaPpi : public fitModel {
public:
fitModelEtaPpi() : mass(0), Dwave(0), Pwave(0), Gwave(0) {};
fitModelEtaPpi() : mass(0), Dwave(0), DwaveBG(0), Pwave(0), Gwave(0), GwaveBG(0) {};
void evaluateAt(double mass_, const std::vector<double>& x);
std::complex<double> valueForWave(const char* name) const;
private:
double mass;
std::complex<double> Dwave;
std::complex<double> DwaveBG;
std::complex<double> phaseD;
std::complex<double> Pwave;
std::complex<double> Gwave;
std::complex<double> GwaveBG;
};

void
Expand All @@ -104,13 +112,13 @@ fitModelEtaPpi::evaluateAt(double mass_, const vector<double>& x)

const double *par = &x[1];
Dwave = 0;
double Dbg = pow(phaseSpace, 2+.5+2)/mass*exp(-x[19]*phaseSpace*phaseSpace)*x[20]*(1 + mass*x[21] + mass*mass*x[22]);
DwaveBG = x[0]*pow(phaseSpace, 2+.5+2)/mass*exp(-x[19]*phaseSpace*phaseSpace)*x[20]*(1 + mass*x[21] + mass*mass*x[22]);
if (par[0] > 0 && par[1] > 0 && par[2] > par[0] && par[3] > 0)
Dwave = x[0]*(sqrt(mass)*BWcoupled(mass*mass, mPi, mEtaP, mPi, mEta, mPi, 0.77, par[0], par[1], 2, 2, 2, 0.15/0.85, 0.70/0.85)
+ Dbg
//+ (complex<double>(par[4], par[5])
// *BW(mass*mass, m1, m2, 2, par[2], par[3]))
);
Dwave = (x[0]*sqrt(mass)*BWcoupled(mass*mass, mPi, mEtaP, mPi, mEta, mPi, 0.77, par[0], par[1], 2, 2, 2, 0.15/0.85, 0.70/0.85)
//+ DwaveBG
+ (complex<double>(par[4], par[5])
*BW(mass*mass, m1, m2, 2, par[2], par[3]))
);
phaseD = 1;
if (abs(Dwave) != 0)
phaseD = Dwave / abs(Dwave);
Expand All @@ -124,13 +132,13 @@ fitModelEtaPpi::evaluateAt(double mass_, const vector<double>& x)

par = &x[13];
Gwave = 0;
double Gbg = pow(phaseSpace, 4+.5+2)/mass*exp(-x[23]*phaseSpace*phaseSpace)*(x[24] + mass*x[25] + mass*mass*x[26]);
GwaveBG = complex<double>(x[11],x[12])*pow(phaseSpace, 4+.5+2)/mass*exp(-x[23]*phaseSpace*phaseSpace)*(x[24] + mass*x[25] + mass*mass*x[26]);
if (par[0] > 0 && par[1] > 0 && par[2] > par[0] && par[3] > 0)
Gwave = complex<double>(x[11],x[12])*sqrt(mass)*(BW(mass*mass, m1, m2, 4, par[0], par[1])
+ Gbg
//+ (complex<double>(par[4], par[5])
// *BW(mass*mass, m1, m2, 4, par[2], par[3]))
);
Gwave = (complex<double>(x[11],x[12])*sqrt(mass)*BW(mass*mass, m1, m2, 4, par[0], par[1])
+ GwaveBG
//+ (complex<double>(par[4], par[5])
// *BW(mass*mass, m1, m2, 4, par[2], par[3]))
);
Gwave /= phaseD;
}

Expand All @@ -140,12 +148,16 @@ fitModelEtaPpi::valueForWave(const char* name) const
{
if (!strcmp(name, "D+"))
return Dwave;
else if (!strcmp(name, "D+BG"))
return DwaveBG;
else if (!strcmp(name, "phaseD"))
return phaseD;
else if (!strcmp(name, "P+"))
return Pwave;
else if (!strcmp(name, "G+"))
return Gwave;
else if (!strcmp(name, "G+BG"))
return GwaveBG;

cerr << "unknown wave '" << name << "' requested" << endl;
exit(1);
Expand Down
1 change: 1 addition & 0 deletions massDep.cc
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ int main(int argc, char **argv)

gHist.getHist("hPhaseD", "#phi(D)", info->getNbins(), info->getLower(), info->getUpper())->SetBinContent(i,arg(phaseD));
gHist.getHist("hDwaveRe", "Dwave", info->getNbins(), info->getLower(), info->getUpper())->SetBinContent(i,real(Dwave));
gHist.getHist("hDwaveBG", "DwaveBG", info->getNbins(), info->getLower(), info->getUpper())->SetBinContent(i,abs(DwaveBG));
gHist.getHist("hPwaveRe", "Re Pwave", info->getNbins(), info->getLower(), info->getUpper())->SetBinContent(i,real(Pwave));
gHist.getHist("hPwaveIm", "Im Pwave", info->getNbins(), info->getLower(), info->getUpper())->SetBinContent(i,(flipImag ? -1 : 1) * imag(Pwave));
gHist.getHist("hGwaveRe", "Re Gwave", info->getNbins(), info->getLower(), info->getUpper())->SetBinContent(i,real(Gwave));
Expand Down

0 comments on commit 2df6f28

Please sign in to comment.