Changeset 8288 for trunk/MagicSoft


Ignore:
Timestamp:
02/02/07 13:50:45 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8287 r8288  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20
     21 2007/02/02 Thomas Bretz
     22
     23   * mreflector/MRflSinglePhoton.[h,cc], mreflector/MRflEvtData.[h,cc]:
     24     - added new Fill functions allowing to fill photons versus
     25       a z-value, e.g. energy.
     26
     27
    2028
    2129 2007/02/01 Thomas Bretz
  • trunk/MagicSoft/Mars/mreflector/MRflEvtData.cc

    r8270 r8288  
    147147// --------------------------------------------------------------------------
    148148//
     149// Fills all photon distances into a TH1 scaled with scale (default=1)
     150//
     151void MRflEvtData::FillRad(TH2 &hist, Double_t z, Float_t scale) const
     152{
     153    MRflSinglePhoton *ph=NULL;
     154
     155    TIter Next(&fList);
     156    while ((ph=(MRflSinglePhoton*)Next()))
     157        ph->FillRad(hist, z, scale);
     158}
     159
     160// --------------------------------------------------------------------------
     161//
    149162// Fills all photons into a TH2 scaled with scale (default=1)
    150163//
     
    156169    while ((ph=(MRflSinglePhoton*)Next()))
    157170        ph->Fill(hist, scale);
     171}
     172
     173// --------------------------------------------------------------------------
     174//
     175// Fills all photons into a TH2 scaled with scale (default=1)
     176//
     177void MRflEvtData::Fill(TH3 &hist, Double_t z, Float_t scale) const
     178{
     179    MRflSinglePhoton *ph=NULL;
     180
     181    TIter Next(&fList);
     182    while ((ph=(MRflSinglePhoton*)Next()))
     183        ph->Fill(hist, z, scale);
    158184}
    159185
  • trunk/MagicSoft/Mars/mreflector/MRflEvtData.h

    r8270 r8288  
    1616class TH1;
    1717class TH2;
     18class TH3;
     19
    1820class MRflSinglePhoton;
    1921
     
    3941
    4042    void FillRad(TH1 &hist, Float_t scale=1) const;
     43    void FillRad(TH2 &hist, Double_t z, Float_t scale=1) const;
    4144    void Fill(TH2 &hist, Float_t scale=1) const;
     45    void Fill(TH3 &hist, Double_t z, Float_t scale=1) const;
    4246
    4347    void Print(Option_t *o="") const;
  • trunk/MagicSoft/Mars/mreflector/MRflSinglePhoton.cc

    r8270 r8288  
    3333
    3434#include <TH2.h>
     35#include <TH3.h>
    3536
    3637#include "MLog.h"
     
    5253// --------------------------------------------------------------------------
    5354//
     55// Fill radial photon distance into histogram scaled by scale.
     56//
     57void MRflSinglePhoton::FillRad(TH2 &hist, Double_t z, Float_t scale) const
     58{
     59    hist.Fill(TMath::Hypot(fX, fY)*scale, z);
     60}
     61
     62// --------------------------------------------------------------------------
     63//
    5464// Fill photon position into histogram scaled by scale.
    5565//
    5666void MRflSinglePhoton::Fill(TH2 &hist, Float_t scale) const
     67{
     68    hist.Fill(fX*scale, fY*scale);
     69}
     70
     71// --------------------------------------------------------------------------
     72//
     73// Fill photon position into histogram scaled by scale.
     74//
     75void MRflSinglePhoton::Fill(TH3 &hist, Double_t z, Float_t scale) const
    5776{
    5877    hist.Fill(fX*scale, fY*scale);
  • trunk/MagicSoft/Mars/mreflector/MRflSinglePhoton.h

    r8270 r8288  
    88class TH1;
    99class TH2;
     10class TH3;
    1011
    1112class MRflSinglePhoton : public MParContainer
     
    1920    Float_t fHeight; // [cm] production height
    2021    Float_t fPhi;    // [rad] camera inc. angle (rad)
     22
    2123public:
    2224    MRflSinglePhoton() { }
     
    3739
    3840    void FillRad(TH1 &hist, Float_t scale=1) const;
     41    void FillRad(TH2 &hist, Double_t z, Float_t scale=1) const;
    3942    void Fill(TH2 &hist, Float_t scale=1) const;
     43    void Fill(TH3 &hist, Double_t z, Float_t scale=1) const;
    4044
    4145    void Print(Option_t *o="") const;
Note: See TracChangeset for help on using the changeset viewer.