GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ASymCorrelatedSpace.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2004-2006 by Olivier Stezowski & Christian Finck *
3  * stezow(AT)ipnl.in2p3.fr, cfinck(AT)ires.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_ASymCorrelatedSpace
24 #include "ASymCorrelatedSpace.h"
25 #endif
26 
27 #ifndef ROOT_TH1D
28 #include "TH1D.h"
29 #endif
30 
31 #ifndef ROOT_TList
32 #include "TList.h"
33 #endif
34 
35 #ifndef ROOT_TString
36 #include "TString.h"
37 #endif
38 
39 using namespace Gw;
40 
41 //
43 
44 
45 //__________________________________________________________
47  : CorrelatedSpace()
48 {
49  // default constructor
50  fLog.GetProcessName() = "ASymCorrelatedSpace";
51 }
52 
53 //__________________________________________________________
54 ASymCorrelatedSpace::ASymCorrelatedSpace(const char* name, const char* title)
55 : CorrelatedSpace(name, title)
56 {
57  fLog.GetProcessName() = "ASymCorrelatedSpace";
58 }
59 
60 //__________________________________________________________
62 {
63  // default destructor
64 }
65 
66 //__________________________________________________________
67 Int_t ASymCorrelatedSpace::GetAxisNumber(Option_t* name) const
68 {
69 
70  TString tmp(name);
71  tmp.ToLower();
72 
73  switch (tmp[0]) {
74  case 'x':
75  return 0;
76 
77  case 'y':
78  return 1;
79 
80  case 'z':
81  return 2;
82 
83  case 't':
84  return 3;
85 
86  default:
87  return tmp[0] - '0';
88  }
89 
90 }
91 
92 //__________________________________________________________
93 void ASymCorrelatedSpace::SetDimension(Int_t dimension)
94 {
95  fDimension = dimension;
96 
97  for (Int_t i = 0; i < fDimension; ++i) {
98  TH1D* h1 = new TH1D(Form("hp%d", i+1), Form("Axis %d Projection", i+1), 1, 0, 1);
99  fHistoList->Add(h1);
100 
101  TH1D* h1b = new TH1D(Form("hpBkg%d", i+1), Form("Axis %d Bkg Projection", i+1), 1, 0, 1);
102  fHistoBkgList->Add(h1b);
103 
104  TH1D* h1t = new TH1D(Form("hpTot%d", i+1), Form("%s Axis %d Total Projection", GetName(), i+1), 1, 0, 1);
105  fHistoTotList->Add(h1t);
106  }
107 }
108 
109 
110 //__________________________________________________________
111 void ASymCorrelatedSpace::Project(Option_t* axis, Option_t* gateName)
112 {
113  CorrelatedSpace::Project(axis, gateName);
114 }
115 
header file for all type of ASymCorrelatedSpace
virtual void Project(CSFilter *, Option_t *)=0
project
virtual Int_t GetAxisNumber(Option_t *name) const
list of Correlated spaces
ASymCorrelatedSpace base class that contains correlated informations.
ClassImp(ASymCorrelatedSpace) ASymCorrelatedSpace
virtual std::string & GetProcessName()
To get the Process name.
Definition: GwLogMessage.h:224
void SetDimension(Int_t dimension)
Set dimension.
virtual void Project(CSFilter *, Option_t *)=0
project
CorrelatedSpace base class that contains correlated informations.