Changeset 9613


Ignore:
Timestamp:
Jul 9, 2010, 2:24:22 PM (11 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mpointing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.cc

    r9342 r9613  
    106106MSrcPosCalc::MSrcPosCalc(const char *name, const char *title)
    107107    : fObservatory(NULL), fPointPos(NULL), fDeviation(NULL), fMcEvt(NULL),
    108     fMcHeader(NULL), fGeom(NULL), fTime(NULL), fCallback(NULL),
     108    fMcHeader(NULL), fMcCorsika(NULL), fGeom(NULL), fTime(NULL), fCallback(NULL),
    109109    fSourcePos(NULL), fSrcPosCam(NULL), fSrcPosAnti(NULL), fMode(kDefault),
    110110    fNumRandomOffPositions(0)
     
    342342    }
    343343
     344    fMcCorsika = 0;
    344345    if (fMcHeader->IsCeres())
    345346        return kTRUE;
    346347
    347     const MMcCorsikaRunHeader *h = (MMcCorsikaRunHeader*)plist->FindObject("MMcCorsikaRunHeader");
    348     if (!h)
     348    fMcCorsika = (MMcCorsikaRunHeader*)plist->FindObject("MMcCorsikaRunHeader");
     349    if (!fMcCorsika)
    349350    {
    350351        *fLog << err << "MMcCorsikaRunHeader not found... aborting." << endl;
     
    358359    // Determine Monte Carlo position from Monte Carlo header
    359360    TVector2 v(0, 0);
    360     if (h->GetWobbleMode()>0.5)
     361    if (fMcCorsika->GetWobbleMode()>0.5)
    361362        v.Set(120.*fGeom->GetConvMm2Deg(), 0.);
    362     if (h->GetWobbleMode()<-0.5)
     363    if (fMcCorsika->GetWobbleMode()<-0.5)
    363364        v.Set(-120.*fGeom->GetConvMm2Deg(), 0.);
    364365
     
    409410        }
    410411
     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
    411420        // If the reflector version was new enough calculate the
    412421        // source position from shower and telescope orientation
     
    414423        MVector3 pos0, pos;
    415424        pos0.SetZdAz(fPointPos->GetZdRad(), fPointPos->GetAzRad());
    416         pos.SetZdAz(fMcEvt->GetTheta(), fMcEvt->GetPhi());
     425        pos.SetZdAz(fMcEvt->GetParticleTheta(), fMcEvt->GetParticlePhi());
    417426
    418427        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
    419434        return kTRUE;
    420435    }
  • trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.h

    r9070 r9613  
    2020class MMcEvt;
    2121class MMcRunHeader;
     22class MMcCorsikaRunHeader;
    2223
    2324class MSrcPosCalc : public MTask
     
    3536    };
    3637
    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
    4547    MPointingPos *fSourcePos;     //! Source Postion in sky coordinates
    4648    MSrcPosCam   *fSrcPosCam;     //! Output: Source position in the camera
Note: See TracChangeset for help on using the changeset viewer.