Changeset 7778 for trunk/MagicSoft


Ignore:
Timestamp:
07/05/06 12:39:47 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7777 r7778  
    3030     datacenter/macros/setupdb.C:
    3131     - make sure that 'res' is correctly deleted
    32      
     32
    3333   * datacenter/macros/doexclusions.C:
    3434     - fixed some variable name overrides
     
    3636   * mhflux/MAlphaFitter.[h,cc]:
    3737     - added the possibility to DrawResult()
     38
     39   * mhflux/MHAlpha.[h,cc]:
     40     - added new output container (Bin) which contains the number
     41       of the bin the event was assigned to
     42     - fixed drawing the significance in DrawAll
    3843
    3944
  • trunk/MagicSoft/Mars/mhflux/MHAlpha.cc

    r7755 r7778  
    5454#include <TStopwatch.h>
    5555
    56 #include "MGeomCam.h"
    5756#include "MSrcPosCam.h"
    5857#include "MHillasSrc.h"
     
    8281MHAlpha::MHAlpha(const char *name, const char *title)
    8382    : fNameParameter("MHillasSrc"), fParameter(0),
    84     fOffData(0), fResult(0), /*fExcess(0),*/ fEnergy(0),
     83    fOffData(0), fResult(0), fEnergy(0), fBin(0),
    8584    fPointPos(0), fTimeEffOn(0), fTime(0), fNumTimeBins(10),
    8685    fHillas(0), fMatrix(0), fSkipHistTime(kFALSE), fSkipHistTheta(kFALSE),
     
    295294    if (!fSigma)
    296295        return kFALSE;
     296    fBin = (MParameterI*)const_cast<MParList*>(pl)->FindCreateObj("MParameterI", "Bin");
     297    if (!fBin)
     298        return kFALSE;
    297299
    298300    //fExcess = (MParameterD*)const_cast<MParList*>(pl)->FindCreateObj("MParameterD", "MExcess");
     
    440442}
    441443
     444void MHAlpha::SetBin(Int_t ibin)
     445{
     446    // Is this necessary?
     447    // Could be speed up up searching for it only once.
     448    const Float_t max     = fFit.GetSignalIntegralMax();
     449    const Int_t bin0      = fHist.GetZaxis()->FindFixBin(max);
     450
     451    const Int_t nbinsx    = fHist.GetNbinsX();
     452    const Int_t nbinsy    = fHist.GetNbinsY();
     453    const Int_t nxy       = (nbinsx+2)*(nbinsy+2);
     454
     455    const Int_t binz      = ibin/nxy;
     456
     457    const Bool_t issignal = binz>0 && binz<bin0;
     458
     459    fBin->SetVal(issignal ? binz : -binz);
     460}
     461
    442462// --------------------------------------------------------------------------
    443463//
     
    479499
    480500    // Fill histograms
    481     fHist.Fill(theta, energy, TMath::Abs(alpha), w);
     501    const Int_t ibin = fHist.Fill(theta, energy, TMath::Abs(alpha), w);
     502    SetBin(ibin);
    482503
    483504    if (!fSkipHistTime)
     
    769790void MHAlpha::DrawAll(Bool_t newc)
    770791{
    771     if (newc && !fDisplay)
     792    if (!newc && !fDisplay)
    772793        return;
    773794
     
    843864        {
    844865            *fLog << dbg << "Bin " << i << ": sigmaexc=" << fit.GetSignificanceExc() << " omega=" << fit.GetGausSigma() << " events=" << fit.GetEventsExcess() << " scale=" << fit.GetScaleFactor() << endl;
    845             fit.PaintResult();
     866            fit.DrawResult();
    846867        }
    847868        /*
  • trunk/MagicSoft/Mars/mhflux/MHAlpha.h

    r7742 r7778  
    2020class MParList;
    2121class MParameterD;
     22class MParameterI;
    2223class MHillas;
    2324class MHMatrix;
     
    4647    MParameterD   *fSigma;      //!
    4748    MParameterD   *fEnergy;     //!
     49    MParameterI   *fBin;        //!
    4850    MPointingPos  *fPointPos;   //!
    4951
     
    7375    void InitAlphaTime(const MTime &t);
    7476    void FinalAlphaTime(MBinning &bins);
     77
     78    void SetBin(Int_t bin);
    7579
    7680    void PaintText(Double_t val, Double_t error) const;
Note: See TracChangeset for help on using the changeset viewer.