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, 05/2005 <mailto:tbretz@astro.uni-wuerzburg.de>
|
---|
19 | ! Author(s): Daniela Dorner, 05/2005 <mailto:dorner@astro.uni-wuerzburg.de>
|
---|
20 | !
|
---|
21 | ! Copyright: MAGIC Software Development, 2000-2006
|
---|
22 | !
|
---|
23 | !
|
---|
24 | \* ======================================================================== */
|
---|
25 |
|
---|
26 | /////////////////////////////////////////////////////////////////////////////
|
---|
27 | //
|
---|
28 | // plotdb.C
|
---|
29 | // ========
|
---|
30 | //
|
---|
31 | // This macro is used to read quality parameters from the DB and plot them.
|
---|
32 | //
|
---|
33 | // The parameters are from the following files:
|
---|
34 | // calib*.root:mean conversion factor, mean arrival time, rms arrival time
|
---|
35 | // (each parameter for inner and outer camera)
|
---|
36 | // signal*.root: mean pedestal rms (for inner and outer camera)
|
---|
37 | // star*.root: PSF, # of Muons, Effective OnTime, Muon rate,
|
---|
38 | // Ratio MC/Data(MuonSize) and mean number of islands
|
---|
39 | //
|
---|
40 | // In the DB these values are stored in the tables Calibration and Star.
|
---|
41 | //
|
---|
42 | // Usage:
|
---|
43 | // .x plotdb.C --> all values in the DB are plotted
|
---|
44 | // You can chose are certain period:
|
---|
45 | // .x plotdb.C(25) --> all values from period 25 are plotted
|
---|
46 | // or a time period from a certain date to a certain date
|
---|
47 | // .x plotdb.C("2004-11-14 00:00:00", "2005-02-28 00:00:00")
|
---|
48 | // --> all values from 14.11.2004 0h to 28.2.2005 0h are plotted
|
---|
49 | // or all data, but with dataset data highlighted
|
---|
50 | // .x plotdb.C("dataset.txt")
|
---|
51 | // --> the sequences defined in dataset.txt aree highlighted (blue:on, red:off)
|
---|
52 | //
|
---|
53 | // Make sure, that database and password are corretly set in a resource
|
---|
54 | // file called sql.rc and the resource file is found.
|
---|
55 | //
|
---|
56 | // To draw sequences belonging to a DataSet in colors for highliting
|
---|
57 | // change the defintition of 'const char *dataset=0;' in the code to something
|
---|
58 | // like 'const char *dataset="dataset.txt";' to load your favourite dataset.
|
---|
59 | //
|
---|
60 | /////////////////////////////////////////////////////////////////////////////
|
---|
61 | #include <iostream>
|
---|
62 | #include <iomanip>
|
---|
63 |
|
---|
64 | #include <TH1.h>
|
---|
65 | #include <TEnv.h>
|
---|
66 | #include <TPad.h>
|
---|
67 | #include <TLine.h>
|
---|
68 | #include <TText.h>
|
---|
69 | #include <TFrame.h>
|
---|
70 | #include <TStyle.h>
|
---|
71 | #include <TGraph.h>
|
---|
72 | #include <TCanvas.h>
|
---|
73 | #include <TSQLRow.h>
|
---|
74 | #include <TSQLResult.h>
|
---|
75 |
|
---|
76 | #include "MTime.h"
|
---|
77 | #include "MAstro.h"
|
---|
78 | #include "MDataSet.h"
|
---|
79 | #include "MSQLServer.h"
|
---|
80 | #include "MStatusDisplay.h"
|
---|
81 |
|
---|
82 | // Replace this line
|
---|
83 | const char *dataset=0;
|
---|
84 | // by
|
---|
85 | // const char *dataset = "/magic/datasets/00000/dataset00000003.txt";
|
---|
86 | // to mark the sequences of your favourite dataset.
|
---|
87 |
|
---|
88 | class MPlot : public MParContainer
|
---|
89 | {
|
---|
90 | private:
|
---|
91 | MSQLServer &fServer;
|
---|
92 |
|
---|
93 | MDataSet *fDataSet;
|
---|
94 |
|
---|
95 | TString fRequestFrom;
|
---|
96 | TString fRequestTo;
|
---|
97 | Int_t fRequestPeriod;
|
---|
98 |
|
---|
99 | Float_t fPlotMin;
|
---|
100 | Float_t fPlotMax;
|
---|
101 |
|
---|
102 | Float_t fHistMin;
|
---|
103 | Float_t fHistMax;
|
---|
104 |
|
---|
105 | TString fDescription;
|
---|
106 | TString fNameTab;
|
---|
107 |
|
---|
108 | void PlotTable(TSQLResult &res, TString name, Float_t fmin, Float_t fmax, Float_t resolution)
|
---|
109 | {
|
---|
110 | gStyle->SetOptStat(111111);
|
---|
111 |
|
---|
112 | TSQLRow *row;
|
---|
113 |
|
---|
114 | TGraph gt;
|
---|
115 | gt.SetNameTitle(name, Form("%s vs Time", name.Data()));
|
---|
116 | gt.SetMarkerStyle(kFullDotMedium);
|
---|
117 |
|
---|
118 | TGraph gz;
|
---|
119 | gz.SetNameTitle(name, Form("%s vs <Zd>", name.Data()));
|
---|
120 | gz.SetMarkerStyle(kFullDotMedium);
|
---|
121 |
|
---|
122 | TGraph gt0, gt1;
|
---|
123 | gt0.SetMarkerColor(kRed);
|
---|
124 | gt1.SetMarkerColor(kBlue);
|
---|
125 | gt0.SetMarkerStyle(kFullDotLarge);
|
---|
126 | gt1.SetMarkerStyle(kFullDotLarge);
|
---|
127 |
|
---|
128 | TGraph gz0, gz1;
|
---|
129 | gz0.SetMarkerColor(kRed);
|
---|
130 | gz1.SetMarkerColor(kBlue);
|
---|
131 | gz0.SetMarkerStyle(kFullDotLarge);
|
---|
132 | gz1.SetMarkerStyle(kFullDotLarge);
|
---|
133 |
|
---|
134 | if (fmax>fmin)
|
---|
135 | {
|
---|
136 | gt.SetMinimum(fmin);
|
---|
137 | gt.SetMaximum(fmax);
|
---|
138 | gz.SetMinimum(fmin);
|
---|
139 | gz.SetMaximum(fmax);
|
---|
140 | }
|
---|
141 |
|
---|
142 | Int_t first = -1;
|
---|
143 | Int_t last = -1;
|
---|
144 |
|
---|
145 | while ((row=res.Next()))
|
---|
146 | {
|
---|
147 | const char *date = (*row)[0];
|
---|
148 | const char *zd = (*row)[1];
|
---|
149 | const char *val = (*row)[2];
|
---|
150 | const char *snum = (*row)[3];
|
---|
151 | if (!date || !val || !zd || !snum)
|
---|
152 | continue;
|
---|
153 |
|
---|
154 | MTime t(date);
|
---|
155 | if (!t.SetSqlDateTime(date))
|
---|
156 | continue;
|
---|
157 |
|
---|
158 | if (fRequestPeriod>0 && MAstro::GetMagicPeriod(t.GetMjd())!=fRequestPeriod)
|
---|
159 | continue;
|
---|
160 |
|
---|
161 | if (first<0)
|
---|
162 | first = TMath::Nint(TMath::Floor(t.GetMjd()));
|
---|
163 | last = TMath::Nint(TMath::Ceil(t.GetMjd()));
|
---|
164 |
|
---|
165 | UInt_t seq = atoi(snum);
|
---|
166 |
|
---|
167 | Float_t value = atof(val);
|
---|
168 | Float_t zenith = atof(zd);
|
---|
169 |
|
---|
170 | if (fDataSet)
|
---|
171 | {
|
---|
172 | if (fDataSet->HasOnSequence(seq))
|
---|
173 | {
|
---|
174 | gt1.SetPoint(gt1.GetN(), t.GetAxisTime(), value);
|
---|
175 | gz1.SetPoint(gz1.GetN(), zenith, value);
|
---|
176 | }
|
---|
177 |
|
---|
178 | if (fDataSet->HasOffSequence(seq))
|
---|
179 | {
|
---|
180 | gt0.SetPoint(gt0.GetN(), t.GetAxisTime(), value);
|
---|
181 | gz0.SetPoint(gz0.GetN(), zenith, value);
|
---|
182 | }
|
---|
183 | }
|
---|
184 |
|
---|
185 | gt.SetPoint(gt.GetN(), t.GetAxisTime(), value);
|
---|
186 | gz.SetPoint(gz.GetN(), zenith, value);
|
---|
187 | }
|
---|
188 |
|
---|
189 | gROOT->SetSelectedPad(0);
|
---|
190 |
|
---|
191 | TString title = fNameTab.IsNull() ? name(name.First('.')+2, name.Length()) : fNameTab;
|
---|
192 | TCanvas &c = fDisplay ? fDisplay->AddTab(title) : *new TCanvas;
|
---|
193 | c.SetFillColor(kWhite);
|
---|
194 | c.SetBorderMode(0);
|
---|
195 | c.Divide(1,2);
|
---|
196 |
|
---|
197 | cerr << setprecision(4) << setw(10) << title << ": ";
|
---|
198 | cerr << setw(8) << gt.GetMean(2) << "+-" << setw(8) << gt.GetRMS(2) << " ";
|
---|
199 | if (gt0.GetN()>0 || gt1.GetN()>0)
|
---|
200 | {
|
---|
201 | cerr << setw(8) << gt1.GetMean(2) << "+-" << setw(8) << gt1.GetRMS(2) << " ";
|
---|
202 | cerr << setw(8) << gt0.GetMean(2) << "+-" << setw(8) << gt0.GetRMS(2);
|
---|
203 | }
|
---|
204 | cerr << endl;
|
---|
205 |
|
---|
206 | TVirtualPad *pad = gPad;
|
---|
207 | pad->cd(2);
|
---|
208 | gPad->SetBorderMode(0);
|
---|
209 | gPad->SetFrameBorderMode(0);
|
---|
210 | gPad->SetGridy();
|
---|
211 |
|
---|
212 | gPad->SetLeftMargin(0.06);
|
---|
213 | gPad->SetRightMargin(0.06);
|
---|
214 | gPad->SetBottomMargin(0.08);
|
---|
215 |
|
---|
216 | TH1 *h = gt.GetHistogram();
|
---|
217 |
|
---|
218 | h->SetXTitle("Time");
|
---|
219 | h->SetYTitle(name);
|
---|
220 | h->GetXaxis()->SetTimeDisplay(1);
|
---|
221 | h->GetYaxis()->SetTitleOffset(0.8);
|
---|
222 | h->GetXaxis()->SetTitleOffset(1.0);
|
---|
223 | h->GetXaxis()->SetLabelOffset(0.01);
|
---|
224 |
|
---|
225 | gt.DrawClone("AP");
|
---|
226 | if (gt0.GetN()>0)
|
---|
227 | gt0.DrawClone("P");
|
---|
228 | if (gt1.GetN()>0)
|
---|
229 | gt1.DrawClone("P");
|
---|
230 |
|
---|
231 | TLine l;
|
---|
232 | TText t;
|
---|
233 | Int_t num=0;
|
---|
234 | l.SetLineStyle(kDotted);
|
---|
235 | l.SetLineColor(kBlue);
|
---|
236 | t.SetTextColor(kBlue);
|
---|
237 | l.SetLineWidth(1);
|
---|
238 | t.SetTextSize(h->GetXaxis()->GetLabelSize());
|
---|
239 | t.SetTextAlign(21);
|
---|
240 | Int_t p0 = MAstro::GetMagicPeriod(first);
|
---|
241 | for (Int_t p = first; p<last; p++)
|
---|
242 | {
|
---|
243 | Int_t p1 = MAstro::GetMagicPeriod(p);
|
---|
244 | if (p1!=p0)
|
---|
245 | {
|
---|
246 | l.DrawLine(MTime(p).GetAxisTime(), h->GetMinimum(), MTime(p).GetAxisTime(), h->GetMaximum());
|
---|
247 | t.DrawText(MTime(p+15).GetAxisTime(), h->GetMaximum(), Form("%d", p1));
|
---|
248 | num++;
|
---|
249 | }
|
---|
250 | p0 = p1;
|
---|
251 | }
|
---|
252 | if (num<4)
|
---|
253 | gPad->SetGridx();
|
---|
254 |
|
---|
255 | const Double_t min = fHistMin>fHistMax ? h->GetMinimum()-resolution/2 : fHistMin;
|
---|
256 | const Double_t max = fHistMin>fHistMax ? h->GetMaximum()+resolution/2 : fHistMax;
|
---|
257 |
|
---|
258 | // Use this to save the pad with the time development to a file
|
---|
259 | //gPad->SaveAs(Form("plotdb-%s.eps", title.Data()));
|
---|
260 |
|
---|
261 | pad->cd(1);
|
---|
262 | gPad->SetBorderMode(0);
|
---|
263 | gPad->SetFrameBorderMode(0);
|
---|
264 | gPad->Divide(2,1);
|
---|
265 |
|
---|
266 | TVirtualPad *pad2 = gPad;
|
---|
267 | pad2->cd(1);
|
---|
268 | gPad->SetBorderMode(0);
|
---|
269 | gPad->SetFrameBorderMode(0);
|
---|
270 | gPad->SetGridx();
|
---|
271 | gPad->SetGridy();
|
---|
272 |
|
---|
273 | const Int_t n = resolution>0 ? TMath::Nint((max-min)/resolution) : 50;
|
---|
274 |
|
---|
275 | TH1F hist("Hist", Form("Distribution of %s", fDescription.IsNull() ? name.Data() : fDescription.Data()), n, min, max);
|
---|
276 | hist.SetDirectory(0);
|
---|
277 |
|
---|
278 | for (int i=0; i<gt.GetN(); i++)
|
---|
279 | hist.Fill(gt.GetY()[i]);
|
---|
280 |
|
---|
281 | if (fDescription.IsNull())
|
---|
282 | hist.SetXTitle(name);
|
---|
283 | hist.SetYTitle("Counts");
|
---|
284 |
|
---|
285 | hist.DrawCopy("");
|
---|
286 |
|
---|
287 | pad2->cd(2);
|
---|
288 | gPad->SetBorderMode(0);
|
---|
289 | gPad->SetFrameBorderMode(0);
|
---|
290 | gPad->SetGridy();
|
---|
291 |
|
---|
292 | TH1 *h2 = gz.GetHistogram();
|
---|
293 |
|
---|
294 | h2->SetXTitle("Zd");
|
---|
295 | h2->SetYTitle(name);
|
---|
296 |
|
---|
297 | gz.DrawClone("AP");
|
---|
298 | if (gz0.GetN()>0)
|
---|
299 | gz0.DrawClone("P");
|
---|
300 | if (gz1.GetN()>0)
|
---|
301 | gz1.DrawClone("P");
|
---|
302 | }
|
---|
303 |
|
---|
304 | public:
|
---|
305 | MPlot(MSQLServer &server) : fServer(server), fDataSet(NULL),
|
---|
306 | fRequestPeriod(-1), fPlotMin(0), fPlotMax(-1), fHistMin(0), fHistMax(-1)
|
---|
307 | {
|
---|
308 | }
|
---|
309 | ~MPlot()
|
---|
310 | {
|
---|
311 | if (fDataSet)
|
---|
312 | delete fDataSet;
|
---|
313 | }
|
---|
314 | void SetDataSet(const TString filename)
|
---|
315 | {
|
---|
316 | if (fDataSet)
|
---|
317 | {
|
---|
318 | delete fDataSet;
|
---|
319 | fDataSet = NULL;
|
---|
320 | }
|
---|
321 | if (!filename.IsNull())
|
---|
322 | fDataSet = new MDataSet(filename);
|
---|
323 | }
|
---|
324 | void SetPlotRange(Float_t min, Float_t max, Int_t n=5)
|
---|
325 | { fPlotMin = min; fPlotMax = max; }
|
---|
326 | void SetHistRange(Float_t min, Float_t max)
|
---|
327 | { fHistMin = min; fHistMax = max; }
|
---|
328 | void SetRequestRange(const char *from="", const char *to="")
|
---|
329 | { fRequestFrom = from; fRequestTo = to; }
|
---|
330 | void SetRequestPeriod(Int_t n=-1)
|
---|
331 | { fRequestPeriod = n; }
|
---|
332 | void SetDescription(const char *d, const char *t=0) { fDescription = d; fNameTab = t; }
|
---|
333 |
|
---|
334 | Bool_t Plot(const char *value, Float_t min=0, Float_t max=-1, Float_t resolution=0)
|
---|
335 | {
|
---|
336 | TString named = "Sequences.fRunStart";
|
---|
337 | TString named2 = "(Sequences.fZenithDistanceMin+Sequences.fZenithDistanceMax)/2";
|
---|
338 | TString namev = value;
|
---|
339 | TString join = "fSequenceFirst";
|
---|
340 |
|
---|
341 | TString tablev = namev(0, namev.First('.'));
|
---|
342 | TString valuev = namev(namev.First('.')+1, namev.Length());
|
---|
343 |
|
---|
344 | TString tabled = named(0, named.First('.'));
|
---|
345 | TString valued = named(named.First('.')+1, named.Length());
|
---|
346 |
|
---|
347 | TString query;
|
---|
348 | query = Form("select %s, %s, %s, Sequences.fSequenceFirst ", valued.Data(), named2.Data(), valuev.Data());
|
---|
349 | query += Form("from %s left join %s ", tabled.Data(), tablev.Data());
|
---|
350 | query += Form("on %s.%s=%s.%s ", tabled.Data(), join.Data(), tablev.Data(), join.Data());
|
---|
351 |
|
---|
352 | if (!fRequestFrom.IsNull() && !fRequestTo.IsNull())
|
---|
353 | query += Form("where fRunStart between '%s' and '%s' ",
|
---|
354 | fRequestFrom.Data(), fRequestTo.Data());
|
---|
355 |
|
---|
356 | query += "order by fRunStart";
|
---|
357 |
|
---|
358 | //cout << "q: " << query << endl;
|
---|
359 |
|
---|
360 | TSQLResult *res = fServer.Query(query);
|
---|
361 | if (!res)
|
---|
362 | {
|
---|
363 | cout << "ERROR - Query failed: " << query << endl;
|
---|
364 | return kFALSE;
|
---|
365 | }
|
---|
366 |
|
---|
367 | if (max>min)
|
---|
368 | PlotTable(*res, namev, min, max, resolution);
|
---|
369 | else
|
---|
370 | PlotTable(*res, namev, fPlotMin, fPlotMax, resolution);
|
---|
371 |
|
---|
372 |
|
---|
373 | delete res;
|
---|
374 | return kTRUE;
|
---|
375 | }
|
---|
376 | };
|
---|
377 |
|
---|
378 | void plotall(MPlot &plot)
|
---|
379 | {
|
---|
380 | //inner camera
|
---|
381 | //from calib*.root
|
---|
382 | plot.SetDescription("Conversion Factor inner Camera;C_{I} [phe/fadc cnts]", "ConvI");
|
---|
383 | plot.Plot("Calibration.fConvFactorInner", 0, 0.5, 0.001);
|
---|
384 | plot.SetDescription("Mean Arrival Time inner Camera;T_{I} [sl]", "ArrTmI");
|
---|
385 | plot.Plot("Calibration.fArrTimeMeanInner", 0, 9.0, 0.1);
|
---|
386 | plot.SetDescription("RMS Arrival Time inner Camera;\\sigma_{T,I} [sl]", "RmsArrTmI");
|
---|
387 | plot.Plot("Calibration.fArrTimeRmsInner", 0, 2.5, 0.1);
|
---|
388 | //from signal*.root
|
---|
389 | plot.SetDescription("Mean Pedestal RMS inner Camera;\\sigma_{P,I} [phe]", "PedRmsI");
|
---|
390 | plot.Plot("Calibration.fMeanPedRmsInner", 0, 3.5, 0.05);
|
---|
391 | plot.SetDescription("Mean Signal inner Camera;S_{I} [phe]", "SignalI");
|
---|
392 | plot.Plot("Calibration.fMeanSignalInner", 0, 7.0, 0.05);
|
---|
393 | plot.SetDescription("Mean PulsePosCheck (falling edge) inner camera;T [sl]", "ChkPos");
|
---|
394 | plot.Plot("Calibration.fPulsePosCheckMean", 1, 15.0, 0.1);
|
---|
395 | plot.SetDescription("Rms PulsePosCheck (falling edge) inner camera;T [sl]", "ChkRms");
|
---|
396 | plot.Plot("Calibration.fPulsePosCheckRms", 0, 5.0, 0.1);
|
---|
397 | plot.SetDescription("Mean calibrated PulsePos;T", "PulPos");
|
---|
398 | plot.Plot("Calibration.fPulsePosMean", 1, 15.0, 0.1);
|
---|
399 | plot.SetDescription("Rms calibrated PulsePos;T", "PulRms");
|
---|
400 | plot.Plot("Calibration.fPulsePosRms", 0, 2.0, 0.1);
|
---|
401 | //from star*.root
|
---|
402 | //muon
|
---|
403 | plot.SetDescription("Point Spred Function;PSF [mm]");
|
---|
404 | plot.Plot("Star.fPSF", 0, 40, 0.5);
|
---|
405 | plot.SetDescription("Muon Calibration Ratio Data/MC;r [1]", "MuonCal");
|
---|
406 | plot.Plot("Star.fRatio", 0, 200, 0.5);
|
---|
407 | plot.SetDescription("Muon Rate after Muon Cuts;R [Hz]");
|
---|
408 | plot.Plot("Star.fMuonRate", 0, 2.0, 0.05);
|
---|
409 | //quality
|
---|
410 | plot.SetDescription("Camera Inhomogeneity;\\sigma [%]", "Inhom");
|
---|
411 | plot.Plot("Star.fInhomogeneity", 0, 100, 1);
|
---|
412 | //imgpar
|
---|
413 | plot.SetDescription("Mean Number of Islands after cleaning;N [#]", "NumIsl");
|
---|
414 | plot.Plot("Star.fMeanNumberIslands", 0.5, 4.5, 0.01);
|
---|
415 | plot.SetDescription("Measures effective on time;T_{eff} [s]", "EffOn");
|
---|
416 | plot.Plot("Star.fEffOnTime", 0, 10000, 150);
|
---|
417 | plot.SetDescription("Datarate [Hz]", "Rate");
|
---|
418 | plot.Plot("Star.fDataRate", 0, 600, 10);
|
---|
419 | plot.SetDescription("Maximum Humidity [%]", "Hum");
|
---|
420 | plot.Plot("Star.fMaxHumidity", 0, 100, 1);
|
---|
421 | //muon
|
---|
422 | plot.SetDescription("Number of Muons after Muon Cuts;N [#]");
|
---|
423 | plot.Plot("Star.fMuonNumber", 0, 10000, 100);
|
---|
424 | //outer camera
|
---|
425 | //from calib*.root
|
---|
426 | plot.SetDescription("Conversion Factor outer Camera;C_{O} [phe/fadc cnts]", "ConvO");
|
---|
427 | plot.Plot("Calibration.fConvFactorOuter", 0, 2.0, 0.01);
|
---|
428 | plot.SetDescription("Mean Arrival Time outer Camera;T_{O} [sl]", "ArrTmO");
|
---|
429 | plot.Plot("Calibration.fArrTimeMeanOuter", 0, 8.5, 0.1);
|
---|
430 | plot.SetDescription("RMS Arrival Time outer Camera;\\sigma_{T,O} [sl]", "RmsArrTmO");
|
---|
431 | plot.Plot("Calibration.fArrTimeRmsOuter", 0, 2.5, 0.1);
|
---|
432 | //from signal*.root
|
---|
433 | plot.SetDescription("Mean Pedestal RMS outer Camera;\\sigma_{P,O} [phe]", "PedRmsO");
|
---|
434 | plot.Plot("Calibration.fMeanPedRmsOuter", 0, 4.0, 0.05);
|
---|
435 | plot.SetDescription("Mean Signal outer Camera;S_{O} [phe]", "SignalO");
|
---|
436 | plot.Plot("Calibration.fMeanSignalOuter", 0, 4.0, 0.05);
|
---|
437 | }
|
---|
438 |
|
---|
439 | int plotdb(TString from, TString to)
|
---|
440 | {
|
---|
441 | TEnv env("sql.rc");
|
---|
442 |
|
---|
443 | MSQLServer serv(env);
|
---|
444 | if (!serv.IsConnected())
|
---|
445 | {
|
---|
446 | cout << "ERROR - Connection to database failed." << endl;
|
---|
447 | return 0;
|
---|
448 | }
|
---|
449 |
|
---|
450 | cout << "plotdb" << endl;
|
---|
451 | cout << "------" << endl;
|
---|
452 | cout << endl;
|
---|
453 | cout << "Connected to " << serv.GetName() << endl;
|
---|
454 | cout << endl;
|
---|
455 |
|
---|
456 | MStatusDisplay *d = new MStatusDisplay;
|
---|
457 | d->SetWindowName(serv.GetName());
|
---|
458 | d->SetTitle(serv.GetName());
|
---|
459 |
|
---|
460 | MPlot plot(serv);
|
---|
461 | plot.SetDataSet(dataset);
|
---|
462 | plot.SetDisplay(d);
|
---|
463 | plot.SetRequestRange(from, to);
|
---|
464 | plotall(plot);
|
---|
465 | d->SaveAsRoot("plotdb.root");
|
---|
466 | d->SaveAsPS("plotdb.ps");
|
---|
467 |
|
---|
468 | return 1;
|
---|
469 | }
|
---|
470 |
|
---|
471 | int plotdb(const char *ds)
|
---|
472 | {
|
---|
473 | TEnv env("sql.rc");
|
---|
474 |
|
---|
475 | MSQLServer serv(env);
|
---|
476 | if (!serv.IsConnected())
|
---|
477 | {
|
---|
478 | cout << "ERROR - Connection to database failed." << endl;
|
---|
479 | return 0;
|
---|
480 | }
|
---|
481 |
|
---|
482 | cout << "plotdb" << endl;
|
---|
483 | cout << "------" << endl;
|
---|
484 | cout << endl;
|
---|
485 | cout << "Connected to " << serv.GetName() << endl;
|
---|
486 | cout << endl;
|
---|
487 |
|
---|
488 | MStatusDisplay *d = new MStatusDisplay;
|
---|
489 | d->SetWindowName(serv.GetName());
|
---|
490 | d->SetTitle(serv.GetName());
|
---|
491 |
|
---|
492 | MPlot plot(serv);
|
---|
493 | plot.SetDataSet(ds);
|
---|
494 | plot.SetDisplay(d);
|
---|
495 | plot.SetRequestRange("", "");
|
---|
496 | plotall(plot);
|
---|
497 | d->SaveAsRoot("plotdb.root");
|
---|
498 | d->SaveAsPS("plotdb.ps");
|
---|
499 |
|
---|
500 | return 1;
|
---|
501 | }
|
---|
502 |
|
---|
503 | int plotdb(Int_t period)
|
---|
504 | {
|
---|
505 | TEnv env("sql.rc");
|
---|
506 |
|
---|
507 | MSQLServer serv(env);
|
---|
508 | if (!serv.IsConnected())
|
---|
509 | {
|
---|
510 | cout << "ERROR - Connection to database failed." << endl;
|
---|
511 | return 0;
|
---|
512 | }
|
---|
513 |
|
---|
514 | cout << "plotdb" << endl;
|
---|
515 | cout << "------" << endl;
|
---|
516 | cout << endl;
|
---|
517 | cout << "Connected to " << serv.GetName() << endl;
|
---|
518 | cout << endl;
|
---|
519 |
|
---|
520 | MStatusDisplay *d = new MStatusDisplay;
|
---|
521 | d->SetWindowName(serv.GetName());
|
---|
522 | d->SetTitle(serv.GetName());
|
---|
523 |
|
---|
524 | MPlot plot(serv);
|
---|
525 | plot.SetDataSet(dataset);
|
---|
526 | plot.SetDisplay(d);
|
---|
527 | plot.SetRequestPeriod(period);
|
---|
528 | plotall(plot);
|
---|
529 | d->SaveAsRoot("plotdb.root");
|
---|
530 | d->SaveAsPS("plotdb.ps");
|
---|
531 |
|
---|
532 | return 1;
|
---|
533 | }
|
---|
534 |
|
---|
535 | int plotdb()
|
---|
536 | {
|
---|
537 | return plotdb("", "");
|
---|
538 | }
|
---|