Ignore:
Timestamp:
06/03/04 10:24:57 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcalib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc

    r4206 r4271  
    8888//
    8989MCalibrationCam::MCalibrationCam(const char *name, const char *title)
    90     : fNumHiGainFADCSlices(0.), fNumLoGainFADCSlices(0.), fPulserColor(kNONE),
     90    : fPulserColor(kNONE),
    9191      fPixels(NULL), fAverageAreas(NULL), fAverageSectors(NULL)
    9292{
    93     fName  = name  ? name  : "MCalibrationCam";
    94     fTitle = title ? title : "Base class Storage container for Camera Calibration";
    95 
    96     fAverageBadAreas    = new TClonesArray("MBadPixelsPix",1);
    97     fAverageBadSectors  = new TClonesArray("MBadPixelsPix",1);
    98 
     93
     94  fAverageBadAreas    = new TClonesArray("MBadPixelsPix",1);
     95  fAverageBadSectors  = new TClonesArray("MBadPixelsPix",1);
     96
     97  fNumHiGainFADCSlices.Set(1);
     98  fNumLoGainFADCSlices.Set(1);
    9999}
    100100
     
    174174 
    175175  MCalibrationCam &calib = (MCalibrationCam&)object;
    176 
    177   MParContainer::Copy(object);
    178  
    179   calib.fNumHiGainFADCSlices  = fNumHiGainFADCSlices;
    180   calib.fNumLoGainFADCSlices  = fNumLoGainFADCSlices;
     176 
     177  MParContainer::Copy(calib);
     178 
    181179  calib.fPulserColor          = fPulserColor;
    182 
     180 
    183181  const Int_t n3 = GetSize();
    184182  if (n3 != 0)
     
    188186        (*this)[i].Copy(calib[i]);
    189187    }
    190 
     188 
    191189  const Int_t n4 = GetAverageAreas();
    192190  if (n4 != 0)
     
    194192      calib.InitAverageAreas(n4);
    195193      for (int i=0; i<n4; i++)
    196         GetAverageArea(i).Copy(calib.GetAverageArea(i));
    197       for (int i=0; i<n4; i++)
    198         GetAverageBadArea(i).Copy(calib.GetAverageBadArea(i));
    199       for (int i=0; i<n4; i++)
    200         calib.fNumUnsuitable[i] = fNumUnsuitable[i];
    201       for (int i=0; i<n4; i++)
    202         calib.fNumUnreliable[i] = fNumUnreliable[i];
     194        {
     195          GetAverageArea   (i).Copy(calib.GetAverageArea(i));
     196          GetAverageBadArea(i).Copy(calib.GetAverageBadArea(i));
     197          calib.fNumUnsuitable      [i] = fNumUnsuitable[i];
     198          calib.fNumUnreliable      [i] = fNumUnreliable[i];
     199          calib.fNumHiGainFADCSlices[i] = fNumHiGainFADCSlices[i];
     200          calib.fNumLoGainFADCSlices[i] = fNumLoGainFADCSlices[i];
     201        }
    203202    }
    204203 
     
    208207      calib.InitAverageSectors(n5);
    209208      for (int i=0; i<n5; i++)
    210         GetAverageSector(i).Copy(calib.GetAverageSector(i));
    211       for (int i=0; i<n5; i++)
    212         GetAverageBadSector(i).Copy(calib.GetAverageBadSector(i));
     209        {
     210          GetAverageSector   (i).Copy(calib.GetAverageSector(i));
     211          GetAverageBadSector(i).Copy(calib.GetAverageBadSector(i));
     212        }
    213213    }
    214  
    215 }
    216 
     214}
    217215
    218216// -------------------------------------------------------------------
     
    241239  fNumUnsuitable.Set(i);
    242240  fNumUnreliable.Set(i);
     241  fNumHiGainFADCSlices.Set(i);
     242  fNumLoGainFADCSlices.Set(i);
    243243}
    244244
     
    299299}
    300300
     301// --------------------------------------------------------------------------
     302//
     303// Returns the mean number of High-Gain FADC slices per area index and -1 if
     304// the area index exceeds the initialized array.
     305//
     306const Float_t MCalibrationCam::GetNumHiGainFADCSlices( Int_t aidx ) const
     307{
     308  if (aidx < 0)
     309    return -1;
     310
     311  return aidx > fNumHiGainFADCSlices.GetSize() ? -1 : fNumHiGainFADCSlices[aidx];
     312}
     313
     314// --------------------------------------------------------------------------
     315//
     316// Returns the mean number of Low-Gain FADC slices per area index and -1 if
     317// the area index exceeds the initialized array.
     318//
     319const Float_t MCalibrationCam::GetNumLoGainFADCSlices( Int_t aidx ) const
     320{
     321  if (aidx < 0)
     322    return -1;
     323
     324  return aidx > fNumLoGainFADCSlices.GetSize() ? -1 : fNumLoGainFADCSlices[aidx];
     325}
     326
     327
    301328
    302329// --------------------------------------------------------------------------
     
    440467}
    441468
     469void MCalibrationCam::SetNumHiGainFADCSlices( const Float_t i, const Int_t aidx)
     470{
     471  if (aidx < 0)
     472    return;
     473
     474  if (aidx < fNumHiGainFADCSlices.GetSize())
     475    fNumHiGainFADCSlices[aidx] = i; 
     476}
     477
     478void MCalibrationCam::SetNumLoGainFADCSlices( const Float_t i, const Int_t aidx)
     479{
     480  if (aidx < 0)
     481    return;
     482  if (aidx < fNumLoGainFADCSlices.GetSize())
     483    fNumLoGainFADCSlices[aidx] = i;
     484}
     485
    442486void MCalibrationCam::SetNumUnsuitable( const UInt_t i, const Int_t aidx)
    443487{
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCam.h

    r4270 r4271  
    6464  const Int_t            GetAverageSectors      ()             const; 
    6565  const MCalibrationPix &GetAverageSector       ( UInt_t i   ) const;
    66   const Float_t          GetNumHiGainFADCSlices ( Int_t aidx ) const;
    67   const Float_t          GetNumLoGainFADCSlices ( Int_t aidx ) const;
     66  const Float_t          GetNumHiGainFADCSlices ( Int_t aidx=0 ) const;
     67  const Float_t          GetNumLoGainFADCSlices ( Int_t aidx=0 ) const;
    6868  const Int_t            GetNumUnsuitable       ( Int_t aidx ) const;
    6969  const Int_t            GetNumUnreliable       ( Int_t aidx ) const;
     
    8484
    8585  // Setters
    86   void  SetNumHiGainFADCSlices ( const Float_t f, const Int_t aidx );
    87   void  SetNumLoGainFADCSlices ( const Float_t f, const Int_t aidx );
     86  void  SetNumHiGainFADCSlices ( const Float_t f, const Int_t aidx=0 );
     87  void  SetNumLoGainFADCSlices ( const Float_t f, const Int_t aidx=0 );
    8888  void  SetNumUnsuitable       ( const UInt_t i,  const Int_t aidx ); 
    8989  void  SetNumUnreliable       ( const UInt_t i,  const Int_t aidx );
Note: See TracChangeset for help on using the changeset viewer.