Changeset 2409 for trunk/MagicSoft/Mars/mhist/MHCamera.cc
- Timestamp:
- 10/20/03 17:44:51 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r2377 r2409 80 80 void MHCamera::Init() 81 81 { 82 UseCurrentStyle(); 83 82 84 SetDirectory(NULL); 83 85 … … 241 243 Int_t MHCamera::Fill(Axis_t x, Axis_t y, Stat_t w) 242 244 { 243 if (fNcells<=1 )245 if (fNcells<=1 || IsFreezed()) 244 246 return -1; 245 247 … … 265 267 mean += fArray[i]; 266 268 267 return mean/(fNcells-2);269 return Profile(mean/(fNcells-2)); 268 270 } 269 271 … … 286 288 sq /= n; 287 289 288 return sqrt(sq-sum*sum);290 return Profile(sqrt(sq-sum*sum)); 289 291 } 290 292 … … 297 299 { 298 300 if (fMinimum != -1111) 299 return fMinimum;301 return Profile(fMinimum); 300 302 301 303 if (fNcells<=1) … … 316 318 minimum = fArray[idx+1]; 317 319 } 318 return minimum;320 return Profile(minimum); 319 321 } 320 322 … … 326 328 Double_t MHCamera::GetMaximum(Bool_t all) const 327 329 { 328 if (fMaximum !=-1111)329 return fMaximum;330 if (fMaximum!=-1111) 331 return Profile(fMaximum); 330 332 331 333 if (fNcells<=1) … … 345 347 maximum = fArray[idx+1]; 346 348 } 347 return maximum;349 return Profile(maximum); 348 350 } 349 351 … … 455 457 gLog << warn << "MHCamera::Update: " << GetName() << " <" << GetTitle() << "> - Pixel Index #" << i << " contents is NaN (Not a Number)..." << endl; 456 458 457 hex.SetFillColor(GetColor( fArray[i+1], min, max, islog));459 hex.SetFillColor(GetColor(GetBinContent(i+1), min, max, islog)); 458 460 } 459 461 else … … 466 468 if (IsUsed(i) && !TMath::IsNaN(fArray[i+1])) 467 469 { 468 Float_t size = pix.GetD()*( fArray[i+1]-min)/(max-min);470 Float_t size = pix.GetD()*(GetBinContent(i+1)-min)/(max-min); 469 471 if (size>pix.GetD()) 470 472 size=pix.GetD(); … … 673 675 void MHCamera::AddCamContent(const MCamEvent &event, Int_t type) 674 676 { 675 if (fNcells<=1 )677 if (fNcells<=1 || IsFreezed()) 676 678 return; 677 679 … … 699 701 void MHCamera::AddCamContent(const MHCamera &d, Int_t type) 700 702 { 701 if (fNcells!=d.fNcells )703 if (fNcells!=d.fNcells || IsFreezed()) 702 704 return; 703 705 … … 733 735 void MHCamera::AddCamContent(const TArrayD &event, const TArrayC *used) 734 736 { 735 if (event.GetSize()!=fNcells-2 )737 if (event.GetSize()!=fNcells-2 || IsFreezed()) 736 738 return; 737 739 … … 756 758 void MHCamera::CntCamContent(const MCamEvent &event, Double_t threshold, Int_t type) 757 759 { 758 if (fNcells<=1 )760 if (fNcells<=1 || IsFreezed()) 759 761 return; 760 762 … … 779 781 void MHCamera::CntCamContent(const TArrayD &event, Double_t threshold, Bool_t ispos) 780 782 { 781 if (event.GetSize()!=fNcells-2 )783 if (event.GetSize()!=fNcells-2 || IsFreezed()) 782 784 return; 783 785 … … 799 801 void MHCamera::FillRandom() 800 802 { 801 if (fNcells<=1 )803 if (fNcells<=1 || IsFreezed()) 802 804 return; 803 805 … … 855 857 void MHCamera::Reset(Option_t *opt) 856 858 { 857 if (fNcells<=1 )859 if (fNcells<=1 || IsFreezed()) 858 860 return; 859 861 … … 1127 1129 cout << "Software Pixel Index: " << idx << endl; 1128 1130 cout << "Hardware Pixel Id: " << idx+1 << endl; 1129 cout << "Contents: " << fArray[idx+1]<< " <";1131 cout << "Contents: " << GetBinContent(idx+1) << " <"; 1130 1132 cout << (IsUsed(idx)?"on":"off"); 1131 1133 cout << ">" << endl; 1132 1134 1133 1135 if (fNotify && fNotify->GetSize()>0) 1134 new TCanvas; 1135 fNotify->ForEach(MCamEvent, DrawPixelContent)(idx); 1136 { 1137 TCanvas *c=new TCanvas; 1138 fNotify->ForEach(MCamEvent, DrawPixelContent)(idx, c); 1139 } 1136 1140 } 1137 1141 … … 1140 1144 return fGeomCam->GetNumPixels(); 1141 1145 } 1146 1147 TH1 *MHCamera::DrawCopy() const 1148 { 1149 gPad=NULL; 1150 return TH1D::DrawCopy(); 1151 }
Note:
See TracChangeset
for help on using the changeset viewer.