source: trunk/MagicSoft/Mars/mreflector/MRflSinglePhoton.cc@ 8802

Last change on this file since 8802 was 8290, checked in by tbretz, 18 years ago
*** empty log message ***
File size: 2.6 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Thomas Bretz, 5/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2003
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26//
27// MRflSinglePhoton
28//
29// Single Photon of a event from the reflector program
30//
31/////////////////////////////////////////////////////////////////////////////
32#include "MRflSinglePhoton.h"
33
34#include <TH2.h>
35#include <TH3.h>
36
37#include "MLog.h"
38#include "MLogManip.h"
39
40ClassImp(MRflSinglePhoton);
41
42using namespace std;
43
44// --------------------------------------------------------------------------
45//
46// Fill radial photon distance scaled by scale into 1D histogram.
47//
48void MRflSinglePhoton::FillRad(TH1 &hist, Float_t scale) const
49{
50 hist.Fill(TMath::Hypot(fX, fY)*scale);
51}
52
53// --------------------------------------------------------------------------
54//
55// Fill radial photon distance scaled by scale versus x into 2D histogram.
56//
57void MRflSinglePhoton::FillRad(TH2 &hist, Double_t x, Float_t scale) const
58{
59 hist.Fill(x, TMath::Hypot(fX, fY)*scale);
60}
61
62// --------------------------------------------------------------------------
63//
64// Fill photon position (x,y) scaled by scale into 2D histogram.
65//
66void MRflSinglePhoton::Fill(TH2 &hist, Float_t scale) const
67{
68 hist.Fill(fX*scale, fY*scale);
69}
70
71// --------------------------------------------------------------------------
72//
73// Fill photon position (x,y) scaled by scale versus z into 3D histogram.
74//
75void MRflSinglePhoton::Fill(TH3 &hist, Double_t z, Float_t scale) const
76{
77 hist.Fill(fX*scale, fY*scale);
78}
79
80// --------------------------------------------------------------------------
81//
82// Dump all photon information
83//
84void MRflSinglePhoton::Print(Option_t *o) const
85{
86 *fLog << all << "x=" << fX << " y=" << fY << endl;
87}
Note: See TracBrowser for help on using the repository browser.