GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CorrelatedSpaceLightTree3.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_CorrelatedSpaceLightTree3
26 #define Gw_CorrelatedSpaceLightTree3
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 TH3;
45 class TH1;
46 class TBranch;
47 
48 namespace Gw {
49 
50 class CSFilter;
51 
58 {
59 
60 protected:
61 
62  TTree* fTree;
63  TString fBranchName; // name of branch where the matrix is stored
64  Short_t fX[3];
65 
66  mutable LogMessage fLog;
67 
68 protected:
69 
70  void ProjectSimple(CSFilter* filter, Int_t idx);
71  void ProjectCombined(CSFilter* filter, Int_t idx);
72 
73 public:
74  CorrelatedSpaceLightTree3(const char* name = CorrelatedSpace::GetDefaultName(), const char* title = "Tree");
76 
78  virtual TBranch* SetAddress();
79 
81  virtual void SetBranch();
82 
84  // virtual void CheckH3InTree(TH3* h3);
85 
87  void Fill(const Double_t* Xn, const Double_t weight = 1.);
88 
90  void FillRandom(TH1* h1, Int_t nEvents);
91 
93  void FillFromH3(TH3* h3);
94 
96  void Project(CSFilter* filter, Option_t* axis = "X");
97 
99  virtual void Project(Option_t* axis, Option_t* gateName = "Gate0");
100 
102  virtual void Browse(TBrowser* b);
103 
105  void SetBranchName(TString name = "cube") { fBranchName = name; }
106 
108  const Char_t* GetBranchName() { return fBranchName.Data(); }
109 
111  void AssertTree();
112 
114  const Char_t* GetTreeName() const;
115 
117  const Char_t* GetTreeTitle() const;
118 
120  void DeleteTree(Option_t* opt = "");
121 
123  Int_t GetNbin(Int_t axis) const;
124 
126  void SetCellContent(Int_t iCell, Double_t weight);
127 
129  Double_t GetCellContent(Int_t iCell);
130 
131  ClassDef(CorrelatedSpaceLightTree3,1) // Correlated Space Tree in 3 dim
132 };
133 
134 
135 
136 } // end namespace
137 
138 #endif
Int_t GetNbin(Int_t axis) const
Get Bin.
TBrowser * b
void FillRandom(TH1 *h1, Int_t nEvents)
fill random
const Char_t * GetBranchName()
Get branch name.
CorrelatedSpaceLightTree3(const char *name=CorrelatedSpace::GetDefaultName(), const char *title="Tree")
void SetCellContent(Int_t iCell, Double_t weight)
Set cell content.
SymCorrelatedSpace base class that contains correlated informations.
void SetBranchName(TString name="cube")
Set branch name.
const Char_t * GetTreeName() const
Get Tree name.
void DeleteTree(Option_t *opt="")
Reset Tree.
LogMessage fLog
array to store axis
const Char_t * GetTreeTitle() const
Get Tree title.
Base class for a Log message.
Definition: GwLogMessage.h:94
void FillFromH3(TH3 *h3)
fill correlated space from H3
header file for GwLogMessage.cpp
void Fill(const Double_t *Xn, const Double_t weight=1.)
Check if h3 already in tree.
CSFilter base class for filter.
Definition: CSFilter.h:56
CorrelatedSpaceLightTree3 class that manages a 3D symmetrical correlated space stored in a tree Here ...
header file for all type of SymCorrelatedSpace
Double_t GetCellContent(Int_t iCell)
Get cell content.
static const Char_t * GetDefaultName()
Get default name for CS.
void ProjectCombined(CSFilter *filter, Int_t idx)
virtual TBranch * SetAddress()
Set address.
virtual void Browse(TBrowser *b)
Browser method.
TString fBranchName
tree that contains the matrix
void ProjectSimple(CSFilter *filter, Int_t idx)
log message
void Project(CSFilter *filter, Option_t *axis="X")
Project.