File indexing completed on 2024-04-06 11:58:55
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 const int netamx = 30;
0014 const int nphimx = 72;
0015 int getieta(int ij) { return (ij < netamx / 2) ? -netamx / 2 + ij : -netamx / 2 + ij + 1; }
0016 int invert_ieta(int ieta) { return (ieta < 0) ? netamx / 2 + ieta : netamx / 2 + ieta - 1; }
0017
0018 const int ncut = 14;
0019 const int ringmx = 5;
0020 const int nchnmx = 10;
0021 const int routmx = 36;
0022 const int rout12mx = 24;
0023
0024 const int rbxmx = 12;
0025 const int rbx12mx = 6;
0026 const int nprojtype = 5;
0027 const char* projname[nprojtype] = {"Noise", "In RM", "3x3", "Proj", "Signal"};
0028 const int nprojmx = 4;
0029 const int nseltype = 4;
0030 const int nadmx = 18;
0031 const int shapemx = 10;
0032
0033 static const int nhothresh = 10;
0034
0035 TH2F* totalmuon;
0036 TH2F* totalproj[9];
0037 TH2F* totalhpd[18];
0038
0039 TH2F* totalprojsig[9];
0040 TH2F* totalhpdsig[18];
0041
0042 TH2F* total2muon;
0043 TH2F* total2proj[9];
0044 TH2F* total2hpd[18];
0045
0046 TH2F* total2projsig[9];
0047 TH2F* total2hpdsig[18];
0048
0049 Double_t gausX(Double_t* x, Double_t* par) { return par[0] * (TMath::Gaus(x[0], par[1], par[2], kTRUE)); }
0050
0051 Double_t landX(Double_t* x, Double_t* par) { return par[0] * (TMath::Landau(x[0], par[1], par[2])); }
0052
0053 Double_t completefit(Double_t* x, Double_t* par) { return gausX(x, par) + landX(x, &par[3]); }
0054
0055 Double_t langaufun(Double_t* x, Double_t* par) {
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068 Double_t invsq2pi = 0.3989422804014;
0069 Double_t mpshift = -0.22278298;
0070
0071
0072 Double_t np = 100.0;
0073 Double_t sc = 5.0;
0074
0075
0076 Double_t xx;
0077 Double_t mpc;
0078 Double_t fland;
0079 Double_t sum = 0.0;
0080 Double_t xlow, xupp;
0081 Double_t step;
0082
0083
0084 mpc = par[1] - mpshift * par[0] * par[1];
0085 double scale = 1;
0086 double scale2 = 1;
0087 if (scale2 < .1)
0088 scale2 = 0.1;
0089
0090
0091 xlow = x[0] - sc * scale * par[3];
0092 xupp = x[0] + sc * scale * par[3];
0093
0094 step = (xupp - xlow) / np;
0095
0096
0097 for (double ij = 1.0; ij <= np / 2; ij++) {
0098 xx = xlow + (ij - .5) * step;
0099 fland = TMath::Landau(xx, mpc, par[0] * par[1], kTRUE);
0100 if (xx > par[1]) {
0101 fland *= exp(-(xx - par[1]) / par[4]);
0102 }
0103 sum += fland * TMath::Gaus(x[0], xx, scale * par[3]);
0104 xx = xupp - (ij - .5) * step;
0105 fland = TMath::Landau(xx, mpc, par[0] * par[1], kTRUE);
0106 if (xx > par[1]) {
0107 fland *= exp(-(xx - par[1]) / par[4]);
0108 }
0109 sum += fland * TMath::Gaus(x[0], xx, scale * par[3]);
0110 }
0111 return (par[2] * step * sum * invsq2pi / (scale2 * par[3]));
0112 }
0113
0114 Double_t totalfunc(Double_t* x, Double_t* par) {
0115 return gausX(x, par) + langaufun(x, &par[3]);
0116 }
0117
0118 void momentum() {
0119 gStyle->SetOptStat(1110);
0120 const int nfile = 3;
0121 TH1F* histx[nfile];
0122 TTree* T1x;
0123 char name[100];
0124 TCanvas* c1 = new TCanvas("c1", "runfile", 700, 300);
0125 c1->Divide(3, 1);
0126
0127 for (int ij = 0; ij < nfile; ij++) {
0128 c1->cd(ij + 1);
0129 sprintf(name, "hist_%i", ij);
0130 histx[ij] = new TH1F(name, name, 120, -150., 150.);
0131 if (ij == 0) {
0132
0133 } else if (ij == 1) {
0134
0135 } else {
0136
0137 }
0138 switch (ij) {
0139 case 0:
0140 _file0->cd();
0141 break;
0142 case 1:
0143 _file1->cd();
0144 break;
0145 case 2:
0146 _file2->cd();
0147 break;
0148 }
0149
0150 T1x = (TTree*)gDirectory->Get("T1");
0151 T1x->Project(name, "trkmm");
0152
0153 histx[ij]->Draw();
0154
0155 }
0156 }
0157
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168 void plot_fitres(int ieta = 13, int iphi = 70) {
0169 gStyle->SetOptTitle(0);
0170 gStyle->SetOptLogy(1);
0171
0172
0173
0174
0175
0176
0177
0178
0179
0180
0181
0182
0183
0184
0185
0186
0187
0188
0189
0190
0191
0192
0193
0194
0195
0196
0197
0198 double par[8] = {23.6947, 0.0178834, 0.0318413, 0.160218, 0.985584, 77652.5, 0.15613, 10.0053};
0199
0200
0201
0202
0203
0204
0205
0206
0207
0208
0209
0210
0211 par[0] /= 18.0;
0212 par[5] /= 18.0;
0213
0214 const char title[100];
0215 TH1F* histx[2];
0216 TH1F* histy[2];
0217
0218 TF1* ped0fun;
0219 TF1* pedfun;
0220 TF1* sigfun;
0221 TF1* signalx;
0222 double xmn = -15.;
0223 double xmx = 20.;
0224
0225 TCanvas* c1 = new TCanvas("c1", "runfile", 600, 600);
0226
0227 for (int i = 1; i < 2; i++) {
0228
0229 switch (i) {
0230 case 0:
0231 sprintf(title, "hoCalibc/ped_eta%i_phi%i", ieta, iphi);
0232 break;
0233 case 1:
0234 sprintf(title, "hoCalibc/sig_eta%i_phi%i", ieta, iphi);
0235 break;
0236 }
0237
0238 histy[i] = (TH1F*)gDirectory->Get(title);
0239 histx[i] = (TH1F*)histy[i]->Clone();
0240 cout << "name " << title << " " << histx[i]->GetBinWidth(100) << " " << histx[i]->GetTitle() << endl;
0241
0242 histx[i]->SetLineColor(2 * (i + 1));
0243 histx[i]->SetLineWidth(2);
0244 histx[i]->Rebin(10);
0245
0246 histx[i]->SetMaximum(1.52 * histx[i]->GetMaximum());
0247
0248
0249
0250
0251
0252
0253
0254 switch (i) {
0255 case 0:
0256 histx[i]->GetXaxis()->SetRangeUser(-16., 16.);
0257 histx[i]->GetXaxis()->SetTitle("HO Pedestal (GeV)");
0258 break;
0259 case 1:
0260 histx[i]->GetXaxis()->SetRangeUser(-20., 40.);
0261 histx[i]->GetXaxis()->SetTitle("HO Signal (GeV)");
0262 break;
0263 }
0264
0265
0266 histx[i]->GetYaxis()->SetTitle("Nevents");
0267
0268
0269 histx[i]->Draw();
0270 }
0271
0272
0273
0274
0275
0276
0277
0278
0279
0280
0281
0282
0283
0284
0285
0286
0287
0288
0289
0290
0291
0292
0293
0294
0295 pedfun = new TF1("ped0", gausX, xmn, 4 * xmx, 3);
0296 pedfun->SetParameters(par);
0297 pedfun->SetLineWidth(2);
0298 pedfun->SetLineColor(3);
0299 pedfun->Draw("same");
0300
0301 sigfun = new TF1("signalfun", langaufun, xmn, 4 * xmx, 5);
0302 sigfun->SetParameters(&par[3]);
0303 sigfun->SetLineWidth(2);
0304 sigfun->SetLineColor(4);
0305 sigfun->Draw("same");
0306
0307 signalx = new TF1("total", totalfunc, xmn, 4 * xmx, 8);
0308 signalx->SetParameters(par);
0309 signalx->SetLineWidth(2);
0310 signalx->SetLineWidth(1);
0311 signalx->Draw("same");
0312
0313 cmsPrel(.55, .75, .55, .75, 0.045, 35);
0314 }
0315
0316
0317
0318
0319
0320
0321
0322
0323
0324
0325
0326
0327
0328
0329
0330
0331
0332
0333 void all_1d4x() {
0334 TCanvas* c1 = new TCanvas("c1", "c1", 700, 500);
0335 c1->Divide(2, 2);
0336
0337 _file0->cd();
0338 const_term_1d4x();
0339 _file1->cd();
0340 const_term_1d4x();
0341 _file2->cd();
0342 const_term_1d4x();
0343 _file3->cd();
0344 const_term_1d4x();
0345 _file4->cd();
0346 const_term_1d4x();
0347 _file5->cd();
0348 const_term_1d4x();
0349 _file6->cd();
0350 const_term_1d4x();
0351 _file7->cd();
0352 const_term_1d4x();
0353 _file8->cd();
0354 const_term_1d4x();
0355 _file9->cd();
0356 const_term_1d4x();
0357 _file10->cd();
0358 const_term_1d4x();
0359 _file11->cd();
0360 const_term_1d4x();
0361 _file12->cd();
0362 const_term_1d4x();
0363 _file13->cd();
0364 const_term_1d4x();
0365
0366
0367
0368
0369
0370
0371
0372
0373
0374
0375
0376
0377
0378
0379
0380
0381
0382
0383
0384
0385
0386
0387
0388
0389
0390
0391
0392
0393
0394
0395
0396
0397
0398
0399
0400
0401
0402
0403
0404
0405
0406
0407
0408
0409
0410
0411
0412
0413
0414 }
0415
0416 void all_2d() {
0417 TCanvas* c1 = new TCanvas("c1", "c1", 700, 400);
0418
0419
0420 _file0->cd();
0421 const_term_2d();
0422 _file1->cd();
0423 const_term_2d();
0424 _file2->cd();
0425 const_term_2d();
0426 _file3->cd();
0427 const_term_2d();
0428 _file4->cd();
0429 const_term_2d();
0430 _file5->cd();
0431 const_term_2d();
0432 _file6->cd();
0433 const_term_2d();
0434 _file7->cd();
0435 const_term_2d();
0436 _file8->cd();
0437 const_term_2d();
0438 _file9->cd();
0439 const_term_2d();
0440 _file10->cd();
0441 const_term_2d();
0442 _file11->cd();
0443 const_term_2d();
0444 _file12->cd();
0445 const_term_2d();
0446 _file13->cd();
0447 const_term_2d();
0448 }
0449
0450 void const_term_1d4x(const char* varname = "const_eta_phi") {
0451 gStyle->SetOptTitle(0);
0452 gStyle->SetOptFit(111);
0453 gStyle->SetOptStat(1110);
0454 gStyle->SetOptLogy(1);
0455 gStyle->SetPadTopMargin(0.01);
0456 gStyle->SetPadBottomMargin(0.13);
0457 gStyle->SetPadLeftMargin(0.12);
0458 gStyle->SetPadRightMargin(0.01);
0459 gStyle->SetStatY(.99);
0460 gStyle->SetStatX(.99);
0461 gStyle->SetStatH(.22);
0462 gStyle->SetStatW(.27);
0463
0464 TLatex latex;
0465 latex.SetNDC();
0466 latex.SetTextSize(0.075);
0467 latex.SetTextFont(42);
0468 latex.SetTextAlign(31);
0469
0470 TCanvas* c1 = new TCanvas("c1", "c1", 700, 400);
0471 c1->Divide(2, 2);
0472
0473
0474
0475
0476
0477
0478
0479
0480
0481
0482
0483
0484
0485
0486
0487
0488
0489
0490
0491
0492 TH2F* hist2d = (TH2F*)gDirectory->Get(varname);
0493 TH1F* histx[4];
0494 histx[0] = new TH1F("histx0", "Correction factor - 1 (R0)", 120, -0.11, 0.29);
0495 histx[1] = new TH1F("histx1", "Correction factor - 1 (R#pm1)", 120, -0.11, 0.29);
0496 histx[2] = new TH1F("histx2", "Correction factor - 1 (R#pm2)", 120, -0.11, 0.29);
0497 histx[3] = new TH1F("histx3", "Correction factor - 1 (All)", 120, -0.11, 0.29);
0498
0499 char name[100] = gDirectory->GetName();
0500 char namex[20];
0501 char namey[50];
0502 strncpy(namex, name, 15);
0503 char* pchy = strchr(namex, '_');
0504 int len = pchy - namex;
0505 strncpy(namey, namex, len);
0506
0507 cout << namex << " " << namey << endl;
0508 float value[2][4] = {0};
0509 float error[2][4] = {0};
0510
0511 for (int ij = 0; ij < hist2d->GetNbinsX(); ij++) {
0512 int ieta = getieta(ij);
0513 for (int jk = 0; jk < hist2d->GetNbinsY(); jk++) {
0514 double xx = hist2d->GetBinContent(ij + 1, jk + 1) - 1.0;
0515 if (xx > -0.5) {
0516 if (abs(ieta) <= 4) {
0517 histx[0]->Fill(xx);
0518 } else if (abs(ieta) <= 10) {
0519 histx[1]->Fill(xx);
0520 } else if (abs(ieta) <= 15) {
0521 histx[2]->Fill(xx);
0522 }
0523 histx[3]->Fill(xx);
0524 }
0525 }
0526 }
0527 for (int ij = 0; ij < 4; ij++) {
0528 c1->cd(ij + 1);
0529 histx[ij]->GetXaxis()->SetTitle(histx[ij]->GetTitle());
0530 histx[ij]->GetXaxis()->SetLabelOffset(.001);
0531 histx[ij]->GetXaxis()->SetLabelSize(0.0645);
0532 histx[ij]->GetXaxis()->SetTitleSize(0.065);
0533 histx[ij]->GetXaxis()->SetTitleOffset(0.99);
0534
0535 histx[ij]->GetYaxis()->SetTitle("Entries/0.005");
0536 histx[ij]->GetYaxis()->SetLabelOffset(.001);
0537 histx[ij]->GetYaxis()->SetLabelSize(0.0645);
0538 histx[ij]->GetYaxis()->SetTitleSize(0.065);
0539 histx[ij]->GetYaxis()->SetTitleOffset(0.85);
0540
0541 histx[ij]->SetLineWidth(1);
0542 TFitResultPtr ptr = histx[ij]->Fit("gaus", "QS");
0543 Int_t fitStatus = ptr;
0544 if (fitStatus == 0) {
0545 value[0][ij] = int(100000 * ptr->Parameter(1)) / 1000.;
0546 value[1][ij] = int(100000 * ptr->Parameter(2)) / 1000.;
0547 error[0][ij] = int(100000 * ptr->ParError(1)) / 1000.;
0548 error[1][ij] = int(100000 * ptr->ParError(2)) / 1000.;
0549
0550
0551 }
0552 }
0553
0554
0555 sprintf(namey, "const_term_1d4x_%s.png", namex);
0556 c1->SaveAs(namey);
0557
0558 cout << "val ";
0559 for (int ij = 0; ij < 4; ij++) {
0560 cout << " " << setw(6) << value[0][ij] << "+-" << setw(6) << error[0][ij];
0561 }
0562 cout << endl;
0563 cout << "err ";
0564 for (int ij = 0; ij < 4; ij++) {
0565 cout << " " << setw(6) << value[1][ij] << "+-" << setw(6) << error[1][ij];
0566 }
0567 cout << endl;
0568 for (int ij = 0; ij < 4; ij++) {
0569 if (histx[ij]) {
0570 delete histx[ij];
0571 histx[ij] = 0;
0572 }
0573 }
0574
0575 }
0576
0577 void const_term_1dx(const char* varname = "const_eta_phi") {
0578 ofstream file_out("test_output.log");
0579 gStyle->SetOptFit(101);
0580 gStyle->SetOptStat(0);
0581 gStyle->SetOptLogy(1);
0582 gStyle->SetPadTopMargin(0.1);
0583 gStyle->SetPadBottomMargin(0.11);
0584 gStyle->SetPadLeftMargin(0.14);
0585 gStyle->SetPadRightMargin(0.03);
0586 gStyle->SetStatY(.93);
0587 gStyle->SetStatX(.98);
0588 gStyle->SetStatH(.16);
0589 gStyle->SetStatW(.19);
0590
0591 TH2F* hist2d[3];
0592
0593 hist2d[0] = (TH2F*)gDirectory->Get(varname);
0594 hist2d[1] = (TH2F*)gDirectory->Get("const_eta_phisum");
0595 TH1F* histx[3];
0596 histx[0] = new TH1F("histx0", "const_eta_phi", 120, .7, 1.3);
0597 histx[1] = new TH1F("histx1", "const_eta_phisum", 120, .7, 1.3);
0598 histx[2] = new TH1F("histx2", "Correction term", 120, -.2, .2);
0599 hist2d[2] = new TH2F("hist2d2", "hist2d2", 120, .9, 1.1, 120, .9, 1.1);
0600 for (int ij = 0; ij < hist2d[0]->GetNbinsX(); ij++) {
0601
0602 for (int jk = 0; jk < hist2d[0]->GetNbinsY(); jk++) {
0603 double xx = hist2d[0]->GetBinContent(ij + 1, jk + 1);
0604 if (xx > 0.5) {
0605 histx[0]->Fill(xx);
0606 }
0607 if (ij != 15)
0608 file_out << hist2d[0]->GetXaxis()->GetBinCenter(ij + 1) << "\t" << jk + 1 << "\t " << xx << endl;
0609
0610 double yy = hist2d[1]->GetBinContent(ij + 1, jk + 1);
0611 if (yy > 0.5) {
0612 histx[1]->Fill(yy);
0613 }
0614 if (xx > .5 && yy > .5) {
0615 histx[2]->Fill(yy - xx);
0616 hist2d[2]->Fill(xx, yy);
0617 }
0618 }
0619 }
0620 TCanvas* c1 = new TCanvas("c1", "c1", 500, 500);
0621
0622
0623
0624
0625
0626
0627 histx[0]->GetXaxis()->SetTitle("Correction factor");
0628 histx[0]->GetXaxis()->SetLabelOffset(.001);
0629 histx[0]->GetXaxis()->SetLabelSize(0.0645);
0630 histx[0]->GetXaxis()->SetTitleSize(0.065);
0631 histx[0]->GetXaxis()->SetTitleOffset(0.75);
0632
0633 histx[0]->GetYaxis()->SetTitle("Entries/0.005");
0634 histx[0]->GetYaxis()->SetLabelOffset(.001);
0635 histx[0]->GetYaxis()->SetLabelSize(0.0645);
0636 histx[0]->GetYaxis()->SetTitleSize(0.065);
0637 histx[0]->GetYaxis()->SetTitleOffset(1.05);
0638
0639 histx[0]->SetLineWidth(1);
0640 histx[0]->Fit("gaus");
0641
0642
0643 file_out.close();
0644 }
0645
0646 void const_term_2dx(const char* varname = "const_eta_phi") {
0647 gStyle->SetOptStat(0);
0648 gStyle->SetOptTitle(0);
0649 gStyle->SetOptLogy(0);
0650
0651 gStyle->SetPalette(1, 0);
0652 gStyle->SetPadTopMargin(0.12);
0653 gStyle->SetPadBottomMargin(0.12);
0654 gStyle->SetPadLeftMargin(0.08);
0655 gStyle->SetPadRightMargin(0.15);
0656
0657 TH2F* hist2d = (TH2F*)gDirectory->Get(varname);
0658
0659 hist2d->SetMaximum(1.5);
0660 hist2d->SetMinimum(0.7);
0661 hist2d->GetXaxis()->SetTitle("i#eta");
0662 hist2d->GetYaxis()->SetTitle("i#phi");
0663
0664 hist2d->Draw("colz");
0665
0666 cmsPrel2(.75, .5, .15, .92, 0.025, 35);
0667 }
0668
0669 double hothreshs[nhothresh + 1] = {0.15, 0.25, 0.5, 1.0, 2.0, 5.0, 10.0, 20., 50, 100., 10000.};
0670 void def_setting() {
0671 gStyle->SetPadTopMargin(0.02);
0672 gStyle->SetPadBottomMargin(0.15);
0673 gStyle->SetPadLeftMargin(0.08);
0674 gStyle->SetPadRightMargin(0.16);
0675 gStyle->SetOptStat(0);
0676
0677
0678
0679 gStyle->SetGridWidth(1);
0680 gStyle->SetTitleFontSize(0.09);
0681 gStyle->SetTitleOffset(-0.09);
0682 gStyle->SetTitleBorderSize(1);
0683 gStyle->SetLabelSize(0.095, "XY");
0684 gStyle->SetOptTitle(0);
0685 gStyle->SetOptStat(0);
0686 gStyle->SetNdivisions(404, "XYZ");
0687
0688 gStyle->SetStatTextColor(1);
0689 gStyle->SetStatX(.99);
0690 gStyle->SetStatY(.99);
0691 gStyle->SetStatW(.3);
0692 gStyle->SetStatH(.2);
0693
0694 gStyle->SetOptLogy(0);
0695 }
0696
0697 void const_term(const char* varname = "const_eta_phi") {
0698 ofstream file_out("test_output.log");
0699 gStyle->SetOptFit(101);
0700 gStyle->SetOptStat(0);
0701 gStyle->SetOptLogy(1);
0702 gStyle->SetLabelSize(.065, "XY");
0703
0704 TH2F* hist2d[3];
0705
0706 hist2d[0] = (TH2F*)gDirectory->Get("const_eta_phi");
0707 hist2d[1] = (TH2F*)gDirectory->Get("const_eta_phisum");
0708
0709 TH1F* histx[3];
0710 histx[0] = new TH1F("histx0", "const_eta_phi", 120, .7, 1.3);
0711 histx[1] = new TH1F("histx1", "const_eta_phisum", 120, .7, 1.3);
0712 histx[2] = new TH1F("histx2", "diff", 120, -.2, .2);
0713 hist2d[2] = new TH2F("hist2d2", "hist2d2", 120, .9, 1.1, 120, .9, 1.1);
0714
0715 for (int ij = 0; ij < hist2d[0]->GetNbinsX(); ij++) {
0716
0717 for (int jk = 0; jk < hist2d[0]->GetNbinsY(); jk++) {
0718 double xx = hist2d[0]->GetBinContent(ij + 1, jk + 1);
0719 if (xx > 0.5) {
0720 histx[0]->Fill(xx);
0721 }
0722 if (ij != 15)
0723 file_out << hist2d[0]->GetXaxis()->GetBinCenter(ij + 1) << "\t" << jk + 1 << "\t " << xx << endl;
0724
0725 double yy = hist2d[1]->GetBinContent(ij + 1, jk + 1);
0726 if (yy > 0.5) {
0727 histx[1]->Fill(yy);
0728 }
0729 if (xx > .5 && yy > .5) {
0730 histx[2]->Fill(yy - xx);
0731 hist2d[2]->Fill(xx, yy);
0732 }
0733 }
0734 }
0735 TCanvas* c1 = new TCanvas("c1", "c1", 700, 900);
0736 c1->Divide(2, 2);
0737 c1->cd(1);
0738 histx[0]->Fit("gaus");
0739 c1->cd(2);
0740 histx[1]->Fit("gaus");
0741 c1->cd(3);
0742 histx[2]->Fit("gaus");
0743 c1->cd(4);
0744 gPad->SetLogy(0);
0745 hist2d[2]->Draw("colz");
0746 file_out.close();
0747 }
0748
0749 void const_term_2d(const char* varname = "const_eta_phi") {
0750 gStyle->SetOptStat(0);
0751 gStyle->SetOptTitle(0);
0752 gStyle->SetPalette(1, 0);
0753 gStyle->SetPadTopMargin(0.09);
0754 gStyle->SetPadBottomMargin(0.11);
0755 gStyle->SetPadLeftMargin(0.11);
0756 gStyle->SetPadRightMargin(0.15);
0757
0758 TLatex latex;
0759 latex.SetNDC();
0760 latex.SetTextSize(0.065);
0761 latex.SetTextFont(42);
0762 latex.SetTextAlign(31);
0763
0764 TH2F* hist2d = (TH2F*)gDirectory->Get(varname);
0765
0766 hist2d->GetXaxis()->SetLabelOffset(.001);
0767 hist2d->GetXaxis()->SetLabelSize(0.064);
0768 hist2d->GetXaxis()->SetTitle("i#eta");
0769 hist2d->GetXaxis()->SetTitleSize(0.065);
0770 hist2d->GetXaxis()->SetTitleOffset(0.75);
0771 hist2d->GetXaxis()->SetTitleColor(1);
0772 hist2d->GetXaxis()->CenterTitle();
0773
0774 hist2d->GetYaxis()->SetLabelOffset(.001);
0775 hist2d->GetYaxis()->SetLabelSize(0.064);
0776 hist2d->GetYaxis()->SetTitleSize(0.065);
0777 hist2d->GetYaxis()->SetTitle("i#phi");
0778 hist2d->GetYaxis()->SetTitleOffset(0.68);
0779 hist2d->GetYaxis()->CenterTitle();
0780
0781 hist2d->GetZaxis()->SetLabelSize(0.045);
0782
0783
0784 hist2d->SetMinimum(0.7);
0785 hist2d->Draw("colz");
0786
0787
0788
0789
0790
0791
0792
0793
0794
0795
0796
0797
0798
0799
0800
0801
0802 char name[100] = gDirectory->GetName();
0803 char namex[20];
0804 char namey[50];
0805 strncpy(namex, name, 15);
0806 cout << namex << endl;
0807 latex.DrawLatex(0.65, 0.92, namex);
0808 sprintf(namey, "statistics_2d_%s.png", namex);
0809 c1->SaveAs(namey);
0810 }
0811
0812 void signal4(int ival = 0, int ndvy = 3) {
0813 gStyle->SetOptStat(0);
0814 gStyle->SetPadTopMargin(0.11);
0815 gStyle->SetPadBottomMargin(0.08);
0816 gStyle->SetPadLeftMargin(0.08);
0817 gStyle->SetPadRightMargin(0.20);
0818 TCanvas* c1 = new TCanvas("c1", "c1", 700, 900);
0819
0820 char name[100];
0821
0822 c1->Divide(3, ndvy);
0823
0824 TH2F* histx[100];
0825 for (int ij = 0; ij < 3 * ndvy; ij++) {
0826
0827 histx[ij] = (TH2F*)gDirectory->Get(name);
0828 switch (ival) {
0829 case 0:
0830 histx[ij] = (TH2F*)totalproj[ij]->Clone();
0831 break;
0832 case 1:
0833 histx[ij] = (TH2F*)total2proj[ij]->Clone();
0834 break;
0835 case 2:
0836 histx[ij] = (TH2F*)totalprojsig[ij]->Clone();
0837 break;
0838 case 3:
0839 histx[ij] = (TH2F*)total2projsig[ij]->Clone();
0840 break;
0841 case 4:
0842 histx[ij] = (TH2F*)totalhpd[ij]->Clone();
0843 break;
0844 case 5:
0845 histx[ij] = (TH2F*)total2hpd[ij]->Clone();
0846 break;
0847 case 6:
0848 histx[ij] = (TH2F*)totalhpdsig[ij]->Clone();
0849 break;
0850 case 7:
0851 histx[ij] = (TH2F*)total2hpdsig[ij]->Clone();
0852 break;
0853 default:
0854 break;
0855 }
0856 c1->cd(ij + 1);
0857 if (strstr(histx[ij]->GetName(), "sig")) {
0858 histx[ij]->SetMaximum(TMath::Min(3., histx[ij]->GetMaximum()));
0859 }
0860 histx[ij]->GetXaxis()->SetLabelSize(0.075);
0861 histx[ij]->GetYaxis()->SetLabelSize(0.075);
0862 histx[ij]->GetZaxis()->SetLabelSize(0.065);
0863 histx[ij]->GetXaxis()->SetNdivisions(404);
0864 histx[ij]->GetYaxis()->SetNdivisions(404);
0865 histx[ij]->Draw("colz");
0866 }
0867 c1->Update();
0868 }
0869
0870
0871 void plot_var(int icut) {
0872 const int nvar = 15;
0873 gStyle->SetTitleFontSize(0.075);
0874 gStyle->SetTitleBorderSize(1);
0875 gStyle->SetPadTopMargin(0.10);
0876 gStyle->SetPadBottomMargin(0.10);
0877 char title[100];
0878 TCanvas* c1 = new TCanvas("c1", "runfile", 700., 900.);
0879 c1->Divide(5, 3, 1.e-5, 1.e-5, 0);
0880
0881 TH2F* fprofx[nvar];
0882 for (int ij = 0; ij < nvar; ij++) {
0883 c1->cd(ij + 1);
0884 sprintf(title, "hoCalibc/sigring_%i_%i", icut, ij);
0885
0886 fprofx[ij] = (TH2F*)gDirectory->Get(title);
0887 fprofx[ij]->GetXaxis()->SetLabelOffset(-0.03);
0888 fprofx[ij]->GetXaxis()->SetLabelSize(0.085);
0889 fprofx[ij]->GetYaxis()->SetLabelSize(0.075);
0890 fprofx[ij]->GetZaxis()->SetLabelSize(0.065);
0891 fprofx[ij]->GetYaxis()->SetNdivisions(404);
0892 fprofx[ij]->GetXaxis()->SetNdivisions(404);
0893 fprofx[ij]->SetLineColor(2);
0894 fprofx[ij]->SetLineWidth(2);
0895
0896 fprofx[ij]->Draw("colz");
0897 fprofx[ij]->ProfileX()->Draw("same");
0898
0899
0900
0901
0902
0903
0904
0905
0906
0907
0908 }
0909 c1->Update();
0910 }
0911
0912
0913 void plot_varprof(int icut) {
0914 const int nvar = 15;
0915 gStyle->SetTitleFontSize(0.075);
0916 gStyle->SetTitleBorderSize(1);
0917 gStyle->SetPadTopMargin(0.12);
0918 gStyle->SetPadBottomMargin(0.10);
0919 char title[100];
0920 TCanvas* c1 = new TCanvas("c1", "runfile", 700., 900.);
0921 c1->Divide(5, 3, 1.e-5, 1.e-5, 0);
0922
0923 TProfile* fprofx[nvar];
0924 for (int ij = 0; ij < nvar; ij++) {
0925 c1->cd(ij + 1);
0926 sprintf(title, "hoCalibc/sigring_%i_%i", icut, ij);
0927
0928 fprofx[ij] = (TProfile*)(((TH2F*)gDirectory->Get(title))->ProfileX());
0929 fprofx[ij]->GetXaxis()->SetLabelOffset(-0.03);
0930 fprofx[ij]->GetXaxis()->SetLabelSize(0.085);
0931 fprofx[ij]->GetYaxis()->SetLabelSize(0.075);
0932 fprofx[ij]->GetYaxis()->SetNdivisions(404);
0933 fprofx[ij]->GetXaxis()->SetNdivisions(404);
0934 fprofx[ij]->SetLineColor(2);
0935 fprofx[ij]->SetLineWidth(2);
0936
0937 fprofx[ij]->Draw();
0938
0939
0940
0941
0942
0943
0944
0945
0946
0947
0948 }
0949 c1->Update();
0950 }
0951
0952 void plot_var_tray(int id = 0, int icut = 0) {
0953
0954
0955 char title[100];
0956 TCanvas* c1 = new TCanvas("c1", "runfile", 700., 900.);
0957 c1->Divide(5, 6, 1.e-5, 1.e-5, 0);
0958
0959 TH2F* fprofx[30];
0960 int itag = 0;
0961 for (int jk = 0; jk < 6; jk++) {
0962 for (int ij = 0; ij < 5; ij++) {
0963 c1->cd(itag + 1);
0964 sprintf(title, "hoCalibc/sigtray_%i_%i_%i", icut, 5 * id + ij, jk);
0965
0966 fprofx[itag] = (TH2F*)gDirectory->Get(title);
0967 fprofx[itag]->GetXaxis()->SetLabelOffset(-.001);
0968 fprofx[itag]->GetXaxis()->SetLabelSize(0.085);
0969 fprofx[itag]->GetYaxis()->SetLabelSize(0.085);
0970 fprofx[itag]->GetZaxis()->SetLabelSize(0.065);
0971 fprofx[itag]->GetYaxis()->SetNdivisions(404);
0972 fprofx[itag]->GetXaxis()->SetNdivisions(404);
0973 fprofx[itag]->SetLineColor(2);
0974 fprofx[itag]->SetLineWidth(2);
0975
0976 fprofx[itag]->Draw("colz");
0977 fprofx[itag]->ProfileX()->Draw("same");
0978
0979
0980
0981
0982
0983
0984
0985
0986
0987
0988 itag++;
0989 }
0990 }
0991 c1->Update();
0992 }
0993
0994 void plot_var_trayprof(int id = 0, int icut = 0) {
0995
0996
0997 char title[100];
0998 TCanvas* c1 = new TCanvas("c1", "runfile", 700., 900.);
0999 c1->Divide(5, 6, 1.e-5, 1.e-5, 0);
1000
1001 TProfile* fprofx[30];
1002 int itag = 0;
1003 for (int jk = 0; jk < 6; jk++) {
1004 for (int ij = 0; ij < 5; ij++) {
1005 c1->cd(itag + 1);
1006 sprintf(title, "hoCalibc/sigtray_%i_%i_%i", icut, 5 * id + ij, jk);
1007
1008 fprofx[itag] = (TProfile*)(((TH2F*)gDirectory->Get(title))->ProfileX());
1009 fprofx[itag]->GetXaxis()->SetLabelOffset(-.001);
1010 fprofx[itag]->GetXaxis()->SetLabelSize(0.085);
1011 fprofx[itag]->GetYaxis()->SetLabelSize(0.085);
1012 fprofx[itag]->GetYaxis()->SetNdivisions(404);
1013 fprofx[itag]->GetXaxis()->SetNdivisions(404);
1014 fprofx[itag]->SetLineColor(2);
1015 fprofx[itag]->SetLineWidth(2);
1016
1017 fprofx[itag]->Draw();
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028 itag++;
1029 }
1030 }
1031 c1->Update();
1032 }
1033
1034 void plot_var_eta(int id = 0, int icut = 0) {
1035
1036
1037 const int netamx = 30;
1038
1039 char title[100];
1040 TCanvas* c1 = new TCanvas("c1", "runfile", 700., 900.);
1041 c1->Divide(5, 6, 1.e-5, 1.e-5, 0);
1042
1043 TH2F* fprofx[netamx];
1044 for (int ij = 0; ij < netamx; ij++) {
1045 c1->cd(ij + 1);
1046 sprintf(title, "hoCalibc/sigeta_%i_%i_%i", icut, id, ij);
1047 fprofx[ij] = (TH2F*)gDirectory->Get(title);
1048 fprofx[ij]->GetXaxis()->SetLabelOffset(-0.001);
1049 fprofx[ij]->GetXaxis()->SetLabelSize(0.085);
1050 fprofx[ij]->GetYaxis()->SetLabelSize(0.085);
1051 fprofx[ij]->GetZaxis()->SetLabelSize(0.065);
1052 fprofx[ij]->GetYaxis()->SetNdivisions(404);
1053 fprofx[ij]->GetXaxis()->SetNdivisions(404);
1054 fprofx[ij]->SetLineColor(2);
1055 fprofx[ij]->SetLineWidth(2);
1056
1057 fprofx[ij]->Draw("colz");
1058 fprofx[ij]->ProfileX()->Draw("same");
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069 }
1070 c1->Update();
1071 }
1072
1073 void plot_var_etaprof(int id = 0, int icut = 0) {
1074
1075
1076 const int netamx = 30;
1077
1078 char title[100];
1079 TCanvas* c1 = new TCanvas("c1", "runfile", 700., 900.);
1080 c1->Divide(5, 6, 1.e-5, 1.e-5, 0);
1081
1082 TProfile* fprofx[netamx];
1083 for (int ij = 0; ij < netamx; ij++) {
1084 c1->cd(ij + 1);
1085 sprintf(title, "hoCalibc/sigeta_%i_%i_%i", icut, id, ij);
1086 fprofx[ij] = (TProfile*)(((TH2F*)gDirectory->Get(title))->ProfileX());
1087 fprofx[ij]->GetXaxis()->SetLabelOffset(-0.001);
1088 fprofx[ij]->GetXaxis()->SetLabelSize(0.085);
1089 fprofx[ij]->GetYaxis()->SetLabelSize(0.085);
1090 fprofx[ij]->GetYaxis()->SetNdivisions(404);
1091 fprofx[ij]->GetXaxis()->SetNdivisions(404);
1092 fprofx[ij]->SetLineColor(2);
1093 fprofx[ij]->SetLineWidth(2);
1094
1095 fprofx[ij]->Draw();
1096 }
1097 c1->Update();
1098 }
1099
1100 void plotyx() {
1101
1102
1103
1104 TCanvas* c1 = new TCanvas("c1", "runfile", 700., 900.);
1105
1106 for (int kl = 0; kl < ncut; kl++) {
1107
1108 plot_var(kl);
1109 }
1110
1111 }
1112
1113 void plotallx() {
1114
1115
1116 gStyle->SetTitleFontSize(0.075);
1117 gStyle->SetTitleBorderSize(1);
1118 gStyle->SetPadTopMargin(0.12);
1119 gStyle->SetPadBottomMargin(0.10);
1120 gStyle->SetPadGridX(1);
1121 gStyle->SetPadGridY(1);
1122 gStyle->SetGridStyle(3);
1123 gStyle->SetOptStat(0);
1124 gStyle->SetTitleBorderSize(1);
1125
1126 TCanvas* c1 = new TCanvas("c1", "runfile", 700., 900.);
1127 int ips = 111;
1128
1129 TPostScript ps("test_2016e.ps", ips);
1130 ps.Range(20, 28);
1131 bool m_select_plot = true;
1132
1133 if (m_select_plot) {
1134 for (int kl = 0; kl < ncut; kl++) {
1135 ps.NewPage();
1136 plot_var(kl);
1137 ps.NewPage();
1138 plot_varprof(kl);
1139 }
1140
1141 gStyle->SetTitleFontSize(0.095);
1142 for (int ix = 0; ix < 3; ix++) {
1143 for (int iy = 0; iy < ncut; iy++) {
1144 ps.NewPage();
1145 plot_var_eta(ix, iy);
1146 ps.NewPage();
1147 plot_var_etaprof(ix, iy);
1148 }
1149 }
1150
1151 for (int ix = 0; ix < 3; ix++) {
1152 for (int iy = 0; iy < ncut; iy++) {
1153 ps.NewPage();
1154 plot_var_tray(ix, iy);
1155 ps.NewPage();
1156 plot_var_trayprof(ix, iy);
1157 }
1158 }
1159 }
1160
1161 char name[100];
1162 totalmuon = (TH2F*)gDirectory->Get("hoCalibc/totalmuon");
1163 total2muon = (TH2F*)gDirectory->Get("hoCalibc/total2muon");
1164
1165 for (int ij = 0; ij < 9; ij++) {
1166 sprintf(name, "hoCalibc/totalproj_%i", ij);
1167 totalproj[ij] = (TH2F*)gDirectory->Get(name);
1168
1169 sprintf(name, "hoCalibc/totalprojsig_%i", ij);
1170 totalprojsig[ij] = (TH2F*)gDirectory->Get(name);
1171
1172 sprintf(name, "hoCalibc/total2proj_%i", ij);
1173 total2proj[ij] = (TH2F*)gDirectory->Get(name);
1174
1175 sprintf(name, "hoCalibc/total2projsig_%i", ij);
1176 total2projsig[ij] = (TH2F*)gDirectory->Get(name);
1177
1178 total2projsig[ij]->Divide(total2proj[ij]);
1179 totalprojsig[ij]->Divide(totalproj[ij]);
1180
1181 total2proj[ij]->Divide(total2muon);
1182 totalproj[ij]->Divide(totalmuon);
1183 }
1184
1185 for (int ij = 0; ij < 18; ij++) {
1186 sprintf(name, "hoCalibc/totalhpd_%i", ij);
1187 totalhpd[ij] = (TH2F*)gDirectory->Get(name);
1188
1189 sprintf(name, "hoCalibc/totalhpdsig_%i", ij);
1190 totalhpdsig[ij] = (TH2F*)gDirectory->Get(name);
1191
1192 sprintf(name, "hoCalibc/total2hpd_%i", ij);
1193 total2hpd[ij] = (TH2F*)gDirectory->Get(name);
1194
1195 sprintf(name, "hoCalibc/total2hpdsig_%i", ij);
1196 total2hpdsig[ij] = (TH2F*)gDirectory->Get(name);
1197
1198 total2hpdsig[ij]->Divide(total2hpd[ij]);
1199 totalhpdsig[ij]->Divide(totalhpd[ij]);
1200
1201 total2hpd[ij]->Divide(total2muon);
1202 totalhpd[ij]->Divide(totalmuon);
1203 }
1204 for (int ij = 0; ij < 8; ij++) {
1205 ps.NewPage();
1206 signal4(ij, (ij <= 3) ? 3 : 6);
1207 }
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220 }
1221
1222 void signal1() {
1223 TCanvas* c1 = new TCanvas("c1", "c1", 800., 600.);
1224 c1->Divide(4, 2);
1225 c1->cd(1);
1226 totalmuon->Draw("colz");
1227 c1->cd(2);
1228 totalproj_3->Draw("colz");
1229 c1->cd(3);
1230 totalproj_4->Draw("colz");
1231 c1->cd(4);
1232 totalproj_5->Draw("colz");
1233 c1->cd(5);
1234 total2muon->Draw("colz");
1235 c1->cd(6);
1236 total2proj_3->Draw("colz");
1237 c1->cd(7);
1238 total2proj_4->Draw("colz");
1239 c1->cd(8);
1240 total2proj_5->Draw("colz");
1241 }
1242
1243 void signal2() {
1244 TCanvas* c1 = new TCanvas("c1", "c1", 800., 600.);
1245 c1->Divide(4, 2);
1246 c1->cd(1);
1247 totalmuon->Draw("colz");
1248 c1->cd(2);
1249 totalproj_3->Draw("colz");
1250 c1->cd(3);
1251 totalproj_4->Draw("colz");
1252 c1->cd(4);
1253 totalproj_5->Draw("colz");
1254
1255 c1->cd(6);
1256 totalprojsig_3->Draw("colz");
1257 c1->cd(7);
1258 totalprojsig_4->Draw("colz");
1259 c1->cd(8);
1260 totalprojsig_5->Draw("colz");
1261 }
1262 void signal3() {
1263 TCanvas* c1 = new TCanvas("c1", "c1", 800., 600.);
1264 c1->Divide(4, 2);
1265 c1->cd(1);
1266 total2muon->Draw("colz");
1267 c1->cd(2);
1268 total2proj_3->Draw("colz");
1269 c1->cd(3);
1270 total2proj_4->Draw("colz");
1271 c1->cd(4);
1272 total2proj_5->Draw("colz");
1273
1274 c1->cd(6);
1275 total2projsig_3->Draw("colz");
1276 c1->cd(7);
1277 total2projsig_4->Draw("colz");
1278 c1->cd(8);
1279 total2projsig_5->Draw("colz");
1280 }
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308 void testplotx2(int thmn = 2, int thmx = 6) {
1309 gStyle->SetPadTopMargin(0.11);
1310 gStyle->SetPadBottomMargin(0.04);
1311 gStyle->SetPadLeftMargin(0.06);
1312 gStyle->SetPadRightMargin(0.02);
1313 gStyle->SetOptStat(0);
1314 gStyle->SetOptTitle();
1315 gStyle->SetPadGridX(1);
1316 gStyle->SetPadGridY(1);
1317 gStyle->SetGridStyle(3);
1318 gStyle->SetGridWidth(1);
1319 gStyle->SetTitleColor(10);
1320 gStyle->SetTitleFontSize(0.09);
1321 gStyle->SetTitleOffset(-0.09);
1322 gStyle->SetTitleBorderSize(1);
1323 gStyle->SetLabelSize(0.095, "XY");
1324
1325
1326
1327
1328 const int nringmx = 5;
1329
1330 const int routmx = 36;
1331 const int rout12mx = 24;
1332
1333 const int rbxmx = 12;
1334 const int rbx12mx = 6;
1335
1336 const int nprojmx = 4;
1337 const int nseltype = 4;
1338 const int nadmx = 18;
1339 const int shapemx = 10;
1340
1341 char* projname[nprojmx] = {"totalproj", "totalprojsig", "totalhpd", "totalhpdsig"};
1342
1343
1344
1345 TH2F* totalmuon[nseltype];
1346 TH2F* totalproj[nseltype][nprojmx][nadmx];
1347
1348 const int nprojtype = 5;
1349 TH2F* histent[nprojtype + 3];
1350 TH2F* histen[nprojtype + 3];
1351 TH2F* histen2[nprojtype + 3];
1352 TH2F* histerr[nprojtype];
1353
1354 const int nhothresh = 10;
1355 TH2F* h_allmucorrel[nhothresh];
1356 TH2F* hnorm_allmucorrel[nhothresh];
1357
1358 TH1F* endigicnt[nprojtype + 1][nhothresh];
1359 TH1F* endigisig[nprojtype + 1][nhothresh];
1360
1361 TH2F* rmdigicnt[nprojtype + 1][nhothresh];
1362 TH2F* rmdigisig[nprojtype + 1][nhothresh];
1363
1364 TH2F* ringdigicnt[nprojtype + 1][nhothresh];
1365 TH2F* ringdigisig[nprojtype + 1][nhothresh];
1366
1367 TH2F* inddigicnt[nprojtype + 1][nhothresh];
1368 TH2F* inddigisig[nprojtype + 1][nhothresh];
1369
1370 TH2F* indrecocnt[nprojtype + 1][nhothresh];
1371 TH2F* indrecosig[nprojtype + 1][nhothresh];
1372
1373 TH1F* rout_mult[nhothresh][nringmx][routmx + 1];
1374 TH1F* rbx_mult[nhothresh][nringmx][rbxmx + 1];
1375
1376 TH1F* rout_ind_energy[nringmx][routmx + 1];
1377
1378 TH2F* h_correlht[nhothresh];
1379 TH2F* h_correlsig[nringmx][nhothresh];
1380 TH2F* h_rmoccu[nhothresh];
1381 TH2F* h_rmcorrel[nhothresh];
1382
1383 TH2F* h_allcorrelsig[nhothresh];
1384
1385 TH2F* rbx_shape[shapemx][nringmx][routmx + 1];
1386
1387 char name[100];
1388
1389 int ips = 111;
1390 TPostScript ps("allmuho.ps", ips);
1391 ps.Range(20, 28);
1392
1393 TFile* fx = new TFile("histall_apr14b_cosmic_csa14_cosmic.root", "read");
1394
1395
1396
1397 for (int isel = 0; isel < nseltype; isel++) {
1398 sprintf(name, "hoCalibc/totalmuon_%i", isel);
1399 totalmuon[isel] = (TH2F*)fx->Get(name);
1400 }
1401
1402
1403 TCanvas* c0 = new TCanvas("c0", "mean rms", 600, 800);
1404 c0->Divide(2, 2);
1405
1406 TCanvas* c3 = new TCanvas("c3", "mean rms", 600, 800);
1407
1408 TCanvas* c1 = new TCanvas("c1", "c1", 600, 900);
1409 c1->Divide(3, 3);
1410
1411 TCanvas* c2 = new TCanvas("c2", "c2", 600, 900);
1412 c2->Divide(3, 6);
1413
1414 TCanvas* c4x = new TCanvas("c4x", "c4x", 600., 800.);
1415 c4x->Divide(2, 6);
1416
1417 TCanvas* c4 = new TCanvas("c4", "c4", 600., 800.);
1418 c4->Divide(2, 6);
1419
1420 TCanvas* c5 = new TCanvas("c5", "c5", 600., 800.);
1421 c5->Divide(6, 6);
1422
1423 TCanvas* c6 = new TCanvas("c6", "c6", 600., 800.);
1424 c6->Divide(2, 5);
1425
1426 TH2F* h2d_nhocapid[nprojtype];
1427 TH2F* h2d_hocapidsig[nprojtype];
1428 TH2F* h2d_hocapidsigwo[nprojtype];
1429
1430 for (int ij = 0; ij < nprojtype; ij++) {
1431 sprintf(name, "hoCalibc/nhocapid_%i", ij);
1432 h2d_nhocapid[ij] = (TH2F*)fx->Get(name);
1433
1434 sprintf(name, "hoCalibc/hocapidsig_%i", ij);
1435 h2d_hocapidsig[ij] = (TH2F*)fx->Get(name);
1436
1437 sprintf(name, "hoCalibc/hocapidsigwo_%i", ij);
1438 h2d_hocapidsigwo[ij] = (TH2F*)fx->Get(name);
1439
1440 h2d_hocapidsig[ij]->Divide(h2d_nhocapid[ij]);
1441 h2d_hocapidsigwo[ij]->Divide(h2d_nhocapid[ij]);
1442
1443 ps.NewPage();
1444 c3->cd();
1445 h2d_hocapidsig[ij]->Draw("colz");
1446 c3->Update();
1447
1448 ps.NewPage();
1449 c3->cd();
1450 h2d_hocapidsigwo[ij]->Draw("colz");
1451 c3->Update();
1452 }
1453
1454 for (int ij = 0; ij < nprojtype; ij++) {
1455 sprintf(name, "hoCalibc/hbentry_d%i", ij + 3);
1456 cout << "ij " << name << endl;
1457 histent[ij] = (TH2F*)fx->Get(name);
1458
1459 sprintf(name, "hoCalibc/hbsig_d%i", ij + 3);
1460 histen[ij] = (TH2F*)fx->Get(name);
1461 sprintf(name, "hoCalibc/hbsig2_d%i", ij + 3);
1462 histen2[ij] = (TH2F*)fx->Get(name);
1463
1464 int nentry = TMath::Max(1., histent[ij]->GetBinContent(0, 0));
1465 cout << "ij " << nentry << endl;
1466
1467 histen[ij]->Divide(histent[ij]);
1468 histen2[ij]->Divide(histent[ij]);
1469
1470 histent[ij]->Scale(1. / nentry);
1471
1472 int xbin = histen[ij]->GetNbinsX();
1473 int ybin = histen[ij]->GetNbinsY();
1474 sprintf(name, "histerr_%i", ij);
1475 histerr[ij] = new TH2F(name,
1476 name,
1477 xbin,
1478 histent[ij]->GetXaxis()->GetXmin(),
1479 histent[ij]->GetXaxis()->GetXmax(),
1480 ybin,
1481 histent[ij]->GetYaxis()->GetXmin(),
1482 histent[ij]->GetYaxis()->GetXmax());
1483
1484 for (int jk = 1; jk <= xbin; jk++) {
1485 for (int kl = 1; kl <= ybin; kl++) {
1486 double err = sqrt(histen2[ij]->GetBinContent(jk, kl) -
1487 histen[ij]->GetBinContent(jk, kl) * histen[ij]->GetBinContent(jk, kl));
1488
1489 histerr[ij]->Fill(histent[ij]->GetXaxis()->GetBinCenter(jk), histent[ij]->GetYaxis()->GetBinCenter(kl), err);
1490 }
1491 }
1492
1493 ps.NewPage();
1494 cout << "ij11 " << ij << " " << histent[ij]->GetBinContent(22, 22) << endl;
1495 c0->cd(1);
1496 histent[ij]->Draw("colz");
1497 cout << "ij12 " << ij << " " << histen[ij]->GetBinContent(22, 22) << endl;
1498 c0->cd(2);
1499 histen[ij]->GetXaxis()->SetRangeUser(-15.49, 15.49);
1500 histen[ij]->Draw("colz");
1501 cout << "ij13 " << ij << endl;
1502 c0->cd(3);
1503 histen2[ij]->GetXaxis()->SetRangeUser(-15.49, 15.49);
1504 histen2[ij]->Draw("colz");
1505 cout << "ij14 " << ij << endl;
1506 c0->cd(4);
1507 histerr[ij]->GetXaxis()->SetRangeUser(-15.49, 15.49);
1508 histerr[ij]->Draw("colz");
1509 cout << "ij15 " << ij << endl;
1510 c0->Update();
1511 cout << "ij16 " << ij << endl;
1512 }
1513
1514 for (int jk = 0; jk < nringmx; jk++) {
1515 for (int kl = 0; kl <= rbxmx; kl++) {
1516 if (jk != 2 && kl > rbx12mx)
1517 continue;
1518 ps.NewPage();
1519 for (int lm = 0; lm < shapemx; lm++) {
1520 if (kl == 0) {
1521 sprintf(name, "hoCalibc/rbx_shape_%i_r%i_allrbx", lm, jk);
1522 } else {
1523 sprintf(name, "hoCalibc/rbx_shape_%i_r%i_%i", lm, jk, kl);
1524 }
1525 rbx_shape[lm][jk][kl] = (TH2F*)fx->Get(name);
1526 c6->cd(int(lm / 5) + 2 * (lm % 5) + 1);
1527
1528 rbx_shape[lm][jk][kl]->Draw("colz");
1529 }
1530 c6->Update();
1531 }
1532 }
1533
1534
1535 for (int ij = thmn; ij < thmx; ij++) {
1536 sprintf(name, "hoCalibc/hocorrelht_%i", ij);
1537 h_correlht[ij] = (TH2F*)fx->Get(name);
1538
1539 h_correlht[ij]->Scale(1. / nentry);
1540
1541 sprintf(name, "hoCalibc/hormoccu_%i", ij);
1542 h_rmoccu[ij] = (TH2F*)fx->Get(name);
1543 h_rmoccu[ij]->Scale(1. / nentry);
1544
1545 sprintf(name, "hoCalibc/hormcorrel_%i", ij);
1546 h_rmcorrel[ij] = (TH2F*)fx->Get(name);
1547 h_rmcorrel[ij]->Scale(1. / nentry);
1548
1549 for (int jk = 0; jk < nringmx; jk++) {
1550 sprintf(name, "hoCalibc/hocorrelsig_%i_%i", jk, ij);
1551 h_correlsig[jk][ij] = (TH2F*)fx->Get(name);
1552 h_correlsig[jk][ij]->Scale(1. / nentry);
1553 }
1554
1555 cout << "ij2 " << ij << endl;
1556 ps.NewPage();
1557
1558 c1->cd(1);
1559 h_correlht[ij]->Draw("colz");
1560
1561 c1->cd(2);
1562 h_rmoccu[ij]->Draw("colz");
1563 c1->cd(3);
1564 h_rmcorrel[ij]->Draw("colz");
1565 cout << "ij23 " << ij << endl;
1566 for (int jk = 0; jk < nringmx; jk++) {
1567 cout << "ij22 " << ij << endl;
1568 c1->cd(jk + 4);
1569 h_correlsig[jk][ij]->Draw("colz");
1570 }
1571 cout << "ij21 " << ij << endl;
1572 c1->Update();
1573
1574 sprintf(name, "hoCalibc/hoallcorrelsig_%i", ij);
1575 cout << "ij24 " << ij << " " << name << endl;
1576 h_allcorrelsig[ij] = (TH2F*)fx->Get(name);
1577 h_allcorrelsig[ij]->Scale(1. / nentry);
1578 cout << "ij25 " << ij << endl;
1579 ps.NewPage();
1580 c3->cd();
1581 h_allcorrelsig[ij]->Draw("colz");
1582 c3->Update();
1583 cout << "ij2 " << ij << endl;
1584 }
1585
1586 for (int jk = 0; jk < nringmx; jk++) {
1587 ps.NewPage();
1588 for (int kl = 1; kl <= routmx; kl++) {
1589 if (jk != 2 && kl > rout12mx)
1590 continue;
1591 c5->cd(kl);
1592 gPad->SetLogy(1);
1593 if (kl == 0) {
1594 sprintf(name, "hoCalibc/rout_ind_energy_r%i_allrout", jk);
1595 } else {
1596 sprintf(name, "hoCalibc/rout_ind_energy_r%i_%i", jk, kl);
1597 }
1598 rout_ind_energy[jk][kl] = (TH1F*)fx->Get(name);
1599 rout_ind_energy[jk][kl]->Draw();
1600 }
1601 c5->Update();
1602 }
1603
1604 for (int ij = thmn; ij < thmx; ij++) {
1605
1606 for (int jk = 0; jk < nringmx; jk++) {
1607 ps.NewPage();
1608 for (int kl = 1; kl <= routmx; kl++) {
1609 if (jk != 2 && kl > rout12mx)
1610 continue;
1611 c5->cd(kl);
1612 gPad->SetLogy(1);
1613 if (kl == 0) {
1614 sprintf(name, "hoCalibc/rout_mult_%i_r%i_allrout", ij, jk);
1615 } else {
1616 sprintf(name, "hoCalibc/rout_mult_%i_r%i_%i", ij, jk, kl);
1617 }
1618 rout_mult[ij][jk][kl] = (TH1F*)fx->Get(name);
1619 rout_mult[ij][jk][kl]->Draw();
1620 }
1621 c5->Update();
1622 }
1623 }
1624
1625 for (int ij = thmn; ij < thmx; ij++) {
1626 int klx = 0;
1627 for (int jk = 0; jk < nringmx; jk++) {
1628 if (klx % 12 == 0)
1629 ps.NewPage();
1630 for (int kl = 1; kl <= rbxmx; kl++) {
1631 if (jk != 2 && kl > rbx12mx)
1632 continue;
1633 c4x->cd(klx % 12 + 1);
1634 klx++;
1635 gPad->SetLogy(1);
1636 if (kl == 0) {
1637 sprintf(name, "hoCalibc/rbx_mult_%i_r%i_allrbx", ij, jk);
1638 } else {
1639 sprintf(name, "hoCalibc/rbx_mult_%i_r%i_%i", ij, jk, kl);
1640 }
1641 rbx_mult[ij][jk][kl] = (TH1F*)fx->Get(name);
1642 rbx_mult[ij][jk][kl]->Draw();
1643 }
1644 if (klx % 12 == 0)
1645 c4x->Update();
1646 }
1647 }
1648
1649 for (int ij = thmn; ij < thmx; ij++) {
1650 for (int jk = 0; jk < nprojtype + 1; jk++) {
1651 sprintf(name, "hoCalibc/endigisig_%i_%i", jk, ij);
1652 cout << "name " << name << endl;
1653 endigisig[jk][ij] = (TH1F*)fx->Get(name);
1654 sprintf(name, "hoCalibc/endigicnt_%i_%i", jk, ij);
1655 endigicnt[jk][ij] = (TH1F*)fx->Get(name);
1656
1657 sprintf(name, "hoCalibc/rmdigisig_%i_%i", jk, ij);
1658 rmdigisig[jk][ij] = (TH2F*)fx->Get(name);
1659 sprintf(name, "hoCalibc/rmdigicnt_%i_%i", jk, ij);
1660 rmdigicnt[jk][ij] = (TH2F*)fx->Get(name);
1661
1662 sprintf(name, "hoCalibc/ringdigisig_%i_%i", jk, ij);
1663 ringdigisig[jk][ij] = (TH2F*)fx->Get(name);
1664 sprintf(name, "hoCalibc/ringdigicnt_%i_%i", jk, ij);
1665 ringdigicnt[jk][ij] = (TH2F*)fx->Get(name);
1666
1667 sprintf(name, "hoCalibc/inddigisig_%i_%i", jk, ij);
1668 inddigisig[jk][ij] = (TH2F*)fx->Get(name);
1669 sprintf(name, "hoCalibc/inddigicnt_%i_%i", jk, ij);
1670 inddigicnt[jk][ij] = (TH2F*)fx->Get(name);
1671
1672 sprintf(name, "hoCalibc/indrecosig_%i_%i", jk, ij);
1673 indrecosig[jk][ij] = (TH2F*)fx->Get(name);
1674 sprintf(name, "hoCalibc/indrecocnt_%i_%i", jk, ij);
1675 indrecocnt[jk][ij] = (TH2F*)fx->Get(name);
1676
1677 endigisig[jk][ij]->Divide(endigicnt[jk][ij]);
1678 rmdigisig[jk][ij]->Divide(rmdigicnt[jk][ij]);
1679 ringdigisig[jk][ij]->Divide(ringdigicnt[jk][ij]);
1680 inddigisig[jk][ij]->Divide(inddigicnt[jk][ij]);
1681 indrecosig[jk][ij]->Divide(indrecocnt[jk][ij]);
1682 }
1683 }
1684
1685 ps.NewPage();
1686
1687 for (int ij = thmn; ij < thmx; ij++) {
1688 ps.NewPage();
1689 for (int jk = 0; jk < nprojtype + 1; jk++) {
1690 c4->cd(2 * jk + 1);
1691 endigicnt[jk][ij]->Draw();
1692 c4->cd(2 * jk + 2);
1693 endigisig[jk][ij]->Draw();
1694 }
1695 c4->Update();
1696 }
1697
1698 for (int ij = thmn; ij < thmx; ij++) {
1699 ps.NewPage();
1700 for (int jk = 0; jk < nprojtype + 1; jk++) {
1701 c4->cd(2 * jk + 1);
1702 rmdigicnt[jk][ij]->Draw("colz");
1703 c4->cd(2 * jk + 2);
1704 rmdigisig[jk][ij]->Draw("colz");
1705 }
1706 c4->Update();
1707 }
1708
1709 for (int ij = thmn; ij < thmx; ij++) {
1710 ps.NewPage();
1711 for (int jk = 0; jk < nprojtype + 1; jk++) {
1712 c4->cd(2 * jk + 1);
1713 ringdigicnt[jk][ij]->Draw("colz");
1714 c4->cd(2 * jk + 2);
1715 ringdigisig[jk][ij]->Draw("colz");
1716 }
1717 c4->Update();
1718 }
1719
1720 for (int ij = thmn; ij < thmx; ij++) {
1721 ps.NewPage();
1722 for (int jk = 0; jk < nprojtype + 1; jk++) {
1723 c4->cd(2 * jk + 1);
1724 inddigicnt[jk][ij]->Draw("colz");
1725 c4->cd(2 * jk + 2);
1726 inddigisig[jk][ij]->Draw("colz");
1727 }
1728 c4->Update();
1729 }
1730
1731 for (int ij = thmn; ij < thmx; ij++) {
1732 ps.NewPage();
1733 for (int jk = 0; jk < nprojtype + 1; jk++) {
1734 c4->cd(2 * jk + 1);
1735 indrecocnt[jk][ij]->Draw("colz");
1736 c4->cd(2 * jk + 2);
1737 indrecosig[jk][ij]->Draw("colz");
1738 }
1739 c4->Update();
1740 }
1741
1742 for (int ij = thmn; ij < thmx; ij++) {
1743 sprintf(name, "hoCalibc/hoallmucorrel_%i", ij);
1744
1745 double total = 0;
1746 h_allmucorrel[ij] = (TH2F*)fx->Get(name);
1747 hnorm_allmucorrel[ij] = (TH2F*)h_allmucorrel[ij]->Clone();
1748 for (int ix = 1; ix <= h_allmucorrel[ij]->GetNbinsX(); ix++) {
1749 float anent = h_allmucorrel[ij]->GetBinContent(ix, 0);
1750 total += anent;
1751 cout << "ix " << ij << " " << ix << " " << anent << " " << total << endl;
1752 if (anent < 1.)
1753 anent = 1.;
1754 for (int iy = 1; iy <= h_allmucorrel[ij]->GetNbinsY(); iy++) {
1755 hnorm_allmucorrel[ij]->SetBinContent(ix, iy, h_allmucorrel[ij]->GetBinContent(ix, iy) / anent);
1756 }
1757 }
1758 ps.NewPage();
1759 c3->cd();
1760 hnorm_allmucorrel[ij]->Draw("colz");
1761 c3->Update();
1762 }
1763
1764 cout << "ij116 " << endl;
1765
1766 for (int isel = 0; isel < nseltype; isel++) {
1767 for (int ij = 0; ij < nprojmx / 2; ij++) {
1768 ps.NewPage();
1769 for (int jk = 0; jk < nadmx / 2; jk++) {
1770 sprintf(name, "hoCalibc/%s_%i_%i", projname[ij], isel, jk);
1771 cout << "name " << name << endl;
1772 totalproj[isel][ij][jk] = (TH2F*)fx->Get(name);
1773 }
1774 }
1775 cout << "1ij116 " << endl;
1776 for (int jk = 0; jk < nadmx / 2; jk++) {
1777 totalproj[isel][1][jk]->Divide(totalproj[isel][0][jk]);
1778 totalproj[isel][0][jk]->Divide(totalmuon[isel]);
1779 }
1780
1781 for (int ij = 0; ij < nprojmx / 2; ij++) {
1782 ps.NewPage();
1783 for (int jk = 0; jk < nadmx / 2; jk++) {
1784 c1->cd(jk + 1);
1785 totalproj[isel][ij][jk]->Draw("colz");
1786 }
1787 c1->Update();
1788 }
1789
1790 cout << "2ij116 " << endl;
1791 for (int ij = 2; ij < nprojmx; ij++) {
1792 for (int jk = 0; jk < nadmx; jk++) {
1793 sprintf(name, "hoCalibc/%s_%i_%i", projname[ij], isel, jk);
1794 cout << "ij2 " << ij << " " << jk << " " << name << endl;
1795 totalproj[isel][ij][jk] = (TH2F*)fx->Get(name);
1796 }
1797 }
1798 cout << "3ij116 " << endl;
1799 for (int jk = 0; jk < nadmx / 2; jk++) {
1800 totalproj[isel][3][jk]->Divide(totalproj[isel][2][jk]);
1801 totalproj[isel][2][jk]->Divide(totalmuon[isel]);
1802 }
1803 cout << "4ij116 " << endl;
1804
1805 for (int ij = 2; ij < nprojmx; ij++) {
1806 ps.NewPage();
1807 for (int jk = 0; jk < nadmx; jk++) {
1808 c2->cd(jk + 1);
1809 totalproj[isel][ij][jk]->Draw("colz");
1810 }
1811 c2->Update();
1812 }
1813
1814 cout << "5ij116 " << endl;
1815 }
1816
1817 ps.Close();
1818 }
1819
1820 void testxx(int nproj = 1) {
1821 def_setting();
1822 const int nprojtype = 5;
1823 TH2F* histent[nprojtype + 3];
1824 TH2F* histen[nprojtype + 3];
1825 TH2F* histen2[nprojtype + 3];
1826 TH2F* histerr[nprojtype];
1827 gStyle->SetOptStat(0);
1828 gStyle->SetPadTopMargin(0.06);
1829 gStyle->SetPadBottomMargin(0.13);
1830 gStyle->SetPadLeftMargin(0.10);
1831 gStyle->SetPadRightMargin(0.12);
1832 gStyle->SetLabelSize(0.065, "XY");
1833
1834 TLatex latex;
1835 latex.SetNDC();
1836 latex.SetTextSize(0.07);
1837 latex.SetTextFont(42);
1838 latex.SetTextAlign(1);
1839
1840 cout << "testxxxx1 " << endl;
1841 TCanvas* c1 = new TCanvas("c1", "c1", 800, 550);
1842 cout << "testxxxx2 " << endl;
1843 c1->Divide(2, 2);
1844
1845 char name[100];
1846
1847 for (int ij = 0; ij < nproj; ij++) {
1848 sprintf(name, "hoCalibc/hbentry_d%i", ij + 3);
1849 cout << "ij " << name << endl;
1850 histent[ij] = (TH2F*)gDirectory->Get(name);
1851 sprintf(name, "hoCalibc/hbsig_d%i", ij + 3);
1852 histen[ij] = (TH2F*)gDirectory->Get(name);
1853 sprintf(name, "hoCalibc/hbsig2_d%i", ij + 3);
1854 histen2[ij] = (TH2F*)gDirectory->Get(name);
1855
1856 int nentry = TMath::Max(1., histent[ij]->GetBinContent(0, 0));
1857 histen[ij]->Divide(histent[ij]);
1858 histen2[ij]->Divide(histent[ij]);
1859
1860 histent[ij]->Scale(1. / nentry);
1861
1862 histen[ij]->GetXaxis()->SetLabelSize(0.065);
1863 histen[ij]->GetYaxis()->SetLabelSize(0.065);
1864 histen2[ij]->GetXaxis()->SetLabelSize(0.065);
1865 histen2[ij]->GetYaxis()->SetLabelSize(0.065);
1866 histent[ij]->GetXaxis()->SetLabelSize(0.065);
1867 histent[ij]->GetYaxis()->SetLabelSize(0.065);
1868
1869 int xbin = histen[ij]->GetNbinsX();
1870 int ybin = histen[ij]->GetNbinsY();
1871 sprintf(name, "histerr_%i", ij);
1872 histerr[ij] = new TH2F(name,
1873 name,
1874 xbin,
1875 histent[ij]->GetXaxis()->GetXmin(),
1876 histent[ij]->GetXaxis()->GetXmax(),
1877 ybin,
1878 histent[ij]->GetYaxis()->GetXmin(),
1879 histent[ij]->GetYaxis()->GetXmax());
1880
1881 for (int jk = 1; jk <= xbin; jk++) {
1882 for (int kl = 1; kl <= ybin; kl++) {
1883 double err = sqrt(histen2[ij]->GetBinContent(jk, kl) -
1884 histen[ij]->GetBinContent(jk, kl) * histen[ij]->GetBinContent(jk, kl));
1885
1886 histerr[ij]->Fill(histent[ij]->GetXaxis()->GetBinCenter(jk), histent[ij]->GetYaxis()->GetBinCenter(kl), err);
1887 }
1888 }
1889
1890 cout << "ij11 " << ij << " " << histent[ij]->GetBinContent(22, 22) << endl;
1891 histent[ij]->GetXaxis()->SetTitle("i#eta");
1892 histent[ij]->GetXaxis()->SetTitleSize(0.075);
1893 histent[ij]->GetXaxis()->SetTitleOffset(0.8);
1894 histent[ij]->GetXaxis()->CenterTitle();
1895 histent[ij]->GetYaxis()->SetTitle("i#phi");
1896 histent[ij]->GetYaxis()->SetTitleSize(0.075);
1897 histent[ij]->GetYaxis()->SetTitleOffset(0.6);
1898 histent[ij]->GetYaxis()->CenterTitle();
1899
1900 c1->cd(1);
1901 histent[ij]->Draw("colz");
1902 latex.DrawLatex(0.5, 0.95, "Occupancy");
1903 cout << "ij12 " << ij << " " << histen[ij]->GetBinContent(22, 22) << endl;
1904 histen[ij]->GetXaxis()->SetTitle("i#eta");
1905 histen[ij]->GetXaxis()->SetTitleSize(0.075);
1906 histen[ij]->GetXaxis()->SetTitleOffset(0.8);
1907 histen[ij]->GetXaxis()->CenterTitle();
1908 histen[ij]->GetYaxis()->SetTitle("i#phi");
1909 histen[ij]->GetYaxis()->SetTitleSize(0.075);
1910 histen[ij]->GetYaxis()->SetTitleOffset(0.6);
1911 histen[ij]->GetYaxis()->CenterTitle();
1912
1913 c1->cd(2);
1914 histen[ij]->Draw("colz");
1915 latex.DrawLatex(0.5, 0.95, "Mean");
1916 histen2[ij]->GetXaxis()->SetTitle("i#eta");
1917 histen2[ij]->GetXaxis()->SetTitleSize(0.075);
1918 histen2[ij]->GetXaxis()->SetTitleOffset(0.8);
1919 histen2[ij]->GetXaxis()->CenterTitle();
1920 histen2[ij]->GetYaxis()->SetTitle("i#phi");
1921 histen2[ij]->GetYaxis()->SetTitleSize(0.075);
1922 histen2[ij]->GetYaxis()->SetTitleOffset(0.6);
1923 histen2[ij]->GetYaxis()->CenterTitle();
1924
1925 c1->cd(3);
1926 histen2[ij]->Draw("colz");
1927 latex.DrawLatex(0.5, 0.95, "(Mean^{2})");
1928 cout << "ij14 " << ij << endl;
1929 histerr[ij]->GetXaxis()->SetTitle("i#eta");
1930 histerr[ij]->GetXaxis()->SetTitleSize(0.075);
1931 histerr[ij]->GetXaxis()->SetTitleOffset(0.8);
1932 histerr[ij]->GetXaxis()->CenterTitle();
1933 histerr[ij]->GetYaxis()->SetTitle("i#phi");
1934 histerr[ij]->GetYaxis()->SetTitleSize(0.075);
1935 histerr[ij]->GetYaxis()->SetTitleOffset(0.6);
1936 histerr[ij]->GetYaxis()->CenterTitle();
1937
1938 c1->cd(4);
1939 histerr[ij]->Draw("colz");
1940 latex.DrawLatex(0.5, 0.95, "RMS");
1941
1942 cout << "ij15 " << ij << endl;
1943 c1->Update();
1944 cout << "ij16 " << ij << endl;
1945
1946 int nentry = TMath::Max(1., histent[ij]->GetBinContent(0, 0));
1947 cout << "ij " << nentry << endl;
1948 }
1949 }
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959 void plot000(int irng = -1, int isect = 0, int isect2 = 5, int ntype = 1, const char* tag = "", int extcol = 0) {
1960 def_setting();
1961 gStyle->SetOptLogy(1);
1962 gStyle->SetOptStat(0);
1963 gStyle->SetStatTextColor(3);
1964 gStyle->SetStatY(.99);
1965 gStyle->SetPadLeftMargin(0.12);
1966 gStyle->SetPadRightMargin(0.02);
1967 gStyle->SetPadTopMargin(0.02);
1968 gStyle->SetPadBottomMargin(0.12);
1969 TLatex latex;
1970 latex.SetNDC();
1971 latex.SetTextSize(0.07);
1972
1973 latex.SetTextFont(42);
1974 latex.SetTextAlign(1);
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987 TLegend* tleg = new TLegend(.5, 0.65, 0.75, 0.85, "", "brNDC");
1988 tleg->SetFillColor(10);
1989 tleg->SetBorderSize(0);
1990 tleg->SetTextFont(42);
1991
1992 char name[100];
1993 if (!strstr(tag, "same")) {
1994 TCanvas* c1 = new TCanvas("c1", "c1", 1000, 600);
1995 if (irng >= 0 && isect2 - isect < 2) {
1996 c1->Divide(5, 2, 1.e-6, 1.e-6);
1997 tleg->SetTextSize(0.06);
1998 } else {
1999 if (irng < 0) {
2000 c1->Divide(nchnmx, ringmx, 1.e-6, 1.e-6);
2001 } else {
2002 c1->Divide(nchnmx, ringmx + 1, 1.e-6, 1.e-6);
2003 }
2004 tleg->SetTextSize(0.10);
2005 }
2006 }
2007
2008 TH1F* histx[nprojtype][ringmx][nchnmx];
2009 TH1F* histy[nprojtype][ringmx][nchnmx];
2010
2011 int nloop = (irng < 0) ? ringmx : isect2 - isect + 1;
2012 cout << "nloop " << nloop << endl;
2013 bool iscomb = false;
2014
2015 for (int kl = 0; kl < ntype; kl++) {
2016 int ipad = 0;
2017 int icol = extcol + kl + 1;
2018 if (icol >= 5)
2019 icol++;
2020 if (icol >= 10)
2021 icol++;
2022 if (extcol > 0)
2023 latex.SetTextColor(icol);
2024 for (int ij = 0; ij < nloop; ij++) {
2025 for (int jk = 0; jk < nchnmx; jk++) {
2026 if (irng < 0) {
2027 sprintf(name, "hoCalibc/ringavedigi_%i_%i_%i_%i", kl, ij, (ij == 2) ? rbxmx : rbx12mx, jk);
2028 iscomb = true;
2029 } else {
2030 sprintf(name, "hoCalibc/ringavedigi_%i_%i_%i_%i", kl, irng, isect + ij, jk);
2031 if ((irng == 2 && isect + ij == rbxmx) || (irng != 2 && isect + ij == rbx12mx))
2032 iscomb = true;
2033 }
2034
2035 histy[kl][ij][jk] = (TH1F*)gDirectory->Get(name);
2036 histx[kl][ij][jk] = (TH1F*)histy[kl][ij][jk]->Clone();
2037 histx[kl][ij][jk]->Rebin(3);
2038 histx[kl][ij][jk]->Scale(1. / TMath::Max(1., histx[kl][ij][jk]->Integral()));
2039 c1->cd(++ipad);
2040 histx[kl][ij][jk]->GetXaxis()->SetTitle("HO digi");
2041 histx[kl][ij][jk]->GetXaxis()->SetTitleSize(0.075);
2042 histx[kl][ij][jk]->GetXaxis()->SetTitleOffset(0.7);
2043 histx[kl][ij][jk]->GetXaxis()->CenterTitle();
2044 histx[kl][ij][jk]->GetXaxis()->SetLabelSize(0.075);
2045 histx[kl][ij][jk]->GetXaxis()->SetLabelOffset(-0.005);
2046
2047 histx[kl][ij][jk]->GetYaxis()->SetTitle();
2048 histx[kl][ij][jk]->GetYaxis()->SetTitleSize(0.085);
2049 histx[kl][ij][jk]->GetYaxis()->SetTitleOffset(0.9);
2050 histx[kl][ij][jk]->GetYaxis()->CenterTitle();
2051 histx[kl][ij][jk]->GetYaxis()->SetLabelSize(0.065);
2052 histx[kl][ij][jk]->GetYaxis()->SetLabelOffset(0.01);
2053
2054 histx[kl][ij][jk]->GetXaxis()->SetNdivisions(404);
2055 histx[kl][ij][jk]->GetYaxis()->SetNdivisions(404);
2056
2057 histx[kl][ij][jk]->SetLineColor(icol);
2058 if (kl == 0) {
2059
2060 histx[kl][ij][jk]->Draw(tag);
2061 if (jk == 0) {
2062 if (irng < 0) {
2063 latex.DrawLatex(0.65, 0.62, Form("Ring %i", ij - 2));
2064 } else {
2065 if (iscomb) {
2066 latex.DrawLatex(0.65, 0.85 - 0.08 * extcol, Form("R %i", irng - 2));
2067 } else {
2068 latex.DrawLatex(0.65, 0.90 - 0.045 * extcol, Form("R%i Rbx%i", irng - 2, isect + ij));
2069 }
2070 }
2071 }
2072 if (ij == 0 && (!strstr(tag, "same")))
2073 latex.DrawLatex(0.45, 0.88, Form("TS %i", jk));
2074 } else {
2075 histx[kl][ij][jk]->Draw("same");
2076 }
2077
2078 if (ij == 0 && jk == 0 && (!strstr(tag, "same"))) {
2079 tleg->AddEntry(histx[kl][ij][jk], projname[kl], "lpfe");
2080 }
2081
2082 cout << "kl " << kl << "" << ij << "" << jk << " " << histx[kl][ij][jk]->Integral() << " "
2083 << histx[kl][ij][jk]->GetTitle() << endl;
2084 }
2085 }
2086 }
2087 if (!strstr(tag, "same")) {
2088 tleg->Draw();
2089 }
2090 if (strstr(tag, "sames")) {
2091 c1->Update();
2092 }
2093 }
2094
2095 void plot000r(int irng = -1, int isup = 0, double xup = 200) {
2096 def_setting();
2097 gStyle->SetOptLogy(1);
2098 gStyle->SetOptStat(0);
2099 gStyle->SetStatTextColor(3);
2100 gStyle->SetStatY(.99);
2101 gStyle->SetPadLeftMargin(0.14);
2102 gStyle->SetPadRightMargin(0.02);
2103 gStyle->SetPadTopMargin(0.02);
2104 gStyle->SetPadBottomMargin(0.12);
2105 TLatex latex;
2106 latex.SetNDC();
2107 if (irng < 0) {
2108 latex.SetTextSize(0.08);
2109 } else {
2110 latex.SetTextSize(0.075);
2111 }
2112
2113 latex.SetTextFont(42);
2114 latex.SetTextAlign(1);
2115
2116 TLegend* tleg = new TLegend(.5, 0.3, 0.8, 0.9, "", "brNDC");
2117 tleg->SetFillColor(10);
2118 tleg->SetBorderSize(0);
2119 tleg->SetTextFont(42);
2120
2121 cout << "xx1x " << endl;
2122 char name[100];
2123 int ysiz = (irng < 0) ? 350 : 450;
2124 TCanvas* c1 = new TCanvas("c1", "c1", 900., ysiz);
2125 tleg->SetTextSize(0.035);
2126 if (irng < 0) {
2127 tleg->SetTextSize(0.045);
2128 c1->Divide(5, 1, 1.e-6, 1.e-6);
2129 } else if (irng == 2) {
2130 c1->Divide(4, 3, 1.e-6, 1.e-6);
2131 } else {
2132 c1->Divide(3, 2, 1.e-6, 1.e-6);
2133 }
2134
2135 cout << "xxx " << endl;
2136 TH1F* histx[ringmx][routmx + 1];
2137 TH1F* histy[ringmx][routmx + 1];
2138
2139 int nloop11 = (irng < 0) ? 0 : irng;
2140 int nloop12 = (irng < 0) ? ringmx : irng + 1;
2141 int nloop2 = (irng < 0 && isup == 0) ? 1 : ((irng == 2 || isup > 0) ? 36 : 24);
2142
2143 bool iscomb = false;
2144 cout << "xxx2 " << nloop11 << " " << nloop12 << " " << nloop2 << endl;
2145 int ipad = 0;
2146 for (int ij = nloop11; ij < nloop12; ij++) {
2147 if (isup > 0)
2148 c1->cd(++ipad);
2149 for (int jk = 0; jk < nloop2; jk++) {
2150 if (ij != 2 && jk >= 24)
2151 continue;
2152 cout << "xxx3 " << ij << " " << jk << endl;
2153 if (irng < 0 && isup == 0) {
2154 sprintf(name, "hoCalibc/rout_ind_energy_r%i_0", ij);
2155 iscomb = true;
2156 } else {
2157 sprintf(name, "hoCalibc/rout_ind_energy_r%i_%i", ij, jk + 1);
2158 }
2159
2160 cout << "name " << name << endl;
2161 histy[ij][jk] = (TH1F*)gDirectory->Get(name);
2162 histx[ij][jk] = (TH1F*)histy[ij][jk]->Clone();
2163
2164 histx[ij][jk]->Scale(1. / TMath::Max(1., histx[ij][jk]->Integral()));
2165 if (isup <= 0)
2166 c1->cd(++ipad);
2167 histx[ij][jk]->GetXaxis()->SetTitle("HO RECO (GeV)");
2168 histx[ij][jk]->GetXaxis()->SetTitleSize(0.065);
2169 histx[ij][jk]->GetXaxis()->SetTitleOffset(0.85);
2170 histx[ij][jk]->GetXaxis()->CenterTitle();
2171 histx[ij][jk]->GetXaxis()->SetLabelSize(0.07);
2172 histx[ij][jk]->GetXaxis()->SetLabelOffset(-0.003);
2173
2174 histx[ij][jk]->GetYaxis()->SetTitle();
2175 histx[ij][jk]->GetYaxis()->SetTitleSize(0.085);
2176 histx[ij][jk]->GetYaxis()->SetTitleOffset(0.9);
2177 histx[ij][jk]->GetYaxis()->CenterTitle();
2178 histx[ij][jk]->GetYaxis()->SetLabelSize(0.07);
2179 histx[ij][jk]->GetYaxis()->SetLabelOffset(0.01);
2180
2181 histx[ij][jk]->GetXaxis()->SetNdivisions(404);
2182 histx[ij][jk]->GetYaxis()->SetNdivisions(404);
2183 histx[ij][jk]->GetXaxis()->SetRangeUser(0., xup);
2184
2185 if (isup > 0)
2186 histx[ij][jk]->SetLineColor(jk + 1);
2187 histx[ij][jk]->Draw((jk > 0 && isup > 0) ? "same" : "");
2188
2189 if (isup > 0 && ij == 2) {
2190 cout << "jk " << jk << endl;
2191 tleg->AddEntry(histx[ij][jk], Form("RM %i", jk), "lpfe");
2192 }
2193
2194 if (irng < 0) {
2195 latex.DrawLatex(0.55, 0.92, Form("Ring %i", ij - 2));
2196 } else {
2197 latex.DrawLatex(0.55, 0.92, Form("Ring %i Sec%i", ij - 2, jk));
2198 }
2199 }
2200 if (isup > 0 && ij == 2)
2201 tleg->Draw();
2202 }
2203
2204 c1->Update();
2205 }
2206
2207 void plot00(int ityp = 0, int isect = 0) {
2208 def_setting();
2209 gStyle->SetOptLogy(1);
2210 gStyle->SetOptStat(1100);
2211 gStyle->SetStatTextColor(3);
2212 gStyle->SetStatY(.99);
2213 gStyle->SetPadLeftMargin(0.09);
2214 gStyle->SetPadRightMargin(0.02);
2215 gStyle->SetPadTopMargin(0.02);
2216 gStyle->SetPadBottomMargin(0.07);
2217 TLatex latex;
2218 latex.SetNDC();
2219 latex.SetTextSize(0.11);
2220 latex.SetTextFont(42);
2221 latex.SetTextAlign(1);
2222
2223 char name[100];
2224 TCanvas* c1 = new TCanvas("c1", "c1", 1000., 600.);
2225 c1->Divide(nchnmx, ringmx, 1.e-6, 1.e-6);
2226
2227 TH1F* histx[ringmx][nchnmx];
2228 int icol = 0;
2229 for (int ij = 0; ij < ringmx; ij++) {
2230 for (int jk = 0; jk < nchnmx; jk++) {
2231
2232 sprintf(name, "hoCalibc/ringavedigi_%i_%i_%i_%i", ityp, ij, isect, jk);
2233
2234 histx[ij][jk] = (TH1F*)gDirectory->Get(name);
2235
2236 c1->cd(++icol);
2237 histx[ij][jk]->GetXaxis()->SetTitle("HO digi");
2238 histx[ij][jk]->GetXaxis()->SetTitleSize(0.095);
2239 histx[ij][jk]->GetXaxis()->SetTitleOffset(0.75);
2240 histx[ij][jk]->GetXaxis()->CenterTitle();
2241 histx[ij][jk]->GetXaxis()->SetLabelSize(0.085);
2242 histx[ij][jk]->GetXaxis()->SetLabelOffset(0.001);
2243
2244 histx[ij][jk]->GetYaxis()->SetTitle();
2245 histx[ij][jk]->GetYaxis()->SetTitleSize(0.085);
2246 histx[ij][jk]->GetYaxis()->SetTitleOffset(0.9);
2247 histx[ij][jk]->GetYaxis()->CenterTitle();
2248 histx[ij][jk]->GetYaxis()->SetLabelSize(0.07);
2249 histx[ij][jk]->GetYaxis()->SetLabelOffset(0.01);
2250
2251 histx[ij][jk]->SetLineColor(3);
2252 histx[ij][jk]->Draw();
2253 if (jk == 0)
2254 latex.DrawLatex(0.65, 0.62, Form("Ring %i", ij - 2));
2255 if (ij == 0)
2256 latex.DrawLatex(0.65, 0.42, Form("TS %i", jk));
2257 }
2258 }
2259 c1->Update();
2260 }
2261
2262
2263
2264
2265
2266
2267 void plot01(int ityp = 0, int islocal = 1) {
2268 def_setting();
2269 gStyle->SetOptLogy(1);
2270 gStyle->SetOptStat(0);
2271 gStyle->SetStatTextColor(3);
2272 gStyle->SetStatY(.99);
2273 gStyle->SetPadRightMargin(0.02);
2274
2275 gStyle->SetPadTopMargin(0.02);
2276 TLatex latex;
2277 latex.SetNDC();
2278 latex.SetTextSize(0.08);
2279 latex.SetTextFont(42);
2280 latex.SetTextAlign(1);
2281
2282 char name[100];
2283 TCanvas* c1 = new TCanvas("c1", "c1", 800., 400.);
2284 c1->Divide(5, 1);
2285
2286 TH1F* histx[ringmx][nprojtype];
2287 TH1F* histy[ringmx][nprojtype];
2288
2289 int nloop = (islocal == 1) ? 1 : nprojtype;
2290 for (int jk = 0; jk < nloop; jk++) {
2291 for (int ij = 0; ij < ringmx; ij++) {
2292 sprintf(name, "hoCalibc/hoindringen_%i_%i", ij, jk);
2293
2294 cout << "name " << name << endl;
2295 histy[ij][jk] = (TH1F*)gDirectory->Get(name);
2296 histx[ij][jk] = (TH1F*)histy[ij][jk]->Clone();
2297 histx[ij][jk]->Rebin(4);
2298 histx[ij][jk]->Scale(1. / histx[ij][jk]->Integral());
2299 }
2300 }
2301 for (int jk = 0; jk < nloop; jk++) {
2302 for (int ij = 0; ij < ringmx; ij++) {
2303 c1->cd(ij + 1);
2304 histx[ij][jk]->GetXaxis()->SetTitle((islocal) ? "Noise (GeV)" : "HO signal/noise (GeV)");
2305 histx[ij][jk]->GetXaxis()->SetTitleSize(0.075);
2306 histx[ij][jk]->GetXaxis()->SetTitleOffset(0.65);
2307 histx[ij][jk]->GetXaxis()->CenterTitle();
2308 histx[ij][jk]->GetXaxis()->SetLabelSize(0.065);
2309 histx[ij][jk]->GetXaxis()->SetLabelOffset(-0.001);
2310
2311 histx[ij][jk]->GetYaxis()->SetTitle();
2312 histx[ij][jk]->GetYaxis()->SetTitleSize(0.075);
2313 histx[ij][jk]->GetYaxis()->SetTitleOffset(0.9);
2314 histx[ij][jk]->GetYaxis()->CenterTitle();
2315 histx[ij][jk]->GetYaxis()->SetLabelSize(0.05);
2316 histx[ij][jk]->GetYaxis()->SetLabelOffset(0.01);
2317
2318 histx[ij][jk]->SetLineColor(jk + 1);
2319 if (jk == 0) {
2320 double xmn = histx[ij][jk]->GetXaxis()->GetXmin();
2321 double xmx = histx[ij][jk]->GetXaxis()->GetXmax();
2322 if (ityp == 0) {
2323 histx[ij][jk]->GetXaxis()->SetRangeUser(xmn, 5.);
2324 } else if (ityp == 1) {
2325 histx[ij][jk]->GetXaxis()->SetRangeUser(2, xmx);
2326 } else {
2327 histx[ij][jk]->GetXaxis()->SetRangeUser(xmn, xmx);
2328 }
2329
2330 histx[ij][jk]->Draw();
2331 latex.DrawLatex(0.25, 0.82, Form("Ring %i", ij - 2));
2332 } else {
2333 histx[ij][jk]->Draw("same");
2334 }
2335
2336 }
2337 }
2338 c1->Update();
2339 }
2340
2341
2342
2343 void plot1() {
2344 def_setting();
2345 gStyle->SetOptStat(1100);
2346 gStyle->SetStatTextColor(3);
2347 gStyle->SetStatY(.99);
2348 gStyle->SetPadRightMargin(0.02);
2349
2350 gStyle->SetPadTopMargin(0.05);
2351 TLatex latex;
2352 latex.SetNDC();
2353 latex.SetTextSize(0.08);
2354 latex.SetTextFont(42);
2355 latex.SetTextAlign(1);
2356
2357 char name[100];
2358 TCanvas* c1 = new TCanvas("c1", "c1", 800., 600.);
2359 c1->Divide(2, 2);
2360
2361 TH1F* histx[8];
2362 for (int ij = 0; ij < 8; ij++) {
2363 sprintf(name, "signal_%i", ij);
2364 histx[ij] = new TH1F(name, name, 100, -0.2, 5.8);
2365
2366
2367
2368 switch (ij) {
2369 case 0:
2370 T1->Project(name, "hosig[4]", "isect>0&&(int(isect/100)-50)<-10&&abs(hodx)>1&&abs(hody)>1&&ndof>20");
2371 break;
2372 case 1:
2373 T1->Project(name,
2374 "hosig[4]",
2375 "isect>0&&(int(isect/100)-50)>=-10&&(int(isect/100)-50)<-5&&abs(hodx)>1&&abs(hody)>1&&ndof>20");
2376 break;
2377 case 2:
2378 T1->Project(name,
2379 "hosig[4]",
2380 "isect>0&&(int(isect/100)-50)>=-4&&(int(isect/100)-50)<5&&abs(hodx)>1&&abs(hody)>1&&ndof>20");
2381 break;
2382 case 3:
2383 T1->Project(name,
2384 "hosig[4]",
2385 "isect>0&&(int(isect/100)-50)>=4&&(int(isect/100)-50)<11&&abs(hodx)>1&&abs(hody)>1&&ndof>20");
2386 break;
2387 case 4:
2388 T1->Project(name, "hocro", "isect>0&&(int(isect/100)-50)<-10&&abs(hodx)>1&&abs(hody)>1&&ndof>20");
2389 break;
2390 case 5:
2391 T1->Project(name,
2392 "hocro",
2393 "isect>0&&(int(isect/100)-50)>=-10&&(int(isect/100)-50)<-5&&abs(hodx)>1&&abs(hody)>1&&ndof>20");
2394 break;
2395 case 6:
2396 T1->Project(name,
2397 "hocro",
2398 "isect>0&&(int(isect/100)-50)>=-4&&(int(isect/100)-50)<5&&abs(hodx)>1&&abs(hody)>1&&ndof>20");
2399 break;
2400 case 7:
2401 T1->Project(name,
2402 "hocro",
2403 "isect>0&&(int(isect/100)-50)>=4&&(int(isect/100)-50)<11&&abs(hodx)>1&&abs(hody)>1&&ndof>20");
2404 break;
2405 }
2406 }
2407 for (int ij = 0; ij < 8; ij++) {
2408 c1->cd(ij % 4 + 1);
2409 histx[ij]->GetXaxis()->SetTitle("HO signal/noise (GeV)");
2410 histx[ij]->GetXaxis()->SetTitleSize(0.075);
2411 histx[ij]->GetXaxis()->SetTitleOffset(0.75);
2412 histx[ij]->GetXaxis()->CenterTitle();
2413 histx[ij]->GetXaxis()->SetLabelSize(0.065);
2414 histx[ij]->GetXaxis()->SetLabelOffset(0.001);
2415
2416 histx[ij]->GetYaxis()->SetTitle();
2417 histx[ij]->GetYaxis()->SetTitleSize(0.075);
2418 histx[ij]->GetYaxis()->SetTitleOffset(0.9);
2419 histx[ij]->GetYaxis()->CenterTitle();
2420 histx[ij]->GetYaxis()->SetLabelSize(0.05);
2421 histx[ij]->GetYaxis()->SetLabelOffset(0.01);
2422
2423 if (ij < 4) {
2424 histx[ij]->SetLineColor(3);
2425 histx[ij]->SetMaximum(1.1 * histx[ij + 4]->GetMaximum());
2426 histx[ij]->Draw();
2427 latex.DrawLatex(0.25, 0.82, Form("Ring %i", ij - 2));
2428 } else {
2429 if (ij == 4) {
2430 c1->Update();
2431 gStyle->SetStatTextColor(2);
2432 gStyle->SetStatY(.79);
2433 }
2434 histx[ij]->SetLineColor(2);
2435 histx[ij]->Draw("sames");
2436 }
2437
2438 }
2439 c1->Update();
2440 }
2441
2442
2443
2444 void plot1a() {
2445 def_setting();
2446 gStyle->SetOptStat(1100);
2447 gStyle->SetOptLogy(1);
2448 gStyle->SetStatTextColor(3);
2449 gStyle->SetStatY(.99);
2450 gStyle->SetPadRightMargin(0.02);
2451 TLatex latex;
2452 latex.SetNDC();
2453 latex.SetTextSize(0.08);
2454 latex.SetTextFont(42);
2455 latex.SetTextAlign(1);
2456
2457 char name[100];
2458 TCanvas* c1 = new TCanvas("c1", "c1", 800., 600.);
2459 c1->Divide(2, 2);
2460
2461 TH1F* histx[8];
2462 for (int ij = 0; ij < 8; ij++) {
2463 sprintf(name, "signal_%i", ij);
2464 histx[ij] = new TH1F(name, name, 100, 0.5, 19.5);
2465
2466
2467
2468 switch (ij) {
2469 case 0:
2470 Tcor1->Project(name, "hocellen", "hocomu>0&&(int(hocomu/100)-50)<-10&&int(icapid/10.)==4");
2471 break;
2472 case 1:
2473 Tcor1->Project(
2474 name, "hocellen", "hocomu>0&&(int(hocomu/100)-50)>=-10&&(int(hocomu/100)-50)<-5&&int(icapid/10.)==4");
2475 break;
2476 case 2:
2477 Tcor1->Project(
2478 name, "hocellen", "hocomu>0&&(int(hocomu/100)-50)>=-4&&(int(hocomu/100)-50)<5&&int(icapid/10.)==4");
2479 break;
2480 case 3:
2481 Tcor1->Project(
2482 name, "hocellen", "hocomu>0&&(int(hocomu/100)-50)>=4&&(int(hocomu/100)-50)<11&&int(icapid/10.)==4");
2483 break;
2484 case 4:
2485 Tcor1->Project(name, "hocellen", "hocomu>0&&(int(hocomu/100)-50)<-10&&int(icapid/10.)==0");
2486 break;
2487 case 5:
2488 Tcor1->Project(
2489 name, "hocellen", "hocomu>0&&(int(hocomu/100)-50)>=-10&&(int(hocomu/100)-50)<-5&&int(icapid/10.)==0");
2490 break;
2491 case 6:
2492 Tcor1->Project(
2493 name, "hocellen", "hocomu>0&&(int(hocomu/100)-50)>=-4&&(int(hocomu/100)-50)<5&&int(icapid/10.)==0");
2494 break;
2495 case 7:
2496 Tcor1->Project(
2497 name, "hocellen", "hocomu>0&&(int(hocomu/100)-50)>=4&&(int(hocomu/100)-50)<11&&int(icapid/10.)==0");
2498 break;
2499 }
2500
2501 c1->cd(ij % 4 + 1);
2502 histx[ij]->GetXaxis()->SetTitle("HO signal/noise (GeV)");
2503 histx[ij]->GetXaxis()->SetTitleSize(0.075);
2504 histx[ij]->GetXaxis()->SetTitleOffset(0.75);
2505 histx[ij]->GetXaxis()->CenterTitle();
2506 histx[ij]->GetXaxis()->SetLabelSize(0.065);
2507 histx[ij]->GetXaxis()->SetLabelOffset(0.001);
2508
2509 histx[ij]->GetYaxis()->SetTitle();
2510 histx[ij]->GetYaxis()->SetTitleSize(0.075);
2511 histx[ij]->GetYaxis()->SetTitleOffset(0.9);
2512 histx[ij]->GetYaxis()->CenterTitle();
2513 histx[ij]->GetYaxis()->SetLabelSize(0.055);
2514 histx[ij]->GetYaxis()->SetLabelOffset(0.01);
2515
2516 if (ij < 4) {
2517 histx[ij]->SetLineColor(3);
2518
2519 histx[ij]->Draw();
2520 latex.DrawLatex(0.25, 0.82, Form("Ring %i", ij - 2));
2521
2522 } else {
2523 if (ij == 4) {
2524 c1->Update();
2525 gStyle->SetStatTextColor(2);
2526 gStyle->SetStatY(.79);
2527 }
2528
2529 histx[ij]->SetLineColor(2);
2530 histx[ij]->Draw("sames");
2531 }
2532
2533 }
2534 c1->Update();
2535 }
2536
2537
2538
2539
2540 void plot2(int ith1 = 1, int ith2 = 4, int iproj = 0) {
2541 def_setting();
2542 gStyle->SetOptStat(0);
2543 gStyle->SetPadTopMargin(0.07);
2544 gStyle->SetPadBottomMargin(0.12);
2545 gStyle->SetPadLeftMargin(0.11);
2546 gStyle->SetPadRightMargin(0.14);
2547
2548 TLatex latex;
2549 latex.SetNDC();
2550 latex.SetTextSize(0.06);
2551 latex.SetTextFont(42);
2552 latex.SetTextAlign(1);
2553
2554 char name[100];
2555 TH2F* histx[10];
2556 TH2F* histy[10];
2557 TCanvas* c1 = new TCanvas("c1", "c1", 800., 600.);
2558 c1->Divide(2, 2);
2559 TH2F* histz = (TH2F*)gDirectory->Get("hoCalibc/hbentry_d3");
2560 int nentry = histz->GetBinContent(0, 0);
2561
2562 icnt = 0;
2563 cout << "nentry = " << nentry << endl;
2564 for (int ij = ith1; ij <= ith2; ij++) {
2565
2566
2567 sprintf(name, "hoCalibc/indrecocnt_%i_%i", iproj, ij);
2568 histy[icnt] = (TH2F*)gDirectory->Get(name);
2569 histx[icnt] = (TH2F*)histy[icnt]->Clone();
2570
2571 c1->cd(icnt + 1);
2572 cout << "icnt " << icnt << " " << histx[icnt]->GetTitle() << endl;
2573 histx[icnt]->Scale(1. / nentry);
2574 histx[icnt]->GetXaxis()->SetTitle("i#eta");
2575 histx[icnt]->GetXaxis()->SetTitleSize(0.075);
2576 histx[icnt]->GetXaxis()->SetTitleOffset(0.75);
2577 histx[icnt]->GetXaxis()->CenterTitle();
2578 histx[icnt]->GetXaxis()->SetLabelSize(0.065);
2579 histx[icnt]->GetXaxis()->SetLabelOffset(0.001);
2580
2581 histx[icnt]->GetYaxis()->SetTitle("i#phi");
2582 histx[icnt]->GetYaxis()->SetTitleSize(0.075);
2583 histx[icnt]->GetYaxis()->SetTitleOffset(0.7);
2584 histx[icnt]->GetYaxis()->CenterTitle();
2585 histx[icnt]->GetYaxis()->SetLabelSize(0.065);
2586 histx[icnt]->GetYaxis()->SetLabelOffset(0.01);
2587
2588 histx[icnt]->GetZaxis()->SetLabelSize(0.048);
2589 histx[icnt]->GetZaxis()->SetLabelOffset(0.01);
2590 histx[icnt]->GetZaxis()->SetNdivisions(406);
2591
2592 histx[icnt]->Draw("colz");
2593 latex.DrawLatex(.4, .95, Form("%g <E_{th} < %g", hothreshs[ij], hothreshs[ij + 1]));
2594 icnt++;
2595 }
2596 c1->Update();
2597 }
2598
2599
2600
2601
2602
2603
2604 void plot3(int isel = 0) {
2605 def_setting();
2606 gStyle->SetOptStat(0);
2607 gStyle->SetPadTopMargin(0.05);
2608 gStyle->SetPadBottomMargin(0.1);
2609 gStyle->SetPadLeftMargin(0.08);
2610 gStyle->SetPadRightMargin(0.14);
2611 char name[100];
2612 TH2F* histx[9];
2613 TH2F* histy[9];
2614
2615 TLatex latex;
2616 latex.SetNDC();
2617 latex.SetTextSize(0.08);
2618 latex.SetTextFont(42);
2619 latex.SetTextAlign(1);
2620
2621 sprintf(name, "hoCalibc/totalmuon_%i", isel);
2622 TH2F* totalmuon = (TH2F*)gDirectory->Get(name);
2623
2624 TCanvas* c1 = new TCanvas("c1", "c1", 800., 600.);
2625 c1->Divide(3, 3, 1.e-6, 1.e-6);
2626 for (int ij = 0; ij < 9; ij++) {
2627 sprintf(name, "hoCalibc/totalproj_%i_%i", isel, ij);
2628 histy[ij] = (TH2F*)gDirectory->Get(name);
2629 histx[ij] = (TH2F*)histy[ij]->Clone();
2630
2631 histx[ij]->Divide(totalmuon);
2632
2633 c1->cd(ij + 1);
2634
2635 histx[ij]->GetXaxis()->SetTitleSize(0.075);
2636 histx[ij]->GetXaxis()->SetTitleOffset(0.75);
2637 histx[ij]->GetXaxis()->CenterTitle();
2638 histx[ij]->GetXaxis()->SetLabelSize(0.065);
2639 histx[ij]->GetXaxis()->SetLabelOffset(0.001);
2640
2641
2642 histx[ij]->GetYaxis()->SetTitleSize(0.075);
2643 histx[ij]->GetYaxis()->SetTitleOffset(0.7);
2644 histx[ij]->GetYaxis()->CenterTitle();
2645 histx[ij]->GetYaxis()->SetLabelSize(0.055);
2646 histx[ij]->GetYaxis()->SetLabelOffset(0.01);
2647
2648 histx[ij]->GetZaxis()->SetLabelSize(0.055);
2649 histx[ij]->GetZaxis()->SetLabelOffset(0.01);
2650 histx[ij]->GetZaxis()->SetNdivisions(406);
2651 histx[ij]->Draw("colz");
2652 }
2653 c1->Update();
2654 }
2655
2656
2657 void plot4(int ith1 = 0, int ith2 = 8, int isel1 = 0, int isel2 = 0) {
2658 def_setting();
2659 gStyle->SetOptStat(0);
2660 gStyle->SetPadTopMargin(0.02);
2661 gStyle->SetPadBottomMargin(0.15);
2662 gStyle->SetPadLeftMargin(0.15);
2663 gStyle->SetPadRightMargin(0.02);
2664 char name[100];
2665 TH1F* histx[10][9];
2666 TH1F* histy[10][9];
2667 TH1F* histz[10][9];
2668
2669 TLatex latex;
2670 latex.SetNDC();
2671 latex.SetTextSize(0.055);
2672 latex.SetTextFont(42);
2673 latex.SetTextAlign(3);
2674
2675 int nydiv = (isel2 == isel1) ? 1 : 2;
2676
2677
2678 TCanvas* c1 = new TCanvas("c1", "c1", 800., 600.);
2679 c1->Divide(3, 3, 1.e-6, 1.e-6);
2680
2681 const int nbin = 5;
2682 TString labels[nbin] = {"Ring-2", "Ring-1", "Ring0", "Ring+1", "Ring+2"};
2683
2684 for (int ij = ith1; ij <= ith2; ij++) {
2685 sprintf(name, "hoCalibc/endigisig_%i_%i", isel1, ij);
2686 histz[0][ij] = (TH1F*)gDirectory->Get(name);
2687
2688 sprintf(name, "hoCalibc/endigisig_%i_%i", isel2, ij);
2689 histz[1][ij] = (TH1F*)gDirectory->Get(name);
2690
2691 sprintf(name, "hoCalibc/endigicnt_%i_%i", isel1, ij);
2692 histy[0][ij] = (TH1F*)gDirectory->Get(name);
2693
2694 sprintf(name, "hoCalibc/endigicnt_%i_%i", isel2, ij);
2695 histy[1][ij] = (TH1F*)gDirectory->Get(name);
2696 }
2697
2698 int icol = 0;
2699 for (int jk = 0; jk < nydiv; jk++) {
2700 for (int ij = ith1; ij <= ith2; ij++) {
2701 histx[jk][ij] = (TH1F*)histz[jk][ij]->Clone();
2702 histx[jk][ij]->Divide(histy[jk][ij]);
2703 c1->cd(++icol);
2704 cout << "ij " << icol << " " << ij << " " << jk << " " << histy[jk][ij]->GetTitle() << endl;
2705
2706 histx[jk][ij]->GetXaxis()->SetLabelSize(0.05);
2707 histx[jk][ij]->GetXaxis()->SetLabelOffset(0.001);
2708
2709 histx[jk][ij]->GetYaxis()->SetLabelSize(0.045);
2710 histx[jk][ij]->GetYaxis()->SetLabelOffset(0.01);
2711
2712 histx[jk][ij]->GetXaxis()->SetTitle("Time slice in Five rings");
2713 histx[jk][ij]->GetXaxis()->SetTitleSize(0.055);
2714 histx[jk][ij]->GetXaxis()->SetTitleOffset(1.2);
2715 histx[jk][ij]->GetXaxis()->CenterTitle();
2716 histx[jk][ij]->GetXaxis()->SetLabelSize(0.075);
2717 histx[jk][ij]->GetXaxis()->SetLabelOffset(0.01);
2718
2719 histx[jk][ij]->GetYaxis()->SetTitle("Signal (fC/GeV)");
2720 histx[jk][ij]->GetYaxis()->SetTitleSize(0.055);
2721 histx[jk][ij]->GetYaxis()->SetTitleOffset(1.3);
2722 histx[jk][ij]->GetYaxis()->CenterTitle();
2723 histx[jk][ij]->GetYaxis()->SetLabelSize(0.065);
2724 histx[jk][ij]->GetYaxis()->SetLabelOffset(0.01);
2725
2726 histx[jk][ij]->GetXaxis()->SetNdivisions(406);
2727 histx[jk][ij]->GetYaxis()->SetNdivisions(406);
2728
2729 for (int kl = 0; kl < nbin; kl++) {
2730 histx[jk][ij]->GetXaxis()->SetBinLabel(10 * kl + 6, labels[kl]);
2731 }
2732 histx[jk][ij]->GetXaxis()->LabelsOption("h");
2733 histx[jk][ij]->Draw();
2734
2735 latex.DrawLatex(0.40, 0.93, Form("%g <E_{RECO} <%g GeV", hothreshs[ij], hothreshs[ij + 1]));
2736 }
2737 }
2738 c1->Update();
2739 }
2740
2741
2742
2743 void plot5(int ith1 = 1, int ith2 = 3, int isel1 = 0, int isel2 = 4, double amx = -1.0) {
2744 def_setting();
2745 gStyle->SetOptStat(0);
2746 gStyle->SetPadTopMargin(0.02);
2747 gStyle->SetPadBottomMargin(0.15);
2748 gStyle->SetPadLeftMargin(0.15);
2749 gStyle->SetPadRightMargin(0.14);
2750
2751 char name[100];
2752 TH2F* histx[5][9];
2753 TH2F* histy[5][9];
2754 TH2F* histz[5][9];
2755
2756 const int nbin = 5;
2757 TString labels[nbin] = {"Ring-2", "Ring-1", "Ring0", "Ring+1", "Ring+2"};
2758
2759 int nydiv = (isel1 == isel2) ? 1 : 2;
2760 TCanvas* c1 = new TCanvas("c1", "c1", 800., (nydiv == 1) ? 350 : 600.);
2761 c1->Divide(3, nydiv, 1.e-6, 1.e-6);
2762
2763 for (int ij = ith1; ij <= ith2; ij++) {
2764 sprintf(name, "hoCalibc/rmdigisig_%i_%i", isel1, ij);
2765 histz[0][ij] = (TH2F*)gDirectory->Get(name);
2766
2767 sprintf(name, "hoCalibc/rmdigisig_%i_%i", isel2, ij);
2768 histz[1][ij] = (TH2F*)gDirectory->Get(name);
2769
2770 sprintf(name, "hoCalibc/rmdigicnt_%i_%i", isel1, ij);
2771 histy[0][ij] = (TH2F*)gDirectory->Get(name);
2772
2773 sprintf(name, "hoCalibc/rmdigicnt_%i_%i", isel2, ij);
2774 histy[1][ij] = (TH2F*)gDirectory->Get(name);
2775 }
2776
2777 int icol = 0;
2778 for (int jk = 0; jk < nydiv; jk++) {
2779 for (int ij = ith1; ij <= ith2; ij++) {
2780 histx[jk][ij] = (TH2F*)histz[jk][ij]->Clone();
2781 histx[jk][ij]->Divide(histy[jk][ij]);
2782 c1->cd(++icol);
2783 cout << "ij " << icol << " " << ij << " " << jk << " " << histy[jk][ij]->GetTitle() << endl;
2784
2785 histx[jk][ij]->GetXaxis()->SetTitle("Time slice in Five rings");
2786 histx[jk][ij]->GetXaxis()->SetTitleSize(0.055);
2787 histx[jk][ij]->GetXaxis()->SetTitleOffset(1.2);
2788 histx[jk][ij]->GetXaxis()->CenterTitle();
2789 histx[jk][ij]->GetXaxis()->SetLabelSize(0.065);
2790 histx[jk][ij]->GetXaxis()->SetLabelOffset(0.01);
2791
2792 histx[jk][ij]->GetYaxis()->SetTitle("RM#");
2793 histx[jk][ij]->GetYaxis()->SetTitleSize(0.055);
2794 histx[jk][ij]->GetYaxis()->SetTitleOffset(1.3);
2795 histx[jk][ij]->GetYaxis()->CenterTitle();
2796 histx[jk][ij]->GetYaxis()->SetLabelSize(0.065);
2797 histx[jk][ij]->GetYaxis()->SetLabelOffset(0.01);
2798
2799 histx[jk][ij]->GetZaxis()->SetLabelSize(0.048);
2800 histx[jk][ij]->GetZaxis()->SetLabelOffset(0.01);
2801
2802 histx[jk][ij]->GetXaxis()->SetNdivisions(202);
2803
2804
2805 if (amx > 0)
2806 histx[jk][ij]->SetMaximum(amx);
2807
2808
2809
2810
2811 histx[jk][ij]->GetXaxis()->SetNdivisions(810);
2812 histx[jk][ij]->Draw("colz");
2813 }
2814 }
2815 c1->Update();
2816 }
2817
2818
2819
2820 void plot6(int iring = -2, int irbx = 3) {
2821 def_setting();
2822 gStyle->SetOptStat(0);
2823 gStyle->SetPadTopMargin(0.10);
2824 gStyle->SetPadBottomMargin(0.08);
2825 gStyle->SetPadLeftMargin(0.20);
2826 gStyle->SetPadRightMargin(0.20);
2827 char name[100];
2828 const int shapemx = 10;
2829 TH2F* histx[shapemx];
2830
2831
2832
2833 const char* shape_name[shapemx] = {
2834 "T3/T4", "T4/Sum45", "T45/Sum4-7", "T4-7/All", "T0-3/T4-7", "T0-3/All", "T0-3/T4-7", "T67/T45", "xx", "xx"};
2835
2836 TCanvas* c1 = new TCanvas("c1", "c1", 800., 500.);
2837 c1->Divide(4, 2, 1.e-6, 1.e-6);
2838
2839 for (int ij = 0; ij < shapemx - 2; ij++) {
2840 c1->cd(ij + 1);
2841 sprintf(name, "hoCalibc/rbx_shape_%i_r%i_%i", ij, iring + 2, irbx);
2842 histx[ij] = (TH2F*)gDirectory->Get(name);
2843 cout << "ij " << ij << " " << histx[ij]->GetTitle() << endl;
2844
2845 if (ij == 0 || ij == 5) {
2846
2847 } else {
2848
2849 }
2850 histx[ij]->GetXaxis()->SetTitleSize(0.065);
2851 histx[ij]->GetXaxis()->SetTitleOffset(0.65);
2852 histx[ij]->GetXaxis()->CenterTitle();
2853 histx[ij]->GetXaxis()->SetLabelSize(0.065);
2854 histx[ij]->GetXaxis()->SetLabelOffset(-0.01);
2855
2856 histx[ij]->GetYaxis()->SetTitle(shape_name[ij]);
2857 histx[ij]->GetYaxis()->SetTitleSize(0.065);
2858 histx[ij]->GetYaxis()->SetTitleOffset(1.3);
2859 histx[ij]->GetYaxis()->CenterTitle();
2860 histx[ij]->GetYaxis()->SetLabelSize(0.065);
2861 histx[ij]->GetYaxis()->SetLabelOffset(0.01);
2862
2863 histx[ij]->GetZaxis()->SetLabelSize(0.07);
2864 histx[ij]->GetZaxis()->SetLabelOffset(0.01);
2865
2866 histx[ij]->GetXaxis()->SetNdivisions(406);
2867 histx[ij]->GetYaxis()->SetNdivisions(406);
2868 histx[ij]->GetZaxis()->SetNdivisions(406);
2869
2870 histx[ij]->Draw("colz");
2871 }
2872 c1->Update();
2873 }
2874
2875
2876
2877 void plot7(int ith = 2, int irbx = 0) {
2878 def_setting();
2879
2880 TLatex latex;
2881 latex.SetNDC();
2882 latex.SetTextSize(0.08);
2883 latex.SetTextFont(42);
2884 latex.SetTextAlign(1);
2885
2886 const int nringmx = 5;
2887 gStyle->SetOptLogy(1);
2888 gStyle->SetOptStat(0);
2889 gStyle->SetPadTopMargin(0.02);
2890 gStyle->SetPadBottomMargin(0.13);
2891 gStyle->SetPadLeftMargin(0.14);
2892 gStyle->SetPadRightMargin(0.02);
2893 char name[100];
2894 TCanvas* c1 = new TCanvas("c1", "c1", 800., 500.);
2895 c1->Divide(5, 2, 1.e-6, 1.e-6);
2896
2897 TH1F* histx[2][nringmx];
2898
2899 int icol = 0;
2900
2901 for (int ij = 0; ij < 2; ij++) {
2902 for (int jk = 0; jk < nringmx; jk++) {
2903 if (ij == 0) {
2904 sprintf(name, "hoCalibc/rbx_mult_%i_r%i_%i", ith, jk, irbx);
2905 } else {
2906 sprintf(name, "hoCalibc/rout_mult_%i_r%i_%i", ith, jk, irbx);
2907 }
2908
2909 histx[ij][jk] = (TH1F*)gDirectory->Get(name);
2910 cout << "name " << name << endl;
2911 c1->cd(++icol);
2912
2913 if (ij == 0) {
2914 histx[ij][jk]->GetXaxis()->SetTitle("# in RBX");
2915 } else {
2916 histx[ij][jk]->GetXaxis()->SetTitle("# in RM");
2917 }
2918 histx[ij][jk]->GetXaxis()->SetTitleSize(0.085);
2919 histx[ij][jk]->GetXaxis()->SetTitleOffset(0.7);
2920 histx[ij][jk]->GetXaxis()->CenterTitle();
2921 histx[ij][jk]->GetXaxis()->SetLabelSize(0.085);
2922 histx[ij][jk]->GetXaxis()->SetLabelOffset(-0.01);
2923
2924 histx[ij][jk]->GetYaxis()->SetTitle();
2925 histx[ij][jk]->GetYaxis()->SetTitleSize(0.075);
2926 histx[ij][jk]->GetYaxis()->SetTitleOffset(1.3);
2927 histx[ij][jk]->GetYaxis()->CenterTitle();
2928 histx[ij][jk]->GetYaxis()->SetLabelSize(0.085);
2929 histx[ij][jk]->GetYaxis()->SetLabelOffset(0.01);
2930
2931 histx[ij][jk]->GetXaxis()->SetNdivisions(404);
2932 histx[ij][jk]->GetYaxis()->SetNdivisions(404);
2933
2934 histx[ij][jk]->Draw();
2935 cout << "ijjk " << ij << " " << jk << " " << histx[ij][jk]->GetTitle() << endl;
2936 latex.DrawLatex(0.35, 0.8, Form("Ring %i", jk - 2));
2937 }
2938 }
2939 c1->Update();
2940 }
2941
2942 void plot7a(int irng = -1, int ith = 2, int isrm = 0) {
2943 def_setting();
2944
2945 TLatex latex;
2946 latex.SetNDC();
2947 latex.SetTextSize(0.08);
2948 latex.SetTextFont(42);
2949 latex.SetTextAlign(1);
2950
2951 const int nringmx = 5;
2952 gStyle->SetOptLogy(1);
2953 gStyle->SetOptStat(0);
2954 gStyle->SetPadTopMargin(0.02);
2955 gStyle->SetPadBottomMargin(0.13);
2956 gStyle->SetPadLeftMargin(0.14);
2957 gStyle->SetPadRightMargin(0.02);
2958 char name[100];
2959 TCanvas* c1 = new TCanvas("c1", "c1", 800., 500.);
2960 if (irng < 0) {
2961 c1->Divide(5, 2, 1.e-6, 1.e-6);
2962 } else if (isrm) {
2963 if (irng == 2) {
2964 c1->Divide(6, 6, 1.e-6, 1.e-6);
2965 } else {
2966 c1->Divide(6, 4, 1.e-6, 1.e-6);
2967 }
2968 } else {
2969 if (irng == 2) {
2970 c1->Divide(4, 3, 1.e-6, 1.e-6);
2971 } else {
2972 c1->Divide(3, 2, 1.e-6, 1.e-6);
2973 }
2974 }
2975 TH1F* histx[routmx + 1][routmx + 1];
2976
2977 int icol = 0;
2978
2979 int nloop1 = 2;
2980 int nloop2 = nringmx;
2981 if (irng >= 0) {
2982 nloop1 = 1;
2983 if (isrm) {
2984 nloop2 = (irng == 2) ? 36 : 24;
2985 } else {
2986 nloop2 = (irng == 2) ? 12 : 6;
2987 }
2988 }
2989
2990 for (int ij = 0; ij < nloop1; ij++) {
2991 for (int jk = 0; jk < nloop2; jk++) {
2992
2993 if (irng < 0) {
2994 if (ij == 0) {
2995 sprintf(name, "hoCalibc/rbx_mult_%i_r%i_0", ith, jk);
2996 } else {
2997 sprintf(name, "hoCalibc/rout_mult_%i_r%i_0", ith, jk);
2998 }
2999 } else if (isrm) {
3000 sprintf(name, "hoCalibc/rout_mult_%i_r%i_%i", ith, irng, jk);
3001 } else {
3002 sprintf(name, "hoCalibc/rbx_mult_%i_r%i_%i", ith, irng, jk);
3003 }
3004
3005 histx[ij][jk] = (TH1F*)gDirectory->Get(name);
3006 cout << "name " << name << endl;
3007 c1->cd(++icol);
3008 if (irng < 0) {
3009 if (ij == 0) {
3010 histx[ij][jk]->GetXaxis()->SetTitle("# in RBX");
3011 } else {
3012 histx[ij][jk]->GetXaxis()->SetTitle("# in RM");
3013 }
3014 } else if (isrm) {
3015 histx[ij][jk]->GetXaxis()->SetTitle("# in RM");
3016 } else {
3017 histx[ij][jk]->GetXaxis()->SetTitle("# in RBX");
3018 }
3019
3020 histx[ij][jk]->GetXaxis()->SetTitleSize(0.085);
3021 histx[ij][jk]->GetXaxis()->SetTitleOffset(0.7);
3022 histx[ij][jk]->GetXaxis()->CenterTitle();
3023 histx[ij][jk]->GetXaxis()->SetLabelSize(0.085);
3024 histx[ij][jk]->GetXaxis()->SetLabelOffset(-0.01);
3025
3026 histx[ij][jk]->GetYaxis()->SetTitle();
3027 histx[ij][jk]->GetYaxis()->SetTitleSize(0.075);
3028 histx[ij][jk]->GetYaxis()->SetTitleOffset(1.3);
3029 histx[ij][jk]->GetYaxis()->CenterTitle();
3030 histx[ij][jk]->GetYaxis()->SetLabelSize(0.085);
3031 histx[ij][jk]->GetYaxis()->SetLabelOffset(0.01);
3032
3033 histx[ij][jk]->GetXaxis()->SetNdivisions(404);
3034 histx[ij][jk]->GetYaxis()->SetNdivisions(404);
3035
3036 histx[ij][jk]->Draw();
3037 cout << "ijjk " << ij << " " << jk << " " << histx[ij][jk]->GetTitle() << endl;
3038 if (irng < 0) {
3039 latex.DrawLatex(0.35, 0.8, Form("Ring %i E>%g", jk - 2, hothreshs[ith]));
3040 } else if (isrm) {
3041 latex.DrawLatex(0.35, 0.8, Form("Ring %i RM%i E>%g", irng, jk, hothreshs[ith]));
3042 } else {
3043 latex.DrawLatex(0.35, 0.8, Form("Ring %i RBX%i E>%g", irng, jk, hothreshs[ith]));
3044 }
3045 }
3046 }
3047 c1->Update();
3048 }
3049
3050 void plot7b(int irng = -1, int th1 = 2, int th2 = 5, int isrm = 0) {
3051 def_setting();
3052
3053 TLatex latex;
3054 latex.SetNDC();
3055 latex.SetTextSize(0.065);
3056 latex.SetTextFont(42);
3057 latex.SetTextAlign(1);
3058
3059 TLegend* tleg = new TLegend(.75, 0.35, 0.95, 0.9, "", "brNDC");
3060 tleg->SetFillColor(10);
3061 tleg->SetBorderSize(0);
3062 tleg->SetTextFont(42);
3063 tleg->SetTextSize(0.07);
3064
3065 const int nringmx = 5;
3066 gStyle->SetOptLogy(1);
3067 gStyle->SetOptStat(0);
3068 gStyle->SetPadTopMargin(0.02);
3069 gStyle->SetPadBottomMargin(0.13);
3070 gStyle->SetPadLeftMargin(0.14);
3071 gStyle->SetPadRightMargin(0.02);
3072 char name[100];
3073 TCanvas* c1 = new TCanvas("c1", "c1", 800., 500.);
3074 if (irng < 0) {
3075 c1->Divide(5, 2, 1.e-6, 1.e-6);
3076 } else if (isrm) {
3077 if (irng == 2) {
3078 c1->Divide(6, 6, 1.e-6, 1.e-6);
3079 } else {
3080 c1->Divide(6, 4, 1.e-6, 1.e-6);
3081 }
3082 } else {
3083 if (irng == 2) {
3084 c1->Divide(4, 3, 1.e-6, 1.e-6);
3085 } else {
3086 c1->Divide(3, 2, 1.e-6, 1.e-6);
3087 }
3088 }
3089 TH1F* histx[routmx + 1][routmx + 1][nhothresh];
3090
3091 int icol = 0;
3092
3093 int nloop1 = 2;
3094 int nloop2 = nringmx;
3095 if (irng >= 0) {
3096 nloop1 = 1;
3097 if (isrm) {
3098 nloop2 = (irng == 2) ? 36 : 24;
3099 } else {
3100 nloop2 = (irng == 2) ? 12 : 6;
3101 }
3102 }
3103
3104 for (int ij = 0; ij < nloop1; ij++) {
3105 for (int jk = 0; jk < nloop2; jk++) {
3106 for (int kl = th1; kl <= th2; kl++) {
3107 if (irng < 0) {
3108 if (ij == 0) {
3109 sprintf(name, "hoCalibc/rbx_mult_%i_r%i_0", kl, jk);
3110 } else {
3111 sprintf(name, "hoCalibc/rout_mult_%i_r%i_0", kl, jk);
3112 }
3113 } else if (isrm) {
3114 sprintf(name, "hoCalibc/rout_mult_%i_r%i_%i", kl, irng, jk + 1);
3115 } else {
3116 sprintf(name, "hoCalibc/rbx_mult_%i_r%i_%i", kl, irng, jk + 1);
3117 }
3118
3119 histx[ij][jk][kl] = (TH1F*)gDirectory->Get(name);
3120 cout << "name " << name << endl;
3121 if (kl == th1)
3122 c1->cd(++icol);
3123 if (irng < 0) {
3124 if (ij == 0) {
3125 histx[ij][jk][kl]->GetXaxis()->SetTitle("# in RBX");
3126 } else {
3127 histx[ij][jk][kl]->GetXaxis()->SetTitle("# in RM");
3128 }
3129 } else if (isrm) {
3130 histx[ij][jk][kl]->GetXaxis()->SetTitle("# in RM");
3131 } else {
3132 histx[ij][jk][kl]->GetXaxis()->SetTitle("# in RBX");
3133 }
3134
3135 histx[ij][jk][kl]->GetXaxis()->SetTitleSize(0.065);
3136 histx[ij][jk][kl]->GetXaxis()->SetTitleOffset(0.75);
3137 histx[ij][jk][kl]->GetXaxis()->CenterTitle();
3138 histx[ij][jk][kl]->GetXaxis()->SetLabelSize(0.075);
3139 histx[ij][jk][kl]->GetXaxis()->SetLabelOffset(-0.01);
3140
3141 histx[ij][jk][kl]->GetYaxis()->SetTitle();
3142 histx[ij][jk][kl]->GetYaxis()->SetTitleSize(0.065);
3143 histx[ij][jk][kl]->GetYaxis()->SetTitleOffset(1.3);
3144 histx[ij][jk][kl]->GetYaxis()->CenterTitle();
3145 histx[ij][jk][kl]->GetYaxis()->SetLabelSize(0.075);
3146 histx[ij][jk][kl]->GetYaxis()->SetLabelOffset(0.01);
3147
3148 histx[ij][jk][kl]->GetXaxis()->SetNdivisions(404);
3149 histx[ij][jk][kl]->GetYaxis()->SetNdivisions(404);
3150
3151 histx[ij][jk][kl]->SetLineColor(kl - th1 + 1);
3152 histx[ij][jk][kl]->Draw((kl == th1) ? "" : "same");
3153 cout << "ijjk " << ij << " " << jk << " " << kl - th1 + 1 << " " << histx[ij][jk][kl]->GetTitle() << endl;
3154 if (kl == th1) {
3155 if (irng < 0) {
3156 latex.DrawLatex(0.35, 0.85, Form("R%i", jk - 2));
3157 } else if (isrm) {
3158 latex.DrawLatex(0.35, 0.85, Form("R%i RM%i", irng - 2, jk));
3159 } else {
3160 latex.DrawLatex(0.35, 0.85, Form("R%i RBX%i", irng - 2, jk));
3161 }
3162 }
3163 if (ij == 0 && jk == 0) {
3164 tleg->AddEntry(histx[ij][jk][kl], Form("th>%g", hothreshs[kl]), "lpfe");
3165 }
3166 }
3167 }
3168 }
3169 tleg->Draw();
3170 c1->Update();
3171 }
3172
3173
3174
3175
3176 void plot8(int ith1 = 1, int ith2 = 8, int ityp = 1) {
3177 def_setting();
3178
3179 gStyle->SetPadGridX(0);
3180 gStyle->SetPadGridY(0);
3181
3182 TLatex latex;
3183 latex.SetNDC();
3184 latex.SetTextSize(0.06);
3185 latex.SetTextFont(42);
3186 latex.SetTextAlign(1);
3187
3188 const int nringmx = 5;
3189 gStyle->SetOptStat(0);
3190 gStyle->SetPadTopMargin(0.06);
3191 gStyle->SetPadBottomMargin(0.16);
3192 gStyle->SetPadLeftMargin(0.16);
3193 gStyle->SetPadRightMargin(0.16);
3194
3195 char name[100];
3196 TCanvas* c1 = new TCanvas("c1", "c1", 800., 500.);
3197 c1->Divide(4, 2, 1.e-6, 1.e-6);
3198
3199 int nentry = ((TH1F*)gDirectory->Get("hoCalibc/hbentry_d3"))->GetBinContent(0, 0);
3200 TH2F* histx[11];
3201 TH2F* histy[11];
3202
3203 int icol = 0;
3204 for (int ij = ith1; ij <= ith2; ij++) {
3205
3206 if (ityp == 0) {
3207 sprintf(name, "hoCalibc/hormoccu_%i", ij);
3208 } else {
3209 sprintf(name, "hoCalibc/hocorrelht_%i", ij);
3210 }
3211 cout << "nentry " << nentry << endl;
3212 histy[ij] = (TH2F*)gDirectory->Get(name);
3213 histx[ij] = (TH2F*)histy[ij]->Clone();
3214 histx[ij]->Scale(1. / nentry);
3215 histx[ij]->GetXaxis()->SetTitle((ityp == 0) ? "iRing" : "i#eta");
3216 histx[ij]->GetXaxis()->SetTitleSize(0.075);
3217 histx[ij]->GetXaxis()->SetTitleOffset(0.85);
3218 histx[ij]->GetXaxis()->CenterTitle();
3219 histx[ij]->GetXaxis()->SetLabelSize(0.075);
3220 histx[ij]->GetXaxis()->SetLabelOffset(0.01);
3221
3222 histx[ij]->GetYaxis()->SetTitle((ityp == 0) ? "RM" : "i#phi");
3223 histx[ij]->GetYaxis()->SetTitleSize(0.065);
3224 histx[ij]->GetYaxis()->SetTitleOffset(1.1);
3225 histx[ij]->GetYaxis()->CenterTitle();
3226 histx[ij]->GetYaxis()->SetLabelSize(0.065);
3227 histx[ij]->GetYaxis()->SetLabelOffset(0.01);
3228
3229 histx[ij]->GetZaxis()->SetLabelSize(0.055);
3230 histx[ij]->GetZaxis()->SetLabelOffset(0.01);
3231
3232 histx[ij]->GetXaxis()->SetNdivisions(202);
3233 histx[ij]->GetYaxis()->SetNdivisions(202);
3234 histx[ij]->GetZaxis()->SetNdivisions(202);
3235
3236 c1->cd(++icol);
3237 histx[ij]->Draw("colz");
3238 latex.DrawLatex(0.58, 0.85, Form("E_{th}=%g GeV", hothreshs[ij]));
3239 }
3240 c1->Update();
3241 }
3242
3243
3244
3245
3246 void plot9(int ith = 2, int ityp = 0) {
3247 def_setting();
3248
3249 TLatex latex;
3250 latex.SetNDC();
3251 latex.SetTextSize(0.075);
3252 latex.SetTextFont(42);
3253 latex.SetTextAlign(1);
3254
3255 const int nringmx = 5;
3256 gStyle->SetOptStat(0);
3257 gStyle->SetPadTopMargin(0.07);
3258 gStyle->SetPadBottomMargin(0.13);
3259 gStyle->SetPadLeftMargin(0.20);
3260 gStyle->SetPadRightMargin(0.17);
3261 char name[100];
3262 TCanvas* c1 = new TCanvas("c1", "c1", 800., 500.);
3263 c1->Divide(3, 2, 1.e-6, 1.e-6);
3264
3265 int nentry = ((TH2F*)gDirectory->Get("hoCalibc/hbentry_d3"))->GetBinContent(0, 0);
3266 TH2F* histx[6];
3267 TH2F* histy[6];
3268
3269 sprintf(name, "hoCalibc/hormcorrel_%i", ith);
3270
3271 histy[0] = (TH2F*)gDirectory->Get(name);
3272 for (int jk = 0; jk < nringmx; jk++) {
3273 if (ityp == 0) {
3274 sprintf(name, "hoCalibc/hocorrelsig_%i_%i", jk, ith);
3275 } else {
3276 sprintf(name, "hoCalibc/hocorrel2sig_%i_%i", jk, ith);
3277 }
3278 histy[1 + jk] = (TH2F*)gDirectory->Get(name);
3279 }
3280
3281 for (int ij = 0; ij < 6; ij++) {
3282 histx[ij] = (TH2F*)histy[ij]->Clone();
3283 histx[ij]->Scale(1. / nentry);
3284
3285 if (ij == 0) {
3286 histx[ij]->GetXaxis()->SetTitle("# of RM in Rings");
3287 histx[ij]->GetYaxis()->SetTitle("# of RM in Rings");
3288 } else {
3289 if (ityp == 0) {
3290 histx[ij]->GetXaxis()->SetTitle("72 #times i#eta + i#phi");
3291 histx[ij]->GetYaxis()->SetTitle("72 #times i#eta + i#phi");
3292 } else {
3293 sprintf(name, "%i #times i#phi + i#eta", (ij == 1 || ij == 5) ? 5 : ((ij == 3) ? 8 : 6));
3294 histx[ij]->GetXaxis()->SetTitle(name);
3295 histx[ij]->GetYaxis()->SetTitle(name);
3296 }
3297 }
3298
3299 histx[ij]->GetXaxis()->SetTitleSize(0.065);
3300 histx[ij]->GetXaxis()->SetTitleOffset(0.90);
3301 histx[ij]->GetXaxis()->CenterTitle();
3302 histx[ij]->GetXaxis()->SetLabelSize(0.065);
3303 histx[ij]->GetXaxis()->SetLabelOffset(0.001);
3304
3305 histx[ij]->GetYaxis()->SetTitleSize(0.065);
3306 histx[ij]->GetYaxis()->SetTitleOffset(1.3);
3307 histx[ij]->GetYaxis()->CenterTitle();
3308 histx[ij]->GetYaxis()->SetLabelSize(0.065);
3309 histx[ij]->GetYaxis()->SetLabelOffset(0.01);
3310
3311 histx[ij]->GetZaxis()->SetLabelSize(0.055);
3312 histx[ij]->GetZaxis()->SetLabelOffset(0.01);
3313
3314 histx[ij]->GetXaxis()->SetNdivisions(404);
3315 histx[ij]->GetYaxis()->SetNdivisions(404);
3316 histx[ij]->GetZaxis()->SetNdivisions(406);
3317
3318 c1->cd(ij + 1);
3319 histx[ij]->Draw("colz");
3320 if (ij == 0)
3321 latex.DrawLatex(0.24, 0.85, Form("E_{th}=%g GeV", hothreshs[ith]));
3322 cout << "ij " << ij << " " << histx[ij]->GetTitle() << endl;
3323 }
3324 c1->Update();
3325 }
3326
3327
3328
3329 void plot10(int ith1 = 2, int ith2 = 3) {
3330 def_setting();
3331 TLatex latex;
3332 latex.SetNDC();
3333 latex.SetTextSize(0.05);
3334 latex.SetTextFont(42);
3335 latex.SetTextAlign(1);
3336 const int nringmx = 5;
3337 gStyle->SetOptStat(0);
3338 gStyle->SetPadTopMargin(0.06);
3339 gStyle->SetPadBottomMargin(0.10);
3340 gStyle->SetPadLeftMargin(0.16);
3341 gStyle->SetPadRightMargin(0.16);
3342 char name[100];
3343 TCanvas* c1 = new TCanvas("c1", "c1", 800., 500.);
3344 c1->Divide(2, 1, 1.e-6, 1.e-6);
3345 int nentry = ((TH2F*)gDirectory->Get("hoCalibc/hbentry_d3"))->GetBinContent(0, 0);
3346 TH2F* histx[2];
3347 TH2F* histy[2];
3348
3349 sprintf(name, "hoCalibc/hoallcorrelsig_%i", ith1);
3350 histy[0] = (TH2F*)gDirectory->Get(name);
3351
3352 sprintf(name, "hoCalibc/hoallcorrelsig_%i", ith2);
3353 histy[1] = (TH2F*)gDirectory->Get(name);
3354
3355 for (int ij = 0; ij < 2; ij++) {
3356 histx[ij] = (TH2F*)histy[ij]->Clone();
3357 histx[ij]->Scale(1. / nentry);
3358
3359 histx[ij]->GetXaxis()->SetTitle("72 #times i#eta+i#phi");
3360 histx[ij]->GetYaxis()->SetTitle("72 #times i#eta+i#phi");
3361
3362 histx[ij]->GetXaxis()->SetTitleSize(0.045);
3363 histx[ij]->GetXaxis()->SetTitleOffset(0.90);
3364 histx[ij]->GetXaxis()->CenterTitle();
3365 histx[ij]->GetXaxis()->SetLabelSize(0.045);
3366 histx[ij]->GetXaxis()->SetLabelOffset(0.001);
3367
3368 histx[ij]->GetYaxis()->SetTitleSize(0.045);
3369 histx[ij]->GetYaxis()->SetTitleOffset(1.65);
3370 histx[ij]->GetYaxis()->CenterTitle();
3371 histx[ij]->GetYaxis()->SetLabelSize(0.045);
3372 histx[ij]->GetYaxis()->SetLabelOffset(0.01);
3373
3374 histx[ij]->GetZaxis()->SetLabelSize(0.045);
3375 histx[ij]->GetZaxis()->SetLabelOffset(0.01);
3376
3377 histx[ij]->GetXaxis()->SetNdivisions(406);
3378 histx[ij]->GetYaxis()->SetNdivisions(406);
3379 histx[ij]->GetZaxis()->SetNdivisions(406);
3380 if (ij == 0)
3381 histx[ij]->SetMaximum(0.000001);
3382
3383 c1->cd(ij + 1);
3384 histx[ij]->Draw("colz");
3385 latex.DrawLatex(0.28, 0.85, Form("E_{th}=%g GeV", hothreshs[(ij == 0) ? ith1 : ith2]));
3386
3387 cout << "ij " << histx[ij]->GetTitle() << endl;
3388 }
3389 c1->Update();
3390 }
3391
3392
3393
3394 void plot11(int ith1 = 2, int ith2 = 3) {
3395 def_setting();
3396
3397 TLatex latex;
3398 latex.SetNDC();
3399 latex.SetTextSize(0.05);
3400 latex.SetTextFont(42);
3401 latex.SetTextAlign(1);
3402 const int nringmx = 5;
3403 gStyle->SetOptStat(0);
3404 gStyle->SetPadTopMargin(0.06);
3405 gStyle->SetPadBottomMargin(0.10);
3406 gStyle->SetPadLeftMargin(0.16);
3407 gStyle->SetPadRightMargin(0.16);
3408
3409 char name[100];
3410 TCanvas* c1 = new TCanvas("c1", "c1", 800., 500.);
3411 c1->Divide(2, 1, 1.e-6, 1.e-6);
3412 int nentry = ((TH2F*)gDirectory->Get("hoCalibc/hbentry_d3"))->GetBinContent(0, 0);
3413 TH2F* histx[2];
3414 TH2F* histy[2];
3415
3416 sprintf(name, "hoCalibc/hoallmucorrel_%i", ith1);
3417 histy[0] = (TH2F*)gDirectory->Get(name);
3418
3419 sprintf(name, "hoCalibc/hoallmucorrel_%i", ith2);
3420 histy[1] = (TH2F*)gDirectory->Get(name);
3421
3422 for (int ij = 0; ij < 2; ij++) {
3423 double total = 0;
3424 histx[ij] = (TH2F*)histy[ij]->Clone();
3425 for (int ix = 1; ix <= histy[ij]->GetNbinsX(); ix++) {
3426 float anent = histy[ij]->GetBinContent(ix, 0);
3427 total += anent;
3428
3429 if (anent < 1.)
3430 anent = 1.;
3431 for (int iy = 1; iy <= histy[ij]->GetNbinsY(); iy++) {
3432 histx[ij]->SetBinContent(ix, iy, histy[ij]->GetBinContent(ix, iy) / anent);
3433 }
3434 }
3435
3436 histx[ij]->GetXaxis()->SetTitle("Projected muon (72 #times i#eta+i#phi)");
3437 histx[ij]->GetYaxis()->SetTitle("Signal in HO tower (72 #times i#eta+i#phi)");
3438
3439 histx[ij]->GetXaxis()->SetTitleSize(0.045);
3440 histx[ij]->GetXaxis()->SetTitleOffset(0.90);
3441 histx[ij]->GetXaxis()->CenterTitle();
3442 histx[ij]->GetXaxis()->SetLabelSize(0.04);
3443 histx[ij]->GetXaxis()->SetLabelOffset(0.001);
3444
3445 histx[ij]->GetYaxis()->SetTitleSize(0.045);
3446 histx[ij]->GetYaxis()->SetTitleOffset(1.65);
3447 histx[ij]->GetYaxis()->CenterTitle();
3448 histx[ij]->GetYaxis()->SetLabelSize(0.04);
3449 histx[ij]->GetYaxis()->SetLabelOffset(0.01);
3450
3451 histx[ij]->GetZaxis()->SetLabelSize(0.04);
3452 histx[ij]->GetZaxis()->SetLabelOffset(0.01);
3453
3454 histx[ij]->GetXaxis()->SetNdivisions(406);
3455 histx[ij]->GetYaxis()->SetNdivisions(406);
3456 histx[ij]->GetZaxis()->SetNdivisions(406);
3457
3458
3459 c1->cd(ij + 1);
3460 histx[ij]->Draw("colz");
3461 latex.DrawLatex(0.28, 0.85, Form("E_{th}=%g GeV", hothreshs[(ij == 0) ? ith1 : ith2]));
3462 cout << "ij " << histx[ij]->GetTitle() << endl;
3463 }
3464 c1->Update();
3465 }
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486 void alllocal(int nfile = 9) {
3487 char pch1[200];
3488 for (int ij = 0; ij < nfile; ij++) {
3489 switch (ij) {
3490 case 0:
3491 _file0->cd();
3492 break;
3493 case 1:
3494 _file1->cd();
3495 break;
3496 case 2:
3497 _file2->cd();
3498 break;
3499 case 3:
3500 _file3->cd();
3501 break;
3502 case 4:
3503 _file4->cd();
3504 break;
3505 case 5:
3506 _file5->cd();
3507 break;
3508 case 6:
3509 _file6->cd();
3510 break;
3511 case 7:
3512 _file7->cd();
3513 break;
3514 case 8:
3515 _file8->cd();
3516 break;
3517 case 9:
3518 _file9->cd();
3519 break;
3520 default:
3521 _file0->cd();
3522 break;
3523 }
3524
3525 cout << "xx1 " << endl;
3526 char* namex = gDirectory->GetName();
3527 int len2 = strlen(namex);
3528 strncpy(pch1, namex + 17, len2 - 22);
3529 pch1[len2 - 22] = '\0';
3530 sprintf(pch1, "%s.ps", pch1);
3531 TPostScript pss(pch1, 112);
3532 pss.Range(28, 20);
3533 cout << "xx2 " << endl;
3534 pss.NewPage();
3535 pss.NewPage();
3536 testxx();
3537 pss.NewPage();
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547 pss.NewPage();
3548 plot000(0, 6, 6, 1);
3549 plot000(1, 6, 6, 1, "same", 1);
3550 plot000(2, 12, 12, 1, "same", 2);
3551 plot000(3, 6, 6, 1, "same", 3);
3552 plot000(4, 6, 6, 1, "sames", 4);
3553
3554 for (int jk = 0; jk < 5; jk++) {
3555 pss.NewPage();
3556 plot000(jk, 0, 0, 1);
3557 for (int kl = 1; kl < 12; kl++) {
3558 if (jk != 2 && kl > 5)
3559 continue;
3560 cout << "jk " << jk << " " << kl << endl;
3561 if ((jk == 2 && kl == 11) || (jk != 2 && kl == 5)) {
3562 plot000(jk, kl, kl, 1, "sames", kl);
3563 } else {
3564 plot000(jk, kl, kl, 1, "same", kl);
3565 }
3566 }
3567 }
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585 pss.NewPage();
3586 plot000r(-1);
3587 pss.NewPage();
3588 plot000r(0);
3589 pss.NewPage();
3590 plot000r(1);
3591 pss.NewPage();
3592 plot000r(2);
3593 pss.NewPage();
3594 plot000r(3);
3595 pss.NewPage();
3596 plot000r(4);
3597
3598
3599
3600
3601
3602 pss.NewPage();
3603 plot01(2, 1);
3604
3605 pss.NewPage();
3606 plot2(0, 4, 0);
3607 pss.NewPage();
3608 plot2(4, 8, 0);
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618 pss.NewPage();
3619 plot6(-2, 0);
3620 pss.NewPage();
3621 plot6(-1, 0);
3622 pss.NewPage();
3623 plot6(0, 0);
3624 pss.NewPage();
3625 plot6(1, 0);
3626 pss.NewPage();
3627 plot6(2, 0);
3628
3629
3630
3631
3632
3633
3634
3635
3636 pss.NewPage();
3637 plot7b(-1, 3);
3638 pss.NewPage();
3639 plot7b(0, 2, 8, 0);
3640 pss.NewPage();
3641 plot7b(1, 2, 8, 0);
3642 pss.NewPage();
3643 plot7b(2, 2, 8, 0);
3644 pss.NewPage();
3645 plot7b(3, 2, 8, 0);
3646 pss.NewPage();
3647 plot7b(4, 2, 8, 0);
3648 pss.NewPage();
3649 plot7b(0, 2, 8, 1);
3650 pss.NewPage();
3651 plot7b(1, 2, 8, 1);
3652 pss.NewPage();
3653 plot7b(2, 2, 8, 1);
3654 pss.NewPage();
3655 plot7b(3, 2, 8, 1);
3656 pss.NewPage();
3657 plot7b(4, 2, 8, 1);
3658
3659 pss.NewPage();
3660 plot8(1, 8, 0);
3661 pss.NewPage();
3662 plot8(1, 8, 1);
3663
3664 pss.NewPage();
3665 plot9(2, 0);
3666 pss.NewPage();
3667 plot9(2, 1);
3668
3669
3670
3671 pss.Close();
3672 }
3673 }
3674
3675
3676
3677
3678
3679
3680
3681
3682 void alllocalx(int nfile = 9) {
3683 char pch1[200];
3684 for (int ij = 0; ij < nfile; ij++) {
3685 switch (ij) {
3686 case 0:
3687 _file0->cd();
3688 break;
3689 case 1:
3690 _file1->cd();
3691 break;
3692 case 2:
3693 _file2->cd();
3694 break;
3695 case 3:
3696 _file3->cd();
3697 break;
3698 case 4:
3699 _file4->cd();
3700 break;
3701 case 5:
3702 _file5->cd();
3703 break;
3704 case 6:
3705 _file6->cd();
3706 break;
3707 case 7:
3708 _file7->cd();
3709 break;
3710 case 8:
3711 _file8->cd();
3712 break;
3713 case 9:
3714 _file9->cd();
3715 break;
3716 case 10:
3717 _file10->cd();
3718 break;
3719 case 11:
3720 _file11->cd();
3721 break;
3722 case 12:
3723 _file12->cd();
3724 break;
3725 case 13:
3726 _file13->cd();
3727 break;
3728 case 14:
3729 _file14->cd();
3730 break;
3731 case 15:
3732 _file15->cd();
3733 break;
3734 case 16:
3735 _file16->cd();
3736 break;
3737 case 17:
3738 _file17->cd();
3739 break;
3740 case 18:
3741 _file18->cd();
3742 break;
3743 case 19:
3744 _file19->cd();
3745 break;
3746 case 20:
3747 _file20->cd();
3748 break;
3749 case 21:
3750 _file21->cd();
3751 break;
3752 case 22:
3753 _file22->cd();
3754 break;
3755 case 23:
3756 _file23->cd();
3757 break;
3758 case 24:
3759 _file24->cd();
3760 break;
3761 case 25:
3762 _file25->cd();
3763 break;
3764 case 26:
3765 _file26->cd();
3766 break;
3767 case 27:
3768 _file27->cd();
3769 break;
3770 case 28:
3771 _file28->cd();
3772 break;
3773 case 29:
3774 _file29->cd();
3775 break;
3776
3777 default:
3778 _file0->cd();
3779 break;
3780 }
3781
3782 char* namex = gDirectory->GetName();
3783 int len2 = strlen(namex);
3784 strncpy(pch1, namex + 17, len2 - 22);
3785 pch1[len2 - 22] = '\0';
3786 sprintf(pch1, "xx_%s.ps", pch1);
3787 TPostScript pss(pch1, 112);
3788 pss.Range(28, 20);
3789
3790 pss.NewPage();
3791 pss.NewPage();
3792 testxx();
3793 pss.NewPage();
3794 testxx();
3795
3796 pss.NewPage();
3797 plot000r(-1, 0, 140);
3798 pss.NewPage();
3799 plot000r(-1, 1, 140);
3800
3801
3802
3803
3804
3805
3806
3807 pss.NewPage();
3808 plot2(0, 4, 0);
3809 pss.NewPage();
3810 plot2(4, 8, 0);
3811
3812
3813
3814
3815
3816
3817
3818 pss.NewPage();
3819 plot01(2, 1);
3820
3821 pss.NewPage();
3822 plot7b(-1, 2, 8);
3823 pss.NewPage();
3824 plot7b(0, 2, 8, 0);
3825 pss.NewPage();
3826 plot7b(1, 2, 8, 0);
3827 pss.NewPage();
3828 plot7b(2, 2, 8, 0);
3829 pss.NewPage();
3830 plot7b(3, 2, 8, 0);
3831 pss.NewPage();
3832 plot7b(4, 2, 8, 0);
3833 pss.NewPage();
3834 plot7b(0, 2, 8, 1);
3835 pss.NewPage();
3836 plot7b(1, 2, 8, 1);
3837 pss.NewPage();
3838 plot7b(2, 2, 8, 1);
3839 pss.NewPage();
3840 plot7b(3, 2, 8, 1);
3841 pss.NewPage();
3842 plot7b(4, 2, 8, 1);
3843
3844 pss.NewPage();
3845 plot8(1, 8, 0);
3846 pss.NewPage();
3847 plot8(1, 8, 1);
3848
3849 pss.NewPage();
3850 plot9(2, 0);
3851
3852
3853
3854
3855 pss.NewPage();
3856 plot4(0, 8, 0, 0);
3857
3858
3859
3860
3861
3862 pss.NewPage();
3863 plot000(0, 6, 6, 1);
3864 plot000(1, 6, 6, 1, "same", 1);
3865 plot000(2, 12, 12, 1, "same", 2);
3866 plot000(3, 6, 6, 1, "same", 3);
3867 plot000(4, 6, 6, 1, "sames", 4);
3868
3869 for (int jk = 0; jk < 5; jk++) {
3870 pss.NewPage();
3871 plot000(jk, 0, 0, 1);
3872 for (int kl = 1; kl < 12; kl++) {
3873 if (jk != 2 && kl > 5)
3874 continue;
3875 cout << "jk " << jk << " " << kl << endl;
3876 if ((jk == 2 && kl == 11) || (jk != 2 && kl == 5)) {
3877 plot000(jk, kl, kl, 1, "sames", kl);
3878 } else {
3879 plot000(jk, kl, kl, 1, "same", kl);
3880 }
3881 }
3882 }
3883
3884 pss.NewPage();
3885 plot6(-2, 0);
3886 pss.NewPage();
3887 plot6(-1, 0);
3888 pss.NewPage();
3889 plot6(0, 0);
3890 pss.NewPage();
3891 plot6(1, 0);
3892 pss.NewPage();
3893 plot6(2, 0);
3894
3895 pss.Close();
3896 }
3897 }
3898
3899
3900
3901 void test1x() {
3902 for (int ij = 1; ij < 14; ij++) {
3903 cout << "INR " << 6200 * ij + 4000 << " (for " << ij << " nights)" << endl;
3904 }
3905 }
3906
3907 void sigpedrun(int nrn = 100) {
3908 TPostScript ps("testxx.ps", 111);
3909 ps.Range(20, 28);
3910 TCanvas* c0x = new TCanvas("c0x", " Pedestal and signal", 900, 1200);
3911 c0x->Divide(5, 4, 1.e-5, 1.e-5, 0);
3912
3913 TH1F* signal_run[5][3000];
3914 char name[100];
3915
3916 for (int ix = 0; ix < nrn; ix++) {
3917 int ixxy = ix % 4;
3918 if (ixxy == 0) {
3919 ps.NewPage();
3920 }
3921 for (int iy = 0; iy < ringmx; iy++) {
3922 sprintf(name, "noise_ring_%i_run%i", iy, ix);
3923 signal_run[iy][ix] = (TH1F*)gDirectory->Get(name);
3924 double mean = signal_run[iy][ix]->GetMean();
3925 double rms = signal_run[iy][ix]->GetRMS();
3926 if (iy == 0)
3927 cout << ix << " " << signal_run[iy][ix]->GetTitle() << " ";
3928
3929 cout << " " << mean;
3930 c0x->cd(ringmx * ixxy + iy + 1);
3931 signal_run[iy][ix]->SetLineColor(3);
3932 signal_run[iy][ix]->GetXaxis()->SetLabelSize(0.095);
3933 signal_run[iy][ix]->GetXaxis()->SetNdivisions(404);
3934 signal_run[iy][ix]->GetYaxis()->SetLabelSize(0.095);
3935 signal_run[iy][ix]->GetXaxis()->SetLabelOffset(-0.02);
3936 signal_run[iy][ix]->Draw();
3937 if (ixxy == 3) {
3938 c0x->Update();
3939 }
3940 }
3941 cout << endl;
3942 }
3943
3944 ps.Close();
3945 }
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005