Changeset 9000


Ignore:
Timestamp:
07/14/08 22:25:59 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8999 r9000  
    7272   * mraw/RawLinkDef.h, mraw/Makefile:
    7373     - removed MRawSocketRead
     74
     75   * mpointing/MHSrcPosCam.[h,cc]:
     76     - fixed ouput in case a container is not found
     77     - made it work for monte carlos, too
     78     - use weight when filling histogram
     79     - changed circle line styles
     80     - changed default in constructor to wobble=kTRUE
    7481
    7582
  • trunk/MagicSoft/Mars/mpointing/MHSrcPosCam.cc

    r8689 r9000  
    8989Bool_t MHSrcPosCam::SetupFill(const MParList *pl)
    9090{
    91     fTimeEffOn = (MTime*)pl->FindObject("MTimeEffectiveOnTime");
    92     if (!fTimeEffOn)
    93     {
    94         *fLog << err << "ERROR - MTimeEffOnTime not found... aborting." << endl;
    95         return kFALSE;
    96     }
    97 
    9891    MGeomCam *geom = (MGeomCam*)pl->FindObject("MGeomCam");
    9992    if (!geom)
     
    10396    }
    10497
     98    fTimeEffOn = (MTime*)      pl->FindObject("MTimeEffectiveOnTime");
    10599    fEffOnTime = (MParameterD*)pl->FindObject("MEffectiveOnTime");
    106     if (!fEffOnTime)
     100
     101    if (!fTimeEffOn && fEffOnTime)
     102    {
     103        *fLog << err << "ERROR - MTimeEffOnTime not found... aborting." << endl;
     104        return kFALSE;
     105    }
     106    if (!fEffOnTime && fTimeEffOn)
    107107    {
    108108        *fLog << err << "ERROR - MEffectiveOnTime not found... aborting." << endl;
     
    110110    }
    111111
    112     MPointingPos *pos = (MPointingPos*)pl->FindObject("MSourcePos", "MPointingPos");
    113     if (!pos)
    114     {
    115         *fLog << warn << "ERROR - MSourcePos not found... aborting." << endl;
    116         return kFALSE;
    117     }
    118 
    119     const TString src = pos->GetString("radec");
     112    if (!fEffOnTime && !fTimeEffOn)
     113        *fLog << inf << "Neither MTimeEffOnTime nor MEffectiveOnTime found... assuming MC." << endl;
     114    else
     115        fTimeLastEffOn = MTime();
     116
     117    const MPointingPos *pos = (MPointingPos*)pl->FindObject("MSourcePos", "MPointingPos");
     118
     119    const TString src = pos ? pos->GetString("radec") : "MonteCarlo";
    120120    fHist.SetTitle(MString::Format("SrcPos distribution in camera: %s", src.Data()));
    121121
    122122    fHist.Reset();
    123     fTimeLastEffOn = MTime();
    124     fConvMm2Deg    = geom->GetConvMm2Deg();
    125     fNum           = 0;
     123    fConvMm2Deg = geom->GetConvMm2Deg();
     124    fNum        = 0;
    126125
    127126    return kTRUE;
     
    145144    }
    146145
     146    if (!fEffOnTime)
     147    {
     148        const TVector2 v(cam->GetXY()*fConvMm2Deg);
     149        fHist.Fill(v.X(), v.Y(), w);
     150        return kTRUE;
     151    }
     152
    147153    // Increase array size if necessary
    148154    if (fNum==fPositions.GetSize())
     
    167173    {
    168174        const TVector2 &v = (TVector2&)*fPositions[i];
    169         fHist.Fill(v.X(), v.Y(), scale);
     175        fHist.Fill(v.X(), v.Y(), scale*w);
    170176    }
    171177
     
    205211    if (fHist.GetXaxis()->GetXmax()>0.5)
    206212    {
     213        // Typical wobble distance +/- 1 shaftencoder step
    207214        TEllipse el;
    208215        el.SetFillStyle(4000);
    209         el.SetLineColor(kMagenta);
     216        el.SetLineColor(kBlack);
     217        el.SetLineStyle(kDashed);
    210218        el.DrawEllipse(0, 0, 0.4, 0, 0, 360, 0);
    211     }
    212 }
    213 
     219        el.SetLineColor(17);
     220        el.DrawEllipse(0, 0, 0.4-0.022, 0, 0, 360, 0);
     221        el.DrawEllipse(0, 0, 0.4+0.022, 0, 0, 360, 0);
     222    }
     223}
     224
  • trunk/MagicSoft/Mars/mpointing/MHSrcPosCam.h

    r8689 r9000  
    3737
    3838public:
    39     MHSrcPosCam(Bool_t wobble=kFALSE, const char *name=NULL, const char *title=NULL);
     39    MHSrcPosCam(Bool_t wobble=kTRUE, const char *name=NULL, const char *title=NULL);
    4040
    4141    // MH
Note: See TracChangeset for help on using the changeset viewer.