Changeset 4750 for trunk


Ignore:
Timestamp:
08/27/04 08:30:51 (20 years ago)
Author:
wittek
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mtemp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mtemp/MTelAxisFromStars.cc

    r4745 r4750  
    4040//
    4141/////////////////////////////////////////////////////////////////////////////
     42#include <TMath.h>
    4243#include <TList.h>
    4344#include <TSystem.h>
     
    124125   if (!fStarCam)
    125126   {
    126        *fLog << err << "MTelAxisFromStars::PreProcess; container 'MStarCam' not found... aborting." << endl;
     127       *fLog << err << "MStarCam not found... aborting." << endl;
    127128       return kFALSE;
    128129   }
     
    132133   if (!fSourceCam)
    133134   {
    134        *fLog << err << "MTelAxisFromStars::PreProcess; container 'MSourceCam' not found... continue  " << endl;
     135       *fLog << warn << "MSourceCam[MStarCam] not found... continue  " << endl;
    135136   }
    136137
     
    139140    fSrcPos = (MSrcPosCam*)pList->FindCreateObj(AddSerialNumber("MSrcPosCam"), "MSrcPosCam");
    140141    if (!fSrcPos)
    141     {
    142         *fLog << err << "MTelAxisFromStars::PreProcess;  MSrcPosCam not found...  aborting" << endl;
    143142        return kFALSE;
    144     }
    145143
    146144    fPntPos = (MSrcPosCam*)pList->FindCreateObj(AddSerialNumber("MSrcPosCam"), "MPntPosCam");
    147145    if (!fPntPos)
    148     {
    149         *fLog << err << "MTelAxisFromStars::PreProcess;  MPntPosCam not found...  aborting" << endl;
    150146        return kFALSE;
    151     }
    152147
    153148    fPointPos = (MPointingPos*)pList->FindCreateObj(AddSerialNumber("MPointingPos"), "MPointingPos");
    154149    if (!fPointPos)
    155     {
    156         *fLog << err << "MTelAxisFromStars::PreProcess;  MPointingPos not found...  aborting" << endl;
    157150        return kFALSE;
    158     }
    159151
    160152    fSourcePos = (MPointingPos*)pList->FindCreateObj(AddSerialNumber("MPointingPos"), "MSourcePos");
    161153    if (!fSourcePos)
    162     {
    163         *fLog << err << "MTelAxisFromStars::PreProcess;  MSourcePos[MPointingPos] not found...  aborting" << endl;
    164154        return kFALSE;
    165     }
    166155
    167156    fSkyCamTrans = (MSkyCamTrans*)pList->FindCreateObj(AddSerialNumber("MSkyCamTrans"));
    168157    if (!fSkyCamTrans)
    169     {
    170         *fLog << err << "MTelAxisFromStars::PreProcess;  MSkyCamTrans not found...  aborting" << endl;
    171158        return kFALSE;
    172     }
     159
    173160
    174161   //-----------------------------------------------------------------
     
    539526    while ( (starSource = (MStarPos*)setnextSource()) )
    540527    {
    541        Double_t corr = esxy[0][1][ix]/ sqrt( esxy[0][0][ix] * esxy[1][1][ix] );
     528       Double_t corr = esxy[0][1][ix] /
     529                       TMath::Sqrt( esxy[0][0][ix] * esxy[1][1][ix] );
    542530       starSource->SetFitValues(100.0, 100.0, bsxy[0][ix], bsxy[1][ix],
    543                 sqrt(esxy[0][0][ix]), sqrt(esxy[1][1][ix]), corr,
     531                TMath::Sqrt(esxy[0][0][ix]), TMath::Sqrt(esxy[1][1][ix]), corr,
    544532                esxy[0][0][ix],       esxy[0][1][ix],       esxy[1][1][ix],
    545533                fChi2, fNdof);
     
    726714  Double_t alfa = 0.0;
    727715  if (fixedrotationangle != -1.0)
    728     alfa = fixedrotationangle / kRad2Deg;
    729 
    730 
     716    alfa = fixedrotationangle / TMath::RadToDeg();
    731717
    732718  Double_t alfaold   = alfa;
    733719  // maximum allowed change of alfa in 1 iteration step (5 degrees)
    734   Double_t dalfamax = 5.0 / kRad2Deg;
     720  Double_t dalfamax = 5.0 / TMath::RadToDeg();
    735721  Double_t dalfa = 0.0;
    736722
    737   Double_t cosal = cos(alfa);
    738   Double_t sinal = sin(alfa);
     723  Double_t cosal = TMath::Cos(alfa);
     724  Double_t sinal = TMath::Sin(alfa);
    739725
    740726  A[0][0] =  cosal;
     
    821807  //                 or  chi2              is less than 'tolchi2'
    822808  Double_t told2 = 0.3*0.3;  // [mm*mm]; 1/100 of an inner pixel diameter
    823   Double_t toldalfa = 0.01 / kRad2Deg;  // 0.01 degrees
     809  Double_t toldalfa = 0.01 / TMath::RadToDeg();  // 0.01 degrees
    824810  Double_t toldlambda = 0.00006;   // uncertainty of 1 mm of distance
    825811                                   // between camera and reflector
     
    991977        alfa = alfaold + dalfa;
    992978
    993         if ( alfa < -5.0/kRad2Deg )
    994           alfa = -5.0/kRad2Deg;
    995         else if ( alfa > 5.0/kRad2Deg )
    996           alfa = 5.0/kRad2Deg;
     979        if ( alfa < -5.0/TMath::RadToDeg() )
     980          alfa = -5.0/TMath::RadToDeg();
     981        else if ( alfa > 5.0/TMath::RadToDeg() )
     982          alfa = 5.0/TMath::RadToDeg();
    997983       
    998984        dalfa = alfa - alfaold;
     
    1000986        alfaold = alfa;
    1001987
    1002         sinal = sin(alfa);
    1003         cosal = cos(alfa);
     988        sinal = TMath::Sin(alfa);
     989        cosal = TMath::Cos(alfa);
    1004990
    1005991        A[0][0] =  cosal;
     
    10681054  //-------   end of iteration *****************************************
    10691055
    1070   alfadeg = alfa * kRad2Deg;
     1056  alfadeg = alfa * TMath::RadToDeg();
    10711057
    10721058  // calculate error matrix of d[2]
     
    12531239
    12541240// --------------------------------------------------------------------------
    1255 //
    1256 //
    1257 Int_t MTelAxisFromStars::PostProcess()
    1258 {
    1259 
    1260     return kTRUE;
    1261 }
    1262 
    1263 
    1264 // --------------------------------------------------------------------------
    1265 
    1266 
    1267 
    1268 
    1269 
    1270 
    1271 
    1272 
    1273 
    1274 
    1275 
    1276 
     1241
     1242
     1243
     1244
     1245
     1246
     1247
     1248
     1249
     1250
     1251
     1252
  • trunk/MagicSoft/Mars/mtemp/MTelAxisFromStars.h

    r4744 r4750  
    5050    Int_t  PreProcess(MParList *pList);
    5151    Int_t  Process();
    52     Int_t  PostProcess();
    5352
    5453 public:
Note: See TracChangeset for help on using the changeset viewer.