- Timestamp:
- 11/30/04 14:16:30 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r5515 r5516 44 44 * mcalib/MCalibrationChargeCalc.[h,cc] 45 45 - added variable containing the name of the requested MPedestalCam 46 47 * mpedestal/MPedestalCam.[h,cc] 48 - added in Copy-function call to MParContainer::Copy 49 - removed now obsolete ReCalc()-function 46 50 47 51 -
trunk/MagicSoft/Mars/mpedestal/MPedestalCam.cc
r5465 r5516 101 101 // Copy 'constructor' 102 102 // 103 void MPedestalCam::Copy(TObject &object) const 104 { 105 106 MPedestalCam &cam = (MPedestalCam&)object; 103 void MPedestalCam::Copy(TObject &obj) const 104 { 105 106 MParContainer::Copy(obj); 107 108 MPedestalCam &cam = (MPedestalCam&)obj; 107 109 108 110 const Int_t n = GetSize(); … … 530 532 } 531 533 532 533 // --------------------------------------------------------------------------534 //535 // Calculates the avarage pedestal and pedestal rms for all sectors536 // and pixel sizes. The geometry container is used to get the necessary537 // geometry information (sector number, size index) If the bad pixel538 // container is given all pixels which have the flag 'kUnsuitableRun' are ignored539 // in the calculation of the sector and size average.540 //541 void MPedestalCam::ReCalc(const MGeomCam &geom, MBadPixelsCam *bad)542 {543 const Int_t np = GetSize();544 const Int_t ns = geom.GetNumSectors();545 const Int_t na = geom.GetNumAreas();546 547 TArrayI acnt(na);548 TArrayI scnt(ns);549 TArrayD asumx(na);550 TArrayD ssumx(ns);551 TArrayD asumr(na);552 TArrayD ssumr(ns);553 554 for (int i=0; i<np; i++)555 {556 if (bad && (*bad)[i].IsUnsuitable(MBadPixelsPix::kUnsuitableRun))557 continue; //was: .IsBad()558 559 // Create sums for areas and sectors560 const UInt_t aidx = geom[i].GetAidx();561 const UInt_t sect = geom[i].GetSector();562 563 const MPedestalPix &pix = (*this)[i];564 565 const UInt_t ne = pix.GetNumEvents();566 const Float_t mean = pix.GetPedestal();567 const Float_t rms = pix.GetPedestalRms();568 569 asumx[aidx] += ne*mean;570 asumr[aidx] += ne*rms;571 acnt[aidx] += ne;572 573 ssumx[sect] += ne*mean;574 ssumr[sect] += ne*rms;575 scnt[sect] += ne;576 }577 578 for (int i=0; i<ns; i++)579 if (scnt[i]>0)580 GetAverageSector(i).Set(ssumx[i]/scnt[i], ssumr[i]/scnt[i], 0, scnt[i]);581 else582 GetAverageSector(i).Clear();583 584 for (int i=0; i<na; i++)585 if (acnt[i]>0)586 GetAverageArea(i).Set(asumx[i]/acnt[i], asumr[i]/acnt[i], 0, acnt[i]);587 else588 GetAverageArea(i).Clear();589 }590 534 591 535 Bool_t MPedestalCam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const -
trunk/MagicSoft/Mars/mpedestal/MPedestalCam.h
r5465 r5516 58 58 void InitAverageSectors ( const UInt_t i ); 59 59 60 void ReCalc(const MGeomCam &geom, MBadPixelsCam *bad=NULL);61 62 60 void Print(Option_t *o="") const; 63 61
Note:
See TracChangeset
for help on using the changeset viewer.