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 is_read; ///< Flag indicating whether the channel was read (from exp. raw 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 
70  public:
71  //----------------------------------------------------------
72  /** @name Constructors, affectation, destructor */
73  //@{
74  GETChannel ( u_int n = 0, double dt = 0.01L );
75  virtual ~GETChannel ( );
76  //@}
77 
78  //----------------------------------------------------------
79  /** @name GET configuration */
80  //@{
81  virtual int ResetConfig ( );
82 
83  const GETCfgChannel * GetConfig ( ) const; // inline
84  GETCfgChannel * GetConfig ( ); // inline
85 
86  bool IsFPNChannel ( ) const;
87  bool IsSignalChannel ( ) const; // inline
88  //@}
89 
90  //----------------------------------------------------------
91  /** @name Initialization functions */
92  //@{
93  virtual void Reset ( );
94  virtual void Init ( u_int n, double dt );
95  virtual void SetTimeStep ( double dt );
96  virtual void ClearEvent ( );
97 
98  virtual void ValidDataSet ( );
99  virtual void ValidSimulSet ( );
100  bool IsModeData ( ) const; // inline
101  bool IsModeSimul ( ) const; // inline
102  //@}
103 
104  //----------------------------------------------------------
105  /** @name GET system core objects functions */
106  //@{
107  int GetSignalId ( ) const; // inline
108  virtual string GetObjectId ( ) const; // inline
109  virtual u_int GetChannelCount ( ) const; // inline
110 
111  virtual u_int GetChildrenNumber ( ) const; // inline
112  virtual const GETObject * GetChild ( u_int i ) const; // inline
113  virtual GETObject * GetChild ( u_int i ); // inline
114 
115  u_short GetLastCell ( ) const;
116 
117  u_int GetSaturationCount ( ) const; // inline
118  virtual u_int GetReadoutMultiplicity ( bool fpn = true ) const;
119  virtual double GetSignalSum ( u_short info = GET::signalOut );
120  //@}
121 
122  //----------------------------------------------------------
123  /** @name Channel samples (Test, Output, Reconstructed) function */
124  //@{
125 
126  bool GetReadoutFlag ( ) const; // inline
127  u_int GetReadoutCount ( ) const; // inline
128 
129  GETSample & TstSample ( ); // inline
130  GETSample & OutSample ( ); // inline
131  GETSample & RecSample ( ); // inline
132 
133  virtual int ProcessData ( bool in_noise = true );
134  virtual int ProcessOutFromTst ( bool in_noise = true, bool out_noise = true );
135  virtual int ProcessRecFromOut ( bool out_corr = true );
136 
137  virtual int ProcessOutputCorrection ( );
138 
139  virtual int ApplyOutputNoise ( GETSample & out_sample );
140  virtual int ApplyOutputCorrection ( GETSample & cor_sample );
141  //@}
142 
143 
144  //------------------------------------------------------------
145  /** @name Read / write of custom objects scheme */
146  //@{
147 
148  //@}
149 
150 
151  //----------------------------------------------------------
152  /** @name ROOT related functions */
153  //@{
154  public:
155 
156  /*! for use within ROOT.*/
157  ClassDef(GETChannel,0);
158  //@}
159 };
160 
161 
162 //----------------------------------------------------------------------
163 // Inline functions
164 #include "icc/GETChannel.icc"
165 
166 
167 //======================================================================
168 #endif
int sig_id
Signal channel identifier (0-63 for signal, 64-67 for FPN)
Definition: GETChannel.hh:58
virtual ~GETChannel()
Definition: GETChannel.cpp:40
virtual int ProcessOutputCorrection()
Definition: GETChannel.cpp:493
u_int GetReadoutCount() const
Definition: GETChannel.icc:79
virtual int ApplyOutputCorrection(GETSample &cor_sample)
Definition: GETChannel.cpp:577
static const u_short signalOut
Output (experimental data) signal sample.
Definition: GETCommon.hh:104
virtual void ValidSimulSet()
Definition: GETChannel.cpp:184
ClassDef(GETChannel, 0)
virtual double GetSignalSum(u_short info=GET::signalOut)
Definition: GETChannel.cpp:214
bool IsModeData() const
Definition: GETChannel.icc:27
bool is_read
Flag indicating whether the channel was read (from exp. raw data)
Definition: GETChannel.hh:66
const GETCfgChannel * GetConfig() const
Definition: GETChannel.icc:13
GETSample signal_tst
Test (input) signal (for simulation)
Definition: GETChannel.hh:62
Definition: GETChannel.hh:41
virtual void ValidDataSet()
Definition: GETChannel.cpp:168
virtual u_int GetChannelCount() const
Definition: GETChannel.icc:41
virtual u_int GetChildrenNumber() const
Definition: GETChannel.icc:45
virtual int ProcessRecFromOut(bool out_corr=true)
Definition: GETChannel.cpp:402
virtual const GETObject * GetChild(u_int i) const
Definition: GETChannel.icc:51
u_int read_count
Number of data read for the channel (from exp. raw data)
Definition: GETChannel.hh:67
GETSample & RecSample()
Definition: GETChannel.icc:94
bool GetReadoutFlag() const
Definition: GETChannel.icc:75
GETSample signal_out
Output signal from AGET.
Definition: GETChannel.hh:63
virtual void ClearEvent()
Definition: GETChannel.cpp:151
bool IsModeSimul() const
Definition: GETChannel.icc:31
GETCfgChannel * config
Configuration data.
Definition: GETChannel.hh:55
Definition: GETObject.hh:38
int GetSignalId() const
Definition: GETChannel.icc:63
virtual void Reset()
Definition: GETChannel.cpp:87
virtual string GetObjectId() const
Definition: GETChannel.icc:37
virtual void Init(u_int n, double dt)
Definition: GETChannel.cpp:99
u_int satur_count
Number of data over saturation threshold.
Definition: GETChannel.hh:68
virtual void SetTimeStep(double dt)
Definition: GETChannel.cpp:139
GETSample & OutSample()
Definition: GETChannel.icc:89
RRealSampleFFT GETSample
Define the data type for samples.
Definition: GETCommon.hh:27
GETSample signal_rec
Reconstructed signal (filtering and deconvolution)
Definition: GETChannel.hh:64
virtual int ApplyOutputNoise(GETSample &out_sample)
Definition: GETChannel.cpp:531
u_int GetSaturationCount() const
Definition: GETChannel.icc:69
GObject(GETChannel)
u_short GetLastCell() const
Definition: GETChannel.cpp:202
bool IsFPNChannel() const
Definition: GETChannel.cpp:67
virtual int ProcessOutFromTst(bool in_noise=true, bool out_noise=true)
Definition: GETChannel.cpp:309
Definition: GETCfgChannel.hh:25
virtual int ResetConfig()
Definition: GETChannel.cpp:56
virtual u_int GetReadoutMultiplicity(bool fpn=true) const
Definition: GETChannel.cpp:238
GETSample & TstSample()
Definition: GETChannel.icc:84
virtual int ProcessData(bool in_noise=true)
Definition: GETChannel.cpp:261
GETChannel(u_int n=0, double dt=0.01L)
Definition: GETChannel.cpp:19
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:126