GET library
GETProcess.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file GETProcess.hh
3  *
4  * Include file for the GETProcess class.
5  */
6 //======================================================================
7 
8 #ifndef GET_PROCESS_HH
9 #define GET_PROCESS_HH
10 
11 //----------------------------------------------------------------------
12 
13 #include "GETCommon.hh"
14 class GETChannel;
15 class GETObject;
16 
17 //======================================================================
18 /*! \class GETProcess
19  *
20  * This is a base class for samples processing objects: response functions,
21  * filters, noise generators...
22  *
23  * The objects deriving from this base class are processes that acts
24  * on the data from a single channel.
25  *
26  * Because each process defines (at least) one internal data sample
27  * with the dimension of the channels signal to process, the base
28  * constructors require the dimension and sampling period of the
29  * GET channels.
30  *
31  */
33 {
34  //------------------------------------------------------------
35  /*! \object_doc */
37  //------------------------------------------------------------
38 
39  protected:
40  GETSample result_sample; ///< Internal processing result sample (processing result)
41 
42  u_int options; ///< Option flags
43 
44  public:
45  //----------------------------------------------------------
46  /** @name Constructors, affectation, destructor */
47  //@{
48  GETProcess ( GETObject & obj );
49  GETProcess ( u_int n = 0, double dt = 0.01 );
50  GETProcess ( const GETProcess & proc );
51  virtual ~GETProcess ( );
52  //@}
53 
54  //----------------------------------------------------------
55  /** @name Initialization functions */
56  //@{
57  virtual void SetOptions ( u_int opts ); // inline
58  virtual void SetOption ( u_int flags, bool b = true ); // inline
59  virtual u_int GetOptions ( ); // inline
60  virtual bool GetOption ( u_int flags ); // inline
61 
62  virtual void Init ( u_int n, double dt ); // inline
63  //@}
64 
65  //----------------------------------------------------------
66  /** @name Access to class data */
67  //@{
68  u_int GetDimension ( ) const; // inline
69  double GetSamplingTime ( ) const; // inline
70 
71  GETSample * GetResultSamplePtr ( ); // inline
72  const GETSample * GetResultSamplePtr ( ) const; // inline
73  GETSample & GetResultSample ( ); // inline
74  const GETSample & GetResultSample ( ) const; // inline
75  //@}
76 
77 
78  //----------------------------------------------------------
79  /** @name Processing */
80  //@{
81 
82  /*! This function process the argument channel and stores the result
83  * in the internal sample.
84  * The channel sample that is processed depends on the type of
85  * processing, and of the \b info argument if required.
86  * The function returns the internal result sample pointer.
87  * In case of error, the result is a NULL pointer.
88  *
89  * \note
90  * The channel samples are not modified, the result is stored in the
91  * process internal sample.
92  *
93  * \param channel GET system channel to be processed
94  * \param info additional optional information (sample signal identifier)
95  */
96  virtual GETSample * ProcessSample ( GETChannel & channel,
97  u_short info ) = 0;
98 
99  /*! This function process the input \b sample channel and stores the result
100  * in the \b result sample.
101  * The channel argument is provided if processing (from derived classes)
102  * may be affected by GET core objects properties.
103  * The function returns the (argument) result sample pointer.
104  * In case of error, the result is a NULL pointer.
105  *
106  * Note that the \b sample to be processed and the \b result sample
107  * can be the same object, in which case the initial sample is replaced
108  * by the processing result.
109  *
110  * \note
111  * - The \b sample to be processed and the \b result sample
112  * can be the same object, in which case the initial sample is replaced
113  * by the processing result.
114  *
115  * \param sample input sample to be processed
116  * \param result sample where result should be stored
117  * \param channel GET system channel (the samples should correspond to this channel)
118  */
119  virtual GETSample * ProcessSample ( GETSample & sample,
120  GETSample & result,
121  GETChannel & channel ) = 0;
122  //@}
123 
124 
125  //----------------------------------------------------------
126  /** @name ROOT related functions */
127  //@{
128  public:
129 
130  /*! for use within ROOT.*/
131  ClassDef(GETProcess,0);
132  //@}
133 };
134 
135 
136 //----------------------------------------------------------------------
137 // Inline functions
138 #include "icc/GETProcess.icc"
139 
140 
141 //======================================================================
142 #endif
GETProcess(GETObject &obj)
Definition: GETProcess.cpp:19
GObjectV(GETProcess)
virtual bool GetOption(u_int flags)
Definition: GETProcess.icc:30
GETSample * GetResultSamplePtr()
Definition: GETProcess.icc:44
virtual u_int GetOptions()
Definition: GETProcess.icc:23
Definition: GETChannel.hh:41
ClassDef(GETProcess, 0)
virtual void SetOptions(u_int opts)
Definition: GETProcess.icc:11
GETSample result_sample
Internal processing result sample (processing result)
Definition: GETProcess.hh:40
u_int GetDimension() const
Definition: GETProcess.icc:61
virtual void Init(u_int n, double dt)
Definition: GETProcess.icc:39
GETSample & GetResultSample()
Definition: GETProcess.icc:48
u_int options
Option flags.
Definition: GETProcess.hh:42
Definition: GETObject.hh:38
double GetSamplingTime() const
Definition: GETProcess.icc:65
virtual ~GETProcess()
Definition: GETProcess.cpp:63
virtual GETSample * ProcessSample(GETChannel &channel, u_short info)=0
RRealSampleFFT GETSample
Define the data type for samples.
Definition: GETCommon.hh:27
Definition: GETProcess.hh:32
virtual void SetOption(u_int flags, bool b=true)
Definition: GETProcess.icc:18