Ignore:
Timestamp:
03/12/03 14:41:29 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/tpoint/tpointfit.C

    r1810 r1819  
    2727    friend ifstream &operator>>(ifstream &fin, Set &set);
    2828private:
    29     Double_t fOrigStarAz;
    30     Double_t fOrigStarEl;
    31 
    3229    Double_t fStarAz;
    3330    Double_t fStarEl;
     
    4744    Double_t GetResidual() const
    4845    {
    49         Double_t del = fRawEl-fStarEl;
    50         Double_t daz = fRawAz-fStarAz;
    51 
    52         Double_t dphi2 = daz/2.;
    53         Double_t cos2  = cos(dphi2)*cos(dphi2);
    54         Double_t sin2  = sin(dphi2)*sin(dphi2);
    55         Double_t d = cos(del)*cos2 - cos(2*fOrigStarEl+del)*sin2;
    56 
    57         Double_t  dist = acos(d);
    58 
    59         return dist * 180 / TMath::Pi();
     46         Double_t del = fRawEl-fStarEl;
     47         Double_t daz = fRawAz-fStarAz;
     48         Double_t dphi2 = daz/2.;
     49         Double_t cos2  = cos(dphi2)*cos(dphi2);
     50         Double_t sin2  = sin(dphi2)*sin(dphi2);
     51         Double_t d = cos(del)*cos2 - cos(fRawEl+fStarEl)*sin2;
     52
     53         Double_t dist = acos(d);
     54
     55         return dist * 180 / TMath::Pi();
    6056    }
    6157
     
    112108    set.fStarEl = v[1]*TMath::Pi()/180;
    113109
    114     set.fOrigStarAz = v[0]*TMath::Pi()/180;
    115     set.fOrigStarEl = v[1]*TMath::Pi()/180;
    116 
    117110    set.fRawAz  = v[2]*TMath::Pi()/180;
    118111    set.fRawEl  = v[3]*TMath::Pi()/180;
     
    284277        phi0 += scale*d;
    285278        phi1 -= scale*d;
    286     }
    287 
    288     DrawPolLine(pad, r0, phi0, r1, phi1);
    289     DrawMarker(pad,  r0, phi0, r1, phi1);
     279
     280        DrawPolLine(pad, r0, phi0, r1, phi1);
     281        DrawMarker(pad,  r0, phi0, r1, phi1);
     282    }
     283    else
     284        DrawMarker(pad,  r1, phi1, 0 ,0);
    290285}
    291286
     
    296291    gCoordinates.SetOwner();
    297292
    298     TH1F hres1("Res1", "  Residuals before correction     ", 10, 0, 180);
    299     TH1F hres2("Res2", "  Residuals after correction     ",  10, 0,   1);
     293    TH1F hres1("Res1", "  Residuals before correction     ", 10, 0,   4);
     294    TH1F hres2("Res2", "  Residuals after correction     ",  40, 0,   4);
    300295
    301296    hres1.SetXTitle("\\Delta [\\circ]");
     
    316311    gzd.SetTitle(" \\Delta Zd vs. Zd ");
    317312
    318     ifstream fin("tpoint/tpoint3.txt");
     313    ifstream fin("/home/tbretz/pc4/results/tpoint3.txt");
    319314
    320315    while (fin && fin.get()!='\n');
     
    395390
    396391    //
     392    // Correct for Offsets only
     393    //
     394    double par[16];
     395    bending.GetParameters(par);
     396    for (int i=2; i<16; i++) par[i]=0;
     397    MBending b2;
     398    b2.SetParameters(par);
     399
     400    //
    397401    // Calculate correction and residuals
    398402    //
     
    403407        ZdAz za = set0.GetStarZdAz()*kRad2Deg;
    404408
    405         hres1.Fill(set0.GetResidual());
     409        //
     410        // Correct for offsets only
     411        //
     412        Set set1(set0);
     413        set1.Adjust(b2);
     414
     415        hres1.Fill(set1.GetResidual());
     416
    406417        set0.Adjust(bending);
    407418        hres2.Fill(set0.GetResidual());
     
    412423
    413424        static int j=0;
    414         gdzd.SetPoint(j, za.Az()/*   set0.GetStarAz()*/, set0.GetDZd());
    415         gaz.SetPoint( j, za.Az()/*   set0.GetStarAz()*/, dz);
    416         gdaz.SetPoint(j, za.Zd()/*90-set0.GetStarEl()*/, dz);
    417         gzd.SetPoint( j, za.Zd()/*90-set0.GetStarEl()*/, set0.GetDZd());
     425        gdzd.SetPoint(j, za.Az(), set0.GetDZd());
     426        gaz.SetPoint( j, za.Az(), dz);
     427        gdaz.SetPoint(j, za.Zd(), dz);
     428        gzd.SetPoint( j, za.Zd(), set0.GetDZd());
    418429        j++;
    419430    }
     
    463474    cout << "Spead after:  " << hres2.GetMean() << "deg  +-  " << hres2.GetRMS() << "deg" << endl;
    464475    cout << "Spead before: " << (int)(hres1.GetMean()*60+.5) << "'  +-  " << (int)(hres1.GetRMS()*60+.5) << "'" << endl;
     476    cout << "Spead before: " << (int)(hres1.GetMean()*60*60/23.4+.5) << "pix  +-  " << (int)(hres1.GetRMS()*60*60/23.4+.5) << "pix" << endl;
    465477    cout << "Spead after:  " << (int)(hres2.GetMean()*60+.5) << "'  +-  " << (int)(hres2.GetRMS()*60+.5) << "'" << endl;
     478    cout << "Spead after:  " << (int)(hres2.GetMean()*60*60/23.4+.5) << "pix  +-  " << (int)(hres2.GetRMS()*60*60/23.4+.5) << "pix" << endl;
    466479    cout << "Spead after:  " << (int)(hres2.GetMean()*16384/360+.5) << "SE  +-  " << (int)(hres2.GetRMS()*16384/360+.5) << "SE" << endl;
    467480    cout << endl;
     
    505518    gPad->Update();
    506519    for (int i=0; i<gCoordinates.GetSize(); i++)
    507         DrawSet(gPad, *(Set*)list.At(i), 10./hres1.GetMean());
     520        DrawSet(gPad, *(Set*)list.At(i));//, 10./hres1.GetMean());
    508521
    509522    c1->cd(3);
Note: See TracChangeset for help on using the changeset viewer.