Ignore:
Timestamp:
05/14/08 12:03:25 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mpedestal
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mpedestal/MPedestalSubtract.cc

    r8795 r8888  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MPedestalSubtract.cc,v 1.9 2007-12-19 18:53:03 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MPedestalSubtract.cc,v 1.10 2008-05-14 11:03:24 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    2020!   Author(s): Thomas Bretz, 10/2006 <mailto:tbretz@astro.uni-wuerzburg.de>
    2121!
    22 !   Copyright: MAGIC Software Development, 2000-2006
     22!   Copyright: MAGIC Software Development, 2000-2008
    2323!
    2424!
     
    5151#include "MArrayB.h"
    5252
     53#include "MRawRunHeader.h"
    5354#include "MRawEvtData.h"
    5455#include "MRawEvtPixelIter.h"
     
    141142}
    142143
     144Bool_t MPedestalSubtract::ReInit(MParList *pList)
     145{
     146    fRunHeader = (MRawRunHeader*)pList->FindObject(AddSerialNumber("MRawRunHeader"));
     147    if (!fRunHeader)
     148    {
     149        *fLog << err << AddSerialNumber("MRawRunHeader") << " not found... aborting." << endl;
     150        return kFALSE;
     151    }
     152    return kTRUE;
     153}
     154
    143155// --------------------------------------------------------------------------
    144156//
     
    150162    const Int_t numl = fRawEvt->GetNumLoGainSamples();
    151163
     164    // Check if event is empty (presumably MC event -- sanity check)
     165    if (numh+numl==0)
     166        return kCONTINUE;
     167
     168    // Check for consistency (our simulation can do weird things!)
     169    if (numh!=fRunHeader->GetNumSamplesHiGain())
     170    {
     171        *fLog << warn << "WARNING - Number of hi-gain samples (" << numh << ") ";
     172        *fLog << " doesn't match run-header (" << fRunHeader->GetNumSamplesHiGain() << ")." << endl;
     173    }
     174    if (numl!=fRunHeader->GetNumSamplesLoGain())
     175    {
     176        *fLog << warn << "WARNING - Number of lo-gain samples (" << numl << ") ";
     177        *fLog << " doesn't match run-header (" << fRunHeader->GetNumSamplesLoGain() << ")." << endl;
     178    }
     179
     180    // Get scale between FADC units and 256 ;-)
    152181    const UInt_t scale = fRawEvt->GetScale();
    153182
  • trunk/MagicSoft/Mars/mpedestal/MPedestalSubtract.h

    r8633 r8888  
    66#endif
    77
     8class MRawRunHeader;
    89class MRawEvtData;
    910class MPedestalCam;
     
    1617    static const TString fgNamePedestalSubtractedEvt;  //! "MPedestalSubtractedEvt"
    1718
     19    MRawRunHeader          *fRunHeader;      //! Run Header
    1820    MRawEvtData            *fRawEvt;         //! Input Raw data
    1921    MPedestalCam           *fPedestals;      //! Pedestals of all pixels in the camera
     
    2426
    2527    Int_t  PreProcess(MParList *pList);
     28    Bool_t ReInit(MParList *pList);
    2629    Int_t  Process();
    2730
Note: See TracChangeset for help on using the changeset viewer.