Changeset 3658


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

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3655 r3658  
    2525
    2626   * mcalib/MCalibrationChargeCalc.[h,cc]
     27   * mcalib/MCalibrationChargeCam.cc
    2728     - holds also pointers to MExtractedSignalPINDiode and
    2829       MExtractedSignalBlindPixel and does the checks inside the task
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc

    r3638 r3658  
    10391039
    10401040  Float_t flux    = pindiode.GetMeanFluxOutsidePlexiglass();
    1041   Float_t fluxerr = pindiode.GetMeanFluxErrOutsidePlexiglass();
     1041  Float_t fluxerr = pindiode.GetMeanFluxOutsidePlexiglassErr();
    10421042
    10431043  TIter Next(fPixels);
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargePINDiode.cc

    r3656 r3658  
    2424
    2525/////////////////////////////////////////////////////////////////////////////
    26 //                                                                         //
    27 // MCalibrationChargePINDiode                                                            //
    28 //                                                                         //
    29 // This is the storage container to hold informations about the pedestal   //
    30 // (offset) value of one Pixel (PMT).                                      //
    31 //                                                                         //
     26//                                     
     27// MCalibrationChargePINDiode       
     28//                                 
     29// Storage container of the fit results of the PIN Diode signal
     30// (from MHCalibrationChargePINDiode). The PIN Diode is not yet working, so
     31// is the documentation for the moment.
     32//
    3233/////////////////////////////////////////////////////////////////////////////
    3334#include "MCalibrationChargePINDiode.h"
     35#include "MCalibrationChargePix.h"
    3436
    3537#include "MLog.h"
     
    4042using namespace std;
    4143
    42 const Float_t MCalibrationChargePINDiode::fgChargeLimit        = 3.;
    43 const Float_t MCalibrationChargePINDiode::fgChargeErrLimit     = 0.;   
    44 const Float_t MCalibrationChargePINDiode::fgChargeRelErrLimit  = 1.;
    45 
    46 const Float_t MCalibrationChargePINDiode::fgConvPhotons        = -1.;
    47 const Float_t MCalibrationChargePINDiode::fgConvPhotonsErr     = -1.;
     44const Float_t MCalibrationChargePINDiode::fgChargeToPhotons    = -1.;
     45const Float_t MCalibrationChargePINDiode::fgChargeToPhotonsErr = -1.;
    4846//
    4947// Area of Inner Pixel w.r.t. PIN Diode (which is 1 cm2)
     
    8482// Default Constructor.
    8583//
     84// Sets:
     85// - fCalibFlags to 0
     86// - fChargeToPhotons to fgChargeToPhotons
     87// - fChargeToPhotonsVar to fgChargeToPhotonsErr*fgChargeToPhotonsErr
     88//
     89// Calls:
     90// - Clear()
     91//
    8692MCalibrationChargePINDiode::MCalibrationChargePINDiode(const char *name, const char *title)
    8793    : fCalibFlags(0)
     
    9197  fTitle = title ? title : "Container of the fit results of MHCalibrationChargePINDiode";
    9298
     99  SetChargeToPhotons();
     100  SetChargeToPhotonsErr();
     101
    93102  Clear();
    94103
    95   SetChargeLimit();
    96   SetChargeErrLimit();
    97   SetChargeRelErrLimit();
    98 
    99   SetConvPhotons();
    100   SetConvPhotonsErr();
    101 
    102   SetOscillating          ( kFALSE );
    103   SetExcluded             ( kFALSE );
    104104}
    105105
    106106// ------------------------------------------------------------------------
    107107//
    108 // Invalidate values
     108// Sets:
     109// - all flags to kFALSE
     110// - all variables to -1.
     111//
     112// Calls:
     113// - MCalibrationPix::Clear()
    109114//
    110115void MCalibrationChargePINDiode::Clear(Option_t *o)
    111116{
    112117
     118  SetOscillating        ( kFALSE );
    113119  SetChargeFitValid     ( kFALSE );
    114120  SetTimeFitValid       ( kFALSE );
    115121   
    116   fPed                              =  -1.;
    117   fPedRms                           =  -1.;
    118 
    119   fRmsChargeMean                    =  -1.;
    120   fRmsChargeMeanErr                 =  -1.;
    121   fRmsChargeSigma                   =  -1.; 
    122   fRmsChargeSigmaErr                =  -1.;
    123 
    124   fAbsTimeMean                      =  -1.;
    125   fAbsTimeRms                       =  -1.;
    126 
    127   fConvertedPhotons                 =  -1.;
    128   fConvertedPhotonsErr              =  -1.;
    129 
    130   fMeanFluxOutsidePlexiglass        =  -1.; 
    131   fMeanFluxErrOutsidePlexiglass     =  -1.;
    132 
     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.;
     138
     139  MCalibrationPix::Clear();
    133140}
    134141
     
    158165// --------------------------------------------------------------------------
    159166//
    160 // Set the Excluded Bit from outside
     167// Set the ChargeFitValid Bit from outside
    161168//
    162169void MCalibrationChargePINDiode::SetChargeFitValid(Bool_t b )   
     
    167174// --------------------------------------------------------------------------
    168175//
    169 // Set the Excluded Bit from outside
     176// Set the TimeFitValid Bit from outside
    170177//
    171178void MCalibrationChargePINDiode::SetTimeFitValid(Bool_t b )   
     
    174181}
    175182
     183// --------------------------------------------------------------------------
     184//
     185// Set the FluxOutsidePlexiglassAvailable Bit from outside
     186//
    176187void MCalibrationChargePINDiode::SetFluxOutsidePlexiglassAvailable (const Bool_t b)
    177188{
    178   b ?  SETBIT(fCalibFlags, kFluxOutsidePlexiglassAvailable) : CLRBIT(fCalibFlags, kFluxOutsidePlexiglassAvailable);
    179 }
    180 
     189  b ?  SETBIT(fCalibFlags, kFluxOutsidePlexiglassAvailable)
     190    : CLRBIT(fCalibFlags, kFluxOutsidePlexiglassAvailable);
     191}
     192
     193// --------------------------------------------------------------------------
     194//
     195// Return -1 if fMeanFluxOutsidePlexiglassVar is smaller than 0.
     196// Return square root of fMeanFluxOutsidePlexiglassVar
     197//
     198Float_t MCalibrationChargePINDiode::GetMeanFluxOutsidePlexiglassErr() const
     199{
     200  if (fMeanFluxOutsidePlexiglassVar < 0.)
     201    return -1.;
     202 
     203  return TMath::Sqrt(fMeanFluxOutsidePlexiglassVar);
     204}
     205
     206
     207// --------------------------------------------------------------------------
     208//
     209// Test bit kChargeFitValid
     210//
    181211Bool_t MCalibrationChargePINDiode::IsChargeFitValid() const
    182212{
     
    184214}
    185215
     216// --------------------------------------------------------------------------
     217//
     218// Test bit kTimeFitValid
     219//
    186220Bool_t MCalibrationChargePINDiode::IsTimeFitValid()   const
    187221{
     
    189223}
    190224
     225// --------------------------------------------------------------------------
     226//
     227// Return kFALSE if IsChargeFitValid() is kFALSE
     228//
     229// Calculate fMeanFluxOutsidePlexiglass with the formula:
     230// - fMeanFluxOutsidePlexiglass = fConvPhotons*gkPINDiodeArea*gkFluxCameravsPINDiode
     231//                              / gkPINDiodeQE (of the corr. colour)
     232// - fMeanFluxOutsidePlexiglass = fConvPhotons*gkPINDiodeArea*gkFluxCameravsPINDiode
     233//
    191234Bool_t MCalibrationChargePINDiode::CalcFluxOutsidePlexiglass()
    192235{
     
    196239 
    197240  // Start calculation of number of photons per mm^2 on the camera
    198   fMeanFluxOutsidePlexiglass  = fConvertedPhotons * gkPINDiodeArea;
     241  fMeanFluxOutsidePlexiglass  = fConvPhotons * gkPINDiodeArea;
    199242  // Correct for the distance between camera and PIN Diode and for different areas.
    200243  fMeanFluxOutsidePlexiglass *= gkFluxCameravsPINDiode;
    201244
    202245  // Start calculation of number of photons relative Variance (!!)
    203   fMeanFluxErrOutsidePlexiglass  = fConvertedPhotonsErr * fConvertedPhotonsErr
    204                                  / fConvertedPhotons    / fConvertedPhotons    ;
    205   fMeanFluxErrOutsidePlexiglass += gkFluxCameravsPINDiodeErr*gkFluxCameravsPINDiodeErr
     246  fMeanFluxOutsidePlexiglassVar  = fConvPhotonsVar
     247                                 / ( fConvPhotons * fConvPhotons  )  ;
     248  fMeanFluxOutsidePlexiglassVar += gkFluxCameravsPINDiodeErr*gkFluxCameravsPINDiodeErr
    206249                                 / gkFluxCameravsPINDiode/gkFluxCameravsPINDiode;
    207250 
     
    210253    case kGREEN:
    211254      fMeanFluxOutsidePlexiglass    /= gkPINDiodeQEGreen;
    212       fMeanFluxErrOutsidePlexiglass += gkPINDiodeQEGreenErr*gkPINDiodeQEGreenErr
     255      fMeanFluxOutsidePlexiglassVar += gkPINDiodeQEGreenErr*gkPINDiodeQEGreenErr
    213256                                     / gkPINDiodeQEGreen/gkPINDiodeQEGreen;
    214257      break;
    215258    case kBLUE:
    216259      fMeanFluxOutsidePlexiglass    /= gkPINDiodeQEBlue;
    217       fMeanFluxErrOutsidePlexiglass += gkPINDiodeQEBlueErr*gkPINDiodeQEBlueErr
     260      fMeanFluxOutsidePlexiglassVar += gkPINDiodeQEBlueErr*gkPINDiodeQEBlueErr
    218261                                     / gkPINDiodeQEBlue/gkPINDiodeQEBlue;
    219262      break;
    220263    case kUV:
    221264      fMeanFluxOutsidePlexiglass    /= gkPINDiodeQEUV;
    222       fMeanFluxErrOutsidePlexiglass += gkPINDiodeQEUVErr*gkPINDiodeQEUVErr
     265      fMeanFluxOutsidePlexiglassVar += gkPINDiodeQEUVErr*gkPINDiodeQEUVErr
    223266                                     / gkPINDiodeQEUV/gkPINDiodeQEUV;
    224267      break;
     
    226269    default:
    227270      fMeanFluxOutsidePlexiglass    /= gkPINDiodeQECT1;
    228       fMeanFluxErrOutsidePlexiglass += gkPINDiodeQECT1Err*gkPINDiodeQECT1Err
     271      fMeanFluxOutsidePlexiglassVar += gkPINDiodeQECT1Err*gkPINDiodeQECT1Err
    229272                                     / gkPINDiodeQECT1/gkPINDiodeQECT1;
    230273      break;
     
    239282      return kFALSE;
    240283
    241   if (fMeanFluxErrOutsidePlexiglass < 0.)
     284  if (fMeanFluxOutsidePlexiglassVar < 0.)
    242285      return kFALSE;
    243286
    244287  SetFluxOutsidePlexiglassAvailable(); 
    245288
    246   // Finish calculation of errors -> convert from relative variance to absolute error
    247   fMeanFluxErrOutsidePlexiglass = TMath::Sqrt(fMeanFluxErrOutsidePlexiglass);
    248   fMeanFluxErrOutsidePlexiglass *= fMeanFluxOutsidePlexiglass;
     289  //
     290  // Finish calculation of errors -> convert from relative variance to absolute variance
     291  //
     292  fMeanFluxOutsidePlexiglassVar *= fMeanFluxOutsidePlexiglass*fMeanFluxOutsidePlexiglass;
    249293
    250294  *fLog << inf << " Error on Photon flux [ph/mm^2] outside Plexiglass: "
    251         << fMeanFluxErrOutsidePlexiglass << endl;
     295        << GetMeanFluxOutsidePlexiglassErr() << endl;
    252296  *fLog << inf << endl;
    253297
    254298  return kTRUE;
    255299}
    256 
    257 
    258 
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargePINDiode.h

    r3656 r3658  
    1010private:
    1111
    12   static const Float_t fgChargeLimit;             //! Default for fChargeLimit
    13   static const Float_t fgChargeErrLimit;          //! Default for fChargeErrLimit
    14   static const Float_t fgChargeRelErrLimit;       //! Default for fChargeRelErrLimit
    15   static const Float_t fgConvPhotons;             //! Default for fConversionChargePhotons
    16   static const Float_t fgConvPhotonsErr;          //! Default for fConversionChargePhotonsErr
     12  static const Float_t fgChargeToPhotons;         //! Default for fChargeToPhotons
     13  static const Float_t fgChargeToPhotonsErr;      //! Default for fChargeToPhotonsVar
    1714  static const Float_t gkPINDiodeArea;            //! PIN Diode Effective Area in mm^2 
    1815  static const Float_t gkFluxCameravsPINDiode;    //! Flux Conversion PIN Diode - inner pixel
     
    3431  Float_t fChargeErrLimit;                // Limit (in units of PedRMS) for acceptance fitted charge sigma
    3532  Float_t fChargeRelErrLimit;             // Limit (in units of Error of fitted charge) for acceptance fitted mean 
    36   Float_t fConvPhotons;                   // Mean conv. PIN Diode charge to number of incident photons
    37   Float_t fConvPhotonsErr;                // Error mean conv. PIN Diode charge to nr. incident photons
    38   Float_t fConvertedPhotons;              // Number photons incidident on PIN Diode
    39   Float_t fConvertedPhotonsErr;           // Error on nr. photons incid. on PIN Diode
     33  Float_t fChargeToPhotons;               // Mean conv. PIN Diode charge to number of incident photons
     34  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
    4037  Float_t fMeanFluxOutsidePlexiglass;     // Mean number photons in INNER PIXEL outside plexiglass
    41   Float_t fMeanFluxErrOutsidePlexiglass;  // Error on nr. photons in INNER PIXEL outside plexiglass
     38  Float_t fMeanFluxOutsidePlexiglassVar;  // Error on nr. photons in INNER PIXEL outside plexiglass
    4239  Float_t fPed;                           // Mean pedestal (from MPedestalPix)
    4340  Float_t fPedRms;                        // Pedestal  RMS (from MPedestalPix)
     
    6057 
    6158  // Setters
    62   void SetAbsTimeMean      ( const Float_t f )                     { fAbsTimeMean       = f; }
    63   void SetAbsTimeRms       ( const Float_t f )                     { fAbsTimeRms        = f; }
    64   void SetChargeLimit      ( const Float_t f=fgChargeLimit       ) { fChargeLimit       = f; }
    65   void SetChargeErrLimit   ( const Float_t f=fgChargeErrLimit    ) { fChargeErrLimit    = f; }
    66   void SetChargeRelErrLimit( const Float_t f=fgChargeRelErrLimit ) { fChargeRelErrLimit = f; }
    67   void SetColor            ( const PulserColor_t color           ) { fColor = color;         }
    68   void SetConvPhotons      ( const Float_t f=fgConvPhotons       ) { fConvPhotons       = f; } 
    69   void SetConvPhotonsErr   ( const Float_t f=fgConvPhotonsErr    ) { fConvPhotonsErr    = f; } 
    70   void SetPedestal         (       Float_t ped, Float_t pedrms   );
    71   void SetRmsChargeMean    ( const Float_t f )                     { fRmsChargeMean     = f; }
    72   void SetRmsChargeMeanErr ( const Float_t f )                     { fRmsChargeMeanErr  = f; }
    73   void SetRmsChargeSigma   ( const Float_t f )                     { fRmsChargeSigma    = f; }
    74   void SetRmsChargeSigmaErr( const Float_t f )                     { fRmsChargeSigmaErr = f; }
    75   void SetOscillating      ( const Bool_t b=kTRUE );
    76   void SetChargeFitValid   ( const Bool_t b=kTRUE );
    77   void SetTimeFitValid     ( const Bool_t b=kTRUE );
     59  void SetAbsTimeMean        ( const Float_t f )                      { fAbsTimeMean        = f;   }
     60  void SetAbsTimeRms         ( const Float_t f )                      { fAbsTimeRms         = f;   }
     61  void SetChargeToPhotons    ( const Float_t f=fgChargeToPhotons    ) { fChargeToPhotons    = f;   } 
     62  void SetChargeToPhotonsErr ( const Float_t f=fgChargeToPhotonsErr ) { fChargeToPhotonsVar = f*f; } 
     63  void SetColor              ( const PulserColor_t color            ) { fColor = color;            }
     64  void SetPedestal           (       Float_t ped, Float_t pedrms    );
     65  void SetRmsChargeMean      ( const Float_t f )                      { fRmsChargeMean      = f;   }
     66  void SetRmsChargeMeanErr   ( const Float_t f )                      { fRmsChargeMeanErr   = f;   }
     67  void SetRmsChargeSigma     ( const Float_t f )                      { fRmsChargeSigma     = f;   }
     68  void SetRmsChargeSigmaErr  ( const Float_t f )                      { fRmsChargeSigmaErr  = f;   }
     69  void SetOscillating        ( const Bool_t b=kTRUE );
     70  void SetChargeFitValid     ( const Bool_t b=kTRUE );
     71  void SetTimeFitValid       ( const Bool_t b=kTRUE );
    7872  void SetFluxOutsidePlexiglassAvailable ( const Bool_t b = kTRUE );
    7973
    8074  // Getters
    8175  Float_t GetMeanFluxOutsidePlexiglass()    const { return fMeanFluxOutsidePlexiglass; }
    82   Float_t GetMeanFluxErrOutsidePlexiglass() const { return fMeanFluxErrOutsidePlexiglass; }
     76  Float_t GetMeanFluxOutsidePlexiglassErr() const;
    8377
    8478  // Pedestals
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.cc

    r3654 r3658  
    108108  fTitle = title ? title : "Container of the fit results of MHCalibrationChargePixs ";
    109109
    110   Clear();
    111 
    112110  //
    113111  // At the moment, we don't have a database, yet,
     
    119117  SetPheFFactorMethodLimit();
    120118 
     119  Clear();
    121120}
    122121
     
    124123//
    125124// Sets:
    126 // - all flags to 0
     125// - all flags to kFALSE
    127126// - all variables to -1.
    128127//
Note: See TracChangeset for help on using the changeset viewer.