source: branches/Mars_use_drstimefiles/macros/plot/mucal.C@ 18066

Last change on this file since 18066 was 7544, checked in by tbretz, 19 years ago
*** empty log message ***
File size: 2.7 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Thomas Bretz, 02/2006 <mailto:tbretz@astro.uni-wuerzburg.de>
19!
20! Copyright: MAGIC Software Development, 2006
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26//
27// mucal.C
28// =======
29//
30// Use this macro to plot the calibration correction factors versus period.
31//
32/////////////////////////////////////////////////////////////////////////////
33void mucal()
34{
35 TEnv env("resources/calibration.rc");
36
37 TGraph g;
38 for (int i=0; i<100; i++)
39 {
40 TString s;
41 s += i;
42
43 Double_t f = env.GetValue(s, -1.0);
44 if (f>0)
45 g.SetPoint(g.GetN(), i, f);
46 }
47
48 TH1 *h = g.GetHistogram();
49 TAxis *axex = h->GetXaxis();
50 TAxis *axey = h->GetYaxis();
51
52 h->SetXTitle("Observation Period");
53 h->SetYTitle("Calibration correction factor (S_{D}/S_{MC})");
54 axey->CenterTitle();
55 axex->CenterTitle();
56
57 axey->SetLabelSize(0.06);
58 axey->SetTitleSize(0.05);
59 axex->SetLabelSize(0.06);
60 axex->SetTitleSize(0.06);
61 axey->SetTitleOffset(0.65);
62
63 g.SetMarkerStyle(kFullDotLarge);
64
65 TCanvas *c1 = new TCanvas;
66 c1->Divide(1,2);
67 c1->cd(1);
68
69 gPad->SetGridx();
70 gPad->SetGridy();
71
72 gPad->SetTopMargin(0.01);
73 gPad->SetRightMargin(0.01);
74 gPad->SetLeftMargin(0.07);
75 gPad->SetBottomMargin(0.13);
76
77 gPad->SetBorderMode(0);
78 gPad->SetFrameBorderMode(0);
79 gPad->SetFillColor(kWhite);
80
81 Double_t min = 0.71;
82 Double_t max = 1.29;
83
84 g.SetMinimum(min);
85 g.SetMaximum(max);
86 g.DrawClone("AP");
87
88 TLine l;
89 l.SetLineStyle(kDashed);
90 l.SetLineWidth(1);
91 l.DrawLine(axex->GetXmin(), 1, axex->GetXmax(), 1);
92
93 l.SetLineColor(kBlue);
94 l.SetLineStyle(kDashed);
95 for (int i=2000; i<2020; i++)
96 {
97 Double_t period = MAstro::GetMagicNewYear(i);
98 if (period>axex->GetXmin() && period<axex->GetXmax())
99 l.DrawLine(period, min, period, max);
100 }
101}
Note: See TracBrowser for help on using the repository browser.