Ignore:
Timestamp:
03/03/07 22:48:30 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndCharge.cc

    r8297 r8358  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MExtractTimeAndCharge.cc,v 1.62 2007-02-03 20:05:35 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MExtractTimeAndCharge.cc,v 1.63 2007-03-03 22:46:10 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    8484#include "MParList.h"
    8585
     86#include "MRawRunHeader.h"
    8687#include "MRawEvtPixelIter.h"
    87 #include "MRawRunHeader.h"
    8888
    8989#include "MArrivalTimeCam.h"
     
    168168        fSignals->SetUsedFADCSlices(fHiGainFirst, fHiGainLast, fNumHiGainSamples,
    169169                                    fLoGainFirst, fLoGainLast, fNumLoGainSamples);
     170
     171    if (!HasLoGain())
     172    {
     173        *fLog << inf << "No lo-gains... resetting lo-gain switch." << endl;
     174        fLoGainSwitch=0xff;
     175    }
     176
    170177    return kTRUE;
    171178}
     
    206213Int_t MExtractTimeAndCharge::Process()
    207214{
     215    const Int_t numh = fRunHeader->GetNumSamplesHiGain();
     216    const Int_t numl = fRunHeader->GetNumSamplesLoGain();
     217
    208218    MRawEvtPixelIter pixel(fRawEvt);
    209 
    210219    while (pixel.Next())
    211220    {
     
    213222
    214223        const Float_t *sig = fSignal->GetSamples(pixidx);
    215 
    216         const Int_t numh = pixel.GetNumHiGainSamples();
    217224
    218225        Int_t sathi0 = fHiGainFirst;  // First slice to extract and first saturating slice
     
    286293
    287294        // FIXME: What to do with the pixel if it saturates too early???
    288         if (pixel.HasLoGain() && maxcont>fLoGainSwitch)
     295        if (numl>0 && maxcont>fLoGainSwitch)
    289296        {
    290297            Int_t first = numh+fLoGainFirst;
     
    424431    MExtractTime::Print(o);
    425432
    426     *fLog << dec;
    427     *fLog << " LoGainStartShift:   " << fLoGainStartShift << endl;
    428     *fLog << " LoGainSwitch:       " << (Int_t)fLoGainSwitch << endl;
    429 }
     433    if (HasLoGain())
     434    {
     435        *fLog << dec;
     436        *fLog << " LoGainStartShift:   " << fLoGainStartShift << endl;
     437        *fLog << " LoGainSwitch:       " << (Int_t)fLoGainSwitch << endl;
     438    }
     439}
Note: See TracChangeset for help on using the changeset viewer.