Changeset 6742


Ignore:
Timestamp:
03/04/05 11:36:43 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r6741 r6742  
    2626     - removed the obsolete parts of "kMaximum" and "kHalfMaximum" in the
    2727       code which were still persistent
     28     - set default extraction type to integral (instead of amplitude)
     29
    2830
    2931 2005/03/04 Abelardo Moralejo
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc

    r6706 r6742  
    176176    : fAbMax(0.), fAbMaxPos(0.), fHalfMax(0.),
    177177      fRiseTimeHiGain(fgRiseTimeHiGain), fFallTimeHiGain(fgFallTimeHiGain),
    178       fRandomIter(0)
     178      fRandomIter(0), fExtractionType(kIntegral)
    179179{
    180180
     
    186186  SetOffsetLoGain(fgOffsetLoGain);
    187187
    188   SetChargeType();
    189188  SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast);
    190189}
     
    203202  MExtractor::SetRange(hifirst, hilast, lofirst, lolast);
    204203
    205   if (IsExtractionType(kIntegral))
    206     SetChargeType(kIntegral);
    207   if (IsExtractionType(kAmplitude))
    208     SetChargeType(kAmplitude);
    209  
     204  SetChargeType(fExtractionType);
    210205}
    211206
     
    221216{
    222217
    223   CLRBIT(fFlags,kAmplitude);
    224   CLRBIT(fFlags,kIntegral );
    225 
    226   SETBIT(fFlags,typ);
    227 
    228   if (IsExtractionType(kAmplitude))
     218  fExtractionType = typ;
     219
     220  if (fExtractionType == kAmplitude)
    229221    {
    230222      fNumHiGainSamples = 1.;
     
    239231    }
    240232
    241   if (IsExtractionType(kIntegral))
     233  if (fExtractionType == kIntegral)
    242234    {
    243235
     
    283275  fLoGainSecondDeriv.Reset();
    284276 
    285   if (IsExtractionType(kAmplitude))
     277  if (fExtractionType == kAmplitude)
    286278    {
    287279      fNumHiGainSamples = 1.;
     
    297289  fFallTimeLoGain    = fFallTimeHiGain * fLoGainStretch;     
    298290
    299   if (IsExtractionType(kIntegral))
     291  if (fExtractionType == kIntegral)
    300292    {
    301293
     
    416408      const Float_t nsx = fRandomIter * fResolution;
    417409
    418       if (IsExtractionType(kAmplitude))
     410      if (fExtractionType == kAmplitude)
    419411        {
    420412          const Float_t b = nsx;
     
    453445
    454446      dtime = 1.0;
    455       if (IsExtractionType(kAmplitude))
     447      if (fExtractionType == kAmplitude)
    456448        {
    457449          sum  = fAbMax;
     
    615607    }
    616608
    617   if (IsExtractionType(kAmplitude))
     609  if (fExtractionType == kAmplitude)
    618610    {
    619611      time  = fAbMaxPos + (Int_t)fHiGainFirst;
     
    775767      const Float_t nsx = fRandomIter * fResolution;
    776768
    777       if (IsExtractionType(kAmplitude))
     769      if (fExtractionType == kAmplitude)
    778770        {
    779771          const Float_t b = nsx;
     
    811803
    812804      dtime = 1.0;
    813       if (IsExtractionType(kAmplitude))
     805      if (fExtractionType == kAmplitude)
    814806        {
    815807          time = (Float_t)(fLoGainFirst + maxpos);
     
    976968    }
    977969
    978   if (IsExtractionType(kAmplitude))
     970  if (fExtractionType == kAmplitude)
    979971    {
    980972      time = fAbMaxPos + (Int_t)fLoGainFirst;
     
    12141206    }
    12151207 
    1216   Bool_t b = kFALSE;
    1217 
    1218   if (IsEnvDefined(env, prefix, "Amplitude", print))
    1219   {
    1220       b = GetEnvValue(env, prefix, "Amplitude", IsExtractionType(kAmplitude));
    1221       if (b)
    1222           SetChargeType(kAmplitude);
    1223       rc = kTRUE;
    1224   }
    1225   if (IsEnvDefined(env, prefix, "Integral", print))
    1226   {
    1227       b = GetEnvValue(env, prefix, "Integral", IsExtractionType(kIntegral));
    1228       if (b)
    1229           SetChargeType(kIntegral);
    1230       rc = kTRUE;
    1231   }
    1232 
    12331208  if (IsEnvDefined(env, prefix, "ExtractionType", print))
    12341209  {
     
    12401215      if (type==(TString)"integral")
    12411216          SetChargeType(kIntegral);
    1242       if (type==(TString)"maximum")
    1243           SetChargeType(kMaximum);
    1244       if (type==(TString)"halfmaximum")
    1245           SetChargeType(kHalfMaximum);
    12461217      rc=kTRUE;
    12471218  }
    12481219
    1249 
    1250 
    1251 
    12521220  return MExtractTimeAndCharge::ReadEnv(env, prefix, print) ? kTRUE : rc;
    12531221
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.h

    r6366 r6742  
    4848  Int_t   fRandomIter;                  // Counter used to randomize weights for noise calculation
    4949 
    50   Byte_t  fFlags;                       // Bit-field to hold the time extraction types
    51  
    52   Int_t  ReadEnv(const TEnv &env, TString prefix, Bool_t print);
     50  Int_t   ReadEnv(const TEnv &env, TString prefix, Bool_t print);
    5351
    54   Bool_t InitArrays();
     52  Bool_t  InitArrays();
    5553 
    5654  void CalcIntegralHiGain(Float_t &sum, Float_t start, Float_t last);
    5755  void CalcIntegralLoGain(Float_t &sum, Float_t start, Float_t last);
    5856
    59 public:
    60 
    61   enum ExtractionType_t { kMaximum,   kHalfMaximum,
    62                           kAmplitude, kIntegral    };    //! Possible time and charge extraction types
     57public: 
     58  enum ExtractionType_t { kAmplitude, kIntegral };    //! Possible time and charge extraction types
    6359
    6460private:
     61 
     62  ExtractionType_t fExtractionType;
    6563
    66   Bool_t IsExtractionType ( ExtractionType_t typ )  { return TESTBIT(fFlags, typ); }
    67  
    6864public:
    6965
     
    9591  void SetLoGainStretch ( const Float_t f=fgLoGainStretch    )  { fLoGainStretch = f;   }
    9692 
    97   void SetChargeType ( const ExtractionType_t typ=kAmplitude);
     93  void SetChargeType ( const ExtractionType_t typ=kIntegral);
    9894 
    9995  void FindTimeAndChargeHiGain(Byte_t *first, Byte_t *logain, Float_t &sum, Float_t &dsum,
Note: See TracChangeset for help on using the changeset viewer.