Ignore:
Timestamp:
02/13/02 16:40:37 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r1210 r1216  
    3939#include <TCanvas.h>
    4040
     41#include "MLog.h"
     42#include "MLogManip.h"
     43
     44#include "MGeomCam.h"
    4145#include "MHillas.h"
    4246#include "MParList.h"
     
    4953//
    5054MHHillas::MHHillas(const char *name, const char *title)
     55    : fMm2Deg(1), fUseMmScale(kFALSE)
    5156{
    5257    //
     
    6166    // connect all the histogram with the container fHist
    6267    //
    63     fWidth  = new TH1F("Width [mm]",  "Width of Hillas",  100, 0, 300);
    64     fLength = new TH1F("Length [mm]", "Length of Hillas", 100, 0, 300);
     68    fWidth  = new TH1F("Width",  "Width of Ellipse",  100, 0, 300);
     69    fLength = new TH1F("Length", "Length of Ellipse", 100, 0, 300);
    6570
    6671    fLength->SetDirectory(NULL);
     
    8994// instances of MBinning (with the names 'BinningWidth' and 'BinningLength')
    9095// are found in the parameter list
     96// Use this function if you want to set the conversion factor which
     97// is used to convert the mm-scale in the camera plain into the deg-scale
     98// used for histogram presentations. The conversion factor is part of
     99// the camera geometry. Please create a corresponding MGeomCam container.
    91100//
    92101Bool_t MHHillas::SetupFill(const MParList *plist)
     
    94103    const MBinning* binsw = (MBinning*)plist->FindObject("BinningWidth");
    95104    const MBinning* binsl = (MBinning*)plist->FindObject("BinningLength");
    96 
    97     if (binsw)
    98         SetBinning(fWidth, binsw);
    99 
    100     if (binsl)
    101         SetBinning(fLength, binsl);
     105    if (!binsw || !binsl)
     106    {
     107        *fLog << err << dbginf << "At least one MBinning not found... aborting." << endl;
     108        return kFALSE;
     109    }
     110
     111    SetBinning(fWidth,  binsw);
     112    SetBinning(fLength, binsl);
     113
     114    const MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam");
     115    if (!geom)
     116    {
     117        *fLog << warn << dbginf << "No Camera Geometry available. Using mm-scale for histograms." << endl;
     118        return kTRUE;
     119    }
     120
     121    fLength->GetXaxis()->SetTitle("Length [\\circ]");
     122    fWidth->GetXaxis()->SetTitle("Width [\\circ]");
     123
     124    fMm2Deg = geom->GetConvMm2Deg();
    102125
    103126    return kTRUE;
     
    113136    const MHillas &h = *(MHillas*)par;
    114137
    115     fWidth ->Fill(h.GetWidth());
    116     fLength->Fill(h.GetLength());
     138    if (fUseMmScale)
     139    {
     140        fWidth ->Fill(h.GetWidth());
     141        fLength->Fill(h.GetLength());
     142    }
     143    else
     144    {
     145        fWidth ->Fill(fMm2Deg*h.GetWidth());
     146        fLength->Fill(fMm2Deg*h.GetLength());
     147    }
    117148
    118149    return kTRUE;
Note: See TracChangeset for help on using the changeset viewer.