GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CorrelatedSpaceTree2.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 
25 #ifndef Gw_CorrelatedSpaceTree2
26 #define Gw_CorrelatedSpaceTree2
27 
28 #include "GwLogMessage.h"
29 
30 #ifndef Gw_SymCorrelatedSpace
31 #include "SymCorrelatedSpace.h"
32 #endif
33 
34 #ifndef ROOT_TObject
35 #include "TObject.h"
36 #endif
37 
38 #ifndef ROOT_TString
39 #include "TString.h"
40 #endif
41 
42 class TTree;
43 class TFile;
44 class TH2;
45 class TH1;
46 class TBranch;
47 
48 namespace Gw {
49 
50 class CSFilter;
51 
60 {
61 
62 protected:
63 
64  TTree* fTree;
65  TString fBranchName; // name of branch where the matrix is stored
66 
67  mutable LogMessage fLog;
68 
69 public:
70  CorrelatedSpaceTree2(const char* name = CorrelatedSpace::GetDefaultName(), const char* title = "Tree");
71  virtual ~CorrelatedSpaceTree2();
72 
74  virtual TBranch* SetAddress() = 0;
75 
77  virtual void SetBranch() = 0;
78 
80  virtual void FillHisto(Int_t j, TH1* h) = 0;
81 
83  virtual void FillCounts(Int_t i, Int_t j, TH2* h2) = 0;
84 
86  virtual void FillCounts(Int_t i, Int_t j, Int_t dimX, const Double_t* Xn, const Double_t weight = 1.) = 0;
87 
89  virtual void SetCounts(Double_t weight) = 0;
90 
92  virtual Double_t GetCounts() = 0;
93 
95  virtual void FillCounts(Int_t j) = 0;
96 
98  virtual void CheckH2InTree(TH2* h2) = 0;
99 
101  void Fill(const Double_t* Xn, const Double_t weight = 1.);
102 
104  void FillRandom(Int_t dim);
105 
107  void FillFromH2(TH2* h2);
108 
110  void Project(CSFilter* filter, Option_t* axis = "X");
111 
113  virtual void Project(Option_t* axis, Option_t* gateName = "Gate0");
114 
116  virtual void Browse(TBrowser* b);
117 
119  void SetBranchName(TString name = "mat1") { fBranchName = name; }
120 
122  const Char_t* GetBranchName() { return fBranchName.Data(); }
123 
125  void AssertTree();
126 
128  const Char_t* GetTreeName() const;
129 
131  const Char_t* GetTreeTitle() const;
132 
134  void DeleteTree(Option_t* opt = "");
135 
137  Int_t GetNbin(Int_t axis) const;
138 
140  void SetCellContent(Int_t iCell, Double_t weight);
141 
143  Double_t GetContent(Int_t i, Int_t j);
144 
146  Double_t GetCellContent(Int_t iCell);
147 
148  ClassDef(CorrelatedSpaceTree2,1) // Correlated Space Tree in 2 dim
149 };
150 
151 
152 
153 } // end namespace
154 
155 #endif
void SetCellContent(Int_t iCell, Double_t weight)
Set cell content.
virtual void SetBranch()=0
Set Branch.
TBrowser * b
CorrelatedSpaceTree2 class that manages a 2D symmetrical correlated space stored in a tree In the ent...
void FillFromH2(TH2 *h2)
fill correlated space from H2
SymCorrelatedSpace base class that contains correlated informations.
Base class for a Log message.
Definition: GwLogMessage.h:94
virtual void Browse(TBrowser *b)
Browser method.
virtual void FillHisto(Int_t j, TH1 *h)=0
Fill histo.
header file for GwLogMessage.cpp
void FillRandom(Int_t dim)
fill random
const Char_t * GetBranchName()
Get branch name.
TString fBranchName
tree that contains the matrix
Int_t GetNbin(Int_t axis) const
Get Bin.
virtual Double_t GetCounts()=0
Get counts.
void SetBranchName(TString name="mat1")
Set branch name.
virtual void FillCounts(Int_t i, Int_t j, TH2 *h2)=0
fill counts from h2
CSFilter base class for filter.
Definition: CSFilter.h:56
CorrelatedSpaceTree2(const char *name=CorrelatedSpace::GetDefaultName(), const char *title="Tree")
log message
virtual void SetCounts(Double_t weight)=0
Set counts.
header file for all type of SymCorrelatedSpace
const Char_t * GetTreeTitle() const
Get Tree title.
virtual void CheckH2InTree(TH2 *h2)=0
Check if h2 already in tree.
Double_t GetCellContent(Int_t iCell)
Get cell content.
void DeleteTree(Option_t *opt="")
Reset Tree.
static const Char_t * GetDefaultName()
Get default name for CS.
void Project(CSFilter *filter, Option_t *axis="X")
Project.
const Char_t * GetTreeName() const
Get Tree name.
void Fill(const Double_t *Xn, const Double_t weight=1.)
fill correlated space
virtual TBranch * SetAddress()=0
Set address.
Double_t GetContent(Int_t i, Int_t j)
Get content.
Int_t dim
Definition: ReadMiniTree3.C:34