Changeset 4056 for trunk/MagicSoft/Mars/mtemp/mifae/library
- Timestamp:
- 05/12/04 18:50:10 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mtemp/mifae/library
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcRotate.cc
r4050 r4056 149 149 // save the number of events, initial and final times 150 150 fNEvts = fRunHeader->GetNumEvents(); 151 fFirstEvt = fEvtHeader->GetDAQEvtNumber();152 151 fIniTime = fRunHeader->GetRunStart(); 153 152 fFinTime = fRunHeader->GetRunEnd(); … … 164 163 cout << "Run number: " << fRunHeader->GetRunNumber() << endl; 165 164 cout << "Number of events: " << fNEvts << endl; 166 cout << "First event: " << fFirstEvt << endl;167 165 cout << "Initial MJD date: " << fIniTime.GetMjd() << endl; 168 166 cout << "Final MJD date: " << fFinTime.GetMjd() << endl; … … 175 173 // FIXME: for the time being, this is computed by assuming constant event rate 176 174 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 180 180 // de-rotate the source position 181 181 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 183 193 Double_t rotationAngle = Observation.RotationAngle(fRA,fDEC)-RefObservation.RotationAngle(fRA,fDEC); 184 194 … … 186 196 Float_t s = TMath::Sin(rotationAngle); 187 197 // 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(); 190 200 191 201 #ifdef DEBUG -
trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcRotate.h
r4050 r4056 18 18 { 19 19 private: 20 MSrcPosCam* fSrcPos; // !Pointer to the source position21 MDCA* fDCA; // !Pointer to the MDCA object22 MRawEvtHeader* fEvtHeader; // !Pointer to the event header23 MRawRunHeader* fRunHeader; // !Pointer to the run header24 MObservatory* fObservatory; // !Pointer to the MObservatory20 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 25 25 26 26 TString fSrcPosName; … … 31 31 Double_t fRefMJD; // [MJ date] reference time for rotation 32 32 UInt_t fNEvts; // Number of events in file 33 UInt_t fFirstEvt; // Event index for first event in file34 33 MTime fIniTime; // Run initial time 35 34 MTime fFinTime; // Run final time
Note:
See TracChangeset
for help on using the changeset viewer.