Changeset 8986 for trunk/MagicSoft
- Timestamp:
- 06/21/08 14:56:03 (16 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8985 r8986 19 19 -*-*- END OF LINE -*-*- 20 20 21 2008/06/10 Thomas Bretz 21 2008/06/21 Thomas Bretz 22 23 * callisto.cc, star.cc, ganymed.cc, sponde.cc: 24 - set the display name to a more convinient name 25 26 * datacenter/macros/plotdb.C: 27 - some improvement in setting axis titles and titles 28 automatically from the sql column names 29 - moved the Muon cut to a SetCondition call 30 - renamed some functions 31 32 * mbase/MStatusDisplay.h: 33 - overwrote SetTitle with a function allowing to set a title 34 only if no title set so far 35 36 * mjobs/MJCalibrateSignal.cc, mjobs/MJCalibration.cc, 37 mjobs/MJPedestal.cc: 38 - set a proper display title and set it only if not already set 39 40 * mjobs/MJPedestal.cc: 41 - changed some filter names to more convinient names 42 43 44 45 2008/06/20 Thomas Bretz 22 46 23 47 * macros/dohtml.C: -
trunk/MagicSoft/Mars/callisto.cc
r8904 r8986 360 360 // From now on each 'Exit' means: Terminate the application 361 361 d->SetBit(MStatusDisplay::kExitLoopOnExit); 362 d->SetTitle( kSequence);362 d->SetTitle(Form("-- Callisto: %s --", kSequence.Data())); 363 363 364 364 if (kModeC/* || kUseTest*/) -
trunk/MagicSoft/Mars/datacenter/macros/plotdb.C
r8965 r8986 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.4 5 2008-06-16 14:58:26tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.46 2008-06-21 13:53:33 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 133 133 // Create TGraph objects 134 134 TGraph > = res.GetFieldCount()>4 ? *new TGraphErrors : *new TGraph; 135 gt.SetNameTitle( name, Form("%s vs Time", name.Data()));135 gt.SetNameTitle(Form("%s_time", res.GetFieldName(2)), Form("%s vs %s", res.GetFieldName(2), res.GetFieldName(0))); 136 136 gt.SetMarkerStyle(kFullDotMedium); 137 137 138 138 TGraph gz; 139 gz.SetNameTitle( name, Form("%s vs <Zd>", name.Data()));139 gz.SetNameTitle(res.GetFieldName(2), Form("%s vs %s", res.GetFieldName(2), res.GetFieldName(1))); 140 140 gz.SetMarkerStyle(kFullDotMedium); 141 141 … … 257 257 cerr << endl; 258 258 259 // format axis 260 TH1 *h = gt.GetHistogram(); 261 262 const Double_t min = fHistMin>fHistMax ? h->GetMinimum()-resolution/2 : fHistMin; 263 const Double_t max = fHistMin>fHistMax ? h->GetMaximum()+resolution/2 : fHistMax; 264 265 // Create histogram 266 const Int_t n = resolution>0 ? TMath::Nint((max-min)/resolution) : 50; 267 268 TH1F hist("Hist", Form("Distribution of %s", fDescription.IsNull() ? name.Data() : fDescription.Data()), n, min, max); 269 hist.SetDirectory(0); 270 271 // Fill data into histogra, 272 for (int i=0; i<gt.GetN(); i++) 273 hist.Fill(gt.GetY()[i]); 274 275 // Format histogram 276 if (fDescription.IsNull()) 277 hist.SetXTitle(name); 278 hist.SetYTitle("Counts"); 279 259 280 TVirtualPad *pad = gPad; 260 281 … … 269 290 gPad->SetBottomMargin(0.08); 270 291 271 // format axis272 TH1 *h = gt.GetHistogram();273 274 292 h->SetXTitle("Time"); 275 h->SetYTitle( name);293 h->SetYTitle(hist.GetXaxis()->GetTitle()); 276 294 h->GetXaxis()->SetTimeDisplay(1); 277 295 h->GetYaxis()->SetTitleOffset(0.8); … … 312 330 gPad->SetGridx(); 313 331 314 const Double_t min = fHistMin>fHistMax ? h->GetMinimum()-resolution/2 : fHistMin;315 const Double_t max = fHistMin>fHistMax ? h->GetMaximum()+resolution/2 : fHistMax;316 317 // Use this to save the pad with the time development to a file318 //gPad->SaveAs(Form("plotdb-%s.eps", title.Data()));319 320 332 // Go back to first (upper) pad, format it and divide it again 321 333 pad->cd(1); … … 333 345 gPad->SetGridy(); 334 346 335 // Create histogram336 const Int_t n = resolution>0 ? TMath::Nint((max-min)/resolution) : 50;337 338 TH1F hist("Hist", Form("Distribution of %s", fDescription.IsNull() ? name.Data() : fDescription.Data()), n, min, max);339 hist.SetDirectory(0);340 341 // Fill data into histogra,342 for (int i=0; i<gt.GetN(); i++)343 hist.Fill(gt.GetY()[i]);344 345 // Format histogram346 if (fDescription.IsNull())347 hist.SetXTitle(name);348 hist.SetYTitle("Counts");349 350 347 // plot histogram 351 348 hist.DrawCopy(""); … … 357 354 gPad->SetGridy(); 358 355 359 // format graph360 TH1 *h2 = gz.GetHistogram();361 362 h2->SetXTitle("Zd");363 h2->SetYTitle(name);364 365 356 // draw graph 366 357 gROOT->SetSelectedPad(0); 358 gz.GetXaxis()->SetTitle(res.GetFieldName(1)); 359 gz.GetYaxis()->SetTitle(hist.GetXaxis()->GetTitle()); 367 360 gz.DrawClone("AP"); 368 361 … … 399 392 void SetCondition(const char *cond="") { fCondition = cond; } 400 393 void SetDescription(const char *d, const char *t=0) { fDescription = d; fNameTab = t; } 394 void SetTabName(const char *t) { fNameTab = t; } 401 395 void SetGroupBy(GroupBy_t b=kGroupByWeek) { fGroupBy=b; } 402 396 void SetPrimaryDate(const char *ts) { fPrimaryDate=ts; } 403 397 void SetPrimaryNumber(const char *ts) { fPrimaryNumber=ts; } 404 398 void SetSecondary(const char *ts) { fSecondary=ts; } 399 400 MStatusDisplay *GetDisplay() { return fDisplay; } 405 401 406 402 Bool_t Plot(const char *value, Float_t min=0, Float_t max=-1, Float_t resolution=0) … … 473 469 474 470 TString where(fCondition); 471 /* 475 472 if (!fDataSet && !interval && tablev=="Star") 476 473 { … … 479 476 where += "Star.fMuonNumber>300 "; 480 477 } 481 478 */ 482 479 if (interval) 483 480 { … … 496 493 query += "WHERE "; 497 494 query += where; 495 query += " "; 498 496 } 499 497 … … 504 502 } 505 503 query += Form("ORDER BY %s ", valued.Data()+1); 506 507 504 508 505 // ------------------------------ … … 526 523 }; 527 524 528 void plotall (MPlot &plot)525 void plotalldb(MPlot &plot) 529 526 { 530 527 //plot.SetGroupBy(MPlot::kGroupByNight); … … 532 529 plot.SetPrimaryDate("Sequences.fRunStart"); 533 530 plot.SetPrimaryNumber("Sequences.fSequenceFirst"); 534 plot.SetSecondary("(Sequences.fZenithDistanceMin+Sequences.fZenithDistanceMax)/2 ");531 plot.SetSecondary("(Sequences.fZenithDistanceMin+Sequences.fZenithDistanceMax)/2 as '<Zd>'"); 535 532 536 533 //inner camera … … 592 589 //plot.Plot("Calibration.fPulsePosVar", 0, 0.03, 0.001); 593 590 591 594 592 //from star*.root 595 593 //muon 594 plot.SetCondition("Star.fMuonNumber>300"); 596 595 plot.SetDescription("Point Spred Function;PSF [mm]"); 597 596 plot.Plot("Star.fPSF", 0, 30, 0.5); … … 600 599 plot.SetDescription("Muon Rate after Muon Cuts;R [Hz]"); 601 600 plot.Plot("Star.fMuonRate", 0, 2.0, 0.05); 601 plot.SetCondition(); 602 602 603 //quality 603 604 plot.SetDescription("Datarate [Hz]", "Rate"); … … 656 657 plot.SetDescription("RMS Arrival Time outer Camera;\\sigma_{T,O} [sl]", "RmsArrTmO"); 657 658 plot.Plot("Calibration.fArrTimeRmsOuter", 0, 4.5, 0.01); 658 plot.SetDescription("Number of unsuitable pixels outer Camera;N {O}", "UnsuitO");659 plot.SetDescription("Number of unsuitable pixels outer Camera;N_{O}", "UnsuitO"); 659 660 plot.Plot("Calibration.fUnsuitableOuter", 0, 25, 1); 660 661 //from signal*.root … … 690 691 plot.SetDisplay(d); 691 692 plot.SetRequestRange(from, to); 692 plotall (plot);693 plotalldb(plot); 693 694 d->SaveAsRoot("plotdb.root"); 694 695 d->SaveAsPS("plotdb.ps"); … … 722 723 plot.SetDisplay(d); 723 724 plot.SetRequestRange("", ""); 724 plotall (plot);725 plotalldb(plot); 725 726 d->SaveAsRoot("plotdb.root"); 726 727 d->SaveAsPS("plotdb.ps"); … … 754 755 plot.SetDisplay(d); 755 756 plot.SetRequestPeriod(period); 756 plotall (plot);757 plotalldb(plot); 757 758 d->SaveAsRoot("plotdb.root"); 758 759 d->SaveAsPS("plotdb.ps"); -
trunk/MagicSoft/Mars/ganymed.cc
r8767 r8986 267 267 // From now on each 'Exit' means: Terminate the application 268 268 d->SetBit(MStatusDisplay::kExitLoopOnExit); 269 d->SetTitle( kSequences);269 d->SetTitle(Form("-- Ganymed: %s --", kSequences.Data())); 270 270 271 271 // -
trunk/MagicSoft/Mars/mbase/MStatusDisplay.h
r8962 r8986 172 172 // Name and title handling 173 173 virtual void SetName(const char *name) { fName = name; } 174 virtual void SetTitle(const char *title="") { fTitle = title; }174 virtual void SetTitle(const char *title="") { SetTitle(title, kTRUE); } 175 175 virtual const char *GetName() const { return fName.Data(); } 176 176 virtual const char *GetTitle() const { return fTitle.Data(); } 177 178 virtual void SetTitle(const char *title, Bool_t replace) 179 { 180 if (fTitle.IsNull() || replace) fTitle = title; 181 } 177 182 178 183 // Getter / display access -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r8954 r8986 159 159 160 160 if (fDisplay) 161 { 162 TString title = "-- Calibrate Signal: "; 163 title += fSequence.GetSequence(); 164 title += " --"; 165 fDisplay->SetTitle(title, kFALSE); 166 161 167 cont.Add(fDisplay); 168 } 162 169 163 170 const TString name(Form("signal%08d.root", fSequence.GetSequence())); -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r8957 r8986 317 317 // Update display 318 318 // 319 TString title = fDisplay->GetTitle(); 320 title += "-- Calibration "; 321 title += Form("calib%08d", fSequence.GetSequence()); 319 TString title = "-- Calibration: "; 320 title += fSequence.GetSequence(); 322 321 title += " --"; 323 fDisplay->SetTitle(title );322 fDisplay->SetTitle(title, kFALSE); 324 323 325 324 // -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r8948 r8986 202 202 // Update display 203 203 // 204 TString title = fDisplay->GetTitle(); 205 title += "-- Pedestal "; 206 title += fSequence.GetFileName(); 204 TString title = "-- Pedestal: "; 205 title += fSequence.GetSequence(); 207 206 title += " --"; 208 fDisplay->SetTitle(title );207 fDisplay->SetTitle(title, kFALSE); 209 208 210 209 // 211 210 // Get container from list 212 211 // 213 MGeomCam &geomcam= *(MGeomCam*)plist.FindObject("MGeomCam");212 const MGeomCam &geomcam = *(MGeomCam*)plist.FindObject("MGeomCam"); 214 213 // MCalibrationPedCam &calpedcam = *(MCalibrationPedCam*)plist.FindObject("MCalibrationPedCam"); 215 214 … … 276 275 } 277 276 */ 278 277 279 278 if (fExtractionType!=kFundamental/*fExtractorResolution*/) 280 279 { … … 326 325 return; 327 326 } 328 327 329 328 /* 330 329 if (fIsUseHists) … … 362 361 TCanvas &c3 = fDisplay->AddTab(fExtractionType!=kFundamental/*fExtractorResolution*/ ? "PedExtrd" : "Ped"); 363 362 c3.Divide(2,3); 364 363 365 364 c3.cd(1); 366 365 gPad->SetBorderMode(0); … … 390 389 obj1->SetPrettyPalette(); 391 390 obj1->Draw(); 392 391 393 392 c3.cd(5); 394 393 gPad->SetBorderMode(0); … … 404 403 FixDataCheckHist(obj2); 405 404 obj2->SetStats(1); 406 405 407 406 c3.cd(2); 408 407 gPad->SetBorderMode(0); … … 422 421 // 423 422 DisplayReferenceLines(obj3,1); 424 423 425 424 c3.cd(4); 426 425 gPad->SetBorderMode(0); … … 430 429 c3.cd(6); 431 430 gPad->SetBorderMode(0); 432 431 433 432 if (geomcam.InheritsFrom("MGeomCamMagic")) 434 433 { … … 512 511 } 513 512 } 514 513 515 514 if (fExtractionType!=kFundamental/*fExtractorResolution*/) 516 515 { 517 516 518 517 TCanvas &c3 = fDisplay->AddTab(fExtractionType==kWithExtractor?"PedExtrd":"PedRndm"); 519 518 c3.Divide(2,3); … … 530 529 } 531 530 } 532 533 531 534 532 void MJPedestal::DisplayReferenceLines(MHCamera *cam, const Int_t what) const … … 1099 1097 // The selection is done with the trigger bits before prescaling 1100 1098 MTriggerPatternDecode decode; 1101 MFTriggerPattern fcalib(" CalibFilter");1099 MFTriggerPattern fcalib("SelectCosmics"); 1102 1100 fcalib.SetDefault(kTRUE); 1103 1101 fcalib.DenyAll(); … … 1116 1114 tlist.AddToList(&pedsub); 1117 1115 1116 // FIXME: MUX Monte Carlos?!?? 1118 1117 if (fIsPulsePosCheck) 1119 1118 { … … 1135 1134 //------------------------------ 1136 1135 // Require that before the Prescaling we had only a pedestal trigger 1137 MFTriggerPattern ftp2(" PedestalFilter");1136 MFTriggerPattern ftp2("SelectPedestals"); 1138 1137 ftp2.SetDefault(kTRUE); 1139 1138 ftp2.DenyAll(); 1140 1139 ftp2.RequirePedestal(); 1141 1140 1141 // FIXME: WHAT D WE DO IN CASE OF MUX MCs???? 1142 1142 if (!fSequence.IsMonteCarlo() && (!fExtractor || !fExtractor->HasLoGain())) 1143 1143 { -
trunk/MagicSoft/Mars/sponde.cc
r8882 r8986 231 231 // From now on each 'Exit' means: Terminate the application 232 232 d->SetBit(MStatusDisplay::kExitLoopOnExit); 233 d->SetTitle( kDataset);233 d->SetTitle(Form("-- Sponde: %s --", kDataset.Data())); 234 234 235 235 // -
trunk/MagicSoft/Mars/star.cc
r8904 r8986 230 230 // From now on each 'Exit' means: Terminate the application 231 231 d->SetBit(MStatusDisplay::kExitLoopOnExit); 232 d->SetTitle( kSequence);232 d->SetTitle(Form("-- Star: %s --", kSequence.Data())); 233 233 234 234 if (kDebugMem)
Note:
See TracChangeset
for help on using the changeset viewer.