Ignore:
Timestamp:
02/24/04 15:49:17 (21 years ago)
Author:
wittek
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/manalysis/MSourcePosfromStarPos.cc

    r3209 r3274  
    4444#include <TList.h>
    4545#include <TSystem.h>
     46#include <TMatrixD.h>
    4647
    4748#include <fstream>
     
    5354#include "MGeomCam.h"
    5455#include "MSrcPosCam.h"
     56#include "MMcEvt.hxx"
    5557
    5658#include "MLog.h"
     
    6769MSourcePosfromStarPos::MSourcePosfromStarPos(
    6870                                         const char *name, const char *title)
    69     : fIn(NULL)
     71  : fIn(NULL)
    7072{
    7173    fName  = name  ? name  : "MSourcePosfromStarPos";
     
    7476    fFileNames = new TList;
    7577    fFileNames->SetOwner();
     78
     79    fRuns  = 0;
     80    fSize  = 100;
     81    fStars = 1;
     82
     83    fRunNr.Set(fSize);
     84
     85    fThetaTel.Set(fSize);
     86    fPhiTel.Set(fSize);
     87    fdThetaTel.Set(fSize);
     88    fdPhiTel.Set(fSize);
     89
     90    fDecStar.Set(fStars);
     91    fRaStar.Set(fStars);
     92    fxStar.ResizeTo(fStars,fSize);
     93    fyStar.ResizeTo(fStars,fSize);
     94    fdxStar.ResizeTo(fStars,fSize);
     95    fdyStar.ResizeTo(fStars,fSize);
    7696}
    7797
     
    92112// Set the sky coordinates of the source and of the star
    93113//
     114// Input :
     115// declination in units of     (Deg,  Min, Sec)
     116// right ascension in units of (Hour, Min, Sec)
     117//
     118
    94119void MSourcePosfromStarPos::SetSourceAndStarPosition(
    95                             Double_t decSource, Double_t raSource,
    96                             Double_t decStar,   Double_t raStar)
    97 {
    98   fDecSource = decSource;
    99   fRaSource  = raSource;
    100 
    101   fDecStar = decStar;
    102   fRaStar  = raStar;
    103 
    104   *fLog << all << "MSourcePosfromStarPos::SetSourceAndStarPosition; fDecSource, fRaSource, fDecStar, fRaStar were set to : "
     120         TString  nameSource,
     121         Double_t decSourceDeg, Double_t decSourceMin, Double_t decSourceSec,
     122         Double_t raSourceHour, Double_t raSourceMin,  Double_t raSourceSec,
     123         TString nameStar,
     124         Double_t decStarDeg,   Double_t decStarMin,   Double_t decStarSec,
     125         Double_t raStarHour,   Double_t raStarMin,    Double_t raStarSec  )
     126{
     127  *fLog << "MSourcePosfromStarPos::SetSourceAndStarPosition :" << endl;
     128  *fLog << "       Source : "  << nameSource << "   " << decSourceDeg << ":"
     129        << decSourceMin << ":" << decSourceSec << endl;
     130  *fLog << "       Star   : "  << nameStar   << "   " << decStarDeg << ":"
     131        << decStarMin << ":"   << decStarSec << endl;
     132
     133  // convert into radians
     134  fDecSource = (decSourceDeg + decSourceMin/60.0 + decSourceSec/3600.0)
     135               / kRad2Deg;
     136  fRaSource  = (raSourceHour + raSourceMin/60.0  + raSourceSec/3600.0)
     137               * 360.0 / (24.0 * kRad2Deg);
     138
     139  fDecStar.Set(fStars);
     140  fDecStar[fStars-1] = (decStarDeg + decStarMin/60.0 + decStarSec/3600.0)
     141                       / kRad2Deg;
     142  fRaStar[fStars-1]  = (raStarHour + raStarMin/60.0  + raStarSec/3600.0)
     143                       * 360.0 / (24.0 * kRad2Deg);
     144
     145  *fLog << all << "MSourcePosfromStarPos::SetSourceAndStarPosition; fDecSource, fRaSource, fDecStar, fRaStar were set to : [radians]  "
    105146        << fDecSource << ",  " << fRaSource << ",  "
    106         << fDecStar << ",  " << fRaStar << endl;
     147        << fDecStar[fStars-1] << ",  " << fRaStar[fStars-1] << endl;
     148}
     149
     150// --------------------------------------------------------------------------
     151//
     152// Set the sky coordinates of another star
     153//
     154// Input :
     155// declination in units of     (Deg,  Min, Sec)
     156// right ascension in units of (Hour, Min, Sec)
     157//
     158
     159void MSourcePosfromStarPos::AddStar(
     160         TString nameStar,
     161         Double_t decStarDeg,   Double_t decStarMin,   Double_t decStarSec,
     162         Double_t raStarHour,   Double_t raStarMin,    Double_t raStarSec  )
     163{
     164  *fLog << "MSourcePosfromStarPos::AddStar :" << endl;
     165  *fLog << "       Star   : "  << nameStar   << "   " << decStarDeg << ":"
     166        << decStarMin << ":"   << decStarSec << endl;
     167
     168  // convert into radians
     169  Int_t fStars = fDecStar.GetSize() + 1;
     170  fDecStar.Set(fStars);
     171  fDecStar[fStars-1] = (decStarDeg + decStarMin/60.0 + decStarSec/3600.0)
     172                       / kRad2Deg;
     173  fRaStar[fStars-1]  = (raStarHour + raStarMin/60.0  + raStarSec/3600.0)
     174                       * 360.0 / (24.0 * kRad2Deg);
     175
     176  *fLog << all << "MSourcePosfromStarPos::AddStar; fDecStar, fRaStar were set to : [radians]  "
     177        << fDecStar[fStars-1] << ",  " << fRaStar[fStars-1] << endl;
    107178}
    108179
     
    119190    }
    120191    fMm2Deg = geom->GetConvMm2Deg();
     192    // fDistCameraReflector is the distance of the camera from the reflector center in [mm]
     193    fDistCameraReflector = kRad2Deg / fMm2Deg;   
     194        *fLog << all << "MSourcePosfromStarPos::PreProcess; fMm2Deg, fDistCameraReflector = "
     195              << fMm2Deg << ",  " << fDistCameraReflector << endl;
    121196
    122197
     
    124199    if (!fRun)
    125200    {
    126         *fLog << err << "MRawRunHeader not found... aborting." << endl;
     201        *fLog << err << "MSourcePosfromStarPos::PreProcess; MRawRunHeader not found... aborting." << endl;
    127202        return kFALSE;
    128203    }
     204
     205
     206   fMcEvt = (MMcEvt*)pList->FindCreateObj("MMcEvt");
     207   if (!fMcEvt)
     208   {
     209       *fLog << err << "MSourcePosfromStarPos::PreProcess; MMcEvt not found... aborting." << endl;
     210       return kFALSE;
     211   }
    129212
    130213
     
    132215    if (!fSrcPos)
    133216    {
    134         *fLog << err << "MSourcePosfromStarPos : MSrcPosCam not found...  aborting" << endl;
     217        *fLog << err << "MSourcePosfromStarPos::PreProcess; MSrcPosCam not found...  aborting" << endl;
    135218        return kFALSE;
    136219    }
     
    140223    //
    141224
    142     fRuns = 0;
    143     fSize = 0;
    144 
    145225    while(1)
    146226    {
    147       if (!OpenNextFile()) break;
    148 
    149       if (fIn->eof())
    150         if (!OpenNextFile()) break;
    151 
    152       // FIXME! Set InputStreamID
    153 
    154       ReadData();
     227      if (!OpenNextFile())
     228      {
     229        *fLog << "there is no more file to open" << endl;
     230        break;
     231      }
     232
     233      *fLog << "read data" << endl;
     234      while (1)
     235      {
     236        if (fIn->eof())
     237        {
     238          *fLog << "eof encountered; open next file" << endl;
     239
     240          if (!OpenNextFile()) break;
     241        }
     242
     243        // FIXME! Set InputStreamID
     244     
     245        ReadData();
     246      }
    155247    }
    156248
     249    *fLog << "all data were read" << endl;
    157250    FixSize();
    158251    //-------------------------------------------------------------
     
    186279
    187280void MSourcePosfromStarPos::SourcefromStar(Double_t &f,
    188                     Double_t &decStar,     Double_t &raStar,
     281                    TArrayD  &decStar,     TArrayD &raStar,
    189282                    Double_t &decSource,   Double_t &raSource,
    190283                    Double_t &thetaTel,    Double_t &phiTel,   
    191                     Double_t &xStar,       Double_t &yStar,
    192                     Double_t &dxStar,      Double_t &dyStar,
     284                    TArrayD  &xStar,       TArrayD &yStar,
     285                    TArrayD  &dxStar,      TArrayD &dyStar,
    193286                    Double_t &xSource,     Double_t &ySource,
    194287                    Double_t &dxSource,    Double_t &dySource)
    195288{
     289  *fLog << "MSourcePosfromStarPos::SourcefromStar :  printout in degrees" << endl;
     290  *fLog << "       decStar, raStar = " << decStar[0]*kRad2Deg << ",  "
     291        << raStar[0]*kRad2Deg << endl;
     292  *fLog << "       decSource, raSource = " << decSource*kRad2Deg << ",  "
     293        << raSource*kRad2Deg << endl;
     294  *fLog << "       thetaTel, phiTel = " << thetaTel*kRad2Deg << ",  "
     295        << phiTel*kRad2Deg << endl;
     296  *fLog << "       xStar, yStar = " << xStar[0]*fMm2Deg << ",  "
     297        << yStar[0]*fMm2Deg << endl;
     298
     299  *fLog << "MSourcePosfromStarPos::SourcefromStar :  printout in radians and mm" << endl;
     300  *fLog << "       decStar, raStar = " << decStar[0] << ",  "
     301        << raStar[0] << endl;
     302  *fLog << "       decSource, raSource = " << decSource << ",  "
     303        << raSource << endl;
     304  *fLog << "       thetaTel, phiTel = " << thetaTel << ",  "
     305        << phiTel << endl;
     306  *fLog << "       xStar, yStar = " << xStar[0] << ",  "
     307        << yStar[0] << endl;
     308
     309
    196310  // the units are assumed to be radians for theta, phi, dec and ra
    197311  //            and                   mm for f, x and y
    198312
    199   // calculate coordinates of star and source in system B (see TDAS 00-11, eqs. (2))
    200   Double_t xB  =  cos(decStar) * cos(raStar);
    201   Double_t yB  =  cos(decStar) * sin(raStar);
    202   Double_t zB  = -sin(decStar);
    203  
    204   Double_t xB0 =  cos(decSource) * cos(raSource);
    205   Double_t yB0 =  cos(decSource) * sin(raSource);
    206   Double_t zB0 = -sin(decSource);
    207  
     313
    208314  // calculate rotation angle alpha of sky image in camera
    209315  // (see TDAS 00-11, eqs. (18) and (20))
     
    218324  Double_t sinal =    a1 * sin(phiTel) * denom;
    219325
    220 
    221   // calculate coordinates of star in a system with the basis vectors e1, e2, e3
    222   // where  e1 is in the direction (r0 x a)
    223   //        e2 is in the direction (e1 x r0)
    224   //   and  e3 is in the direction -r0;
    225   // r0 is the direction the telescope is pointing to
    226   // and a is the earth rotation axis (pointing to the celestial north pole)
    227   //
    228   Double_t x = (-xB*yB0 + xB0*yB) / sqrt( xB0*xB0 + yB0*yB0 );
    229   Double_t y = ( xB*xB0*zB0 + yB*yB0*zB0 - zB*(xB0*xB0 + yB0*yB0) )
    230                                   / sqrt( xB0*xB0 + yB0*yB0 );
    231   Double_t z = -(xB*xB0 + yB*yB0 + zB*zB0);
    232 
    233   // calculate coordinates of star in camera
    234   Double_t xtilde = -f/z * (cosal*x - sinal*y);
    235   Double_t ytilde = -f/z * (sinal*x + cosal*y);
    236 
    237   // calculate coordinates of source in camera
    238   // note : in real camera signs are inverted (therefore s = -1.0)
    239   Double_t s = -1.0;
    240   xSource = s * (s*xStar - xtilde);
    241   ySource = s * (s*yStar - ytilde);
    242 
    243326  *fLog << "thetaTel, phiTel, cosal, sinal = " << thetaTel << ",  "
    244327        << phiTel << ",  " << cosal << ",  " << sinal << endl;
    245 }
    246 
     328
     329
     330  // calculate coordinates of source in system B (see TDAS 00-11, eqs. (2))
     331  Double_t xB0 =  cos(decSource) * cos(raSource);
     332  Double_t yB0 =  cos(decSource) * sin(raSource);
     333  Double_t zB0 = -sin(decSource);
     334
     335  *fLog << "xB0, yB0, zB0 = " << xB0 << ",  " << yB0 << ",  "
     336        << zB0 << endl;
     337
     338  //-----------------------------------------------------
     339  // loop over stars
     340  Double_t sumx  = 0.0;
     341  Double_t sumy  = 0.0;
     342  Double_t sumwx = 0.0;
     343  Double_t sumwy = 0.0;
     344
     345  for (Int_t i=0; i<decStar.GetSize(); i++)
     346  {
     347    // calculate weights
     348    Double_t weightx = 1.0 / (dxStar[i]*dxStar[i]);
     349    Double_t weighty = 1.0 / (dyStar[i]*dyStar[i]);
     350    sumwx += weightx;
     351    sumwy += weighty;
     352
     353  *fLog << "weightx, weighty = " << weightx << ",  " << weighty << endl;
     354
     355    // calculate coordinates of star in system B (see TDAS 00-11, eqs. (2))
     356    Double_t xB  =  cos(decStar[i]) * cos(raStar[i]);
     357    Double_t yB  =  cos(decStar[i]) * sin(raStar[i]);
     358    Double_t zB  = -sin(decStar[i]);
     359
     360
     361  *fLog << "xB, yB, zB = " << xB << ",  " << yB << ",  "
     362        << zB << endl;
     363
     364 
     365    // calculate coordinates of star in a system with the basis vectors e1, e2, e3
     366    // where  e1 is in the direction (r0 x a)
     367    //        e2 is in the direction (e1 x r0)
     368    //   and  e3 is in the direction -r0;
     369    // r0 is the direction to the source
     370    // and a is the earth rotation axis (pointing to the celestial north pole)
     371    //
     372    Double_t x = (-xB*yB0 + xB0*yB) / sqrt( xB0*xB0 + yB0*yB0 );
     373    Double_t y = ( xB*xB0*zB0 + yB*yB0*zB0 - zB*(xB0*xB0 + yB0*yB0) )
     374                                    / sqrt( xB0*xB0 + yB0*yB0 );
     375    Double_t z = -(xB*xB0 + yB*yB0 + zB*zB0);
     376
     377  *fLog << "x, y, z = " << x << ",  " << y << ",  "
     378        << z << endl;
     379
     380
     381    // calculate coordinates of star in camera
     382    Double_t xtilde = -f/z * (cosal*x - sinal*y);
     383    Double_t ytilde = -f/z * (sinal*x + cosal*y);
     384
     385  *fLog << "xtilde, ytile = " << xtilde << ",  " << ytilde << endl;
     386
     387
     388    // calculate coordinates of source in camera
     389    // note : in real camera signs are inverted (therefore s = -1.0)
     390    Double_t s = -1.0;
     391    sumx += s * (s*xStar[i] - xtilde) * weightx;
     392    sumy += s * (s*yStar[i] - ytilde) * weighty;
     393  }
     394  //-----------------------------------------------------
     395
     396  xSource  = sumx / sumwx;
     397  ySource  = sumy / sumwy;
     398  dxSource = 1.0 / sqrt(sumwx);
     399  dySource = 1.0 / sqrt(sumwy);
     400   
     401  *fLog << all << "MSourcePosfromStarPos::SourcefromStar; xSource, ySource = "
     402        << xSource << " +- " << dxSource << ",   "
     403        << ySource << " +- " << dySource << endl;
     404}
    247405
    248406// --------------------------------------------------------------------------
     
    253411Bool_t MSourcePosfromStarPos::ReInit(MParList *pList)
    254412{
    255   if (fDecStar   == 0.0 || fRaStar   == 0.0 ||
    256       fDecSource == 0.0 || fRaSource == 0.0)
    257   {
    258     *fLog << err << "MSourcePosfromStarPos::ReInit; sky coordinates of star and source are not defined ... aborting"
    259           << endl;
    260     return kFALSE;
    261   }
    262 
    263   // f is the distance of the camera from the reflector center in [mm]
    264   Double_t f = kRad2Deg / fMm2Deg;   
    265 
     413  //if (fDecSource == 0.0  ||  fRaSource == 0.0  ||  fStars == 0)
     414  //{
     415  //  *fLog << err << "MSourcePosfromStarPos::ReInit; sky coordinates of star and source are not defined ... aborting"
     416  //        << endl;
     417    //return kFALSE;
     418  //}
     419
     420  Int_t run = fRun->GetRunNumber();
     421
     422  *fLog << "MSourcePosfromStarPos::ReInit; run = " << run << endl;
     423
     424  //-------------------------------------------------------------------
     425  // search this run in the list
    266426  for (Int_t i=0; i<fSize; i++)
    267427  {
    268     Int_t run = fRun->GetRunNumber();
    269428    if (run == fRunNr[i])
    270429    {
    271       MSourcePosfromStarPos::SourcefromStar( f,
    272                     fDecStar, fRaStar, fDecSource, fRaSource,
    273                     fThetaTel[i],   fPhiTel[i],   
    274                     fxStar[i],      fyStar[i],
    275                     fdxStar[i],     fdyStar[i],
    276                     fxSource,       fySource,
    277                     fdxSource,      fdySource);
     430      //-----------------------------------------
     431      // put the zenith angle into MMcEvt
     432
     433      Double_t thetarad = fThetaTel[i];
     434      Double_t phirad   = fPhiTel[i];
     435      fMcEvt->SetTelescopeTheta(thetarad);
     436      fMcEvt->SetTelescopePhi(phirad);
     437      fMcEvt->SetReadyToSave();
     438
     439      *fLog << "theta, phi = " << thetarad*kRad2Deg << ",  "
     440            << phirad*kRad2Deg << endl;
     441       
     442      //-----------------------------------------
     443      // Get source position and put it into MSrcPosCam
     444
     445      /*
     446      if (fStars > 0)
     447      {
     448        TArrayD xStar(fxStar.GetNrows());
     449        TArrayD dxStar(fdxStar.GetNrows());
     450        TArrayD yStar(fyStar.GetNrows());
     451        TArrayD dyStar(fdyStar.GetNrows());
     452        for (Int_t j=0; j<fxStar.GetNrows(); j++)
     453        {
     454          xStar[j]  = fxStar(j, i);
     455          dxStar[j] = fdxStar(j, i);
     456          yStar[j]  = fyStar(j, i);
     457          dyStar[j] = fdyStar(j, i);
     458        }
     459
     460        MSourcePosfromStarPos::SourcefromStar( fDistCameraReflector,
     461                      fDecStar, fRaStar, fDecSource, fRaSource,
     462                      fThetaTel[i],   fPhiTel[i],   
     463                      xStar,          yStar,
     464                      dxStar,         dyStar,
     465                      fxSource,       fySource,
     466                      fdxSource,      fdySource);
    278467     
    279       fSrcPos->SetXY(fxSource, fySource);
    280 
    281       *fLog << all << "MSourcePosfromStarPos::ReInit; f = " << f << endl;
    282       *fLog << all << "MSourcePosfromStarPos::ReInit; fRunNr, fxSource, fySource = "
    283             << fRunNr[i] << ",  " << fxSource << ",  " << fySource
    284             << endl;
     468        fSrcPos->SetXY(fxSource, fySource);
     469
     470        *fLog << all << "MSourcePosfromStarPos::ReInit; fRunNr, fxSource, fySource = "
     471              << fRunNr[i] << ",  " << fxSource << ",  " << fySource
     472              << endl;
    285473       
    286       fSrcPos->SetReadyToSave();       
     474        fSrcPos->SetReadyToSave();       
     475      }
     476      */
     477
     478      return kTRUE;
    287479    }
    288480  }
     481  //------------------------------------------------------------------- 
     482    *fLog << warn << "MSourcePosfromStarPos::ReInit;  no information for run number = "
     483          << run << endl;
     484
     485    Double_t thetadeg = 90.0;
     486    Double_t thetarad = thetadeg / kRad2Deg;
     487    fMcEvt->SetTelescopeTheta(thetarad);
     488
     489    Double_t phideg = 0.0;
     490    Double_t phirad = phideg / kRad2Deg;
     491    fMcEvt->SetTelescopePhi(phirad);
     492    fMcEvt->SetReadyToSave();
    289493
    290494    return kTRUE;
     
    296500Int_t MSourcePosfromStarPos::Process()
    297501{
     502  Int_t run = fRun->GetRunNumber();
     503
     504  //*fLog << "MSourcePosfromStarPos::Process; run = " << run << endl;
     505   
    298506
    299507    return kTRUE;
     
    315523void MSourcePosfromStarPos::FixSize()
    316524{
     525  *fLog << "MSourcePosfromStarPos::FixSize; fix size of arrays : fRuns = "
     526        << fRuns << endl;
     527
    317528    fSize = fRuns;
    318529
     
    324535    fdPhiTel.Set(fSize);
    325536
    326     fxStar.Set(fSize);
    327     fyStar.Set(fSize);
    328     fdxStar.Set(fSize);
    329     fdyStar.Set(fSize);
     537    fStars = fxStar.GetNrows();
     538    fxStar.ResizeTo(fStars, fSize);
     539    fyStar.ResizeTo(fStars, fSize);
     540    fdxStar.ResizeTo(fStars, fSize);
     541    fdyStar.ResizeTo(fStars, fSize);
    330542}
    331543
     
    337549{
    338550  Float_t val;
    339 
    340   if (fRuns >= fSize)
     551  Int_t   ival;
     552
     553  // extend size of arrays if necessary
     554  if ( fRuns >= (fSize-1) )
    341555  {
    342556    fSize += 100;
     
    349563    fdPhiTel.Set(fSize);
    350564
    351     fxStar.Set(fSize);
    352     fyStar.Set(fSize);
    353     fdxStar.Set(fSize);
    354     fdyStar.Set(fSize);
     565    fStars = fxStar.GetNrows();
     566    fxStar.ResizeTo(fStars, fSize);
     567    fyStar.ResizeTo(fStars, fSize);
     568    fdxStar.ResizeTo(fStars, fSize);
     569    fdyStar.ResizeTo(fStars, fSize);
    355570  }
    356571
     572  //-------------------
     573  // read header line
     574  //*fIn >> val;
     575
     576  //*fLog << "val =" << val << endl;
     577
     578  //*fIn >> val;
     579  //*fIn >> val;
     580  //*fIn >> val;
     581  //*fIn >> val;
     582  //*fIn >> val;
     583  //*fIn >> val;
     584  //*fIn >> val;
     585  //*fIn >> val;
     586  //*fIn >> val;
     587  //*fIn >> val;
     588  //-------------------
     589
     590
    357591  fRuns += 1;
    358592
     593  *fIn >> ival;
     594 
     595  *fLog << fRuns <<"th run : " << ival << endl; 
     596
     597  fRunNr.AddAt(ival, fRuns-1);
     598
     599  *fLog << "check : fRuns, fRunNr[fRuns-1], fRunNr[fRuns] = " << fRuns << ",  "
     600        << fRunNr[fRuns-1] << ",  " << fRunNr[fRuns] << endl;
     601
     602  // read mjdS, hmsS, mjdE, hmsE
     603  *fIn >> val;
     604  *fIn >> val;
     605  *fIn >> val;
     606  *fIn >> val;
     607
     608  *fIn >> val;
     609  *fIn >> val;
     610  *fIn >> val;
     611  *fIn >> val;
     612
     613
    359614  *fIn >> val;
    360   fRunNr.AddAt(val, fRuns-1);
     615  fThetaTel.AddAt(val/kRad2Deg, fRuns-1);
     616  *fLog << "val, fThetaTel[fRuns-1] = " << val << ",  "
     617        << fThetaTel[fRuns-1] << endl;
     618
    361619
    362620  *fIn >> val;
    363   fThetaTel.AddAt(val, fRuns-1);
    364   *fIn >> val;
    365   fPhiTel.AddAt(val, fRuns-1);
    366 
    367   *fIn >> val;
    368   fdThetaTel.AddAt(val, fRuns-1);
    369   *fIn >> val;
    370   fdPhiTel.AddAt(val, fRuns-1);
    371 
    372   *fIn >> val;
    373   fxStar.AddAt(val, fRuns-1);
    374   *fIn >> val;
    375   fyStar.AddAt(val, fRuns-1);
    376 
    377   *fIn >> val;
    378   fdxStar.AddAt(val, fRuns-1);
    379   *fIn >> val;
    380   fdyStar.AddAt(val, fRuns-1);
     621  fPhiTel.AddAt(val/kRad2Deg, fRuns-1);
     622  *fLog << "val, fPhiTel[fRuns-1] = " << val << ",  "
     623        << fPhiTel[fRuns-1] << endl;
     624
     625
     626  //*fIn >> val;
     627  //fdThetaTel.AddAt(val/kRad2Deg, fRuns-1);
     628  //*fIn >> val;
     629  //fdPhiTel.AddAt(val/kRad2Deg, fRuns-1);
     630
     631  // input is in [deg], convert to [mm]
     632  fStars = fxStar.GetNrows();
     633  for (Int_t i=0; i<fStars; i++)
     634  {
     635    *fIn >> val;
     636    fxStar(i, fRuns-1) = val / fMm2Deg;;
     637    *fLog << "val, fxStar(i, fRuns-1) = " << val << ",  "
     638          << fxStar(i, fRuns-1) << endl;
     639
     640    *fIn >> val;
     641    fyStar(i, fRuns-1) = val / fMm2Deg;
     642    *fLog << "val, fyStar(i, fRuns-1) = " << val << ",  "
     643          << fyStar(i, fRuns-1) << endl;
     644
     645
     646    *fIn >> val;
     647    //*fLog << "y=dxStar = " << val << endl;
     648
     649    fdxStar(i, fRuns-1) = val / fMm2Deg;
     650    *fIn >> val;
     651    //*fLog << "y=dyStar = " << val << endl;
     652
     653    fdyStar(i, fRuns-1) = val / fMm2Deg;
     654  }
     655
    381656}
    382657
     
    389664    TNamed *name = new TNamed(txt, "");
    390665    fFileNames->AddLast(name);
     666
     667    *fLog << "MSourcePosfromStarPos::AddFile; add file '" << txt << "'"
     668          << endl;
     669
    391670    return 1;
    392671}
     
    447726
    448727
     728
Note: See TracChangeset for help on using the changeset viewer.