Ignore:
Timestamp:
01/10/05 23:24:35 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/msignal
Files:
2 edited

Legend:

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

    r5748 r5795  
    9898//     time search.
    9999//  2) If Charge Type: kIntegral was chosen, sum the fHiGainSignal between:
    100 //     (Int_t)(fAbMaxPos - fRiseTime) and
    101 //     (Int_t)(fAbMaxPos + fFallTime)
     100//     (Int_t)(fAbMaxPos - fRiseTimeHiGain) and
     101//     (Int_t)(fAbMaxPos + fFallTimeHiGain)
    102102//     (default: fRiseTime: 1.5, fFallTime: 4.5)
    103 //   
     103//                                           sum the fLoGainSignal between:
     104//     (Int_t)(fAbMaxPos - fRiseTimeHiGain*fLoGainStretch) and
     105//     (Int_t)(fAbMaxPos + fFallTimeHiGain*fLoGainStretch)
     106//     (default: fLoGainStretch: 1.5)
     107//       
    104108//  The values: fNumHiGainSamples and fNumLoGainSamples are set to:
    105109//  1) If Charge Type: kAmplitude was chosen: 1.
    106 //  2) If Charge Type: kIntegral was chosen: fRiseTime + fFallTime
    107 //                 or: fRiseTime + fFallTime + 1. in the case of the low-gain
     110//  2) If Charge Type: kIntegral was chosen: fRiseTimeHiGain + fFallTimeHiGain
     111//                 or: fNumHiGainSamples*fLoGainStretch in the case of the low-gain
    108112//
    109113//  Call: SetRange(fHiGainFirst, fHiGainLast, fLoGainFirst, fLoGainLast)
     
    127131//          --> no further function evaluation needed
    128132//        - SetChargeType(MExtractTimeAndChargeSpline::kIntegral) for the
    129 //          computation of the integral beneith the spline between fRiseTime 
    130 //          from the position of the maximum to fFallTime after the position of
     133//          computation of the integral beneith the spline between fRiseTimeHiGain
     134//          from the position of the maximum to fFallTimeHiGain after the position of
    131135//          the maximum. The Low Gain is computed with half a slice more at the rising
    132136//          edge and half a slice more at the falling edge.
     
    146150using namespace std;
    147151
    148 const Byte_t  MExtractTimeAndChargeSpline::fgHiGainFirst  = 2;
    149 const Byte_t  MExtractTimeAndChargeSpline::fgHiGainLast   = 14;
    150 const Byte_t  MExtractTimeAndChargeSpline::fgLoGainFirst  = 2;
    151 const Byte_t  MExtractTimeAndChargeSpline::fgLoGainLast   = 14;
    152 const Float_t MExtractTimeAndChargeSpline::fgResolution   = 0.05;
    153 const Float_t MExtractTimeAndChargeSpline::fgRiseTime     = 1.5;
    154 const Float_t MExtractTimeAndChargeSpline::fgFallTime     = 4.5;
     152const Byte_t  MExtractTimeAndChargeSpline::fgHiGainFirst    = 2;
     153const Byte_t  MExtractTimeAndChargeSpline::fgHiGainLast     = 14;
     154const Byte_t  MExtractTimeAndChargeSpline::fgLoGainFirst    = 2;
     155const Byte_t  MExtractTimeAndChargeSpline::fgLoGainLast     = 14;
     156const Float_t MExtractTimeAndChargeSpline::fgResolution     = 0.05;
     157const Float_t MExtractTimeAndChargeSpline::fgRiseTimeHiGain = 1.5;
     158const Float_t MExtractTimeAndChargeSpline::fgFallTimeHiGain = 4.5;
     159const Float_t MExtractTimeAndChargeSpline::fgLoGainStretch  = 1.5;
     160const Float_t MExtractTimeAndChargeSpline::fgOffsetLoGain   = 1.7;   // 5 ns
    155161// --------------------------------------------------------------------------
    156162//
     
    161167//
    162168// Initializes:
    163 // - fResolution    to fgResolution
    164 // - fRiseTime      to fgRiseTime
    165 // - fFallTime      to fgFallTime
    166 // - Time Extraction Type to kMaximum
     169// - fResolution     to fgResolution
     170// - fRiseTimeHiGain to fgRiseTimeHiGain
     171// - fFallTimeHiGain to fgFallTimeHiGain
    167172// - Charge Extraction Type to kAmplitude
     173// - fLoGainStretch  to fgLoGainStretch
    168174//
    169175MExtractTimeAndChargeSpline::MExtractTimeAndChargeSpline(const char *name, const char *title)
     
    175181
    176182  SetResolution();
    177   SetRiseTime();
    178   SetFallTime();
     183
     184  SetRiseTimeHiGain();
     185  SetFallTimeHiGain();
    179186 
    180187  SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast);
    181188
    182189  SetChargeType();
    183 
     190  SetLoGainStretch();
     191
     192  SetOffsetLoGain(fgOffsetLoGain);
    184193}
    185194
     
    263272  if (IsExtractionType(kIntegral))
    264273    {
    265       fNumHiGainSamples  = fRiseTime + fFallTime;
    266       fNumLoGainSamples  = fLoGainLast ? fNumHiGainSamples + 1. : 0.;
    267       fNumLoGainSamples  *= 0.75;     
     274
     275      fRiseTimeLoGain    = fRiseTimeHiGain * fLoGainStretch;
     276      fFallTimeLoGain    = fFallTimeHiGain * fLoGainStretch;     
     277
     278      fNumHiGainSamples  = fRiseTimeHiGain + fFallTimeHiGain;
     279      fNumLoGainSamples  = fLoGainLast ? fRiseTimeLoGain + fFallTimeLoGain : 0.;
     280      //      fNumLoGainSamples  *= 0.75;     
    268281
    269282      fSqrtHiGainSamples = TMath::Sqrt(fNumHiGainSamples);
    270283      fSqrtLoGainSamples = TMath::Sqrt(fNumLoGainSamples);
    271       fWindowSizeHiGain  = (Int_t)(fRiseTime + fFallTime);
    272       fWindowSizeLoGain  = (Int_t)(fRiseTime + fFallTime+1);
     284      fWindowSizeHiGain  = (Int_t)(fRiseTimeHiGain + fFallTimeHiGain);
     285      fWindowSizeLoGain  = (Int_t)(fRiseTimeLoGain + fFallTimeLoGain);
    273286    }
    274287
     
    392405        {
    393406          Float_t start = 2. + nsx;
    394           Float_t last  = start + fRiseTime + fFallTime;
     407          Float_t last  = start + fRiseTimeHiGain + fFallTimeHiGain;
    395408     
    396409          if (int(last) > range)
     
    423436     
    424437      if (maxpos > range - 2)
    425         CalcIntegralHiGain(sum, (Float_t)range - fRiseTime - fFallTime, (Float_t)range - 0.001);
     438        CalcIntegralHiGain(sum, (Float_t)range - fRiseTimeHiGain - fFallTimeHiGain, (Float_t)range - 0.001);
    426439      else
    427         CalcIntegralHiGain(sum, 0.001, fRiseTime + fFallTime);
     440        CalcIntegralHiGain(sum, 0.001, fRiseTimeHiGain + fFallTimeHiGain);
    428441
    429442      time =  (Float_t)(fHiGainFirst + maxpos - 1);
     
    650663  //
    651664 
    652   Float_t start = fAbMaxPos - fRiseTime;
    653   Float_t last  = fAbMaxPos + fFallTime;
     665  Float_t start = fAbMaxPos - fRiseTimeHiGain;
     666  Float_t last  = fAbMaxPos + fFallTimeHiGain;
    654667 
    655668  const Int_t diff = int(last) - range;
     
    750763        {
    751764          Float_t start = 2. + nsx;
    752           Float_t last  = start + fRiseTime + fFallTime +1.;
     765          Float_t last  = start + fRiseTimeLoGain + fFallTimeLoGain;
    753766     
    754767          if (int(last) > range)
     
    769782  // Don't start if the maxpos is too close to the limits.
    770783  //
    771   if (sat || maxpos < TMath::Ceil(fRiseTime+0.45) || maxpos > range-2)
     784  if (sat || maxpos < TMath::Ceil(fRiseTimeLoGain) || maxpos > range-2)
    772785    {
    773786      dtime = 0.5;
     
    780793     
    781794      if (maxpos > range-2)
    782         CalcIntegralLoGain(sum, (Float_t)range - fRiseTime - fFallTime-1., (Float_t)range - 0.001);
     795        CalcIntegralLoGain(sum, (Float_t)range - fRiseTimeLoGain - fFallTimeLoGain -1., (Float_t)range - 0.001);
    783796      else
    784         CalcIntegralLoGain(sum, 0.001, fRiseTime + fFallTime + 1.);
     797        CalcIntegralLoGain(sum, 0.001, fRiseTimeLoGain + fFallTimeLoGain + 1.);
    785798
    786799      time = (Float_t)(fLoGainFirst + maxpos - 1);
     
    10101023  // Now integrate the whole thing!
    10111024  //
    1012   Float_t start = fAbMaxPos - fRiseTime - 0.5;
    1013   Float_t last  = fAbMaxPos + fFallTime + 0.5;
     1025  Float_t start = fAbMaxPos - fRiseTimeLoGain;
     1026  Float_t last  = fAbMaxPos + fFallTimeLoGain;
    10141027 
    10151028  const Int_t diff = int(last) - range;
     
    11561169      rc  = kTRUE;
    11571170    }
    1158   if (IsEnvDefined(env, prefix, "RiseTime", print))
    1159     {
    1160       SetRiseTime(GetEnvValue(env, prefix, "RiseTime", fRiseTime));
     1171  if (IsEnvDefined(env, prefix, "RiseTimeHiGain", print))
     1172    {
     1173      SetRiseTimeHiGain(GetEnvValue(env, prefix, "RiseTimeHiGain", fRiseTimeHiGain));
    11611174      rc = kTRUE;
    11621175    }
    1163   if (IsEnvDefined(env, prefix, "FallTime", print))
    1164     {
    1165       SetFallTime(GetEnvValue(env, prefix, "FallTime", fFallTime));
     1176  if (IsEnvDefined(env, prefix, "FallTimeHiGain", print))
     1177    {
     1178      SetFallTimeHiGain(GetEnvValue(env, prefix, "FallTimeHiGain", fFallTimeHiGain));
     1179      rc = kTRUE;
     1180    }
     1181  if (IsEnvDefined(env, prefix, "LoGainStretch", print))
     1182    {
     1183      SetLoGainStretch(GetEnvValue(env, prefix, "LoGainStretch", fLoGainStretch));
    11661184      rc = kTRUE;
    11671185    }
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.h

    r5794 r5795  
    2424  static const Float_t fgFallTimeHiGain; //! Default for fFallTime     (now set to: 4.5)
    2525  static const Float_t fgLoGainStretch;  //! Default for fLoGainStretch (now set to: 1.5)
    26   static const Float_t fgOffsetLoGain;   //! Default for fOffsetLoGain (now set to 1.2)
     26  static const Float_t fgOffsetLoGain;   //! Default for fOffsetLoGain (now set to 1.7)
    2727 
    2828  MArrayF fHiGainSignal;                //! Need fast access to the signals in a float way
Note: See TracChangeset for help on using the changeset viewer.