Changeset 1263 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
03/20/02 10:36:39 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/macros/flux.C

    r1215 r1263  
    116116    fillsp.SetFilter(&fasrc);
    117117    fillasp.SetFilter(&fsrc);
    118     fillsptheta.SetFilter(&fsrc);
    119     fillasptheta.SetFilter(&fasrc);
     118    fillsptheta.SetFilter(&fasrc);
     119    fillasptheta.SetFilter(&fsrc);
    120120
    121121    MFillH fillontime ("EffOnTime  [MHTimeDiffTime]",  "MMcEvt");
  • trunk/MagicSoft/Mars/mhist/MHHillas.cc

    r1216 r1263  
    5353//
    5454MHHillas::MHHillas(const char *name, const char *title)
    55     : fMm2Deg(1), fUseMmScale(kFALSE)
     55    : fMm2Deg(-1), fUseMmScale(kFALSE)
    5656{
    5757    //
     
    152152// --------------------------------------------------------------------------
    153153//
     154// Use this function to setup your own conversion factor between degrees
     155// and millimeters. The conversion factor should be the one calculated in
     156// MGeomCam. Use this function with Caution: You could create wrong values
     157// by setting up your own scale factor.
     158//
     159void MHHillas::SetMm2Deg(Float_t mmdeg)
     160{
     161    if (mmdeg<0)
     162    {
     163        *fLog << warn << dbginf << "Warning - Conversion factor < 0 - nonsense. Ignored." << endl;
     164        return;
     165    }
     166
     167    if (fMm2Deg>=0)
     168        *fLog << warn << dbginf << "Warning - Conversion factor already set. Overwriting" << endl;
     169
     170    fMm2Deg = mmdeg;
     171}
     172
     173// --------------------------------------------------------------------------
     174//
     175// With this function you can convert the histogram ('on the fly') between
     176// degrees and millimeters.
     177//
     178void MHHillas::SetMmScale(Bool_t mmscale=kTRUE)
     179{
     180    if (fUseMmScale == mmscale)
     181        return;
     182
     183    if (fMm2Deg<0)
     184    {
     185        *fLog << warn << dbginf << "Warning - Sorry, no conversion factor for conversion available." << endl;
     186        return;
     187    }
     188
     189    if (fUseMmScale)
     190    {
     191        fLength->GetXaxis()->SetTitle("Length [mm]");
     192        fWidth->GetXaxis()->SetTitle("Width [mm]");
     193
     194        fLength->Scale(1./fMm2Deg);
     195        fWidth->Scale(1./fMm2Deg);
     196    }
     197    else
     198    {
     199        fLength->GetXaxis()->SetTitle("Length [\\circ]");
     200        fWidth->GetXaxis()->SetTitle("Width [\\circ]");
     201
     202        fLength->Scale(fMm2Deg);
     203        fWidth->Scale(fMm2Deg);
     204    }
     205
     206    fUseMmScale = mmscale;
     207}
     208
     209// --------------------------------------------------------------------------
     210//
    154211// Draw clones of all four histograms. So that the object can be deleted
    155212// and the histograms are still visible in the canvas.
  • trunk/MagicSoft/Mars/mhist/MHHillas.h

    r1216 r1263  
    2323    ~MHHillas();
    2424
    25     void SetMmScale(Bool_t mmscale=kTRUE) { fUseMmScale = mmscale; }
     25    void SetMmScale(Bool_t mmscale=kTRUE);
     26    void SetMm2Deg(Float_t mmdeg);
    2627
    2728    Bool_t SetupFill(const MParList *pList);
  • trunk/MagicSoft/Mars/mhist/MHStarMap.cc

    r1211 r1263  
    9898
    9999    const float m = tan(delta);
    100     const float t = m*h.GetMeanX()-h.GetMeanY();
     100    const float t = h.GetMeanY() - m*h.GetMeanX();
    101101
    102102    if (m>-1 && m<1)
  • trunk/MagicSoft/Mars/mhist/MHTimeDiffTheta.cc

    r1215 r1263  
    106106    // FIXME: ProjectionX,Y is not const within root
    107107    //
    108     TH1 *h;
     108    TH1D *h;
    109109
    110110    c->cd(1);
     
    133133        MakeDefCanvas("DiffTimeTheta", "Distrib of Delta t, Theta");
    134134
    135     TH1 *h;
     135    TH1D *h;
    136136
    137137    gPad->Divide(2,2);
  • trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.cc

    r1215 r1263  
    9898    // FIXME: ProjectionX,Y is not const within root
    9999    //
    100     TH1 *h;
     100    TH1D *h;
    101101
    102102    c->cd(1);
     
    127127    gPad->Divide(2,2);
    128128
    129     TH1 *h;
     129    TH1D *h;
    130130
    131131    gPad->cd(1);
Note: See TracChangeset for help on using the changeset viewer.