18 #include "TGraphErrors.h"
27 gStyle->SetTextFont(font);
28 gStyle->SetLabelFont(font,
"xy");
29 gStyle->SetTitleFont(font,
"xy");
30 gStyle->SetOptStat(0);
31 gStyle->SetOptTitle(0);
32 gStyle->SetStripDecimals(1);
33 TGaxis::SetMaxDigits(4);
34 gStyle->SetFrameFillStyle(0);
35 gStyle->SetFrameBorderMode(0);
40 TFile* infile=TFile::Open(infilename,
"READ");
42 cerr <<
"File " << infilename <<
" not found!"<< endl;
45 TTree* pwa=(TTree*)infile->FindObjectAny(
"pwa");
47 cerr <<
"Tree not found!"<< endl;
52 string branchname(
"fitResult_v2");
53 if(pwa->FindBranch(branchname.c_str())==NULL){
54 cerr <<
"Invalid branch ."<<branchname<<endl;
59 unsigned int nbins=13;
60 TGraphErrors* gArgand=
new TGraphErrors(0);
61 TGraphErrors* gIntens=
new TGraphErrors(0);
62 TGraphErrors* gPhase=
new TGraphErrors(0);
64 TGraph* gPS=
new TGraph(nbins);
66 vector<TString> labels(nbins);
67 vector<double> xlabels(nbins);
68 vector<double> ylabels(nbins);
71 pwa->SetBranchAddress(branchname.c_str(),&res);
72 cout <<
"Entries: " <<pwa->GetEntries() << endl;
78 for(
unsigned int i=0;
i<names.size();++
i)cout << names[
i]<<endl;
82 unsigned int waa=res->
waveIndex(
"1-2-+0+pi-_02_f21270=pi-+_1_a11269=pi+-_0_rho770.amp");
89 for(
unsigned int c=0;c<nbins;++c){
98 TString Wave(
"V0_1-1++0+pi-_01_eta1");
101 if(ml<1000)Wave.Append(
"0");
105 if(mu<1000)Wave.Append(
"0");
108 Wave.Append(
"=pi-+_01_a11269=pi+-_01_rho770.amp");
111 TString wav=Wave; wav.ReplaceAll(
"V0_",
"");
118 unsigned int wa1=res->
waveIndex(wav.Data());
119 complex<double> amp=res->
prodAmp(wi1);
121 gPS->SetPoint(i,ml+0.5*dm,integral*integral);
122 if(amp.real()==0 && amp.imag()==0)
continue;
125 ampCov*=1./(integral*integral);
129 gArgand->SetPoint(i,amp.real(),amp.imag());
130 gArgand->SetPointError(i,sqrt(ampCov[0][0]),sqrt(ampCov[1][1]));
133 xlabels[
i]=amp.real();
134 ylabels[
i]=amp.imag();
135 labels[
i]+=ml+0.5*dm;
137 double intens=norm(amp);
139 gIntens->SetPoint(i,ml+0.5*dm,intens);
140 gIntens->SetPointError(i,0.5*dm,intensE);
142 double ph=180/TMath::Pi()*arg(amp);
146 double tn=amp.real()/amp.imag();
147 double dacot=-1./(1+tn*tn);
148 double dacotRe=dacot/amp.imag();
149 double dacotIm=dacot*amp.real();
157 double pherr=res->
phaseErr(wi1,waa);
163 gPhase->GetPoint(i-1,mpre,phpre);
164 double diff1=fabs(ph-phpre);
165 double diff2=fabs(ph+360-phpre);
166 double diff3=fabs(ph-360-phpre);
167 if(diff2<diff1 && diff2<diff3)ph+=360;
168 else if(diff3<diff1 && diff3<diff2)ph-=360;
173 gPhase->SetPoint(i,ml+0.5*dm,ph);
174 gPhase->SetPointError(i,dm*0.5,pherr);
179 TCanvas* c=
new TCanvas(
"c",
"c",10,10,1000,600);
182 gIntens->Draw(
"APL");
183 gIntens->GetXaxis()->SetRangeUser(800,2000);
184 gIntens->GetXaxis()->SetTitle(
"4#pi mass (GeV/c^{2})");
185 gIntens->GetYaxis()->SetTitle(
"Intensity");
186 gIntens->GetYaxis()->SetTitleOffset(1.2);
190 gPhase->GetXaxis()->SetRangeUser(800,2000);
191 gPhase->GetXaxis()->SetTitle(
"4#pi mass (GeV/c^{2})");
192 gPhase->GetYaxis()->SetTitle(
"Phase");
193 gPhase->GetYaxis()->SetTitleOffset(1.2);
195 gArgand->Draw(
"APL");
196 gArgand->GetXaxis()->SetTitle(
"Re");
197 gArgand->GetYaxis()->SetTitle(
"Im");
198 gArgand->GetYaxis()->SetTitleOffset(1.2);
201 for(
unsigned int j=0;j<nbins;++j){
202 cout << xlabels[j] <<
" "
203 << ylabels[j] <<
" " << labels[j].Data() << endl;
204 TLatex* lab=
new TLatex(xlabels[j],ylabels[j],labels[j].Data());