Ignore:
Timestamp:
05/09/07 13:15:53 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/msignal
Files:
2 edited

Legend:

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

    r8368 r8478  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MExtractTimeAndChargeSpline.cc,v 1.67 2007-03-05 08:55:09 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MExtractTimeAndChargeSpline.cc,v 1.68 2007-05-09 12:15:53 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    2020!   Author(s): Markus Gaug 09/2004 <mailto:markus@ifae.es>
    2121!
    22 !   Copyright: MAGIC Software Development, 2002-2006
     22!   Copyright: MAGIC Software Development, 2002-2007
    2323!
    2424!
     
    145145#include "MExtractTimeAndChargeSpline.h"
    146146
    147 #include "MExtralgoSpline.h"
    148 
    149147#include "MPedestalPix.h"
    150148
     
    181179//
    182180MExtractTimeAndChargeSpline::MExtractTimeAndChargeSpline(const char *name, const char *title)
    183     : fExtractionType(kIntegral)
     181    : fHeightTm(0.5), fExtractionType(MExtralgoSpline::kIntegralRel)
    184182{
    185183
     
    220218//               second derivative to zero, there.
    221219//
    222 void MExtractTimeAndChargeSpline::SetChargeType( ExtractionType_t typ )
     220void MExtractTimeAndChargeSpline::SetChargeType(MExtralgoSpline::ExtractionType_t typ)
    223221{
    224222  fExtractionType = typ;
     
    228226  switch (fExtractionType)
    229227  {
    230   case kAmplitude:
     228  case MExtralgoSpline::kAmplitude:
    231229      SetResolutionPerPheHiGain(0.053);
    232230      SetResolutionPerPheLoGain(0.016);
    233231      return;
    234232
    235   case kIntegral:
     233  case MExtralgoSpline::kIntegralRel:
     234  case MExtralgoSpline::kIntegralAbs:
    236235      switch (fWindowSizeHiGain)
    237236      {
     
    305304    switch (fExtractionType)
    306305    {
    307     case kAmplitude:
     306    case MExtralgoSpline::kAmplitude:
    308307        fNumHiGainSamples  = 1.;
    309308        fNumLoGainSamples  = fLoGainLast ? 1. : 0.;
     
    315314        break;
    316315
    317     case kIntegral:
     316    case MExtralgoSpline::kIntegralAbs:
     317    case MExtralgoSpline::kIntegralRel:
    318318        fNumHiGainSamples  = fRiseTimeHiGain + fFallTimeHiGain;
    319319        fNumLoGainSamples  = fLoGainLast ? fRiseTimeLoGain + fFallTimeLoGain : 0.;
     
    336336    MExtralgoSpline s(ptr, num, fHiGainFirstDeriv.GetArray(), fHiGainSecondDeriv.GetArray());
    337337
     338    s.SetExtractionType(fExtractionType);
     339    s.SetHeightTm(fHeightTm);
    338340    s.SetRiseFallTime(fRiseTimeHiGain, fFallTimeHiGain);
    339341
     
    357359    MExtralgoSpline s(ptr, num, fLoGainFirstDeriv.GetArray(), fLoGainSecondDeriv.GetArray());
    358360
     361    s.SetExtractionType(fExtractionType);
     362    s.SetHeightTm(fHeightTm);
    359363    s.SetRiseFallTime(fRiseTimeLoGain, fFallTimeLoGain);
    360364
     
    404408      rc = kTRUE;
    405409    }
    406  
     410  if (IsEnvDefined(env, prefix, "HeightTm", print))
     411    {
     412      fHeightTm = GetEnvValue(env, prefix, "HeightTm", fHeightTm);
     413      rc = kTRUE;
     414    }
     415
    407416  if (IsEnvDefined(env, prefix, "ExtractionType", print))
    408417  {
     
    411420      type = type.Strip(TString::kBoth);
    412421      if (type==(TString)"amplitude")
    413           SetChargeType(kAmplitude);
    414       if (type==(TString)"integral")
    415           SetChargeType(kIntegral);
     422          SetChargeType(MExtralgoSpline::kAmplitude);
     423      if (type==(TString)"integralabsolute")
     424          SetChargeType(MExtralgoSpline::kIntegralAbs);
     425      if (type==(TString)"integralrelative")
     426          SetChargeType(MExtralgoSpline::kIntegralRel);
    416427      rc=kTRUE;
    417428  }
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.h

    r8304 r8478  
    44#ifndef MARS_MExtractTimeAndCharge
    55#include "MExtractTimeAndCharge.h"
     6#endif
     7
     8#ifndef MARS_MExtralgoSpline
     9#include "MExtralgoSpline.h"
    610#endif
    711
     
    4145
    4246    Float_t fLoGainStretch;                  // The stretch of the low-gain w.r.t. the high-gain pulse
     47    Float_t fHeightTm;
    4348
    4449//    Int_t   fRandomIter;                     //! Counter used to randomize weights for noise calculation
     
    4752    Bool_t  InitArrays(Int_t n);
    4853
    49 public:
    50     enum ExtractionType_t { kAmplitude, kIntegral };    //! Possible time and charge extraction types
    51 
    5254private:
    53     ExtractionType_t fExtractionType;
     55    MExtralgoSpline::ExtractionType_t fExtractionType;
    5456
    5557public:
    5658    MExtractTimeAndChargeSpline(const char *name=NULL, const char *title=NULL);
    57     ~MExtractTimeAndChargeSpline() {}
    5859
    5960    Float_t GetRiseTimeHiGain() const { return fRiseTimeHiGain; }
     
    8384    void SetLoGainStretch(const Float_t f=fgLoGainStretch) { fLoGainStretch = f;   }
    8485
    85     void SetChargeType(const ExtractionType_t typ=kIntegral);
     86    void SetChargeType(const MExtralgoSpline::ExtractionType_t typ=MExtralgoSpline::kIntegralRel);
    8687/*
    8788    void FindTimeAndChargeHiGain(Byte_t *first, Byte_t *logain, Float_t &sum, Float_t &dsum,
     
    100101                                  Byte_t sat, Int_t maxpos) const;
    101102
    102     ClassDef(MExtractTimeAndChargeSpline, 4)   // Task to Extract Arrival Times and Charges using a Cubic Spline
     103    ClassDef(MExtractTimeAndChargeSpline, 5)   // Task to Extract Arrival Times and Charges using a Cubic Spline
    103104};
    104105
Note: See TracChangeset for help on using the changeset viewer.