KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
GTGanilData.h
Go to the documentation of this file.
1 /***************************************************************************
17  ***************************************************************************
18  * *
19  * This program is free software; you can redistribute it and/or modify *
20  * it under the terms of the GNU General Public License as published by *
21  * the Free Software Foundation; either version 2 of the License, or *
22  * (at your option) any later version. *
23  * *
24  ***************************************************************************/
25 
26 #ifndef GT_GTGanilData_H
27 #define GT_GTGanilData_H
28 
30 #include "Rtypes.h"
31 #include <TFile.h>
32 #include <TString.h>
33 #include <TTree.h>
34 #include <TNtuple.h>
35 
36 #include "GTDataParameters.h"
37 #include "GTScalers.h"
38 #include "GanTape/GEN_TYPE.H"
39 #include "GanTape/STR_EVT.H"
40 #include "GanTape/gan_acq_buf.h"
41 #ifndef __GAN_TAPE_GENERAL_H
42 typedef struct {
43  int bidon;
45 #endif
46 
63 class GTGanilData {
64 public:
66  typedef enum {
67  kSkipScaler, // Skip it.
68  kDumpScaler, // Print all values of scalers in buffer
69  kReportScaler, // Report the existance of a scaler buffer. WARNING! user
71  kAutoWriteScaler // Automatic scaler management: wrote on disk
73 
74 
75 public:
76  GTGanilData(const TString filename);
77  GTGanilData();
78  virtual ~GTGanilData(void);
79 
80  void SetFileName(const TString filename);
81  void Open(void);
82  void PrintRunParameters(void) const;
83  void PrintDataParameters(void) const;
84  void DumpEvent(void) const;
85  void DumpParameterName(void) const;
86  void Connect(const Int_t index, UShort_t** p) const;
87  void ConnectFired(const Int_t index, Bool_t** p) const;
88  bool Next(void);
89  void MakeTree(const TString filename = "", UInt_t nEvents = kMaxUInt);
90  inline bool IsScalerBuffer(void) const
91  {
92  return (fIsScalerBuffer);
93  };
95  {
97  return fScaler;
98  };
99  Int_t GetStatus(void) const
100  {
101  return (fStatus);
102  }
104  Int_t GetRunNumber(void) const;
105 
106  Bool_t IsOpen(void) const;
107 
109  {
110  return fDataParameters;
111  };
113  {
114  return fDataParameters->GetList();
115  };
117  {
118  return fEventCount;
119  }
120 
121  virtual void SetUserTree(TTree*);
123  {
124  return fDateStart;
125  }
126 
127 protected:
128  void InitDefault(const Int_t argc = 0, char** argv = NULL);
129  virtual void ReadParameters(void);
130  void ReadBuffer(void);
131  bool ReadNextEvent(void);
132  bool ReadNextEvent_EBYEDAT(void);
133  virtual bool EventUnravelling(CTRL_EVENT*);
134 
140  in2p3_buffer_struct* fBuffer;
150  char fHeader[9];
156  bool fIsCtrl;
164 public:
165  ClassDef(GTGanilData, 0) // Interface to a GANIL formated Tape or File
166 };
167 
168 #endif
int Int_t
unsigned int UInt_t
unsigned short UShort_t
const Bool_t kFALSE
bool Bool_t
#define ClassDef(name, id)
const TList * GetList() const
Read GANIL formatted tapes or files.
Definition: GTGanilData.h:63
Int_t fLun
Logical number of the device.
Definition: GTGanilData.h:137
bool ReadNextEvent(void)
Int_t fRunNumber
current file run number
Definition: GTGanilData.h:149
void ReadBuffer(void)
char fHeader[9]
Buffer header.
Definition: GTGanilData.h:150
void ConnectFired(const Int_t index, Bool_t **p) const
Connect a pointer to a data to the defined index in the Data Array.
UShort_t * fEventBrut
Brut data buffer.
Definition: GTGanilData.h:146
void InitDefault(const Int_t argc=0, char **argv=NULL)
bool fAllocated
True if the Tape is allocated (useless?)
Definition: GTGanilData.h:148
Int_t fEventCount
Our event counter.
Definition: GTGanilData.h:155
Int_t fEventNumber
Local event number in current buffer (should be renamed)
Definition: GTGanilData.h:154
GTScalers * fScaler
Scaler array.
Definition: GTGanilData.h:160
TString GetRunStartDate() const
Definition: GTGanilData.h:122
Int_t fCtrlForm
Fix/variable length events.
Definition: GTGanilData.h:143
void DumpEvent(void) const
Dump parameter index, name and value for the current event.
gan_tape_desc * fDevice
Device structure (ganil_tape interface)
Definition: GTGanilData.h:138
void Connect(const Int_t index, UShort_t **p) const
Connect a pointer to a data to the defined index in the Data Array.
Int_t fDensity
Tape density.
Definition: GTGanilData.h:139
char * fStructEvent
??? (ganil_tape interface)
Definition: GTGanilData.h:141
Int_t GetRunNumber(void) const
Returns current run number.
const TList * GetListOfDataParameters() const
Definition: GTGanilData.h:112
Int_t fStatus
Status, 0 is OK, any other value suspect.
Definition: GTGanilData.h:136
void SetFileName(const TString filename)
Definition: GTGanilData.cpp:90
TString fDateStart
Date/time of start of run read from file.
Definition: GTGanilData.h:162
UShort_t * fEventCtrl
Control data buffer.
Definition: GTGanilData.h:147
bool ReadNextEvent_EBYEDAT(void)
void PrintRunParameters(void) const
Print every class parameters, for now a simple dump.
GTDataParameters * GetDataParameters() const
Definition: GTGanilData.h:108
virtual void SetUserTree(TTree *)
Not used.
bool fIsCtrl
We are currently in a CTRL buffer.
Definition: GTGanilData.h:156
bool fIsScalerBuffer
The current buffer is a scaler buffer.
Definition: GTGanilData.h:157
void DumpParameterName(void) const
Dump parameter index and name.
in2p3_buffer_struct * fBuffer
Brut data buffer (ganil_tape interface)
Definition: GTGanilData.h:140
Int_t GetStatus(void) const
Definition: GTGanilData.h:99
Bool_t IsOpen(void) const
bool IsScalerBuffer(void) const
Definition: GTGanilData.h:90
Bool_t * fFired
fired parameters in each event
Definition: GTGanilData.h:152
virtual void ReadParameters(void)
GTGanilData()
Default constructor.
Definition: GTGanilData.cpp:64
GTDataParameters * fDataParameters
Data parameters names class.
Definition: GTGanilData.h:159
Int_t GetEventCount() const
Definition: GTGanilData.h:116
TString fFileName
Filename, can be a tape drive.
Definition: GTGanilData.h:135
Int_t fBufSize
Buffer size.
Definition: GTGanilData.h:142
GTScalers * GetScalers(void)
Definition: GTGanilData.h:94
Int_t fDataArraySize
Data array size.
Definition: GTGanilData.h:153
void SetScalerBuffersManagement(const ScalerWhat_t sc)
UShort_t * fDataArray
Physical data array.
Definition: GTGanilData.h:151
bool Next(void)
Int_t fEvbsize
Size of the brut data buffer.
Definition: GTGanilData.h:144
ScalerWhat_t fWhatScaler
What do we do with scalers buffers.
Definition: GTGanilData.h:158
void MakeTree(const TString filename="", UInt_t nEvents=kMaxUInt)
virtual ~GTGanilData(void)
virtual bool EventUnravelling(CTRL_EVENT *)
Int_t fEvcsize
Size of the ctrl data buffer.
Definition: GTGanilData.h:145
Int_t fCTRLEVNT_HD
size (in 16-bit words) of CTRL_EVNT header
Definition: GTGanilData.h:163
void PrintDataParameters(void) const
TTree * fScalerTree
Scaler tree for automatic filling.
Definition: GTGanilData.h:161
void Open(void)
ScalerWhat_t
What to do with scaler buffer.
Definition: GTGanilData.h:66
@ kAutoWriteScaler
have to take care of it.
Definition: GTGanilData.h:71
Handle scaler buffers in GANIL DAQ data.
Definition: GTScalers.h:33
ROOT headers.
Definition: GTGanilData.h:42