GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GANIL/PSAWatchers.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 _PSAWatchers
22 #define _PSAWatchers
23 
24 // Watcher definition
25 #include "Watchers.h"
26 
27 // ADF definitions
28 #include "PSAFrame.h"
29 
30 // ROOT definitions
31 #include "Rtypes.h"
32 
33 #include "CanvasVisu.h"
34 
35 class TH1F;
36 class TH2F;
37 class TH3F;
38 
39 
40 using namespace ADF;
41 using namespace Gw;
42 
44 
46 class PSAWatcher : public WatcherWithTag
47 {
48 protected:
50 public:
51  PSAWatcher(const char *name, const char *title, TDirectory *sp_dir = 0x0, TDirectory *tag_dir = 0x0) :
52  WatcherWithTag(name,title,sp_dir,tag_dir),
53  fFrame(0x0)
54  {;}
55  virtual ~PSAWatcher()
56  {;}
57 
59 
61  virtual Bool_t SetTrigger( ADF::DFTrigger */*trigger*/ = 0x0 );
62 
63 
64  ClassDef(PSAWatcher,0) // Trigger on PSA Frame
65 };
66 
68 /*
69 
70  for OpenGL support :
71  You must add
72  gStyle->SetCanvasPreferGL(1);
73  and TH3D::Draw("glbox") for cubic symbol
74  or TH3D::Draw("glbox1") for spherical symbol
75 
76  for plane slicing put your mouse on a plane (the plane become green)
77  stay press on shift and move the mouse
78 
79 */
80 class PSACrystal3D : public PSAWatcher
81 {
82 private:
83  static Float_t fgMetric;
84  static Float_t fRadius;
85  static Float_t fDepht;
86  static Int_t fNBinX;
87  static Int_t fNBinZ;
88  static Float_t fDefaultECutMin;
89  static Float_t fDefaultECutMax;
90 
91 private:
92  TH3F * fH3DHitPosition;
93  TH1F * fE0;
94  TH1F * fE1;
95  TH1F * fT0;
96  TH1F * fT1;
97  TH2F * fTE0;
98  TH2F * fTE1;
99  TH1F * fEnergySeg;
100  TH1F * fNbHits;
101 
102 private:
103  Float_t fCurrentECutMin;
104  Float_t fCurrentECutMax;
105 
106 protected:
108  virtual void DoCanvas(TCanvas *c, Option_t *);
109 
110 public:
111  PSACrystal3D( const char * name, const char * title, TDirectory *sp_dir = 0x0, TDirectory *tag_dir = 0x0);
112  virtual ~PSACrystal3D();
113 
114  virtual void Exec(Option_t * option="");
115 
117  void SetEnergyCut(Float_t EcutMin,
118  Float_t EcutMax ); //*MENU* *ARGS={EcutMin=>fCurrentECutMin,EcutMax=>fCurrentECutMax}
119 
120  void SetCurrentECutMin( Float_t EcutMin );
121  void SetCurrentECutMax( Float_t EcutMax );
122 
123  Float_t GetCurrentECutMin() const;
124  Float_t GetCurrentECutMax() const;
125 
126  ClassDef(PSACrystal3D,0) // To get a 3D map of hits in a particular crystal
127 };
128 
129 
130 
131 class PSACrystal : public PSAWatcher, public CanvasVisu
132 {
133 protected:
134  static Float_t fgMetric;
135  static Float_t fRadius;
136  static Float_t fDepht;
137  static Int_t fNBinX;
138  static Int_t fNBinZ;
139  static Float_t fDefaultECutMin;
140  static Float_t fDefaultECutMax;
141 
142 protected:
144  TH1F * fE0;
145  TH1F * fE1;
146  TH1F * fT0;
147  TH1F * fT1;
148  TH2F * fTE0;
149  TH2F * fTE1;
150  TH1F * fEnergySeg;
151  TH1F * fNbHits;
152 
153  TH2F * fHitsSlices[6];
154 
155 protected:
158 
159 protected:
160  TObjArray *fSpectra;
161 
162 private:
163  unsigned int fNevts;
164  int fCrystalID;
165 
166 public:
167  PSACrystal(const char *name = "PSACrystal", const char *title = "Display the psa values for one crystal at the producer level", TDirectory *sp_dir=0x0, TDirectory *tag_dir=0x0);
168  virtual ~PSACrystal();
169 
170  void Exec(Option_t * /*option*/);
171 
172  Bool_t SetTrigger(ADF::DFTrigger* trigger );
173 
174  virtual void ShowSpectraMap(const char *option=""); //*MENU*
175  virtual void SetLoupe(bool loupeon = true){CanvasVisu::SetLoupe(loupeon);} //*MENU*
176 
177  void ShowCoreVsSumSeg(); //*MENU*
178 
179  void ShowTimeVsE(); //*MENU*
180 
181  void Show3DHits(); //*MENU*
183  void SetEnergyCut(Float_t EcutMin, Float_t EcutMax ); //*MENU* *ARGS={EcutMin=>fCurrentECutMin,EcutMax=>fCurrentECutMax}
184 
185  void SetCurrentECutMin( Float_t EcutMin );
186  void SetCurrentECutMax( Float_t EcutMax );
187 
188  Float_t GetCurrentECutMin() const;
189  Float_t GetCurrentECutMax() const;
190 
191  virtual void SetRange(double min, double max, const char *x_y_z = "y"){CanvasVisu::SetRange(min,max,x_y_z);} //*MENU*
192 
193  virtual void UnZoom(const char *x_y_z = "y"){CanvasVisu::Unzoom(x_y_z);} //*MENU*
194 
195  virtual void LogX(){CanvasVisu::LogX();} //*MENU*
196  virtual void LogY(){CanvasVisu::LogY();} //*MENU*
197  virtual void LogZ(){CanvasVisu::LogY();} //*MENU*
198 
199  virtual void Print(const char *option="") const; //*MENU*
200 
201  virtual void ShowCanvas(Option_t){}
202 
203  ClassDef(PSACrystal,0)
204 };
205 
206 #endif
207 
static Float_t fRadius
virtual void SetRange(double min, double max, const char *x_y_z="y")
static Int_t fNBinZ
Float_t fCurrentECutMin
static Float_t fDepht
TObjArray * fSpectra
virtual void LogX()
Definition: CanvasVisu.C:351
SharedFP * fFrame
virtual void UnZoom(const char *x_y_z="y")
virtual void SetRange(double min, double max, const char *x_y="x")
Definition: CanvasVisu.C:408
To get a 3D map of hits in a particular crystal.
PSAWatcher(const char *name, const char *title, TDirectory *sp_dir=0x0, TDirectory *tag_dir=0x0)
header file for PSAFrame.cpp
A Shared Frame Pointer.
Definition: Frame.h:597
virtual void LogY()
Definition: CanvasVisu.C:370
virtual ~PSAWatcher()
static Float_t fDefaultECutMin
Base class for a trigger on a data flow.
Definition: Trigger.h:155
virtual void Unzoom(const char *x_y_xy="xy")
Definition: CanvasVisu.C:299
TH3F * fH3DHitPosition
virtual void LogY()
Float_t fCurrentECutMax
static Int_t fNBinX
static Float_t fDefaultECutMax
Base Watcher working for any kind of Frame (Frame interface)
static Float_t fgMetric
PSA watcher class.
virtual void SetLoupe(bool loupeon=true)
virtual void ShowCanvas(Option_t)
virtual void LogX()
virtual void SetLoupe(bool loupeon=true)
Definition: CanvasVisu.C:646
virtual void LogZ()