Ignore:
Timestamp:
05/12/04 18:50:10 (21 years ago)
Author:
rico
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mtemp/mifae/library
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcRotate.cc

    r4050 r4056  
    149149      // save the number of events, initial and final times
    150150      fNEvts    = fRunHeader->GetNumEvents();
    151       fFirstEvt = fEvtHeader->GetDAQEvtNumber();
    152151      fIniTime  = fRunHeader->GetRunStart();
    153152      fFinTime  = fRunHeader->GetRunEnd();
     
    164163      cout << "Run number: " << fRunHeader->GetRunNumber() << endl;
    165164      cout << "Number of events: " << fNEvts << endl;
    166       cout << "First event: " << fFirstEvt << endl;
    167165      cout << "Initial MJD date: " << fIniTime.GetMjd() << endl;
    168166      cout << "Final MJD   date: " << fFinTime.GetMjd() << endl;
     
    175173  // FIXME: for the time being, this is computed by assuming constant event rate
    176174  MTime eventTime;
    177   Double_t newMJD = fIniTime.GetMjd() + (fFinTime.GetMjd()-fIniTime.GetMjd())*(fEvtHeader->GetDAQEvtNumber()-fFirstEvt)/fNEvts; 
    178   eventTime.SetMjd(newMJD); 
    179  
     175  Double_t newMJD = fIniTime.GetMjd() + (fFinTime.GetMjd()-fIniTime.GetMjd())*fEvtHeader->GetDAQEvtNumber()/fNEvts; 
     176  eventTime.SetMjd(newMJD);   
     177  MTime refTime;
     178  refTime.SetMjd(fRefMJD);
     179
    180180  // de-rotate the source position
    181181  const MAstroSky2Local Observation(eventTime, *fObservatory);
    182   const MAstroSky2Local RefObservation(fRefMJD, *fObservatory);
     182  const MAstroSky2Local RefObservation(refTime, *fObservatory);
     183
     184#ifdef DEBUG
     185  printf("Run:%d, Event:%d, iniMJD=%15.5f, finMJD=%15.5f, fDeltaT=%15.5f, newMJD=%15.5f, fRefMJD=%15.5f, rotation=%15.5f, ref=%15.5f\n",
     186         fRunHeader->GetRunNumber(),fEvtHeader->GetDAQEvtNumber(),
     187         fIniTime.GetMjd(),fFinTime.GetMjd(),fDeltaT,
     188         newMJD,fRefMJD,Observation.RotationAngle(fRA,fDEC),
     189         RefObservation.RotationAngle(fRA,fDEC));
     190  //  cout << "newMJD=" << newMJD << ", fRefMJD="<<fRefMJD<<", rotation="<<Observation.RotationAngle(fRA,fDEC)<<", ref="<<RefObservation.RotationAngle(fRA,fDEC)<< endl;
     191#endif
     192
    183193  Double_t rotationAngle = Observation.RotationAngle(fRA,fDEC)-RefObservation.RotationAngle(fRA,fDEC);
    184194 
     
    186196  Float_t s = TMath::Sin(rotationAngle);
    187197  // perform a rotation of -rotationAngle to move the source back to the "initial" position
    188   Float_t newX = c*fSrcPos->GetX()+s*fSrcPos->GetY();
    189   Float_t newY = -s*fSrcPos->GetX()+c*fSrcPos->GetY();
     198  Float_t newX = c*fSrcPos->GetX()-s*fSrcPos->GetY();
     199  Float_t newY = s*fSrcPos->GetX()+c*fSrcPos->GetY();
    190200
    191201#ifdef DEBUG
  • trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcRotate.h

    r4050 r4056  
    1818{
    1919private:
    20     MSrcPosCam*    fSrcPos;      //!  Pointer to the source position
    21     MDCA*          fDCA;         //!  Pointer to the MDCA object
    22     MRawEvtHeader* fEvtHeader;   //!  Pointer to the event header
    23     MRawRunHeader* fRunHeader;   //!  Pointer to the run header
    24     MObservatory*  fObservatory; //!  Pointer to the MObservatory   
     20    MSrcPosCam*    fSrcPos;      //  Pointer to the source position
     21    MDCA*          fDCA;         //  Pointer to the MDCA object
     22    MRawEvtHeader* fEvtHeader;   //  Pointer to the event header
     23    MRawRunHeader* fRunHeader;   //  Pointer to the run header
     24    MObservatory*  fObservatory; //  Pointer to the MObservatory   
    2525
    2626    TString     fSrcPosName;
     
    3131    Double_t   fRefMJD;      //  [MJ date] reference time for rotation
    3232    UInt_t     fNEvts;       //  Number of events in file
    33     UInt_t     fFirstEvt;    //  Event index for first event in file
    3433    MTime      fIniTime;     //  Run initial time
    3534    MTime      fFinTime;     //  Run final time
Note: See TracChangeset for help on using the changeset viewer.