Changeset 9625 for trunk


Ignore:
Timestamp:
08/06/10 11:47:39 (14 years ago)
Author:
tbretz
Message:
Made baseline, baseline noise and gain accessible from the resources.
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9618 r9625  
    1919                                                 -*-*- END OF LINE -*-*-
    2020
     21 2010/08/06 Thomas Bretz
     22
     23   * msimcamera/MSimCamera.[h,cc]:
     24     - added the possibility to set an overall baseline, baseline-noise
     25       and gain.
     26
     27   * ceres.rc:
     28     - added entries for the new values
     29
     30
     31
    2132 2010/07/28 Daniela Dorner
    2233
  • trunk/MagicSoft/Mars/NEWS

    r9615 r9625  
    3838     has been implemented to set an artificial run-number:
    3939        ---run-number=12345
     40
     41   * The baseline, the baseline noise and the gain (multiplicator to the
     42     pulse) are now accessible from the outside. The new values are:
     43        MSimCamera.DefaultOffset
     44        MSimCamera.DefaultNoise
     45        MSimCamera.DefaultGain
    4046
    4147 ;star:
  • trunk/MagicSoft/Mars/ceres.rc

    r9575 r9625  
    233233#MPulseShape.Function.Xmax:   45
    234234
     235# Old values
     236# Baseline at 15 like in MAGIC
     237# 1.5 bit noise for a gain of 64
     238# This allows a maximum of 200phe/pix
     239MSimCamera.DefaultOffset: 960
     240MSimCamera.DefaultNoise:   96
     241MSimCamera.DefaultGain:   256
     242
     243# New values
     244#MSimCamera.DefaultOffset: 1000
     245#MSimCamera.DefaultNoise:    30
     246#MSimCamera.DefaultGain:    190
     247
     248
    235249# -------------------------------------------------------------------------
    236250# Setup an image cleaning on the pure gamma signal (without noise)
  • trunk/MagicSoft/Mars/msimcamera/MSimCamera.cc

    r9425 r9625  
    7474MSimCamera::MSimCamera(const char* name, const char *title)
    7575    : fEvt(0), fStat(0), fRunHeader(0), fElectronicNoise(0), fGain(0),
    76     fCamera(0), fMcEvt(0), fSpline(0), fBaselineGain(kFALSE)
     76    fCamera(0), fMcEvt(0), fSpline(0), fBaselineGain(kFALSE),
     77    fDefaultOffset(-1), fDefaultNoise(-1), fDefaultGain(-1)
     78
    7779{
    7880    fName  = name  ? name  : "MSimCamera";
     
    171173    for (int i=0; i<fElectronicNoise->GetSize(); i++)
    172174    {
    173         // 64 -> Dynamic range 12 bit left
    174175        MPedestalPix &ped = (*fElectronicNoise)[i];
    175         ped.SetPedestal(15*64);     // Baseline at 15 like in MAGIC
    176         ped.SetPedestalRms(1.5*64); //2.0); // 1.5 bit noise for a gain of 64
     176        if (fDefaultOffset>0)
     177            ped.SetPedestal(fDefaultOffset);
     178        if (fDefaultNoise>0)
     179            ped.SetPedestalRms(fDefaultNoise);
     180
    177181        ped.SetPedestalABoffset(0);
    178182        ped.SetNumEvents(0);
    179183
    180         // 256 scale from 8bit to 16bit
    181         // 8 signal height of one phe
     184
    182185        MPedestalPix &gain = (*fGain)[i];
    183         gain.SetPedestal(4*64);     // This allows a maximum of 200phe/pix
     186        if (fDefaultGain>0)
     187            gain.SetPedestal(fDefaultGain);
     188
    184189        gain.SetPedestalRms(0);
    185190        gain.SetPedestalABoffset(0);
    186191        gain.SetNumEvents(0);
    187192    }
     193
    188194    return kTRUE;
    189195}
     
    302308    }
    303309
     310    if (IsEnvDefined(env, prefix, "DefaultOffset", print))
     311    {
     312        rc = kTRUE;
     313        fDefaultOffset = GetEnvValue(env, prefix, "DefaultOffset", fDefaultOffset);
     314    }
     315    if (IsEnvDefined(env, prefix, "DefaultNoise", print))
     316    {
     317        rc = kTRUE;
     318        fDefaultNoise = GetEnvValue(env, prefix, "DefaultNoise", fDefaultNoise);
     319    }
     320    if (IsEnvDefined(env, prefix, "DefaultGain", print))
     321    {
     322        rc = kTRUE;
     323        fDefaultGain = GetEnvValue(env, prefix, "DefaultGain", fDefaultGain);
     324    }
     325
    304326    return rc;
    305327}
  • trunk/MagicSoft/Mars/msimcamera/MSimCamera.h

    r9525 r9625  
    3232    Bool_t fBaselineGain;  // Should the gain be applied to baseline and electronic noise?
    3333
     34    Double_t fDefaultOffset;  // Default offset added to all channels
     35    Double_t fDefaultNoise;   // Default noise (RMS) added to all samples
     36    Double_t fDefaultGain;    // Default gain (multiplication factor to the given/used pulse shape)
     37
    3438    // MParContainer
    3539    Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
Note: See TracChangeset for help on using the changeset viewer.