GET library
GETChannel.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file GETChannel.hh
3  *
4  * Include file for the GETChannel class.
5  */
6 //======================================================================
7 
8 #ifndef GET_CHANNEL_HH
9 #define GET_CHANNEL_HH
10 
11 //----------------------------------------------------------------------
12 
13 #include "GETCommon.hh"
14 #include "GETObject.hh"
15 #include "GETCfgTools.hh"
16 #include "GETCfgChannel.hh"
17 class GETAGet;
18 
19 //======================================================================
20 /*! \class GETChannel
21  *
22  * This class defines the mechanism for a single channel processing.
23  * It can be used in 2 ways:
24  * - to analyse some "real" data: the data coming from the electronics
25  * is set in the output sample, and processed to estimate the input
26  * signal (deconvolution of the response function);
27  * in this case, an additionnal output noise can be defined
28  * (the input noise has to be set directly in the input test
29  * sample).
30  * - to simulate some data, setting an input signal that is transformed
31  * using the response function before being processed.
32  *
33  * The GETChannel defines 3 signal samples objects:
34  * - the \b test sample: \b input signal (from simulations);
35  * - the \b output sample: the result from simulation input processing
36  * (with optional output noise) or the result from a real measurement;
37  * - the \b reconstructed sample, from inverse processing of the
38  * output, with optional signal filtering.
39  *
40  */
41 class GETChannel : public GETObject
42 {
43  //------------------------------------------------------------
44  /*! \object_doc */
46  //------------------------------------------------------------
47 
48  friend class GETSystem;
49  friend class GETAGet;
50  friend class GETCfgChannel;
51 
52  protected:
53 
54  // GET configuration
55  GETCfgChannel * config; ///< Configuration data
56 
57  // Channel data
58  int sig_id; ///< Signal channel identifier (0-63 for signal, 64-67 for FPN)
59  u_short data_mode; ///< Whether data comes from an experimental file or from simulation
60 
61  // input/output signals
62  GETSample signal_tst; ///< Test (input) signal (for simulation)
63  GETSample signal_out; ///< Output signal from AGET
64  GETSample signal_rec; ///< Reconstructed signal (filtering and deconvolution)
65 
66  bool read_ok[GET_MAX_DEPTH]; ///< Flag for read data
67  u_int read_count; ///< Number of data read for the channel (from exp. raw data)
68  u_int satur_count; ///< Number of data over saturation threshold
69  int satur_low; ///< Lower saturated time bucket
70  int satur_high; ///< Higher saturated time bucket
71 
72  public:
73  //----------------------------------------------------------
74  /** @name Constructors, affectation, destructor */
75  //@{
76  GETChannel ( u_int n = 0, double dt = 0.01L );
77  virtual ~GETChannel ( );
78  //@}
79 
80  //----------------------------------------------------------
81  /** @name GET configuration */
82  //@{
83  virtual int ResetConfig ( );
84 
85  const GETCfgChannel * GetConfig ( ) const; // inline
86  GETCfgChannel * GetConfig ( ); // inline
87 
88  bool IsFPNChannel ( ) const;
89  bool IsSignalChannel ( ) const; // inline
90  //@}
91 
92  //----------------------------------------------------------
93  /** @name Initialization functions */
94  //@{
95  virtual void Reset ( );
96  virtual void Init ( u_int n, double dt );
97  virtual void SetTimeStep ( double dt );
98  virtual void ResetReadCount ( ); // inline
99  virtual void ClearEvent ( );
100 
101  virtual void ValidDataSet ( );
102  virtual void ValidSimulSet ( );
103  bool IsModeData ( ) const; // inline
104  bool IsModeSimul ( ) const; // inline
105  //@}
106 
107  //----------------------------------------------------------
108  /** @name GET system core objects functions */
109  //@{
110  int GetSignalId ( ) const; // inline
111  virtual string GetObjectId ( ) const; // inline
112  virtual u_int GetChannelCount ( ) const; // inline
113 
114  virtual u_int GetChildrenNumber ( ) const; // inline
115  virtual const GETObject * GetChild ( u_int i ) const; // inline
116  virtual GETObject * GetChild ( u_int i ); // inline
117 
118  u_short GetLastCell ( ) const;
119 
120  virtual void IncrSaturationCount ( u_int incr = 1 ); // inline
121  virtual void SetSaturation ( u_int buckid );
122  u_int GetSaturationCount ( ) const; // inline
123  int GetSaturationLow ( ) const; // inline
124  int GetSaturationHigh ( ) const; // inline
125  virtual void UpdateSaturations ( u_int sat );
126 
127  virtual u_int GetReadoutMultiplicity ( bool fpn = true ) const;
128  virtual double GetSignalSum ( u_short info = GET::signalOut );
129  //@}
130 
131  //----------------------------------------------------------
132  /** @name Channel samples (Test, Output, Reconstructed) function */
133  //@{
134  virtual void IncrReadoutCount ( u_int incr = 1); // inline
135  u_int GetReadoutCount ( ) const; // inline
136 
137  bool IsReadOk ( u_short i ) const; // inline
138  void SetReadOk ( u_short i, bool b = true ); // inline
139 
140  GETSample & TstSample ( ); // inline
141  GETSample & OutSample ( ); // inline
142  GETSample & RecSample ( ); // inline
143 
144  virtual int ProcessData ( bool in_noise = true );
145  virtual int ProcessOutFromTst ( bool in_noise = true, bool out_noise = true );
146  virtual int ProcessRecFromOut ( bool out_corr = true );
147 
148  virtual int ProcessOutputCorrection ( );
149 
150  virtual int ApplyOutputNoise ( GETSample & out_sample );
151  virtual int ApplyOutputCorrection ( GETSample & cor_sample );
152  //@}
153 
154 
155  //------------------------------------------------------------
156  /** @name Read / write of custom objects scheme */
157  //@{
158 
159  //@}
160 
161 
162  //----------------------------------------------------------
163  /** @name ROOT related functions */
164  //@{
165  public:
166 
167  /*! for use within ROOT.*/
168  ClassDef(GETChannel,0);
169  //@}
170 };
171 
172 
173 //----------------------------------------------------------------------
174 // Inline functions
175 #include "icc/GETChannel.icc"
176 
177 
178 //======================================================================
179 #endif
int sig_id
Signal channel identifier (0-63 for signal, 64-67 for FPN)
Definition: GETChannel.hh:58
virtual ~GETChannel()
Definition: GETChannel.cpp:41
virtual int ProcessOutputCorrection()
Definition: GETChannel.cpp:542
u_int GetReadoutCount() const
Definition: GETChannel.icc:122
virtual int ApplyOutputCorrection(GETSample &cor_sample)
Definition: GETChannel.cpp:629
static const u_short signalOut
Output (experimental data) signal sample.
Definition: GETCommon.hh:110
#define GET_MAX_DEPTH
Maximum data depth.
Definition: GETCommon.hh:34
virtual void ValidSimulSet()
Definition: GETChannel.cpp:190
virtual void UpdateSaturations(u_int sat)
Definition: GETChannel.cpp:258
ClassDef(GETChannel, 0)
virtual double GetSignalSum(u_short info=GET::signalOut)
Definition: GETChannel.cpp:220
void SetReadOk(u_short i, bool b=true)
Definition: GETChannel.icc:110
bool IsModeData() const
Definition: GETChannel.icc:36
const GETCfgChannel * GetConfig() const
Definition: GETChannel.icc:13
GETSample signal_tst
Test (input) signal (for simulation)
Definition: GETChannel.hh:62
virtual void IncrReadoutCount(u_int incr=1)
Definition: GETChannel.icc:118
Definition: GETChannel.hh:41
bool IsReadOk(u_short i) const
Definition: GETChannel.icc:103
virtual void ValidDataSet()
Definition: GETChannel.cpp:174
virtual u_int GetChannelCount() const
Definition: GETChannel.icc:50
virtual void IncrSaturationCount(u_int incr=1)
Definition: GETChannel.icc:78
virtual u_int GetChildrenNumber() const
Definition: GETChannel.icc:54
virtual int ProcessRecFromOut(bool out_corr=true)
Definition: GETChannel.cpp:446
int GetSaturationLow() const
Definition: GETChannel.icc:90
virtual const GETObject * GetChild(u_int i) const
Definition: GETChannel.icc:60
u_int read_count
Number of data read for the channel (from exp. raw data)
Definition: GETChannel.hh:67
GETSample & RecSample()
Definition: GETChannel.icc:137
int GetSaturationHigh() const
Definition: GETChannel.icc:96
GETSample signal_out
Output signal from AGET.
Definition: GETChannel.hh:63
virtual void ClearEvent()
Definition: GETChannel.cpp:154
int satur_high
Higher saturated time bucket.
Definition: GETChannel.hh:70
bool IsModeSimul() const
Definition: GETChannel.icc:40
GETCfgChannel * config
Configuration data.
Definition: GETChannel.hh:55
Definition: GETObject.hh:38
int GetSignalId() const
Definition: GETChannel.icc:72
virtual void Reset()
Definition: GETChannel.cpp:87
virtual string GetObjectId() const
Definition: GETChannel.icc:46
virtual void Init(u_int n, double dt)
Definition: GETChannel.cpp:102
u_int satur_count
Number of data over saturation threshold.
Definition: GETChannel.hh:68
virtual void SetTimeStep(double dt)
Definition: GETChannel.cpp:142
GETSample & OutSample()
Definition: GETChannel.icc:132
RRealSampleFFT GETSample
Define the data type for samples.
Definition: GETCommon.hh:31
GETSample signal_rec
Reconstructed signal (filtering and deconvolution)
Definition: GETChannel.hh:64
virtual int ApplyOutputNoise(GETSample &out_sample)
Definition: GETChannel.cpp:583
u_int GetSaturationCount() const
Definition: GETChannel.icc:84
bool read_ok[512]
Flag for read data.
Definition: GETChannel.hh:66
GObject(GETChannel)
virtual void SetSaturation(u_int buckid)
Definition: GETChannel.cpp:246
u_short GetLastCell() const
Definition: GETChannel.cpp:208
bool IsFPNChannel() const
Definition: GETChannel.cpp:68
virtual int ProcessOutFromTst(bool in_noise=true, bool out_noise=true)
Definition: GETChannel.cpp:353
Definition: GETCfgChannel.hh:25
virtual int ResetConfig()
Definition: GETChannel.cpp:57
int satur_low
Lower saturated time bucket.
Definition: GETChannel.hh:69
virtual u_int GetReadoutMultiplicity(bool fpn=true) const
Definition: GETChannel.cpp:282
virtual void ResetReadCount()
Definition: GETChannel.icc:27
GETSample & TstSample()
Definition: GETChannel.icc:127
virtual int ProcessData(bool in_noise=true)
Definition: GETChannel.cpp:305
GETChannel(u_int n=0, double dt=0.01L)
Definition: GETChannel.cpp:20
u_short data_mode
Whether data comes from an experimental file or from simulation.
Definition: GETChannel.hh:59
Definition: GETAGet.hh:34
bool IsSignalChannel() const
Definition: GETChannel.icc:21
Definition: GETSystem.hh:147