Changeset 4296


Ignore:
Timestamp:
06/16/04 10:39:19 (20 years ago)
Author:
moralejo
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r4292 r4296  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20
     21 2004/06/12: Abelardo Moralejo
     22
     23  * manalysis/MMcCalibrationUpdate.cc
     24  * mcalib/MMcCalibrationCalc.[h,cc]
     25    - Fixed mistake in the calibration which occurred only when
     26      different light collection efficiency was simulated for outer
     27      pixels.
    2028
    2129 2004/06/12: Abelardo Moralejo
  • trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc

    r4291 r4296  
    253253    // (at angle = 90 deg)
    254254
    255     // Set now the conversion from ADC counts to photoelectrons (in case
    256     // no previous calibration existed in the parameter list).
     255    // Set now the default conversion from ADC counts to "photoelectrons"
     256    // (in case no previous calibration existed in the parameter list).
    257257    // As default we want 1 photon = 1 inner pixel ADC count
    258     // (this will make Size to be in ADC counts which is what we want for
    259     // the MC calibration loop. To achieve this we set the ADC to
     258    // (this will make Size to be in ADC counts, which is what we want for
     259    // the MC calibration loop). To achieve this we set the ADC to
    260260    // photoelectron conversion equal to the QE, which will later make the
    261     // ADC to photon conversion factor to be = 1.
     261    // ADC to photon conversion factor (= ADC2PhotEl/QE) to be = 1.
    262262    //
    263263    fADC2PhElInner = MCalibrationQEPix::gkDefaultAverageQE;
    264264
    265265    //
    266     // Set the ADC to photons conversion factor for outer pixels.
    267     // One can choose not to apply the known (in MC) gain factor between
    268     // inner and outer pixels, (fOuterPixelsGainScaling = kFALSE),
     266    // Set the default ADC to "photoelectrons" conversion factor for outer
     267    // pixels. One can choose not to apply the known (in MC) gain factor
     268    // between inner and outer pixels, (in case fOuterPixelsGainScaling = kFALSE),
    269269    // which may be useful for display purposes.
    270     // If we apply the factor, we must take into account the different
    271     // gain photoelectrons->ADC counts, and also apply the correct QE
    272     // (see comment above) for the outer pixels through the factor
    273     // fOuterPixelsLightCollection.
     270    // If on the contrary we apply the factor, we must take into account the
     271    // different gains photoelectrons->ADC counts, given in MC by fAmplitude
     272    // and fAmplitudeOuter. This "default" calibration is such that a shower
     273    // completely contained in the inner part would have Size in ADC counts,
     274    // whereas one partially in the outer part would have Size in "equivalent
     275    // inner ADC counts" : the "same" shower (light density distribution) would
     276    // have the same Size no matter where in the camera it lies. For this we have
     277    // also to set later (see below) the right QE for outer pixels, which may
     278    // be different from that of inner pixels.
    274279    //
    275280
    276281    if (fOuterPixelsGainScaling)
    277282      fADC2PhElOuter =  MCalibrationQEPix::gkDefaultAverageQE
    278           * fOuterPixelsLightCollection
    279           * (fAmplitude / fAmplitudeOuter);
     283        * (fAmplitude / fAmplitudeOuter);
    280284    else
    281285      fADC2PhElOuter = fADC2PhElInner;
     
    306310          fADC2PhElOuter : fADC2PhElInner;
    307311
     312
    308313        calpix.SetMeanConvFADC2Phe(adc2photel);
    309314        calpix.SetMeanConvFADC2PheVar(0.);
     
    314319    //
    315320    // Now set the average QE for each type of pixels. Correct outer pixels
    316     // by different light collection efficiency.
     321    // for different light collection efficiency.
    317322    //
    318323    num = fQECam->GetSize();
     
    320325    {
    321326        MCalibrationQEPix &qepix = (MCalibrationQEPix&)(*fQECam)[i];
    322         Float_t avqe =
    323             (fGeom->GetPixRatio(i) < fGeom->GetPixRatio(0))?
    324             MCalibrationQEPix::gkDefaultAverageQE*fOuterPixelsLightCollection:
    325             MCalibrationQEPix::gkDefaultAverageQE;
     327
     328        Float_t avqe = MCalibrationQEPix::gkDefaultAverageQE;
     329
     330        if (fOuterPixelsGainScaling)
     331          if (fGeom->GetPixRatio(i) < fGeom->GetPixRatio(0))
     332            avqe = MCalibrationQEPix::gkDefaultAverageQE*fOuterPixelsLightCollection;
    326333
    327334        qepix.SetAverageQE(avqe);
  • trunk/MagicSoft/Mars/mcalib/MMcCalibrationCalc.cc

    r3852 r4296  
    2828//
    2929//  Input Containers:
     30//   MMcConfigRunHeader
    3031//   MRawRunHeader
    3132//   MMcFadcHeader
     
    5758#include "MGeomCam.h"
    5859#include "MRawRunHeader.h"
     60#include "MMcConfigRunHeader.h"
    5961
    6062#include "MHillas.h"
     
    194196  }
    195197
     198  // Now check the light collection for inner and outer pixels to
     199  // calculate the ratio between the two. FIXME! Light collection
     200  // depends on the incidence angle of the light w.r.t. the camera
     201  // plane. For the moment we take the ratio for light impinging
     202  // perpendicular to the camera plane.
     203  //
     204  // FIXME! We should look for AddSerialNumber("MMcConfigRunHeader") but
     205  // for the moment the stereo version of camera does not write one such
     206  // header per telescope (it should!)
     207  //
     208  MMcConfigRunHeader* mcconfig = (MMcConfigRunHeader*) pList->FindObject("MMcConfigRunHeader");
     209  if (!mcconfig)
     210    {
     211      *fLog << err << "MMcConfigRunHeader" << " not found... aborting." << endl;
     212      return kFALSE;
     213    }
     214  TArrayF innerlightcoll = mcconfig->GetLightCollectionFactor();
     215  TArrayF outerlightcoll = mcconfig->GetLightCollectionFactorOuter();
     216
     217  // In principle outer pixels seem to have a different average light
     218  // collection efficiency than outer ones. We set here the factor between
     219  // the two.
     220
     221  fOuterPixelsLightCollection = outerlightcoll[90] / innerlightcoll[90];
     222  // (at angle = 90 deg)
     223
     224
    196225  return kTRUE;
    197226}
     
    210239        return kTRUE;
    211240
     241    const Float_t size = fHillas->GetSize();
     242    const Float_t innersize = fNew->GetInnerSize();
     243
     244    // Size will at this point be in ADC counts (still uncalibrated)
    212245    //
    213246    // Exclude events with low Size (larger fluctuations)
     
    216249    //   
    217250
    218     const Float_t size = fHillas->GetSize();
    219     // Size will at this point be in ADC counts (still uncalibrated)
    220 
    221251    if (size < 1000)
    222252        return kTRUE;
    223253
    224     fHistADC2PhotEl->Fill(TMath::Log10(fMcEvt->GetPhotElfromShower()/size));
    225     fHistPhot2PhotEl->Fill( (Float_t) fMcEvt->GetPhotElfromShower() /
    226                         (Float_t) fMcEvt->GetPassPhotCone() );
     254    //
     255    // PATCH: Convert number of photoelectrons in camera to the approximate number
     256    // of photoelectrons that would have been registered if all pixels had the same
     257    // light collection efficiency as inner ones (called here "corrected_photel").
     258    //
     259 
     260    const Float_t inner_photel = (Float_t) fMcEvt->GetPhotElfromShower() * innersize / size;
     261    const Float_t outer_photel = (Float_t) fMcEvt->GetPhotElfromShower() - inner_photel;
     262
     263    const Float_t corrected_photel = inner_photel + outer_photel / fOuterPixelsLightCollection;
     264
     265
     266    //    fHistADC2PhotEl->Fill(TMath::Log10(fMcEvt->GetPhotElfromShower()/size));
     267
     268    fHistADC2PhotEl->Fill(TMath::Log10(corrected_photel/size));
     269    fHistPhot2PhotEl->Fill( corrected_photel / (Float_t) fMcEvt->GetPassPhotCone() );
    227270
    228271    return kTRUE;
     
    270313        MCalibrationQEPix     &qepix  = (MCalibrationQEPix&)    (*fQECam) [i];
    271314
    272         qepix.SetAverageQE(fPhot2PhotEl);
     315        Float_t qe = fPhot2PhotEl;
     316        if (fGeom->GetPixRatio(i) < 1.)
     317          qe *= fOuterPixelsLightCollection;
     318        qepix.SetAverageQE(qe);
    273319
    274320        qepix.SetAvNormFFactor(1.);
     
    284330        //
    285331        // We take into account the (possibly) different gain of outer pixels:
     332        // FIXME: we are now assuming that all inner pixels have the same gain, and all
     333        // outer pixels have the same gain (different from inner ones though). This can
     334        // only be like this in camera 0.7, but may change in future versions of camera.
    286335        //
     336
    287337        if (fGeom->GetPixRatio(i) < 1.)
    288338          factor *= fHeaderFadc->GetAmplitud()/fHeaderFadc->GetAmplitudOuter();
  • trunk/MagicSoft/Mars/mcalib/MMcCalibrationCalc.h

    r3852 r4296  
    2727    MMcFadcHeader             *fHeaderFadc;
    2828
    29     Float_t fADC2PhotEl;   // Conversion factor (photel / ADC count)
    30     Float_t fPhot2PhotEl;  // Conversion factor (photons / photoelectron) = average QE
     29    Float_t fADC2PhotEl;   // Conversion factor (photel / ADC count). FOR INER PIXELS
     30    Float_t fPhot2PhotEl;  // Conversion factor (photons / photoelectron) = average QE. FOR INER PIXELS
    3131    Long_t  fEvents;
     32    Float_t fOuterPixelsLightCollection; // Light collection efficiency (plexiglas, light guide) of
     33                                         // outer pixels w.r.t inner ones
    3234
    3335    TH1F*   fHistADC2PhotEl;
Note: See TracChangeset for help on using the changeset viewer.