Changeset 8158


Ignore:
Timestamp:
10/24/06 13:40:58 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8157 r8158  
    2929   * mextralgo/MExtralgoSpline.[h,cc]:
    3030     - removed the random iterator, use a random number instead
     31     - removed obsolete variable fResolution
    3132
    3233   * mjobs/MJCalibrateSignal.cc, mjobs/MJCalibration.cc,
     
    4647     - removed memcpy stuff, instead use the output of MExtractPedestal
    4748     - get the window size automatically from a possible extractor
     49     - simplified InitBlindPixel
    4850
    4951   * mpedestal/Makefile, mpedestal/PedestalLinkDef.h:
     
    8789     - changed rise-time from 0.5 to 0.7 and fall time from 0.5 to 1.0
    8890     - removed obsolete data members
     91     - removed fRandomIter
    8992
    9093   * msignal/MExtractedSignalPix.h:
     
    117120   * msignal/SignalIncl.h:
    118121     - removed obsolete includes
     122
     123   * msignal/MExtractBlindPixel.[h,cc]:
     124     - changed according to the other changes
     125     - removed a lot of obsolete variables
     126     - changed interface to set blind pixel indices
     127     - now directly use the spline extractor class
    119128
    120129
  • trunk/MagicSoft/Mars/mextralgo/MExtralgoSpline.cc

    r8154 r8158  
    5050#include "MExtralgoSpline.h"
    5151
     52#include <TRandom.h>
     53
    5254#include "../mbase/MMath.h"
    5355
     
    207209}
    208210
    209 #include <TRandom.h>
    210 Float_t MExtralgoSpline::ExtractNoise(Int_t iter)
    211 {
     211Float_t MExtralgoSpline::ExtractNoise(/*Int_t iter*/)
     212{
     213    // FIXME: Shell we keep the extraction inside one slice
     214    // or randomize it along the extraction window?
    212215    const Float_t nsx = gRandom->Uniform(); //iter * fResolution;
    213216
     
    378381    {
    379382        fTime      = maxpos;
    380         fTimeDev   = fResolution;
     383        fTimeDev   = 0;
    381384        fSignal    = maxval;
    382385        fSignalDev = 0;  // means: is valid
     
    389392
    390393    fTime      = x1;
    391     fTimeDev   = fResolution;
     394    fTimeDev   = 0;
    392395    fSignal    = CalcIntegral(maxpos);
    393396    fSignalDev = 0;  // means: is valid
  • trunk/MagicSoft/Mars/mextralgo/MExtralgoSpline.h

    r8154 r8158  
    3030    Float_t fFallTime;
    3131
    32     Float_t fResolution;
     32//    Float_t fResolution;
    3333
    3434    // Result
     
    446446
    447447    void SetRiseFallTime(Float_t rise, Float_t fall) { fRiseTime=rise; fFallTime=fall; }
    448     void SetExtrationType(ExtractionType_t typ)      { fExtractionType = typ; }
    449     void SetResolution(Float_t res)                  { fResolution=res; }
     448    void SetExtractionType(ExtractionType_t typ)     { fExtractionType = typ; }
     449//    void SetResolution(Float_t res)                  { fResolution=res; }
    450450
    451451    Float_t GetTime() const      { return fTime; }
     
    458458    void GetTime(Float_t &sig, Float_t &dsig) const   { sig=fTime; dsig=fTimeDev; }
    459459
    460     Float_t ExtractNoise(Int_t iter);
     460    Float_t ExtractNoise(/*Int_t iter*/);
    461461    void Extract(Byte_t sat, Int_t maxpos);
    462462};
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r8154 r8158  
    114114
    115115#include "MPedestalCam.h"
     116#include "MPedestalSubtract.h"
    116117#include "MCalibColorSteer.h"
    117118
     
    15941595                                   MHCalibrationChargeBlindCam &blindcam)
    15951596{
    1596 
    1597   Int_t run = fSequence.GetLastRun();
    1598  
    1599   //
    1600   // Initialize the blind pixel. Unfortunately, there is a hardware difference
    1601   // in the first blind pixel until run "gkSecondBlindPixelInstallation" and the
    1602   // later setup. The first needs to use a filter because of the length of
    1603   // spurious NSB photon signals. The latter get better along extracting the amplitude
    1604   // from a small window.
    1605   //
    1606   if (run < gkSecondBlindPixelInstallation)
    1607     {
    1608       MCalibrationBlindCamOneOldStyle blindresults;
    1609       if (IsIntensity())
     1597    const Int_t run = fSequence.GetLastRun();
     1598
     1599    //
     1600    // Initialize the blind pixel. Unfortunately, there is a hardware
     1601    // difference in the first blind pixel until run
     1602    // gkSecondBlindPixelInstallation and the later setup. The first
     1603    // needs to use a filter because of the length of spurious NSB photon
     1604    // signals. The latter get better along extracting the amplitude
     1605    // from a small window.
     1606    //
     1607    const MCalibrationBlindCamOneOldStyle   one;
     1608    const MCalibrationBlindCamTwoNewStyle   two;
     1609    const MCalibrationBlindCamThreeNewStyle three;
     1610
     1611    const MCalibrationBlindCam &blindresults =
     1612        run<gkSecondBlindPixelInstallation ? static_cast<MCalibrationBlindCam>(one) :
     1613        (run<gkThirdBlindPixelInstallation ? static_cast<MCalibrationBlindCam>(two) : static_cast<MCalibrationBlindCam>(three));
     1614
     1615    if (IsIntensity())
    16101616        blindresults.Copy(*fIntensBlindCam.GetCam());
    1611       else
     1617    else
    16121618        blindresults.Copy(fCalibrationBlindCam);
    16131619
    1614       blindext.SetExtractionType(MExtractBlindPixel::kIntegral);
    1615       blindext.SetExtractionType(MExtractBlindPixel::kFilter);
    1616       blindext.SetRange(10,19,0,6);
    1617       blindext.SetNSBFilterLimit(70);
    1618     }
    1619   else if (run < gkThirdBlindPixelInstallation)
    1620     {
    1621 
    1622       MCalibrationBlindCamTwoNewStyle blindresults;
    1623 
    1624       if (IsIntensity())
    1625         blindresults.Copy(*fIntensBlindCam.GetCam());
    1626       else
    1627         blindresults.Copy(fCalibrationBlindCam);
    1628 
    1629       blindext.SetNumBlindPixels(blindresults.GetSize());
    1630       for (Int_t i=0;i<blindresults.GetSize();i++)
    1631         blindext.SetBlindPixelIdx(blindresults[i].GetPixId(),i);
    1632 
    1633       blindext.SetExtractionType(MExtractBlindPixel::kAmplitude);
    1634       blindext.SetExtractionType(MExtractBlindPixel::kFilter);
    1635       blindext.SetRange(5,8,0,2);
    1636       blindext.SetNSBFilterLimit(38);
    1637      
    1638     }
    1639   else
    1640     {
    1641 
    1642       MCalibrationBlindCamThreeNewStyle blindresults;
    1643 
    1644       if (IsIntensity())
    1645         blindresults.Copy(*fIntensBlindCam.GetCam());
    1646       else
    1647         blindresults.Copy(fCalibrationBlindCam);
    1648 
    1649       blindext.SetNumBlindPixels(blindresults.GetSize());
    1650 
    1651       for (Int_t i=0;i<blindresults.GetSize();i++)
    1652         blindext.SetBlindPixelIdx(blindresults[i].GetPixId(),i);
    1653 
    1654       blindext.SetExtractionType(MExtractBlindPixel::kAmplitude);
    1655       blindext.SetExtractionType(MExtractBlindPixel::kFilter);
    1656       blindext.SetDataType(MExtractBlindPixel::kRawEvt2);
    1657       blindext.SetRange(5,8,0,2);
    1658       blindext.SetNSBFilterLimit(38);
    1659      
    1660     }
    1661  
     1620    blindext.SetExtractionType(MExtractBlindPixel::kIntegral);
     1621    blindext.SetExtractionType(MExtractBlindPixel::kFilter);
     1622
     1623    if (run<gkSecondBlindPixelInstallation)
     1624    {
     1625        blindext.SetRange(10,19,0,6);
     1626        blindext.SetNSBFilterLimit(70);
     1627    }
     1628    else
     1629    {
     1630        blindext.SetRange(5,8,0,2);
     1631        blindext.SetNSBFilterLimit(38);
     1632    }
     1633
     1634    if (run>=gkThirdBlindPixelInstallation)
     1635        blindext.SetDataType(MExtractBlindPixel::kRawEvt2);
    16621636}
    16631637
  • trunk/MagicSoft/Mars/mpedestal/MPedestalSubtract.cc

    r8154 r8158  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MPedestalSubtract.cc,v 1.2 2006-10-24 08:18:07 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MPedestalSubtract.cc,v 1.3 2006-10-24 12:39:00 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    144144        memcpy(sample+numh, pixel.GetLoGainSamples(), numl);
    145145
    146         // if no pedestals are given we are finished
     146        // start of destination array, end of hi-gain destination array
     147        // and start of hi-gain samples
     148        Float_t *beg = fSignal->GetSamples(pixidx);
     149        Float_t *end = beg + fSignal->GetNumSamples();
     150
     151        const Byte_t *src = sample;
     152
     153        // if no pedestals are given just convert the data into
     154        // floats and we are finished
    147155        if (!fPedestals)
     156        {
     157            while (beg<end)
     158                *beg++ = *src++;
    148159            continue;
     160        }
    149161
    150162        // get pedestal information for this pixel
     
    155167        const Float_t ped = pedpix.GetPedestal();
    156168
    157         // start of destination array, end of hi-gain destination array
    158         // and start of hi-gain samples
    159         Float_t *beg = fSignal->GetSamples(pixidx);
    160         Float_t *end = beg + fSignal->GetNumSamples();
    161 
    162169        // determine with which pedestal (+/- AB offset) to start
    163170        const Bool_t  swap    = (ab&1)==1;
    164171        const Float_t offh    = swap ? -pedpix.GetPedestalABoffset() : pedpix.GetPedestalABoffset();
    165172        const Float_t mean[2] = { ped + offh, ped - offh };
    166 
    167         const Byte_t *src = sample;
    168173
    169174        // Copy hi-gains into array and substract pedestal
  • trunk/MagicSoft/Mars/mpedestal/MPedestalSubtractedEvt.h

    r8154 r8158  
    5656    }
    5757
     58    Int_t GetIntegralRaw(Int_t idx, Int_t first, Int_t last) const
     59    {
     60        Byte_t *ptr = GetSamplesRaw(idx);
     61
     62        const Byte_t *end = ptr + last - first + 1;
     63
     64        Int_t sum = 0;
     65        while (ptr<end)
     66            sum += *ptr++;
     67
     68        return sum;
     69    }
     70
    5871    Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const { return kTRUE; }
    5972    void   DrawPixelContent(Int_t num) const { }
  • trunk/MagicSoft/Mars/msignal/MExtractBlindPixel.cc

    r8155 r8158  
    6161#include "MRawEvtPixelIter.h"
    6262
     63#include "MPedestalSubtractedEvt.h"
    6364#include "MExtractedSignalBlindPixel.h"
    6465
    6566#include "MPedestalCam.h"
    6667#include "MPedestalPix.h"
     68
     69#include "MCalibrationBlindCam.h"
     70#include "MCalibrationBlindPix.h"
     71
     72#include "MExtralgoSpline.h"
    6773
    6874ClassImp(MExtractBlindPixel);
     
    7884const Float_t MExtractBlindPixel::fgResolution       = 0.003;
    7985const Float_t MExtractBlindPixel::gkOverflow         = 300.;
     86
    8087// --------------------------------------------------------------------------
    8188//
     
    9299//
    93100MExtractBlindPixel::MExtractBlindPixel(const char *name, const char *title)
    94     : fBlindPixel(0), fHiLoLast(0), fDataType(0)
     101    : fBlindPixel(0), /*fHiLoLast(0),*/ fDataType(0)
    95102{
    96103 
     
    102109  SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast);
    103110 
    104   SetNumBlindPixels();
     111//  SetNumBlindPixels();
     112  fBlindPixelIdx.Set(1);
     113  fBlindPixelIdx[0] = fgBlindPixelIdx;
    105114
    106115  Clear();
     
    128137    fExtractionType = 0;
    129138
    130     fBlindPixelIdx.Set(0);
    131     SetBlindPixelIdx();
     139    fBlindPixelIdx.Set(1);
     140    fBlindPixelIdx[0] = fgBlindPixelIdx;
     141}
     142
     143void MExtractBlindPixel::SetBlindPixels(const MCalibrationBlindCam &cam)
     144{
     145    const Int_t n = cam.GetSize();
     146
     147    fBlindPixelIdx.Set(n);
     148    for (Int_t i=0; i<n; i++)
     149        fBlindPixelIdx[i] = cam[i].GetPixId();
    132150}
    133151
     
    138156
    139157  fNumHiGainSamples = (Float_t)(fHiGainLast-fHiGainFirst+1);
    140   if (lolast)
    141     fNumLoGainSamples = (Float_t)(fLoGainLast-fLoGainFirst+1);
    142   else
     158//  if (lolast)
     159//    fNumLoGainSamples = (Float_t)(fLoGainLast-fLoGainFirst+1);
     160//  else
    143161    fNumLoGainSamples = 0.;
    144162
     
    146164  fSqrtLoGainSamples = TMath::Sqrt(fNumLoGainSamples); 
    147165 
    148   fHiLoFirst = 0;
    149   fHiLoLast  = 0;
     166  //fHiLoFirst = 0;
     167  //fHiLoLast  = 0;
    150168}
    151169
     
    170188    return kFALSE;
    171189
    172   if (IsDataType(kRawEvt2))
    173     fRawEvt = (MRawEvtData*)pList->FindObject(AddSerialNumber("MRawEvtData2"));
    174   else
    175     fRawEvt = (MRawEvtData*)pList->FindObject(AddSerialNumber("MRawEvtData"));
    176 
     190  const TString raw = IsDataType(kRawEvt2) ? "MRawEvtData2" : "MRawEvtData";
     191  const TString sig = IsDataType(kRawEvt2) ? "MPedestalSubtractedEvt2" : "MPedestalSubtractedEvt";
     192
     193  fRawEvt = (MRawEvtData*)pList->FindObject(AddSerialNumber(raw), "MRawEvtData");
    177194  if (!fRawEvt)
    178195    {
    179       *fLog << err << GetDescriptor()
    180             << Form("%s%s",IsDataType(kRawEvt2) ? "MRawEvtData2" : "MRawEvtData",
    181                     " not found... aborting.") << endl;
     196      *fLog << err << raw << " [MRawEvtData] not found... aborting." << endl;
    182197      return kFALSE;
    183198    }
     199
     200  fSignal = (MPedestalSubtractedEvt*)pList->FindObject(AddSerialNumber(sig), "MPedestalSubtractedEvt");
     201  if (!fSignal)
     202    {
     203      *fLog << err << sig << " [MPedestalSubtractedEvt] not found... aborting." << endl;
     204      return kFALSE;
     205    }
     206
    184207  return kTRUE;
    185208}
     
    204227{
    205228 
    206   for (Int_t i=0;i<fNumBlindPixels;i++)
    207     fBlindPixel->SetBlindPixelIdx(fBlindPixelIdx.At(i),i);
     229  for (UInt_t i=0;i<fBlindPixelIdx.GetSize();i++)
     230      fBlindPixel->SetBlindPixelIdx(fBlindPixelIdx[i], i);
    208231
    209232  fBlindPixel->SetExtractionType(fExtractionType);
     
    223246      }
    224247  }
    225 
     248/*
    226249  const Int_t higainsamples = fRunHeader->GetNumSamplesHiGain();
    227250  const Int_t logainsamples = fRunHeader->GetNumSamplesLoGain();
     
    265288      fHiLoLast   = logainsamples ? diff : 0;
    266289    }
    267 
    268   const Int_t range = fHiLoFirst ? fHiLoLast - fHiLoFirst + 1 : fHiGainLast - fHiGainFirst + fHiLoLast + 1;
    269 
    270   fHiGainSignal.Set(range);
    271   fHiGainSignal.Reset();
     290 */
     291  const Int_t range = fHiGainLast-fHiGainFirst+1; //fHiLoFirst ? fHiLoLast - fHiLoFirst + 1 : fHiGainLast - fHiGainFirst + fHiLoLast + 1;
     292
     293//  fHiGainSignal.Set(range);
     294//  fHiGainSignal.Reset();
    272295
    273296  fHiGainFirstDeriv.Set(range);
     
    280303  *fLog << inf << "Extracting "
    281304      << (IsExtractionType(kAmplitude) ? "Amplitude" : " Integral")
    282       << " using " << range << " FADC samples from "
    283       << (fHiLoFirst ? "Low Gain slice" : " High Gain slice")
    284       << (fHiLoFirst ? (Int_t)fHiLoFirst : (Int_t)fHiGainFirst)
    285       << " to (including) "
    286       << (fHiLoLast ? "Low Gain slice" : "High Gain slice")
    287       << (fHiLoLast ?  (Int_t)fHiLoLast-1 : (Int_t)fHiGainLast)
    288       << endl;
     305      << " using " << range << " FADC samples from slice "
     306      << (Int_t)fHiGainFirst << " to " << (Int_t)fHiGainLast << " (incl)" << endl;
    289307
    290308  if (IsExtractionType(kFilter))
    291309    *fLog << inf << "Will use Filter using "
    292310          << (Int_t)(fLoGainLast-fLoGainFirst+1) << " FADC slices"
    293           << " from High Gain slice " << (Int_t)fLoGainFirst
    294           << " to High Gain slice " << (Int_t)fLoGainLast << endl;
     311          << " from slice " << (Int_t)fLoGainFirst
     312          << " to " << (Int_t)fLoGainLast << endl;
    295313
    296314  fBlindPixel->SetUsedFADCSlices(fHiGainFirst, range);
     
    303321//
    304322// FindSignalHiGain:
     323//
     324// - Loop from ptr to (ptr+fHiGainLast-fHiGainFirst)
     325// - Sum up contents of *ptr
     326// - If *ptr is greater than fSaturationLimit, raise sat by 1
     327// - If fHiLoLast is set, loop from logain to (logain+fHiLoLast)
     328// - Add contents of *logain to sum
     329//
     330/*
     331void MExtractBlindPixel::FindIntegral(Byte_t *ptr, Byte_t *logain, Float_t &sum, Byte_t &sat)
     332{
     333    const Byte_t *end = ptr + fHiGainLast - fHiGainFirst + 1;
     334
     335    Int_t summ = 0;
     336    while (p<end)
     337    {
     338        summ += *ptr;
     339
     340        if (*ptr++ >= fSaturationLimit)
     341            sat++;
     342    }
     343
     344    sum = (Float_t)summ;
     345}
     346*/
     347
     348// --------------------------------------------------------------------------
     349//
     350// FindSignalPhe:
    305351//
    306352// - Loop from ptr to (ptr+fHiGainLast-fHiGainFirst)
     
    310356// - Add contents of *logain to sum
    311357//
    312 void MExtractBlindPixel::FindIntegral(Byte_t *ptr, Byte_t *logain, Float_t &sum, Byte_t &sat)
    313 {
    314 
    315   Int_t summ = 0;
    316   Byte_t *p   = ptr;
    317   Byte_t *end = ptr + fHiGainLast - fHiGainFirst + 1;
    318 
    319   if (fHiLoFirst == 0)
    320     {
    321 
    322       while (p<end)
    323         {
    324           summ += *ptr;
    325          
    326           if (*p++ >= fSaturationLimit)
    327             sat++;
    328         }
    329      
    330     }
    331  
    332   p   = logain + fHiLoFirst; 
    333   end = logain + fHiLoLast;
    334   while (p<end)
    335     {
    336       summ += *p;
    337 
    338       if (*p++ >= fSaturationLimit)
    339             sat++;
    340     }
    341 
    342   sum = (Float_t)summ;
    343 }
    344 
    345 // --------------------------------------------------------------------------
    346 //
    347 // FindSignalPhe:
    348 //
    349 // - Loop from ptr to (ptr+fHiGainLast-fHiGainFirst)
    350 // - Sum up contents of *ptr
    351 // - If *ptr is greater than fSaturationLimit, raise sat by 1
    352 // - If fHiLoLast is set, loop from logain to (logain+fHiLoLast)
    353 // - Add contents of *logain to sum
    354 //
    355 void MExtractBlindPixel::FindAmplitude(Byte_t *ptr, Byte_t *logain, Float_t &sum, Byte_t &sat)
    356 {
    357 
     358//void MExtractBlindPixel::FindAmplitude(Float_t *ptr, Byte_t *logain, Float_t &sum, Byte_t &sat)
     359Float_t MExtractBlindPixel::FindAmplitude(Int_t idx, Int_t numsat) const
     360{
     361    Int_t sat0 = fHiGainFirst; // First slice to extract and first saturating slice
     362    Int_t sat1 = fHiGainLast;  // Last  slice to extract and last saturating slice
     363
     364    Int_t maxcont;
     365    Int_t maxpos = fSignal->GetMax(idx, sat0, sat1, maxcont);
     366
     367//    numsat = fSignal->GetSaturation(idx, fSaturationLimit, sat0, sat1);
     368
     369    const Float_t *ptr = fSignal->GetSamples(idx);
     370    const Int_t    num = fHiGainLast-fHiGainFirst+1;
     371
     372    MExtralgoSpline s(ptr, num, fHiGainFirstDeriv.GetArray(), fHiGainSecondDeriv.GetArray());
     373
     374    s.SetExtractionType(MExtralgoSpline::kAmplitude);
     375
     376    s.Extract(numsat, maxpos);
     377
     378    return s.GetSignal();
     379/*
    358380  Int_t range   = 0;
    359381  Int_t count   = 0;
     
    586608        }
    587609    }
    588 
     610  */
    589611}
    590612
     
    596618// - Sum up contents of *ptr
    597619// - If *ptr is greater than fSaturationLimit, raise sat by 1
    598 //
    599 void MExtractBlindPixel::FindSignalFilter(Byte_t *ptr, Int_t &sum, Byte_t &sat) const
    600 {
    601 
    602   Byte_t *end = ptr + fLoGainLast - fLoGainFirst + 1;
     620//
     621/*
     622void MExtractBlindPixel::FindSignalFilter(Byte_t *ptr, Int_t range, Int_t &sum, Byte_t &sat) const
     623{
     624
     625  Byte_t *end = ptr + range;
    603626 
    604627  while (ptr<end)
     
    610633    }
    611634}
     635*/
    612636
    613637// --------------------------------------------------------------------------
     
    624648 
    625649  for (UInt_t id=0;id<fBlindPixelIdx.GetSize();id++)
    626     {
    627  
    628       pixel.Jump(fBlindPixelIdx[id]);
    629      
    630       Int_t sum   = 0;
    631       Byte_t sat  = 0;
    632 
     650  {
     651      // Be carefull: GetSaturation changed sat0 and sat1
     652      Int_t sat0 = fHiGainFirst; // First slice to extract and first saturating slice
     653      Int_t sat1 = fHiGainLast;  // Last  slice to extract and last saturating slice
     654
     655      const Int_t sat = fSignal->GetSaturation(fBlindPixelIdx[id], fSaturationLimit, sat0, sat1);
     656     
    633657      if (IsExtractionType(kFilter))
    634658      {
    635 
    636           FindSignalFilter(pixel.GetHiGainSamples()+fLoGainFirst, sum, sat);
    637          
     659          // FIXME: fLoGain* is used to determine the FILTER/CHECK range
     660          const Int_t numh = pixel.GetNumHiGainSamples();
     661
     662          const Int_t sum = fSignal->GetIntegralRaw(fBlindPixelIdx[id], fLoGainFirst+numh, fLoGainLast+numh);
    638663          if (sum > fNSBFilterLimit)
    639664          {
     
    644669          }
    645670
     671          /*
    646672          sum = 0;
    647673          if (pixel.HasLoGain())
    648             FindSignalFilter(pixel.GetLoGainSamples(), sum, sat);         
    649 
    650           /*
     674            FindSignalFilter(sl+pixel.GetNumLoGainSamples()+fLoGainFirst, fLoGainLast - fLoGainFirst + 1, sum, sat);
     675
    651676          if (fModified)
    652677            {
     
    661686          */
    662687      }
    663      
     688
     689
    664690      Float_t newsum = 0.;
    665       sat = 0;
    666      
    667691      if (IsExtractionType(kAmplitude))
    668         FindAmplitude   (pixel.GetHiGainSamples()+fHiGainFirst, pixel.GetLoGainSamples(), newsum, sat);
     692          newsum = FindAmplitude(fBlindPixelIdx[id], sat);
    669693      else
    670         FindIntegral    (pixel.GetHiGainSamples()+fHiGainFirst, pixel.GetLoGainSamples(), newsum, sat);
    671  
    672 
    673       fBlindPixel->SetExtractedSignal(newsum,id);
    674       fBlindPixel->SetNumSaturated(sat,id);
    675     }
    676  
     694          newsum = fSignal->GetIntegralRaw(fBlindPixelIdx[id], fHiGainFirst, fHiGainLast);
     695 
     696      fBlindPixel->SetExtractedSignal(newsum, id);
     697      fBlindPixel->SetNumSaturated(sat, id);
     698  }
     699
    677700  fBlindPixel->SetReadyToSave();
    678701  return kTRUE;
     
    686709Bool_t MExtractBlindPixel::IsDataType( const DataType_t typ )
    687710{
    688  
    689711  return TESTBIT( fDataType, typ );
    690 
    691712}
    692713
     
    698719Bool_t MExtractBlindPixel::IsExtractionType( const ExtractionType_t typ )
    699720{
    700  
    701721  return TESTBIT( fExtractionType, typ );
    702 
    703722}
    704723
  • trunk/MagicSoft/Mars/msignal/MExtractBlindPixel.h

    r8155 r8158  
    1313#endif
    1414
     15class MCalibrationBlindCam;
    1516class MExtractedSignalBlindPixel;
    1617
     
    3031  MExtractedSignalBlindPixel *fBlindPixel; // Extracted signal of the Blind Pixel
    3132
    32   Byte_t   fHiLoFirst;                     // If not zero, start extraction from fHiLoFirst slice of Low-Gain
    33   Byte_t   fHiLoLast;
     33//  Byte_t   fHiLoFirst;                     // If not zero, start extraction from fHiLoFirst slice of Low-Gain
     34//  Byte_t   fHiLoLast;
    3435
    35   MArrayF  fHiGainSignal;                  //! Need fast access to the signals in a float way
     36//  MArrayF  fHiGainSignal;                  //! Need fast access to the signals in a float way
    3637  MArrayF  fHiGainFirstDeriv;              //! First derivative at intersection
    3738  MArrayF  fHiGainSecondDeriv;             //! Second derivative at intersection
     
    4344  Byte_t  fExtractionType;                 // What extraction type has been chosen?
    4445  Byte_t  fDataType;                       // What data container type is needed? 
    45   Int_t   fNumBlindPixels;                 // Current number of blind pixels
     46//  Int_t   fNumBlindPixels;                 // Current number of blind pixels
    4647
    4748public:
     
    5051
    5152private:
    52   void FindAmplitude   (Byte_t *firstused, Byte_t *lowgain, Float_t &sum, Byte_t &sat);
    53   void FindIntegral    (Byte_t *firstused, Byte_t *lowgain, Float_t &sum, Byte_t &sat);
    54   void FindSignalFilter(Byte_t *ptr,                          Int_t &sum, Byte_t &sat) const;
     53  Float_t FindAmplitude(Int_t idx, Int_t numsat) const;
     54//  void FindIntegral    (Byte_t *firstused, Byte_t *lowgain, Float_t &sum, Byte_t &sat);
     55//  void FindSignalFilter(Byte_t *ptr, Int_t range,             Int_t &sum, Byte_t &sat) const;
    5556 
    5657  Int_t  PreProcess(MParList *pList);
     
    6970
    7071  // Setters
     72  /*
    7173  void SetBlindPixelIdx(  const Int_t  idx=fgBlindPixelIdx, const UInt_t nr=0 )
    7274  {
     
    7476          fBlindPixelIdx.Set(nr+1);
    7577      fBlindPixelIdx[nr] = idx;
    76   }
     78      }
     79      */
     80
     81  void SetBlindPixels(const MCalibrationBlindCam &cam);
     82
    7783  void SetExtractionType( const ExtractionType_t typ=kAmplitude );
    7884  void SetDataType    ( const DataType_t       typ=kRawEvt    ); 
    7985  void SetNSBFilterLimit( const Int_t   lim=fgNSBFilterLimit )  { fNSBFilterLimit = lim;   }     
    8086 
    81   void SetNumBlindPixels( const Int_t   num=1 )  { fNumBlindPixels = num;   }
     87//  void SetNumBlindPixels( const Int_t   num=1 )  { fNumBlindPixels = num;   }
    8288 
    8389  void SetRange         ( const Byte_t  hifirst=0, const Byte_t hilast=0,
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc

    r8154 r8158  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MExtractTimeAndChargeSpline.cc,v 1.61 2006-10-24 08:24:52 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MExtractTimeAndChargeSpline.cc,v 1.62 2006-10-24 12:39:00 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    182182//
    183183MExtractTimeAndChargeSpline::MExtractTimeAndChargeSpline(const char *name, const char *title)
    184     : fRandomIter(0), fExtractionType(kIntegral)
     184    : /*fRandomIter(0),*/ fExtractionType(kIntegral)
    185185{
    186186
     
    377377
    378378    s.SetRiseFallTime(fRiseTimeHiGain, fFallTimeHiGain);
    379     s.SetResolution(fResolution);
     379//    s.SetResolution(fResolution);
    380380
    381381    if (IsNoiseCalculation())
    382382    {
    383         if (fRandomIter == int(1./fResolution))
    384             fRandomIter = 0;
    385 
    386         sum = s.ExtractNoise(fRandomIter);
    387         fRandomIter++;
     383//        if (fRandomIter == int(1./fResolution))
     384//            fRandomIter = 0;
     385
     386        sum = s.ExtractNoise(/*fRandomIter*/);
     387//        fRandomIter++;
    388388        return;
    389389    }
     
    402402
    403403    s.SetRiseFallTime(fRiseTimeLoGain, fFallTimeLoGain);
    404     s.SetResolution(fResolution);
     404//    s.SetResolution(fResolution);
    405405
    406406    if (IsNoiseCalculation())
    407407    {
    408         if (fRandomIter == int(1./fResolution))
    409             fRandomIter = 0;
    410 
    411         sum = s.ExtractNoise(fRandomIter);
     408//        if (fRandomIter == int(1./fResolution))
     409//            fRandomIter = 0;
     410
     411        sum = s.ExtractNoise(/*fRandomIter*/);
    412412        return;
    413413    }
Note: See TracChangeset for help on using the changeset viewer.