Changeset 4852


Ignore:
Timestamp:
09/03/04 19:45:41 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r4851 r4852  
    2626
    2727   * mcalib/MCalibrationChargeCam.[h,cc]
    28      - two new functions GetAveragedConvFADC2PhotPerArea and
    29        GetAveragedConvFADC2PhotPerSector, to be used by the data check.
     28     - new functions:
     29       GetAveragedConvFADC2PhotPerArea, 
     30       GetAveragedConvFADC2PhotPerSector,
     31       GetAveragedArrivalTimeMeanPerArea, 
     32       GetAveragedArrivalTimeMeanPerSector,
     33       GetAveragedArrivalTimeRmsPerArea, 
     34       GetAveragedArrivalTimeRmsPerSector,
     35       to be used by the data check.
    3036
    3137   * mcalib/MCalibrationQEPix.[h,cc]
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc

    r4848 r4852  
    675675  return arr;
    676676
     677
     678// --------------------------------------------------------------------------
     679//
     680// Calculates the average mean arrival times for pixel sizes.
     681// The geometry container is used to get the necessary
     682// geometry information (area index).
     683// If the bad pixel container is given all pixels which have the flag 'kUnsuitableRun' are ignored
     684// in the calculation of the size average.
     685//
     686// Returns a TArrayF of dimension 2:
     687// arr[0]: averaged mean arrival times (default: -1.)
     688// arr[1]: Error (rms) of averaged mean arrival times (default: 0.)
     689//
     690// ATTENTION: THE USER HAS TO DELETE THE RETURNED TARRAYF ACCORDINGLY
     691//
     692TArrayF *MCalibrationChargeCam::GetAveragedArrivalTimeMeanPerArea  ( const MGeomCam &geom,
     693                                           const UInt_t ai,  MBadPixelsCam *bad)
     694{
     695
     696  const Int_t np = GetSize();
     697
     698  Double_t mean  = 0.;
     699  Double_t mean2 = 0.;
     700  Int_t    nr    = 0;
     701
     702  for (int i=0; i<np; i++)
     703    {
     704      if (bad && (*bad)[i].IsUnsuitable(MBadPixelsPix::kUnsuitableRun))
     705        continue;
     706     
     707      const UInt_t aidx = geom[i].GetAidx();
     708     
     709      if (ai != aidx)
     710        continue;
     711
     712      const MCalibrationChargePix &pix = (MCalibrationChargePix&)(*this)[i];
     713      const Float_t time = pix.GetAbsTimeMean();
     714
     715      mean  += time   ;
     716      mean2 += time*time;
     717      nr    ++;
     718     
     719    }
     720
     721  TArrayF *arr = new TArrayF(2);
     722  arr->AddAt(nr   ? mean/nr : -1.,0);
     723  arr->AddAt(nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0. ,1);
     724
     725  return arr;
     726}
     727
     728// --------------------------------------------------------------------------
     729//
     730// Calculates the average mean arrival times for camera sectors.
     731// The geometry container is used to get the necessary
     732// geometry information (area index).
     733// If the bad pixel container is given all pixels which have the flag 'kUnsuitableRun' are ignored
     734// in the calculation of the size average.
     735//
     736// Returns a TArrayF of dimension 2:
     737// arr[0]: averaged mean arrival times (default: -1.)
     738// arr[1]: Error (rms) of averaged mean arrival times (default: 0.)
     739//
     740// ATTENTION: THE USER HAS TO DELETE THE RETURNED TARRAYF ACCORDINGLY
     741//
     742TArrayF *MCalibrationChargeCam::GetAveragedArrivalTimeMeanPerSector( const MGeomCam &geom,
     743                                             const UInt_t sec, MBadPixelsCam *bad)
     744{
     745  const Int_t np = GetSize();
     746
     747  Double_t mean  = 0.;
     748  Double_t mean2 = 0.;
     749  Int_t    nr    = 0;
     750
     751  for (int i=0; i<np; i++)
     752    {
     753      if (bad && (*bad)[i].IsUnsuitable(MBadPixelsPix::kUnsuitableRun))
     754        continue;
     755     
     756      const UInt_t sector = geom[i].GetSector();
     757     
     758      if (sector != sec)
     759        continue;
     760
     761      const MCalibrationChargePix &pix = (MCalibrationChargePix&)(*this)[i];
     762      const Float_t time = pix.GetAbsTimeMean();
     763
     764      mean  += time;
     765      mean2 += time*time;
     766      nr    ++;
     767     
     768    }
     769
     770  TArrayF *arr = new TArrayF(2);
     771  arr->AddAt(nr   ? mean/nr : -1.,0);
     772  arr->AddAt(nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0. ,1);
     773
     774  return arr;
     775
     776
     777// --------------------------------------------------------------------------
     778//
     779// Calculates the average arrival time RMSs for pixel sizes.
     780// The geometry container is used to get the necessary
     781// geometry information (area index).
     782// If the bad pixel container is given all pixels which have the flag 'kUnsuitableRun' are ignored
     783// in the calculation of the size average.
     784//
     785// Returns a TArrayF of dimension 2:
     786// arr[0]: averaged arrival time RMSs (default: -1.)
     787// arr[1]: Error (rms) of averaged arrival time RMSs (default: 0.)
     788//
     789// ATTENTION: THE USER HAS TO DELETE THE RETURNED TARRAYF ACCORDINGLY
     790//
     791TArrayF *MCalibrationChargeCam::GetAveragedArrivalTimeRmsPerArea  ( const MGeomCam &geom,
     792                                           const UInt_t ai,  MBadPixelsCam *bad)
     793{
     794
     795  const Int_t np = GetSize();
     796
     797  Double_t mean  = 0.;
     798  Double_t mean2 = 0.;
     799  Int_t    nr    = 0;
     800
     801  for (int i=0; i<np; i++)
     802    {
     803      if (bad && (*bad)[i].IsUnsuitable(MBadPixelsPix::kUnsuitableRun))
     804        continue;
     805     
     806      const UInt_t aidx = geom[i].GetAidx();
     807     
     808      if (ai != aidx)
     809        continue;
     810
     811      const MCalibrationChargePix &pix = (MCalibrationChargePix&)(*this)[i];
     812      const Float_t rms = pix.GetAbsTimeRms();
     813
     814      mean  += rms;
     815      mean2 += rms*rms;
     816      nr    ++;
     817     
     818    }
     819
     820  TArrayF *arr = new TArrayF(2);
     821  arr->AddAt(nr   ? mean/nr : -1.,0);
     822  arr->AddAt(nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0. ,1);
     823
     824  return arr;
     825}
     826
     827// --------------------------------------------------------------------------
     828//
     829// Calculates the average arrival time RMSs for camera sectors.
     830// The geometry container is used to get the necessary
     831// geometry information (area index).
     832// If the bad pixel container is given all pixels which have the flag 'kUnsuitableRun' are ignored
     833// in the calculation of the size average.
     834//
     835// Returns a TArrayF of dimension 2:
     836// arr[0]: averaged arrival time RMSs (default: -1.)
     837// arr[1]: Error (rms) of averaged arrival time RMSs (default: 0.)
     838//
     839// ATTENTION: THE USER HAS TO DELETE THE RETURNED TARRAYF ACCORDINGLY
     840//
     841TArrayF *MCalibrationChargeCam::GetAveragedArrivalTimeRmsPerSector( const MGeomCam &geom, const UInt_t sec, MBadPixelsCam *bad)
     842{
     843  const Int_t np = GetSize();
     844
     845  Double_t mean  = 0.;
     846  Double_t mean2 = 0.;
     847  Int_t    nr    = 0;
     848
     849  for (int i=0; i<np; i++)
     850    {
     851      if (bad && (*bad)[i].IsUnsuitable(MBadPixelsPix::kUnsuitableRun))
     852        continue;
     853     
     854      const UInt_t sector = geom[i].GetSector();
     855     
     856      if (sector != sec)
     857        continue;
     858
     859      const MCalibrationChargePix &pix = (MCalibrationChargePix&)(*this)[i];
     860      const Float_t rms = pix.GetAbsTimeRms();
     861
     862      mean  += rms;
     863      mean2 += rms*rms;
     864      nr    ++;
     865    }
     866
     867  TArrayF *arr = new TArrayF(2);
     868  arr->AddAt(nr   ? mean/nr : -1.,0);
     869  arr->AddAt(nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0. ,1);
     870
     871  return arr;
     872
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.h

    r4847 r4852  
    4747  Bool_t  IsFFactorMethodValid            () const;
    4848
    49   TArrayF *GetAveragedConvFADC2PhotPerArea  ( const MGeomCam &geom, const MCalibrationQECam &qecam,
    50                                              const UInt_t ai=0,  MBadPixelsCam *bad=NULL);
    51   TArrayF *GetAveragedConvFADC2PhotPerSector( const MGeomCam &geom, const MCalibrationQECam &qecam,
    52                                              const UInt_t sec=0, MBadPixelsCam *bad=NULL); 
     49  TArrayF *GetAveragedConvFADC2PhotPerArea    ( const MGeomCam &geom, const MCalibrationQECam &qecam,
     50                                                const UInt_t ai=0,  MBadPixelsCam *bad=NULL);
     51  TArrayF *GetAveragedConvFADC2PhotPerSector  ( const MGeomCam &geom, const MCalibrationQECam &qecam,
     52                                                const UInt_t sec=0, MBadPixelsCam *bad=NULL); 
     53  TArrayF *GetAveragedArrivalTimeMeanPerArea  ( const MGeomCam &geom,
     54                                                const UInt_t ai=0,  MBadPixelsCam *bad=NULL);
     55  TArrayF *GetAveragedArrivalTimeMeanPerSector( const MGeomCam &geom,
     56                                                const UInt_t sec=0, MBadPixelsCam *bad=NULL); 
     57  TArrayF *GetAveragedArrivalTimeRmsPerArea   ( const MGeomCam &geom,
     58                                                const UInt_t ai=0,  MBadPixelsCam *bad=NULL);
     59  TArrayF *GetAveragedArrivalTimeRmsPerSector ( const MGeomCam &geom,
     60                                                const UInt_t sec=0, MBadPixelsCam *bad=NULL); 
    5361 
    5462  // Prints
    55   void   Print(Option_t *o="")         const;
     63  void   Print(Option_t *o="") const;
    5664
    5765  // Setters   
    58   void  SetFFactorMethodValid ( const Bool_t b=kTRUE );
    59   void  SetNumPhotonsBlindPixelMethod ( const Float_t f )     { fNumPhotonsBlindPixelMethod    = f; }
    60   void  SetNumPhotonsFFactorMethod   ( const Float_t f )     { fNumPhotonsFFactorMethod       = f; }     
    61   void  SetNumPhotonsPINDiodeMethod  ( const Float_t f )     { fNumPhotonsPINDiodeMethod      = f; }   
    62   void  SetNumPhotonsBlindPixelMethodErr ( const Float_t f )  { fNumPhotonsBlindPixelMethodErr = f; }
     66  void  SetFFactorMethodValid           ( const Bool_t b=kTRUE );
     67  void  SetNumPhotonsBlindPixelMethod   ( const Float_t f )  { fNumPhotonsBlindPixelMethod    = f; }
     68  void  SetNumPhotonsFFactorMethod      ( const Float_t f )  { fNumPhotonsFFactorMethod       = f; }     
     69  void  SetNumPhotonsPINDiodeMethod     ( const Float_t f )  { fNumPhotonsPINDiodeMethod      = f; }   
     70  void  SetNumPhotonsBlindPixelMethodErr( const Float_t f )  { fNumPhotonsBlindPixelMethodErr = f; }
    6371  void  SetNumPhotonsFFactorMethodErr   ( const Float_t f )  { fNumPhotonsFFactorMethodErr    = f; }     
    6472  void  SetNumPhotonsPINDiodeMethodErr  ( const Float_t f )  { fNumPhotonsPINDiodeMethodErr   = f; }   
Note: See TracChangeset for help on using the changeset viewer.