GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LNL/EventPSAWatchers.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 _EventPSAWatchers
22 #define _EventPSAWatchers
23 
24 // Gw and Watcher definition
25 #ifndef Gw_Watchers
26 #include "Watchers.h"
27 #endif
28 
29 // ADF definitions
30 #ifndef ADF_CompositeFrame
31 #include "CompositeFrame.h"
32 #endif
33 
34 #ifndef ADF_PSAFrame
35 #include "PSAFrame.h"
36 #endif
37 
38 // ROOT definitions
39 #ifndef ROOT_ArrayI
40 #include "TArrayI.h"
41 #endif
42 
43 #ifndef ROOT_TH2F
44 #include "TH2F.h"
45 #endif
46 #include "TH3F.h"
47 
48 #ifndef ROOT_TVirtualPad
49 #include "TVirtualPad.h"
50 #endif
51 
52 #ifndef Gw_AgataEventDisplay
53 #include "AgataEventDisplay.h"
54 #endif
55 
56 #ifndef Gw_AgataEventContainer
57 #include "AgataEventContainer.h"
58 #endif
59 
60 #ifndef Gw_AgataGeometryTransformer
62 #endif
63 #include "MetaFrame.h"
64 
65 class TObjArray;
66 class TPaveText;
67 class TLatex;
68 class VertexBuilder;
69 
70 using namespace ADF;
71 using namespace Gw;
72 
73 class TTimer;
75 
78 class EventPSAWatcher : public WatcherWithTag
79 {
80 protected:
82  Frame *fPSAFrame;
83 
84 protected:
86  SharedFP *fFrame;
87 
88 protected:
90  UInt_t GetNbFramePSA();
91 
93  PSAInterface *GetDataPSA(UInt_t which);
94 
95 public:
96  EventPSAWatcher(const char *name, const char *title, TDirectory *sp_dir = 0x0, TDirectory *tag_dir = 0x0) :
97  WatcherWithTag(name,title,sp_dir,tag_dir),
98  fPSAFrame(0x0),
99  fFrame(0x0)
100  {;}
102  {
103  if (fPSAFrame)
104  delete fPSAFrame;
105  fPSAFrame = 0x0;
106  }
107 
109 
112  virtual Bool_t SetTrigger( ADF::DFTrigger */*trigger*/ = 0x0 );
113 
114  ClassDef(EventPSAWatcher,0) // Trigger on tracked Frame
115 };
116 
118 
127 class HitsSpectra : public EventPSAWatcher
128 {
129  static const UShort_t gNbCrys = 50u;
130 
131 private:
132  VertexBuilder *fVertexBuilder;
133 
134 protected:
135  AgataGeometryTransformer *fTrans;
136 
137 protected:
139  TObjArray fSpectra;
140  TObjArray fSpectraDoppler;
141 
143  TH1 *fCoreCommon;
144  TH1 *fSumSpectra;
145 
146  TH2 *fGxG;
147  TH2 *fGxT;
149  TH1 *fCoreCommonDoppler;
150  TH2 *fGxGDoppler;
151 
152  TH1 *fFold;
153 
155  TH1F *fDistri;
156  TH3F *fPosXYZ;
157  TH3F *fPosXYZ_Ta;
158 
159 protected:
161  virtual void DoCanvas(TCanvas *c, Option_t *);
162 
163 protected:
165  virtual Double_t DoDopplerCorrection(const TrackedHit *hit, VertexInterface *vertex);
166 
167 public:
168  HitsSpectra(const char *name, const char *title, TDirectory *sp_dir = 0x0, TDirectory *tag_dir = 0x0);
169  virtual ~HitsSpectra();
170 
172  virtual void Exec(Option_t *option="");
173 
174  ClassDef(HitsSpectra,0) // Gamma-rays spectra using hits
175 };
176 
178 
180 class HitDisplay3D : public EventPSAWatcher
181 {
182 
183 private:
184  AgataGeometryTransformer* fTrans;
185 
186  Int_t fMaxCycle;
187 
188  const Char_t* fPathFile;
189  static Float_t fgMetric;
190 
191 protected:
193  virtual void DoCanvas(TCanvas *c, Option_t *);
194 
195 public:
196  HitDisplay3D(const char *name, const char *type, TDirectory *sp_dir = 0x0, TDirectory *tag_dir = 0x0);
197  virtual ~HitDisplay3D();
198 
200  virtual void Exec(Option_t *option="");
201 
203  virtual void ShowEve(const Char_t* agataPathFile); //*MENU* *GETTER=GetPathFile* *ARGS={agataPathFile=>fPathFile}*
204 
206  void SetActive(Bool_t active = true); //*TOGGLE*
207 
209  virtual void SetMaxCycle(Int_t cycle) { fMaxCycle = cycle; } //*MENU*
210 
212  virtual Int_t GetMaxCycle() { return fMaxCycle; }
213 
215  virtual const Char_t* GetPathFile() const { return fPathFile; }
216 
217  ClassDef(HitDisplay3D,0) // psa display
218 };
219 
220 class TGToolTip;
221 class TBox;
222 class TObject;
224 
235 class RateDisplay : public EventPSAWatcher
236 {
237 private:
238 
239  TObjArray* fSectorList; // container of detector sector Polyline
240 
241  TObjArray* fLabelList; // container of label crystal PaveText
242 
243  TObjArray* fRateList; // container of rate sector Polyline
244 
245  AgataGeometryTransformer* fTransf; // geometry transformer
246 
247  TArrayI* fCountArray[7]; // count array for each sector for a given depth
248 
249  TArrayI* fCountMax; // max count per crystal
250 
251  Int_t fCountCoreMax; // max count for core
252 
253  Int_t fCountMaxAll; // max count in all cristals
254 
255  Int_t fCurrentCycle; // current number of cycles
256 
257  Int_t fMaxCycle; // maximum number of cycles before resetting histo
258 
259  Int_t fDepth; // depth number of the crystal
260 
261  Bool_t fNormByAll; // fNorm: true, count normalized by the maximum of all cristals; false, normalized per cristal
262 
263  TTimer* fTimer; // timer
264 
265  Long_t fRefresh; // time lapse between two depth refreshes in seconds
266 
267  TLatex* fDepthText; // text for depth
268 
269  Int_t fLastX; // last position of mouse in X
270 
271  Int_t fLastY; // last position of mouse in Y
272 
273  TBox* fBox; // just a box for tool tip
274 
275  TGToolTip* fInfoTip; // info tool tip
276 
277 
278  TH1I* fHistoCntCrystal; // number of counts per crystal
279 
280  TH1I* fHistoCntSlice[180*6*6]; // number of counts in each detector per depth and per sector
281 
282 private:
283  const ADF::NamedItem<UShort_t>* fCrysID;
284  const ADF::NamedItem<Float_t>* fCoreE1;
285 
286 private:
287  static const Double_t fgkDRho; // distance between two crystal
288  static const Double_t fgkRho1; // inner radius of the sector
289  static const Double_t fgkRho2; // outer radius of the sector
290  static const Double_t fgkDRange; // range of the pad
291  static const Int_t fgkNofPoints; // number of points of the polyline for a sector
292  static const Int_t fgkNofSectors; // total number of sectors
293  static const Int_t fgkNofCrystals;// total number of crystals
294  static const Int_t fgkNofSlices; // total number of slices (= number of depths-1, depth = 0 for core)
295  static const Int_t fgkNDivX; // number of clusters displayed in X
296  static const Int_t fgkNDivY; // number of clusters displayed in Y
297 
298 protected:
300  virtual void DoCanvas(TCanvas* canvas, Option_t* option);
301 
303  void AddCluster(Double_t xOffset = 0, Double_t yOffset = 0);
304 
306  void AddCristals(Double_t xPos = 0, Double_t yPos = 0);
307 
309  void AddRates();
310 
311 public:
312  RateDisplay(const Char_t *name, const Char_t *title, TDirectory *sp_dir = 0x0, TDirectory *tag_dir = 0x0);
313  virtual ~RateDisplay();
314 
316  virtual void Exec(Option_t *option="");
317 
319  virtual void SetDepth(Int_t depth = 1, Bool_t stop = true); //*MENU*
320 
322  virtual Int_t GetDepth() { return fDepth; }
323 
325  virtual void SetNormalization(Bool_t norm) {fNormByAll = norm;} //*TOGGLE* *ARGS={norm=>fNormByAll} *GETTER=IsNormByAll
326 
328  virtual Bool_t IsNormByAll() {return fNormByAll;}
329 
331  virtual void SetMaxCycle(Int_t cycle) { fMaxCycle = cycle; } //*MENU*
332 
334  virtual Int_t GetMaxCycle() { return fMaxCycle; }
335 
337  void SetRefresh(Long_t r); //*MENU*
338 
340  virtual Long_t GetRefresh() { return fRefresh; }
341 
343  void UpdateRates();
344 
346  void UpdateCanvas();
347 
349  void Reset();
350 
352  virtual void Zero(Option_t *hname="pool", Option_t *binning=""); //*MENU*
353 
355  virtual Bool_t SetTrigger( ADF::DFTrigger */*trigger*/ = 0x0 );
356 
358  void HandleMovement(Int_t eventType, Int_t eventX, Int_t eventY, TObject* select);
359 
360  ClassDef(RateDisplay,0) // rate display
361 };
362 
363 #endif
364 
virtual Int_t GetMaxCycle()
Get max cycle.
virtual Int_t GetMaxCycle()
Get max cycle.
virtual Int_t GetDepth()
Get depth.
Interface for any watcher that is a VertexBuilder.
Base class for a Frame.
Definition: Frame.h:73
virtual const Char_t * GetPathFile() const
Get Prima conf file.
AgataGeometryTransformer class that manage geometry transformations.
virtual Bool_t IsNormByAll()
return normalization
EventPSAWatcher(const char *name, const char *title, TDirectory *sp_dir=0x0, TDirectory *tag_dir=0x0)
virtual void SetMaxCycle(Int_t cycle)
Set max cycle.
header file for PSAFrame.cpp
Show rates (counts) per Crystal.
It is a hit associated to a list of Hits.
Definition: Hits.h:256
virtual void SetNormalization(Bool_t norm)
Set normalization of counts per all crystals (true) or per each crystal (false)
A Shared Frame Pointer.
Definition: Frame.h:597
virtual void SetMaxCycle(Int_t cycle)
Set max cycle, before resetting buffer.
*********************************** HitsSpectra Class **************************************/// ...
Base class for a trigger on a data flow.
Definition: Trigger.h:155
header file for MetaFrame.cpp
virtual Long_t GetRefresh()
Get Refresh.
*********************************** EventPSAWatcher Class **************************************/// ...