Changeset 3032 for trunk/MagicSoft


Ignore:
Timestamp:
02/05/04 17:37:02 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3031 r3032  
    2929     - default step width 100 ps.
    3030     - look for half maximum (at rising edge)
     31
     32   * manalysis/MExtractSignal.[h,cc]
     33     - removed uncommented code
     34     - set start byte back by one like it was before TB's changes
     35       (does not affect the calculation of number of FADC slices)
     36
    3137
    3238
  • trunk/MagicSoft/Mars/manalysis/MArrivalTimeCalc.cc

    r2944 r3032  
    6161// Default constructor.
    6262//
     63// Initialize step size by default to 0.03 time slices == 100 ps.
     64//
    6365MArrivalTimeCalc::MArrivalTimeCalc(const char *name, const char *title)
    64     : fStepSize(0.1)
     66    : fStepSize(0.03)
    6567{
    6668
     
    8082//  - MArrivalTime
    8183//
     84
    8285Int_t MArrivalTimeCalc::PreProcess(MParList *pList)
    8386{
     87
     88
    8489    fRawEvt = (MRawEvtData*)pList->FindObject(AddSerialNumber("MRawEvtData"));
    8590    if (!fRawEvt)
     
    186191
    187192  //
    188   // Now find the maximum evaluating the spline function at every 1/10 time slice
     193  // Now find the half maximum (!)
     194  // evaluating the spline function at every fStepSize time slice
    189195  //
    190196  Double_t abscissa=0;
     
    201207          maxAb  = abscissa;
    202208        }
     209      // make step size a bit bigger first
    203210      abscissa += fStepSize;
    204     }
    205 
    206   return (Float_t)maxAb;
    207 }
    208 
     211      //      abscissa += fStepSize;
     212    }
     213
     214  //
     215  // another (much smaller) loop to move back from the maximum
     216  //
     217  Double_t halfMaxAb = 0;
     218
     219  abscissa = maxAb;
     220 
     221  while (abscissa > 0)
     222    {
     223     
     224      const Double_t swap = spline.Eval(abscissa);
     225     
     226      if (swap < maxOrd/2.)
     227        {
     228          halfMaxAb = abscissa;
     229          break;
     230        }
     231     
     232      abscissa -= fStepSize;
     233    }
     234 
     235
     236  //  return (Float_t)maxAb;
     237  return (Float_t)halfMaxAb;
     238}
     239
  • trunk/MagicSoft/Mars/manalysis/MExtractSignal.cc

    r3016 r3032  
    1717!
    1818!   Author(s): Markus Gaug, 09/2003 <mailto:markus@ifae.es>
     19!              Thomas Bretz, 01/2004
    1920!
    2021!   Copyright: MAGIC Software Development, 2000-2004
     
    124125void MExtractSignal::FindSignal(Byte_t *ptr, Int_t size, Int_t &sum, Byte_t &sat) const
    125126{
    126     Byte_t *end = ptr + size;
    127 
    128     sum = 0;
    129     sat = 0;
    130 
    131     while (ptr<end)
    132     {
    133         sum += *ptr;
    134 
    135         if (*ptr++ >= fSaturationLimit)
    136             sat++;
     127
     128  Byte_t *end = ptr + size;
     129 
     130  sum = 0;
     131  sat = 0;
     132 
     133  while (ptr<end)
     134    {
     135      sum += *ptr;
     136     
     137      if (*ptr++ >= fSaturationLimit)
     138        sat++;
    137139    }
    138140}
     
    156158        Byte_t sathi, satlo;
    157159
    158         FindSignal(pixel.GetHiGainSamples()+fHiGainFirst, fNumHiGainSamples, sumhi, sathi);
    159         FindSignal(pixel.GetLoGainSamples()+fLoGainFirst, fNumLoGainSamples, sumlo, satlo);
     160        FindSignal(pixel.GetHiGainSamples()+fHiGainFirst-1, fNumHiGainSamples, sumhi, sathi);
     161        FindSignal(pixel.GetLoGainSamples()+fLoGainFirst-1, fNumLoGainSamples, sumlo, satlo);
    160162
    161163        if (satlo)
     
    170172        const Float_t pedrms = ped.GetPedestalRms();
    171173
     174       
    172175        pix.SetExtractedSignal(sumhi - pedes*fNumHiGainSamples, pedrms*fSqrtHiGainSamples,
    173176                               sumlo - pedes*fNumLoGainSamples, pedrms*fSqrtLoGainSamples);
Note: See TracChangeset for help on using the changeset viewer.