Ignore:
Timestamp:
09/25/04 14:01:50 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r5047 r5137  
    7474/////////////////////////////////////////////////////////////////////////////
    7575#include "MCalibrationQECam.h"
     76#include "MCalibrationQEPix.h"
    7677
    7778#include <TOrdCollection.h>
     79#include <TGraphErrors.h>
     80#include <TH2D.h>
    7881
    7982#include "MLog.h"
    8083#include "MLogManip.h"
    8184
    82 #include "MCalibrationQEPix.h"
    83 
    8485ClassImp(MCalibrationQECam);
    8586
    8687using namespace std;
    8788
    88 const Float_t MCalibrationQECam::gkPlexiglassQE    = 0.96;
     89const Float_t MCalibrationQECam::gkPlexiglassQE    = 0.92;
    8990const Float_t MCalibrationQECam::gkPlexiglassQEErr = 0.01;
    90 
    9191// --------------------------------------------------------------------------
    9292//
     
    785785}
    786786
    787 
    788 
    789 
    790 
    791 
    792 
    793 
     787// --------------------------------------------------------------------------
     788//
     789// Returns a TGraphErrors correlating the corning blues with the
     790// calcualted quantum efficiency of each pixel, obtained with the F-Factor
     791// method.
     792//
     793TGraphErrors *MCalibrationQECam::GetGraphQEvsCorningBlues() const
     794{
     795
     796  const UInt_t size = GetSize();
     797
     798  if (fCorningBlues.GetSize() == 0)
     799    {
     800      *fLog << warn << "Size of intialized Cornings Blue is zero, please use MCalibrationQECamMagic" << endl;
     801      return NULL;
     802    }
     803 
     804  if (fCorningBlues.GetSize() != size)
     805    *fLog << warn << "Sizes mismatch, cannot create Graph!! " << endl;
     806
     807  TArrayD qes(size);
     808  TArrayD qeerrs(size);
     809  TArrayD corns(size);
     810  TArrayD cornerrs(size);
     811 
     812  Int_t cnt = 0;
     813 
     814  for (UInt_t i=0; i<size; i++)
     815    {
     816      MCalibrationQEPix &pix = (MCalibrationQEPix&)(*this)[i];
     817      if (pix.IsFFactorMethodValid() && fCorningBlues[i] > 0. && pix.GetQECascadesFFactorErr() > 0.)
     818        {
     819          qes   [i] = pix.GetQECascadesFFactor();
     820          qeerrs[i] = pix.GetQECascadesFFactorErr();
     821          corns [i] = fCorningBlues[i];
     822          cornerrs[i] = 0.05;
     823          cnt++;
     824        }
     825    }
     826 
     827  TGraphErrors *gr = new TGraphErrors(cnt,
     828                                     corns.GetArray(),qes.GetArray(),
     829                                      cornerrs.GetArray(),qeerrs.GetArray());
     830  return gr;
     831}
     832
     833// --------------------------------------------------------------------------
     834//
     835// Returns a TGraphErrors correlating the corning reds with the
     836// calcualted quantum efficiency of each pixel, obtained with the F-Factor
     837// method.
     838//
     839TGraphErrors *MCalibrationQECam::GetGraphQEvsCorningReds() const
     840{
     841
     842  const UInt_t size = GetSize();
     843
     844  if (fCorningReds.GetSize() == 0)
     845    {
     846      *fLog << warn << "Size of intialized Cornings Red is zero, please use MCalibrationQECamMagic" << endl;
     847      return NULL;
     848    }
     849 
     850  if (fCorningReds.GetSize() != size)
     851    *fLog << warn << "Sizes mismatch, cannot create Graph!! " << endl;
     852
     853  TArrayD qes(size);
     854  TArrayD qeerrs(size);
     855  TArrayD corns(size);
     856  TArrayD cornerrs(size);
     857
     858  Int_t cnt = 0;
     859
     860  for (UInt_t i=0; i<size; i++)
     861    {
     862      MCalibrationQEPix &pix = (MCalibrationQEPix&)(*this)[i];
     863      if (pix.IsFFactorMethodValid() && fCorningReds[i] > 0. && pix.GetQECascadesFFactorErr() > 0.)
     864        {
     865          qes     [i] = pix.GetQECascadesFFactor();
     866          qeerrs  [i] = pix.GetQECascadesFFactorErr();
     867          corns   [i] = fCorningReds[i];
     868          cornerrs[i] = 0.05;
     869          cnt++;
     870        }
     871     
     872    }
     873 
     874  TGraphErrors *gr = new TGraphErrors(cnt,
     875                                      corns.GetArray(),qes.GetArray(),
     876                                      cornerrs.GetArray(),qeerrs.GetArray());
     877 
     878  return gr;
     879}
     880
     881TH2D *MCalibrationQECam::GetHistQEvsCorningBlues( const Int_t nbins, const Axis_t first, const Axis_t last ) const
     882{
     883
     884  const UInt_t size = GetSize();
     885
     886  if (fCorningBlues.GetSize() == 0)
     887    return NULL;
     888 
     889  if (fCorningBlues.GetSize() != size)
     890    *fLog << warn << "Sizes mismatch, cannot create Graph!! " << endl;
     891
     892  TH2D *h = new TH2D("hist","QE vs. Corning Blue",nbins,first,last,nbins,0.,0.35);
     893 
     894  for (UInt_t i=0; i<size; i++)
     895    {
     896      MCalibrationQEPix &pix = (MCalibrationQEPix&)(*this)[i];
     897      if (pix.IsFFactorMethodValid() && fCorningBlues[i] > 0.)
     898        h->Fill(fCorningBlues[i],pix.GetQECascadesFFactor());
     899    }
     900 
     901  return h;
     902}
     903
     904TH2D *MCalibrationQECam::GetHistQEvsCorningReds( const Int_t nbins, const Axis_t first, const Axis_t last ) const
     905{
     906
     907  const UInt_t size = GetSize();
     908
     909  if (fCorningReds.GetSize() == 0)
     910    return NULL;
     911 
     912  if (fCorningReds.GetSize() != size)
     913    *fLog << warn << "Sizes mismatch, cannot create Graph!! " << endl;
     914
     915  TH2D *h = new TH2D("hist","QE vs. Corning Red",nbins,first,last,nbins,0.,0.35);
     916
     917  for (UInt_t i=0; i<size; i++)
     918    {
     919      MCalibrationQEPix &pix = (MCalibrationQEPix&)(*this)[i];
     920      if (pix.IsFFactorMethodValid() && fCorningReds[i] > 0.)
     921        h->Fill(fCorningReds[i],pix.GetQECascadesFFactor());
     922    }
     923 
     924  return h;
     925}
Note: See TracChangeset for help on using the changeset viewer.