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/MHHillasSrc.cc

    r1210 r1216  
    3838#include <TCanvas.h>
    3939
     40#include "MLog.h"
     41#include "MLogManip.h"
     42
     43#include "MGeomCam.h"
     44
    4045#include "MParList.h"
    4146
     
    6267    // connect all the histogram with the container fHist
    6368    //
    64     fAlpha = new TH1F("Alpha [deg]", "Alpha of Hillas",   90, 0,  90);
    65     fDist  = new TH1F("Dist [mm]",   "Dist of Hillas",   100, 0, 600);
     69    fAlpha = new TH1F("Alpha", "Alpha of Ellipse",   90, 0,  90);
     70    fDist  = new TH1F("Dist",  "Dist of Ellipse",   100, 0, 600);
    6671
    6772    fAlpha->SetDirectory(NULL);
     
    9095// instances of MBinning (with the names 'BinningAlpha' and 'BinningDist')
    9196// are found in the parameter list
     97// Use this function if you want to set the conversion factor which
     98// is used to convert the mm-scale in the camera plain into the deg-scale
     99// used for histogram presentations. The conversion factor is part of
     100// the camera geometry. Please create a corresponding MGeomCam container.
    92101//
    93102Bool_t MHHillasSrc::SetupFill(const MParList *plist)
     
    95104    const MBinning* binsa = (MBinning*)plist->FindObject("BinningAlpha");
    96105    const MBinning* binsd = (MBinning*)plist->FindObject("BinningDist");
    97 
    98     if (binsa)
    99         SetBinning(fAlpha, binsa);
    100 
    101     if (binsd)
    102         SetBinning(fDist, binsd);
     106    if (!binsa || !binsd)
     107    {
     108        *fLog << err << dbginf << "At least one MBinning not found... aborting." << endl;
     109        return kFALSE;
     110    }
     111
     112    SetBinning(fAlpha, binsa);
     113    SetBinning(fDist,  binsd);
     114
     115    const MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam");
     116    if (!geom)
     117    {
     118        *fLog << warn << dbginf << "No Camera Geometry available. Using mm-scale for histograms." << endl;
     119        return kTRUE;
     120    }
     121
     122    fDist->GetXaxis()->SetTitle("Dist [\\circ]");
     123
     124    fMm2Deg = geom->GetConvMm2Deg();
    103125
    104126    return kTRUE;
     
    115137
    116138    fAlpha->Fill(fabs(h.GetAlpha()));
    117     fDist ->Fill(h.GetDist());
     139    fDist ->Fill(fUseMmScale ? h.GetDist() : fMm2Deg*h.GetDist());
    118140
    119141    return kTRUE;
Note: See TracChangeset for help on using the changeset viewer.