File indexing completed on 2025-08-06 08:11:55
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, "an1out.root");
0015 char hname [100];
0016 sprintf(hname, "Ean1d");
0017 TH1F *h1 = new TH1F(hname, "Ean1d", 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("anpercent.root","UPDATE");
0025 h1->Write();
0026 fout->Write();
0027 cout << h1->Integral() << " " << hname << endl;
0028
0029 fout->Close();
0030
0031 sprintf(infile, "an2out.root");
0032 char hname [100];
0033 sprintf(hname, "Ean2d");
0034 TH1F *h1 = new TH1F(hname, "Ean2d", 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("anpercent.root","UPDATE");
0042 h1->Write();
0043 fout->Write();
0044 cout << h1->Integral() << " " << hname << endl;
0045
0046 fout->Close();
0047
0048 sprintf(infile, "an4out.root");
0049 char hname [100];
0050 sprintf(hname, "Ean4d");
0051 TH1F *h1 = new TH1F(hname, "Ean4d", 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("anpercent.root","UPDATE");
0059 h1->Write();
0060 fout->Write();
0061 cout << h1->Integral() << " " << hname << endl;
0062
0063 fout->Close();
0064
0065 sprintf(infile, "an8out.root");
0066 char hname [100];
0067 sprintf(hname, "Ean8d");
0068 TH1F *h1 = new TH1F(hname, "Ean8d", 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("anpercent.root","UPDATE");
0076 h1->Write();
0077 fout->Write();
0078 cout << h1->Integral() << " " << hname << endl;
0079
0080 fout->Close();
0081
0082 sprintf(infile, "an12out.root");
0083 char hname [100];
0084 sprintf(hname, "Ean12d");
0085 TH1F *h1 = new TH1F(hname, "Ean12d", 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("anpercent.root","UPDATE");
0093 h1->Write();
0094 fout->Write();
0095 cout << h1->Integral() << " " << hname << endl;
0096
0097 fout->Close();
0098
0099 sprintf(infile, "an16out.root");
0100 char hname [100];
0101 sprintf(hname, "Ean16d");
0102 TH1F *h1 = new TH1F(hname, "Ean16d", 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("anpercent.root","UPDATE");
0110 h1->Write();
0111 fout->Write();
0112 cout << h1->Integral() << " " << hname << endl;
0113
0114 fout->Close();
0115
0116 sprintf(infile, "an32out.root");
0117 char hname [100];
0118 sprintf(hname, "Ean32d");
0119 TH1F *h1 = new TH1F(hname, "Ean32d", 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("anpercent.root","UPDATE");
0127 h1->Write();
0128 fout->Write();
0129 cout << h1->Integral() << " " << hname << endl;
0130
0131 fout->Close();
0132
0133 sprintf(infile, "an40out.root");
0134 char hname [100];
0135 sprintf(hname, "Ean40d");
0136 TH1F *h1 = new TH1F(hname, "Ean40d", 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("anpercent.root","UPDATE");
0144 h1->Write();
0145 fout->Write();
0146 cout << h1->Integral() << " " << hname << endl;
0147
0148 fout->Close();
0149
0150 sprintf(infile, "an0out.root");
0151 char hname [100];
0152 sprintf(hname, "an50d");
0153 TH1F *h1 = new TH1F(hname, "an50d", 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("anpercent.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("anpercent.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, "an1d");
0214 TH1 *h1 = (TH1F *) fin->Get(hname);
0215 spf->DrawMarker(1, h1->GetMean(1));
0216
0217 char hname[100];
0218 sprintf(hname, "an2d");
0219 TH1 *h1 = (TH1F *) fin->Get(hname);
0220 spf->DrawMarker(2, h1->GetMean(1));
0221
0222 char hname[100];
0223 sprintf(hname, "an4d");
0224 TH1 *h1 = (TH1F *) fin->Get(hname);
0225
0226 spf->DrawMarker(4, h1->GetMean(1));
0227
0228 char hname[100];
0229 sprintf(hname, "an8d");
0230 TH1 *h1 = (TH1F *) fin->Get(hname);
0231
0232 spf->DrawMarker(8, h1->GetMean(1));
0233
0234 char hname[100];
0235 sprintf(hname, "an12d");
0236 TH1 *h1 = (TH1F *) fin->Get(hname);
0237
0238 spf->DrawMarker(12, h1->GetMean(1));
0239
0240 char hname[100];
0241 sprintf(hname, "an16d");
0242 TH1 *h1 = (TH1F *) fin->Get(hname);
0243
0244 spf->DrawMarker(16, h1->GetMean(1));
0245
0246 char hname[100];
0247 sprintf(hname, "an32d");
0248 TH1 *h1 = (TH1F *) fin->Get(hname);
0249
0250 spf->DrawMarker(32, h1->GetMean(1));
0251
0252 char hname[100];
0253 sprintf(hname, "an40d");
0254 TH1 *h1 = (TH1F *) fin->Get(hname);
0255
0256 spf->DrawMarker(40, h1->GetMean(1));
0257
0258 char hname[100];
0259 sprintf(hname, "an50d");
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, "an1out.root");
0341 char hname [100];
0342 sprintf(hname, "HIan1d");
0343 TH1F *h1 = new TH1F(hname, "HIan1d", 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("anpercent.root","UPDATE");
0351 h1->Write();
0352 fout->Write();
0353 cout << h1->Integral() << " " << hname << endl;
0354
0355 fout->Close();
0356
0357 sprintf(infile, "an2out.root");
0358 char hname [100];
0359 sprintf(hname, "HIan2d");
0360 TH1F *h1 = new TH1F(hname, "HIan2d", 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("anpercent.root","UPDATE");
0368 h1->Write();
0369 fout->Write();
0370 cout << h1->Integral() << " " << hname << endl;
0371
0372 fout->Close();
0373
0374 sprintf(infile, "an4out.root");
0375 char hname [100];
0376 sprintf(hname, "HIan4d");
0377 TH1F *h1 = new TH1F(hname, "HIan4d", 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("anpercent.root","UPDATE");
0385 h1->Write();
0386 fout->Write();
0387 cout << h1->Integral() << " " << hname << endl;
0388
0389 fout->Close();
0390
0391 sprintf(infile, "an8out.root");
0392 char hname [100];
0393 sprintf(hname, "HIan8d");
0394 TH1F *h1 = new TH1F(hname, "HIan8d", 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("anpercent.root","UPDATE");
0402 h1->Write();
0403 fout->Write();
0404 cout << h1->Integral() << " " << hname << endl;
0405
0406 fout->Close();
0407
0408 sprintf(infile, "an12out.root");
0409 char hname [100];
0410 sprintf(hname, "HIan12d");
0411 TH1F *h1 = new TH1F(hname, "HIan12d", 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("anpercent.root","UPDATE");
0419 h1->Write();
0420 fout->Write();
0421 cout << h1->Integral() << " " << hname << endl;
0422
0423 fout->Close();
0424
0425 sprintf(infile, "an16out.root");
0426 char hname [100];
0427 sprintf(hname, "HIan16d");
0428 TH1F *h1 = new TH1F(hname, "HIan16d", 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("anpercent.root","UPDATE");
0436 h1->Write();
0437 fout->Write();
0438 cout << h1->Integral() << " " << hname << endl;
0439
0440 fout->Close();
0441
0442 sprintf(infile, "an32out.root");
0443 char hname [100];
0444 sprintf(hname, "HIan32d");
0445 TH1F *h1 = new TH1F(hname, "HIan32d", 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("anpercent.root","UPDATE");
0453 h1->Write();
0454 fout->Write();
0455 cout << h1->Integral() << " " << hname << endl;
0456
0457 fout->Close();
0458
0459 sprintf(infile, "an40out.root");
0460 char hname [100];
0461 sprintf(hname, "HIan40d");
0462 TH1F *h1 = new TH1F(hname, "HIan40d", 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("anpercent.root","UPDATE");
0470 h1->Write();
0471 fout->Write();
0472 cout << h1->Integral() << " " << hname << endl;
0473
0474 fout->Close();
0475
0476 sprintf(infile, "an50out.root");
0477 char hname [100];
0478 sprintf(hname, "HIan50d");
0479 TH1F *h1 = new TH1F(hname, "HIan50d", 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("anpercent.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("anpercent.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, "HIan1d");
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, "HIan2d");
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, "HIan4d");
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, "HIan8d");
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, "HIan12d");
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, "HIan16d");
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, "HIan32d");
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, "HIan40d");
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, "HIan50d");
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
0660 void EdepPercentOH()
0661 {
0662 char infile[100];
0663
0664 int pz[10] = {1,2,4,8,12,16,32,40,50,90};
0665
0666 int h1int[36];
0667
0668
0669
0670
0671
0672
0673 sprintf(infile, "an1out.root");
0674 char hname [100];
0675 sprintf(hname, "HOan1d");
0676 TH1F *h1 = new TH1F(hname, "HOan1d", 100, 0, 1);
0677 TFile *f = TFile::Open(infile);
0678 gROOT->cd();
0679 TNtuple *nt = (TNtuple *)f->Get("ed");
0680 nt->Project(hname,"(HOA+HOS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0681 f->Close();
0682 h1->Draw();
0683 TFile *fout = TFile::Open("anpercent.root","UPDATE");
0684 h1->Write();
0685 fout->Write();
0686 cout << h1->Integral() << " " << hname << endl;
0687
0688 fout->Close();
0689
0690 sprintf(infile, "an2out.root");
0691 char hname [100];
0692 sprintf(hname, "HOan2d");
0693 TH1F *h1 = new TH1F(hname, "HOan2d", 100, 0, 1);
0694 TFile *f = TFile::Open(infile);
0695 gROOT->cd();
0696 TNtuple *nt = (TNtuple *)f->Get("ed");
0697 nt->Project(hname,"(HOA+HOS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0698 f->Close();
0699 h1->Draw();
0700 TFile *fout = TFile::Open("anpercent.root","UPDATE");
0701 h1->Write();
0702 fout->Write();
0703 cout << h1->Integral() << " " << hname << endl;
0704
0705 fout->Close();
0706
0707 sprintf(infile, "an4out.root");
0708 char hname [100];
0709 sprintf(hname, "HOan4d");
0710 TH1F *h1 = new TH1F(hname, "HOan4d", 100, 0, 1);
0711 TFile *f = TFile::Open(infile);
0712 gROOT->cd();
0713 TNtuple *nt = (TNtuple *)f->Get("ed");
0714 nt->Project(hname,"(HOA+HOS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0715 f->Close();
0716 h1->Draw();
0717 TFile *fout = TFile::Open("anpercent.root","UPDATE");
0718 h1->Write();
0719 fout->Write();
0720 cout << h1->Integral() << " " << hname << endl;
0721
0722 fout->Close();
0723
0724 sprintf(infile, "an8out.root");
0725 char hname [100];
0726 sprintf(hname, "HOan8d");
0727 TH1F *h1 = new TH1F(hname, "HOan8d", 100, 0, 1);
0728 TFile *f = TFile::Open(infile);
0729 gROOT->cd();
0730 TNtuple *nt = (TNtuple *)f->Get("ed");
0731 nt->Project(hname,"(HOA+HOS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0732 f->Close();
0733 h1->Draw();
0734 TFile *fout = TFile::Open("anpercent.root","UPDATE");
0735 h1->Write();
0736 fout->Write();
0737 cout << h1->Integral() << " " << hname << endl;
0738
0739 fout->Close();
0740
0741 sprintf(infile, "an12out.root");
0742 char hname [100];
0743 sprintf(hname, "HOan12d");
0744 TH1F *h1 = new TH1F(hname, "HOan12d", 100, 0, 1);
0745 TFile *f = TFile::Open(infile);
0746 gROOT->cd();
0747 TNtuple *nt = (TNtuple *)f->Get("ed");
0748 nt->Project(hname,"(HOA+HOS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0749 f->Close();
0750 h1->Draw();
0751 TFile *fout = TFile::Open("anpercent.root","UPDATE");
0752 h1->Write();
0753 fout->Write();
0754 cout << h1->Integral() << " " << hname << endl;
0755
0756 fout->Close();
0757
0758 sprintf(infile, "an16out.root");
0759 char hname [100];
0760 sprintf(hname, "HOan16d");
0761 TH1F *h1 = new TH1F(hname, "HOan16d", 100, 0, 1);
0762 TFile *f = TFile::Open(infile);
0763 gROOT->cd();
0764 TNtuple *nt = (TNtuple *)f->Get("ed");
0765 nt->Project(hname,"(HOA+HOS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0766 f->Close();
0767 h1->Draw();
0768 TFile *fout = TFile::Open("anpercent.root","UPDATE");
0769 h1->Write();
0770 fout->Write();
0771 cout << h1->Integral() << " " << hname << endl;
0772
0773 fout->Close();
0774
0775 sprintf(infile, "an32out.root");
0776 char hname [100];
0777 sprintf(hname, "HOan32d");
0778 TH1F *h1 = new TH1F(hname, "HOan32d", 100, 0, 1);
0779 TFile *f = TFile::Open(infile);
0780 gROOT->cd();
0781 TNtuple *nt = (TNtuple *)f->Get("ed");
0782 nt->Project(hname,"(HOA+HOS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0783 f->Close();
0784 h1->Draw();
0785 TFile *fout = TFile::Open("anpercent.root","UPDATE");
0786 h1->Write();
0787 fout->Write();
0788 cout << h1->Integral() << " " << hname << endl;
0789
0790 fout->Close();
0791
0792 sprintf(infile, "an40out.root");
0793 char hname [100];
0794 sprintf(hname, "HOan40d");
0795 TH1F *h1 = new TH1F(hname, "HOan40d", 100, 0, 1);
0796 TFile *f = TFile::Open(infile);
0797 gROOT->cd();
0798 TNtuple *nt = (TNtuple *)f->Get("ed");
0799 nt->Project(hname,"(HOA+HOS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0800 f->Close();
0801 h1->Draw();
0802 TFile *fout = TFile::Open("anpercent.root","UPDATE");
0803 h1->Write();
0804 fout->Write();
0805 cout << h1->Integral() << " " << hname << endl;
0806
0807 fout->Close();
0808
0809 sprintf(infile, "an50out.root");
0810 char hname [100];
0811 sprintf(hname, "HOan50d");
0812 TH1F *h1 = new TH1F(hname, "HOan50d", 100, 0, 1);
0813 TFile *f = TFile::Open(infile);
0814 gROOT->cd();
0815 TNtuple *nt = (TNtuple *)f->Get("ed");
0816 nt->Project(hname,"(HOA+HOS)/(EA+ES+HIA+HIS+HOA+HOS+BH+MAG)");
0817 f->Close();
0818 h1->Draw();
0819 TFile *fout = TFile::Open("anpercent.root","UPDATE");
0820 h1->Write();
0821 fout->Write();
0822 cout << h1->Integral() << " " << hname << endl;
0823
0824 fout->Close();
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()
0856 {
0857 TFile *fin = TFile::Open("anpercent.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, "HOan1d");
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, "HOan2d");
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, "HOan4d");
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, "HOan8d");
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, "HOan12d");
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, "HOan16d");
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, "HOan40d");
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, "an50d");
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
1031
1032
1033
1034
1035
1036
1037
1038
1039 void EdepSmall(const char *calo="HOan")
1040 {
1041 int pz[9] = {1,2,4,8,12,16,32,40,50};
1042 double x[9];
1043 double y[9];
1044 double xer[9] = {0};
1045 double yer[9];
1046 char hname[100];
1047 TFile *fin = TFile::Open("anpercent.root");
1048 gROOT->cd();
1049 for (int i=0; i<9; i++)
1050 {
1051 x[i] = pz[i];
1052 sprintf(hname,"%s%dd",calo,pz[i]);
1053 TH1 *h1 = (TH1F *) fin->Get(hname);
1054 y[i] = h1->GetMean(1);
1055 yer[i] = h1->GetRMS(1);
1056 }
1057 gr = new TGraphErrors(9,x,y,xer,yer);
1058 gr->Draw("ALP");
1059 gr->SetMarkerStyle(20);
1060 gr->SetMarkerColor(2);
1061 fin->Close();
1062 }
1063