GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
H1Calibrator.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_H1CALIBRATOR_H
24 #define GW_H1CALIBRATOR_H
25 
26 // root's includes
27 #ifndef ROOT_TH1
28 #include <TH1.h>
29 #endif
30 
31 #ifndef ROOT_TH2
32 #include <TH2.h>
33 #endif
34 
35 #ifndef ROOT_TH3
36 #include <TH3.h>
37 #endif
38 
39 #ifndef ROOT_TAxis
40 #include <TAxis.h>
41 #endif
42 
43 #ifndef ROOT_TF1
44 #include <TF1.h>
45 #endif
46 
47 namespace Gw {
48 
59 {
60 public:
61  H1Calibrator();
62  virtual ~H1Calibrator(); // destructor
63  void Calibrate(const TH1*, const TF1*, const Option_t *AxisOption="x");
65 
68  void Calibrate(const TH2*, const TF1*, const TF1*);
70 
72  void Calibrate(const TH3*, const TF1*, const TF1*, const TF1*);
73  void Calibrate(const TH3*, const TF1*, const TF1*, const Option_t *AxisOption="xy");
74 
77  void Calibrate(const TH1*, const Double_t a, const Double_t b, const Option_t *AxisOption="x");
78  void Calibrate(const TH1*, const Double_t a, const Double_t b, const Double_t c, const Option_t *AxisOption="x");
80 
83  void Calibrate(const TH2*, const Double_t ax, const Double_t bx, const Double_t cx,
85  const Double_t ay, const Double_t by, const Double_t cy);
87  void Calibrate(const TH2*, const Double_t ax, const Double_t bx,
88  const Double_t ay, const Double_t by);
90  void Calibrate(const TH3*, const Double_t ax, const Double_t bx, const Double_t cx, const Double_t ay,
91  const Double_t by, const Double_t cy, const Double_t az, const Double_t bz, const Double_t cz);
93  void Calibrate(const TH3*, const Double_t ax, const Double_t bx, const Double_t ay,
94  const Double_t by, const Double_t az, const Double_t bz);
96 
97  void Calibrate(const TH3*, const Double_t a1, const Double_t b1, const Double_t c1, const Double_t a2,
98  const Double_t b2, const Double_t c2, const Option_t *AxisOption);
100 
101  void Calibrate(const TH3*, const Double_t a1, const Double_t b1, const Double_t a2,
102  const Double_t b2, const Option_t *AxisOption);
103 
105  TH1* GetHistoCal() const;
106 
108  void DrawResult(const Option_t *opt="") const ;
109 
110 private:
111  TAxis *fXRawAxis; // X raw axis
112  TAxis *fYRawAxis; // Y raw axis
113  TAxis *fZRawAxis; // Z raw axis
114  TH1 *fHistoCal; // Calibrated Histo
115 
117  void Set(const TH1 *);
118  void CalibOneAxis(const TF1 *, const Option_t *);
119  void CalibOneAxis(const Double_t, const Double_t, const Option_t *);
120  void CalibOneAxis(const Double_t, const Double_t, const Double_t, const Option_t *);
121  void Invert();
122 
124  ClassDef(H1Calibrator,0); // a H1Calibrator
125 };
126 
127 // inline members
128 
129 }
130 
131 #endif
132 
133 
134 
TBrowser * b
virtual ~H1Calibrator()
void Calibrate(const TH1 *, const TF1 *, const Option_t *AxisOption="x")
void DrawResult(const Option_t *opt="") const
draw the calibrated histogram in the current pad with same range of the raw histogram ...
TH1 * GetHistoCal() const
return the calibrated histogram
H1Calibrator is a service class in order to calibrate a TH1 The raw histogram must never be changed T...
Definition: H1Calibrator.h:58