GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CSFilter.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_CSFilter
24 #include "CSFilter.h"
25 #endif
26 
27 #ifndef Gw_BasePeak
28 #include "BasePeak.h"
29 #endif
30 
31 using namespace Gw;
32 
33 //
35 
36 TString CSFilter::fgFolderName = "Filter";
37 
38 //__________________________________________________________
40  : TNamed(),
41  fCondition(1),
42  fDimension(1),
43  fLog("CSFilter")
44 {
45  // default constructor
46 }
47 
48 //__________________________________________________________
49 CSFilter::CSFilter(const char* name, const char* title)
50 : TNamed(name, title),
51  fCondition(1),
52  fDimension(1),
53  fPeakList(new TList()),
54  IsBkg(false),
55  fLog("CSFilter")
56 {
57  // default constructor
58  fPeakList->SetOwner(true);
59 
60 }
61 
62 //__________________________________________________________
64 {
65  // default destructor
66  delete fPeakList;
67 }
68 
69 //__________________________________________________________
71 {
72  fPeakList->Clear();
73 }
74 
75 //__________________________________________________________
76 void CSFilter::Draw(Option_t* opt)
77 {
78  TIter next(fPeakList);
79  TObject* peak = 0x0;
80  while ( (peak = next()) ) {
81  // clone to add peak to pad
82  BasePeak* cpeak = (BasePeak*)peak->Clone();
83  cpeak->SetBit(kCanDelete);
84  cpeak->SetBit(kMustCleanup);
85  cpeak->Draw(opt);
86  }
87 }
88 
89 //__________________________________________________________
90 void CSFilter::AddPeak(BasePeak* peak, Option_t* opt)
91 {
92  TString option(opt);
93  option.ToLower();
94  if (option.Contains("reset")) {
95  fPeakList->Clear();
96  }
97 
98  fPeakList->Add(peak->Clone());
99 }
100 
101 
102 
void AddPeak(BasePeak *peak, Option_t *opt="update")
Add Peak.
Definition: CSFilter.cpp:90
TList * fPeakList
dimension for projection
Definition: CSFilter.h:64
void Draw(Option_t *opt)
Draw peaks.
Definition: CSFilter.cpp:76
CSFilter base class for filter.
Definition: CSFilter.h:56
ClassImp(BaseNucleus)
A BasePeak is defined by a height, intensity and a dimension of the peak.
Definition: BasePeak.h:19
virtual ~CSFilter()
Definition: CSFilter.cpp:63
void Reset()
Reset peak.
Definition: CSFilter.cpp:70