GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ADTree.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 _ADTree
22 #define _ADTree
23 
24 #include "TTreeWatchers.h"
25 #include "Watchers.h"
26 #include "TrackedWatchers.h"
27 #include "EventPSAWatchers.h"
28 #include "PSAWatchers.h"
29 #include "CrystalWatchers.h"
30 #include "EventWatchers.h"
31 
32 #include "AgataKeyFactory.h"
33 
35 
41 class ADKeyTree : public Watcher, public TTreeBuilder
42 {
43 private:
45  SharedFP *fFrame;
47  const AgataKey *fKey;
48 private:
50  UInt_t fEventNumber; // Event Numver
51  ULong64_t fTimestamp; // Timestamp
52 
53 protected:
55  virtual void SetBranches();
56 
57 public:
58  ADKeyTree(const char *name, const char *title, TTree *tree = 0x0);
59  virtual ~ADKeyTree()
60  {;}
61 
63  virtual Bool_t SetTrigger( ADF::DFTrigger * /*trigger*/ = 0x0 );
64 
66  virtual void Exec(Option_t *option="");
67 
68  ClassDef(ADKeyTree,0) // built a root tree for the key part
69 };
70 
71 
72 //#define CHECK_COMMISSIONING_GANIL
73 
75 
77 class ADTrackTree : public TrackedWatcher, public TTreeBuilder
78 {
79 private:
81  VertexBuilder *fVertexBuilder;
82 
83 protected:
84  ULong64_t fTimestamp;
85 
86 private:
87  static const Int_t MaxGamma = 500;
88 
89  Int_t nbTrack; // Current number of tracked gamma-rays
90  Float_t trackE[MaxGamma]; // Energies of the tracked gamma
91  Float_t trackEDC[MaxGamma]; // Energies with Doppler Correction
92  Float_t trackX1[MaxGamma]; // X position of the first interaction point
93  Float_t trackY1[MaxGamma]; // Y position of the first interaction point
94  Float_t trackZ1[MaxGamma]; // Z position of the first interaction point
95  Float_t trackX2[MaxGamma]; // X position of the second interaction point. Used for polarisation
96  Float_t trackY2[MaxGamma]; // Y position of the second interaction point. Used for polarisation
97  Float_t trackZ2[MaxGamma]; // Z position of the second interaction point. Used for polarisation
98  Float_t trackXS[MaxGamma]; // X position of the source emitting g-rays. To check things
99  Float_t trackYS[MaxGamma]; // Y position of the source emitting g-rays. To check things
100  Float_t trackZS[MaxGamma]; // Z position of the source emitting g-rays. To check things
101  Float_t cosTheta[MaxGamma]; // cosTheta between recoil and gamma
102 
103  Float_t trackT[MaxGamma]; // time of the track gamma
104  Int_t trackCrystalID[MaxGamma]; // CrystalID of the first interaction point of the track
105 
106 #ifdef CHECK_COMMISSIONING_GANIL
107  static const Int_t MaxG = 45;
108  Float_t Eg[MaxG];
109  Float_t Eg1[MaxG];
110  Float_t EgA[MaxG];
111 #endif
112 
113 protected:
114  virtual void SetBranches();
115 
116 public:
117  ADTrackTree(const char *name, const char *title, TTree *tree = 0x0);
118  virtual ~ADTrackTree();
119 
121  virtual void Exec(Option_t *option="");
122 
123  ClassDef(ADTrackTree,0) // built a root tree for the gamma part
124 };
125 
127 
129 class ADHitTree : public EventPSAWatcher, public TTreeBuilder
130 {
131 private:
133  VertexBuilder *fVertexBuilder;
134 
135 protected:
137  ULong64_t fTimestamp;
140 
141 private:
142  static const Int_t MaxHits = 500; // Max number of hits in one event
143  static const Int_t MaxCore = 180; // Max number of cores in one event
144 
145  //
146  Int_t nbHits; // Number of hits in the array
147  Float_t ESum; // Sum of all hit (for calorimeter mode)
148  Float_t hitE[MaxHits]; // Energie of the hit
149  Float_t hitX[MaxHits]; // X position of the hit in the Crystal Frame
150  Float_t hitY[MaxHits]; // Y position of the hit in the Crystal Frame
151  Float_t hitZ[MaxHits]; // Z position of the hit in the Crystal Frame
152  Float_t hitGX[MaxHits]; // Position x of hit with , in global frame
153  Float_t hitGY[MaxHits]; // Position y of hit with , in global frame
154  Float_t hitGZ[MaxHits]; // Position z of hit with , in global frame
155  Int_t hitId[MaxHits]; // Segment ID in which a hit occurs
156  Int_t hitSg[MaxHits]; // Crystal ID in which a hit occurs
157  //
158  Int_t nbCores; // for more than 1 frame (built event)
159  Int_t coreId[MaxCore]; // for each crystal fired its ID
160  Float_t coreE0[MaxCore]; // Core energie, high gain ... TODO, Should be one !
161  Float_t coreE1[MaxCore]; // Core energie, low gain ... TODO, Should be one !
162  Float_t coreT0[MaxCore];
163  Float_t coreT1[MaxCore];
164  Float_t coreDE0[MaxCore]; // Doppler with position from Hit with Max E
165  Float_t coreDE1[MaxCore]; // Doppler with position from Hit with Max E
166  //
167  Float_t velDop[MaxCore]; // Beta for the doppler correction
168  Int_t hit_per_cryst[MaxCore]; // Number of hits for each cryst ID i.e. dans each data:psa frames
169 
170 private:
171  // Spectra on the Hit tree. Used here since no tracking yet.
172  TH1 *fIdSpectra;
173  TH1 *fSumSpectra;
174  TH3F *fhitAgata; // spectra with some position in agata ref: wall, target, Gamma
175 
176 protected:
178  virtual Double_t DoDopplerCorrection(const TrackedHit *hit, VertexInterface *vertex);
179  //
180  virtual void SetBranches();
181 
182 public:
183  ADHitTree(const char *name, const char *title, TTree *tree = 0x0);
184  virtual ~ADHitTree();
185 
187  virtual void Exec(Option_t *option="");
188 
190  void FillSpectraByUser();
191 
192  ClassDef(ADHitTree,0) // built a root tree for the gamma part
193 };
194 
196 
198 class ADCoincTree : public EventWatcher, public TTreeBuilder
199 {
200 protected:
201  Float_t fTSCoinc;
202 
203 protected:
204  virtual void SetBranches();
205 
206 public:
207  ADCoincTree(const char *name, const char *title, TTree *tree = 0x0);
208  virtual ~ADCoincTree();
209 
211  virtual void Exec(Option_t *option="");
212 
213  ClassDef(ADCoincTree,0) // quantities compted from coincidences between agata and ancillary
214 };
215 
216 
217 class ADPSAHitTree : public PSAWatcher, public TTreeBuilder
218 {
219 
220 protected:
222  ULong64_t fTimestamp;
223  Int_t fEfvtNbr;
224 
225 private:
226  static const Int_t MaxHits = 500;
227 
228  Int_t number_of_hits; // Number of hits in the array
229  Float_t hitE[MaxHits]; // Energie of the hit
230  Float_t hitX[MaxHits]; // X position of the hit in the Crystal Frame
231  Float_t hitY[MaxHits]; // Y position of the hit in the Crystal Frame
232  Float_t hitZ[MaxHits]; // Z position of the hit in the Crystal Frame
233  Int_t hitSg[MaxHits]; // Crystal ID in which a hit occurs
234  Float_t coreE0; // Core energie, high gain ... TODO, Should be one !
235  Float_t coreE1; // Core energie, low gain ... TODO, Should be one !
236  Float_t coreT0; // Core time, high gain ... TODO, Should be one !
237  Float_t coreT1; // Core time, low gain ... TODO, Should be one !
238 
239 protected:
240  virtual void SetBranches();
241 
242 public:
243  ADPSAHitTree(const char *name, const char *title, TTree *tree = 0x0);
244  virtual ~ADPSAHitTree();
245 
247  virtual void Exec(Option_t *option="");
248 
250  void FillSpectraByUser();
251 
252  virtual void Print(Option_t *option="") const; //*MENU*
253 
254  ClassDef(ADPSAHitTree,0) // built a root tree for the gamma part
255 };
256 
257 
258 class ADCrystalTree : public ShowSignals, public TTreeBuilder
259 {
260 public:
263  static const int kNSamples = 100;
264 
265 protected:
267  ULong64_t fTimestamp;
268  Int_t fEfvtNbr;
269 
270 private:
271  Float_t SegmentTraces[kNSG*kNSamples];
272  Float_t CoreTraces[kNCC*kNSamples];
273 
274  Double_t SegBaselines[kNSG];
275  Double_t CoreBaselines[kNCC];
276 
277  Double_t SegE[kNSG];
278  Double_t CoreE[kNCC];
279 
280 protected:
281  virtual void SetBranches();
282 
283 public:
284  ADCrystalTree(const char *name, const char *title, TTree *tree = 0x0);
285  virtual ~ADCrystalTree();
286 
288  virtual void Exec(Option_t *option="");
289 
291  void FillSpectraByUser();
292 
293  void ConvertInGraph(TH1 *h, TGraph *g);
294 
295  virtual void Print(Option_t *option="") const; //*MENU*
296 
297  ClassDef(ADCrystalTree,0) // built a root tree for the gamma part
298 };
299 
300 #endif
301 
Float_t fTSCoinc
Definition: ADTree.h:201
ADCrystalTree(const char *name, const char *title, TTree *tree=0x0)
Definition: ADTree.C:632
virtual ~ADPSAHitTree()
Definition: ADTree.C:563
virtual void Exec(Option_t *option="")
watch the current frame
Definition: ADTree.C:65
virtual void SetBranches()
Definition: ADTree.C:518
Interface for any watcher that is a VertexBuilder.
virtual void SetBranches()
Definition: ADTree.C:657
virtual void Exec(Option_t *option="")
watch the current frame
Definition: ADTree.C:524
ULong64_t fTimestamp
Current timestamp.
Definition: ADTree.h:137
ULong64_t fTimestamp
Definition: ADTree.h:84
Int_t fEfvtNbr
Definition: ADTree.h:268
static const UShort_t kNbCores
Definition: CrystalFrame.h:110
ADCoincTree(const char *name, const char *title, TTree *tree=0x0)
Definition: ADTree.C:506
virtual void Exec(Option_t *option="")
watch the current frame
Definition: ADTree.C:341
Interface to AgataKey.
virtual void Print(Option_t *option="") const
Definition: ADTree.C:617
void FillSpectraByUser()
Filling the spectra.
Definition: ADTree.C:499
virtual void Exec(Option_t *option="")
watch the current frame
Definition: ADTree.C:583
virtual void SetBranches()
Definition: ADTree.C:99
Int_t fEfvtNbr
Definition: ADTree.h:223
AgataGeometryTransformer class that manage geometry transformations.
void FillSpectraByUser()
Filling the spectra.
Definition: ADTree.C:612
AgataGeometryTransformer * fTrans
used to transform local to global [since otherwise done in tracking]
Definition: ADTree.h:139
Base class for a Watcher.
Definition: Watchers.h:60
ADHitTree(const char *name, const char *title, TTree *tree=0x0)
Definition: ADTree.C:272
ULong64_t fTimestamp
Current timestamp.
Definition: ADTree.h:267
ULong64_t fTimestamp
Current timestamp.
Definition: ADTree.h:222
AD ROOT TTree branches for the hit part.
Definition: ADTree.h:129
Base class for a Watcher that fill a TTree or some branches of a TTree.
Definition: TTreeWatchers.h:51
AGATA Default Ket Tree.
Definition: ADTree.h:41
virtual void SetBranches()
Definition: ADTree.C:313
virtual void SetBranches()
add branches to the ttree.
Definition: ADTree.C:59
Base Watcher working for any event:data.
built branches for coincidence between agata and ancillary
Definition: ADTree.h:198
header file for AgataKeyFactory.cpp
virtual ~ADHitTree()
Definition: ADTree.C:309
ADPSAHitTree(const char *name, const char *title, TTree *tree=0x0)
Definition: ADTree.C:554
To work on Signals.
virtual Double_t DoDopplerCorrection(const TrackedHit *hit, VertexInterface *vertex)
Do Doppler taking into account additionnal offset of the agata position (see SetAgataOffset) ...
Definition: ADTree.C:474
virtual ~ADKeyTree()
Definition: ADTree.h:59
It is a hit associated to a list of Hits.
Definition: Hits.h:256
A Shared Frame Pointer.
Definition: Frame.h:597
void ConvertInGraph(TH1 *h, TGraph *g)
Definition: ADTree.C:722
virtual void Exec(Option_t *option="")
watch the current frame
Definition: ADTree.C:132
Base class for a trigger on a data flow.
Definition: Trigger.h:155
ADKeyTree(const char *name, const char *title, TTree *tree=0x0)
Definition: ADTree.C:31
ADTrackTree(const char *name, const char *title, TTree *tree=0x0)
Definition: ADTree.C:86
static const int kNSamples
Definition: ADTree.h:263
AD ROOT TTree branches for the tracked part.
Definition: ADTree.h:77
static const int kNCC
Definition: ADTree.h:261
void FillSpectraByUser()
Filling the spectra.
Definition: ADTree.C:730
virtual void Print(Option_t *option="") const
Definition: ADTree.C:735
static const int kNSG
Definition: ADTree.h:262
*********************************** EventPSAWatcher Class **************************************/// ...
virtual ~ADCoincTree()
Definition: ADTree.C:514
virtual Bool_t SetTrigger(ADF::DFTrigger *=0x0)
set the trigger on the main Frame whatever it is
Definition: ADTree.C:40
Base Watcher working for any kind of Frame (Frame interface)
static const UShort_t kNbSegments
Definition: CrystalFrame.h:110
Base Watcher working for any kind of Trackek Frame (Frame interface) and.
virtual void SetBranches()
Definition: ADTree.C:567
virtual ~ADTrackTree()
Definition: ADTree.C:126
virtual void Exec(Option_t *option="")
watch the current frame
Definition: ADTree.C:672
virtual ~ADCrystalTree()
Definition: ADTree.C:653