Ignore:
Timestamp:
02/15/09 15:09:12 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mpointing
Files:
4 edited

Legend:

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

    r9153 r9338  
    5858//
    5959MHSrcPosCam::MHSrcPosCam(Bool_t wobble, const char *name, const char *title)
    60     : fTimeEffOn(NULL), fEffOnTime(NULL), fSourcePos(NULL),
     60    : fTimeEffOn(NULL), fEffOnTime(NULL), fSourcePos(NULL), fGeom(NULL),
    6161    fPositions("TVector2", 50000)
    6262{
     
    8989Bool_t MHSrcPosCam::SetupFill(const MParList *pl)
    9090{
    91     MGeomCam *geom = (MGeomCam*)pl->FindObject("MGeomCam");
    92     if (!geom)
     91    fGeom = (MGeomCam*)pl->FindObject("MGeomCam");
     92    if (!fGeom)
    9393    {
    9494        *fLog << err << "ERROR - MGeomCam not found... aborting." << endl;
     
    121121
    122122    fHist.Reset();
    123     fConvMm2Deg = geom->GetConvMm2Deg();
    124     fNum        = 0;
     123    fNum = 0;
    125124
    126125    return kTRUE;
     
    146145    if (!fEffOnTime)
    147146    {
    148         const TVector2 v(cam->GetXY()*fConvMm2Deg);
     147        const TVector2 v(cam->GetXY()*fGeom->GetConvMm2Deg());
    149148        fHist.Fill(v.X(), v.Y(), w);
    150149        return kTRUE;
     
    157156    // buffer position into array (could be speed up a little bit more
    158157    // by using ExpandCreate and memcpy)
    159     new (fPositions[fNum++]) TVector2(cam->GetXY()*fConvMm2Deg);
     158    new (fPositions[fNum++]) TVector2(cam->GetXY()*fGeom->GetConvMm2Deg());
    160159
    161160    // Check if there is a new effective on time
  • trunk/MagicSoft/Mars/mpointing/MHSrcPosCam.h

    r9153 r9338  
    1818#endif
    1919
     20class MGeomCam;
    2021class MParList;
    2122class MParameterD;
     
    3132    MParameterD  *fEffOnTime;      //! Effective on time
    3233    MPointingPos *fSourcePos;      //! Pointing position of the telescope
     34    MGeomCam     *fGeom;           //! Conversion from mm to deg
    3335
    34     Double_t      fConvMm2Deg;     //! Conversion factor from mm to deg
    3536    TClonesArray  fPositions;      //! Buffer to store source positions
    3637    Int_t         fNum;            //! Position in array
  • trunk/MagicSoft/Mars/mpointing/MSrcPosRndm.cc

    r8802 r9338  
    5757Int_t MSrcPosRndm::PreProcess(MParList *plist)
    5858{
    59     MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam");
    60     if (!geom)
     59    fGeom = (MGeomCam*)plist->FindObject("MGeomCam");
     60    if (!fGeom)
    6161    {
    6262        *fLog << err << "ERROR - MGeomCam not found... aborting." << endl;
     
    8686        *fLog << inf << "Source position will be produced randomly in a distance of " << fDistOfSource << "° from the camera center!" << endl;
    8787
    88     fConvMm2Deg = geom->GetConvMm2Deg();
    89 
    9088    return kTRUE;
    9189}
     
    107105    }
    108106
    109     fSrcPos->SetXY(x/fConvMm2Deg, y/fConvMm2Deg);
     107    const Double_t f = fGeom->GetConvMm2Deg();
     108
     109    fSrcPos->SetXY(x/f, y/f);
    110110    if (fDistOfSource>=0)
    111         fSrcPosAnti->SetXY(-x/fConvMm2Deg, -y/fConvMm2Deg);
     111        fSrcPosAnti->SetXY(-x/f, -y/f);
    112112    return kTRUE;
    113113}
  • trunk/MagicSoft/Mars/mpointing/MSrcPosRndm.h

    r8802 r9338  
    66#endif
    77
     8class MGeomCam;
    89class MSrcPosCam;
    910class MHSrcPosCam;
     
    1516    MSrcPosCam   *fSrcPosAnti; //!
    1617    MHSrcPosCam  *fHist;       //!
    17 
    18     Double_t fConvMm2Deg;
     18    MGeomCam     *fGeom;       //! Conversion factor from mm to deg
    1919
    2020    Double_t fDistOfSource; // [deg] Distance of the source from the camera center
     
    2424
    2525public:
    26     MSrcPosRndm() : fSrcPos(0), fHist(0), fDistOfSource(-1)
     26    MSrcPosRndm() : fSrcPos(0), fSrcPosAnti(0), fHist(0), fGeom(0), fDistOfSource(-1)
    2727    {
    2828        fName  = "MSrcPosRndm";
Note: See TracChangeset for help on using the changeset viewer.