Changeset 7494 for trunk/MagicSoft/Mars/datacenter/macros
- Timestamp:
- 02/10/06 13:28:31 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/macros/plotdb.C
r7493 r7494 52 52 // 53 53 // To draw sequences belonging to a DataSet in colors for highliting 54 // change the defintition of "MDataSet ds;"in the code to something55 // like "MDataSet ds("dataset.txt");"to load your favourite dataset.54 // change the defintition of 'const char *dataset=0;' in the code to something 55 // like 'const char *dataset="dataset.txt";' to load your favourite dataset. 56 56 // 57 57 ///////////////////////////////////////////////////////////////////////////// 58 58 #include <iostream> 59 #include <iomanip> 59 60 60 61 #include <TH1.h> … … 77 78 78 79 // Replace this line 79 MDataSet ds;80 const char *dataset=0; 80 81 // by 81 // MDataSet ds("/magic/datasets/00000/dataset00000003.txt");82 // const char *dataset = "/magic/datasets/00000/dataset00000003.txt"; 82 83 // to mark the sequences of your favourite dataset. 83 84 … … 86 87 private: 87 88 MSQLServer &fServer; 89 90 MDataSet *fDataSet; 88 91 89 92 TString fRequestFrom; … … 162 165 Float_t zenith = atof(zd); 163 166 164 if ( ds.HasOnSequence(seq))167 if (fDataSet) 165 168 { 166 gt1.SetPoint(gt1.GetN(), t.GetAxisTime(), value); 167 gz1.SetPoint(gz1.GetN(), zenith, value); 168 } 169 170 if (ds.HasOffSequence(seq)) 171 { 172 gt0.SetPoint(gt0.GetN(), t.GetAxisTime(), value); 173 gz0.SetPoint(gz0.GetN(), zenith, value); 169 if (fDataSet->HasOnSequence(seq)) 170 { 171 gt1.SetPoint(gt1.GetN(), t.GetAxisTime(), value); 172 gz1.SetPoint(gz1.GetN(), zenith, value); 173 } 174 175 if (fDataSet->HasOffSequence(seq)) 176 { 177 gt0.SetPoint(gt0.GetN(), t.GetAxisTime(), value); 178 gz0.SetPoint(gz0.GetN(), zenith, value); 179 } 174 180 } 175 181 … … 292 298 293 299 public: 294 MPlot(MSQLServer &server) : fServer(server), fRequestPeriod(-1), 295 fPlotMin(0), fPlotMax(-1), fHistMin(0), fHistMax(-1) 296 { 300 MPlot(MSQLServer &server) : fDataSet(NULL), fServer(server), 301 fRequestPeriod(-1), fPlotMin(0), fPlotMax(-1), fHistMin(0), fHistMax(-1) 302 { 303 } 304 ~MPlot() 305 { 306 if (fDataSet) 307 delete fDataSet; 308 } 309 void SetDataSet(const TString filename) 310 { 311 if (fDataSet) 312 { 313 delete fDataSet; 314 fDataSet = NULL; 315 } 316 if (!filename.IsNull()) 317 fDataSet = new MDataSet(filename); 297 318 } 298 319 void SetPlotRange(Float_t min, Float_t max, Int_t n=5) … … 433 454 434 455 MPlot plot(serv); 456 plot.SetDataSet(dataset); 435 457 plot.SetDisplay(d); 436 458 plot.SetRequestRange(from, to); … … 464 486 465 487 MPlot plot(serv); 488 plot.SetDataSet(dataset); 466 489 plot.SetDisplay(d); 467 490 plot.SetRequestPeriod(period);
Note:
See TracChangeset
for help on using the changeset viewer.