Changeset 5516 for trunk


Ignore:
Timestamp:
11/30/04 14:16:30 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r5515 r5516  
    4444   * mcalib/MCalibrationChargeCalc.[h,cc]
    4545     - 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
    4650
    4751
  • trunk/MagicSoft/Mars/mpedestal/MPedestalCam.cc

    r5465 r5516  
    101101// Copy 'constructor'
    102102//
    103 void MPedestalCam::Copy(TObject &object) const
    104 {
    105 
    106   MPedestalCam &cam = (MPedestalCam&)object;
     103void MPedestalCam::Copy(TObject &obj) const
     104{
     105
     106  MParContainer::Copy(obj);
     107
     108  MPedestalCam &cam = (MPedestalCam&)obj;
    107109 
    108110  const Int_t n = GetSize();
     
    530532}
    531533
    532 
    533 // --------------------------------------------------------------------------
    534 //
    535 // Calculates the avarage pedestal and pedestal rms for all sectors
    536 // and pixel sizes. The geometry container is used to get the necessary
    537 // geometry information (sector number, size index) If the bad pixel
    538 // container is given all pixels which have the flag 'kUnsuitableRun' are ignored
    539 // 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 sectors
    560         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         else
    582             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         else
    588             GetAverageArea(i).Clear();
    589 }
    590534
    591535Bool_t MPedestalCam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
  • trunk/MagicSoft/Mars/mpedestal/MPedestalCam.h

    r5465 r5516  
    5858  void  InitAverageSectors             ( const UInt_t i      );
    5959
    60   void ReCalc(const MGeomCam &geom, MBadPixelsCam *bad=NULL);
    61 
    6260  void Print(Option_t *o="") const;
    6361 
Note: See TracChangeset for help on using the changeset viewer.