Changeset 8585 for trunk/MagicSoft


Ignore:
Timestamp:
06/19/07 12:17:36 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8584 r8585  
    7272     - changed the GetScale from a calculation to a switch
    7373       (faster and easier to understand)
     74
     75   * callisto_mux.rc:
     76     - replaced saturation and lower signal limit in
     77       MJPedestalY2.MHCalibrationPulseTimeCam by the defaults
     78
     79   * mbase/MMath.[h,cc]:
     80     - added a function to do a InterpolParab assuming that the
     81       x-coordinates are -1, 0, 1
    7482
    7583
  • trunk/MagicSoft/Mars/callisto_mux.rc

    r8577 r8585  
    335335# Define the Pulse Position check parameters:
    336336# -------------------------------------------------------------------------
    337 MJPedestalY2.MHCalibrationPulseTimeCam.SaturationLimit:  252
    338 MJPedestalY2.MHCalibrationPulseTimeCam.LowerSignalLimit: 35
    339 #MJPedestalY2.MHCalibrationPulseTimeCam.NumPixelsRequired: 2
     337#MJPedestalY2.MHCalibrationPulseTimeCam.SaturationLimit:  245
     338#MJPedestalY2.MHCalibrationPulseTimeCam.LowerSignalLimit:  85
     339#MJPedestalY2.MHCalibrationPulseTimeCam.NumPixelsRequired:  2
    340340#MJPedestalY2.PixelCheck: no
    341341
  • trunk/MagicSoft/Mars/mbase/MMath.cc

    r8581 r8585  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.35 2007-06-18 14:42:32 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.36 2007-06-19 11:14:33 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    308308TVector3 MMath::GetParab(const TVector3 &x, const TVector3 &y)
    309309{
    310     Double_t x1 = x(0);
    311     Double_t x2 = x(1);
    312     Double_t x3 = x(2);
    313 
    314     Double_t y1 = y(0);
    315     Double_t y2 = y(1);
    316     Double_t y3 = y(2);
     310    const Double_t x1 = x(0);
     311    const Double_t x2 = x(1);
     312    const Double_t x3 = x(2);
     313
     314    const Double_t y1 = y(0);
     315    const Double_t y2 = y(1);
     316    const Double_t y3 = y(2);
    317317
    318318    const double det =
     
    343343}
    344344
     345// --------------------------------------------------------------------------
     346//
     347//  Interpolate the points with x-coordinates vx and y-coordinates vy
     348// by a parabola (second order polynomial) and return the value at x.
     349//
    345350Double_t MMath::InterpolParabLin(const TVector3 &vx, const TVector3 &vy, Double_t x)
    346351{
    347352    const TVector3 c = GetParab(vx, vy);
     353    return c(0) + c(1)*x + c(2)*x*x;
     354}
     355
     356// --------------------------------------------------------------------------
     357//
     358//  Interpolate the points with x-coordinates vx=(-1,0,1) and
     359// y-coordinates vy by a parabola (second order polynomial) and return
     360// the value at x.
     361//
     362Double_t MMath::InterpolParabLin(const TVector3 &vy, Double_t x)
     363{
     364    const TVector3 c(vy(1), (vy(2)-vy(0))/2, vy(0)/2 - vy(1) + vy(2)/2);
    348365    return c(0) + c(1)*x + c(2)*x*x;
    349366}
  • trunk/MagicSoft/Mars/mbase/MMath.h

    r8544 r8585  
    3939    TVector3 GetParab(const TVector3 &x, const TVector3 &y);
    4040    Double_t InterpolParabLin(const TVector3 &vx, const TVector3 &vy, Double_t x);
     41    Double_t InterpolParabLin(const TVector3 &vy, Double_t x);
    4142    Double_t InterpolParabLog(const TVector3 &vx, const TVector3 &vy, Double_t x);
    4243    Double_t InterpolParabCos(const TVector3 &vx, const TVector3 &vy, Double_t x);
  • trunk/MagicSoft/Mars/mjobs/MJStar.cc

    r8582 r8585  
    110110
    111111    const TString oname = Form("%s/star%08d.root", (const char*)fPathOut, fSequence.GetSequence());
    112     return WriteContainer(cont, oname, "UPDATE");
     112    return WriteContainer(cont, oname, "RECREATE");
    113113}
    114114
  • trunk/MagicSoft/Mars/msignal/MExtractor.cc

    r8582 r8585  
    136136    : fResolutionPerPheHiGain(0), fResolutionPerPheLoGain(0),
    137137    fSignals(NULL), fRawEvt(NULL), fRunHeader(NULL), fSignal(NULL),
    138       /*fHiLoLast(0),*/ fNumHiGainSamples(0), fNumLoGainSamples(0)
     138    fNumHiGainSamples(0), fNumLoGainSamples(0)
    139139{
    140140    fName  = name  ? name  : "MExtractor";
     
    251251        fLoGainFirst=0;
    252252        fLoGainLast =0;
    253         if (fSaturationLimit>fRunHeader->GetMax())
    254         {
    255             *fLog << " and saturation limit to " << fRunHeader->GetMax();
    256             fSaturationLimit=fRunHeader->GetMax();
    257         }
    258253        *fLog << "." << endl;
    259254    }
    260255
    261 /*
    262   const Int_t logainsamples = fRunHeader->GetNumSamplesLoGain();
    263 
    264   Int_t lastdesired;
    265   Int_t lastavailable;
    266 
    267   if (logainsamples)
    268     {
    269 
    270       lastdesired   = (Int_t)(fLoGainLast);
    271       lastavailable = logainsamples-1;
    272      
    273       if (lastavailable < 0)
    274         *fLog << warn << GetDescriptor() << " - WARNING: Number of available Low-Gain Slices is smaller than or equal zero!" << endl;
    275      
    276     if (lastdesired > lastavailable)
    277       {
    278         const Int_t diff = lastdesired - lastavailable;
    279        
    280         *fLog << endl;
    281         *fLog << warn << GetDescriptor() << ": Selected Lo Gain FADC Window [";
    282         *fLog << Form("%2i,%2i", (int)fLoGainFirst, lastdesired);
    283         *fLog << "] ranges out of the available limits: [0," << Form("%2i", lastavailable) << "]" << endl;
    284         *fLog << GetDescriptor() << ": Will reduce the upper edge to " << (int)(fLoGainLast - diff) << endl;
    285         SetRange(fHiGainFirst, fHiGainLast, fLoGainFirst, fLoGainLast-diff);
    286       }
    287     }
    288   else
    289     SetRange(fHiGainFirst, fHiGainLast, 0,0);     
    290  
    291   const Int_t higainsamples = fRunHeader->GetNumSamplesHiGain();
    292 
    293   if (higainsamples <= 0)
    294     {
    295       *fLog << err << GetDescriptor();
    296       *fLog << " - ERROR: Number of available High-Gain Slices is smaller than or equal zero!" << endl;
    297       return kFALSE;
    298     }
    299 
    300   lastdesired   = (Int_t)fHiGainLast;
    301   lastavailable = higainsamples-1;
    302  
    303   if (lastdesired > lastavailable)
    304     {
    305       const Int_t diff = lastdesired - lastavailable;
    306      
    307       *fLog << endl;
    308       *fLog << inf << GetDescriptor() << ": Selected Hi Gain FADC Window [";
    309       *fLog << Form("%2i,%2i", (int)fHiGainFirst,lastdesired);
    310       *fLog << "] ranges out of the available limits: [0," << Form("%2i", lastavailable) << "]" << endl;
    311       *fLog << inf << GetDescriptor() << ": Will use ";
    312       *fLog << Form("%2i", diff) << " samples from the Low-Gain for the High-Gain extraction";
    313       *fLog << endl;
    314      
    315       fHiGainLast -= diff;
    316       fHiLoLast    = diff;
    317     }
    318  
    319   */
    320256    return kTRUE;
    321257}
     
    329265{
    330266    return kERROR;
    331 /*
    332   MRawEvtPixelIter pixel(fRawEvt);
    333 
    334   while (pixel.Next())
    335     {
    336       Float_t sumhi = 0.;
    337       Byte_t sathi = 0;
    338 
    339       FindSignalHiGain(pixel.GetHiGainSamples()+fHiGainFirst, pixel.GetLoGainSamples(), sumhi, sathi);
    340 
    341       Float_t sumlo  = 0.;
    342       Byte_t  satlo  = 0;
    343 
    344       if (pixel.HasLoGain())
    345         FindSignalLoGain(pixel.GetLoGainSamples()+fLoGainFirst, sumlo, satlo);
    346 
    347       const Int_t pixid = pixel.GetPixelId();
    348      
    349       const MPedestalPix  &ped = (*fPedestals)[pixid];
    350       MExtractedSignalPix &pix = (*fSignals)[pixid];
    351      
    352       const Float_t pedes  = ped.GetPedestal();
    353       const Float_t pedrms = ped.GetPedestalRms();
    354 
    355       pix.SetExtractedSignal(sumhi - pedes*fNumHiGainSamples, pedrms*fSqrtHiGainSamples,
    356                              sumlo - pedes*fNumLoGainSamples, pedrms*fSqrtLoGainSamples);
    357      
    358       pix.SetGainSaturation(sathi, satlo);
    359      
    360     }
    361 
    362     fSignals->SetReadyToSave();
    363 
    364     return kTRUE;
    365     */
    366267}
    367268
     
    461362
    462363    *fLog << " Hi Gain Range:      " << Form("%2d %2d", fHiGainFirst, fHiGainLast) << endl;
     364    *fLog << " Saturation Lim:     " << Form("%3d", fSaturationLimit) << endl;
    463365    if (HasLoGain())
    464366    {
    465367        *fLog << " Lo Gain Range:      " << Form("%2d %2d", fLoGainFirst, fLoGainLast) << endl;
    466         *fLog << " Saturation Lim:     " << Form("%3d", fSaturationLimit) << endl;
    467368        *fLog << " Num Samples Hi/Lo:  " << Form("%2.1f %2.1f", fNumHiGainSamples, fNumLoGainSamples) << endl;
    468369    }
Note: See TracChangeset for help on using the changeset viewer.