Changeset 8358


Ignore:
Timestamp:
03/03/07 22:48:30 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/msignal
Files:
4 edited

Legend:

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

    r8304 r8358  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MExtractTime.cc,v 1.23 2007-02-04 15:30:16 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MExtractTime.cc,v 1.24 2007-03-03 22:48:30 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    135135{
    136136    MExtractor::Print(o);
    137     *fLog << " Offset Lo-Gain:     " << fOffsetLoGain << endl;
     137    if (HasLoGain())
     138        *fLog << " Offset Lo-Gain:     " << fOffsetLoGain << endl;
    138139}
  • 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}
  • trunk/MagicSoft/Mars/msignal/MExtractor.cc

    r8304 r8358  
    251251        *fLog << err << "ERROR - Last lo-gain slice must not exceed " << num-1 << endl;
    252252        return kFALSE;
     253    }
     254
     255    if (numl==0)
     256    {
     257        *fLog << inf << "No lo-gains... resetting lo-gain range and saturation limit." << endl;
     258        fLoGainFirst=0;
     259        fLoGainLast =0;
     260        fSaturationLimit=0xff;
    253261    }
    254262
     
    455463
    456464    *fLog << " Hi Gain Range:      " << Form("%2d %2d", fHiGainFirst, fHiGainLast) << endl;
    457     *fLog << " Lo Gain Range:      " << Form("%2d %2d", fLoGainFirst, fLoGainLast) << endl;
    458 //    *fLog << " Gain Overlap to Lo: " << Form("%2d", fHiLoLast)        << endl;
    459     *fLog << " Saturation Lim:     " << Form("%3d", fSaturationLimit) << endl;
    460     *fLog << " Num Samples Hi/Lo:  " << Form("%2.1f %2.1f", fNumHiGainSamples, fNumLoGainSamples) << endl;
     465    if (HasLoGain())
     466    {
     467        *fLog << " Lo Gain Range:      " << Form("%2d %2d", fLoGainFirst, fLoGainLast) << endl;
     468        *fLog << " Saturation Lim:     " << Form("%3d", fSaturationLimit) << endl;
     469        *fLog << " Num Samples Hi/Lo:  " << Form("%2.1f %2.1f", fNumHiGainSamples, fNumLoGainSamples) << endl;
     470    }
    461471    if (fPedestals)
    462472        *fLog << " Pedestals:          " << fPedestals->GetName() << ", " << fPedestals << endl;
  • trunk/MagicSoft/Mars/msignal/MExtractor.h

    r8304 r8358  
    9696  Byte_t  GetSaturationLimit() const { return fSaturationLimit; }
    9797
     98  Bool_t  HasLoGain() const { return fLoGainFirst>0 || fLoGainLast>0; }
    9899  Bool_t  IsNoiseCalculation () const { return fNoiseCalculation; }
    99100
Note: See TracChangeset for help on using the changeset viewer.