Ignore:
Timestamp:
02/11/09 17:35:54 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/msimcamera/MSimReadout.cc

    r9308 r9318  
    3131// system.
    3232//
     33// You can give a conversion factor from the unitx of your analog signal
     34// to the units of your adc. This is a fixed factor because it is just
     35// a matter of what the meaning of an adc count is, nothing which could
     36// jitter or is a real part of the electronics. Such effects should
     37// be simulated somewhere else.
     38//
    3339//
    3440//  Input Containers:
     
    7379//
    7480MSimReadout::MSimReadout(const char* name, const char *title)
    75 : fRunHeader(0), fEvtHeader(0), fCamera(0), fPulsePos(0), fTrigger(0), fData(0)
     81    : fRunHeader(0), fEvtHeader(0), fCamera(0), fPulsePos(0), fTrigger(0), fData(0),
     82    fConversionFactor(1)
    7683{
    7784    fName  = name  ? name  : "MSimReadout";
     
    135142
    136143    fRunHeader->InitPixels(cam->GetNumPixels());
    137     fRunHeader->SetValidMagicNumber();
    138     fRunHeader->SetSourceInfo("MonteCarlo");  // "Muon" from first event??
    139     fRunHeader->SetReadyToSave();
    140144
    141145    fData->InitRead(fRunHeader);
     
    209213    }
    210214
    211     const Float_t gain      = 64./1;
    212     const Float_t offset    = 128;
     215    const Float_t offset    = 0;//128;
    213216    const UInt_t  max       = fData->GetMax();
    214217
     
    230233        {
    231234            Float_t slice = j+trig>=(Int_t)sig.GetSize() ? offset :
    232                 sig[j+trig] * gain + offset;
     235                sig[j+trig] * fConversionFactor + offset;
    233236
    234237            // FIXME: Handle/Implement saturation!
     
    257260    return kTRUE;
    258261}
     262
     263// --------------------------------------------------------------------------
     264//
     265// Read the parameters from the resource file.
     266//
     267//  ConversionFactor: 1
     268//
     269Int_t MSimReadout::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     270{
     271    Bool_t rc = kFALSE;
     272    if (IsEnvDefined(env, prefix, "ConversionFactor", print))
     273    {
     274        rc = kTRUE;
     275        fConversionFactor = GetEnvValue(env, prefix, "ConversionFactor", fConversionFactor);
     276    }
     277
     278    return rc;
     279}
Note: See TracChangeset for help on using the changeset viewer.