Changeset 3880 for trunk


Ignore:
Timestamp:
04/29/04 13:44:53 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3879 r3880  
    2222   * msignal/MExtractor.h
    2323     - make SetRange virtual
     24     - check for range w.r.t. ranges given in the run header in ReInit
    2425
    2526   * msignal/MExtractFixedWindow.[h,cc]
  • trunk/MagicSoft/Mars/msignal/MExtractor.cc

    r3878 r3880  
    5757#include "MRawEvtData.h"
    5858#include "MRawEvtPixelIter.h"
     59#include "MRawRunHeader.h"
    5960
    6061#include "MPedestalCam.h"
     
    110111Int_t MExtractor::PreProcess(MParList *pList)
    111112{
     113
    112114    fRawEvt = (MRawEvtData*)pList->FindObject(AddSerialNumber("MRawEvtData"));
    113115    if (!fRawEvt)
    114     {
     116      {
    115117        *fLog << err << AddSerialNumber("MRawEvtData") << " not found... aborting." << endl;
    116118        return kFALSE;
    117     }
    118 
     119      }
     120   
     121    fRunHeader = (MRawRunHeader*)pList->FindObject(AddSerialNumber("MRawRunHeader"));
     122    if (!fRunHeader)
     123      {
     124        *fLog << err << AddSerialNumber("MRawRunHeader") << " not found... aborting." << endl;
     125        return kFALSE;
     126      }
     127   
    119128
    120129    fSignals = (MExtractedSignalCam*)pList->FindCreateObj(AddSerialNumber("MExtractedSignalCam"));
     
    135144    return kTRUE;
    136145}
     146
     147Bool_t MExtractor::ReInit(MParList *pList)
     148{
     149 
     150  Int_t lastdesired   = (Int_t)fHiGainLast;
     151  Int_t lastavailable = (Int_t)fRunHeader->GetNumSamplesHiGain()-1;
     152 
     153  if (lastdesired > lastavailable)
     154    {
     155      const Int_t diff = lastdesired - lastavailable;
     156      *fLog << endl;
     157      *fLog << warn << GetDescriptor()
     158            << Form("%s%2i%s%2i%s%2i%s",": Selected Hi Gain FADC Window [",
     159                    (int)fHiGainFirst,",",lastdesired,
     160                    "] ranges out of the available limits: [0,",lastavailable,"].") << endl;
     161      *fLog << GetDescriptor() << ": Will reduce the upper edge to " << (int)(fHiGainLast - diff) << endl;
     162      SetRange(fHiGainFirst, fHiGainLast-diff, fLoGainFirst, fLoGainLast);
     163    }
     164
     165  lastdesired   = (Int_t)(fLoGainLast);
     166  lastavailable = (Int_t)fRunHeader->GetNumSamplesLoGain()-1;
     167 
     168  if (lastdesired > lastavailable)
     169    {
     170      const Int_t diff = lastdesired - lastavailable;
     171      *fLog << endl;
     172      *fLog << warn << GetDescriptor()
     173            << Form("%s%2i%s%2i%s%2i%s",": Selected Lo Gain FADC Window [",
     174                    (int)fLoGainFirst,",",lastdesired,
     175                    "] ranges out of the available limits: [0,",lastavailable,"].") << endl;
     176      *fLog << GetDescriptor() << ": Will reduce the upper edge to " << (int)(fLoGainLast - diff) << endl;
     177      SetRange(fHiGainFirst, fHiGainLast, fLoGainFirst, fLoGainLast-diff);
     178    }
     179
     180  return kTRUE;
     181}
     182
     183
    137184
    138185void MExtractor::FindSignalHiGain(Byte_t *firstused, Int_t &sum, Byte_t &sat) const
  • trunk/MagicSoft/Mars/msignal/MExtractor.h

    r3878 r3880  
    4949
    5050    virtual Int_t  PreProcess(MParList *pList);
     51    virtual Bool_t ReInit(MParList *pList);
    5152    virtual Int_t  Process();
    5253    virtual void   StreamPrimitive(ofstream &out) const;
Note: See TracChangeset for help on using the changeset viewer.