Changeset 7392 for trunk/MagicSoft


Ignore:
Timestamp:
11/10/05 12:03:37 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7390 r7392  
    4646   * mpointing/MPointingPos.[h,cc]:
    4747     - added Print function
     48
     49   * ganymed_onoff.rc:
     50     - let the exponential fit fit all the background (decoupled
     51       sclae and background-fit reagion)
     52
     53   * mhflux/MAlphaFitter.[h,cc]:
     54     - changed the background fit in the case of a ThetaSq function
     55       from a polynomial to a exponential
    4856
    4957
  • trunk/MagicSoft/Mars/NEWS

    r7390 r7392  
    88     and where to search for the image data
    99       --ind=/magic/data/star
    10 
    11    - ganymed/sponde: Calculation of the error of single size-/energy-
    12      bins now uses Li/Ma (5) instead of LiMa (17)
    1310
    1411   - ganymed: MSrcPosCorrect now allows overwriting of the misfocussing
     
    2320     "1ES1218" were read) The source coordinates are now printed
    2421     in addition to its name to the logging output.
     22
     23   - ganymed: changed the background fit in the case of a ThetaSq function
     24     from a polynomial to a exponential, this should give a big improvement
     25     for on-only analysis'
     26
     27   - ganymed/sponde: Calculation of the error of single size-/energy-
     28     bins now uses Li/Ma (5) instead of LiMa (17)
    2529
    2630
  • trunk/MagicSoft/Mars/ganymed_onoff.rc

    r7362 r7392  
    101101
    102102# ---------- SETUP FOR ONOFF-MODE -----------
     103MAlphaFitter.ScaleMin: 0.137
     104MAlphaFitter.ScaleMax: 0.640
    103105MAlphaFitter.BackgroundFitMin: 0.137
    104 MAlphaFitter.BackgroundFitMax: 0.64
     106MAlphaFitter.BackgroundFitMax: 1.000
    105107MAlphaFitter.PolynomOrder: 1
    106 MAlphaFitter.ScaleMode: Background
     108MAlphaFitter.ScaleMode: OffRegion
    107109MAlphaFitter.SignalFunction: ThetaSq
    108110
  • trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc

    r7386 r7392  
    116116    Double_t bgmax =fBgMax;
    117117
    118     //*fLog << inf << "Fit: " << sigmax << " " << fSigInt << "  " << bgmin << " " << bgmax << endl;
    119 
    120     //TF1 fFunc("", Form("gaus(0) + pol%d(3)", fPolynomOrder), 0, 90);
    121 
    122     //fFunc->SetParameters(fCoefficients.GetArray());
    123 
    124     fFunc->FixParameter(1, 0);
    125     if (fPolynomOrder!=1)
    126         fFunc->FixParameter(4, 0);
    127     fFunc->SetParLimits(2, 0, 90);
    128     fFunc->SetParLimits(3, -1, 1);
    129 
    130118    const Double_t alpha0 = h.GetBinContent(1);
    131119    const Double_t alphaw = h.GetXaxis()->GetBinWidth(1);
     
    137125    // First fit a polynom in the off region
    138126    fFunc->FixParameter(0, 0);
     127    fFunc->FixParameter(1, 0);
    139128    fFunc->FixParameter(2, 1);
    140129    fFunc->ReleaseParameter(3);
     130    if (fPolynomOrder!=1)
     131        fFunc->FixParameter(4, 0);
    141132
    142133    for (int i=5; i<fFunc->GetNpar(); i++)
     
    145136        else
    146137            fFunc->SetParameter(i, 0);
     138
     139    fFunc->SetParLimits(2, 0, 90);
     140    //    fFunc->SetParLimits(3, -1, 1);
    147141
    148142    // options : N  do not store the function, do not draw
     
    171165    //func.ReleaseParameter(1);
    172166    fFunc->ReleaseParameter(2);
    173     fFunc->FixParameter(3, fFunc->GetParameter(3));
    174     fFunc->FixParameter(4, fFunc->GetParameter(4));
    175     for (int i=5; i<fFunc->GetNpar(); i++)
     167    for (int i=3; i<fFunc->GetNpar(); i++)
    176168        fFunc->FixParameter(i, fFunc->GetParameter(i));
    177169
    178170    // Do not allow signals smaller than the background
    179     const Double_t A  = alpha0-fFunc->GetParameter(3);
     171    const Double_t s  = fSignalFunc==kGauss ? fFunc->GetParameter(3) : TMath::Exp(fFunc->GetParameter(3));
     172    const Double_t A  = alpha0-s;
    180173    const Double_t dA = TMath::Abs(A);
    181174    fFunc->SetParLimits(0, -dA*4, dA*4);
     
    334327    switch (fSignalFunc)
    335328    {
    336     case kGauss:       *fLog << "gauss(x)";        break;
    337     case kThetaSq:     *fLog << "gauss(sqrt(x))";  break;
     329    case kGauss:       *fLog << "gauss(x)/pol" << fPolynomOrder; break;
     330    case kThetaSq:     *fLog << "gauss(sqrt(x))/expo";  break;
    338331    }
    339332    *fLog << endl;
  • trunk/MagicSoft/Mars/mhflux/MAlphaFitter.h

    r7386 r7392  
    136136            break;
    137137        case kThetaSq:
    138             fFunc=new TF1 ("", Form("[0]*exp(-0.5*((sqrt(x)-[1])/[2])^2) + pol%d(3)", fPolynomOrder));
     138//            if (fPolynomOrder==0)
     139//                fFunc=new TF1("", "[0]*exp(-0.5*((sqrt(x)-[1])/[2])^2) + pol0(3)");
     140//            else
     141            //            {
     142            if (fPolynomOrder>0)
     143                fPolynomOrder = 1;
     144            fFunc=new TF1("", "[0]*exp(-0.5*((sqrt(x)-[1])/[2])^2) + expo(3)");
     145//            }
    139146            break;
    140147        }
Note: See TracChangeset for help on using the changeset viewer.