GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Peak.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2006 by Christophe Theisen & Olivier Stezowski *
3  * christophe.theisen(AT)cea.fr, stezow(AT)ipnl.in2p3.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 
23 #ifndef GW_PEAK_H
24 #define GW_PEAK_H
25 
26 // root's includes
27 #ifndef ROOT_TARRAYD_H
28 #include <TArrayD.h>
29 #endif
30 
31 #ifndef ROOT_TOBJECT_H
32 #include <TObject.h>
33 #endif
34 
35 
36 namespace GwD {
37 
43 class Peak : public TObject
44 {
45 public:
46  Peak(); //Default constructor
47  Peak(Int_t n); // constructor
48  Peak(const Peak& p); //copy constructor
49  virtual ~Peak(); // destructor
51  void Set(Int_t n); // Set the dimension
52  void SetPosition(const Double_t x, const Double_t y=0.0, const Double_t z=0.0);
53  void SetPosition(const Double_t *array);
54  void SetResolution(const Double_t x, const Double_t y=0.0, const Double_t z=0.0);
55  void SetResolution(const Double_t *array);
56  void SetIntensity(const Double_t val);
57 
58  Int_t GetSize();
59  Double_t GetPosition(const Int_t i);
60  const Double_t* GetPosition();
61  Double_t GetResolution(const Int_t i);
62  const Double_t* GetResolution();
63  Double_t GetIntensity();
64 
65 private:
66  Int_t fDim; //Dimension of the peak (1D, 2D, 3D, ...)
67  TArrayD *fPos; //Array of positions
68  TArrayD *fRes; //Array of resolutions
69  Double_t fInt; //Intensity
70 
72  ClassDef(Peak,1); // a peak
73 };
74 
75 // inline members
76 
77 }
78 
79 #endif
80 
81 
82 
void SetResolution(const Double_t x, const Double_t y=0.0, const Double_t z=0.0)
Definition: Peak.cpp:89
const Double_t * GetResolution()
Definition: Peak.cpp:125
Double_t GetIntensity()
Definition: Peak.cpp:130
Int_t GetSize()
Definition: Peak.cpp:106
const Double_t * GetPosition()
Definition: Peak.cpp:115
void SetPosition(const Double_t x, const Double_t y=0.0, const Double_t z=0.0)
Definition: Peak.cpp:77
void Set(Int_t n)
Set the dimension. A new array for position (resolution) is created, the old contents copied to new a...
Definition: Peak.cpp:69
Description of the class.
Definition: Peak.h:43
void SetIntensity(const Double_t val)
Definition: Peak.cpp:101
Peak()
Definition: Peak.cpp:36
virtual ~Peak()
Definition: Peak.cpp:64