Ignore:
Timestamp:
01/21/02 20:52:12 (23 years ago)
Author:
rkb
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhist
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/HistLinkDef.h

    r1015 r1203  
    1111#pragma link C++ class MHFadcPix+;
    1212#pragma link C++ class MHHillas+;
     13#pragma link C++ class MHHillasSrc+;
    1314#pragma link C++ class MHStarMap+;
    1415#pragma link C++ class MHMcEnergy+;
  • trunk/MagicSoft/Mars/mhist/MHHillas.cc

    r1082 r1203  
    4545// --------------------------------------------------------------------------
    4646//
    47 // Setup four histograms for Alpha, Width, Length and Dist
     47// Setup four histograms for Width, Length
    4848//
    4949MHHillas::MHHillas (const char *name, const char *title)
     
    6060    // connect all the histogram with the container fHist
    6161    //
    62     fAlpha  = new TH1F("Alpha [deg]", "Alpha of Hillas",   90, 0,  90);
    6362    fWidth  = new TH1F("Width [mm]",  "Width of Hillas",  100, 0, 300);
    6463    fLength = new TH1F("Length [mm]", "Length of Hillas", 100, 0, 300);
    65     fDist   = new TH1F("Dist [mm]",   "Dist of Hillas",   100, 0, 300);
    6664
    67     fAlpha->SetDirectory(NULL);
    6865    fLength->SetDirectory(NULL);
    69     fDist->SetDirectory(NULL);
    7066    fWidth->SetDirectory(NULL);
    7167
    72     fAlpha->GetXaxis()->SetTitle("\\alpha [\\circ]");
    7368    fLength->GetXaxis()->SetTitle("Length [mm]");
    74     fDist->GetXaxis()->SetTitle("Dist [mm]");
    7569    fWidth->GetXaxis()->SetTitle("Width [mm]");
    7670
    77     fAlpha->GetYaxis()->SetTitle("Counts");
    7871    fLength->GetYaxis()->SetTitle("Counts");
    79     fDist->GetYaxis()->SetTitle("Counts");
    8072    fWidth->GetYaxis()->SetTitle("Counts");
    8173}
     
    8779MHHillas::~MHHillas()
    8880{
    89     delete fAlpha;
    9081    delete fWidth;
    9182    delete fLength;
    92     delete fDist;
    9383}
    9484
     
    10292    const MHillas &h = *(MHillas*)par;
    10393
    104     fAlpha ->Fill(fabs(h.GetAlpha()));
    10594    fWidth ->Fill(h.GetWidth());
    10695    fLength->Fill(h.GetLength());
    107     fDist  ->Fill(h.GetDist());
    10896}
    10997
     
    118106TObject *MHHillas::DrawClone(Option_t *opt) const
    119107{
    120     TCanvas *c = MakeDefCanvas("Hillas", "Histograms of Hillas Parameters");
    121     c->Divide(2, 2);
     108    TCanvas *c = MakeDefCanvas("Hillas", "Histograms of Hillas Parameters",
     109                               350, 500);
     110    c->Divide(1, 2);
    122111
    123112    gROOT->SetSelectedPad(NULL);
     
    127116    //
    128117    c->cd(1);
    129     fAlpha->DrawCopy();
     118    fLength->DrawCopy();
    130119
    131120    c->cd(2);
    132     fLength->DrawCopy();
    133 
    134     c->cd(3);
    135     fDist->DrawCopy();
    136 
    137     c->cd(4);
    138121    fWidth->DrawCopy();
    139122
     
    153136{
    154137    if (!gPad)
    155         MakeDefCanvas("Hillas", "Histograms of Hillas Parameters");
     138        MakeDefCanvas("Hillas", "Histograms of Hillas Parameters", 350, 500);
    156139
    157     gPad->Divide(2,2);
     140    gPad->Divide(1, 2);
    158141
    159142    gPad->cd(1);
    160     fAlpha->Draw();
     143    fLength->Draw();
    161144
    162145    gPad->cd(2);
    163     fLength->Draw();
    164 
    165     gPad->cd(3);
    166     fDist->Draw();
    167 
    168     gPad->cd(4);
    169146    fWidth->Draw();
    170147
  • trunk/MagicSoft/Mars/mhist/MHHillas.h

    r1015 r1203  
    1212{
    1313private:
    14     TH1F *fAlpha;
    1514    TH1F *fWidth;
    1615    TH1F *fLength;
    17     TH1F *fDist;
    1816
    1917public:
    20      MHHillas(const char *name=NULL, const char *title=NULL);
     18    MHHillas(const char *name=NULL, const char *title=NULL);
    2119    ~MHHillas();
    2220
    2321    void Fill(const MParContainer *par);
    2422
    25     TH1F *GetHistAlpha()  { return fAlpha; }
    2623    TH1F *GetHistWidth()  { return fWidth; }
    2724    TH1F *GetHistLength() { return fLength; }
    28     TH1F *GetHistDist()   { return fDist; }
    2925
    3026    void Draw(Option_t *opt=NULL);
     
    3531
    3632#endif
    37 
  • trunk/MagicSoft/Mars/mhist/MHStarMap.cc

    r1082 r1203  
    4747// Create the star map histogram
    4848//
    49 MHStarMap::MHStarMap (const char *name, const char *title)
     49MHStarMap::MHStarMap(const char *name, const char *title)
    5050{
    5151    //
     
    7272    fStarMap->SetDirectory(NULL);
    7373
    74     fStarMap->SetXTitle("x/mm");
    75     fStarMap->SetYTitle("y/mm");
     74    fStarMap->SetXTitle("x [mm]");
     75    fStarMap->SetYTitle("y [mm]");
    7676    fStarMap->SetZTitle("Counts");
    7777}
     
    9595    const MHillas &h = *(MHillas*)par;
    9696
    97     const float dist  = h.GetDist();
    98     const float theta = h.GetTheta();
    99     const float alpha = h.GetAlpha()/kRad2Deg;
    100 
    101     const float m = tan(theta+alpha-kPI);
    102     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();
    103101
    104102    if (m>-1 && m<1)
     
    211209    gPad->Update();
    212210}
    213 
  • trunk/MagicSoft/Mars/mhist/MHStarMap.h

    r1015 r1203  
    2020
    2121public:
    22      MHStarMap(const char *name=NULL, const char *title=NULL);
     22    MHStarMap(const char *name=NULL, const char *title=NULL);
    2323    ~MHStarMap();
    2424
     
    3434
    3535#endif
    36 
  • trunk/MagicSoft/Mars/mhist/Makefile

    r1052 r1203  
    3030SRCFILES = MFillH.cc \
    3131           MH.cc \
    32            MHFadcPix.cc \
     32        MHFadcPix.cc \
    3333           MHFadcCam.cc \
    3434           MHHillas.cc \
     35           MHHillasSrc.cc \
    3536           MHStarMap.cc \
    3637           MHMcCollectionArea.cc \
     
    5354
    5455# @endcode
    55 
Note: See TracChangeset for help on using the changeset viewer.