CMS 3D CMS Logo

zadcampltest.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <fstream>
3 #include "TH1.h"
4 #include "TH2.h"
5 #include "TCanvas.h"
6 #include "TROOT.h"
7 #include <TMath.h>
8 #include "TStyle.h"
9 #include "TSystem.h"
10 #include "TLegend.h"
11 #include "TText.h"
12 #include "TAxis.h"
13 #include "TFile.h"
14 #include "TLine.h"
15 #include "TGraph.h"
16 #include <TPaveText.h>
17 #include <TPostScript.h>
18 #include <TClass.h>
19 
20 //
21 using namespace std;
22 //
23 //
24 
25 //inline void HERE(const char *msg) { std::cout << msg << std::endl; }
26 
27 int main(int argc, char *argv[]) {
28  //======================================================================
29  printf("reco: gROOT Reset \n");
30  gROOT->Reset();
31  gROOT->SetStyle("Plain");
32  // gStyle->SetOptStat(0); // no statistics _or_
33  // gStyle->SetOptStat(11111111);
34  //gStyle->SetOptStat(1101);// name mean and rms
35  // gStyle->SetOptStat(0101);// name and entries
36  // gStyle->SetOptStat(1100);// mean and rms only !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
37  // gStyle->SetOptStat(1110000);// und over, integral !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
38  gStyle->SetOptStat(101110); // entries, mean, rms, overflow !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
39  // gStyle->SetOptStat(100000);// over !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
40  //
41  //gStyle->SetOptFit(00010);// constant, mean and sigma only !!
42  // gStyle->SetOptFit(00001);// hi2/nu, constant, mean and sigma only !!
43  gStyle->SetOptFit(0010); // constant, mean and sigma only !!
44  // gStyle->SetOptFit(00011);// constant, mean and sigma only !!
45  // gStyle->SetOptFit(1101);
46  // gStyle->SetOptFit(1011);
47  //
48  //gStyle->SetStatX(0.98);
49  //gStyle->SetStatY(0.99);
50  //gStyle->SetStatW(0.30);
51  //gStyle->SetStatH(0.25);
52  gStyle->SetStatX(0.91);
53  gStyle->SetStatY(0.75);
54  gStyle->SetStatW(0.20);
55  gStyle->SetStatH(0.10);
56  // gStyle->SetStatH(0.35);
57  //
58 
59  // Float_t LeftOffset = 0.12;
60  //Float_t TopOffset = 0.12;
61  Float_t LeftOffset = 0.12;
62  Float_t TopOffset = 0.22;
63 
64  gStyle->SetLineWidth(1);
65  gStyle->SetErrorX(0);
66 
67  //---=[ Titles,Labels ]=-----------
68  gStyle->SetOptTitle(0); // title on/off
69  // gStyle->SetTitleColor(0); // title color
70  gStyle->SetTitleColor(1); // title color
71  // gStyle->SetTitleX(0.35); // title x-position
72  gStyle->SetTitleX(0.15); // title x-position
73  gStyle->SetTitleH(0.15); // title height
74  // gStyle->SetTitleW(0.53); // title width
75  gStyle->SetTitleW(0.60); // title width
76  gStyle->SetTitleFont(42); // title font
77  gStyle->SetTitleFontSize(0.07); // title font size
78 
79  gStyle->SetPalette(1);
80  //---=[ Histogram style ]=----------
81  // gStyle->SetHistFillColor(38);
82  // gStyle->SetFrameFillColor(41);// jelto-kori4nev-svetl
83  // gStyle->SetFrameFillColor(5);// jeltyi
84  // gStyle->SetFrameFillColor(17);// seryi
85  // gStyle->SetFrameFillColor(18);// svetlo seryi
86  // gStyle->SetFrameFillColor(20);// svetlo kori4nev
87  // gStyle->SetFrameFillColor(33);// sine-seryi
88  // gStyle->SetFrameFillColor(40);// fiolet-seryi
89  // gStyle->SetFrameFillColor(23);// sv.kor
90 
91  //---=[ Pad style ]=----------------
92  gStyle->SetPadTopMargin(TopOffset);
93  gStyle->SetPadBottomMargin(LeftOffset);
94  gStyle->SetPadRightMargin(TopOffset);
95  gStyle->SetPadLeftMargin(LeftOffset);
96  //---=[ SetCanvasDef ]=----------------
97  //======================================================================
98  //
99  // Connect the input file and get the 2-d histogram in memory
100  //======================================================================
101  // TBrowser *b = new TBrowser
102 
103  // TFile *hfile1= new TFile("test.root", "READ");
104  //
105 
106  // TFile *hfile1= new TFile("testNZS.root", "READ");
107  // TFile *hfile1= new TFile("test.root", "READ");
108 
109  // TFile *hfile1= new TFile("newruns/Global_234034.root", "READ");
110  //
111 
112  // TFile *hfile1= new TFile("/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/CMTweb/histos/Global_234556.root", "READ");
113  // TFile *hfile1= new TFile("Global_234034.root", "READ");
114  // TFile *hfile1= new TFile("test211006.root", "READ");
115  // TFile *hfile1= new TFile("test234457.root", "READ");
116 
117  // TFile *hfile1= new TFile("Global_51.root", "READ");
118  // TFile *hfile1= new TFile("Global_235698.root", "READ");
119 
120  // TFile *hfile1= new TFile("Global_39.root", "READ");
121  // TFile *hfile1= new TFile("test237165.root", "READ");
122  //
123  // TFile *hfile1= new TFile("Laser_238187.root", "READ");
124  // TFile *hfile1= new TFile("Laser_238183.root", "READ");
125 
126  // TFile *hfile1= new TFile("Global_255031.root", "READ");
127 
128  // TFile *hfile1= new TFile("Global_256001.root", "READ");
129  // TFile *hfile1= new TFile("Global_256167.root", "READ");
130  // TFile *hfile1= new TFile("Global_256348.root", "READ");
131  // TFile *hfile1= new TFile("Global_256630.root", "READ");
132 
133  // TFile *hfile1= new TFile("../PYTHON_runlist_test/Global_283884_1.root", "READ");
134  // TFile *hfile1= new TFile("Global_test.root", "READ");
135 
136  // TFile *hfile1= new TFile("LED_280702.root", "READ");
137  // TFile *hfile2= new TFile("LED_287824.root", "READ");
138 
139  // TFile *hfile1= new TFile("LED_284352.root", "READ");
140  // TFile *hfile1= new TFile("LEDtest.root", "READ");
141  TFile *hfile1 = new TFile("Global_311668.root", "READ");
142 
143  // TFile *hfile2= new TFile("LED_284902.root", "READ");
144  // TFile *hfile2= new TFile("LED_284499.root", "READ");
145  // TFile *hfile2= new TFile("LED_284352.root", "READ");
146 
147  // TFile *hfile2= new TFile("LED_286590.root", "READ");
148 
149  // getchar();
150  //
151  TPostScript psfile("zadcampltest.ps", 111);
152 
153  //
154 
155  TCanvas *c1 = new TCanvas("c1", "Hcal4test", 200, 10, 700, 900);
156 
157  //========================================================================================== 1
158  //======================================================================
159  //======================================================================
160  //================
161  //======================================================================
162  c1->Clear();
163  c1->Divide(2, 4);
164 
165  c1->cd(1);
166  TH2F *Zzzdepth1hef1 = (TH2F *)hfile1->Get("h_mapDepth1_HE");
167  gPad->SetGridy();
168  gPad->SetGridx();
169  gPad->SetLogz();
170  Zzzdepth1hef1->SetXTitle("#eta \b");
171  Zzzdepth1hef1->SetYTitle("#phi \b");
172  Zzzdepth1hef1->SetZTitle("h_mapDepth1_HE \b");
173  Zzzdepth1hef1->Draw("COLZ");
174 
175  c1->cd(2);
176  TH2F *Zzzdepth1hef2 = (TH2F *)hfile1->Get("h_mapDepth2_HE");
177  gPad->SetGridy();
178  gPad->SetGridx();
179  gPad->SetLogz();
180  Zzzdepth1hef2->SetXTitle("#eta \b");
181  Zzzdepth1hef2->SetYTitle("#phi \b");
182  Zzzdepth1hef2->SetZTitle("h_mapDepth2_HE \b");
183  Zzzdepth1hef2->Draw("COLZ");
184 
185  c1->cd(3);
186  TH2F *Zzzdepth1hef3 = (TH2F *)hfile1->Get("h_mapDepth3_HE");
187  gPad->SetGridy();
188  gPad->SetGridx();
189  gPad->SetLogz();
190  Zzzdepth1hef3->SetXTitle("#eta \b");
191  Zzzdepth1hef3->SetYTitle("#phi \b");
192  Zzzdepth1hef3->SetZTitle("h_mapDepth3_HE \b");
193  Zzzdepth1hef3->Draw("COLZ");
194 
195  c1->cd(4);
196  TH2F *Zzzdepth1hef4 = (TH2F *)hfile1->Get("h_mapDepth4_HE");
197  gPad->SetGridy();
198  gPad->SetGridx();
199  gPad->SetLogz();
200  Zzzdepth1hef4->SetXTitle("#eta \b");
201  Zzzdepth1hef4->SetYTitle("#phi \b");
202  Zzzdepth1hef4->SetZTitle("h_mapDepth4_HE \b");
203  Zzzdepth1hef4->Draw("COLZ");
204 
205  c1->cd(5);
206  TH2F *Zzzdepth1hef5 = (TH2F *)hfile1->Get("h_mapDepth5_HE");
207  gPad->SetGridy();
208  gPad->SetGridx();
209  gPad->SetLogz();
210  Zzzdepth1hef5->SetXTitle("#eta \b");
211  Zzzdepth1hef5->SetYTitle("#phi \b");
212  Zzzdepth1hef5->SetZTitle("h_mapDepth5_HE \b");
213  Zzzdepth1hef5->Draw("COLZ");
214 
215  c1->cd(6);
216  TH2F *Zzzdepth1hef6 = (TH2F *)hfile1->Get("h_mapDepth6_HE");
217  gPad->SetGridy();
218  gPad->SetGridx();
219  gPad->SetLogz();
220  Zzzdepth1hef6->SetXTitle("#eta \b");
221  Zzzdepth1hef6->SetYTitle("#phi \b");
222  Zzzdepth1hef6->SetZTitle("h_mapDepth6_HE \b");
223  Zzzdepth1hef6->Draw("COLZ");
224 
225  c1->cd(7);
226  TH2F *Zzzdepth1hef7 = (TH2F *)hfile1->Get("h_mapDepth7_HE");
227  gPad->SetGridy();
228  gPad->SetGridx();
229  gPad->SetLogz();
230  Zzzdepth1hef7->SetXTitle("#eta \b");
231  Zzzdepth1hef7->SetYTitle("#phi \b");
232  Zzzdepth1hef7->SetZTitle("h_mapDepth7_HE \b");
233  Zzzdepth1hef7->Draw("COLZ");
234 
235  c1->cd(8);
236  TH1F *jdjswi8 = (TH1F *)hfile1->Get("h_ADCAmpl_HE");
237  gPad->SetLogy(kFALSE);
238  // gPad->SetLogx();
239  jdjswi8->SetMarkerStyle(20);
240  jdjswi8->SetMarkerSize(0.8);
241  jdjswi8->GetYaxis()->SetLabelSize(0.04);
242  jdjswi8->SetXTitle("h_ADCAmpl_HE \b");
243  jdjswi8->SetMarkerColor(2);
244  jdjswi8->SetLineColor(2);
245  jdjswi8->Draw("");
246 
247  c1->Update();
248 
249  //========================================================================================== 2
250  //======================================================================
251  //======================================================================
252  //================
253  //======================================================================
254  c1->Clear();
255  c1->Divide(2, 4);
256 
257  c1->cd(1);
258  TH1F *wqwhef1 = (TH1F *)hfile1->Get("h_mapDepth1ADCAmpl_HE");
259  gPad->SetGridy();
260  gPad->SetGridx();
261  gPad->SetLogz();
262  wqwhef1->SetZTitle("h_mapDepth1ADCAmpl_HE \b");
263  wqwhef1->Draw("COLZ");
264 
265  c1->cd(2);
266  TH1F *wqwhef2 = (TH1F *)hfile1->Get("h_mapDepth2ADCAmpl_HE");
267  gPad->SetGridy();
268  gPad->SetGridx();
269  gPad->SetLogz();
270  wqwhef2->SetZTitle("h_mapDepth2ADCAmpl_HE \b");
271  wqwhef2->Draw("COLZ");
272 
273  c1->cd(3);
274  TH1F *wqwhef3 = (TH1F *)hfile1->Get("h_mapDepth3ADCAmpl_HE");
275  gPad->SetGridy();
276  gPad->SetGridx();
277  gPad->SetLogz();
278  wqwhef3->SetZTitle("h_mapDepth3ADCAmpl_HE \b");
279  wqwhef3->Draw("COLZ");
280 
281  c1->cd(4);
282  TH1F *wqwhef4 = (TH1F *)hfile1->Get("h_mapDepth4ADCAmpl_HE");
283  gPad->SetGridy();
284  gPad->SetGridx();
285  gPad->SetLogz();
286  wqwhef4->SetZTitle("h_mapDepth4ADCAmpl_HE \b");
287  wqwhef4->Draw("COLZ");
288 
289  c1->cd(5);
290  TH1F *wqwhef5 = (TH1F *)hfile1->Get("h_mapDepth5ADCAmpl_HE");
291  gPad->SetGridy();
292  gPad->SetGridx();
293  gPad->SetLogz();
294  wqwhef5->SetZTitle("h_mapDepth5ADCAmpl_HE \b");
295  wqwhef5->Draw("COLZ");
296 
297  c1->cd(6);
298  TH1F *wqwhef6 = (TH1F *)hfile1->Get("h_mapDepth6ADCAmpl_HE");
299  gPad->SetGridy();
300  gPad->SetGridx();
301  gPad->SetLogz();
302  wqwhef6->SetZTitle("h_mapDepth6ADCAmpl_HE \b");
303  wqwhef6->Draw("COLZ");
304 
305  c1->cd(7);
306  TH1F *wqwhef7 = (TH1F *)hfile1->Get("h_mapDepth7ADCAmpl_HE");
307  gPad->SetGridy();
308  gPad->SetGridx();
309  gPad->SetLogz();
310  wqwhef7->SetZTitle("h_mapDepth7ADCAmpl_HE \b");
311  wqwhef7->Draw("COLZ");
312 
313  c1->Update();
314 
315  //========================================================================================== 3
316  //======================================================================
317  //======================================================================
318  //================
319  //======================================================================
320  c1->Clear();
321  c1->Divide(2, 4);
322 
323  c1->cd(1);
324  TH1F *azzdepth1hef1 = (TH1F *)hfile1->Get("h_sumADCAmplperLS3");
325  gPad->SetGridy();
326  gPad->SetGridx();
327  azzdepth1hef1->SetZTitle("h_sumADCAmplperLS3 \b");
328  azzdepth1hef1->Draw("");
329 
330  c1->cd(2);
331  TH1F *azzdepth1hef2 = (TH1F *)hfile1->Get("h_sumADCAmplperLS4");
332  gPad->SetGridy();
333  gPad->SetGridx();
334  azzdepth1hef2->SetZTitle("h_sumADCAmplperLS3 \b");
335  azzdepth1hef2->Draw("");
336 
337  c1->cd(3);
338  TH1F *azzdepth1hef3 = (TH1F *)hfile1->Get("h_sumADCAmplperLS5");
339  gPad->SetGridy();
340  gPad->SetGridx();
341  azzdepth1hef3->SetZTitle("h_sumADCAmplperLS3 \b");
342  azzdepth1hef3->Draw("");
343 
344  c1->cd(4);
345  TH1F *azzdepth1hef4 = (TH1F *)hfile1->Get("h_sumADCAmplperLSdepth4HEu");
346  gPad->SetGridy();
347  gPad->SetGridx();
348  azzdepth1hef4->SetZTitle("h_sumADCAmplperLS3 \b");
349  azzdepth1hef4->Draw("");
350 
351  c1->cd(5);
352  TH1F *azzdepth1hef5 = (TH1F *)hfile1->Get("h_sumADCAmplperLSdepth5HEu");
353  gPad->SetGridy();
354  gPad->SetGridx();
355  azzdepth1hef5->SetZTitle("h_sumADCAmplperLS3 \b");
356  azzdepth1hef5->Draw("");
357 
358  c1->cd(6);
359  TH1F *azzdepth1hef6 = (TH1F *)hfile1->Get("h_sumADCAmplperLSdepth6HEu");
360  gPad->SetGridy();
361  gPad->SetGridx();
362  azzdepth1hef6->SetZTitle("h_sumADCAmplperLS3 \b");
363  azzdepth1hef6->Draw("");
364 
365  c1->cd(7);
366  TH1F *azzdepth1hef7 = (TH1F *)hfile1->Get("h_sumADCAmplperLSdepth7HEu");
367  gPad->SetGridy();
368  gPad->SetGridx();
369  azzdepth1hef7->SetZTitle("h_sumADCAmplperLS3 \b");
370  azzdepth1hef7->Draw("");
371 
372  c1->Update();
373 
374  //========================================================================================== 4
375  //======================================================================
376  //======================================================================
377  //================
378  //======================================================================
379  c1->Clear();
380  c1->Divide(2, 4);
381 
382  c1->cd(1);
383  TH1F *poqw1 = (TH1F *)hfile1->Get("h_sumCutADCAmplperLS3");
384  gPad->SetGridy();
385  gPad->SetGridx();
386  poqw1->SetZTitle("h_sumCutADCAmplperLS3 \b");
387  poqw1->Draw("");
388 
389  c1->cd(2);
390  TH1F *poqw2 = (TH1F *)hfile1->Get("h_sumCutADCAmplperLS4");
391  gPad->SetGridy();
392  gPad->SetGridx();
393  poqw2->SetZTitle("h_sumCutADCAmplperLS3 \b");
394  poqw2->Draw("");
395 
396  c1->cd(3);
397  TH1F *poqw3 = (TH1F *)hfile1->Get("h_sumCutADCAmplperLS5");
398  gPad->SetGridy();
399  gPad->SetGridx();
400  poqw3->SetZTitle("h_sumCutADCAmplperLS3 \b");
401  poqw3->Draw("");
402 
403  c1->cd(4);
404  TH1F *poqw4 = (TH1F *)hfile1->Get("h_sumCutADCAmplperLSdepth4HEu");
405  gPad->SetGridy();
406  gPad->SetGridx();
407  poqw4->SetZTitle("h_sumCutADCAmplperLS3 \b");
408  poqw4->Draw("");
409 
410  c1->cd(5);
411  TH1F *poqw5 = (TH1F *)hfile1->Get("h_sumCutADCAmplperLSdepth5HEu");
412  gPad->SetGridy();
413  gPad->SetGridx();
414  poqw5->SetZTitle("h_sumCutADCAmplperLS3 \b");
415  poqw5->Draw("");
416 
417  c1->cd(6);
418  TH1F *poqw6 = (TH1F *)hfile1->Get("h_sumCutADCAmplperLSdepth6HEu");
419  gPad->SetGridy();
420  gPad->SetGridx();
421  poqw6->SetZTitle("h_sumCutADCAmplperLS3 \b");
422  poqw6->Draw("");
423 
424  c1->cd(7);
425  TH1F *poqw7 = (TH1F *)hfile1->Get("h_sumCutADCAmplperLSdepth7HEu");
426  gPad->SetGridy();
427  gPad->SetGridx();
428  poqw7->SetZTitle("h_sumCutADCAmplperLS3 \b");
429  poqw7->Draw("");
430 
431  c1->Update();
432 
433  //========================================================================================== 5
434  //======================================================================
435  //======================================================================
436  //================
437  //======================================================================
438  c1->Clear();
439  c1->Divide(2, 4);
440 
441  c1->cd(1);
442  TH1F *cdew1 = (TH1F *)hfile1->Get("h_sum0ADCAmplperLS3");
443  gPad->SetGridy();
444  gPad->SetGridx();
445  cdew1->SetZTitle("h_sum0ADCAmplperLS3 \b");
446  cdew1->Draw("");
447 
448  c1->cd(2);
449  TH1F *cdew2 = (TH1F *)hfile1->Get("h_sum0ADCAmplperLS4");
450  gPad->SetGridy();
451  gPad->SetGridx();
452  cdew2->SetZTitle("h_sum0ADCAmplperLS3 \b");
453  cdew2->Draw("");
454 
455  c1->cd(3);
456  TH1F *cdew3 = (TH1F *)hfile1->Get("h_sum0ADCAmplperLS5");
457  gPad->SetGridy();
458  gPad->SetGridx();
459  cdew3->SetZTitle("h_sum0ADCAmplperLS3 \b");
460  cdew3->Draw("");
461 
462  c1->cd(4);
463  TH1F *cdew4 = (TH1F *)hfile1->Get("h_sum0ADCAmplperLSdepth4HEu");
464  gPad->SetGridy();
465  gPad->SetGridx();
466  cdew4->SetZTitle("h_sum0ADCAmplperLS3 \b");
467  cdew4->Draw("");
468 
469  c1->cd(5);
470  TH1F *cdew5 = (TH1F *)hfile1->Get("h_sum0ADCAmplperLSdepth5HEu");
471  gPad->SetGridy();
472  gPad->SetGridx();
473  cdew5->SetZTitle("h_sum0ADCAmplperLS3 \b");
474  cdew5->Draw("");
475 
476  c1->cd(6);
477  TH1F *cdew6 = (TH1F *)hfile1->Get("h_sum0ADCAmplperLSdepth6HEu");
478  gPad->SetGridy();
479  gPad->SetGridx();
480  cdew6->SetZTitle("h_sum0ADCAmplperLS3 \b");
481  cdew6->Draw("");
482 
483  c1->cd(7);
484  TH1F *cdew7 = (TH1F *)hfile1->Get("h_sum0ADCAmplperLSdepth7HEu");
485  gPad->SetGridy();
486  gPad->SetGridx();
487  cdew7->SetZTitle("h_sum0ADCAmplperLS3 \b");
488  cdew7->Draw("");
489 
490  c1->Update();
491 
492  //======================================================================
493  //==================================================================================================== end
494  //======================================================================
495  //======================================================================
496  // close and delete all possible things:
497 
498  // psfile->Close();
499  psfile.Close();
500 
501  hfile1->Close();
502  // hfile1->Delete();
503  hfile1->Close();
504  // hfile1->Delete();
505 
506  // Exit Root
507  gSystem->Exit(0);
508  //======================================================================
509 }
cmsBatch.argv
argv
Definition: cmsBatch.py:279
dir2webdir.argc
argc
Definition: dir2webdir.py:39
alignmentValidation.c1
c1
do drawing
Definition: alignmentValidation.py:1025
std
Definition: JetResolutionObject.h:76
main
int main(int argc, char *argv[])
Definition: zadcampltest.cc:27