Changeset 1227 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
02/28/02 16:36:54 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1221 r1227  
    11                                                                  -*-*- END -*-*-
     2
     3 2002/02/28: Thomas Bretz
     4
     5   * mhist/MHMcEnergyImpact.[h,cc], mhist/MHMcEfficiency.[h,cc]:
     6     - added
     7     
     8   * mhist/Makefile, mhist/HistLinkDef.h:
     9     - added MHMcEnergyImpact and MHMcEfficiency
     10
     11   * mhist/*.cc:
     12     - repaced some *&-> casts by &.
     13
     14   * mhist/MHMcCollectionArea.[h,cc]:
     15     - changed to be able to use new MHMcEfficiency.
     16
     17
    218
    319 2002/02/21: Abelardo Moralejo
  • trunk/MagicSoft/Mars/mhist/HistLinkDef.h

    r1211 r1227  
    1515#pragma link C++ class MHEnergyTime+;
    1616#pragma link C++ class MHEnergyTheta+;
    17 #pragma link C++ class MHMcEnergy+;
    18 #pragma link C++ class MHMcCollectionArea+;
    1917#pragma link C++ class MHAlphaEnergyTime;
    2018#pragma link C++ class MHAlphaEnergyTheta;
     
    2725
    2826#pragma link C++ class MHMcRate+;
     27#pragma link C++ class MHMcEfficiency+;
     28#pragma link C++ class MHMcEnergy+;
     29#pragma link C++ class MHMcEnergyImpact+;
     30#pragma link C++ class MHMcCollectionArea+;
    2931
    3032#endif
  • trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.cc

    r1219 r1227  
    165165
    166166    c->cd(4);
    167     ((TH3*)(&fHist))->DrawCopy(opt);
     167    ((TH3&)fHist).DrawCopy(opt);
    168168
    169169    c->Modified();
  • trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.cc

    r1215 r1227  
    169169
    170170    c->cd(4);
    171     ((TH3D*)(&fHist))->DrawCopy(opt);
     171    ((TH3D&)fHist).DrawCopy(opt);
    172172
    173173    c->Modified();
  • trunk/MagicSoft/Mars/mhist/MHEffOnTimeTheta.cc

    r1215 r1227  
    139139    gROOT->SetSelectedPad(NULL);
    140140
    141     ((TH2*)(&fHist))->DrawCopy(opt);
     141    ((TH2&)fHist).DrawCopy(opt);
    142142
    143143    c->Modified();
  • trunk/MagicSoft/Mars/mhist/MHEffOnTimeTime.cc

    r1215 r1227  
    7878    gROOT->SetSelectedPad(NULL);
    7979
    80     ((TH2*)(&fHist))->DrawCopy(opt);
     80    ((TH2&)fHist).DrawCopy(opt);
    8181
    8282    c->Modified();
  • trunk/MagicSoft/Mars/mhist/MHEnergyTheta.cc

    r1213 r1227  
    133133    gROOT->SetSelectedPad(NULL);
    134134
    135     ((TH2D*)&fHist)->DrawCopy(option);
     135    ((TH2D&)fHist).DrawCopy(option);
    136136    gPad->SetLogy();
    137137
  • trunk/MagicSoft/Mars/mhist/MHEnergyTime.cc

    r1213 r1227  
    141141    gROOT->SetSelectedPad(NULL);
    142142
    143     ((TH2D*)&fHist)->DrawCopy(option);
     143    ((TH2D&)fHist).DrawCopy(option);
    144144    gPad->SetLogy();
    145145
  • trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.cc

    r1088 r1227  
    3030
    3131#include "MH.h"
     32#include "MHMcEfficiency.h"
    3233
    3334ClassImp(MHMcCollectionArea);
     
    192193}
    193194
     195void MHMcCollectionArea::Calc(MHMcEfficiency *heff)
     196{
     197    //
     198    //  now calculate the Collection area for different
     199    //  energies
     200    //
     201    TH2D &h = (TH2D&)*heff->GetHist();
     202
     203    const Int_t nbinx = h.GetXaxis()->GetNbins();
     204    const Int_t nbiny = h.GetYaxis()->GetNbins();
     205
     206    for (Int_t ix=1; ix<=nbinx; ix++)
     207    {
     208        Double_t errA = 0;
     209        Double_t colA = 0;
     210
     211        for (Int_t iy=1; iy<=nbiny; iy++)
     212        {
     213            TAxis *yaxis = h.GetYaxis();
     214
     215            const Double_t r1  = yaxis->GetBinLowEdge(iy);
     216            const Double_t r2  = yaxis->GetBinLowEdge(iy+1);
     217
     218            const Double_t A   = TMath::Pi() * (r2*r2 - r1*r1);
     219
     220            const Double_t eff = h.GetCellContent(ix, iy);
     221            const Double_t err = h.GetCellError(ix, iy);
     222
     223            colA += eff*A;
     224            errA += A*A * err*err;
     225        }
     226
     227        fHistCol->SetBinContent(ix, colA);
     228        fHistCol->SetBinError(ix, sqrt(errA));
     229    }
     230}
     231
    194232// --------------------------------------------------------------------------
    195233//
     
    201239    // Description!
    202240
     241    /*
    203242    //
    204243    //  first of all calculate the efficency
     
    258297        fHistCol->SetBinContent(ix, colA);
    259298        fHistCol->SetBinError(ix, sqrt(errA));
    260     }
     299        }
     300        */
     301    MHMcEfficiency heff;
     302    heff.Calc(fHistSel, fHistAll);
     303
     304    Calc(&heff);
    261305
    262306    SetReadyToSave();
  • trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.h

    r1015 r1227  
    88class TH1D;
    99class TH2D;
     10
     11class MHMcEfficiency;
    1012
    1113class MHMcCollectionArea : public MParContainer
     
    3335    void CalcEfficiency();
    3436
     37    void Calc(MHMcEfficiency *eff);
     38
    3539    ClassDef(MHMcCollectionArea, 1)  // Data Container to calculate Collection Area
    3640};
  • trunk/MagicSoft/Mars/mhist/Makefile

    r1216 r1227  
    4646           MHTimeDiffTheta.cc \
    4747           MHMcEnergy.cc \
     48           MHMcEfficiency.cc \
     49           MHMcEnergyImpact.cc \
    4850           MHMcRate.cc
    4951
Note: See TracChangeset for help on using the changeset viewer.