Changeset 3660


Ignore:
Timestamp:
04/05/04 21:48:56 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/manalysis/MGeomApply.cc

    r3659 r3660  
    127127    if (!cam)
    128128    {
    129         *fLog << err << GetDescriptor() << ": No MGeomCam found... aborting." << endl;
     129       *fLog << err << GetDescriptor() << ": No MGeomCam found... aborting." << endl;
    130130        return kFALSE;
    131131    }
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc

    r3658 r3660  
    10381038{
    10391039
    1040   Float_t flux    = pindiode.GetMeanFluxOutsidePlexiglass();
    1041   Float_t fluxerr = pindiode.GetMeanFluxOutsidePlexiglassErr();
     1040  Float_t flux    = pindiode.GetFluxOutsidePlexiglass();
     1041  Float_t fluxerr = pindiode.GetFluxOutsidePlexiglassErr();
    10421042
    10431043  TIter Next(fPixels);
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargePINDiode.cc

    r3658 r3660  
    3131// is the documentation for the moment.
    3232//
     33// Currently, the following numbers are implemented:
     34//
     35// Area of Inner Pixel Ai: 779.423 +- 0  mm^2
     36// Area of PIN Diode   Ap: 100.000 +- 10 mm^2
     37//
     38// Ratio of areas:
     39//
     40// Distance of PIN Diode to pulser D1:   1.5  +- 0.3 m
     41// Distance of Inner Pixel to pulser D2: 18.0 +- 0.5 m
     42//
     43//                         Ai*D1*D1
     44// gkSolidAngleRatio   =   -------- = 0.054
     45//                         Ap*D2*D2
     46//
     47// gkSolidAngleRatioErr = 0.01
     48//
     49//
    3350/////////////////////////////////////////////////////////////////////////////
    3451#include "MCalibrationChargePINDiode.h"
     
    4461const Float_t MCalibrationChargePINDiode::fgChargeToPhotons    = -1.;
    4562const Float_t MCalibrationChargePINDiode::fgChargeToPhotonsErr = -1.;
    46 //
    47 // Area of Inner Pixel w.r.t. PIN Diode (which is 1 cm2)
    48 //
    49 // Distance of PIN Diode to pulser D1:   1.5  +- 0.3 m
    50 // Distance of Inner Pixel to pulser D2: 18.0 +- 0.5 m
    51 //
    52 //
    53 //                 D1*D1
    54 // conversion C = ------ = 0.0069
    55 //                 D2*D2
    56 //
    57 // Delta C / C  = 2 * Sqrt( (Delta D1/D1)2 + (Delta D2/D2)2 )
    58 // Delta C / C  = 0.4
    59 //
    60 // C = 0.007 +- 0.003
    61 //
    62 const Float_t MCalibrationChargePINDiode::gkFluxCameravsPINDiode      = 0.007;
    63 const Float_t MCalibrationChargePINDiode::gkFluxCameravsPINDiodeErr   = 0.003;
     63const Float_t MCalibrationChargePINDiode::gkSolidAngleRatio      = 0.055;
     64const Float_t MCalibrationChargePINDiode::gkSolidAngleRatioErr   = 0.01;
    6465//
    6566// Average QE of the PIN Diode
     
    120121  SetTimeFitValid       ( kFALSE );
    121122   
    122   fPed                          =  -1.;
    123   fPedRms                       =  -1.;
    124 
    125   fRmsChargeMean                =  -1.;
    126   fRmsChargeMeanErr             =  -1.;
    127   fRmsChargeSigma               =  -1.; 
    128   fRmsChargeSigmaErr            =  -1.;
    129 
    130   fAbsTimeMean                  =  -1.;
    131   fAbsTimeRms                   =  -1.;
    132 
    133   fConvPhotons                  =  -1.;
    134   fConvPhotonsVar               =  -1.;
    135 
    136   fMeanFluxOutsidePlexiglass    =  -1.; 
    137   fMeanFluxOutsidePlexiglassVar =  -1.;
     123  fAbsTimeMean              =  -1.;
     124  fAbsTimeRms               =  -1.;
     125  fFluxOutsidePlexiglass    =  -1.; 
     126  fFluxOutsidePlexiglassVar =  -1.;
     127  fNumPhotons               =  -1.;
     128  fNumPhotonsVar            =  -1.;
     129  fPed                      =  -1.;
     130  fPedRms                   =  -1.;
     131  fRmsChargeMean            =  -1.;
     132  fRmsChargeMeanErr         =  -1.;
     133  fRmsChargeSigma           =  -1.; 
     134  fRmsChargeSigmaErr        =  -1.;
    138135
    139136  MCalibrationPix::Clear();
     
    193190// --------------------------------------------------------------------------
    194191//
    195 // Return -1 if fMeanFluxOutsidePlexiglassVar is smaller than 0.
    196 // Return square root of fMeanFluxOutsidePlexiglassVar
     192// Return -1 if fFluxOutsidePlexiglassVar is smaller than 0.
     193// Return square root of fFluxOutsidePlexiglassVar
    197194//
    198 Float_t MCalibrationChargePINDiode::GetMeanFluxOutsidePlexiglassErr() const
    199 {
    200   if (fMeanFluxOutsidePlexiglassVar < 0.)
     195Float_t MCalibrationChargePINDiode::GetFluxOutsidePlexiglassErr() const
     196{
     197  if (fFluxOutsidePlexiglassVar < 0.)
    201198    return -1.;
    202199 
    203   return TMath::Sqrt(fMeanFluxOutsidePlexiglassVar);
     200  return TMath::Sqrt(fFluxOutsidePlexiglassVar);
    204201}
    205202
     
    227224// Return kFALSE if IsChargeFitValid() is kFALSE
    228225//
    229 // Calculate fMeanFluxOutsidePlexiglass with the formula:
    230 // - fMeanFluxOutsidePlexiglass = fConvPhotons*gkPINDiodeArea*gkFluxCameravsPINDiode
    231 //                              / gkPINDiodeQE (of the corr. colour)
    232 // - fMeanFluxOutsidePlexiglass = fConvPhotons*gkPINDiodeArea*gkFluxCameravsPINDiode
     226// Calculate fFluxOutsidePlexiglass with the formula:
     227// - fFluxOutsidePlexiglass    = fNumPhotons*gkSolidAngleRatio / gkPINDiodeQE (of the corr. colour)
     228// - fFluxOutsidePlexiglassVar = sqrt( fNumPhotonsVar / ( fNumPhotons * fNumPhotons )
     229//                             + ( gkSolidAngleRatioErr * gkSolidAngleRatioErr / gkSolidAngleRatio / gkSolidAngleRatio )
     230//                             + ( gkPINDiodeQEErr * gkPINDiodeQEErr / gkPINDiodeQE / gkPINDiodeQE )
     231//                               ) * fFluxOutsidePlexiglass * * fFluxOutsidePlexiglass
     232//
     233// If the fFluxOutsidePlexiglass is smaller than 0., return kFALSE
     234// If the Variance is smaller than 0., return kFALSE
     235//
     236// SetFluxOutsidePlexiglassAvailable() and return kTRUE
    233237//
    234238Bool_t MCalibrationChargePINDiode::CalcFluxOutsidePlexiglass()
     
    238242    return kFALSE;
    239243 
    240   // Start calculation of number of photons per mm^2 on the camera
    241   fMeanFluxOutsidePlexiglass  = fConvPhotons * gkPINDiodeArea;
     244  //
     245  // Start calculation of number of photons per mm^2 on an inner pixel:
    242246  // Correct for the distance between camera and PIN Diode and for different areas.
    243   fMeanFluxOutsidePlexiglass *= gkFluxCameravsPINDiode;
    244 
     247  //
     248  fFluxOutsidePlexiglass  = fNumPhotons * gkSolidAngleRatio;
     249
     250  //
    245251  // Start calculation of number of photons relative Variance (!!)
    246   fMeanFluxOutsidePlexiglassVar  = fConvPhotonsVar
    247                                  / ( fConvPhotons * fConvPhotons  )  ;
    248   fMeanFluxOutsidePlexiglassVar += gkFluxCameravsPINDiodeErr*gkFluxCameravsPINDiodeErr
    249                                  / gkFluxCameravsPINDiode/gkFluxCameravsPINDiode;
    250  
     252  //
     253  const Float_t numphotRelVar    = fNumPhotonsVar / ( fNumPhotons * fNumPhotons  )  ;
     254  const Float_t solidangleRelVar = gkSolidAngleRatioErr* gkSolidAngleRatioErr
     255                              / ( gkSolidAngleRatio    * gkSolidAngleRatio   );
     256  Float_t fluxRelVar            = numphotRelVar + solidangleRelVar ;
     257
    251258  switch (fColor)
    252259    {
    253260    case kGREEN:
    254       fMeanFluxOutsidePlexiglass    /= gkPINDiodeQEGreen;
    255       fMeanFluxOutsidePlexiglassVar += gkPINDiodeQEGreenErr*gkPINDiodeQEGreenErr
    256                                      / gkPINDiodeQEGreen/gkPINDiodeQEGreen;
     261      fFluxOutsidePlexiglass /= gkPINDiodeQEGreen;
     262      fluxRelVar             +=  gkPINDiodeQEGreenErr* gkPINDiodeQEGreenErr
     263                             / ( gkPINDiodeQEGreen   * gkPINDiodeQEGreen    );
    257264      break;
    258265    case kBLUE:
    259       fMeanFluxOutsidePlexiglass    /= gkPINDiodeQEBlue;
    260       fMeanFluxOutsidePlexiglassVar += gkPINDiodeQEBlueErr*gkPINDiodeQEBlueErr
    261                                      / gkPINDiodeQEBlue/gkPINDiodeQEBlue;
     266      fFluxOutsidePlexiglass /= gkPINDiodeQEBlue;
     267      fluxRelVar             +=  gkPINDiodeQEBlueErr* gkPINDiodeQEBlueErr
     268                             / ( gkPINDiodeQEBlue   * gkPINDiodeQEBlue   );
    262269      break;
    263270    case kUV:
    264       fMeanFluxOutsidePlexiglass    /= gkPINDiodeQEUV;
    265       fMeanFluxOutsidePlexiglassVar += gkPINDiodeQEUVErr*gkPINDiodeQEUVErr
    266                                      / gkPINDiodeQEUV/gkPINDiodeQEUV;
     271      fFluxOutsidePlexiglass /= gkPINDiodeQEUV;
     272      fluxRelVar             +=  gkPINDiodeQEUVErr* gkPINDiodeQEUVErr
     273                             / ( gkPINDiodeQEUV   * gkPINDiodeQEUV    );
    267274      break;
    268275    case kCT1:
    269276    default:
    270       fMeanFluxOutsidePlexiglass    /= gkPINDiodeQECT1;
    271       fMeanFluxOutsidePlexiglassVar += gkPINDiodeQECT1Err*gkPINDiodeQECT1Err
    272                                      / gkPINDiodeQECT1/gkPINDiodeQECT1;
     277      fFluxOutsidePlexiglass /= gkPINDiodeQECT1;
     278      fluxRelVar             +=  gkPINDiodeQECT1Err* gkPINDiodeQECT1Err
     279                             / ( gkPINDiodeQECT1   * gkPINDiodeQECT1    );
    273280      break;
    274281    }
     
    277284  *fLog << inf << endl;
    278285  *fLog << inf << " Mean Photon flux [ph/mm^2] outside Plexiglass: "
    279         << fMeanFluxOutsidePlexiglass << endl;
    280 
    281   if (fMeanFluxOutsidePlexiglass < 0.)
     286        << fFluxOutsidePlexiglass << endl;
     287
     288  if (fFluxOutsidePlexiglass < 0.)
    282289      return kFALSE;
    283290
    284   if (fMeanFluxOutsidePlexiglassVar < 0.)
     291  if (fluxRelVar < 0.)
    285292      return kFALSE;
    286293
     
    290297  // Finish calculation of errors -> convert from relative variance to absolute variance
    291298  //
    292   fMeanFluxOutsidePlexiglassVar *= fMeanFluxOutsidePlexiglass*fMeanFluxOutsidePlexiglass;
     299  fFluxOutsidePlexiglassVar *= fluxRelVar * fFluxOutsidePlexiglass * fFluxOutsidePlexiglass;
    293300
    294301  *fLog << inf << " Error on Photon flux [ph/mm^2] outside Plexiglass: "
    295         << GetMeanFluxOutsidePlexiglassErr() << endl;
     302        << GetFluxOutsidePlexiglassErr() << endl;
    296303  *fLog << inf << endl;
    297304
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargePINDiode.h

    r3658 r3660  
    1313  static const Float_t fgChargeToPhotonsErr;      //! Default for fChargeToPhotonsVar
    1414  static const Float_t gkPINDiodeArea;            //! PIN Diode Effective Area in mm^2 
    15   static const Float_t gkFluxCameravsPINDiode;    //! Flux Conversion PIN Diode - inner pixel
    16   static const Float_t gkFluxCameravsPINDiodeErr; //! Error of flux conv. PIN Diode - inner pixel
    1715  static const Float_t gkPINDiodeQEGreen;         //! Quantum Efficiency at 520 nm
    1816  static const Float_t gkPINDiodeQEBlue;          //! Quantum Efficiency at 460 nm
     
    2018  static const Float_t gkPINDiodeQECT1;           //! Quantum Efficiency at 370 nm
    2119  static const Float_t gkPINDiodeQEGreenErr;      //! Uncertainty QE at 520 nm
    22   static const Float_t gkPINDiodeQEBlueErr ;      //! Uncertainty QE at 460 nm
    23   static const Float_t gkPINDiodeQEUVErr   ;      //! Uncertainty QE at 370 nm
    24   static const Float_t gkPINDiodeQECT1Err  ;      //! Uncertainty QE at 370 nmu
    25  
     20  static const Float_t gkPINDiodeQEBlueErr;       //! Uncertainty QE at 460 nm
     21  static const Float_t gkPINDiodeQEUVErr;         //! Uncertainty QE at 370 nm
     22  static const Float_t gkPINDiodeQECT1Err;        //! Uncertainty QE at 370 nmu
     23  static const Float_t gkSolidAngleRatio;         //! Solid angles ratio PIN Diode - inner pixel
     24  static const Float_t gkSolidAngleRatioErr;      //! Error solid angle ratio PIN Diode - inn. pix.
    2625
    2726  Float_t fAbsTimeMean;                   // Mean Absolute Arrival Time
     
    3332  Float_t fChargeToPhotons;               // Mean conv. PIN Diode charge to number of incident photons
    3433  Float_t fChargeToPhotonsVar;            // Variance of mean conv. PIN Diode charge to nr. incident photons
    35   Float_t fConvPhotons;                   // Number photons incidident on PIN Diode
    36   Float_t fConvPhotonsVar;                // Error on nr. photons incid. on PIN Diode
    37   Float_t fMeanFluxOutsidePlexiglass;     // Mean number photons in INNER PIXEL outside plexiglass
    38   Float_t fMeanFluxOutsidePlexiglassVar;  // Error on nr. photons in INNER PIXEL outside plexiglass
     34  Float_t fNumPhotons;                    // Number photons incidident on PIN Diode
     35  Float_t fNumPhotonsVar;                 // Variance nr. photons incid. on PIN Diode
     36  Float_t fFluxOutsidePlexiglass;         // Mean number photons in INNER PIXEL outside plexiglass
     37  Float_t fFluxOutsidePlexiglassVar;      // Error on nr. photons in INNER PIXEL outside plexiglass
    3938  Float_t fPed;                           // Mean pedestal (from MPedestalPix)
    4039  Float_t fPedRms;                        // Pedestal  RMS (from MPedestalPix)
     
    7372
    7473  // Getters
    75   Float_t GetMeanFluxOutsidePlexiglass()    const { return fMeanFluxOutsidePlexiglass; }
    76   Float_t GetMeanFluxOutsidePlexiglassErr() const;
     74  Float_t GetFluxOutsidePlexiglass()    const { return fFluxOutsidePlexiglass; }
     75  Float_t GetFluxOutsidePlexiglassErr() const;
    7776
    7877  // Pedestals
Note: See TracChangeset for help on using the changeset viewer.