Ignore:
Timestamp:
01/21/02 22:09:45 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhist
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/MH.cc

    r1205 r1207  
    222222}
    223223
     224void MH::SetBinning(TH1 *h, TH1 *x)
     225{
     226    SetBinning(h, x->GetXaxis(), x->GetYaxis(), x->GetZaxis());
     227}
  • trunk/MagicSoft/Mars/mhist/MH.h

    r1205 r1207  
    77
    88class TH1;
     9class TAxis;
     10class TArrayD;
     11class TCanvas;
     12
    913class MBinning;
    1014class MParList;
    11 class TArrayD;
    12 class TAxis;
    13 
    14 class TCanvas;
    1515
    1616class MH : public MParContainer
     
    3939    static void SetBinning(TH1 *h, const TAxis *binsx, const TAxis *binsy, const TAxis *binsz);
    4040
     41    static void SetBinning(TH1 *h, TH1 *x);
     42
    4143    ClassDef(MH, 1) //A histogram base class for Mars histograms
    4244};
  • trunk/MagicSoft/Mars/mhist/MHHillas.cc

    r1205 r1207  
    1 <<<<<<< MHHillas.cc
    21/* ======================================================================== *\
    32!
     
    1918!   Author(s): Thomas Bretz  2001 <mailto:tbretz@uni-sw.gwdg.de>
    2019!
    21 !   Copyright: MAGIC Software Development, 2000-2001
     20!   Copyright: MAGIC Software Development, 2000-2002
    2221!
    2322!
    2423\* ======================================================================== */
    2524
    26 ///////////////////////////////////////////////////////////////////////
     25/////////////////////////////////////////////////////////////////////////////
    2726//
    2827// MHHillas
     
    3029// This class contains histograms for every Hillas parameter
    3130//
    32 ///////////////////////////////////////////////////////////////////////
     31/////////////////////////////////////////////////////////////////////////////
    3332
    3433#include "MHHillas.h"
     
    4645// --------------------------------------------------------------------------
    4746//
    48 // Setup four histograms for Alpha, Width, Length and Dist
     47// Setup four histograms for Width, Length
    4948//
    5049MHHillas::MHHillas (const char *name, const char *title)
     
    6160    // connect all the histogram with the container fHist
    6261    //
    63     fAlpha  = new TH1F("Alpha [deg]", "Alpha of Hillas",   90, 0,  90);
    6462    fWidth  = new TH1F("Width [mm]",  "Width of Hillas",  100, 0, 300);
    6563    fLength = new TH1F("Length [mm]", "Length of Hillas", 100, 0, 300);
    66     fDist   = new TH1F("Dist [mm]",   "Dist of Hillas",   100, 0, 300);
    6764
    68     fAlpha->SetDirectory(NULL);
    6965    fLength->SetDirectory(NULL);
    70     fDist->SetDirectory(NULL);
    7166    fWidth->SetDirectory(NULL);
    7267
    73     fAlpha->GetXaxis()->SetTitle("\\alpha [\\circ]");
    7468    fLength->GetXaxis()->SetTitle("Length [mm]");
    75     fDist->GetXaxis()->SetTitle("Dist [mm]");
    7669    fWidth->GetXaxis()->SetTitle("Width [mm]");
    7770
    78     fAlpha->GetYaxis()->SetTitle("Counts");
    7971    fLength->GetYaxis()->SetTitle("Counts");
    80     fDist->GetYaxis()->SetTitle("Counts");
    8172    fWidth->GetYaxis()->SetTitle("Counts");
    8273}
     
    8879MHHillas::~MHHillas()
    8980{
    90     delete fAlpha;
    9181    delete fWidth;
    9282    delete fLength;
    93     delete fDist;
    9483}
    9584
     
    10392    const MHillas &h = *(MHillas*)par;
    10493
    105     fAlpha ->Fill(fabs(h.GetAlpha()));
    10694    fWidth ->Fill(h.GetWidth());
    10795    fLength->Fill(h.GetLength());
    108     fDist  ->Fill(h.GetDist());
    10996
    11097    return kTRUE;
     
    121108TObject *MHHillas::DrawClone(Option_t *opt) const
    122109{
    123     TCanvas *c = MakeDefCanvas("Hillas", "Histograms of Hillas Parameters");
    124     c->Divide(2, 2);
     110    TCanvas *c = MakeDefCanvas("Hillas", "Histograms of Hillas Parameters",
     111                               350, 500);
     112    c->Divide(1, 2);
    125113
    126114    gROOT->SetSelectedPad(NULL);
     
    130118    //
    131119    c->cd(1);
    132     fAlpha->DrawCopy();
     120    fLength->DrawCopy();
    133121
    134122    c->cd(2);
    135     fLength->DrawCopy();
    136 
    137     c->cd(3);
    138     fDist->DrawCopy();
    139 
    140     c->cd(4);
    141123    fWidth->DrawCopy();
    142124
     
    156138{
    157139    if (!gPad)
    158         MakeDefCanvas("Hillas", "Histograms of Hillas Parameters");
     140        MakeDefCanvas("Hillas", "Histograms of Hillas Parameters", 350, 500);
    159141
    160     gPad->Divide(2,2);
     142    gPad->Divide(1, 2);
    161143
    162144    gPad->cd(1);
    163     fAlpha->Draw();
     145    fLength->Draw();
    164146
    165147    gPad->cd(2);
    166     fLength->Draw();
    167 
    168     gPad->cd(3);
    169     fDist->Draw();
    170 
    171     gPad->cd(4);
    172148    fWidth->Draw();
    173149
  • trunk/MagicSoft/Mars/mhist/MHHillas.h

    r1203 r1207  
    1919    ~MHHillas();
    2020
    21     void Fill(const MParContainer *par);
     21    Bool_t Fill(const MParContainer *par);
    2222
    2323    TH1F *GetHistWidth()  { return fWidth; }
  • trunk/MagicSoft/Mars/mhist/MHStarMap.cc

    r1205 r1207  
    1 <<<<<<< MHStarMap.cc
    21/* ======================================================================== *\
    32!
     
    4847// Create the star map histogram
    4948//
    50 MHStarMap::MHStarMap (const char *name, const char *title)
     49MHStarMap::MHStarMap(const char *name, const char *title)
    5150{
    5251    //
     
    7372    fStarMap->SetDirectory(NULL);
    7473
    75     fStarMap->SetXTitle("x/mm");
    76     fStarMap->SetYTitle("y/mm");
     74    fStarMap->SetXTitle("x [mm]");
     75    fStarMap->SetYTitle("y [mm]");
    7776    fStarMap->SetZTitle("Counts");
    7877}
     
    9695    const MHillas &h = *(MHillas*)par;
    9796
    98     const float dist  = h.GetDist();
    99     const float theta = h.GetTheta();
    100     const float alpha = h.GetAlpha()/kRad2Deg;
    101 
    102     const float m = tan(theta+alpha-kPI);
    103     const float t = dist*(sin(theta)-cos(theta)*m);
     97    const float delta = h.GetDelta();
     98
     99    const float m = tan(delta);
     100    const float t = m*h.GetMeanX()-h.GetMeanY();
    104101
    105102    if (m>-1 && m<1)
     
    214211    gPad->Update();
    215212}
    216 
  • trunk/MagicSoft/Mars/mhist/MHStarMap.h

    r1203 r1207  
    2323    ~MHStarMap();
    2424
    25     void Fill(const MParContainer *par);
     25    Bool_t Fill(const MParContainer *par);
    2626
    2727    TH2F *GetHist() { return fStarMap; }
Note: See TracChangeset for help on using the changeset viewer.