GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GANILWatchers.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (c) IPNL, IN2P3, CNRS *
3  * Contibutor(s) : *
4  * Olivier Stezowski stezow(AT)ipnl.in2p3.fr [2014] *
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 
24 #ifndef _GANILWatchers
25 #define _GANILWatchers
26 
27 // Gw and Watcher definition
28 #include "WatchersConfig.h"
29 #include "Watchers.h"
30 #include "TTreeWatchers.h"
31 
32 #include "TH2.h"
33 
34 // Defines required at the VAMOS level
35 #define WITH_MFM
36 #define WITH_ROOT
37 
38 class MFMCommonFrame;
39 class MFMEbyedatFrame;
40 class MFMMergeFrame;
41 class DataParameters;
42 
44 
50 {
51 public:
54 
56  std::string gActionDefault;
57 
58 protected:
61 
62 protected:
64  MFMCommonFrame *fMFMFrame;
65 
67  MFMEbyedatFrame *fEBYFrame;
68  MFMCommonFrame *fInsideFrame;
69  MFMMergeFrame *fMergedFrame;
70 
71 protected:
73  Int_t fEGTYPE;
74 
75 protected:
77  DataParameters *fDataParameters;
79  std::string fActionCurrent;
80 
81 public:
83  virtual ~ GANILInterface();
84 
86  virtual Int_t ReadActionFile(std::string full_name_of_action_file = "");
87 
89  Bool_t ADF2MFM();
90 };
91 
92 
94 
100 {
101 protected:
102  TH1I *fFrameType;
103  TH1I *fFrameSize;
104 
105 protected:
106  TH2I *fParXValue;
109 
110 protected:
112  virtual void DoCanvas(TCanvas *c, Option_t *);
113 
114 public:
115  std::string gActionDefault;
116 
117 public:
118  MFMWatcher(const char *, const char *, TDirectory *sp_dir = 0x0, TDirectory *tag_dir = 0x0);
119  virtual ~MFMWatcher();
120 
122  virtual Bool_t SetTrigger( ADF::DFTrigger * /*trigger*/ = 0x0 );
123 
125  virtual Int_t ReadActionFile(std::string full_name_of_action_file = ""); // *MENU*
126 
128  virtual void Exec(Option_t *option="");
129 
130  ClassDef(MFMWatcher,0) // Watcher for MFM Frames
131 };
132 
134 
139 {
140 public:
141  static const Int_t MaxValues = 10000;
142 
143 private:
144  Int_t fNbValues; // number of values for the current event
145  UInt_t fValues[MaxValues]; // values of the current event
146  UInt_t fLabels[MaxValues]; // corresponding labels
147 
148 protected:
149  virtual void SetBranches();
150 
151 public:
152  RawMFMTree(const char *name, const char *title, TTree *tree = 0x0);
153  virtual ~RawMFMTree()
154  {;}
155 
157  virtual Bool_t SetTrigger( ADF::DFTrigger * /*trigger*/ = 0x0 );
158 
160  virtual void Exec(Option_t *option="");
161 
162  ClassDef(RawMFMTree,0) // Set/fill branch with raw DATA from GANIL
163 };
164 
165 #include "PSAFrame.h"
166 #include "CanvasVisu.h"
167 
169 
173 {
174 protected:
179 
180 protected:
182  UInt_t GetNbFramePSA();
184  ADF::PSAInterface *GetDataPSA(UInt_t which);
185 
186 protected:
190  std::vector <TH2 *> fGAGATAxGVAMOS;
199  TH1 *fTOF;
200 
201 protected:
202  // Some useful label to make coincidence
203  std::vector< std::pair<Int_t,ULong64_t> > fVTS;
204  std::vector< std::pair<Int_t,ULong64_t> > fT;
205  std::pair<Int_t,ULong64_t> fRawToF;
206  std::pair<Int_t,ULong64_t> fMW05;
207  std::vector< std::pair<std::pair<Int_t,Int_t>,Float_t> > fAGATAE;
208 
209 protected:
210  ULong64_t fFirstVTS;
211  ULong64_t fFirstCentrum;
212 
213  double fLastVTS;
214  double fLastCentrum;
215 
216 private:
217  unsigned int fNevts;
218  unsigned int fNVTSRev;
219  unsigned int fNCentrumRev;
220 
221  TH1F *fTimeStampSpread;
222 
223 
224 protected:
225  // //! To be overwritten by real implementation if a canvas is produced.
226  // virtual void DoCanvas(TCanvas *c, Option_t *);
227 
228 public:
229  AGATAVAMOSCoinc(const char *, const char *, TDirectory *sp_dir = 0x0, TDirectory *tag_dir = 0x0);
230  virtual ~AGATAVAMOSCoinc();
231 
232  void ShowCrystalSpectra(); //*MENU*
233  void ShowTimeCoinc(); //*MENU*
234  void ShowCoreCommomAndSumSpectra(); //*MENU*
235 
236  virtual void Print(Option_t *option="") const; //*MENU*
237 
239  virtual Bool_t SetTrigger( ADF::DFTrigger * /*trigger*/ = 0x0 );
240 
242  virtual void Exec(Option_t *option="");
243 
244  ClassDef(AGATAVAMOSCoinc,0) // Watcher for MFM Frames
245 };
246 
247 #ifdef HAS_VAMOS
248 
249 // detectors definitions
250 #include "DetectorsDefs.hh"
251 #include "Identification.hh"
252 #include "TimeStamp.hh"
253 #include "TargetPos.hh"
254 
255 class Parameters;
256 class Map;
257 class HistoManager;
258 class Analysis;
259 class LogManager;
260 class MOFile;
261 class BashColor;
262 
264 
267 //class VAMOSWatcher : public Gw::TTreeWithConditions, public GANILInterface
268 class VAMOSWatcher : public Gw::Watcher, public GANILInterface, public Gw::TTreeBuilder
269 {
270 private:
271  // Managers or equivalent
273  Parameters *PL;
275  Map *M;
277  HistoManager *H;
279  Analysis *An;
281  LogManager *LM;
283  MOFile *L;
284 
285  BashColor *fBashColor;
286 
287 protected:
288  // Detectors
289 #ifdef D_ID
290  Identification* Id;
291 #endif
292 #ifdef D_AGATA
293  TimeStamp *LTS;
294 #endif
295 #ifdef D_TMW
296  TargetPos *TP;
297 #endif
298 
300  Float_t fBrhoRef;
302  UShort_t fMode;
304  Bool_t fCalcMode;
305 
306 protected:
307  // Should be implemented to set properly the branches in new or update mode
308  virtual void SetBranches()
309  {;}
311  virtual void DoCanvas(TCanvas *c, Option_t *);
312 
313 
314 protected:
316  virtual void AddBranches(TTree *tree)
317  {
318  ;
319  }
320 
322  virtual void FillBranches();
324  virtual void Clear(Option_t * = "");
325 
326 protected:
327  void RetriveHistograms();
328  void RetrivePointers();
329 
330 public:
331  VAMOSWatcher(const char *name, const char *title, TTree *tree = 0x0);
332  virtual ~VAMOSWatcher();
333 
334  // to create the spectra
335  //void BuildSpectraByUser();
336 
337  //to fill some spectra
338  // void FillSpectraByUser();
339 
340 #ifdef D_ID
341  inline Identification* GetId(){return Id;};
342 #endif
343 #ifdef D_TMW
344  inline TargetPos *GetTP(){return TP;};
345 #endif
346 
348  virtual Bool_t SetTrigger( ADF::DFTrigger * /*trigger*/ = 0x0 );
349 
351  virtual void InitVAMOS(UShort_t fMode, Option_t *opt = "tmp_histo_vamos.root", Int_t RunNr = -1, const Char_t * OutDir="./Out");
352 
354  virtual Float_t SetBrhoRef(Float_t brho = 1.0); //*MENU*
356  virtual Float_t GetBrhoRef()
357  {
358  return fBrhoRef;
359  }
360 
362  virtual void Exec(Option_t *option="");
363 
364  ClassDef(VAMOSWatcher,0) // Watcher for MFM Frames
365 };
366 
367 #include "MetaWatchers.h"
368 
369 class VAMOSVertexBuilder : public Gw::WatcherWithTag, public VertexBuilder
370 {
371 protected:
373  VAMOSWatcher *fVAMOSWatcher;
374  TargetPos *fTP;
375  Identification *fId;
376 
377 public:
378  VAMOSVertexBuilder(const char *, const char *);
379  virtual ~VAMOSVertexBuilder()
380  {
381  ;
382  }
383 
385  // void SetSomething() ; //*MENU*
386 
388  virtual void Exec(Option_t *option="");
389 
390 
391  ClassDef(VAMOSVertexBuilder,0) // Watcher for builder vertex using the VAMOS library
392 };
393 
394 // endif VAMOS
395 #endif
396 
397 /*
398  #ifdef IN_DEV_GRU
399  #ifdef HAS_GRU
400  class GNetServerRoot;
401  class GSpectra;
402 
404 
405  class GRUWatcher : public TTask
406  {
407  protected:
408  GNetServerRoot *NetworkRoot;
409  GSpectra *SpectraDB;
410 
411  public:
412  GRUWatcher(Int_t Port = 9010);
413  virtual ~ GRUWatcher();
414 
416  virtual void Exec(Option_t *option="")
417  {;}
418 
419  ClassDef(GRUWatcher,0) // To export GwSpectra to GRU
420  };
421  #endif
422  #endif
423  */
424 
425 #endif
TH2 * fTimeCorrelation
time correlation AGATA versus VAMOS i.e. Delta[TSAGATA-VTS] versus TimeOfFlight
TH2I * fParXValue
ADF::Frame * fPSAFrame
current PSA frame to help decoding one by one
virtual void SetBranches()=0
virtual Bool_t SetTrigger(ADF::DFTrigger *=0x0)
set trigger in which one can retrieve encapsulated MFM Frame
MFMEbyedatFrame * fEBYFrame
used to decode depending of the MFM type
Definition: GANILWatchers.h:67
ULong64_t fFirstCentrum
Interface for any watcher that is a VertexBuilder.
virtual ~MFMWatcher()
Int_t fEGTYPE
To get the EG TYPE.
Definition: GANILWatchers.h:73
Base class for a Frame.
Definition: Frame.h:73
EGTYPE
enum to have categories of type of frame. Convenient for histogramming ...
Definition: GANILWatchers.h:53
virtual void DoCanvas(TCanvas *, Option_t *)
To be overwritten by real implementation if a canvas is produced.
Definition: Watchers.h:244
MFMCommonFrame * fInsideFrame
Definition: GANILWatchers.h:68
virtual ~GANILInterface()
Definition: GANILWatchers.C:62
TH1 * fCoreCommomVamos
All GE.
virtual ~AGATAVAMOSCoinc()
AGATAVAMOSCoinc(const char *, const char *, TDirectory *sp_dir=0x0, TDirectory *tag_dir=0x0)
TH1D * fLabelsDistribution
DataParameters * fDataParameters
use to decode the Raw MFM frame
Definition: GANILWatchers.h:77
MFMWatcher, to check the structure of the MBS Frame.
Definition: GANILWatchers.h:99
virtual void Exec(Option_t *option="")
watch the current frame
std::pair< Int_t, ULong64_t > fMW05
Bool_t ADF2MFM()
Move current ADF Frame to MFM.
ADF::SharedFP * fEventPSA
main frame i.e. event:data:psa
RawMFMTree, branches that contains value/label as written in the MFM Frame.
Base class for a Watcher.
Definition: Watchers.h:60
std::vector< std::pair< Int_t, ULong64_t > > fT
ULong64_t fFirstVTS
std::vector< TH2 * > fGAGATAxGVAMOS
correlation Gamma e-energy AGATA versus VAMOS
virtual void SetBranches()
virtual Bool_t SetTrigger(ADF::DFTrigger *=0x0)
set trigger in which one can retrieve encapsulated MFM Frame
Base class for a Watcher that fill a TTree or some branches of a TTree.
Definition: TTreeWatchers.h:51
header file for PSAFrame.cpp
void ShowCoreCommomAndSumSpectra()
MFMCommonFrame * fMFMFrame
always filled
Definition: GANILWatchers.h:64
MFMWatcher(const char *, const char *, TDirectory *sp_dir=0x0, TDirectory *tag_dir=0x0)
void ShowCrystalSpectra()
virtual void Exec(Option_t *option="")
watch the current frame
GANILInterce, base class for all GANIL based watchers.
Definition: GANILWatchers.h:49
RawMFMTree(const char *name, const char *title, TTree *tree=0x0)
MFMMergeFrame * fMergedFrame
Definition: GANILWatchers.h:69
virtual ~RawMFMTree()
std::vector< std::pair< Int_t, ULong64_t > > fVTS
A Shared Frame Pointer.
Definition: Frame.h:597
To build some basic VAMOS Spectra and Coincidences with AGATA [Requires Event:data:psa].
Base class for a trigger on a data flow.
Definition: Trigger.h:155
ADF::PSAInterface * GetDataPSA(UInt_t which)
To get one by one the PSA Frames in one event (It fills fFramePSA). Read has beed called ! ...
virtual void Print(Option_t *option="") const
UInt_t GetNbFramePSA()
number of PSA Frames extracted from the current event
std::string gActionDefault
Default file for ACTIONS.
Definition: GANILWatchers.h:56
std::string gActionDefault
virtual void Exec(Option_t *option="")
watch the current frame
virtual Bool_t SetTrigger(ADF::DFTrigger *)
To set the Frames (through a trigger) associated to this watcher.
Definition: Watchers.cpp:829
TH1I * fFrameSize
std::vector< std::pair< std::pair< Int_t, Int_t >, Float_t > > fAGATAE
TH1I * fFrameType
virtual Int_t ReadActionFile(std::string full_name_of_action_file="")
read the file that contains the mapping. It returns the numbers of parameters, otherwise 0 ...
Definition: GANILWatchers.C:90
virtual Int_t ReadActionFile(std::string full_name_of_action_file="")
read the file that contains the mapping. It returns the numbers of parameters, otherwise 0 ...
ADF::SharedFP * fMFMinADFFrame
Pointer to the Ancillary Frame as delivered by the ADF Trigger.
Definition: GANILWatchers.h:60
virtual Bool_t SetTrigger(ADF::DFTrigger *=0x0)
set trigger in which one can retrieve encapsulated MFM Frame
std::string fActionCurrent
Current actions files.
Definition: GANILWatchers.h:79
TH1D * fMeanNumberOfValues
virtual void DoCanvas(TCanvas *c, Option_t *)
To be overwritten by real implementation if a canvas is produced.
std::pair< Int_t, ULong64_t > fRawToF
static const Int_t MaxValues