File indexing completed on 2025-08-06 08:11:56
0001 void EdepPercentE()
0002 {
0003 char infile[100];
0004
0005 int pz[10] = {1,2,4,8,12,16,32,40,50,90};
0006
0007 int h1int[36];
0008
0009
0010
0011
0012
0013
0014 sprintf(infile, "e1out.root");
0015 char hname [100];
0016 sprintf(hname, "e1d");
0017 TH1F *h1 = new TH1F(hname, "e1d", 100, 0, 1);
0018 TFile *f = TFile::Open(infile);
0019 gROOT->cd();
0020 TNtuple *nt = (TNtuple *)f->Get("ed");
0021 nt->Project(hname,"(EA+ES)/(EA+ES+HOA+HOS+HIA+HIS+BH+MAG)");
0022 f->Close();
0023 h1->Draw();
0024 TFile *fout = TFile::Open("epercent.root","UPDATE");
0025 h1->Write();
0026 fout->Write();
0027 cout << h1->Integral() << " " << hname << endl;
0028
0029 fout->Close();
0030
0031 sprintf(infile, "e2out.root");
0032 char hname [100];
0033 sprintf(hname, "e2d");
0034 TH1F *h1 = new TH1F(hname, "e2d", 100, 0, 1);
0035 TFile *f = TFile::Open(infile);
0036 gROOT->cd();
0037 TNtuple *nt = (TNtuple *)f->Get("ed");
0038 nt->Project(hname,"(EA+ES)/(EA+ES+HOA+HOS+HIA+HIS+BH+MAG)");
0039 f->Close();
0040 h1->Draw();
0041 TFile *fout = TFile::Open("epercent.root","UPDATE");
0042 h1->Write();
0043 fout->Write();
0044 cout << h1->Integral() << " " << hname << endl;
0045
0046 fout->Close();
0047
0048 sprintf(infile, "e4out.root");
0049 char hname [100];
0050 sprintf(hname, "e4d");
0051 TH1F *h1 = new TH1F(hname, "e4d", 100, 0, 1);
0052 TFile *f = TFile::Open(infile);
0053 gROOT->cd();
0054 TNtuple *nt = (TNtuple *)f->Get("ed");
0055 nt->Project(hname,"(EA+ES)/(EA+ES+HOA+HOS+HIA+HIS+BH+MAG");
0056 f->Close();
0057 h1->Draw();
0058 TFile *fout = TFile::Open("epercent.root","UPDATE");
0059 h1->Write();
0060 fout->Write();
0061 cout << h1->Integral() << " " << hname << endl;
0062
0063 fout->Close();
0064
0065 sprintf(infile, "e8out.root");
0066 char hname [100];
0067 sprintf(hname, "e8d");
0068 TH1F *h1 = new TH1F(hname, "e8d", 100, 0, 1);
0069 TFile *f = TFile::Open(infile);
0070 gROOT->cd();
0071 TNtuple *nt = (TNtuple *)f->Get("ed");
0072 nt->Project(hname,"(EA+ES)/(EA+ES+HOA+HOS+HIA+HIS+BH+MAG)");
0073 f->Close();
0074 h1->Draw();
0075 TFile *fout = TFile::Open("epercent.root","UPDATE");
0076 h1->Write();
0077 fout->Write();
0078 cout << h1->Integral() << " " << hname << endl;
0079
0080 fout->Close();
0081
0082 sprintf(infile, "e12out.root");
0083 char hname [100];
0084 sprintf(hname, "e12d");
0085 TH1F *h1 = new TH1F(hname, "e12d", 100, 0, 1);
0086 TFile *f = TFile::Open(infile);
0087 gROOT->cd();
0088 TNtuple *nt = (TNtuple *)f->Get("ed");
0089 nt->Project(hname,"(EA+ES)/(EA+ES+HOA+HOS+HIA+HIS+BH+MAG)");
0090 f->Close();
0091 h1->Draw();
0092 TFile *fout = TFile::Open("epercent.root","UPDATE");
0093 h1->Write();
0094 fout->Write();
0095 cout << h1->Integral() << " " << hname << endl;
0096
0097 fout->Close();
0098
0099 sprintf(infile, "e16out.root");
0100 char hname [100];
0101 sprintf(hname, "e16d");
0102 TH1F *h1 = new TH1F(hname, "e16d", 100, 0, 1);
0103 TFile *f = TFile::Open(infile);
0104 gROOT->cd();
0105 TNtuple *nt = (TNtuple *)f->Get("ed");
0106 nt->Project(hname,"(EA+ES)/(EA+ES+HOA+HOS+HIA+HIS+BH+MAG)");
0107 f->Close();
0108 h1->Draw();
0109 TFile *fout = TFile::Open("epercent.root","UPDATE");
0110 h1->Write();
0111 fout->Write();
0112 cout << h1->Integral() << " " << hname << endl;
0113
0114 fout->Close();
0115
0116 sprintf(infile, "e32out.root");
0117 char hname [100];
0118 sprintf(hname, "e32d");
0119 TH1F *h1 = new TH1F(hname, "e32d", 100, 0, 1);
0120 TFile *f = TFile::Open(infile);
0121 gROOT->cd();
0122 TNtuple *nt = (TNtuple *)f->Get("ed");
0123 nt->Project(hname,"(EA+ES)/(EA+ES+HOA+HOS+HIA+HIS+BH+MAG)");
0124 f->Close();
0125 h1->Draw();
0126 TFile *fout = TFile::Open("epercent.root","UPDATE");
0127 h1->Write();
0128 fout->Write();
0129 cout << h1->Integral() << " " << hname << endl;
0130
0131 fout->Close();
0132
0133 sprintf(infile, "e40out.root");
0134 char hname [100];
0135 sprintf(hname, "e40d");
0136 TH1F *h1 = new TH1F(hname, "e40d", 100, 0, 1);
0137 TFile *f = TFile::Open(infile);
0138 gROOT->cd();
0139 TNtuple *nt = (TNtuple *)f->Get("ed");
0140 nt->Project(hname,"(EA+ES)/(EA+ES+HOA+HOS+HIA+HIS+BH+MAG)");
0141 f->Close();
0142 h1->Draw();
0143 TFile *fout = TFile::Open("epercent.root","UPDATE");
0144 h1->Write();
0145 fout->Write();
0146 cout << h1->Integral() << " " << hname << endl;
0147
0148 fout->Close();
0149
0150 sprintf(infile, "e50out.root");
0151 char hname [100];
0152 sprintf(hname, "e50d");
0153 TH1F *h1 = new TH1F(hname, "e50d", 100, 0, 1);
0154 TFile *f = TFile::Open(infile);
0155 gROOT->cd();
0156 TNtuple *nt = (TNtuple *)f->Get("ed");
0157 nt->Project(hname,"(EA+ES)/(EA+ES+HOA+HOS+HIA+HIS+BH+MAG)");
0158 f->Close();
0159 h1->Draw();
0160 TFile *fout = TFile::Open("epercent.root","UPDATE");
0161 h1->Write();
0162 fout->Write();
0163 cout << h1->Integral() << " " << hname << endl;
0164
0165 fout->Close();
0166
0167
0168
0169
0170
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
0199
0200 void EdepPercentAnalyzerE()
0201 {
0202 TFile *fin = TFile::Open("epercent.root");
0203 gROOT->cd();
0204 TH2 *h2 = new TH2F("htot","EMCAL",1,0,50,1,0,1);
0205 gStyle->SetOptStat(0);
0206 TMarker *spf = new TMarker();
0207 spf->SetMarkerStyle(20);
0208 spf->SetMarkerColor(4);
0209 TCanvas *c1 = new TCanvas();
0210 h2->Draw();
0211
0212 char hname[100];
0213 sprintf(hname, "e1d");
0214 TH1 *h1 = (TH1F *) fin->Get(hname);
0215 spf->DrawMarker(1, h1->GetMean(1));
0216
0217 char hname[100];
0218 sprintf(hname, "e2d");
0219 TH1 *h1 = (TH1F *) fin->Get(hname);
0220 spf->DrawMarker(2, h1->GetMean(1));
0221
0222 char hname[100];
0223 sprintf(hname, "e4d");
0224 TH1 *h1 = (TH1F *) fin->Get(hname);
0225
0226 spf->DrawMarker(4, h1->GetMean(1));
0227
0228 char hname[100];
0229 sprintf(hname, "e8d");
0230 TH1 *h1 = (TH1F *) fin->Get(hname);
0231
0232 spf->DrawMarker(8, h1->GetMean(1));
0233
0234 char hname[100];
0235 sprintf(hname, "e12d");
0236 TH1 *h1 = (TH1F *) fin->Get(hname);
0237
0238 spf->DrawMarker(12, h1->GetMean(1));
0239
0240 char hname[100];
0241 sprintf(hname, "e16d");
0242 TH1 *h1 = (TH1F *) fin->Get(hname);
0243
0244 spf->DrawMarker(16, h1->GetMean(1));
0245
0246 char hname[100];
0247 sprintf(hname, "e32d");
0248 TH1 *h1 = (TH1F *) fin->Get(hname);
0249
0250 spf->DrawMarker(32, h1->GetMean(1));
0251
0252 char hname[100];
0253 sprintf(hname, "e40d");
0254 TH1 *h1 = (TH1F *) fin->Get(hname);
0255
0256 spf->DrawMarker(40, h1->GetMean(1));
0257
0258 char hname[100];
0259 sprintf(hname, "e50d");
0260 TH1 *h1 = (TH1F *) fin->Get(hname);
0261
0262 spf->DrawMarker(50, h1->GetMean(1));
0263
0264
0265
0266
0267
0268
0269
0270 fin->Close();
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
0296
0297
0298
0299
0300
0301
0302
0303
0304
0305
0306
0307
0308
0309
0310
0311
0312
0313
0314
0315
0316
0317
0318
0319
0320
0321
0322
0323
0324 }
0325
0326
0327 void EdepPercentIH()
0328 {
0329 char infile[100];
0330
0331 int pz[10] = {1,2,4,8,12,16,32,40,50,90};
0332
0333 int h1int[36];
0334
0335
0336
0337
0338
0339
0340 sprintf(infile, "e1out.root");
0341 char hname [100];
0342 sprintf(hname, "HIe1d");
0343 TH1F *h1 = new TH1F(hname, "HIe1d", 100, 0, 1);
0344 TFile *f = TFile::Open(infile);
0345 gROOT->cd();
0346 TNtuple *nt = (TNtuple *)f->Get("ed");
0347 nt->Project(hname,"(HIA+HIS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0348 f->Close();
0349 h1->Draw();
0350 TFile *fout = TFile::Open("epercent.root","UPDATE");
0351 h1->Write();
0352 fout->Write();
0353 cout << h1->Integral() << " " << hname << endl;
0354
0355 fout->Close();
0356
0357 sprintf(infile, "e2out.root");
0358 char hname [100];
0359 sprintf(hname, "HIe2d");
0360 TH1F *h1 = new TH1F(hname, "HIe2d", 100, 0, 1);
0361 TFile *f = TFile::Open(infile);
0362 gROOT->cd();
0363 TNtuple *nt = (TNtuple *)f->Get("ed");
0364 nt->Project(hname,"(HIA+HIS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0365 f->Close();
0366 h1->Draw();
0367 TFile *fout = TFile::Open("epercent.root","UPDATE");
0368 h1->Write();
0369 fout->Write();
0370 cout << h1->Integral() << " " << hname << endl;
0371
0372 fout->Close();
0373
0374 sprintf(infile, "e4out.root");
0375 char hname [100];
0376 sprintf(hname, "HIe4d");
0377 TH1F *h1 = new TH1F(hname, "HIe4d", 100, 0, 1);
0378 TFile *f = TFile::Open(infile);
0379 gROOT->cd();
0380 TNtuple *nt = (TNtuple *)f->Get("ed");
0381 nt->Project(hname,"(HIA+HIS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0382 f->Close();
0383 h1->Draw();
0384 TFile *fout = TFile::Open("epercent.root","UPDATE");
0385 h1->Write();
0386 fout->Write();
0387 cout << h1->Integral() << " " << hname << endl;
0388
0389 fout->Close();
0390
0391 sprintf(infile, "e8out.root");
0392 char hname [100];
0393 sprintf(hname, "HIe8d");
0394 TH1F *h1 = new TH1F(hname, "HIe8d", 100, 0, 1);
0395 TFile *f = TFile::Open(infile);
0396 gROOT->cd();
0397 TNtuple *nt = (TNtuple *)f->Get("ed");
0398 nt->Project(hname,"(HIA+HIS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0399 f->Close();
0400 h1->Draw();
0401 TFile *fout = TFile::Open("epercent.root","UPDATE");
0402 h1->Write();
0403 fout->Write();
0404 cout << h1->Integral() << " " << hname << endl;
0405
0406 fout->Close();
0407
0408 sprintf(infile, "e12out.root");
0409 char hname [100];
0410 sprintf(hname, "HIe12d");
0411 TH1F *h1 = new TH1F(hname, "HIe12d", 100, 0, 1);
0412 TFile *f = TFile::Open(infile);
0413 gROOT->cd();
0414 TNtuple *nt = (TNtuple *)f->Get("ed");
0415 nt->Project(hname,"(HIA+HIS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0416 f->Close();
0417 h1->Draw();
0418 TFile *fout = TFile::Open("epercent.root","UPDATE");
0419 h1->Write();
0420 fout->Write();
0421 cout << h1->Integral() << " " << hname << endl;
0422
0423 fout->Close();
0424
0425 sprintf(infile, "e16out.root");
0426 char hname [100];
0427 sprintf(hname, "HIe16d");
0428 TH1F *h1 = new TH1F(hname, "HIe16d", 100, 0, 1);
0429 TFile *f = TFile::Open(infile);
0430 gROOT->cd();
0431 TNtuple *nt = (TNtuple *)f->Get("ed");
0432 nt->Project(hname,"(HIA+HIS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0433 f->Close();
0434 h1->Draw();
0435 TFile *fout = TFile::Open("epercent.root","UPDATE");
0436 h1->Write();
0437 fout->Write();
0438 cout << h1->Integral() << " " << hname << endl;
0439
0440 fout->Close();
0441
0442 sprintf(infile, "e32out.root");
0443 char hname [100];
0444 sprintf(hname, "HIe32d");
0445 TH1F *h1 = new TH1F(hname, "HIe32d", 100, 0, 1);
0446 TFile *f = TFile::Open(infile);
0447 gROOT->cd();
0448 TNtuple *nt = (TNtuple *)f->Get("ed");
0449 nt->Project(hname,"(HIA+HIS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0450 f->Close();
0451 h1->Draw();
0452 TFile *fout = TFile::Open("epercent.root","UPDATE");
0453 h1->Write();
0454 fout->Write();
0455 cout << h1->Integral() << " " << hname << endl;
0456
0457 fout->Close();
0458
0459 sprintf(infile, "e40out.root");
0460 char hname [100];
0461 sprintf(hname, "HIe40d");
0462 TH1F *h1 = new TH1F(hname, "HIe40d", 100, 0, 1);
0463 TFile *f = TFile::Open(infile);
0464 gROOT->cd();
0465 TNtuple *nt = (TNtuple *)f->Get("ed");
0466 nt->Project(hname,"(HIA+HIS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0467 f->Close();
0468 h1->Draw();
0469 TFile *fout = TFile::Open("epercent.root","UPDATE");
0470 h1->Write();
0471 fout->Write();
0472 cout << h1->Integral() << " " << hname << endl;
0473
0474 fout->Close();
0475
0476 sprintf(infile, "e50out.root");
0477 char hname [100];
0478 sprintf(hname, "HIe50d");
0479 TH1F *h1 = new TH1F(hname, "HIe50d", 100, 0, 1);
0480 TFile *f = TFile::Open(infile);
0481 gROOT->cd();
0482 TNtuple *nt = (TNtuple *)f->Get("ed");
0483 nt->Project(hname,"(HIA+HIS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0484 f->Close();
0485 h1->Draw();
0486 TFile *fout = TFile::Open("epercent.root","UPDATE");
0487 h1->Write();
0488 fout->Write();
0489 cout << h1->Integral() << " " << hname << endl;
0490
0491 fout->Close();
0492
0493
0494
0495
0496
0497
0498
0499
0500
0501
0502
0503
0504
0505
0506
0507
0508
0509
0510
0511
0512
0513
0514
0515
0516
0517 }
0518
0519
0520
0521
0522
0523
0524
0525
0526 void EdepPercentAnalyzerIH()
0527 {
0528 TFile *fin = TFile::Open("epercent.root");
0529 gROOT->cd();
0530 TH2 *h2 = new TH2F("htot","Inner_HCAL",1,0,50,1,0,.1);
0531 gStyle->SetOptStat(0);
0532 TMarker *spf = new TMarker();
0533 spf->SetMarkerStyle(20);
0534 spf->SetMarkerColor(8);
0535 TLine *rlin = new TLine();
0536 rlin->SetLineColor(8);
0537 rlin->SetLineStyle(1);
0538 rlin->SetLineWidth(1);
0539 TCanvas *c2 = new TCanvas();
0540 h2->Draw();
0541
0542 char hname[100];
0543 sprintf(hname, "HIe1d");
0544 TH1 *h1 = (TH1F *) fin->Get(hname);
0545 spf->DrawMarker(1, h1->GetMean(1));
0546 rlin->DrawLine(1,(h1->GetMean(1)-h1->GetRMS(1)),1,(h1->GetMean(1) + h1->GetRMS(1)));
0547 char hname[100];
0548 sprintf(hname, "HIe2d");
0549 TH1 *h1 = (TH1F *) fin->Get(hname);
0550 spf->DrawMarker(2, h1->GetMean(1));
0551 rlin->DrawLine(2,(h1->GetMean(1)-h1->GetRMS(1)),2,(h1->GetMean(1) + h1->GetRMS(1)));
0552 char hname[100];
0553 sprintf(hname, "HIe4d");
0554 TH1 *h1 = (TH1F *) fin->Get(hname);
0555
0556 spf->DrawMarker(4, h1->GetMean(1));
0557 rlin->DrawLine(4,(h1->GetMean(1)-h1->GetRMS(1)),4,(h1->GetMean(1) + h1->GetRMS(1)));
0558 char hname[100];
0559 sprintf(hname, "HIe8d");
0560 TH1 *h1 = (TH1F *) fin->Get(hname);
0561
0562 spf->DrawMarker(8, h1->GetMean(1));
0563 rlin->DrawLine(8,(h1->GetMean(1)-h1->GetRMS(1)),8,(h1->GetMean(1) + h1->GetRMS(1)));
0564 char hname[100];
0565 sprintf(hname, "HIe12d");
0566 TH1 *h1 = (TH1F *) fin->Get(hname);
0567
0568 spf->DrawMarker(12, h1->GetMean(1));
0569 rlin->DrawLine(12,(h1->GetMean(1)-h1->GetRMS(1)),12,(h1->GetMean(1) + h1->GetRMS(1)));
0570 char hname[100];
0571 sprintf(hname, "HIe16d");
0572 TH1 *h1 = (TH1F *) fin->Get(hname);
0573
0574 spf->DrawMarker(16, h1->GetMean(1));
0575 rlin->DrawLine(16,(h1->GetMean(1)-h1->GetRMS(1)),16,(h1->GetMean(1) + h1->GetRMS(1)));
0576
0577 char hname[100];
0578 sprintf(hname, "HIe32d");
0579 TH1 *h1 = (TH1F *) fin->Get(hname);
0580
0581 spf->DrawMarker(32, h1->GetMean(1));
0582 rlin->DrawLine(32,(h1->GetMean(1)-h1->GetRMS(1)),32,(h1->GetMean(1) + h1->GetRMS(1)));
0583 char hname[100];
0584 sprintf(hname, "HIe40d");
0585 TH1 *h1 = (TH1F *) fin->Get(hname);
0586
0587 spf->DrawMarker(40, h1->GetMean(1));
0588 rlin->DrawLine(40,(h1->GetMean(1)-h1->GetRMS(1)),40,(h1->GetMean(1) + h1->GetRMS(1)));
0589
0590 char hname[100];
0591 sprintf(hname, "HIe50d");
0592 TH1 *h1 = (TH1F *) fin->Get(hname);
0593
0594 spf->DrawMarker(50, h1->GetMean(1));
0595 rlin->DrawLine(50,(h1->GetMean(1)-h1->GetRMS(1)),50,(h1->GetMean(1) + h1->GetRMS(1)));
0596
0597
0598
0599
0600
0601
0602
0603 fin->Close();
0604
0605
0606
0607
0608
0609
0610
0611
0612
0613
0614
0615
0616
0617
0618
0619
0620
0621
0622
0623
0624
0625
0626
0627
0628
0629
0630
0631
0632
0633
0634
0635
0636
0637
0638
0639
0640
0641
0642
0643
0644
0645
0646
0647
0648
0649
0650
0651
0652
0653
0654
0655
0656
0657 }
0658
0659 void EdepPercentOH()
0660 {
0661 char infile[100];
0662
0663 int pz[10] = {1,2,4,8,12,16,32,40,50,90};
0664
0665 int h1int[36];
0666
0667
0668
0669
0670
0671
0672 sprintf(infile, "e1out.root");
0673 char hname [100];
0674 sprintf(hname, "HOe1d");
0675 TH1F *h1 = new TH1F(hname, "HOe1d", 100, 0, 1);
0676 TFile *f = TFile::Open(infile);
0677 gROOT->cd();
0678 TNtuple *nt = (TNtuple *)f->Get("ed");
0679 nt->Project(hname,"(HOA+HOS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0680 f->Close();
0681 h1->Draw();
0682 TFile *fout = TFile::Open("epercent.root","UPDATE");
0683 h1->Write();
0684 fout->Write();
0685 cout << h1->Integral() << " " << hname << endl;
0686
0687 fout->Close();
0688
0689 sprintf(infile, "e2out.root");
0690 char hname [100];
0691 sprintf(hname, "HOe2d");
0692 TH1F *h1 = new TH1F(hname, "HOe2d", 100, 0, 1);
0693 TFile *f = TFile::Open(infile);
0694 gROOT->cd();
0695 TNtuple *nt = (TNtuple *)f->Get("ed");
0696 nt->Project(hname,"(HOA+HOS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0697 f->Close();
0698 h1->Draw();
0699 TFile *fout = TFile::Open("epercent.root","UPDATE");
0700 h1->Write();
0701 fout->Write();
0702 cout << h1->Integral() << " " << hname << endl;
0703
0704 fout->Close();
0705
0706 sprintf(infile, "e4out.root");
0707 char hname [100];
0708 sprintf(hname, "HOe4d");
0709 TH1F *h1 = new TH1F(hname, "HOe4d", 100, 0, 1);
0710 TFile *f = TFile::Open(infile);
0711 gROOT->cd();
0712 TNtuple *nt = (TNtuple *)f->Get("ed");
0713 nt->Project(hname,"(HOA+HOS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0714 f->Close();
0715 h1->Draw();
0716 TFile *fout = TFile::Open("epercent.root","UPDATE");
0717 h1->Write();
0718 fout->Write();
0719 cout << h1->Integral() << " " << hname << endl;
0720
0721 fout->Close();
0722
0723 sprintf(infile, "e8out.root");
0724 char hname [100];
0725 sprintf(hname, "HOe8d");
0726 TH1F *h1 = new TH1F(hname, "HOe8d", 100, 0, 1);
0727 TFile *f = TFile::Open(infile);
0728 gROOT->cd();
0729 TNtuple *nt = (TNtuple *)f->Get("ed");
0730 nt->Project(hname,"(HOA+HOS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0731 f->Close();
0732 h1->Draw();
0733 TFile *fout = TFile::Open("epercent.root","UPDATE");
0734 h1->Write();
0735 fout->Write();
0736 cout << h1->Integral() << " " << hname << endl;
0737
0738 fout->Close();
0739
0740 sprintf(infile, "e12out.root");
0741 char hname [100];
0742 sprintf(hname, "HOe12d");
0743 TH1F *h1 = new TH1F(hname, "HOe12d", 100, 0, 1);
0744 TFile *f = TFile::Open(infile);
0745 gROOT->cd();
0746 TNtuple *nt = (TNtuple *)f->Get("ed");
0747 nt->Project(hname,"(HOA+HOS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0748 f->Close();
0749 h1->Draw();
0750 TFile *fout = TFile::Open("epercent.root","UPDATE");
0751 h1->Write();
0752 fout->Write();
0753 cout << h1->Integral() << " " << hname << endl;
0754
0755 fout->Close();
0756
0757 sprintf(infile, "e16out.root");
0758 char hname [100];
0759 sprintf(hname, "HOe16d");
0760 TH1F *h1 = new TH1F(hname, "HOe16d", 100, 0, 1);
0761 TFile *f = TFile::Open(infile);
0762 gROOT->cd();
0763 TNtuple *nt = (TNtuple *)f->Get("ed");
0764 nt->Project(hname,"(HOA+HOS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0765 f->Close();
0766 h1->Draw();
0767 TFile *fout = TFile::Open("epercent.root","UPDATE");
0768 h1->Write();
0769 fout->Write();
0770 cout << h1->Integral() << " " << hname << endl;
0771
0772 fout->Close();
0773
0774 sprintf(infile, "e32out.root");
0775 char hname [100];
0776 sprintf(hname, "HOe32d");
0777 TH1F *h1 = new TH1F(hname, "HOe32d", 100, 0, 1);
0778 TFile *f = TFile::Open(infile);
0779 gROOT->cd();
0780 TNtuple *nt = (TNtuple *)f->Get("ed");
0781 nt->Project(hname,"(HOA+HOS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0782 f->Close();
0783 h1->Draw();
0784 TFile *fout = TFile::Open("epercent.root","UPDATE");
0785 h1->Write();
0786 fout->Write();
0787 cout << h1->Integral() << " " << hname << endl;
0788
0789 fout->Close();
0790
0791 sprintf(infile, "e40out.root");
0792 char hname [100];
0793 sprintf(hname, "HOe40d");
0794 TH1F *h1 = new TH1F(hname, "HOe40d", 100, 0, 1);
0795 TFile *f = TFile::Open(infile);
0796 gROOT->cd();
0797 TNtuple *nt = (TNtuple *)f->Get("ed");
0798 nt->Project(hname,"(HOA+HOS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0799 f->Close();
0800 h1->Draw();
0801 TFile *fout = TFile::Open("epercent.root","UPDATE");
0802 h1->Write();
0803 fout->Write();
0804 cout << h1->Integral() << " " << hname << endl;
0805
0806 fout->Close();
0807
0808 sprintf(infile, "e50out.root");
0809 char hname [100];
0810 sprintf(hname, "HOe50d");
0811 TH1F *h1 = new TH1F(hname, "HOe50d", 100, 0, 1);
0812 TFile *f = TFile::Open(infile);
0813 gROOT->cd();
0814 TNtuple *nt = (TNtuple *)f->Get("ed");
0815 nt->Project(hname,"(HOA+HOS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0816 f->Close();
0817 h1->Draw();
0818 TFile *fout = TFile::Open("epercent.root","UPDATE");
0819 h1->Write();
0820 fout->Write();
0821 cout << h1->Integral() << " " << hname << endl;
0822
0823 fout->Close();
0824
0825
0826
0827
0828
0829
0830
0831
0832
0833
0834
0835
0836
0837
0838
0839
0840
0841
0842
0843
0844
0845
0846
0847
0848
0849 }
0850
0851
0852
0853
0854
0855 void EdepPercentAnalyzerOH(const char *calo="HOe")
0856 {
0857 TFile *fin = TFile::Open("epercent.root");
0858 gROOT->cd();
0859 TH2 *h2 = new TH2F("htot","Outer_HCAL",1,0,50,1,0,.1);
0860 gStyle->SetOptStat(0);
0861 TMarker *spf = new TMarker();
0862 spf->SetMarkerStyle(20);
0863 spf->SetMarkerColor(11);
0864 TLine *rlin = new TLine();
0865 rlin->SetLineColor(3);
0866 rlin->SetLineStyle(1);
0867 rlin->SetLineWidth(1);
0868 TCanvas *c3 = new TCanvas();
0869 h2->Draw();
0870
0871 char hname[100];
0872 sprintf(hname, "HOe1d");
0873 TH1 *h1 = (TH1F *) fin->Get(hname);
0874 spf->DrawMarker(1, h1->GetMean(1));
0875 rlin->DrawLine(1,(h1->GetMean(1)-h1->GetRMS(1)),1,(h1->GetMean(1) + h1->GetRMS(1)));
0876 double hom1 = h1->GetMean(1);
0877 double hor1 = h1->GetRMS(1);
0878
0879 char hname[100];
0880 sprintf(hname, "HOe2d");
0881 TH1 *h1 = (TH1F *) fin->Get(hname);
0882 spf->DrawMarker(2, h1->GetMean(1));
0883 rlin->DrawLine(2,(h1->GetMean(1)-h1->GetRMS(1)),2,(h1->GetMean(1) + h1->GetRMS(1)));
0884 double hom2 = h1->GetMean(1);
0885 double hor2 = h1->GetRMS(1);
0886
0887 char hname[100];
0888 sprintf(hname, "HOe4d");
0889 TH1 *h1 = (TH1F *) fin->Get(hname);
0890
0891 spf->DrawMarker(4, h1->GetMean(1));
0892 rlin->DrawLine(4,(h1->GetMean(1)-h1->GetRMS(1)),4,(h1->GetMean(1) + h1->GetRMS(1)));
0893 double hom4 = h1->GetMean(1);
0894 double hor4 = h1->GetRMS(1);
0895
0896
0897 char hname[100];
0898 sprintf(hname, "HOe8d");
0899 TH1 *h1 = (TH1F *) fin->Get(hname);
0900
0901 spf->DrawMarker(8, h1->GetMean(1));
0902 rlin->DrawLine(8,(h1->GetMean(1)-h1->GetRMS(1)),8,(h1->GetMean(1) + h1->GetRMS(1)));
0903 double hom8 = h1->GetMean(1);
0904 double hor8 = h1->GetRMS(1);
0905
0906
0907 char hname[100];
0908 sprintf(hname, "HOe12d");
0909 TH1 *h1 = (TH1F *) fin->Get(hname);
0910
0911 spf->DrawMarker(12, h1->GetMean(1));
0912 rlin->DrawLine(12,(h1->GetMean(1)-h1->GetRMS(1)),12,(h1->GetMean(1) + h1->GetRMS(1)));
0913 double hom12 = h1->GetMean(1);
0914 double hor12 = h1->GetRMS(1);
0915
0916
0917 char hname[100];
0918 sprintf(hname, "HOe16d");
0919 TH1 *h1 = (TH1F *) fin->Get(hname);
0920
0921 spf->DrawMarker(16, h1->GetMean(1));
0922 rlin->DrawLine(16,(h1->GetMean(1)-h1->GetRMS(1)),16,(h1->GetMean(1) + h1->GetRMS(1)));
0923 double hom16 = h1->GetMean(1);
0924 double hor16 = h1->GetRMS(1);
0925
0926
0927 char hname[100];
0928 sprintf(hname, "HOe32d");
0929 TH1 *h1 = (TH1F *) fin->Get(hname);
0930
0931 spf->DrawMarker(32, h1->GetMean(1));
0932 rlin->DrawLine(32,(h1->GetMean(1)-h1->GetRMS(1)),32,(h1->GetMean(1) + h1->GetRMS(1)));
0933 double hom32 = h1->GetMean(1);
0934 double hor32 = h1->GetRMS(1);
0935
0936
0937 char hname[100];
0938 sprintf(hname, "HOe40d");
0939 TH1 *h1 = (TH1F *) fin->Get(hname);
0940
0941 spf->DrawMarker(40, h1->GetMean(1));
0942 rlin->DrawLine(40,(h1->GetMean(1)-h1->GetRMS(1)),40,(h1->GetMean(1) + h1->GetRMS(1)));
0943 double hom40 = h1->GetMean(1);
0944 double hor40 = h1->GetRMS(1);
0945
0946
0947 char hname[100];
0948 sprintf(hname, "%s50d",calo);
0949 TH1 *h1 = (TH1F *) fin->Get(hname);
0950
0951 spf->DrawMarker(50, h1->GetMean(1));
0952 rlin->DrawLine(50,(h1->GetMean(1)-h1->GetRMS(1)),50,(h1->GetMean(1) + h1->GetRMS(1)));
0953 double hom50 = h1->GetMean(1);
0954 double hor50 = h1->GetRMS(1);
0955
0956
0957 double x[9] = {1,2,4,8,12,16,32,40,50};
0958 double y[9] = {hom1,hom2,hom4,hom8,hom12,hom16,hom32,hom40,hom50};
0959 double xer[9] = {0};
0960 double yer[9] = {hor1,hor2,hor4,hor8,hor12,hor16,hor32,hor40,hor50};
0961 gr = new TGraphErrors(9,x,y,xer,yer);
0962 gr->Draw("ALP");
0963 gr->SetMarkerStyle(20);
0964 gr->SetMarkerColor(2);
0965
0966
0967
0968
0969
0970
0971
0972 fin->Close();
0973
0974
0975
0976
0977
0978
0979
0980
0981
0982
0983
0984
0985
0986
0987
0988
0989
0990
0991
0992
0993
0994
0995
0996
0997
0998
0999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026 }
1027
1028
1029
1030 void EdepPercentSmall (const char *calo="HO", const char *part="e")
1031 {
1032 char infile[100];
1033 int pz[9] = {1,2,4,8,12,16,32,40,50};
1034 double x[9];
1035
1036 for (int i=0; i<9; i++)
1037 {
1038
1039 sprintf(infile, "%s%dout.root",part, pz[i]);
1040 char hname [100];
1041 sprintf(hname, "%s%s%dd",calo,part,pz[i]);
1042 TH1F *h1 = new TH1F(hname, "", 100, 0, 1);
1043 TFile *f = TFile::Open(infile);
1044 gROOT->cd();
1045 TNtuple *nt = (TNtuple *)f->Get("ed");
1046
1047
1048 if (calo == "HO")
1049 {
1050 nt->Project(hname,"(EA+HOS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
1051 }
1052 else if(calo == "HI")
1053 {
1054 nt->Project(hname,"(EA+HOS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
1055 }
1056 else if(calo == "E")
1057 {
1058 nt->Project(hname,"(EA+ES)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
1059 }
1060 else if (calo == "MAG")
1061 {
1062 nt->Project(hname,"(MAG)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
1063 }
1064 else if (calo == "BH")
1065 {
1066 nt->Project(hname,"(MAG)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
1067 }
1068 else
1069 {
1070 cout << "ERROR" << endl;
1071 }
1072 f->Close();
1073 h1->Draw();
1074 char fname [100];
1075 sprintf(fname, "%spercent.root",part);
1076 TFile *fout = TFile::Open(fname,"UPDATE");
1077 h1->Write();
1078 fout->Write();
1079 cout << h1->Integral() << " " << hname << " " << pz[i] << endl;
1080
1081 fout->Close();
1082 }
1083
1084 }
1085
1086
1087
1088
1089
1090
1091
1092
1093 void EdepSmall(const char *calo="HOe")
1094 {
1095 int pz[9] = {1,2,4,8,12,16,32,40,50};
1096 double x[9];
1097 double y[9];
1098 double xer[9] = {0};
1099 double yer[9];
1100 char hname[100];
1101 TFile *fin = TFile::Open("epercent.root");
1102 gROOT->cd();
1103 for (int i=0; i<9; i++)
1104 {
1105 x[i] = pz[i];
1106 sprintf(hname,"%s%dd",calo,pz[i]);
1107 TH1 *h1 = (TH1F *) fin->Get(hname);
1108 y[i] = h1->GetMean(1);
1109 yer[i] = h1->GetRMS(1);
1110 }
1111 gr = new TGraphErrors(9,x,y,xer,yer);
1112 gr->Draw("ALP");
1113 gr->SetMarkerStyle(20);
1114 gr->SetMarkerColor(2);
1115 fin->Close();
1116 }
1117