Changeset 6954


Ignore:
Timestamp:
04/18/05 20:11:09 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r6952 r6954  
    111111     - changed RunEnergy such, that it can correctly treat
    112112       MC files written by ganymed using wobble-mode
     113
     114   * mbase/MStatusDisplay.cc:
     115     - fixed a possible crash in GetFullPad
     116
     117   * mhbase/MBinning.[h,cc]:
     118     - implemented Copy Constructor
     119
     120   * mhflux/MHCollectionArea.h:
     121     - call CalcEfficiency in Finalize
     122
     123   * mhflux/MHEnergyEst.[h,cc]:
     124     - implemented GetWeights
     125
    113126
    114127
  • trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc

    r6938 r6954  
    766766TVirtualPad *MStatusDisplay::GetFullPad(const Int_t i, const Int_t j)
    767767{
    768  
    769   TVirtualPad *vpad = GetCanvas(i)->GetPad(j);
    770   if (vpad)
     768    if (!GetCanvas(i))
     769    {
     770        *fLog << warn << "MStatusDisplay::GetFullPad: i-th canvas not dound." << endl;
     771        return NULL;
     772    }
     773
     774    TVirtualPad *vpad = GetCanvas(i)->GetPad(j);
     775    if (!vpad)
     776    {
     777        *fLog << warn << "MStatusDisplay::GetFullPad: Pad is out of range." << endl;
     778        return NULL;
     779    }
     780
    771781    vpad->SetPad(0.,0.,1.,1.);
    772   else
    773     *fLog << warn << "MStatusDisplay::GetFullPad: Pad is out of range." << endl;
    774 
    775   return vpad;
    776 }
    777 
    778 
     782    return vpad;
     783}
    779784
    780785// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mhbase/MBinning.cc

    r6938 r6954  
    7878// --------------------------------------------------------------------------
    7979//
     80// Copy Constructor. If necessary give also name and title.
     81//
     82MBinning::MBinning(const MBinning &bins, const char *name, const char *title)
     83{
     84    fName  = name  ? name  : gsDefName.Data();
     85    fTitle = title ? title : gsDefTitle.Data();
     86
     87    SetEdges(bins);
     88}
     89
     90// --------------------------------------------------------------------------
     91//
    8092// Instantiate MBinning with nbins number of bins between lo (lower edge)
    8193// and hi (upper edge), name name and title title.
  • trunk/MagicSoft/Mars/mhbase/MBinning.h

    r6938 r6954  
    4040    MBinning(const char *name=NULL, const char *title=NULL);
    4141    MBinning(Int_t nbins, Axis_t lo, Axis_t hi, const char *name=0, const char *opt="", const char *title=NULL);
    42     MBinning(const MBinning &bins) { SetEdges(bins); }
     42    MBinning(const MBinning &bins, const char *name=NULL, const char *title=NULL);
    4343    MBinning(const TH1 &h, const Char_t axis='x', const char *name=0, const char *title=0);
    4444    MBinning(const TAxis &a, const char *name=0, const char *title=0);
  • trunk/MagicSoft/Mars/mhflux/MHCollectionArea.h

    r6938 r6954  
    3636
    3737    void Calc(TH2D &hsel, TH2D &hall);
     38    void CalcEfficiency();
    3839
    3940public:
     
    4344    Bool_t ReInit(MParList *pList);
    4445    Bool_t Fill(const MParContainer *par, const Stat_t weight=1);
     46    Bool_t Finalize() { CalcEfficiency(); return kTRUE; }
    4547
    4648    void Draw(Option_t *option="");
    4749    void Paint(Option_t *option="");
    48 
    49     void CalcEfficiency();
    5050
    5151    void SetHistAll(const TH2D &h) { h.Copy(fHistAll); fIsExtern=kTRUE; }
     
    5353    TH2D &GetHistAll()             { return fHistAll; }
    5454    const TH2D &GetHistAll() const { return fHistAll; }
     55    const TH1D &GetHEnergy() const { return fHEnergy; }
    5556
    5657/*
  • trunk/MagicSoft/Mars/mhflux/MHEnergyEst.cc

    r6949 r6954  
    219219}
    220220
     221void MHEnergyEst::GetWeights(TH1D &hist) const
     222{
     223    // Project into EnergyEst_ey
     224    TH1D *h1 = (TH1D*)fHEnergy.Project3D("rtlprmft_ex");
     225    TH1D *h2 = (TH1D*)fHEnergy.Project3D("rtlprmft_ey");
     226
     227    h1->Copy(hist);
     228    hist.Divide(h2);
     229
     230    delete h1;
     231    delete h2;
     232
     233    hist.SetNameTitle("EnergyRatio", "Ratio between estimated and monte carlo energy");
     234    hist.SetXTitle("E [GeV]");
     235    hist.SetYTitle("N_{est}/N_{mc} [1]");
     236    hist.SetDirectory(0);
     237}
     238
    221239void MHEnergyEst::Paint(Option_t *opt)
    222240{
  • trunk/MagicSoft/Mars/mhflux/MHEnergyEst.h

    r6938 r6954  
    4949
    5050    const TH3D &GetHEnergy() const { return fHEnergy; }
     51    void GetWeights(TH1D &hist) const;
    5152
    5253    void InitMapping(MHMatrix *mat);
  • trunk/MagicSoft/Mars/mjobs/MJCut.cc

    r6949 r6954  
    214214
    215215    TFile *file = 0;
    216     if (fNameResult.IsNull())
     216    if (fNameResult.IsNull() && fStoreResult)
    217217    {
    218218        file = (TFile*)gROOT->GetListOfFiles()->FindObject(oname);
Note: See TracChangeset for help on using the changeset viewer.