GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ILLWatchers.h
Go to the documentation of this file.
1 
2 /***************************************************************************
3  * Copyright (C) 2010 by Olivier Stezowski *
4  * stezow(AT)ipnl.in2p3.fr *
5  * *
6  * This program is free software; you can redistribute it and/or modify *
7  * it under the terms of the GNU General Public License as published by *
8  * the Free Software Foundation; either version 2 of the License, or *
9  * (at your option) any later version. *
10  * *
11  * This program is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14  * GNU General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License *
17  * along with this program; if not, write to the *
18  * Free Software Foundation, Inc., *
19  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
20  ***************************************************************************/
21 
22 #ifndef _EXOILLWatchers
23 #define _EXOILLWatchers
24 
25 // NOMAD
26  #include "NOMADMap.h"
27 
28 // Watcher definition
29 #include "Watchers.h"
30 #include "TTreeWatchers.h"
31 
32 // ROOT definitions
33 #include "TH1.h"
34 #include "TH2.h"
35 #include "TRegexp.h"
36 #include "TList.h"
37 
38 using namespace ADF;
39 using namespace Gw;
40 
42 
47 class BaseEXOILLWatcher : public Watcher
48 {
49 protected:
50  NOMADMap fMap;
51 
52 protected:
55 
56 protected:
58  Bool_t fIsEvent;
59 
60 protected:
62  ULong64_t fCurrentTS;
64  UInt_t fNbSubEvent;
66  std::vector< NOMADEvent > fEvent;
68  std::vector< NOMADEvent *> fGEEvent;
69  std::vector< NOMADEvent *> fACEvent;
70  std::vector< NOMADEvent *> fLAEvent;
71 
72 public:
74  Watcher("BaseEXOILLWatcher","BaseEXOILLWatcher"),
75  fMap(),
76  fFrame(0x0),
77  fIsEvent(false),
78  fNbSubEvent(0u),
79  fEvent(0u),
80  fGEEvent(0u),
81  fACEvent(0u),
82  fLAEvent(0u)
83  { LoadConfig(); }
84  BaseEXOILLWatcher(const char *name, const char *title, TDirectory *sp_dir = 0x0, TDirectory *tag_dir = 0x0):
85  Watcher(name,title,sp_dir,tag_dir),
86  fFrame(0x0)
87  {;}
89  {;}
90 
91  virtual Bool_t LoadConfig(const Char_t *fname = "EXOILLWatcher.conf");
92 
94 
96  virtual Bool_t SetTrigger( ADF::DFTrigger * /*trigger*/ = 0x0 );
97 
98  virtual void Exec(Option_t * option="");
99 
100  ClassDef(BaseEXOILLWatcher,0) // Watcher on any kind of Frames
101 };
102 
104 
107 {
108  static const Int_t time_depth = 15; // have to be even
109 
110 private:
112  std::vector< ULong64_t > fTimelineUID;
114  std::pair<UShort_t, ULong64_t> fTimeline;
115 
116 private:
118  TH1 *fUIDDistri;
120  TH1 *fFoldDistri;
122  TObjArray fADCSpectra;
124  TObjArray fESpectra;
126  TObjArray fTSSpectra;
127 private:
129  Double_t fSigma;
130  Double_t fThreshold;
131 
132 protected:
133  void FindCo60(TH1 *h, TList &list_of_peaks);
134  void FindEu152(TH1 *h, TList &list_of_peaks, const TF1 *fcalib);
135  void FindBaCl2(TH1 *h, TList &list_of_peaks, const TF1 *fcalib);
136 
137  void Calibrate(TH1 *h, TF1 *function, const TList & peaks);
138 
139 public:
140  DoEXOILLCalib(const char *name, const char *title);
141  virtual ~DoEXOILLCalib()
142  {;}
143 
144  virtual void Exec(Option_t * option="");
145 
146  void ProcessDisplayPeaks(Int_t np_peaks, const Double_t peaks[], Option_t *fit);
147 
149 
153  void AlignTS(Option_t * opt = "dry", Option_t *algo = "mean"); // *MENU*
154 
156  void Calib(const Char_t *what_source = "Co60", Option_t * opt = "dry", Option_t* DefFileName = "CalibStorage.txt"); // *MENU*
157 
159  void SearchParameters(Double_t sig = 2.0, Double_t thre = 0.05); // *MENU*
160 
162  void DisplayPeaks(Option_t *opt = "BaCl", Option_t *fit = "fitted" ); // *MENU*
163 
165  void SaveMAP(const Char_t *fname = "NOMADMap.conf.new", Option_t *opt = ""); // *MENU*
166 
167  ClassDef(DoEXOILLCalib,0) // built spectra for calibration + method to calib
168 };
169 
171 
174 {
175 private:
177  TH1 *fFoldDistri;
179  TH2 *fGG;
181  TH2 *fGT;
183  TH2 *fUIDT;
185  TH2 *fUIDUID;
186 
188  TH2 *fGeELaE;
190  TH2 *fGeELaT;
191 
192 
193 public:
194  RawMatrices(const char *name, const char *title);
195  virtual ~RawMatrices()
196  {;}
197 
198  virtual void Exec(Option_t * option="");
199 
200  ClassDef(RawMatrices,0) // built gamma - gamma matrix
201 };
202 
204 
209 {
210 private:
211  static const Int_t fConditions = 1;
212 private:
213  std::vector< std::pair<Float_t, Float_t> > fListOfGates;
214 
215 private:
217  TH2 *fGG;
218 
219 public:
220  GatedGG(const char *name, const char *title);
221  virtual ~GatedGG()
222  {;}
223 
224  virtual void Exec(Option_t * option="");
225 
226  ClassDef(GatedGG,0) // built a gated gg matrix
227 };
228 
230 
234 {
235 private:
236  static const Int_t MaxGamma = 500;
237 
239  ULong64_t TS;
241  Int_t FOLD;
243  Int_t DT [MaxGamma];
244  Float_t E [MaxGamma];
245  Int_t ID [MaxGamma];
246 
247 protected:
248  virtual void SetBranches();
249 
250 public:
251  MyILLTree(const char *name, const char *title, TTree *tree = 0x0);
252  virtual ~MyILLTree()
253  {;}
254 
255  virtual void Exec(Option_t * option="");
256 
257  ClassDef(MyILLTree,0) // to build a TTree
258 };
259 
260 #endif
261 
virtual ~GatedGG()
Definition: ILLWatchers.h:221
virtual ~RawMatrices()
Definition: ILLWatchers.h:195
std::vector< NOMADEvent * > fACEvent
Definition: ILLWatchers.h:69
SharedFP * fFrame
the frame to be watched
Definition: ILLWatchers.h:54
Base class for a Watcher.
Definition: Watchers.h:60
Base class for a watcher for EXOGAM.
Definition: ILLWatchers.h:47
BaseEXOILLWatcher(const char *name, const char *title, TDirectory *sp_dir=0x0, TDirectory *tag_dir=0x0)
Definition: ILLWatchers.h:84
Base class for a Watcher that fill a TTree or some branches of a TTree.
Definition: TTreeWatchers.h:51
std::vector< NOMADEvent * > fGEEvent
subevent per type
Definition: ILLWatchers.h:68
virtual ~BaseEXOILLWatcher()
Definition: ILLWatchers.h:88
ULong64_t fCurrentTS
Global TS for the current event.
Definition: ILLWatchers.h:62
Base class for building control spectra and calibrate.
Definition: ILLWatchers.h:106
Built some correlation matrices.
Definition: ILLWatchers.h:173
A Shared Frame Pointer.
Definition: Frame.h:597
std::vector< NOMADEvent * > fLAEvent
Definition: ILLWatchers.h:70
Base class for a trigger on a data flow.
Definition: Trigger.h:155
Shows how to save data in a TTree.
Definition: ILLWatchers.h:233
build a gated matrix
Definition: ILLWatchers.h:208
virtual ~MyILLTree()
Definition: ILLWatchers.h:252
std::vector< NOMADEvent > fEvent
subevents
Definition: ILLWatchers.h:66
virtual ~DoEXOILLCalib()
Definition: ILLWatchers.h:141
UInt_t fNbSubEvent
number of subevents read from fFrame
Definition: ILLWatchers.h:64
Bool_t fIsEvent
true is the frame contains and event i.e. if frame version is 0,1. false if frame version is 0...
Definition: ILLWatchers.h:58