File indexing completed on 2024-04-06 12:05:51
0001 #include <TChain.h>
0002 #include <TH1D.h>
0003 #include <TH2D.h>
0004 #include <TProfile.h>
0005 #include <TFitResult.h>
0006 #include <TFitResultPtr.h>
0007 #include <TPaveStats.h>
0008 #include <vector>
0009 #include <string>
0010 #include <iomanip>
0011
0012 #include <iostream>
0013 #include <fstream>
0014 #include "TH1.h"
0015 #include "TH2.h"
0016 #include "TCanvas.h"
0017 #include "TROOT.h"
0018 #include <TMath.h>
0019 #include "TStyle.h"
0020 #include "TSystem.h"
0021 #include "TLegend.h"
0022 #include "TText.h"
0023 #include "TAxis.h"
0024 #include "TFile.h"
0025 #include "TLine.h"
0026 #include "TGraph.h"
0027 #include <TPaveText.h>
0028 #include <TPostScript.h>
0029 #include <TClass.h>
0030
0031
0032 using namespace std;
0033
0034
0035
0036
0037
0038 int main(int argc, char *argv[]) {
0039 std::string dirnm = "Analyzer";
0040
0041 printf("reco: gROOT Reset \n");
0042 gROOT->Reset();
0043 gROOT->SetStyle("Plain");
0044
0045
0046
0047
0048
0049
0050
0051 gStyle->SetOptStat(101110);
0052
0053
0054
0055
0056 gStyle->SetOptFit(0010);
0057
0058
0059
0060
0061
0062
0063
0064
0065 gStyle->SetStatX(0.91);
0066 gStyle->SetStatY(0.75);
0067 gStyle->SetStatW(0.20);
0068 gStyle->SetStatH(0.10);
0069
0070
0071
0072
0073
0074 Float_t LeftOffset = 0.12;
0075 Float_t TopOffset = 0.22;
0076
0077 gStyle->SetLineWidth(1);
0078 gStyle->SetErrorX(0);
0079
0080
0081 gStyle->SetOptTitle(0);
0082
0083 gStyle->SetTitleColor(1);
0084
0085 gStyle->SetTitleX(0.15);
0086 gStyle->SetTitleH(0.15);
0087
0088 gStyle->SetTitleW(0.60);
0089 gStyle->SetTitleFont(42);
0090 gStyle->SetTitleFontSize(0.07);
0091
0092 gStyle->SetPalette(1);
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105 gStyle->SetPadTopMargin(TopOffset);
0106 gStyle->SetPadBottomMargin(LeftOffset);
0107 gStyle->SetPadRightMargin(TopOffset);
0108 gStyle->SetPadLeftMargin(LeftOffset);
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156 TFile *hfile1 = new TFile("Global_362365.root", "READ");
0157
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168 TPostScript psfile("zlumiadcampltest.ps", 111);
0169
0170
0171
0172 TCanvas *c1 = new TCanvas("c1", "Hcal4test", 200, 10, 700, 900);
0173
0174
0175 hfile1->ls();
0176 TDirectory *dir = (TDirectory *)hfile1->FindObjectAny(dirnm.c_str());
0177
0178
0179
0180
0181
0182
0183
0184
0185
0186
0187 c1->Clear();
0188 c1->Divide(2, 1);
0189 c1->cd(1);
0190 TH1F *LumLum = (TH1F *)dir->FindObjectAny("h_lsnumber_per_eachLS");
0191 int MaxLumDanila = LumLum->GetBinContent(LumLum->GetMaximumBin());
0192 cout << " MaxLumDanila= " << MaxLumDanila << endl;
0193
0194
0195 LumLum->SetMarkerStyle(21);
0196 LumLum->SetMarkerSize(0.8);
0197 LumLum->GetYaxis()->SetLabelSize(0.04);
0198 LumLum->SetTitle("Cont. number per LS \b");
0199 LumLum->SetXTitle("Cont.number \b");
0200 LumLum->SetYTitle("Ls \b");
0201 LumLum->SetMarkerColor(4);
0202 LumLum->SetLineColor(0);
0203 LumLum->SetMinimum(0.8);
0204 LumLum->GetXaxis()->SetRangeUser(0, MaxLumDanila + 5.);
0205 LumLum->Draw("Error");
0206
0207 c1->cd(2);
0208 TH1F *LumiEv = (TH1F *)dir->FindObjectAny("h_nevents_per_eachRealLS");
0209 int MaxLum0 = LumiEv->GetBinContent(LumiEv->GetMaximumBin());
0210 int MaxLum = 0;
0211 for (int i = 1; i <= LumiEv->GetXaxis()->GetNbins(); i++) {
0212 if (LumiEv->GetBinContent(i)) {
0213 MaxLum = i;
0214 }
0215 }
0216 cout << " Nev in bin of MaxLum = " << MaxLum0 << " MaxLum= " << MaxLum << endl;
0217
0218
0219
0220 gPad->SetLogy();
0221
0222 LumiEv->GetYaxis()->SetLabelSize(0.04);
0223 LumiEv->SetTitle("Number of events per LS");
0224 LumiEv->SetXTitle("LS");
0225 LumiEv->SetYTitle("Number of events ");
0226 LumiEv->SetMarkerStyle(21);
0227 LumiEv->SetMarkerSize(0.8);
0228 LumiEv->SetMarkerColor(4);
0229 LumiEv->SetLineColor(0);
0230 LumiEv->SetMinimum(0.8);
0231 LumiEv->GetXaxis()->SetRangeUser(0, MaxLum + 5.);
0232 LumiEv->Draw("Error");
0233
0234 c1->Update();
0235
0236
0237
0238
0239
0240
0241
0242
0243
0244
0245
0246
0247
0248
0249
0250
0251
0252 c1->Clear();
0253 c1->Divide(2, 4);
0254
0255 c1->cd(1);
0256 TH1F *MilMil = (TH1F *)dir->FindObjectAny("h_lsnumber_per_eachLS");
0257 int MaxMilDanila = MilMil->GetBinContent(MilMil->GetMaximumBin());
0258 cout << " MaxMilDanila= " << MaxMilDanila << endl;
0259
0260
0261 MilMil->GetYaxis()->SetLabelSize(0.04);
0262 MilMil->SetTitle("Cont. number per LS \b");
0263 MilMil->SetXTitle("Cont.number \b");
0264 MilMil->SetYTitle("Ls \b");
0265 MilMil->SetMarkerStyle(20);
0266 MilMil->SetMarkerSize(0.2);
0267 MilMil->SetMarkerColor(4);
0268 MilMil->SetLineColor(0);
0269 MilMil->SetMinimum(0.8);
0270 MilMil->GetXaxis()->SetRangeUser(0, MaxMilDanila);
0271 MilMil->Draw("Error");
0272
0273 c1->cd(2);
0274 TH1F *MiliEv = (TH1F *)dir->FindObjectAny("h_nevents_per_eachLS");
0275 int MaxMil0 = MiliEv->GetBinContent(MiliEv->GetMaximumBin());
0276 int MaxMil = 0;
0277 for (int i = 1; i <= MiliEv->GetXaxis()->GetNbins(); i++) {
0278 if (MiliEv->GetBinContent(i)) {
0279 MaxMil = i;
0280 }
0281 }
0282 cout << " MaxMil0= " << MaxMil0 << " MaxMil= " << MaxMil << endl;
0283
0284
0285
0286 gPad->SetLogy();
0287
0288 MiliEv->GetYaxis()->SetLabelSize(0.04);
0289 MiliEv->SetTitle("Number of events per LS");
0290 MiliEv->SetXTitle("LS");
0291 MiliEv->SetYTitle("Number of events ");
0292 MiliEv->SetMarkerStyle(20);
0293 MiliEv->SetMarkerSize(0.2);
0294 MiliEv->SetMarkerColor(4);
0295 MiliEv->SetLineColor(0);
0296
0297 MiliEv->GetXaxis()->SetRangeUser(0, MaxMil);
0298 MiliEv->Draw("Error");
0299
0300 c1->cd(3);
0301 TH1F *GiriEv = (TH1F *)dir->FindObjectAny("h_nls_per_run");
0302 int MaxGir0 = GiriEv->GetBinContent(GiriEv->GetMaximumBin());
0303 int MaxGir = 0;
0304 for (int i = 1; i <= GiriEv->GetXaxis()->GetNbins(); i++) {
0305 if (GiriEv->GetBinContent(i)) {
0306 MaxGir = i;
0307 }
0308 }
0309 cout << "nls_per_run = " << MaxGir0 << " Maxnls_per_run= " << MaxGir << endl;
0310
0311
0312
0313
0314
0315 GiriEv->GetYaxis()->SetLabelSize(0.04);
0316 GiriEv->SetTitle("Number of LS per run");
0317 GiriEv->SetXTitle("irun");
0318 GiriEv->SetYTitle("Number of LS ");
0319 GiriEv->SetMarkerStyle(20);
0320 GiriEv->SetMarkerSize(0.8);
0321 GiriEv->SetMarkerColor(4);
0322 GiriEv->SetLineColor(0);
0323
0324 GiriEv->GetXaxis()->SetRangeUser(0, MaxGir);
0325 GiriEv->Draw("Error");
0326
0327 c1->cd(4);
0328 TH1F *SumiEv = (TH1F *)dir->FindObjectAny("h_nevents_per_eachRealLS");
0329 int MaxSum0 = SumiEv->GetBinContent(SumiEv->GetMaximumBin());
0330 int MaxSum = 0;
0331 for (int i = 1; i <= SumiEv->GetXaxis()->GetNbins(); i++) {
0332 if (SumiEv->GetBinContent(i)) {
0333 MaxSum = i;
0334 }
0335 }
0336 cout << " MaxSum0= " << MaxSum0 << " MaxSum= " << MaxSum << endl;
0337
0338 gPad->SetGridy();
0339 gPad->SetGridx();
0340 gPad->SetLogy();
0341
0342 SumiEv->GetYaxis()->SetLabelSize(0.04);
0343 SumiEv->SetTitle("Number of events per RealLS");
0344 SumiEv->SetXTitle("LS");
0345 SumiEv->SetYTitle("Number of events ");
0346 SumiEv->SetMarkerStyle(20);
0347 SumiEv->SetMarkerSize(0.2);
0348 SumiEv->SetMarkerColor(4);
0349 SumiEv->SetLineColor(0);
0350
0351 SumiEv->GetXaxis()->SetRangeUser(0, MaxSum);
0352 SumiEv->Draw("Error");
0353
0354 c1->cd(5);
0355 TH1F *TiriEv = (TH1F *)dir->FindObjectAny("h_nevents_per_LS");
0356 int MaxTir0 = TiriEv->GetBinContent(TiriEv->GetMaximumBin());
0357 int MaxTir = 0;
0358 for (int i = 1; i <= TiriEv->GetXaxis()->GetNbins(); i++) {
0359 if (TiriEv->GetBinContent(i)) {
0360 MaxTir = i;
0361 }
0362 }
0363 cout << " MaxTir0= " << MaxTir0 << " MaxTir= " << MaxTir << endl;
0364
0365 TiriEv->GetYaxis()->SetLabelSize(0.04);
0366 TiriEv->SetTitle("Number of events per LS");
0367 TiriEv->SetXTitle("LS");
0368 TiriEv->SetYTitle("Number of events ");
0369 TiriEv->SetMarkerStyle(20);
0370 TiriEv->SetMarkerSize(0.8);
0371 TiriEv->SetMarkerColor(4);
0372 TiriEv->SetLineColor(0);
0373
0374 TiriEv->GetXaxis()->SetRangeUser(0, MaxTir);
0375 TiriEv->Draw("Error");
0376
0377 c1->cd(6);
0378 TH1F *MasiEv = (TH1F *)dir->FindObjectAny("h_nevents_per_LSzoom");
0379 int MaxMas0 = MasiEv->GetBinContent(MasiEv->GetMaximumBin());
0380 int MaxMas = 0;
0381 for (int i = 1; i <= MasiEv->GetXaxis()->GetNbins(); i++) {
0382 if (MasiEv->GetBinContent(i)) {
0383 MaxMas = i;
0384 }
0385 }
0386 cout << " MaxMas0= " << MaxMas0 << " MaxMas= " << MaxMas << endl;
0387
0388 MasiEv->GetYaxis()->SetLabelSize(0.04);
0389 MasiEv->SetTitle("Number of events per LS");
0390 MasiEv->SetXTitle("LS");
0391 MasiEv->SetYTitle("Number of events ");
0392 MasiEv->SetMarkerStyle(20);
0393 MasiEv->SetMarkerSize(0.8);
0394 MasiEv->SetMarkerColor(4);
0395 MasiEv->SetLineColor(0);
0396
0397 MasiEv->GetXaxis()->SetRangeUser(0, MaxMas);
0398 MasiEv->Draw("Error");
0399
0400 c1->cd(7);
0401 TH1F *LediEv = (TH1F *)dir->FindObjectAny("h_nls_per_run10");
0402 int MaxLed0 = LediEv->GetBinContent(LediEv->GetMaximumBin());
0403 int MaxLed = 0;
0404 for (int i = 1; i <= LediEv->GetXaxis()->GetNbins(); i++) {
0405 if (LediEv->GetBinContent(i)) {
0406 MaxLed = i;
0407 }
0408 }
0409 cout << " NlsPERrun= " << MaxLed0 << " MaxbinHisto= " << MaxLed << endl;
0410
0411 LediEv->GetYaxis()->SetLabelSize(0.04);
0412 LediEv->SetTitle("Number of ls(ev>10) per run");
0413 LediEv->SetXTitle("run");
0414 LediEv->SetYTitle("Number of ls ");
0415 LediEv->SetMarkerStyle(20);
0416 LediEv->SetMarkerSize(0.8);
0417 LediEv->SetMarkerColor(4);
0418 LediEv->SetLineColor(0);
0419
0420 LediEv->GetXaxis()->SetRangeUser(0, MaxLed);
0421 LediEv->Draw("Error");
0422
0423 c1->Update();
0424
0425
0426
0427
0428
0429
0430
0431
0432 psfile.Close();
0433
0434 hfile1->Close();
0435
0436 hfile1->Close();
0437
0438
0439
0440 gSystem->Exit(0);
0441
0442 }