Ignore:
Timestamp:
05/27/04 18:54:57 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcalib
Files:
2 edited

Legend:

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

    r4203 r4227  
    6868const Float_t MCalibrationChargeBlindPix::gkBlindPixelAttUV      = 1.95;
    6969const Float_t MCalibrationChargeBlindPix::gkBlindPixelAttCT1     = 1.95;
    70 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEGreen    = 0.154;
    71 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEBlue     = 0.226;
    72 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUV       = 0.247;
    73 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECT1      = 0.247;
    74 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEGreenErr = 0.015;
    75 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEBlueErr  = 0.02;
    76 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUVErr    = 0.02;
    77 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECT1Err   = 0.02;
     70const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedGreen    = 0.154;
     71const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedBlue     = 0.226;
     72const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedUV       = 0.247;
     73const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedCT1      = 0.247;
     74const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedGreenErr = 0.015;
     75const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedBlueErr  = 0.02;
     76const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedUVErr    = 0.02;
     77const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedCT1Err   = 0.02;
     78const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedGreen      = 0.192;
     79const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedBlue       = 0.27;
     80const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedUV         = 0.285;
     81const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedCT1        = 0.285;
     82const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedGreenErr   = 0.05;
     83const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedBlueErr    = 0.07;
     84const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedUVErr      = 0.07;
     85const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedCT1Err     = 0.07;
    7886// --------------------------------------------------------------------------
    7987//
     
    8290// Calls:
    8391// - Clear()
     92// - SetCoated()
    8493//
    8594MCalibrationChargeBlindPix::MCalibrationChargeBlindPix(const char *name, const char *title)
     
    8998  fTitle = title ? title : "Container of the fit results of the blind pixel";
    9099
     100  SetCoated();
    91101  Clear();
    92102}
     
    139149// --------------------------------------------------------------------------
    140150//
     151// Set the Coated Bit from outside
     152//
     153void  MCalibrationChargeBlindPix::SetCoated( const Bool_t b)
     154{
     155    b ? SETBIT(fFlags,kCoated) : CLRBIT(fFlags,kCoated);
     156}
     157
     158// --------------------------------------------------------------------------
     159//
    141160// Set the Oscillating Bit from outside
    142161//
     
    239258// Return gkBlindPixelQEGreenErr^2 / (gkBlindPixelQEGreen^2 )
    240259//
    241 const Float_t MCalibrationChargeBlindPix::GetBlindPixelQEGreenRelVar() const
    242 {
    243   if (gkBlindPixelQEGreenErr < 0.)
    244     return -1.;
    245  
    246   if (gkBlindPixelQEGreen  == 0.)
    247     return -1.;
    248  
    249   return gkBlindPixelQEGreenErr * gkBlindPixelQEGreenErr / gkBlindPixelQEGreen / gkBlindPixelQEGreen ;
     260const Float_t MCalibrationChargeBlindPix::GetBlindPixelQEGreen() const
     261{
     262
     263  if (IsCoated())
     264    {
     265      if (gkBlindPixelQECoatedGreen < 0.)
     266        return -1.;
     267     
     268      return gkBlindPixelQECoatedGreen;
     269    }
     270  else
     271    {
     272      if (gkBlindPixelQEUnCoatedGreen < 0.)
     273        return -1.;
     274     
     275      return gkBlindPixelQEUnCoatedGreen;
     276    }
     277 
    250278}
    251279
     
    256284// Return gkBlindPixelQEBlueErr^2 / gkBlindPixelQEBlue^2
    257285//
    258 const Float_t MCalibrationChargeBlindPix::GetBlindPixelQEBlueRelVar() const
    259 {
    260   if (gkBlindPixelQEBlueErr < 0.)
    261     return -1.;
    262  
    263   if (gkBlindPixelQEBlue  == 0.)
    264     return -1.;
    265  
    266   return gkBlindPixelQEBlueErr * gkBlindPixelQEBlueErr / gkBlindPixelQEBlue / gkBlindPixelQEBlue ;
     286const Float_t MCalibrationChargeBlindPix::GetBlindPixelQEBlue() const
     287{
     288  if (IsCoated())
     289    {
     290      if (gkBlindPixelQECoatedBlue < 0.)
     291        return -1.;
     292     
     293      return gkBlindPixelQECoatedBlue;
     294    }
     295  else
     296    {
     297      if (gkBlindPixelQEUnCoatedBlue < 0.)
     298        return -1.;
     299     
     300      return gkBlindPixelQEUnCoatedBlue;
     301    }
    267302}
    268303
     
    273308// Return gkBlindPixelQEUVErr ^2 / gkBlindPixelQEUV^2
    274309//
    275 const Float_t MCalibrationChargeBlindPix::GetBlindPixelQEUVRelVar() const
    276 {
    277   if (gkBlindPixelQEUVErr < 0.)
    278     return -1.;
    279  
    280   if (gkBlindPixelQEUV  == 0.)
    281     return -1.;
    282  
    283   return gkBlindPixelQEUVErr * gkBlindPixelQEUVErr / gkBlindPixelQEUV / gkBlindPixelQEUV ;
     310const Float_t MCalibrationChargeBlindPix::GetBlindPixelQEUV() const
     311{
     312
     313  if (IsCoated())
     314    {
     315      if (gkBlindPixelQECoatedUV < 0.)
     316        return -1.;
     317     
     318      return gkBlindPixelQECoatedUV;
     319    }
     320  else
     321    {
     322      if (gkBlindPixelQEUnCoatedUV < 0.)
     323        return -1.;
     324     
     325     
     326      return gkBlindPixelQEUnCoatedUV;
     327    }
    284328}
    285329
     
    290334// Return gkBlindPixelQECT1Err ^2 / gkBlindPixelQECT1^2
    291335//
     336const Float_t MCalibrationChargeBlindPix::GetBlindPixelQECT1() const
     337{
     338
     339  if (IsCoated())
     340    {
     341      if (gkBlindPixelQECoatedCT1 < 0.)
     342        return -1.;
     343     
     344      return gkBlindPixelQECoatedCT1;
     345    }
     346  else
     347    {
     348      if (gkBlindPixelQEUnCoatedCT1 < 0.)
     349        return -1.;
     350     
     351      return gkBlindPixelQEUnCoatedCT1;
     352    }
     353}
     354
     355// --------------------------------------------------------------------------
     356//
     357// Return -1 if gkBlindPixelQEGreenErr is smaller than 0.
     358// Return -1 if gkBlindPixelQEGreen    is 0.
     359// Return gkBlindPixelQEGreenErr^2 / (gkBlindPixelQEGreen^2 )
     360//
     361const Float_t MCalibrationChargeBlindPix::GetBlindPixelQEGreenRelVar() const
     362{
     363
     364  if (IsCoated())
     365    {
     366      if (gkBlindPixelQECoatedGreenErr < 0.)
     367        return -1.;
     368     
     369      if (gkBlindPixelQECoatedGreen  == 0.)
     370        return -1.;
     371     
     372      return gkBlindPixelQECoatedGreenErr * gkBlindPixelQECoatedGreenErr
     373         / gkBlindPixelQECoatedGreen / gkBlindPixelQECoatedGreen ;
     374    }
     375  else
     376    {
     377      if (gkBlindPixelQEUnCoatedGreenErr < 0.)
     378        return -1.;
     379     
     380      if (gkBlindPixelQEUnCoatedGreen  == 0.)
     381        return -1.;
     382     
     383      return gkBlindPixelQEUnCoatedGreenErr * gkBlindPixelQEUnCoatedGreenErr
     384         / gkBlindPixelQEUnCoatedGreen / gkBlindPixelQEUnCoatedGreen ;
     385    }
     386 
     387}
     388
     389// --------------------------------------------------------------------------
     390//
     391// Return -1 if gkBlindPixelQEBlueErr is smaller than 0.
     392// Return -1 if gkBlindPixelQEBlue    is 0.
     393// Return gkBlindPixelQEBlueErr^2 / gkBlindPixelQEBlue^2
     394//
     395const Float_t MCalibrationChargeBlindPix::GetBlindPixelQEBlueRelVar() const
     396{
     397  if (IsCoated())
     398    {
     399      if (gkBlindPixelQECoatedBlueErr < 0.)
     400        return -1.;
     401     
     402      if (gkBlindPixelQECoatedBlue  == 0.)
     403        return -1.;
     404     
     405      return gkBlindPixelQECoatedBlueErr * gkBlindPixelQECoatedBlueErr
     406         / gkBlindPixelQECoatedBlue / gkBlindPixelQECoatedBlue ;
     407    }
     408  else
     409    {
     410      if (gkBlindPixelQEUnCoatedBlueErr < 0.)
     411        return -1.;
     412     
     413      if (gkBlindPixelQEUnCoatedBlue  == 0.)
     414        return -1.;
     415     
     416      return gkBlindPixelQEUnCoatedBlueErr * gkBlindPixelQEUnCoatedBlueErr
     417         / gkBlindPixelQEUnCoatedBlue / gkBlindPixelQEUnCoatedBlue ;
     418    }
     419}
     420
     421// --------------------------------------------------------------------------
     422//
     423// Return -1 if gkBlindPixelQEUVErr is smaller than 0.
     424// Return -1 if gkBlindPixelQEUV    is 0.
     425// Return gkBlindPixelQEUVErr ^2 / gkBlindPixelQEUV^2
     426//
     427const Float_t MCalibrationChargeBlindPix::GetBlindPixelQEUVRelVar() const
     428{
     429
     430  if (IsCoated())
     431    {
     432      if (gkBlindPixelQECoatedUVErr < 0.)
     433        return -1.;
     434     
     435      if (gkBlindPixelQECoatedUV  == 0.)
     436        return -1.;
     437     
     438      return gkBlindPixelQECoatedUVErr * gkBlindPixelQECoatedUVErr
     439         / gkBlindPixelQECoatedUV / gkBlindPixelQECoatedUV ;
     440    }
     441  else
     442    {
     443      if (gkBlindPixelQEUnCoatedUVErr < 0.)
     444        return -1.;
     445     
     446      if (gkBlindPixelQEUnCoatedUV  == 0.)
     447        return -1.;
     448     
     449      return gkBlindPixelQEUnCoatedUVErr * gkBlindPixelQEUnCoatedUVErr
     450         / gkBlindPixelQEUnCoatedUV / gkBlindPixelQEUnCoatedUV ;
     451    }
     452}
     453
     454// --------------------------------------------------------------------------
     455//
     456// Return -1 if gkBlindPixelQECT1Err is smaller than 0.
     457// Return -1 if gkBlindPixelQECT1    is 0.
     458// Return gkBlindPixelQECT1Err ^2 / gkBlindPixelQECT1^2
     459//
    292460const Float_t MCalibrationChargeBlindPix::GetBlindPixelQECT1RelVar() const
    293461{
    294   if (gkBlindPixelQECT1Err < 0.)
    295     return -1.;
    296  
    297   if (gkBlindPixelQECT1  == 0.)
    298     return -1.;
    299  
    300   return gkBlindPixelQECT1Err * gkBlindPixelQECT1Err / gkBlindPixelQECT1 / gkBlindPixelQECT1 ;
     462
     463  if (IsCoated())
     464    {
     465      if (gkBlindPixelQECoatedCT1Err < 0.)
     466        return -1.;
     467     
     468      if (gkBlindPixelQECoatedCT1  == 0.)
     469        return -1.;
     470     
     471      return gkBlindPixelQECoatedCT1Err * gkBlindPixelQECoatedCT1Err
     472         / gkBlindPixelQECoatedCT1 / gkBlindPixelQECoatedCT1 ;
     473    }
     474  else
     475    {
     476      if (gkBlindPixelQEUnCoatedCT1Err < 0.)
     477        return -1.;
     478     
     479      if (gkBlindPixelQEUnCoatedCT1  == 0.)
     480        return -1.;
     481     
     482      return gkBlindPixelQEUnCoatedCT1Err * gkBlindPixelQEUnCoatedCT1Err
     483         / gkBlindPixelQEUnCoatedCT1 / gkBlindPixelQEUnCoatedCT1 ;
     484    }
    301485}
    302486
     
    312496// --------------------------------------------------------------------------
    313497//
     498// Test bit kCoated
     499//
     500Bool_t MCalibrationChargeBlindPix::IsCoated()  const
     501{
     502    return TESTBIT(fFlags,kCoated);
     503}
     504
     505// --------------------------------------------------------------------------
     506//
    314507// Test bit kOscillating
    315508//
     
    352545//
    353546// Calculate fFluxInsidePlexiglass with the formula:
    354 // - fFluxInsidePlexiglass    = fLambda * gkBlindPixelArea / gkBlindPixelQE * 10**gkBlindPixelAtt
     547// - fFluxInsidePlexiglass    = fLambda * gkBlindPixelArea / GetBlindPixelQE() * 10**gkBlindPixelAtt
    355548// - fFluxInsidePlexiglassVar = sqrt( fLambdaVar / ( fLambda * fLambda )
    356549//                             + ( gkBlindPixelQEErr * gkBlindPixelQEErr / gkBlindPixelQE / gkBlindPixelQE )
     
    376569    {
    377570    case MCalibrationCam::kGREEN:
    378       fFluxInsidePlexiglass    = fLambda / gkBlindPixelQEGreen * TMath::Power(10,gkBlindPixelAttGreen);   
     571      fFluxInsidePlexiglass    = fLambda / GetBlindPixelQEGreen() * TMath::Power(10,gkBlindPixelAttGreen);   
    379572      // attenuation has negligible error
    380573      fFluxInsidePlexiglassVar = GetLambdaRelVar() + GetBlindPixelQEGreenRelVar();
    381574      break;
    382575    case MCalibrationCam::kBLUE:
    383       fFluxInsidePlexiglass    = fLambda / gkBlindPixelQEBlue * TMath::Power(10,gkBlindPixelAttBlue);   
     576      fFluxInsidePlexiglass    = fLambda / GetBlindPixelQEBlue() * TMath::Power(10,gkBlindPixelAttBlue);   
    384577      // attenuation has negligible error
    385578      fFluxInsidePlexiglassVar = GetLambdaRelVar() + GetBlindPixelQEBlueRelVar();
    386579      break;
    387580    case MCalibrationCam::kUV:
    388       fFluxInsidePlexiglass    = fLambda / gkBlindPixelQEUV * TMath::Power(10,gkBlindPixelAttUV);   
     581      fFluxInsidePlexiglass    = fLambda / GetBlindPixelQEUV() * TMath::Power(10,gkBlindPixelAttUV);   
    389582      // attenuation has negligible error
    390583      fFluxInsidePlexiglassVar = GetLambdaRelVar() + GetBlindPixelQEUVRelVar();
     
    392585    case MCalibrationCam::kCT1:
    393586    default:
    394       fFluxInsidePlexiglass    = fLambda / gkBlindPixelQECT1 * TMath::Power(10,gkBlindPixelAttCT1);   
     587      fFluxInsidePlexiglass    = fLambda / GetBlindPixelQECT1() * TMath::Power(10,gkBlindPixelAttCT1);   
    395588      // attenuation has negligible error
    396589      fFluxInsidePlexiglassVar = GetLambdaRelVar() + GetBlindPixelQECT1RelVar();
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeBlindPix.h

    r3699 r4227  
    1414private:
    1515
    16   static const Float_t gkBlindPixelArea;        //! The Blind Pixel area in mm^2
    17   static const Float_t gkBlindPixelAttGreen;    //! Attenuation Filter at 520 nm
    18   static const Float_t gkBlindPixelAttBlue ;    //! Attenuation Filter at 460 nm
    19   static const Float_t gkBlindPixelAttUV   ;    //! Attenuation Filter at 370 nm
    20   static const Float_t gkBlindPixelAttCT1  ;    //! Attenuation Filter at 370 nm
    21   static const Float_t gkBlindPixelQEGreen;     //! Quantum Efficiency at 520 nm
    22   static const Float_t gkBlindPixelQEBlue ;     //! Quantum Efficiency at 460 nm
    23   static const Float_t gkBlindPixelQEUV   ;     //! Quantum Efficiency at 370 nm
    24   static const Float_t gkBlindPixelQECT1  ;     //! Quantum Efficiency at 370 nm
    25   static const Float_t gkBlindPixelQEGreenErr;  //! Uncertainty QE at 520 nm
    26   static const Float_t gkBlindPixelQEBlueErr ;  //! Uncertainty QE at 460 nm
    27   static const Float_t gkBlindPixelQEUVErr   ;  //! Uncertainty QE at 370 nm
    28   static const Float_t gkBlindPixelQECT1Err  ;  //! Uncertainty QE at 370 nmu
     16  static const Float_t gkBlindPixelArea;               //! The Blind Pixel area in mm^2
     17  static const Float_t gkBlindPixelAttGreen;           //! Attenuation Filter at 520 nm
     18  static const Float_t gkBlindPixelAttBlue ;           //! Attenuation Filter at 460 nm
     19  static const Float_t gkBlindPixelAttUV   ;           //! Attenuation Filter at 370 nm
     20  static const Float_t gkBlindPixelAttCT1  ;           //! Attenuation Filter at 370 nm
     21  static const Float_t gkBlindPixelQEUnCoatedGreen;    //! Quantum Efficiency at 520 nm
     22  static const Float_t gkBlindPixelQEUnCoatedBlue ;    //! Quantum Efficiency at 460 nm
     23  static const Float_t gkBlindPixelQEUnCoatedUV   ;    //! Quantum Efficiency at 370 nm
     24  static const Float_t gkBlindPixelQEUnCoatedCT1  ;    //! Quantum Efficiency at 370 nm
     25  static const Float_t gkBlindPixelQEUnCoatedGreenErr; //! Uncertainty QEUnCoated at 520 nm
     26  static const Float_t gkBlindPixelQEUnCoatedBlueErr ; //! Uncertainty QEUnCoated at 460 nm
     27  static const Float_t gkBlindPixelQEUnCoatedUVErr   ; //! Uncertainty QEUnCoated at 370 nm
     28  static const Float_t gkBlindPixelQEUnCoatedCT1Err  ; //! Uncertainty QEUnCoated at 370 nmu
     29  static const Float_t gkBlindPixelQECoatedGreen;      //! Quantum Efficiency at 520 nm
     30  static const Float_t gkBlindPixelQECoatedBlue ;      //! Quantum Efficiency at 460 nm
     31  static const Float_t gkBlindPixelQECoatedUV   ;      //! Quantum Efficiency at 370 nm
     32  static const Float_t gkBlindPixelQECoatedCT1  ;      //! Quantum Efficiency at 370 nm
     33  static const Float_t gkBlindPixelQECoatedGreenErr;   //! Uncertainty QECoated at 520 nm
     34  static const Float_t gkBlindPixelQECoatedBlueErr ;   //! Uncertainty QECoated at 460 nm
     35  static const Float_t gkBlindPixelQECoatedUVErr   ;   //! Uncertainty QECoated at 370 nm
     36  static const Float_t gkBlindPixelQECoatedCT1Err  ;   //! Uncertainty QECoated at 370 nmu
    2937
    3038  Float_t fLambda;                  // Mean Poisson fit
     
    4452
    4553  enum { kOscillating, kPedestalFitOK, kSinglePheFitOK, kChargeFitValid,
    46          kFluxInsidePlexiglassAvailable };
     54         kFluxInsidePlexiglassAvailable, kCoated };
    4755
    48   MCalibrationCam::PulserColor_t fColor; 
     56  MCalibrationCam::PulserColor_t fColor;
     57
     58  const Float_t GetBlindPixelQEGreen() const;
     59  const Float_t GetBlindPixelQEBlue () const;
     60  const Float_t GetBlindPixelQEUV   () const;
     61  const Float_t GetBlindPixelQECT1  () const;
    4962
    5063  const Float_t GetBlindPixelQEGreenRelVar() const;
     
    8093  Float_t GetSigma1Err                    () const { return fSigma1Err;            }
    8194
     95  Bool_t  IsCoated                        () const; 
    8296  Bool_t  IsOscillating                   () const;
    8397  Bool_t  IsChargeFitValid                () const;
     
    101115  void SetSigma1Err      ( const Float_t f )                            { fSigma1Err      = f; }
    102116
     117  void SetCoated         ( const Bool_t  b=kTRUE ); 
    103118  void SetOscillating    ( const Bool_t  b=kTRUE );
    104119  void SetChargeFitValid ( const Bool_t  b=kTRUE );
     
    107122  void SetFluxInsidePlexiglassAvailable( const Bool_t b=kTRUE);
    108123
    109   ClassDef(MCalibrationChargeBlindPix, 1)       // Container Charge Calibration Results Blind Pixel
     124  ClassDef(MCalibrationChargeBlindPix, 2)       // Container Charge Calibration Results Blind Pixel
    110125};
    111126
Note: See TracChangeset for help on using the changeset viewer.