Analysis  version 7.0 - august 2014
GanilCoderInfo.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file GanilCoderInfo.hh
3  *
4  * Déclaration des méthodes de la classe GanilCoderInfo traitant les
5  * données du buffer Comment.
6  */
7 //======================================================================
8 
9 #ifndef GANIL_CODER_INFO_HH
10 #define GANIL_CODER_INFO_HH
11 
12 #include "GanilCommon.hh"
13 #include "GanilBuffer.hh"
14 
15 //----------------------------------------------------------------------
16 // données du buffer Comment
17 
18 /// inforamtion paramètres fixes de l'acquisition
19 #define GANIL_CODER_FIX 0
20 
21 /// inforamtion paramètres variables de l'acquisition
22 #define GANIL_CODER_VAR 1
23 
24 //----------------------------------------------------------------------
25 
26 /// identification nouvelle branche
27 #define GANIL_BRN_DATA " "
28 
29 /// identification de la donnée trigger de la branche
30 #define GANIL_TRG_DATA "0000"
31 
32 /// identification des données paramètres fixes de la branche
33 #define GANIL_FIX_DATA "0001"
34 
35 /// identification des données paramètres variables de la branche
36 #define GANIL_VAR_DATA "0002"
37 
38 /// identification du nom de branche
39 #define GANIL_COD_DATA "0003"
40 
41 //----------------------------------------------------------------------
42 
43 /// bit de donnée trigger renseignée
44 #define GANIL_TRG_FLAG 1
45 
46 /// bit de données paramètres fixes renseignées
47 #define GANIL_FIX_FLAG 2
48 
49 /// bit de données paramètres variables renseignées
50 #define GANIL_VAR_FLAG 4
51 
52 /// bit de donnée nom de branche renseignéelysi@
53 #define GANIL_COD_FLAG 8
54 
55 /// bit de donnée nombre de paramètres renseignée
56 #define GANIL_PAR_FLAG 16
57 
58 /// masque sur l'ensemble des bits de donnée coder
59 #define GANIL_ALL_FLAG 31
60 
61 //======================================================================
62 /*! \class GanilCoderInfo
63  *
64  * Classe traitant les données du buffer Comment.
65  */
67 {
68  friend class GanilRun;
69 
70 //----------------------------------------------------------------------
71  /*! \object_doc */
73 //----------------------------------------------------------------------
74 
75  public:
76  u_short number; ///< Nombre de branches de codeurs
77 
78 #ifndef __MAKECINT__
79  u_short *trignum; ///< Table des numéros de triggers des branches
80  u_short *parnum; ///< Table des nombres de paramètres par branche
81  u_short **trig; ///< Table des valeurs de trigger pour chaque branche
82  u_short **fix1; ///< Table du premier paramètre fixe pour chaque branche
83  u_short **fixn; ///< Table du nombre de paramètres fixes pour chaque branche
84 #endif
85  string *coder; ///< Table des noms de branches
86 
87  public:
88  // constructeur
89  GanilCoderInfo ();
90 
91  // constructeur de recopie
92  GanilCoderInfo ( const GanilCoderInfo & );
93 
94  // destructeur
95  virtual ~GanilCoderInfo ();
96 
97  // operateur de d'affectation
99 
100  // operateur de comparaison
101  bool operator == ( const GanilCoderInfo & );
102 
103  // Opérateur de comparaison (non-équivalence).
104  bool operator != ( const GanilCoderInfo &data );
105 
106 
107  // sortie des informations
108  void CoderInfo ( );
109  void CoderInfo ( ostream & );
110 
111  u_short Number ( );
112  u_short TrigNum ( const u_int b );
113  u_short ParNum ( const u_int b );
114  u_short Trig ( const u_int b, const u_int t );
115  u_short Fix1 ( const u_int b, const u_int t );
116  u_short Fixn ( const u_int b, const u_int t );
117  string Coder ( const u_int b );
118 
119  void Clear ( );
120 
121  protected:
122  // rempli les données à partir d'un buffer
123  int SetCoderInfo ( GanilBuffer & );
124 
125 //----------------------------------------------------------------------
126 // pour ROOT...
127  public:
128  /*! Définition à usage de ROOT... */
130 } ;
131 
132 
133 //======================================================================
134 // METHODES INLINE
135 //======================================================================
136 
137 
138 /*! Opérateur de comparaison (non-équivalence).
139  * \param data donnée avec laquelle on teste l'équivalence
140  */
142  { return ( ! (*this == data) ); }
143 
144 /*! Ecriture des informations du fichier sur la sortie standard.
145  */
147 { CoderInfo (cout); }
148 
149 /*! Retourne le nombre de branches de codeurs.
150  */
151 inline u_short GanilCoderInfo::Number ( ) { return (number); }
152 
153 /*! Retourne le numéro de trigger d'une branche de codeurs.
154  * \param b numéro de branche
155  */
156 inline u_short GanilCoderInfo::TrigNum ( const u_int b )
157  { return ( (b < number) ? trignum[b] : 0 ); }
158 
159 /*! Retourne le nombre de paramètres d'une branche de codeurs.
160  * \param b numéro de branche
161  */
162 inline u_short GanilCoderInfo::ParNum ( const u_int b )
163  { return ( (b < number) ? parnum[b] : 0 ); }
164 
165 /*! Retourne la valeur d'un trigger dans une branche.
166  * \param b numéro de branche
167  * \param t numéro de trigger
168  */
169 inline u_short GanilCoderInfo::Trig ( const u_int b, const u_int t )
170  { return ( (b < number) ? (( t < trignum[b] ) ? trig[b][t] : 0) : 0 ); }
171 
172 /*! Retourne le numéro du premier paramètre fixe pour un trigger
173  * dans une branche.
174  * \param b numéro de branche
175  * \param t numéro de trigger
176  */
177 inline u_short GanilCoderInfo::Fix1 ( const u_int b, const u_int t )
178  { return ( (b < number) ? (( t < trignum[b] ) ? fix1[b][t] : 0) : 0 ); }
179 
180 /*! Retourne le nombre de paramètres fixes pour un trigger dans
181  * une branche.
182  * \param b numéro de branche
183  * \param t numéro de trigger
184  */
185 inline u_short GanilCoderInfo::Fixn ( const u_int b, const u_int t )
186  { return ( (b < number) ? (( t < trignum[b] ) ? fixn[b][t] : 0) : 0 ); }
187 
188 /*! Retourne le nom d'une branche de codeurs.
189  * \param b numéro de branche
190  */
191 inline string GanilCoderInfo::Coder ( const u_int b )
192  { return ( (b < number) ? coder[b] : 0 ); }
193 
194 
195 //======================================================================
196 #endif
string * coder
Table des noms de branches.
Definition: GanilCoderInfo.hh:85
Definition: GanilRun.hh:39
u_short Number()
Definition: GanilCoderInfo.hh:151
int SetCoderInfo(GanilBuffer &)
Definition: GanilCoderInfo.cpp:227
u_short Fix1(const u_int b, const u_int t)
Definition: GanilCoderInfo.hh:177
u_short ParNum(const u_int b)
Definition: GanilCoderInfo.hh:162
u_short ** fixn
Table du nombre de paramètres fixes pour chaque branche.
Definition: GanilCoderInfo.hh:83
u_short ** fix1
Table du premier paramètre fixe pour chaque branche.
Definition: GanilCoderInfo.hh:82
GanilCoderInfo()
Definition: GanilCoderInfo.cpp:15
Definition: GanilCoderInfo.hh:66
void CoderInfo()
Definition: GanilCoderInfo.hh:146
GObject(GanilCoderInfo)
bool operator!=(const GanilCoderInfo &data)
Definition: GanilCoderInfo.hh:141
u_short number
Nombre de branches de codeurs.
Definition: GanilCoderInfo.hh:76
u_short * trignum
Table des numéros de triggers des branches.
Definition: GanilCoderInfo.hh:79
Definition: GanilBuffer.hh:26
string Coder(const u_int b)
Definition: GanilCoderInfo.hh:191
u_short * parnum
Table des nombres de paramètres par branche.
Definition: GanilCoderInfo.hh:80
u_short Fixn(const u_int b, const u_int t)
Definition: GanilCoderInfo.hh:185
GanilCoderInfo & operator=(const GanilCoderInfo &)
Definition: GanilCoderInfo.cpp:100
void Clear()
Definition: GanilCoderInfo.cpp:74
u_short TrigNum(const u_int b)
Definition: GanilCoderInfo.hh:156
virtual ~GanilCoderInfo()
Definition: GanilCoderInfo.cpp:66
u_short Trig(const u_int b, const u_int t)
Definition: GanilCoderInfo.hh:169
bool operator==(const GanilCoderInfo &)
Definition: GanilCoderInfo.cpp:150
u_short ** trig
Table des valeurs de trigger pour chaque branche.
Definition: GanilCoderInfo.hh:81
ClassDef(GanilCoderInfo, 0)