Ignore:
Timestamp:
03/14/07 19:12:17 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Cosy/main
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/main/MBending.cc

    r4255 r8376  
    5959#include "MBending.h"
    6060
    61 #include <fstream.h>
    62 #include <iomanip.h>
     61#include <fstream>
     62#include <iomanip>
    6363#include <TVector3.h>
    6464
     
    6868
    6969ClassImp(MBending);
     70
     71using namespace std;
    7072
    7173#undef DEBUG
  • trunk/MagicSoft/Cosy/main/MCaos.cc

    r7790 r8376  
    11#include "MCaos.h"
    22
    3 #include <iostream>
     3#include <fstream>
    44#include <iomanip>
    55
     
    2121#include "coord.h"
    2222
    23 void MCaos::ReadResources(const char *name="leds.txt")
     23using namespace std;
     24
     25void MCaos::ReadResources(const char *name)
    2426{
    2527    ifstream fin(name);
     
    242244    c->Update();
    243245
    244     const Int_t n1 = (Int_t)(sqrt(fPositions.GetEntriesFast())+1.0);
    245     const Int_t n2 = (Int_t)(sqrt(fPositions.GetEntriesFast())+0.5);
     246    const Int_t n1 = (Int_t)(TMath::Sqrt(fPositions.GetEntriesFast())+1.0);
     247    const Int_t n2 = (Int_t)(TMath::Sqrt(fPositions.GetEntriesFast())+0.5);
    246248
    247249    TCanvas *c1 = new TCanvas("cpos", "Led Positions", 800, 600);
     
    330332}
    331333
    332 Ring MCaos::Run(byte *img, bool printl, bool printr, const ZdAz &pos, const MTime &t, Double_t box, Double_t cut)
     334Ring MCaos::Run(byte *img, bool printl, bool printr, const ZdAz &pos, const MTime &t, Int_t box, Double_t cut)
    333335{
    334336    Leds &leds = *fLeds;
     
    355357        // Try to find Led in this area
    356358        const Led &l0 = fPositions(i);
    357         f.Execute(leds, l0.GetX(), l0.GetY());
     359        f.Execute(leds, TMath::FloorNint(l0.GetX()), TMath::FloorNint(l0.GetY()));
    358360
    359361        // Loop over newly found Leds
  • trunk/MagicSoft/Cosy/main/MCaos.h

    r4865 r8376  
    8989
    9090    Ring Run(byte *img, bool printl, bool printr, const ZdAz &pos,
    91              const MTime &t, Double_t box, Double_t cut);
     91             const MTime &t, Int_t box, Double_t cut);
    9292};
    9393
  • trunk/MagicSoft/Cosy/main/MCosy.cc

    r7790 r8376  
    11#include "MCosy.h"
    22
    3 #include <iomanip.h>
    4 #include <fstream.h>
    5 #include <iostream.h>
     3#include <iomanip>
     4#include <fstream>
    65
    76#include <TROOT.h>
     
    3029
    3130ClassImp(MCosy);
     31
     32using namespace std;
    3233
    3334typedef struct tm tm_t;
     
    493494    {
    494495#ifdef EXPERT
    495         fMac1->SetDeceleration(0.5*fMac1->GetVelRes());
    496         fMac2->SetDeceleration(0.5*fMac2->GetVelRes());
     496        fMac1->SetDeceleration(TMath::Nint(0.5*fMac1->GetVelRes()));
     497        fMac2->SetDeceleration(TMath::Nint(0.5*fMac2->GetVelRes()));
    497498#else
    498         fMac1->SetDeceleration(0.3*fMac1->GetVelRes());
    499         fMac2->SetDeceleration(0.3*fMac2->GetVelRes());
     499        fMac1->SetDeceleration(TMath::Nint(0.3*fMac1->GetVelRes()));
     500        fMac2->SetDeceleration(TMath::Nint(0.3*fMac2->GetVelRes()));
    500501#endif
    501502        fMac1->SetRpmMode(FALSE);
  • trunk/MagicSoft/Cosy/main/MPointing.cc

    r7230 r8376  
    66
    77ClassImp(MPointing);
     8
     9using namespace std;
    810
    911//#define EXPERT
     
    3032    if (ratio<1)
    3133    {
    32         fCosy->fMac1->SetVelocity(vel);
    33         fCosy->fMac2->SetVelocity(vel*ratio);
     34        fCosy->fMac1->SetVelocity(TMath::Nint(vel));
     35        fCosy->fMac2->SetVelocity(TMath::Nint(vel*ratio));
    3436    }
    3537    else
    3638    {
    37         fCosy->fMac1->SetVelocity(vel/ratio);
    38         fCosy->fMac2->SetVelocity(vel);
     39        fCosy->fMac1->SetVelocity(TMath::Nint(vel/ratio));
     40        fCosy->fMac2->SetVelocity(TMath::Nint(vel));
    3941    }
    4042}
     
    5658    fCosy->SetStatus(MDriveCom::kMoving);
    5759
    58     if (axe1) fCosy->fMac2->StartRelPos(rd.Zd());
    59     if (axe2) fCosy->fMac1->StartRelPos(rd.Az());
     60    if (axe1) fCosy->fMac2->StartRelPos(TMath::Nint(rd.Zd()));
     61    if (axe2) fCosy->fMac1->StartRelPos(TMath::Nint(rd.Az()));
    6062#ifdef EXPERT
    6163    cout << "Waiting for positioning..." << flush;
     
    7375{
    7476    const int vr = mac->GetVelRes();
    75     mac->SetAcceleration(acc*vr);
    76     mac->SetDeceleration(dec*vr);
     77    mac->SetAcceleration(TMath::Nint(acc*vr));
     78    mac->SetDeceleration(TMath::Nint(dec*vr));
    7779    return !mac->IsZombieNode();
    7880}
  • trunk/MagicSoft/Cosy/main/MStargHistograms.cc

    r7767 r8376  
    2222
    2323#include "coord.h"
     24
     25using namespace std;
    2426
    2527void MStargHistograms::OpenFile()
  • trunk/MagicSoft/Cosy/main/MStarguider.cc

    r7795 r8376  
    44#include "MStarguider.h"
    55
    6 #include <fstream.h>    // ifstream
    7 #include <iostream.h>   // cout
    8 #include <iomanip.h>   // cout
     6#include <fstream>    // ifstream
     7#include <iostream>   // cout
     8#include <iomanip>    // cout
    99
    1010#include <TH2F.h>
     
    5757
    5858ClassImp(MStarguider);
     59
     60using namespace std;
    5961
    6062enum {
     
    14571459           
    14581460            const Int_t idx = x.GetSize();
    1459            
     1461
    14601462            x.Set(idx+1);
    14611463            y.Set(idx+1);
    14621464            mag.Set(idx+1);
    1463            
     1465
    14641466            x.AddAt(dpos.X(), idx);
    14651467            y.AddAt(dpos.Y(), idx);
     
    15071509    fPZdAz->SetCoordinates(cpos);
    15081510
    1509 
    15101511    // Check StargTPoint data set request
    15111512    if (!fStargTPoint->IsDown())
     
    15751576}
    15761577
    1577 XY MStarguider::FindRoqueLamp(FilterLed &f, FilterLed &f2, Ring &CameraCenter, MTime &t, Double_t cut, Double_t box, XY SearchCenter)
     1578XY MStarguider::FindRoqueLamp(FilterLed &f, FilterLed &f2, Ring &CameraCenter, MTime &t, Double_t cut, Int_t box, XY SearchCenter)
    15781579{
    15791580    // Set search Paremeters (FIXME: Get them from user input!)
     
    16111612}
    16121613
    1613 ZdAz MStarguider::FindStar(FilterLed &f, FilterLed &f2, Ring &center, MTime &t, Double_t cut, Double_t box, Double_t scalefactor = 1.0)
     1614ZdAz MStarguider::FindStar(FilterLed &f, FilterLed &f2, Ring &center, MTime &t, Double_t cut, Int_t box, Double_t scalefactor = 1.0)
    16141615{
    16151616    // Set search Paremeters (FIXME: Get them from user input!)
     
    18501851    {
    18511852        // SCALE FACTOR ASSUMED TO BE 70
    1852         FindStar(f, f2, center, t, 3.5, 70);
     1853        FindStar(f, f2, center, t, 3/*3.5*/, 70);
    18531854        SendAmcTrigger("TPoint");
    18541855    }
     
    19201921
    19211922        Double_t imageclean = 1.5;
    1922         Double_t boxradius = 60;
     1923        Int_t    boxradius = 60;
    19231924        //Double_t scalefactor = 1;
    19241925        XY searchcenter(768/2-1,576/2+25);
     
    19471948
    19481949        Double_t imageclean = 5;
    1949         Double_t boxradius = 60;
     1950        Int_t    boxradius = 60;
    19501951        //Double_t scalefactor = 1;
    19511952        //      XY searchcenter(sgcenter.GetX(),sgcenter.GetY());
     
    20162017                     sgcenter.GetY()-293.6+28.5);
    20172018
    2018         fSao->CalcStars(stars, 530, 292, off.X(), off.Y());
     2019        fSao->CalcStars(stars, 530, 292, TMath::FloorNint(off.X()), TMath::FloorNint(off.Y()));
    20192020        fSao->DrawStars(stars, cimg);
    20202021
Note: See TracChangeset for help on using the changeset viewer.