Changeset 8361


Ignore:
Timestamp:
03/04/07 12:01:41 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.cc

    r8355 r8361  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MHCalibrationPulseTimeCam.cc,v 1.33 2007-03-03 22:01:13 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MHCalibrationPulseTimeCam.cc,v 1.34 2007-03-04 11:55:55 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    540540            << endl;
    541541    }
    542   return;
    543542}
    544543
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r8347 r8361  
    9595#include "MPedestalCam.h"
    9696#include "MPedestalPix.h"
     97#include "MPedestalSubtract.h"
    9798
    9899ClassImp(MJPedestal);
     
    211212    TString title = fDisplay->GetTitle();
    212213    title += "--  Pedestal ";
    213     title += fSequence.GetName();
     214    title += fSequence.GetFileName();
    214215    title += "  --";
    215216    fDisplay->SetTitle(title);
     
    914915
    915916    //
     917    // This is for data without lo-gains
     918    //
     919    const Bool_t haslo = ext->HasLoGain();
     920
     921    //
    916922    // Get the ranges for the new extractor setting. The window
    917923    // size is always rounded to the next higher integer.
     
    940946    }
    941947
    942     if (poslo+wslogain+fExtractWinRight > lo1-0.5)
     948    if (haslo && poslo+wslogain+fExtractWinRight > lo1-0.5)
    943949    {
    944950        *fLog << err;
     
    959965    }
    960966
    961     if (poslo2-fExtractWinLeft < lo0+0.5)
     967    if (haslo && poslo2-fExtractWinLeft < lo0+0.5)
    962968    {
    963969        *fLog << warn;
     
    10641070        hpedcam.SetRenorm(kTRUE);
    10651071
    1066     MFillH fillpul("MHCalibrationPulseTimeCam", "MPedestalSubtractedEvt", "FillPulseTime");
     1072    // To have it in the parlist!
     1073    MHCalibrationPulseTimeCam pulcam;
     1074    plist.AddToList(&pulcam);
     1075    MFillH fillpul(&pulcam, "MPedestalSubtractedEvt", "FillPulseTime");
    10671076    fillpul.SetBit(MFillH::kDoNotDisplay);
    10681077
     
    11031112    MFTriggerPattern fcalib("CalibFilter");
    11041113    fcalib.SetDefault(kFALSE);
    1105     fcalib.RequireCalibration();
    1106     fcalib.SetInverted();
     1114    fcalib.DenyCalibration();
     1115    fcalib.DenyPedestal();
    11071116
    11081117    tlist.AddToList(&decode);
     
    11271136    // ----------------------------------------------------------------------
    11281137    MTaskEnv taskenv("ExtractPedestal");
     1138
     1139    //------------------------------
     1140    MFTriggerPattern ftp2("PedestalFilter");
     1141    ftp2.SetDefault(kTRUE);
     1142    ftp2.DenyCalibration();
     1143//    ftp2.RequirePedestal();
     1144
     1145    if (!IsUseMC())
     1146    {
     1147        taskenv.SetFilter(&ftp2);
     1148        tlist.AddToList(&ftp2);
     1149    }
     1150    //------------------------------
     1151
    11291152    switch (fExtractType)
    11301153    {
     
    11661189    pedlogain.SetPedestalsOut(&fPedestalCamOut);
    11671190
    1168      // kFundamental
     1191    // kFundamental
    11691192    if (fExtractor)
    11701193    {
     
    11811204        else
    11821205        {
    1183             // The window size of the extractor is not yet initialized,
    1184             // so we have to stick to the extraction range
    1185             const Int_t f = fExtractor->GetHiGainFirst();
    1186             const Int_t l = fExtractor->GetHiGainLast();
    1187             const Int_t w = (l-f+1)&~1;
    1188 
    1189             // Setup to use the hi-gain extraction window in the lo-gain
    1190             // range (the start of the lo-gain range is added automatically
    1191             // by MPedCalcFromLoGain)
    1192             pedcalc.SetExtractWindow(f, w);
    1193             pedlogain.SetExtractWindow(f, w);
     1206            pedcalc.SetRangeFromExtractor(*fExtractor);
     1207            pedlogain.SetRangeFromExtractor(*fExtractor);
    11941208        }
    11951209
  • trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.cc

    r8343 r8361  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MPedCalcFromLoGain.cc,v 1.36 2007-03-01 21:20:41 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MPedCalcFromLoGain.cc,v 1.37 2007-03-04 12:00:30 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    214214        return kFALSE;
    215215
    216     CheckExtractionWindow(fRunHeader->GetNumSamplesHiGain());
     216    const Int_t nhi = fRunHeader->GetNumSamplesHiGain();
     217    const Int_t nlo = fRunHeader->GetNumSamplesLoGain();
     218    CheckExtractionWindow(nlo>0?nhi:0);
    217219
    218220    return kTRUE;
     
    227229Int_t MPedCalcFromLoGain::Calc()
    228230{
     231    const Int_t nhi = fRunHeader->GetNumSamplesHiGain();
     232    const Int_t nlo = fRunHeader->GetNumSamplesLoGain();
     233
    229234    // Real Process
    230235    MRawEvtPixelIter pixel(fRawEvt);
    231 
    232236    while (pixel.Next())
    233237    {
     
    240244        UInt_t ab[2];
    241245        const Float_t sum = fExtractor ?
    242             CalcExtractor(pixel, pixel.GetNumHiGainSamples()) :
    243             CalcSums(pixel, pixel.GetNumHiGainSamples(), ab[0], ab[1]);
     246            CalcExtractor(pixel, nlo>0?nhi:0) :
     247            CalcSums(pixel, nlo>0?nhi:0, ab[0], ab[1]);
    244248
    245249        const UInt_t aidx   = (*fGeom)[idx].GetAidx();
  • trunk/MagicSoft/Mars/mpedestal/MPedestalSubtractedEvt.cc

    r8250 r8361  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MPedestalSubtractedEvt.cc,v 1.2 2007-01-15 12:06:15 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MPedestalSubtractedEvt.cc,v 1.3 2007-03-04 12:01:37 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    105105    Byte_t *p0 = GetSamplesRaw(idx);
    106106
    107     Byte_t *sathi0 = 0; // first saturating hi-gain slice
    108     Byte_t *sathi1 = 0; // last  saturating hi-gain slice
     107    Byte_t *sat0 = 0; // first saturating slice
     108    Byte_t *sat1 = 0; // last  saturating slice
    109109
    110110    Int_t num = 0;
     
    115115        if (*ptr>=limit)
    116116        {
    117             sathi1 = ptr;
    118             if (!sathi0)
    119                 sathi0 = ptr;
     117            sat1 = ptr;
     118            if (!sat0)
     119                sat0 = ptr;
    120120            num++;
    121121        }
    122122    }
    123123
    124     last  = sathi1 ? sathi1-p0 : -1;
    125     first = sathi0 ? sathi0-p0 : -1;
     124    last  = sat1 ? sat1-p0 : -1;
     125    first = sat0 ? sat0-p0 : -1;
    126126
    127127    return num;
     
    138138// Warning: No range checks and no sanity checks are done!
    139139//
    140 Int_t MPedestalSubtractedEvt::GetMax(const Int_t idx, const Int_t first, const Int_t last, Int_t &val) const
     140Int_t MPedestalSubtractedEvt::GetMax(const Int_t idx, const Int_t first, const Int_t last, UInt_t &val) const
    141141{
    142142    // Get pointer to first slice to be considered
  • trunk/MagicSoft/Mars/mpedestal/MPedestalSubtractedEvt.h

    r8350 r8361  
    4141    Int_t GetSaturation(const Int_t idx, Int_t limit, Int_t &first, Int_t &last) const;
    4242    //void  InterpolateSaturation(const Int_t idx, Int_t limit, Int_t first, Int_t last) const;
    43     Int_t GetMax(const Int_t pixidx, const Int_t first, const Int_t last, Int_t &val) const;
     43    Int_t GetMax(const Int_t pixidx, const Int_t first, const Int_t last, UInt_t &val) const;
    4444    Int_t GetMax(const Int_t pixidx, const Int_t first, const Int_t last) const
    4545    {
    46         Int_t val;
     46        UInt_t val;
    4747        return GetMax(pixidx, first, last, val);
    4848    }
    49     Int_t GetMax(const Int_t pixidx, Int_t &val) const
     49    Int_t GetMax(const Int_t pixidx, UInt_t &val) const
    5050    {
    5151        return GetMax(pixidx, 0, fNumSamples, val);
     
    5454    Int_t GetMax(const Int_t pixidx) const
    5555    {
    56         Int_t val;
     56        UInt_t val;
    5757        return GetMax(pixidx, 0, fNumSamples, val);
    5858    }
Note: See TracChangeset for help on using the changeset viewer.