KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
GTScalers.cpp
Go to the documentation of this file.
1 /***************************************************************************/
2 // GTGanilData.cpp - Main Header to ROOTGAnilTape
3 // -------------------
4 // begin : Thu Jun 14 2001
5 // copyright : (C) 2001 by Garp
6 // email : patois@ganil.fr
7 
8 
9 #include "Riostream.h"
10 #include "GanTape/GEN_TYPE.H"
11 #include "GanTape/gan_acq_buf.h"
12 
13 // Problem (for me?) in gan_acq_buf :
14 // What the use of defining struct inside other structs ?
15 // Then, theyr definition remain local and I have to do it again here:
16 
18 
19 typedef struct SCALE {
20  UNSINT32 Length; /* Nb bytes utils suivant ce mot */
21  UNSINT32 Nb_channel;
22  UNSINT32 Acq_status;
23  UNSINT32 Reserve[2];
24  union JBUS_SCALE {
25  scale_struct UnScale[NB_MAX_CHANNEL];
26  UNSINT16 Info_jbus [NB_MAX_JBUS];
27  } jbus_scale;
29 
30 //}
31 
32 #include <TMath.h>
33 #include "GTScalers.h"
34 #include "GTOneScaler.h"
35 
36 using namespace std;
37 
39 
40 
41 
44  : fScalerArray("GTOneScaler", 256)
45 {
46  fNbChannel = -1; // Initialisation Marker
47 }
48 
49 
50 
52 
54 {
55 }
56 
57 
58 
60 
61 void GTScalers::Fill(void* echelle)
62 {
63 
64  fScalerArray.Clear();
65  scale* s = (scale*)echelle;
66 // cout <<s->Length<<endl;
67 // cout <<s->Nb_channel<<endl; // This is number of actual scalers
68 // cout <<s->Acq_status<<endl;
69 
70  fNbChannel = s->Nb_channel;
71 
72  for (Int_t i = 0; i < fNbChannel; i++) {
73  GTOneScaler* scal = (GTOneScaler*)fScalerArray.ConstructedAt(i);
74  scal->Set(&(s->jbus_scale.UnScale[i]));
75  }
76 }
77 
78 
79 
82 
84 {
85  // Dump scalers value on cout
86 
87  cout << "Dumping " << fNbChannel << " scalers" << endl;
88  for (Int_t i = 0; i < fNbChannel; i++) {
89  fScalerArray[i]->ls();
90  }
91 }
92 
93 
94 
97 
99 {
100  // Return a constant pointer to the Scaler Index
101  return ((GTOneScaler*)fScalerArray[index]);
102 }
103 
104 
int Int_t
struct SCALE scale
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
Scaler class for the scaler structure.
Definition: GTOneScaler.h:35
void Set(scale_struct *s)
Definition: GTOneScaler.cpp:46
Handle scaler buffers in GANIL DAQ data.
Definition: GTScalers.h:33
const GTOneScaler * GetScalerPtr(Int_t index) const
Return a constant pointer to the Scaler Index.
Definition: GTScalers.cpp:98
~GTScalers(void)
Definition: GTScalers.cpp:53
void Fill(void *)
Definition: GTScalers.cpp:61
void DumpScalers(void)
Dump scalers value on cout.
Definition: GTScalers.cpp:83
const long double s
Definition: KVUnits.h:94
UNSINT32 Reserve[2]
Definition: GTGanilData.cpp:41
UNSINT32 Length
Definition: GTGanilData.cpp:38
UNSINT32 Acq_status
Definition: GTGanilData.cpp:40
union SCALE::JBUS_SCALE jbus_scale
UNSINT32 Nb_channel
Definition: GTGanilData.cpp:39
UNSINT16 Info_jbus[NB_MAX_JBUS]
Definition: GTGanilData.cpp:44
scale_struct UnScale[NB_MAX_CHANNEL]
Definition: GTGanilData.cpp:43