Changeset 9613 for trunk/MagicSoft/Mars/mpointing
- Timestamp:
- 07/09/10 14:24:22 (14 years ago)
- Location:
- trunk/MagicSoft/Mars/mpointing
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.cc
r9342 r9613 106 106 MSrcPosCalc::MSrcPosCalc(const char *name, const char *title) 107 107 : fObservatory(NULL), fPointPos(NULL), fDeviation(NULL), fMcEvt(NULL), 108 fMcHeader(NULL), f Geom(NULL), fTime(NULL), fCallback(NULL),108 fMcHeader(NULL), fMcCorsika(NULL), fGeom(NULL), fTime(NULL), fCallback(NULL), 109 109 fSourcePos(NULL), fSrcPosCam(NULL), fSrcPosAnti(NULL), fMode(kDefault), 110 110 fNumRandomOffPositions(0) … … 342 342 } 343 343 344 fMcCorsika = 0; 344 345 if (fMcHeader->IsCeres()) 345 346 return kTRUE; 346 347 347 const MMcCorsikaRunHeader *h= (MMcCorsikaRunHeader*)plist->FindObject("MMcCorsikaRunHeader");348 if (! h)348 fMcCorsika = (MMcCorsikaRunHeader*)plist->FindObject("MMcCorsikaRunHeader"); 349 if (!fMcCorsika) 349 350 { 350 351 *fLog << err << "MMcCorsikaRunHeader not found... aborting." << endl; … … 358 359 // Determine Monte Carlo position from Monte Carlo header 359 360 TVector2 v(0, 0); 360 if ( h->GetWobbleMode()>0.5)361 if (fMcCorsika->GetWobbleMode()>0.5) 361 362 v.Set(120.*fGeom->GetConvMm2Deg(), 0.); 362 if ( h->GetWobbleMode()<-0.5)363 if (fMcCorsika->GetWobbleMode()<-0.5) 363 364 v.Set(-120.*fGeom->GetConvMm2Deg(), 0.); 364 365 … … 409 410 } 410 411 412 // If this is ceres data and we have a view cone keep 413 // the source position fixed to the center of the camera 414 if (fMcCorsika && fMcCorsika->HasViewCone()) 415 { 416 SetSrcPos(); 417 return kTRUE; 418 } 419 411 420 // If the reflector version was new enough calculate the 412 421 // source position from shower and telescope orientation … … 414 423 MVector3 pos0, pos; 415 424 pos0.SetZdAz(fPointPos->GetZdRad(), fPointPos->GetAzRad()); 416 pos.SetZdAz(fMcEvt->Get Theta(), fMcEvt->GetPhi());425 pos.SetZdAz(fMcEvt->GetParticleTheta(), fMcEvt->GetParticlePhi()); 417 426 418 427 CalcResult(pos0, pos); 428 429 // If it was not ceres due to a bug in the MAGIC MCs 430 // we have to fix the sign of X 431 if (!fMcHeader->IsCeres()) 432 SetSrcPos(TVector2(-fSrcPosCam->GetX(), fSrcPosCam->GetY())); 433 419 434 return kTRUE; 420 435 } -
trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.h
r9070 r9613 20 20 class MMcEvt; 21 21 class MMcRunHeader; 22 class MMcCorsikaRunHeader; 22 23 23 24 class MSrcPosCalc : public MTask … … 35 36 }; 36 37 37 const MObservatory *fObservatory; //! Observatory location 38 const MPointingPos *fPointPos; //! Present pointing position of the telescope in Zd/Az 39 const MPointingDev *fDeviation; //! Deviation calculated from starguider data 40 const MMcEvt *fMcEvt; //! Possible input of shower position from MC 41 const MMcRunHeader *fMcHeader; //! Monte Carlo run header needed for correct wobble position 42 const MGeomCam *fGeom; //! Camera geomety 43 const MTime *fTime; //! Time of the current event 44 const MTaskList *fCallback; //! Callback function to get the number of the cycle 38 const MObservatory *fObservatory; //! Observatory location 39 const MPointingPos *fPointPos; //! Present pointing position of the telescope in Zd/Az 40 const MPointingDev *fDeviation; //! Deviation calculated from starguider data 41 const MMcEvt *fMcEvt; //! Possible input of shower position from MC 42 const MMcRunHeader *fMcHeader; //! Monte Carlo run header needed for correct wobble position 43 const MMcCorsikaRunHeader *fMcCorsika; //! Monte Carlo run header needed to determine view cone option 44 const MGeomCam *fGeom; //! Camera geomety 45 const MTime *fTime; //! Time of the current event 46 const MTaskList *fCallback; //! Callback function to get the number of the cycle 45 47 MPointingPos *fSourcePos; //! Source Postion in sky coordinates 46 48 MSrcPosCam *fSrcPosCam; //! Output: Source position in the camera
Note:
See TracChangeset
for help on using the changeset viewer.