- Timestamp:
- 03/11/04 15:25:44 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3470 r3471 19 19 -*-*- END OF LINE -*-*- 20 20 21 2004/03/11: Thomas Bretz 22 23 * status.cc: 24 - updated 25 26 * manalysis/MCerPhotAnal2.cc: 27 - removed an obsolete debug output 28 29 * mhist/MHCamera.[h,cc]: 30 - added same-option to camera display 31 32 33 21 34 2004/03/11: Markus Gaug 22 35 … … 26 39 * mbadpixels/MBadPixelsCam.cc 27 40 - updated GetPixelContent 41 28 42 29 43 … … 42 56 in which high gain saturates. Added getter funciton for it. 43 57 Updated class version to 3. 58 44 59 45 60 … … 67 82 - replaced one SetUnsuitableRun(....) by the new version without 68 83 argument. 84 69 85 70 86 -
trunk/MagicSoft/Mars/manalysis/MCerPhotAnal2.cc
r3389 r3471 120 120 else 121 121 { 122 *fLog << all << "CHECK: " << runheader->GetRunType() << endl;123 122 if (runheader->IsMonteCarloRun()) 124 123 return kTRUE; -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r3400 r3471 188 188 Int_t MHCamera::Fill(Axis_t x) 189 189 { 190 191 190 #if ROOT_VERSION_CODE > ROOT_VERSION(3,05,00) 192 191 if (fBuffer) return BufferFill(x,1); … … 397 396 // GeMinimum() ((val-min)/(max-min)) 398 397 // 'proj' Display the y-projection of the histogram 398 // 'same' Draw trandparent pixels on top of an existing pad. This 399 // makes it possible to draw the camera image on top of an 400 // existing TH2, but also allows for distorted camera images 399 401 // 400 402 void MHCamera::Draw(Option_t *option) 401 403 { 404 const Bool_t hassame = TString(option).Contains("same", TString::kIgnoreCase) && gPad; 405 402 406 // root 3.02: 403 407 // gPad->SetFixedAspectRatio() 404 408 const Color_t col = gPad ? gPad->GetFillColor() : 16; 405 409 TVirtualPad *pad = gPad ? gPad : MH::MakeDefCanvas("CamDisplay", "Mars Camera Display", 656, 600); 406 pad->SetBorderMode(0); 407 pad->SetFillColor(col); 408 409 // 410 // Create an own pad for the MHCamera-Object which can be 411 // resized in paint to keep the correct aspect ratio 412 // 413 pad->Divide(1, 1, 0, 0, col); 414 pad->cd(1); 415 gPad->SetBorderMode(0); 416 417 TString opt(option); 418 opt.ToLower(); 410 411 if (!hassame) 412 { 413 pad->SetBorderMode(0); 414 pad->SetFillColor(col); 415 416 // 417 // Create an own pad for the MHCamera-Object which can be 418 // resized in paint to keep the correct aspect ratio 419 // 420 pad->Divide(1, 1, 0, 0, col); 421 pad->cd(1); 422 gPad->SetBorderMode(0); 423 } 419 424 420 425 AppendPad(option); 426 //fGeomCam->AppendPad(); 421 427 422 428 // … … 424 430 // changes gPad... 425 431 // 426 pad->cd(); 432 if (!hassame) 433 pad->cd(); 427 434 } 428 435 … … 600 607 // Updates the pixel colors and paints the pixels 601 608 // 602 void MHCamera::Update(Bool_t islog, Bool_t isbox, Bool_t iscol )609 void MHCamera::Update(Bool_t islog, Bool_t isbox, Bool_t iscol, Bool_t issame) 603 610 { 604 611 Double_t min = GetMinimum(kFALSE); … … 613 620 max += 1; 614 621 615 UpdateLegend(min, max, islog); 622 if (!issame) 623 UpdateLegend(min, max, islog); 624 625 // Try to estimate the units of the current display. This is only 626 // necessary for 'same' option and allows distorted images of the camera! 627 const Float_t maxr = (1-fGeomCam->GetConvMm2Deg())*fGeomCam->GetMaxRadius()/2; 628 const Float_t conv = issame || 629 gPad->GetX1()<-maxr || gPad->GetY1()<-maxr || 630 gPad->GetX2()> maxr || gPad->GetY2()>maxr ? 1 : fGeomCam->GetConvMm2Deg(); 616 631 617 632 MHexagon hex; 618 633 for (Int_t i=0; i<fNcells-2; i++) 619 634 { 620 if (IsUsed(i) && iscol) 635 hex.SetFillStyle(issame ? 4000 : 1001); 636 637 if (!issame) 621 638 { 622 if (TMath::IsNaN(fArray[i+1])) 623 gLog << warn << "MHCamera::Update: " << GetName() << " <" << GetTitle() << "> - Pixel Index #" << i << " contents is NaN (Not a Number)..." << endl; 624 625 hex.SetFillColor(GetColor(GetBinContent(i+1), min, max, islog)); 639 if (IsUsed(i) && iscol) 640 { 641 if (TMath::IsNaN(fArray[i+1])) 642 gLog << warn << "MHCamera::Update: " << GetName() << " <" << GetTitle() << "> - Pixel Index #" << i << " contents is NaN (Not a Number)..." << endl; 643 644 hex.SetFillColor(GetColor(GetBinContent(i+1), min, max, islog)); 645 } 646 else 647 hex.SetFillColor(10); 626 648 } 627 else 628 hex.SetFillColor(10); 629 630 MGeomPix &pix = (*fGeomCam)[i]; 649 650 const MGeomPix &pix = (*fGeomCam)[i]; 651 652 const Float_t x = pix.GetX()*conv; 653 const Float_t y = pix.GetY()*conv; 654 const Float_t d = pix.GetD()*conv; 655 631 656 if (!isbox) 632 hex.PaintHexagon( pix.GetX(), pix.GetY(), pix.GetD());657 hex.PaintHexagon(x, y, d); 633 658 else 634 659 if (IsUsed(i) && !TMath::IsNaN(fArray[i+1])) 635 660 { 636 Float_t size = pix.GetD()*(GetBinContent(i+1)-min)/(max-min);637 if (size> pix.GetD())638 size= pix.GetD();639 hex.PaintHexagon( pix.GetX(), pix.GetY(), size);661 Float_t size = d*(GetBinContent(i+1)-min)/(max-min); 662 if (size>d) 663 size=d; 664 hex.PaintHexagon(x, y, size); 640 665 } 641 666 } … … 705 730 return; 706 731 } 707 708 gPad->Clear(); 709 710 // Maintain aspect ratio 711 SetRange(); 712 713 Bool_t isbox = opt.Contains("box"); 714 Bool_t iscol = isbox ? !opt.Contains("nocol") : 1; 715 716 if (GetPainter()) 717 { 718 // Paint statistics 719 if (!TestBit(TH1::kNoStats)) 720 fPainter->PaintStat(gStyle->GetOptStat(), NULL); 721 722 // Paint primitives (pixels, color legend, photons, ...) 723 if (fPainter->InheritsFrom(THistPainter::Class())) 732 733 const Bool_t hassame = opt.Contains("same"); 734 const Bool_t hasbox = opt.Contains("box"); 735 const Bool_t hascol = hasbox ? !opt.Contains("nocol") : kTRUE; 736 737 if (!hassame) 738 { 739 gPad->Clear(); 740 741 // Maintain aspect ratio 742 SetRange(); 743 744 if (GetPainter()) 724 745 { 725 static_cast<THistPainter*>(fPainter)->MakeChopt(""); 726 static_cast<THistPainter*>(fPainter)->PaintTitle(); 746 // Paint statistics 747 if (!TestBit(TH1::kNoStats)) 748 fPainter->PaintStat(gStyle->GetOptStat(), NULL); 749 750 // Paint primitives (pixels, color legend, photons, ...) 751 if (fPainter->InheritsFrom(THistPainter::Class())) 752 { 753 static_cast<THistPainter*>(fPainter)->MakeChopt(""); 754 static_cast<THistPainter*>(fPainter)->PaintTitle(); 755 } 727 756 } 728 757 } 729 758 730 759 // Update Contents of the pixels and paint legend 731 Update(gPad->GetLogy(), isbox, iscol); 732 PaintAxisTitle(); 760 Update(gPad->GetLogy(), hasbox, hascol, hassame); 761 762 if (!hassame) 763 PaintAxisTitle(); 733 764 734 765 if (opt.Contains("pixelindex")) -
trunk/MagicSoft/Mars/mhist/MHCamera.h
r3400 r3471 61 61 62 62 void PaintIndices(Int_t type); 63 void Update(Bool_t islog, Bool_t isbox, Bool_t iscol );63 void Update(Bool_t islog, Bool_t isbox, Bool_t iscol, Bool_t issame); 64 64 void UpdateLegend(Float_t min, Float_t max, Bool_t islog); 65 65 void SetRange(); -
trunk/MagicSoft/Mars/status.cc
r2773 r3471 42 42 #include "MMcPedestalCopy.h" 43 43 #include "MMcPedestalNSBAdd.h" 44 #include "MCerPhotCalc.h"44 //#include "MCerPhotCalc.h" 45 45 #include "MCerPhotAnal2.h" 46 46 //#include "MBlindPixelCalc.h" … … 54 54 #include "MEvtLoop.h" 55 55 #include "MFDataMember.h" 56 #include "MCalibrate.h" 57 #include "MExtractSignal.h" 58 #include "MMcCalibrationUpdate.h" 56 59 57 60 #include <TApplication.h> … … 196 199 MMcPedestalCopy pcopy; 197 200 MMcPedestalNSBAdd pnsb; 198 MCerPhotCalc ncalc;201 //MCerPhotCalc ncalc; 199 202 MCerPhotAnal2 nanal; 200 203 201 204 MFDataMember f1("MRawRunHeader.fRunType", '>', 255.5); 202 205 MFDataMember f2("MRawRunHeader.fRunType", '<', 255.5); 203 204 ncalc.SetFilter(&f1); 206 f1.SetName("MFMonteCarlo"); 207 f2.SetName("MFRealData"); 208 209 MExtractSignal extra; 210 extra.SetRange(5, 9, 5, 9); 211 212 MMcCalibrationUpdate mcupd; 213 mcupd.SetOuterPixelsGainScaling(kFALSE); 214 215 MCalibrate calib; 216 217 // MC 218 extra.SetFilter(&f1); 219 mcupd.SetFilter(&f1); 220 calib.SetFilter(&f1); 205 221 nanal.SetFilter(&f2); 206 /* 207 TArrayS blinds(6); 208 blinds[0] = 0; 209 blinds[1] = 195; 210 blinds[2] = 227; 211 blinds[3] = 248; 212 blinds[4] = 271; 213 blinds[5] = 291; 222 223 /* 224 TArrayS blinds(6); 225 blinds[0] = 0; 226 blinds[1] = 195; 227 blinds[2] = 227; 228 blinds[3] = 248; 229 blinds[4] = 271; 230 blinds[5] = 291; 214 231 215 232 blinds[3] = 51; … … 222 239 blinds[10]= 291; // 311, 119, 54, 85, 125, 92, 133, 224 223 240 224 MBlindPixelCalc blind; 225 blind.SetPixelIndices(blinds); 226 //blind.SetUseInterpolation(); 227 */ 241 MBlindPixelCalc blind; 242 blind.SetPixelIndices(blinds); 243 //blind.SetUseInterpolation(); 244 */ 245 228 246 // MSigmabarCalc sgcal; 229 247 MImgCleanStd clean; … … 271 289 tlist.AddToList(&pcopy); 272 290 tlist.AddToList(&pnsb); 273 tlist.AddToList(&ncalc); 291 292 tlist.AddToList(&extra); 293 tlist.AddToList(&mcupd); 294 tlist.AddToList(&calib); 295 274 296 tlist.AddToList(&nanal); 275 297 //tlist.AddToList(&blind);
Note:
See TracChangeset
for help on using the changeset viewer.