GET library
GETCommon.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file GETCommon.hh
3  *
4  * Common include file for library sources.
5  */
6 //======================================================================
7 
8 #ifndef GET_COMMON_HH
9 #define GET_COMMON_HH
10 
11 //----------------------------------------------------------------------
12 
13 // GCpp base include files
14 #include "GGlobal.hh"
15 #include "GBaseFunctions.hh"
16 #include "GLogMessage.hh"
17 #include "GString.hh"
18 
19 // ROOT / GRootTools include files
20 #include "TRandom3.h"
21 #include "TMath.h"
22 
23 // GFFT include files
24 #include "RRealSampleFFT.hh"
25 
26 //! Define the data type for samples
27 typedef RRealSampleFFT GETSample;
28 
29 
30 // Xerces-c include filess (for XML parsing)
31 #include <xercesc/util/PlatformUtils.hpp>
32 #include <xercesc/sax/HandlerBase.hpp>
33 #include <xercesc/parsers/XercesDOMParser.hpp>
34 #include <xercesc/dom/DOM.hpp>
35 #include <xercesc/util/XMLString.hpp>
36 
37 using namespace xercesc;
38 
39 // GET general include files
40 #include "GETMetaFrame.hh"
41 
42 //----------------------------------------------------------------------
43 
44 //! Macro inverting 2 bytes values
45 #define GET_SWAP_BYTES(a,b) { byte __tmp = a; a = b; b = __tmp; }
46 
47 
48 //----------------------------------------------------------------------
49 
50 //! End of file returned value
51 #define GET_EOF -1
52 
53 //! Error code for file problem
54 #define GET_FILE_ERROR 1
55 
56 //! Error code for frame problem
57 #define GET_FRAME_ERROR 3
58 
59 //! Warning code for MFM frames problem
60 #define GET_FRAME_WARN -2
61 
62 
63 //======================================================================
64 // Global variables
65 // (defined in GETObject.cpp file)
66 
67 /*! Unique random generator for GET library.*/
68 extern TRandom3 GETRandom; ///< Random numbers generator
69 
70 
71 //======================================================================
72 /*! \namespace GET
73  *
74  * This namespace defines some values for GET objects and configuration
75  * files.
76  */
77 namespace GET
78 {
79  //----------------------------------------------------------
80  /** @name Experimental / simulation data modes */
81  //@{
82 
83  //! The samples are filled from an experimental data file (in channel output sample)
84  static const u_short modeUndefined = 0;
85 
86  //! The samples are filled from an experimental data file (in channel output sample)
87  static const u_short modeData = 1;
88 
89  //! The samples are filled from an experimental data file (in channel output sample)
90  static const u_short modeSimul = 2;
91  //@}
92 
93  //----------------------------------------------------------
94  /** @name Channel signal sample identifier */
95  //@{
96 
97  //! Undefined signal sample
98  static const u_short signalUndef = 0;
99 
100  //! Test input (simulation) signal sample
101  static const u_short signalTst = 1;
102 
103  //! Output (experimental data) signal sample
104  static const u_short signalOut = 2;
105 
106  //! Reconstructed signal sample
107  static const u_short signalRec = 3;
108  //@}
109 
110  //----------------------------------------------------------
111  /** @name Channel information identifier */
112  //@{
113 
114  //! Maximum value of signal data
115  static const u_short dataMaxSignal = 0x0000;
116 
117  //! Maximum integral of signal data
118  static const u_short dataIntegral = 0x0001;
119 
120  //! Full signal data (for 3D)
121  static const u_short dataFullSignal = 0x0002;
122 
123  //! Time of maximum value of signal data
124  static const u_short dataTime = 0x0004;
125 
126  //! Time bucket of maximum value of signal data
127  static const u_short dataTimeBin = 0x000C;
128 
129  //! Whether the channel is hit (1) or not (0)
130  static const u_short dataHit = 0x0010;
131 
132  //@}
133 
134  //----------------------------------------------------------
135  /** @name Channels amplitude and timing analysis modes */
136  //@{
137 
138  //! Channel amplitude calculation mode: maximum signal time bucket
139  static const u_short amplitudeMaxSignal = 0;
140 
141  //! Channel amplitude calculation mode: average around maximum signal time bucket
142  static const u_short amplitudeLocalAvg = 1;
143 
144  //! Channel amplitude calculation mode: quadratic fit around maximum signal time bucket
145  static const u_short amplitudeLocalFitP2 = 2;
146 
147  //! Channel timing from maximum amplitude
148  static const u_short timingMaxSignal = 0;
149 
150  //! Channel timing from CFD algorithm
151  static const u_short timingCFD = 1;
152 
153  //@}
154 
155  //----------------------------------------------------------
156  /** @name Reduced-CoBo options */
157  //@{
158 
159  //! When reading experimental data, correct for sample 0 artefact
160  static const u_int RCoBoData0Correction = 0x00000001;
161 
162  //! When reading experimental data, correct for last sample artefact
163  static const u_int RCoBoDataNCorrection = 0x00000002;
164 
165  //! When reading experimental data, correct for last cell read of AGet number 2
166  static const u_int RCoBoCorrectLC2 = 0x00000010;
167 
168  //! When reading experimental data, correct with closer FPN channel (only for signal channels)
169  static const u_int RCoBoCorrectFPN1 = 0x00000020;
170 
171  //! When reading experimental data, correct with 2 half chip FPN channels average (only for signal channels)
172  static const u_int RCoBoCorrectFPN2 = 0x00000040;
173 
174  //! When reading experimental data, correct with average FPN (only for signal channels)
175  static const u_int RCoBoCorrectFPN4 = 0x00000060;
176  //! When reading experimental data, correct with average FPN (only for signal channels)
177  static const u_int RCoBoCorrectFPN = 0x00000060;
178 
179  //! all option for corrections when reading events
180  static const u_int RCoBoCorrectEvents = 0x000000FF;
181 
182  //@}
183 
184  //----------------------------------------------------------
185  /** @name All GET systems options */
186  //@{
187 
188  //! When reading experimental data, correct with closer FPN channel (only for signal channels)
189  static const u_int CoBoCorrectFPN1 = RCoBoCorrectFPN1;
190 
191  //! When reading experimental data, correct with 2 half chip FPN channels average (only for signal channels)
192  static const u_int CoBoCorrectFPN2 = RCoBoCorrectFPN2;
193 
194  //! When reading experimental data, correct with average FPN (only for signal channels)
195  static const u_int CoBoCorrectFPN4 = RCoBoCorrectFPN4;
196  //! When reading experimental data, correct with average FPN (only for signal channels)
197  static const u_int CoBoCorrectFPN = RCoBoCorrectFPN4;
198 
199 
200  /*! When reading experimental data, a (software) zero suppression is
201  * performed on data.
202  * Note that this option cancels the FPN and automatic baseline
203  * corrections.
204  */
205  static const u_int CoBoZeroSuppress = 0x00000400;
206 
207 
208  //! all options for corrections when reading events
209  static const u_int CoBoCorrectEvents = 0x00000FFF;
210 
211 
212  //! Skip events with incomplete merged frames
213  static const u_int MergedIncompleteSkip = 0x00001000;
214 
215  //! Error on events with incomplete merged frames
216  static const u_int MergedIncompleteError = 0x00003000;
217 
218  //@}
219 
220 
221  //----------------------------------------------------------
222  /** @name Filters options */
223  //@{
224 
225  //! Normalize filter to conserve signal integral
226  static const u_int filterNormalize = 0x00000001;
227 
228  //@}
229 
230  //----------------------------------------------------------
231  // Configuration files data
232 
233  //! This namespace defines configuration files values.
234  namespace CFG
235  {
236 
237  //----------------------------------------------------------
238  /** @name Channels configuration */
239  //@{
240 
241  //! Defines the trigger inhibit identifiers.
242  enum TriggerInhibit { inhibitChannel,
243  inhibitTriggerData,
244  inhibitTriggerFunction,
245  inhibitNone };
246 
247  //! Defines the CSA gain identifiers.
248  enum CSAGain { csa10pC, csa120fC, csa1pC, csa240fC };
249 
250  //! Defines the reading modes identifiers.
251  enum ReadingMode { readAlways,
252  readNever,
253  readOnlyIfHit };
254  //@}
255 
256  //----------------------------------------------------------
257  /** @name AGet configuration */
258  //@{
259 
260  // AGet / Global / Reg1 configuration */
261 
262  //! Defines the test mode capacitors values identifiers.
263  enum TestModeRange { capa10pF, capa120fF, capa1pF, capa240fF };
264 
265  //! Defines the peaking time values identifiers.
266  enum PeakingTime { peaking70, peaking117, peaking232, peaking280,
267  peaking334, peaking383, peaking502, peaking541,
268  peaking568, peaking632, peaking721, peaking760,
269  peaking831, peaking870, peaking976, peaking1014 };
270 
271  //! Defines the test mode selection identifiers.
272  enum TestModeSelection { testModeCalibration,
273  testModeFunctionality,
274  testModeNothing,
275  testModeTest };
276 
277  //! Defines the SCA pointer identifiers.
278  enum TSCAPointer { anySCAPointer,
279  col0or128or256or384,
280  col0or256,
281  column0 };
282 
283  //! Defines the Vicm values identifiers.
284  enum Vicm { vicm125V, vicm135V, vicm155V, vicm165V };
285  //@}
286 
287  }
288 }
289 
290 //----------------------------------------------------------------------
291 #endif
static const u_int CoBoCorrectEvents
all options for corrections when reading events
Definition: GETCommon.hh:209
static const u_int MergedIncompleteSkip
Skip events with incomplete merged frames.
Definition: GETCommon.hh:213
static const u_short signalOut
Output (experimental data) signal sample.
Definition: GETCommon.hh:104
static const u_int RCoBoCorrectFPN
When reading experimental data, correct with average FPN (only for signal channels) ...
Definition: GETCommon.hh:177
static const u_short signalRec
Reconstructed signal sample.
Definition: GETCommon.hh:107
PeakingTime
Defines the peaking time values identifiers.
Definition: GETCommon.hh:266
Vicm
Defines the Vicm values identifiers.
Definition: GETCommon.hh:284
static const u_short dataMaxSignal
Maximum value of signal data.
Definition: GETCommon.hh:115
TRandom3 GETRandom
Random numbers generator.
Definition: GETObject.cpp:12
static const u_int RCoBoDataNCorrection
When reading experimental data, correct for last sample artefact.
Definition: GETCommon.hh:163
static const u_short timingCFD
Channel timing from CFD algorithm.
Definition: GETCommon.hh:151
static const u_int CoBoCorrectFPN1
When reading experimental data, correct with closer FPN channel (only for signal channels) ...
Definition: GETCommon.hh:189
static const u_short timingMaxSignal
Channel timing from maximum amplitude.
Definition: GETCommon.hh:148
static const u_short modeData
The samples are filled from an experimental data file (in channel output sample)
Definition: GETCommon.hh:87
TestModeSelection
Defines the test mode selection identifiers.
Definition: GETCommon.hh:272
static const u_int CoBoCorrectFPN4
When reading experimental data, correct with average FPN (only for signal channels) ...
Definition: GETCommon.hh:195
TestModeRange
Defines the test mode capacitors values identifiers.
Definition: GETCommon.hh:263
ReadingMode
Defines the reading modes identifiers.
Definition: GETCommon.hh:251
CSAGain
Defines the CSA gain identifiers.
Definition: GETCommon.hh:248
static const u_short dataIntegral
Maximum integral of signal data.
Definition: GETCommon.hh:118
static const u_int CoBoZeroSuppress
Definition: GETCommon.hh:205
static const u_int RCoBoCorrectFPN4
When reading experimental data, correct with average FPN (only for signal channels) ...
Definition: GETCommon.hh:175
static const u_int RCoBoCorrectLC2
When reading experimental data, correct for last cell read of AGet number 2.
Definition: GETCommon.hh:166
static const u_short amplitudeLocalAvg
Channel amplitude calculation mode: average around maximum signal time bucket.
Definition: GETCommon.hh:142
RRealSampleFFT GETSample
Define the data type for samples.
Definition: GETCommon.hh:27
static const u_int RCoBoCorrectFPN2
When reading experimental data, correct with 2 half chip FPN channels average (only for signal channe...
Definition: GETCommon.hh:172
static const u_short signalUndef
Undefined signal sample.
Definition: GETCommon.hh:98
static const u_short modeSimul
The samples are filled from an experimental data file (in channel output sample)
Definition: GETCommon.hh:90
static const u_short dataFullSignal
Full signal data (for 3D)
Definition: GETCommon.hh:121
TriggerInhibit
Defines the trigger inhibit identifiers.
Definition: GETCommon.hh:242
static const u_int filterNormalize
Normalize filter to conserve signal integral.
Definition: GETCommon.hh:226
static const u_int CoBoCorrectFPN2
When reading experimental data, correct with 2 half chip FPN channels average (only for signal channe...
Definition: GETCommon.hh:192
static const u_int RCoBoData0Correction
When reading experimental data, correct for sample 0 artefact.
Definition: GETCommon.hh:160
static const u_short signalTst
Test input (simulation) signal sample.
Definition: GETCommon.hh:101
static const u_short amplitudeLocalFitP2
Channel amplitude calculation mode: quadratic fit around maximum signal time bucket.
Definition: GETCommon.hh:145
static const u_short modeUndefined
The samples are filled from an experimental data file (in channel output sample)
Definition: GETCommon.hh:84
static const u_short dataTime
Time of maximum value of signal data.
Definition: GETCommon.hh:124
static const u_int CoBoCorrectFPN
When reading experimental data, correct with average FPN (only for signal channels) ...
Definition: GETCommon.hh:197
static const u_int MergedIncompleteError
Error on events with incomplete merged frames.
Definition: GETCommon.hh:216
static const u_short amplitudeMaxSignal
Channel amplitude calculation mode: maximum signal time bucket.
Definition: GETCommon.hh:139
static const u_int RCoBoCorrectFPN1
When reading experimental data, correct with closer FPN channel (only for signal channels) ...
Definition: GETCommon.hh:169
TSCAPointer
Defines the SCA pointer identifiers.
Definition: GETCommon.hh:278
static const u_short dataHit
Whether the channel is hit (1) or not (0)
Definition: GETCommon.hh:130
static const u_short dataTimeBin
Time bucket of maximum value of signal data.
Definition: GETCommon.hh:127
static const u_int RCoBoCorrectEvents
all option for corrections when reading events
Definition: GETCommon.hh:180