6 #include "TLorentzVector.h"
8 #include "TLorentzRotation.h"
11 #include "TGraphErrors.h"
12 #include "TClonesArray.h"
34 TGraphErrors*
buildGraph(vector<TH1D*> histo,
unsigned int n){
35 unsigned int nbins=histo[0]->GetNbinsX();
37 TGraphErrors* g=
new TGraphErrors(nbins);
38 for(
unsigned int ib=0;ib<nbins;++ib){
39 double x=histo[0]->GetBinCenter(ib+1);
40 double val=histo[0]->GetBinContent(ib+1);
41 double dx=histo[0]->GetBinWidth(ib+1)*0.5;
42 g->SetPoint(ib,x,val);
45 for(
unsigned int ih=0;ih<
n;++ih){
46 double xi=val-histo[ih]->GetBinContent(ib+1);
50 g->SetPointError(ib,dx,sqrt(sigma));
62 void plotWeightedEvts(TTree* mctr, TTree* datatr, TString outfilename, TString
mass,
unsigned int nsamples=1){
64 gROOT->SetStyle(
"Plain");
67 const Int_t NRGBs = 5;
68 Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
69 Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
70 Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
71 Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
72 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
74 gStyle->SetNumberContours(NCont);
78 massbin=(
"_m")+mass;massbin.ReplaceAll(
" ",
"");
85 gStyle->SetOptStat(0);
86 gStyle->SetOptTitle(0);
87 gStyle->SetStripDecimals(1);
88 TGaxis::SetMaxDigits(4);
92 gStyle->SetTextFont(font);
93 gStyle->SetLabelFont(font,
"xyz");
94 gStyle->SetTitleFont(font,
"xyz");
97 TH1D* hMMC=
new TH1D(
"hMMC"+massbin,
"Mass (MC)",60,1.0,3.0);
99 TH1D* hMData=
new TH1D(
"hMData"+massbin,
"Mass (DATA)",60,1.0,3.0);
100 hM.push_back(hMData);
103 vector<TH1D*> hMIsobar;
104 vector<TH1D*> hMIsobar2;
105 vector<TH1D*> hMIsobar3;
111 vector<TH1D*> hHe22Phi;
113 vector<TH1D*> hHe31Phi;
115 vector<TH1D*> hHe21Phi;
118 for(
unsigned int isamples=0;isamples<nsamples;++isamples){
119 TString blub;blub+=
massbin;blub+=
"_";blub+=isamples;
120 TH1D* hMIsobarMC=
new TH1D(
"hMIsobarMC"+blub,
"Isobar Mass (MC) for m_{5#pi}="+mass,nbninsm,0.2,3);
121 hMIsobar.push_back(hMIsobarMC);
124 TH1D* hMIsobar2MC=
new TH1D(
"hMIsobar2MC"+blub,
"Isobar Mass (MC)",nbninsm,0.4,2.7);
125 hMIsobar2.push_back(hMIsobar2MC);
126 hMIsobar2MC->Sumw2();
128 TH1D* hMIsobar3MC=
new TH1D(
"hMIsobar3MC"+blub,
"Isobar Mass (MC)",nbninsm,0.2,2.2);
129 hMIsobar3.push_back(hMIsobar3MC);
130 hMIsobar3MC->Sumw2();
132 TString name=
"hGJMC";name+=+
massbin;name+=
"_";name+=isamples;
133 TH1D* hGJMC=
new TH1D(name,
"Cos Gottfried-Jackson Theta (MC)",nbinsang,-1,1);
134 hGJ.push_back(hGJMC);
137 TH1D* hTYMC=
new TH1D(
"hTYMC"+blub,
"Treiman-Yang Phi (MC)",nbinsang,-TMath::Pi(),TMath::Pi());
138 hTY.push_back(hTYMC);
142 TH1D* hGJ2MC=
new TH1D(
"hGJ2MC"+blub,
"Cos Gottfried-Jackson Theta (MC)",nbinsang,-1,1);
143 hGJ2.push_back(hGJ2MC);
146 TH1D* hHe22MC=
new TH1D(
"hHe22ThMC"+blub,
"Helicity Theta 2pi2pi (MC)",nbinsang,-1,1);
147 hHe22.push_back(hHe22MC);
150 TH1D* hHe22PhiMC=
new TH1D(
"hHe22PhiMC"+blub,
"Helicity Phi 2pi2pi (MC)",nbinsang,-TMath::Pi(),TMath::Pi());
151 hHe22Phi.push_back(hHe22PhiMC);
154 TH1D* hHe31MC=
new TH1D(
"hHe31ThMC"+blub,
"Helicity Theta 3pi1pi (MC)",nbinsang,-1,1);
155 hHe31.push_back(hHe31MC);
158 TH1D* hHe31PhiMC=
new TH1D(
"hHe31PhiMC"+blub,
"Helicity Phi 3pi1pi (MC)",nbinsang,-TMath::Pi(),TMath::Pi());
159 hHe31Phi.push_back(hHe31PhiMC);
163 TH1D* hHe21MC=
new TH1D(
"hHe21ThMC"+blub,
"Helicity Theta 2pi1pi (MC)",nbinsang,-1,1);
164 hHe21.push_back(hHe21MC);
167 TH1D* hHe21PhiMC=
new TH1D(
"hHe21PhiMC"+blub,
"Helicity Phi 2pi1pi (MC)",nbinsang,-TMath::Pi(),TMath::Pi());
168 hHe21Phi.push_back(hHe21PhiMC);
173 TH1D* hMIsobarData=
new TH1D(
"hMIsobarData"+massbin,
"Isobar mass (DATA)",nbninsm,0.2,3);
174 hMIsobar.push_back(hMIsobarData);
176 TH1D* hMIsobarAPS=
new TH1D(
"hMIsobarAPS"+massbin,
"Isobar mass (Accepted PS)",nbninsm,0.2,3);
185 TH1D* hMIsobar2Data=
new TH1D(
"hMIsobar2Data"+massbin,
"Isobar mass (DATA)",nbninsm,0.4,2.7);
186 hMIsobar2.push_back(hMIsobar2Data);
187 TH1D* hMIsobar2APS=
new TH1D(
"hMIsobar2APS"+massbin,
"Isobar mass (Accepted PS)",nbninsm,0.4,2.7);
189 TH1D* hMIsobar3Data=
new TH1D(
"hMIsobar3Data"+massbin,
"Isobar mass (DATA)",nbninsm,0.2,2.3);
190 hMIsobar3.push_back(hMIsobar3Data);
191 TH1D* hMIsobar3APS=
new TH1D(
"hMIsobar3APS"+massbin,
"Isobar mass (Accepted PS)",nbninsm,0.2,2.3);
193 TH1D* hGJData=
new TH1D(
"hGJData"+massbin,
"Cos Gottfried-Jackson Theta (DATA)",nbinsang,-1,1); hGJ.push_back(hGJData);
195 TH1D* hGJAPS=
new TH1D(
"hGJAPS"+massbin,
"Cos Gottfried-Jackson Theta (Accepted PS)",nbinsang,-1,1);
197 TH1D* hHe22Data=
new TH1D(
"hHe22ThData"+massbin,
"Helicity Theta 2pi2pi (Data)",nbinsang,-1,1);
198 hHe22.push_back(hHe22Data);
199 TH1D* hHe22APS=
new TH1D(
"hHe22ThAPS"+massbin,
"Helicity Theta 2pi2pi (Accepted PS)",nbinsang,-1,1);
202 TH1D* hHe22PhiData=
new TH1D(
"hHe22PhiData"+massbin,
"Helicity Phi 2pi2pi (Data)",nbinsang,-TMath::Pi(),TMath::Pi());
203 hHe22Phi.push_back(hHe22PhiData);
204 TH1D* hHe22PhiAPS=
new TH1D(
"hHe22PhiAPS"+massbin,
"Helicity Phi 2pi2pi (Accepted PS)",nbinsang,-TMath::Pi(),TMath::Pi());
207 TH1D* hHe31Data=
new TH1D(
"hHe31ThData"+massbin,
"Helicity Theta 3pi1pi (Data)",nbinsang,-1,1);
208 hHe31.push_back(hHe31Data);
209 TH1D* hHe31APS=
new TH1D(
"hHe31ThAPS"+massbin,
"Helicity Theta 3pi1pi (Accepted PS)",nbinsang,-1,1);
211 TH1D* hHe31PhiData=
new TH1D(
"hHe31PhiData"+massbin,
"Helicity Phi 3pi1pi (Data)",nbinsang,-TMath::Pi(),TMath::Pi());
212 hHe31Phi.push_back(hHe31PhiData);
213 TH1D* hHe31PhiAPS=
new TH1D(
"hHe31PhiAPS"+massbin,
"Helicity Phi 3pi1pi (Accepted PS)",nbinsang,-TMath::Pi(),TMath::Pi());
216 TH1D* hHe21Data=
new TH1D(
"hHe21ThData"+massbin,
"Helicity Theta 2pi1pi (Data)",nbinsang,-1,1);
217 hHe21.push_back(hHe21Data);
218 TH1D* hHe21APS=
new TH1D(
"hHe21ThAPS"+massbin,
"Helicity Theta 2pi1pi (Accepted PS)",nbinsang,-1,1);
220 TH1D* hHe21PhiData=
new TH1D(
"hHe21PhiData"+massbin,
"Helicity Phi 2pi1pi (Data)",nbinsang,-TMath::Pi(),TMath::Pi());
221 hHe21Phi.push_back(hHe21PhiData);
222 TH1D* hHe21PhiAPS=
new TH1D(
"hHe21PhiAPS"+massbin,
"Helicity Phi 2pi1pi (Accepted PS)",nbinsang,-TMath::Pi(),TMath::Pi());
224 vector<TH2D*> hM1vsGJ;
225 TH2D* hM1vsGJMC=
new TH2D(
"hM1vsGJMC"+massbin,
"M1 Cos Gottfried-Jackson Theta (MC)",nbinsang/4,-1,1,nbninsm/2,0.2,3.8);
226 hM1vsGJ.push_back(hM1vsGJMC);
227 TH2D* hM1vsGJData=
new TH2D(
"hM1vsGJData"+massbin,
"M1 Cos Gottfried-Jackson Theta (Data)",nbinsang/4,-1,1,nbninsm/2,0.2,3.8);
228 hM1vsGJ.push_back(hM1vsGJData);
231 vector<TH1D*> hThetaLab;
232 TH1D* hThetaLabMC=
new TH1D(
"hThetaLabMC"+massbin,
"Cos Theta Lab (MC)",nbninsm,0.997,1);
233 hThetaLab.push_back(hThetaLabMC);
234 TH1D* hThetaLabData=
new TH1D(
"hThetaLabData"+massbin,
"Cos Theta Lab (Data)",nbninsm,0.997,1);
235 hThetaLab.push_back(hThetaLabData);
236 hThetaLab[0]->Sumw2();
239 TH2D* hGJtMC=
new TH2D(
"hGJtMC"+massbin,
"Cos GJ Theta vs t' (MC)",nbinsang,-1,1,20,0,0.01);
240 hGJt.push_back(hGJtMC);
241 TH2D* hGJtData=
new TH2D(
"hGJtData"+massbin,
"Cos GJ Theta vs t' (DATA)",nbinsang,-1,1,20,0,0.01); hGJt.push_back(hGJtData);
247 TH1D* hGJ2Data=
new TH1D(
"hGJ2Data"+massbin,
"Cos Gottfried-Jackson Theta (DATA)",nbinsang,-1,1); hGJ2.push_back(hGJ2Data);
248 TH1D* hGJ2APS=
new TH1D(
"hGJ2APS"+massbin,
"Cos Gottfried-Jackson Theta (Accepted PS)",nbinsang,-1,1); hGJ2.push_back(hGJ2Data);
257 TH1D* hTYData=
new TH1D(
"hTYData"+massbin,
"Treiman-Yang Phi (DATA)",nbinsang,-TMath::Pi(),TMath::Pi());
258 hTY.push_back(hTYData);
259 TH1D* hTYAPS=
new TH1D(
"hTYAPS"+massbin,
"Treiman-Yang Phi (Accepted PS)",nbinsang,-TMath::Pi(),TMath::Pi());
262 TH1D* hTY2MC=
new TH1D(
"hTY2MC"+massbin,
"Treiman-Yang Phi (MC)",nbinsang,-TMath::Pi(),TMath::Pi());
263 TH1D* hTY2Data=
new TH1D(
"hTY2Data"+massbin,
"Treiman-Yang Phi (DATA)",nbinsang,-TMath::Pi(),TMath::Pi());
264 hTY2.push_back(hTY2MC);
265 hTY2.push_back(hTY2Data);
270 TH1D* hTY3MC=
new TH1D(
"hTY3MC"+massbin,
"Treiman-Yang Phi (MC)",nbinsang,-TMath::Pi(),TMath::Pi());
271 TH1D* hTY3Data=
new TH1D(
"hTY3Data"+massbin,
"Treiman-Yang Phi (DATA)",nbinsang,-TMath::Pi(),TMath::Pi());
272 hTY3.push_back(hTY3MC);
273 hTY3.push_back(hTY3Data);
280 for(
unsigned int itree=0;itree<2;++itree){
281 TTree* tr= itree==0 ? mctr : datatr;
282 if(tr==NULL)
continue;
284 double weight=1;
double impweight=1;
286 TClonesArray*
p=
new TClonesArray(
"TLorentzVector");
287 TLorentzVector* beam=NULL;
289 std::vector<int>*
q=NULL;
290 std::vector<double> weights(nsamples);
292 for(
unsigned int isamples=0;isamples<nsamples;++isamples){
293 TString wname(
"W");wname+=isamples;
294 tr->SetBranchAddress(wname.Data(),&weights[isamples]);
298 if (itree==0)tr->SetBranchAddress(
"weight",&weight);
299 if (itree==0)tr->SetBranchAddress(
"impweight",&impweight);
300 tr->SetBranchAddress(
"p",&p);
301 tr->SetBranchAddress(
"beam",&beam);
302 tr->SetBranchAddress(
"qbeam",&qbeam);
303 tr->SetBranchAddress(
"q",&q);
311 unsigned int nevt=tr->GetEntries();
312 for(
unsigned int i=0;
i<nevt;++
i){
314 if(itree==1){weight=1;impweight=1;}
315 if(weight==0)
continue;
319 if(impweight!=0)weight/=impweight;
321 if(weight>maxweight)maxweight=weight;
322 if(itree==0)avweight+=weight;
327 unsigned int npart=
event.nParticles();
329 for(
unsigned int ipart=0;ipart<npart;++ipart){
330 TLorentzVector p=
event.getParticle(ipart).p();
331 hThetaLab[itree]->Fill(p.CosTheta(),weight);
341 unsigned int nstates=
event.nStates();
342 for(
unsigned int is=0;is<nstates;++is){
345 if(state.
n()==npart){
348 hM[itree]->Fill(state.
p().M());
352 if(state.
n()==npart-1 && state.
q()==0){
355 hGJAPS->Fill(state.
p().CosTheta());
356 hMIsobarAPS->Fill(state.
p().M());
357 hTYAPS->Fill(state.
p().Phi());
358 for(
unsigned int isamples=0;isamples<nsamples;++isamples){
359 hGJ[isamples]->Fill(state.
p().CosTheta(),weights[isamples]);
360 hTY[isamples]->Fill(state.
p().Phi(),weights[isamples]);
361 hMIsobar[isamples]->Fill(state.
p().M(),weights[isamples]);
365 hGJ[nsamples+itree-1]->Fill(state.
p().CosTheta(),1);
366 hMIsobar[nsamples+itree-1]->Fill(state.
p().M(),1);
368 hTY[nsamples+itree-1]->Fill(state.
p().Phi(),1);
372 else if(state.
n()==npart-2 && state.
q()==-1){
374 hGJ2APS->Fill(state.
p().CosTheta());
375 hMIsobar2APS->Fill(state.
p().M());
376 for(
unsigned int isamples=0;isamples<nsamples;++isamples){
377 hGJ2[isamples]->Fill(state.
p().CosTheta(),weights[isamples]);
378 hMIsobar2[isamples]->Fill(state.
p().M(),weights[isamples]);
382 hGJ2[itree+nsamples-1]->Fill(state.
p().CosTheta(),1);
383 hMIsobar2[itree+nsamples-1]->Fill(state.
p().M(),1);
386 else if(state.
n()==npart-3 && state.
q()==0){
388 hMIsobar3APS->Fill(state.
p().M());
389 for(
unsigned int isamples=0;isamples<nsamples;++isamples){
391 hMIsobar3[isamples]->Fill(state.
p().M(),weights[isamples]);
396 hMIsobar3[itree+nsamples-1]->Fill(state.
p().M(),1);
406 TLorentzVector pX=
event.p();
408 for(
unsigned int is=0;is<nstates;++is){
411 if(state.
n()==4 && state.
q()==0){
414 for(
unsigned int js=0;js<nstates;++js){
417 if(substate.
n()==2 && substate.
q()==0){
420 TLorentzVector phe=
event.getHelicityFrame(pX,state.
p(),substate.
p());
422 hHe22APS->Fill(phe.CosTheta());
423 hHe22PhiAPS->Fill(phe.Phi());
424 for(
unsigned int isamples=0;isamples<nsamples;++isamples){
425 hHe22[isamples]->Fill(phe.CosTheta(),weights[isamples]);
426 hHe22Phi[isamples]->Fill(phe.Phi(),weights[isamples]);
430 hHe22[nsamples+itree-1]->Fill(phe.CosTheta(),1);
431 hHe22Phi[nsamples+itree-1]->Fill(phe.Phi(),1);
436 else if(substate.
n()==3 && substate.
q()==-1){
439 TLorentzVector phe=
event.getHelicityFrame(pX,state.
p(),substate.
p());
441 hHe31APS->Fill(phe.CosTheta());
442 hHe31PhiAPS->Fill(phe.Phi());
443 for(
unsigned int isamples=0;isamples<nsamples;++isamples){
444 hHe31[isamples]->Fill(phe.CosTheta(),weights[isamples]);
445 hHe31Phi[isamples]->Fill(phe.Phi(),weights[isamples]);
449 hHe31[nsamples+itree-1]->Fill(phe.CosTheta(),1);
450 hHe31Phi[nsamples+itree-1]->Fill(phe.Phi(),1);
458 if(state.
n()==3 && state.
q()==-1){
461 for(
unsigned int js=0;js<nstates;++js){
464 if(substate.
n()==2 && substate.
q()==0){
467 TLorentzVector phe=
event.getHelicityFrame(pX,state.
p(),substate.
p());
469 hHe21APS->Fill(phe.CosTheta());
470 hHe21PhiAPS->Fill(phe.Phi());
471 for(
unsigned int isamples=0;isamples<nsamples;++isamples){
472 hHe21[isamples]->Fill(phe.CosTheta(),weights[isamples]);
473 hHe21Phi[isamples]->Fill(phe.Phi(),weights[isamples]);
477 hHe21[nsamples+itree-1]->Fill(phe.CosTheta(),1);
478 hHe21Phi[nsamples+itree-1]->Fill(phe.Phi(),1);
489 if(itree==0)avweight/=(double)nevt;
490 cout <<
"Maxweight=" << maxweight << endl;
491 cout <<
"Average weight=" << avweight << endl;
497 TCanvas* cm=
new TCanvas(
"PredictM"+massbin,
"Weighted Events",20,20,600,800);
498 if (!cm) cout <<
" äh " << endl;
499 hM[0]->SetLineColor(kRed);
503 TCanvas* gjt=
new TCanvas(
"GJT"+massbin,
"Events",40,40,600,800);
505 hGJt[1]->Draw(
"COLZ");
509 TCanvas* c=
new TCanvas(
"KineValidate"+massbin,
"Weighted Events",10,10,600,800);
513 double totMC=hMIsobar[0]->Integral();
514 double totDATA=hMIsobar[nsamples]->Integral();
516 cerr <<
"totMC/totData = " << totMC/totDATA << endl;
518 for(
unsigned int isamples=0;isamples<nsamples;++isamples){
519 const char* opt= (isamples==0) ?
"" :
"same";
522 double totMC=hMIsobar[isamples]->Integral();
523 double totDATA=hMIsobar[nsamples]->Integral();
524 if(totMC!=0)hMIsobar[isamples]->Scale(totDATA/totMC);
525 hMIsobar[isamples]->SetLineColor(kRed);
527 hMIsobar[isamples]->Draw(opt);
531 totMC=hMIsobar2[isamples]->Integral();
532 totDATA=hMIsobar2[nsamples]->Integral();
533 if(totMC!=0)hMIsobar2[isamples]->Scale(totDATA/totMC);
534 hMIsobar2[isamples]->SetLineColor(kRed);
536 hMIsobar2[isamples]->Draw(opt);
540 totMC=hMIsobar3[isamples]->Integral();
541 totDATA=hMIsobar3[nsamples]->Integral();
542 if(totMC!=0)hMIsobar3[isamples]->Scale(totDATA/totMC);
543 hMIsobar3[isamples]->SetLineColor(kRed);
545 hMIsobar3[isamples]->Draw(opt);
548 totDATA=hGJ[nsamples]->Integral();
549 totMC=hGJ[isamples]->Integral();
550 if(totMC!=0)hGJ[isamples]->Scale(totDATA/totMC);
551 hGJ[isamples]->SetLineColor(kRed);
553 hGJ[isamples]->Draw(opt);
557 totDATA=hTY[nsamples]->Integral();
558 totMC=hTY[isamples]->Integral();
559 if(totMC!=0)hTY[isamples]->Scale(totDATA/totMC);
560 hTY[isamples]->SetLineColor(kRed);
562 hTY[isamples]->Draw(opt);
565 totMC=hGJ2[isamples]->Integral();
566 totDATA=hGJ2[nsamples]->Integral();
568 if(totMC!=0)hGJ2[isamples]->Scale(totDATA/totMC);
569 hGJ2[isamples]->SetLineColor(kRed);
570 hGJ2[isamples]->SetFillColor(kRed);
571 hGJ2[isamples]->Draw(opt);
575 totMC=hHe22[isamples]->Integral();
576 totDATA=hHe22[nsamples]->Integral();
578 if(totMC!=0)hHe22[isamples]->Scale(totDATA/totMC);
579 hHe22[isamples]->SetLineColor(kRed);
581 hHe22[isamples]->Draw(opt);
584 totMC=hHe22Phi[isamples]->Integral();
585 totDATA=hHe22Phi[nsamples]->Integral();
587 if(totMC!=0)hHe22Phi[isamples]->Scale(totDATA/totMC);
588 hHe22Phi[isamples]->SetLineColor(kRed);
590 hHe22Phi[isamples]->Draw(opt);
594 totMC=hHe31[isamples]->Integral();
595 totDATA=hHe31[nsamples]->Integral();
597 if(totMC!=0)hHe31[isamples]->Scale(totDATA/totMC);
598 hHe31[isamples]->SetLineColor(kRed);
600 hHe31[isamples]->Draw(opt);
603 totMC=hHe31Phi[isamples]->Integral();
604 totDATA=hHe31Phi[nsamples]->Integral();
606 if(totMC!=0)hHe31Phi[isamples]->Scale(totDATA/totMC);
607 hHe31Phi[isamples]->SetLineColor(kRed);
609 hHe31Phi[isamples]->Draw(opt);
612 totMC=hHe21[isamples]->Integral();
613 totDATA=hHe21[nsamples]->Integral();
615 if(totMC!=0)hHe21[isamples]->Scale(totDATA/totMC);
616 hHe21[isamples]->SetLineColor(kRed);
618 hHe21[isamples]->Draw(opt);
621 totMC=hHe21Phi[isamples]->Integral();
622 totDATA=hHe21Phi[nsamples]->Integral();
624 if(totMC!=0)hHe21Phi[isamples]->Scale(totDATA/totMC);
625 hHe21Phi[isamples]->SetLineColor(kRed);
627 hHe21Phi[isamples]->Draw(opt);
633 hGJ2[nsamples]->Draw(
"same E");
634 hGJ2[0]->GetYaxis()->SetRangeUser(0,hGJ2[0]->GetMaximum()*1.5);
638 hHe22[nsamples]->Draw(
"same E");
639 hHe22[0]->GetYaxis()->SetRangeUser(0,hHe22[0]->GetMaximum()*1.5);
643 hHe22Phi[nsamples]->Draw(
"same E");
644 hHe22Phi[0]->GetYaxis()->SetRangeUser(0,hHe22Phi[0]->GetMaximum()*1.5);
648 hHe31[nsamples]->Draw(
"same E");
649 hHe31[0]->GetYaxis()->SetRangeUser(0,hHe31[0]->GetMaximum()*1.5);
653 hHe31Phi[nsamples]->Draw(
"same E");
654 hHe31Phi[0]->GetYaxis()->SetRangeUser(0,hHe31Phi[0]->GetMaximum()*1.5);
658 hHe21[nsamples]->Draw(
"same E");
659 hHe21[0]->GetYaxis()->SetRangeUser(0,hHe21[0]->GetMaximum()*1.5);
663 hHe21Phi[nsamples]->Draw(
"same E");
664 hHe21Phi[0]->GetYaxis()->SetRangeUser(0,hHe21Phi[0]->GetMaximum()*1.5);
739 hDiffMIsobar=(TH1D*)hMIsobar[0]->Clone(
"hMIsobarDiff"+massbin);
740 hDiffMIsobar->Add(hMIsobar[nsamples],-1.);
741 hMIsobar[nsamples]->Draw(
"same E");
742 hDiffMIsobar->SetLineColor(kOrange-3);
743 hDiffMIsobar->Draw(
"same");
745 hMIsobar[0]->GetYaxis()->SetRangeUser(hDiffMIsobar->GetMinimum()*1.5,hMIsobar[0]->GetMaximum()*1.2);
747 TString lab=
massbin;lab.ReplaceAll(
"_m",
"m=");
748 TLatex* Label=
new TLatex(1.5,hMIsobar[0]->GetMaximum()*0.8,lab.Data());
755 hMIsobar2[nsamples]->Draw(
"same E");
756 hDiffMIsobar2=(TH1D*)hMIsobar2[0]->Clone(
"hMIsobar2Diff"+massbin);
757 hDiffMIsobar2->Add(hMIsobar2[nsamples],-1.);
758 hDiffMIsobar2->SetLineColor(kOrange-3);
759 hDiffMIsobar2->Draw(
"same E");
762 hMIsobar2[0]->GetYaxis()->SetRangeUser(hDiffMIsobar2->GetMinimum()*1.5,hMIsobar2[0]->GetMaximum()*1.2);
766 hMIsobar3[nsamples]->Draw(
"same E");
767 hDiffMIsobar3=(TH1D*)hMIsobar3[0]->Clone(
"hMIsobar3Diff"+massbin);
768 hDiffMIsobar3->Add(hMIsobar3[nsamples],-1.);
769 hDiffMIsobar3->SetLineColor(kOrange-3);
770 hDiffMIsobar3->Draw(
"same");
772 hMIsobar3[0]->GetYaxis()->SetRangeUser(hDiffMIsobar3->GetMinimum()*1.5,hMIsobar3[0]->GetMaximum()*1.2);
777 gGJ->SetLineColor(kMagenta);
778 gGJ->SetFillColor(kMagenta);
781 hGJ[nsamples]->Draw(
"same E");
783 hGJ[0]->GetYaxis()->SetRangeUser(0,hGJ[0]->GetMaximum()*1.5);
787 hTY[nsamples]->Draw(
"same E");
788 hTY[0]->GetYaxis()->SetRangeUser(0,hTY[0]->GetMaximum()*1.5);
793 TList* Hlist=gDirectory->GetList();
795 Hlist->Remove(datatr);
798 TFile* outfile=TFile::Open(outfilename,
"UPDATE");
799 TString psFileName=outfilename;
800 psFileName.ReplaceAll(
".root",massbin);
801 psFileName.Append(
".ps");
806 TH1D* hMIsobarMCGlob=(TH1D*)outfile->Get(
"hMIsobarMCGlob");
807 if(hMIsobarMCGlob==NULL)hMIsobarMCGlob=
new TH1D(
"hMIsobarMCGlob",
"4#pi Isobar Mass (MC)",nbninsm,0.2,3.8);
808 hMIsobarMCGlob->Add(hMIsobar[0]);
809 hMIsobarMCGlob->Write();
810 TH1D* hMIsobarDataGlob=(TH1D*)outfile->Get(
"hMIsobarDataGlob");
811 if(hMIsobarDataGlob==NULL)hMIsobarDataGlob=
new TH1D(
"hMIsobarDataGlob",
"4#pi Isobar mass (DATA)",nbninsm,0.2,3.8);
812 hMIsobarDataGlob->Add(hMIsobar[nsamples]);
813 hMIsobarDataGlob->Write();
815 TH1D* hMIsobar2MCGlob=(TH1D*)outfile->Get(
"hMIsobar2MCGlob");
816 if(hMIsobar2MCGlob==NULL)hMIsobar2MCGlob=
new TH1D(
"hMIsobar2MCGlob",
"3#pi Isobar mass (MC)",nbninsm,0.4,3.6);
817 hMIsobar2MCGlob->Add(hMIsobar2[0]);
818 hMIsobar2MCGlob->Write();
820 TH1D* hMIsobar2DataGlob=(TH1D*)outfile->Get(
"hMIsobar2DataGlob");
821 if(hMIsobar2DataGlob==NULL)hMIsobar2DataGlob=
new TH1D(
"hMIsobar2DataGlob",
"3#pi Isobar mass (DATA)",nbninsm,0.4,3.6);
822 hMIsobar2DataGlob->Add(hMIsobar2[nsamples]);
823 hMIsobar2DataGlob->Write();
825 TH1D* hMIsobar3MCGlob=(TH1D*)outfile->Get(
"hMIsobar3MCGlob");
826 if(hMIsobar3MCGlob==NULL)hMIsobar3MCGlob=
new TH1D(
"hMIsobar3MCGlob",
"2#pi Isobar mass (MC)",nbninsm,0.2,3.4);
827 hMIsobar3MCGlob->Add(hMIsobar3[0]);
828 hMIsobar3MCGlob->Write();
830 TH1D* hMIsobar3DataGlob=(TH1D*)outfile->Get(
"hMIsobar3DataGlob");
831 if(hMIsobar3DataGlob==NULL)hMIsobar3DataGlob=
new TH1D(
"hMIsobar3DataGlob",
"2#pi Isobar mass (DATA)",nbninsm,0.2,3.4);
832 hMIsobar3DataGlob->Add(hMIsobar3[nsamples]);
833 hMIsobar3DataGlob->Write();
836 TH1D* hGJMCGlob=(TH1D*)outfile->Get(
"hGJMCGlob");
837 if(hGJMCGlob==NULL)hGJMCGlob=
new TH1D(
"hGJMCGlob",
"Gottfried-Jackson Theta (MC)",nbinsang,-1,1);
838 hGJMCGlob->Add(hGJ[0]);
841 TH1D* hGJDataGlob=(TH1D*)outfile->Get(
"hGJDataGlob");
842 if(hGJDataGlob==NULL)hGJDataGlob=
new TH1D(
"hGJDataGlob",
"Gottfried-Jackson Theta (Data)",nbinsang,-1,1);
843 hGJDataGlob->Add(hGJ[nsamples]);
844 hGJDataGlob->Write();
846 TH1D* hGJ2MCGlob=(TH1D*)outfile->Get(
"hGJ2MCGlob");
847 if(hGJ2MCGlob==NULL)hGJ2MCGlob=
new TH1D(
"hGJ2MCGlob",
"Gottfried-Jackson Theta (MC)",nbinsang,-1,1);
848 hGJ2MCGlob->Add(hGJ2[0]);
851 TH1D* hGJ2DataGlob=(TH1D*)outfile->Get(
"hGJ2DataGlob");
852 if(hGJ2DataGlob==NULL)hGJ2DataGlob=
new TH1D(
"hGJ2DataGlob",
"Gottfried-Jackson Theta (Data)",nbinsang,-1,1);
853 hGJ2DataGlob->Add(hGJ2[nsamples]);
854 hGJ2DataGlob->Write();
893 TCanvas dummyCanv(
"dummy",
"dummy");
894 c->Print((psFileName));
896 int nobj=Hlist->GetEntries();
897 std::cout<<
"Found "<<nobj<<
" Objects in HList"<<std::endl;
911 int main(
int argc,
char** argv){
914 cout <<
" not enough arguments! " << endl;
918 TString evtfile(argv[1]);
919 TString mcfile(argv[2]);
920 TString outfile(argv[3]);
921 TString
mass(argv[4]);
923 TFile* file1=TFile::Open(evtfile,
"READ");
924 TFile* file2=TFile::Open(mcfile,
"READ");
925 TTree* data=(TTree*)file1->Get(
"events");
926 TTree* mc=(TTree*)file2->Get(
"pwevents");