4 pl3DbeamLine(
int page=3,
char *core=
"R13078011",
int pl=0){
7 TString outPath=inPath;
8 TString fullInpName=Form(
"%s3D_beam_%s.hist.root",inPath,core);
10 fd=
new TFile(fullInpName);
12 printf(
"EROR: input histo file not found, quit\n",fullInpName.Data());
16 gStyle->SetPalette(1,0);
18 char *nameA[]={
"trStat",
"trCh2",
"trZ",
"trX",
"trY",
"trP",,
"trPt"};
19 char *nameB[]={
"fcnChiXY",
"fcnChiXnX",
"fcnChiYnY"};
20 char *nameC[]={
"bmSol",
"fcnDet",
"fcnDca",
"fcnDcaZ",
"fcnNtr"};
24 can=
new TCanvas(
"aa",
"aa",800,800); TPad *c=makeTitle(can,core,page);
25 c->Divide(3,3);gStyle->SetOptStat(111111);
27 for(
int i=0;i<7;i++) {
28 printf(
"->%s<\n",nameX[i]);
29 h=(TH1*)fd->Get(nameX[i]); assert(h);
30 c->cd(i+1); h->Draw();
37 can=
new TCanvas(
"aa",
"aa",900,650); TPad *c=makeTitle(can,core,page,0.85);
38 c->Divide(3,2);gStyle->SetOptStat(0);
40 for(
int i=0;i<3;i++) {
41 printf(
"->%s<\n",nameX[i]);
42 h=(TH1*)fd->Get(nameX[i]); assert(h);
43 c->cd(i+1); gPad->SetLeftMargin(0.15);
47 c->cd(4); bmSol->Draw();
48 bmSol->GetXaxis()->SetTitleOffset(0.9);
55 can=
new TCanvas(
"aa",
"aa",900,800); TPad *c=makeTitle(can,core,page);
56 c->Divide(3,2);gStyle->SetOptStat(111111);
58 for(
int i=0;i<5;i++) {
59 printf(
"->%s<\n",nameX[i]);
60 h=(TH1*)fd->Get(nameX[i]); assert(h);
61 c->cd(i+1); h->Draw();
62 if(i==3) h->Draw(
"colz");
70 printf(
"page=%d NOT defined\n",page);
75 sprintf(text,
"%s_page%02d",core,page);
82 if(pl) can->Print(outPath+tit+
".ps");
88 TPad *makeTitle(TCanvas *c,
char *core,
int page,
float frac=0.95) {
91 TPad *pad0 =
new TPad(
"pad0",
"apd0",0.0,frac,1.,1.);
95 TPaveText *pt =
new TPaveText(0,0.,1,1,
"br");
108 pad =
new TPad(
"pad1",
"apd1",0.0,0.0,1,frac);
114 void doStat(
char *name0,
char *name3){
115 printf(
"->%s<\n",name0);
116 h0=(TH1*)fd->Get(name0); assert(h0);
117 int nEve=h0->GetEntries()/ h0->GetNbinsX();
118 printf(
"nEve=%d\n",nEve);
120 h3=(TH1F*)fd->Get(name3); assert(h3);
121 int nb=h3->GetNbinsX();
123 for(i=1; i<=nb;i++) {
124 float y=h3->GetBinContent(i);
128 float er=sqrt(y)/nEve;
129 if(r>0.001){ printf(
"* "); n1++;}
133 printf(
" HankCh=%d failProb=%.3f +/- %.3f\n", i-1,r,er);
135 printf(
"bigErr n1=%d n=%d\n",n1,n);
141 spreadFit( TH2* h2,
double Ymx=370) {
143 ln0=
new TLine(0,0,450,0); ln0->SetLineColor(kBlack);ln0->SetLineWidth(2.);
144 ln0->SetLineStyle(2);
145 TString tt=h2->GetName();
146 h2->GetListOfFunctions()->Clear();
147 TString tt=h2->GetName();
149 TH1D*hd= (TH1D*)gROOT->FindObject(tt+
"_1");
150 h2->SetAxisRange(-Ymx,Ymx,
"y");
152 hd->SetMarkerStyle(20);
158 memset(er1,0,
sizeof(er1));
160 TH1D *he= (TH1D*)gROOT->FindObject(tt+
"_2");
161 he->Fit(
"pol1",
"",
"same");
163 TH1D *yu=(TH1D*) hd->Clone(); yu->SetLineColor(kMagenta);
164 yu->Add(he); yu->SetError(er1);yu->SetLineWidth(2.);
167 TH1D *yd=(TH1D*) hd->Clone();
168 yd->Add(he,-1); yd->SetError(er1); yd->SetLineColor(kMagenta);
169 yd->Draw(
"same");yd->SetLineWidth(2.);
176 plAll(
char *core=
"d1") {
178 for(i=1; i<=4; i++) plFgtSS(i,core,2);
179 for(i=6; i<=7; i++) plFgtSS(i,core,2);