source: branches/Mars_use_drstimefiles/mreflector/MRflSinglePhoton.cc@ 18102

Last change on this file since 18102 was 8907, checked in by tbretz, 16 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 <TMath.h>
35
36#include <TH2.h>
37#include <TH3.h>
38
39#include "MLog.h"
40#include "MLogManip.h"
41
42ClassImp(MRflSinglePhoton);
43
44using namespace std;
45
46// --------------------------------------------------------------------------
47//
48// Fill radial photon distance scaled by scale into 1D histogram.
49//
50void MRflSinglePhoton::FillRad(TH1 &hist, Float_t scale) const
51{
52 hist.Fill(TMath::Hypot(fX, fY)*scale);
53}
54
55// --------------------------------------------------------------------------
56//
57// Fill radial photon distance scaled by scale versus x into 2D histogram.
58//
59void MRflSinglePhoton::FillRad(TH2 &hist, Double_t x, Float_t scale) const
60{
61 hist.Fill(x, TMath::Hypot(fX, fY)*scale);
62}
63
64// --------------------------------------------------------------------------
65//
66// Fill photon position (x,y) scaled by scale into 2D histogram.
67//
68void MRflSinglePhoton::Fill(TH2 &hist, Float_t scale) const
69{
70 hist.Fill(fX*scale, fY*scale);
71}
72
73// --------------------------------------------------------------------------
74//
75// Fill photon position (x,y) scaled by scale versus z into 3D histogram.
76//
77void MRflSinglePhoton::Fill(TH3 &hist, Double_t z, Float_t scale) const
78{
79 hist.Fill(fX*scale, fY*scale);
80}
81
82// --------------------------------------------------------------------------
83//
84// Dump all photon information
85//
86void MRflSinglePhoton::Print(Option_t *o) const
87{
88 *fLog << all << "x=" << fX << " y=" << fY << endl;
89}
Note: See TracBrowser for help on using the repository browser.