Ignore:
Timestamp:
08/25/05 13:57:36 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r7295 r7313  
    6565        const Double_t del = fRawEl-fStarEl;
    6666        const Double_t daz = fRawAz-fStarAz;
     67
    6768        /*
    6869        const Double_t dphi2 = daz/2.;
     
    7172        const Double_t d = cos(del)*cos2 - cos(fRawEl+fStarEl)*sin2;
    7273        */
    73 
    7474        const Double_t d  = cos(del) - cos(fRawEl)*cos(fStarEl)*(1.-cos(daz));
    7575
     
    208208        bend.SetParameters(par); // Set Parameters [deg] to MPointing
    209209
     210        Int_t n=0;
    210211        for (int i=0; i<fCoordinates.GetSize(); i++)
    211212        {
     
    214215            set.Adjust(bend);
    215216
    216             Double_t err;// = 0.005; // [deg] = 0.25SE
    217             Double_t res = set.GetResidual(&err);
     217            Double_t err = 0.01; // [deg] = 0.25SE
     218            Double_t res = set.GetResidual(); //(&err);
    218219            res /= err;
    219220
     
    221222        }
    222223
    223         //f /= (fCoordinates.GetSize()-7)*(fCoordinates.GetSize()-7);
    224         //f /= fCoordinates.GetSize()*fCoordinates.GetSize();
    225         //cout << f << ": " << fCoordinates.GetSize() << endl;
    226224        f /= fCoordinates.GetSize();
    227225    }
     
    256254        //Double_t x1[3] = { r1*cos(phi1), r1*sin(phi1), 0};
    257255
    258         Double_t y0[3], y1[3];
     256        Double_t y0[3];//, y1[3];
    259257   
    260258        view->WCtoNDC(x0, y0);
     
    412410        TGraph gaz;
    413411        TGraph gzd;
    414         TGraph graz;
    415         TGraph grzd;
    416         TGraph grmag;
     412        TGraphErrors graz;
     413        TGraphErrors grzd;
     414        TGraphErrors grmag;
    417415        TGraph gmaz;
    418416        TGraph gmzd;
     
    513511            if (dz>180)
    514512                dz -= 360;
     513
     514            Double_t err;
    515515   
    516516            gdzd.SetPoint(i, za.Az(), set0.GetDZd());
    517517            gdaz.SetPoint(i, za.Zd(), dz);
    518             graz.SetPoint(i, za.Az(), set0.GetResidual());
    519             grzd.SetPoint(i, za.Zd(), set0.GetResidual());
     518            graz.SetPoint(i, za.Az(), set0.GetResidual(&err));
     519            graz.SetPointError(i, 0, err);
     520            grzd.SetPoint(i, za.Zd(), set0.GetResidual(&err));
     521            grzd.SetPointError(i, 0, err);
    520522            gaz.SetPoint( i, za.Az(), dz);
    521523            gzd.SetPoint( i, za.Zd(), set0.GetDZd());
    522524            if (set0.GetMag()>=-20)
    523525            {
    524                 grmag.SetPoint(i, set0.GetMag(), set0.GetResidual());
     526                grmag.SetPoint(i, set0.GetMag(), set0.GetResidual(&err));
     527                grmag.SetPointError(i, 0, err);
    525528                gmaz.SetPoint( i, set0.GetMag(), dz);
    526529                gmzd.SetPoint( i, set0.GetMag(), set0.GetDZd());
     
    575578        cout << "OK." << endl;
    576579        cout << endl;
    577    
    578 
    579         TCanvas *c1;
    580 
    581         if ((c1 = (TCanvas*)gROOT->FindObject("CanvGraphs")))
    582             delete c1;
    583         if ((c1 = (TCanvas*)gROOT->FindObject("CanvResiduals")))
    584             delete c1;
    585 
    586580
    587581        const Double_t max1 = TMath::Max(gaz.GetHistogram()->GetMaximum(), gdaz.GetHistogram()->GetMaximum());
     
    616610        grmag.SetMinimum(0);
    617611
    618         c1=new TCanvas("CanvGraphs", "Graphs");
     612        TCanvas *c1;
     613
     614        if (gROOT->FindObject("CanvGraphs"))
     615            c1 = dynamic_cast<TCanvas*>(gROOT->FindObject("CanvGraphs"));
     616        else
     617            c1=new TCanvas("CanvGraphs", "Graphs");
     618
     619        gROOT->SetSelectedPad(0);
     620        c1->SetSelectedPad(0);
     621        c1->Clear();
     622
    619623        c1->SetFillColor(kWhite);
    620624        c1->Divide(3,3,1e-10,1e-10);
     
    698702        gPad->SetGridx();
    699703        gPad->SetGridy();
    700         g=(TGraph*)graz.DrawClone("A*");
     704        g=(TGraph*)graz.DrawClone("AP");
    701705        g->SetBit(kCanDelete);
    702706        g->GetHistogram()->SetXTitle("Az [\\circ]");
     
    708712        gPad->SetGridx();
    709713        gPad->SetGridy();
    710         g=(TGraph*)grzd.DrawClone("A*");
     714        g=(TGraph*)grzd.DrawClone("AP");
    711715        g->SetBit(kCanDelete);
    712716        g->GetHistogram()->SetXTitle("Zd [\\circ]");
     
    718722        gPad->SetGridx();
    719723        gPad->SetGridy();
    720         g=(TGraph*)grmag.DrawClone("A*");
     724        g=(TGraph*)grmag.DrawClone("AP");
    721725        g->SetBit(kCanDelete);
    722726        g->GetHistogram()->SetXTitle("Mag");
     
    757761        gStyle->SetStatFormat("6.2g");
    758762
    759 
    760         c1=new TCanvas("CanvResiduals", "Residuals", 800, 800);
     763        if (gROOT->FindObject("CanvResiduals"))
     764            c1 = dynamic_cast<TCanvas*>(gROOT->FindObject("CanvResiduals"));
     765        else
     766            c1=new TCanvas("CanvResiduals", "Residuals", 800, 800);
     767
     768        gROOT->SetSelectedPad(0);
     769        c1->SetSelectedPad(0);
     770        c1->Clear();
     771
    761772        c1->Divide(2, 2, 1e-10, 1e-10);
    762773   
     
    866877        };
    867878
    868         static TString dir(".");
     879        static TString dir("tpoint/");
    869880
    870881        TGFileInfo fi; // fFileName and fIniDir deleted in ~TGFileInfo
Note: See TracChangeset for help on using the changeset viewer.