GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CSManager.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_CSManager
26 #define Gw_CSManager
27 
28 #include "GwLogMessage.h"
29 
30 #ifndef ROOT_TNamed
31 #include "TNamed.h"
32 #endif
33 
34 #ifndef ROOT_TString
35 #include "TString.h"
36 #endif
37 
38 class TCanvas;
39 class TH1D;
40 class TList;
41 class TVirtualPad;
42 
43 namespace Gw {
44 class CorrelatedSpace;
45 class CSFilter;
46 class Peak1D;
47 
53 class CSManager : public TNamed
54 {
55 
56 private:
57 
58  static const TString fgkFolderName;
59  static const TString fgkFilterFolderName;
60  static Int_t fgNofInstance;
61 
62 protected:
63 
64  TList* fRegCS;
65 
66  TString fFilterBaseName;
67  Int_t fCInstance;
68  Bool_t fIsCanvasDiv;
69  mutable LogMessage fLog;
70 
71 protected:
72 
74  void SetFolders();
75 
77  Float_t GetRatio(CSFilter* filter);
78 
79 public:
80 
81  TString GetFolderName();
82  TString GetFilterFolderName();
83 
84 public:
85  CSManager();
86  CSManager(const char* name, const char* title);
87  virtual ~CSManager();
88 
90  TCanvas* GetCanvas();
91 
93  TVirtualPad* GetProjTotPad(Int_t idx);
94 
96  TVirtualPad* GetProjPad(Int_t idx);
97 
99  void Register(CorrelatedSpace* cs);
100 
102  const TList* GetRegCSList() { return fRegCS; }
103 
105  void Project(Option_t* axis);
106 
108  CSFilter* GetFilter(Option_t* gateName = "Gate");
109 
111  Int_t CollectGate(Option_t* opt = "reset");
112 
114  TH1D* GetHisto(Int_t iCS) const;
115 
117  TH1D* GetHistoBkg(Int_t iCS) const;
118 
120  TH1D* GetHistoTot(Option_t* axis = "x", Int_t iCS = 0) const;
121 
123  void DrawProj(Option_t* opt);
124 
126  void DrawProjTot(Option_t* opt, Option_t* axis = "x");
127 
129  void Convert(CorrelatedSpace* src, CorrelatedSpace* dst);
130 
132  const Char_t* GetFilterBaseName() { return fFilterBaseName.Data(); }
133 
135  void SetFilterBaseName(const Char_t* name) { fFilterBaseName = name; }
136 
138  void EnableCanvasDiv() { fIsCanvasDiv = false; }
139 
140  ClassDef(CSManager,0) // Correlated Space Manager
141 };
142 
143 } // end namespace
144 
145 #endif
TVirtualPad * GetProjPad(Int_t idx)
Get pad of projected spectrum for a given CS.
Definition: CSManager.cpp:212
TString GetFolderName()
Definition: CSManager.cpp:154
TH1D * GetHistoTot(Option_t *axis="x", Int_t iCS=0) const
Get projection total.
Definition: CSManager.cpp:342
TString fFilterBaseName
list of registred CS
Definition: CSManager.h:66
void Register(CorrelatedSpace *cs)
Add correlated space.
Definition: CSManager.cpp:327
Int_t fCInstance
filter base name
Definition: CSManager.h:67
virtual ~CSManager()
Definition: CSManager.cpp:145
Base class for a Log message.
Definition: GwLogMessage.h:94
CSManager correlated spaces manager.
Definition: CSManager.h:53
Float_t GetRatio(CSFilter *filter)
Get ratio for removing bgk spectrum from the gated one.
Definition: CSManager.cpp:131
header file for GwLogMessage.cpp
LogMessage fLog
flag for canvas division
Definition: CSManager.h:69
const TList * GetRegCSList()
Get registred CS list.
Definition: CSManager.h:102
void Project(Option_t *axis)
Project.
Definition: CSManager.cpp:414
void EnableCanvasDiv()
Enable again canvas division.
Definition: CSManager.h:138
void SetFolders()
log message
Definition: CSManager.cpp:104
CSFilter base class for filter.
Definition: CSFilter.h:56
TString GetFilterFolderName()
Definition: CSManager.cpp:163
TH1D * GetHisto(Int_t iCS) const
Get histogramm.
Definition: CSManager.cpp:357
void DrawProj(Option_t *opt)
Draw projection.
Definition: CSManager.cpp:219
TH1D * GetHistoBkg(Int_t iCS) const
Get histogramm.
Definition: CSManager.cpp:372
void Convert(CorrelatedSpace *src, CorrelatedSpace *dst)
Convert correlated space to another correlated space.
Definition: CSManager.cpp:437
TList * fRegCS
number of instances
Definition: CSManager.h:64
Int_t CollectGate(Option_t *opt="reset")
Collect gates on spectra.
Definition: CSManager.cpp:277
void DrawProjTot(Option_t *opt, Option_t *axis="x")
Draw total projection.
Definition: CSManager.cpp:257
void SetFilterBaseName(const Char_t *name)
Set Filter Base Name.
Definition: CSManager.h:135
CSFilter * GetFilter(Option_t *gateName="Gate")
Get Filter.
Definition: CSManager.cpp:387
Bool_t fIsCanvasDiv
number of CS manager instanced
Definition: CSManager.h:68
const Char_t * GetFilterBaseName()
Get Filter Base Name.
Definition: CSManager.h:132
TVirtualPad * GetProjTotPad(Int_t idx)
Get pad of total projection spectrum for a given CS.
Definition: CSManager.cpp:205
CorrelatedSpace base class that contains correlated informations.
TCanvas * GetCanvas()
Start view.
Definition: CSManager.cpp:173