GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CorrelatedSpace.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2004 by Olivier Stezowski *
3  * Copyright (C) 2010 by Christian Finck *
4  * stezow(AT)ipnl.in2p3.fr *
5  * *
6  * This program is free software; you can redistribute it and/or modify *
7  * it under the terms of the GNU General Public License as published by *
8  * the Free Software Foundation; either version 2 of the License, or *
9  * (at your option) any later version. *
10  * *
11  * This program is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14  * GNU General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License *
17  * along with this program; if not, write to the *
18  * Free Software Foundation, Inc., *
19  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
20  ***************************************************************************/
21 
24 #ifndef Gw_CorrelatedSpace
25 #define Gw_CorrelatedSpace
26 
27 #include "GwLogMessage.h"
28 
29 #ifndef ROOT_TNamed
30 #include "TNamed.h"
31 #endif
32 
33 class TBrowser;
34 class TList;
35 class TH1D;
36 
37 namespace Gw {
38 
39 class CSFilter;
40 
44 class CorrelatedSpace : public TNamed
45 {
46 
47 protected:
48 
49  Int_t fDimension; // dimension of the correlated space
50 
51  TList* fHistoTotList; // list of histograms for total projection
52 
53  TList* fHistoList; // list of histograms for projection
54 
55  TList* fHistoBkgList; // list of histograms for bkg projection
56 
57  Int_t fNofCells; // number of cells
58 
59  Int_t fStatus; // status of the space
60 
61  mutable LogMessage fLog;
62 
63 private:
64 
65  static const Char_t* fgkDefaultName;
66  static const TString fgkFolderName;
67  static TList* fgCorrSpaces;
68 
69 protected:
70 
71  virtual Int_t GetAxisNumber(Option_t* name) const = 0;
72 
73 public:
74 
76 
78  static const Char_t* GetDefaultName() { return fgkDefaultName; }
79 
81  static const TString GetFolderName() { return fgkFolderName; }
82 
84  static TList* GetCSList() { return fgCorrSpaces; }
85 
86 public:
88  CorrelatedSpace(const char* name, const char* title);
89  virtual ~CorrelatedSpace();
90 
92  virtual void Fill(const Double_t* /*Xn*/, const Double_t /*weight*/ = 1) = 0;
93 
95  virtual void Project(CSFilter* /*filter*/, Option_t* /*axis*/) = 0;
96 
98  virtual void Project(Option_t* axis, Option_t* gateName = "Gate0");
99 
101  virtual void SetDimension(Int_t dimension) = 0;
102 
104  virtual Int_t GetDimension() const = 0;
105 
107  virtual Int_t GetNbin(Int_t /*axis*/) const = 0;
108 
110  virtual Double_t GetCellContent(Int_t /*iCell*/) = 0;
111 
113  virtual void SetCellContent(Int_t /*iCell*/, Double_t /*weight*/) = 0;
114 
116  virtual void Browse(TBrowser* b) = 0;
117 
119  virtual void SetBins(Int_t bin, Double_t min, Double_t max, Int_t axis = 0);
120 
122  Int_t GetNofCells() { return fNofCells; }
123 
125  void SetNofCells(Int_t nCells) { fNofCells = nCells; }
126 
128  virtual TH1D* GetHisto(Option_t* axis = "x");
129 
131  virtual TH1D* GetHistoBkg(Option_t* axis = "x");
132 
134  virtual TH1D* GetHistoTot(Option_t* axis = "x");
135 
137  virtual TH1D* GetHistoTot(Option_t* axis = "x") const;
138 
140  void Import(CorrelatedSpace* cs);
141 
142  ClassDef(CorrelatedSpace,3) // Correlated Space
143 };
144 
145 } // end namespace
146 
147 #endif
virtual Double_t GetCellContent(Int_t)=0
Get cell content.
TBrowser * b
virtual void SetBins(Int_t bin, Double_t min, Double_t max, Int_t axis=0)
Set bin for each axis.
Base class for a Log message.
Definition: GwLogMessage.h:94
virtual TH1D * GetHistoBkg(Option_t *axis="x")
Get bkg histo.
void SetNofCells(Int_t nCells)
Set number of cells.
virtual void Fill(const Double_t *, const Double_t=1)=0
fill correlated space
void Import(CorrelatedSpace *cs)
Import another CS.
static const TString GetFolderName()
Get folder name.
header file for GwLogMessage.cpp
static TList * GetCSList()
Get correlated space lsit.
virtual Int_t GetAxisNumber(Option_t *name) const =0
list of Correlated spaces
Int_t GetNofCells()
Get number of cells.
CSFilter base class for filter.
Definition: CSFilter.h:56
virtual Int_t GetDimension() const =0
Get dimension.
virtual void SetCellContent(Int_t, Double_t)=0
Set cell content.
virtual TH1D * GetHistoTot(Option_t *axis="x")
Get histo total projection.
virtual void Project(CSFilter *, Option_t *)=0
project
static const Char_t * GetDefaultName()
Get default name for CS.
virtual void SetDimension(Int_t dimension)=0
Set dimension.
virtual TH1D * GetHisto(Option_t *axis="x")
Get histo.
virtual Int_t GetNbin(Int_t) const =0
Get Bin.
CorrelatedSpace base class that contains correlated informations.
virtual void Browse(TBrowser *b)=0
Browser method.