GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GANIL/CrystalWatchers.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2010 by Olivier Stezowski *
3  * stezow(AT)ipnl.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 
21 #ifndef _CrystalWatchers
22 #define _CrystalWatchers
23 
24 // Gw and Watcher definition
25 #ifndef Gw_Watchers
26 #include "Watchers.h"
27 #endif
28 
29 // ADF definitions
30 #ifndef ADF_CrystalFrame
31 #include "CrystalFrame.h"
32 #endif
33 
34 // ROOT definitions
35 class TH3;
36 class TH2;
37 using namespace ADF;
38 using namespace Gw;
39 
41 
44 {
45 protected:
47 
48 public:
49  CrystalWatcher(const char *name, const char *title) :
50  WatcherWithTag(name,title,0x0,0x0),
51  fFrame(0x0)
52  {;}
53  virtual ~CrystalWatcher()
54  {;}
55 
57 
60  virtual Bool_t SetTrigger( ADF::DFTrigger */*trigger*/ = 0x0 );
61 
62  ClassDef(CrystalWatcher,0) // Trigger on crystal Frame
63 };
64 
66 
75 {
76 public:
77  static const Short_t gkNB_SIG = 10; // number of signal kept in memory
78 
79 private:
81  Short_t fCurrentSig;
83  TString fProcessingAlgo;
84 
85 protected:
87  TH2 *fEnergies;
88 
89 protected:
91  TObjArray *fSeg;
92  TObjArray *fCor;
93 
94 protected:
96  Int_t fVMin;
97  Int_t fVMax;
98  Double_t fHMin;
99  Double_t fHMax;
100 
101 protected:
103  TObjArray *fBaseLines;
104  TObjArray *fSpectra;
105  TObjArray *fAmplitudes;
107  std::vector <Double_t> fFromSignal;
108 
113  std::vector<Int_t > fCoincThreshold;
114  std::vector<Int_t > fCoincOverShoot;
116  TH2 *fCoinc;
119 
120 protected:
122  TObjArray fBaseLinesArrows;
123  TObjArray fThresholdArrows;
124  TObjArray fOvershootArrows;
125 
126 protected:
128  virtual void DoCanvas(TCanvas *c, Option_t *);
129 
130 protected:
132  void ProcessSignal(Signal *, TH1 *h = 0x0);
133  // this is done using very basic signal processing
134  void ProcessSignalBasic(Signal *, TH1 *h = 0x0);
135 
136 public:
137  ShowSignals(const char *name = "ShowSignals", const char *title = "Display the signals for one crystal");
138  virtual ~ShowSignals();
139 
141  // virtual char * GetObjectInfo(Int_t px, Int_t py) const;
142 
143  static void SetDefaultArrow(Double_t baseline, Double_t threshold, Double_t overshoot, Double_t pos = 10, Double_t length = 1000 );
144 
146  void ShowLastOnes(); //*MENU*
147 
149  void SetVRange(Int_t min = 0, Int_t max = 10000); //*MENU*
151  void SetHRange(Double_t min = 0, Double_t max = 100); //*MENU*
152 
154  void ShowArrow(Int_t which_sig = 0); //*MENU*
155 
157 
161  // void SetLevel(Double_t baseline, Double_t threshold, Double_t overshoot, UInt_t which_sig = 0); //*MENU*
162 
164  virtual void Exec(Option_t *option="");
165 
166  ClassDef(ShowSignals,0) // to get all the signal of one crystal
167 };
168 
169 
171 
172 
173 #include "TBrowser.h"
174 
175 #include "CrystalWatchers.h"
176 #include "CanvasVisu.h"
177 
178 #include "Macros/Visu/LoupeOnPad.h"
179 
180 class CrystalSpectra : public ShowSignals, public CanvasVisu
181 {
182 
183 protected:
184 
186  TString fCrystalName;
187 
188 public:
189  CrystalSpectra(const char *name = "CrystalSpectra", const char *title = "Display the values for one crystal at the producer level");
190  virtual ~CrystalSpectra();
191 
193  virtual void SetVRange(Int_t min, Int_t max){ShowSignals::SetVRange(min,max);}
195  virtual void SetHRange(Double_t min, Double_t max){ShowSignals::SetHRange(min,max);}
196 
197  virtual void ShowSignalsMap(int NbrOfSignals = 1); //*MENU*
198 
199  virtual void ShowBaselinesMap(const char *option=""); //*MENU*
200 
201  virtual void ShowSpectraMap(const char *option=""); //*MENU*
202 
203  virtual void GlobalAutoRange(const char *opt="xy"); //*MENU
204 
205  virtual void SetLoupe(bool loupeon = true){CanvasVisu::SetLoupe(loupeon);} //*MENU*
206 
207  virtual void SetRange(double min, double max, const char *x_y = "y"){CanvasVisu::SetRange(min,max,x_y);} //*MENU*
208  virtual void UnZoom(const char *x_y = "y"){CanvasVisu::Unzoom(x_y);} //*MENU*
209 
210  virtual void LogX(){CanvasVisu::LogX();} //*MENU*
211  virtual void LogY(){CanvasVisu::LogY();} //*MENU*
212 
213  virtual void ShowLastOnes(){}
214  virtual void ShowArrow(Int_t){}
215  virtual void ShowCanvas(Option_t){}
216 
217  ClassDef(CrystalSpectra,0) // to get all the signal of one crystal
218 
219 };
220 
221 
223 {
224 public:
225  CCrystalSpectra(const char *name = "CCrystalSpectra", const char *title = "Display the values for one crystal at the preprocessing level") : CrystalSpectra(name,title) {}
226  virtual ~CCrystalSpectra() {}
227 
228 // virtual void ShowSignalsMap(int /*NbrOfSignals*/) {}
229 
230 // virtual void ShowBaselinesMap(const char * /*option*/) {}
231 
232  ClassDef(CCrystalSpectra,0)
233 
234 };
235 
236 #endif
237 
virtual void ShowArrow(Int_t)
TH2 * fCoreCoinc
Core correlation core0 versus core1.
virtual void UnZoom(const char *x_y="y")
TObjArray fThresholdArrows
TObjArray * fSeg
Array of last gkNB_SIG signals for core and segments.
std::vector< Double_t > fFromSignal
Some characteritics extracted from the signal.
Int_t fVMin
to change the range to diplay signals
TObjArray fOvershootArrows
std::vector< Int_t > fCoincOverShoot
TObjArray * fAmplitudes
virtual void LogX()
Definition: CanvasVisu.C:351
TH2 * fEnergies
Energie for the different channels core and segments.
virtual void ShowCanvas(Option_t)
header file for CrystalFrame.cpp
virtual void SetRange(double min, double max, const char *x_y="x")
Definition: CanvasVisu.C:408
CCrystalSpectra(const char *name="CCrystalSpectra", const char *title="Display the values for one crystal at the preprocessing level")
Base class for a Signal.
Definition: Signals.h:39
Base Watcher working for any kind of crystal Frame (Frame interface)
virtual void ShowLastOnes()
To work on Signals.
TObjArray * fBaseLines
Baseline for the different channels core and segments.
virtual void SetRange(double min, double max, const char *x_y="y")
void SetVRange(Int_t min=0, Int_t max=10000)
change vertical range
A Shared Frame Pointer.
Definition: Frame.h:597
virtual void LogY()
Definition: CanvasVisu.C:370
void SetHRange(Double_t min=0, Double_t max=100)
change horizontal range
Base class for a trigger on a data flow.
Definition: Trigger.h:155
virtual void SetHRange(Double_t min, Double_t max)
change horizontal range
std::vector< Int_t > fCoincThreshold
to keep event by event the list of signals and overshoot
virtual void SetLoupe(bool loupeon=true)
virtual void Unzoom(const char *x_y_xy="xy")
Definition: CanvasVisu.C:299
virtual void SetVRange(Int_t min, Int_t max)
change vertical range
TObjArray fBaseLinesArrows
contains arrows corresponding respectively to baseline, threshold and overshoot for all detector ...
Crystal spectra watcher class.
TObjArray * fSpectra
TH2 * fCoinc
Coincidence between segments [signals above the threshold].
CrystalWatcher(const char *name, const char *title)
TH3 * fHThreshold
keep statistcis for threshold and overshoot
virtual void SetLoupe(bool loupeon=true)
Definition: CanvasVisu.C:646