GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LLaBr3Watchers.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 _LLaBr3Watchers
22 #define _LLaBr3Watchers
23 
24 // root includes
25 #include "TRotation.h"
26 #include "TH3.h"
27 #include "TString.h"
28 #include "TVector3.h"
29 
30 // Gw and Watcher definition
31 #include "TTreeWatchers.h"
32 #include "RancLegnaroWatchers.h"
33 
34 // a simple structure that kept all the information for one LaBr3 module
35 struct MyLLaBr3 {
36 
37  // position in beam reference system
38  TVector3 P;
39 
40  // time and amplitude
41  Double_t T;
42  Double_t E;
43 
44  // threshold to
47 
48  // status flag to know if the detector has fired
49  Bool_t has_fired;
50 
51  // used for calibration
52  Double_t A, B, C;
53 
54  MyLLaBr3() :
55  P(),
56  T(0.0),
57  E(0.0),
58  threshold_adc_min(200),
59  threshold_adc_max(20000),
60  has_fired(false),
61  A(0.0), B(1.0), C(0.0) {;}
62 
63  // apply calibration, set is_fired to false if not a good event (i.e in threshold)
64  void Calibrate () ;
65 };
66 
68 
72 {
73 public:
74  // number of modules compositng
75  static const Short_t gMaxNumberOfModules = 10;
76  // number of items per module (E,T)
77  static const Short_t gNumberOfItems = 2;
78  // table to get for each items the position in the rawBuf vector
80  // init table to default
81  static void InitLUT();
82 
83 protected:
84  // number of module for the current setting
86  // one structure per module
88 
89 public:
90  BaseLLaBr3Watcher(const char *, const char *, TDirectory *sp_dir = 0x0, TDirectory *tag_dir = 0x0);
91  virtual ~BaseLLaBr3Watcher();
92 
93  // (re)load the current configuration
94  Bool_t LoadCalibration(const char *calib_file = "LLaBr3.conf"); //*MENU*
95 
97  virtual void Exec(Option_t *option="");
98 
99  ClassDef(BaseLLaBr3Watcher,0) // Base classe for LaBr3 modules as ancillary of AGATA through AGAVA
100 };
101 
103 {
104 private:
105  VertexBuilder *fVertexBuilder;
106 
107 protected:
108  // histograms to check if everything is all right
109  // how many channels fired
110  TH1F *fCounts;
111  TH1F *fHitPattern;
112  TObjArray fE_no_doppler;
113  TObjArray fE_doppler;
114  TObjArray fT;
115 
116 protected:
118  virtual void DoCanvas(TCanvas *c, Option_t *o);
119 
120 public:
121  DisplayLLaBr3(const char *, const char *, TDirectory *sp_dir = 0x0, TDirectory *tag_dir = 0x0);
122  virtual ~DisplayLLaBr3();
123 
125  virtual void Exec(Option_t *option="");
126 
127  ClassDef(DisplayLLaBr3,0) //
128 };
129 
131 {
132 private:
133  Int_t fNbLaBr3;
134 
135  UShort_t fWhichLaBr3[gMaxNumberOfModules]; //[fNbModule]
136 
137  Float_t fELaBr3[gMaxNumberOfModules]; //[fNbModule]
138  Float_t fTLaBr3[gMaxNumberOfModules]; //[fNbModule]
139 
140 protected:
141  virtual void SetBranches();
142 
143 public:
144  MyLLaBr3Tree(const char *name, const char *title, TTree *tree = 0x0);
145  ~MyLLaBr3Tree();
146 
148  virtual void Exec(Option_t *option="");
149 
150  ClassDef(MyLLaBr3Tree,0) // Built the Dante Branch
151 };
152 
153 
154 #endif
155 
Double_t C
Int_t threshold_adc_max
MyLLaBr3Tree(const char *name, const char *title, TTree *tree=0x0)
static const Short_t gNumberOfItems
MyLLaBr3 fLaBr3[gMaxNumberOfModules]
Interface for any watcher that is a VertexBuilder.
Double_t B
Bool_t has_fired
virtual ~DisplayLLaBr3()
TVector3 P
virtual ~BaseLLaBr3Watcher()
Base classe for LaBr3.
Base for a watcher on an ancillary (raw) frame.
static Short_t gLUT[gNumberOfItems][gMaxNumberOfModules]
static void InitLUT()
Double_t A
virtual void Exec(Option_t *option="")
watch the current frame
virtual void Exec(Option_t *option="")
watch the current frame
Base class for a Watcher that fill a TTree or some branches of a TTree.
Definition: TTreeWatchers.h:51
virtual void Exec(Option_t *option="")
watch the current frame
Double_t E
DisplayLLaBr3(const char *, const char *, TDirectory *sp_dir=0x0, TDirectory *tag_dir=0x0)
static const Short_t gMaxNumberOfModules
Double_t T
BaseLLaBr3Watcher(const char *, const char *, TDirectory *sp_dir=0x0, TDirectory *tag_dir=0x0)
Short_t fNumberOfModules
virtual void DoCanvas(TCanvas *c, Option_t *o)
To be overwritten by real implementation if a canvas is produced.
Int_t threshold_adc_min
TObjArray fE_no_doppler
void Calibrate()
virtual void SetBranches()
TObjArray fE_doppler
Bool_t LoadCalibration(const char *calib_file="LLaBr3.conf")