Changeset 6318


Ignore:
Timestamp:
02/09/05 19:37:19 (20 years ago)
Author:
moralejo
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r6313 r6318  
    2222
    2323 2005/02/09 Abelardo Moralejo
     24
     25   * manalysis/MMcCalibrationUpdate.cc
     26     - Updated to make the MC calibration in phe- work
     27
     28   * macros/starmc.C
     29     - same as above. Now default is calibration in phe-
    2430
    2531   * mraw/MRawEvtHeader.h
  • trunk/MagicSoft/Mars/macros/starmc.C

    r5819 r6318  
    5252  // differences in gain of outer pixels)
    5353  //
    54   CalibrationFilename = new TString("/data1/magic/mc_data/root/Period021_0.73_mirror/gammas_nonoise/Gamma_zbin0_*.root");
     54  CalibrationFilename = new TString("/users/emc/moralejo/mcdata/Period021_0.73_mirror/gammas_nonoise/Gamma_zbin0_*.root");
     55
    5556  // File to be used in the calibration (must be a camera file without added noise)
    5657
    57   Char_t* AnalysisFilename = "Gamma_zbin*.root";  // File to be analyzed
     58  Char_t* AnalysisFilename = "Gamma_*w0.root";  // File to be analyzed
     59  //  Char_t* AnalysisFilename = "Gamma_*1000to1009*w0.root";  // File to be analyzed
    5860
    5961
     
    7274  Float_t accepted_fraction = 1.;
    7375
    74   Float_t CleanLev[2] = {3., 2.}; // Tail cuts for image analysis
     76  Float_t CleanLev[2] = {5.75, 3.84}; // Tail cuts for image analysis
     77  MImgCleanStd  clean(CleanLev[0], CleanLev[1]); // Applies tail cuts to image.
     78  //  clean.SetMethod(MImgCleanStd::kScaled);
    7579
    7680  //  Int_t BinsHigh[2] = {5, 10}; // First and last FADC bin of the range to be integrated,
     
    8185  //  sigextract.SetRange(BinsHigh[0], BinsHigh[1], BinsLow[0], BinsLow[1]);
    8286
    83   MExtractFixedWindowPeakSearch sigextract;
    84   sigextract.SetWindows(6, 6, 4);
     87//     MExtractFixedWindowPeakSearch sigextract;
     88//     sigextract.SetWindows(6, 6, 4);
     89
     90   MExtractTimeAndChargeDigitalFilter sigextract;
     91   sigextract.SetNameWeightsFile("/users/emc/moralejo/Mars/msignal/MC_weights.dat");
     92   sigextract.SetNameWeightsFile("/users/emc/moralejo/Mars/msignal/cosmics_weights.dat");
     93   sigextract.SetRange(1, 14, 3, 14);
    8594
    8695  MSrcPosCam src;
     
    136145  MCalibrateData calib; // Transforms signals from ADC counts into photons.
    137146  calib.SetCalibrationMode(MCalibrateData::kFfactor);
     147  calib.SetSignalType(MCalibrateData::kPhe);
    138148
    139149  //    MBlindPixelCalc   blind;
    140150  //    blind.SetUseInterpolation();
    141 
    142   MImgCleanStd      clean(CleanLev[0], CleanLev[1]); // Applies tail cuts to image.
    143151
    144152  MHillasCalc       hcalc; // Calculates Hillas parameters not dependent on source position.
     
    223231  //
    224232
    225   MProgressBar bar;
    226   bar.SetWindowName("Calibrating...");
     233  //  MProgressBar bar;
     234  //  bar.SetWindowName("Calibrating...");
    227235
    228236  MEvtLoop evtloop;
    229   evtloop.SetProgressBar(&bar);
     237  //  evtloop.SetProgressBar(&bar);
    230238  evtloop.SetParList(&plist);
    231239
     
    261269  tlist.AddToListBefore(&skip, &sigextract);
    262270
    263   bar.SetWindowName("Analyzing...");
     271  //  bar.SetWindowName("Analyzing...");
    264272
    265273  tlist.RemoveFromList(&mccalibcalc); // Removes calibration task from list.
  • trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc

    r5977 r6318  
    3030//  MMcFadcHeader and translates it to the pedestal mean and rms (in adc counts).
    3131//  If not already existing in the parameter list, an MCalibrationCam object
    32 //  is created, with the conversion factor between photons and ADC counts is
    33 //  set to 1 to allow the analysis to proceed.
     32//  is created, with the conversion factor between ADC counts and photons or
     33//  photoelectrons (depending on fSignalType) is set to 1 to allow the analysis
     34//  to proceed.
    3435//
    3536//  Then it creates and fills also the MPedPhotCam object containing the pedestal
    36 //  mean and rms in units of photons.
     37//  mean and rms in units of photons or photoelectrons.
    3738//
    3839//  Input Containers:
     
    7172#include "MMcFadcHeader.hxx"
    7273#include "MMcConfigRunHeader.h"
     74#include "MCalibrateData.h"
    7375
    7476ClassImp(MMcCalibrationUpdate);
     
    8587    fAmplitudeOuter = -1.;
    8688    fConversionHiLo = -1.;
     89
     90    fSignalType = MCalibrateData::kPhe;
    8791
    8892    fFillCalibrationCam = kTRUE;
     
    221225    // If MCalibrationChargeCam and MCalibrationQECam already existed
    222226    // in the parameter list before MMcCalibrationUpdate::PreProcess was
    223     // executed (from a previous calibration loop) we must not fill it,
     227    // executed (from a previous calibration loop) we must not fill them,
    224228    // hence nothing else has to be done in ReInit:
    225229    //
     
    233237    // perpendicular to the camera plane.
    234238    //
    235     // FIXME! We should look for AddSerialNumber("MMcConfigRunHeader") but
     239    // FIXME! We look for AddSerialNumber("MMcConfigRunHeader") but
    236240    // for the moment the stereo version of camera does not write one such
    237241    // header per telescope (it should!)
     
    254258    // (at angle = 90 deg)
    255259
    256     // Set now the default conversion from ADC counts to "photoelectrons"
     260    // Set now the default conversion from ADC counts to photoelectrons
    257261    // (in case no previous calibration existed in the parameter list).
    258     // As default we want 1 photon = 1 inner pixel ADC count
    259     // (this will make Size to be in ADC counts, which is what we want for
    260     // the MC calibration loop). To achieve this we set the ADC to
    261     // photoelectron conversion equal to the QE, which will later make the
    262     // ADC to photon conversion factor (= ADC2PhotEl/QE) to be = 1.
    263     //
    264     fADC2PhElInner = MCalibrationQEPix::gkDefaultAverageQE;
     262    //
     263    // As default we want to have SIZE in ADC counts, or rather, in "inner pixel
     264    // equivalent ADC counts".
     265    //
     266    // To achieve this:
     267    // - In the case fSignalType==kPhot: we set the ADC to photoelectron conversion
     268    // equal to the QE, which will later make the ADC to photon conversion factor
     269    // (= ADC2PhotEl/QE) to be = 1,
     270    //
     271    // - In the case fSignalType==kPhe: we set the ADC to photoelectron conversion
     272    // equal to 1, since this will be applied directly to the signals...
     273
     274    if (fSignalType == MCalibrateData::kPhot)
     275      fADC2PhElInner = MCalibrationQEPix::gkDefaultAverageQE;
     276    else
     277      fADC2PhElInner = 1.;
    265278
    266279    //
     
    281294
    282295    if (fOuterPixelsGainScaling)
    283       fADC2PhElOuter =  MCalibrationQEPix::gkDefaultAverageQE
     296      fADC2PhElOuter = fADC2PhElInner
    284297        * (fAmplitude / fAmplitudeOuter);
    285298    else
     
    397410
    398411        Float_t qe       = qepix.GetAverageQE();
    399         Float_t adc2phot = calpix.GetMeanConvFADC2Phe() / qe;
     412
     413
     414        Float_t conv = (fSignalType == MCalibrateData::kPhot?
     415          calpix.GetMeanConvFADC2Phe() / qe  :
     416          calpix.GetMeanConvFADC2Phe());
     417
    400418        Float_t hi2lo    = calpix.GetConversionHiLo();
    401419
    402420        if (sigpix.IsLoGainUsed())
    403             pedpix.Set(adc2phot*hi2lo*pedestmean, adc2phot*hi2lo*pedestrms);
     421            pedpix.Set(conv*hi2lo*pedestmean, conv*hi2lo*pedestrms);
    404422        else
    405             pedpix.Set(adc2phot*pedestmean, adc2phot*pedestrms);
     423            pedpix.Set(conv*pedestmean, conv*pedestrms);
    406424
    407425    }
     
    409427    return kTRUE;
    410428}
     429
Note: See TracChangeset for help on using the changeset viewer.