GET library
GETAsAd.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file GETAsAd.hh
3  *
4  * Include file for the GETAsAd class.
5  */
6 //======================================================================
7 
8 #ifndef GET_ASAD_HH
9 #define GET_ASAD_HH
10 
11 //----------------------------------------------------------------------
12 
13 #include "GETAGet.hh"
14 #include "GETCfgAsAd.hh"
15 
16 //! Number of chips (AGET) on the AsAd board
17 #define ASAD_SIZE 4
18 
19 //! Undefined serial identifier
20 #define ASAD_SERIAL_UNDEF "NoSerialId"
21 
22 class GETCoBo;
23 
24 //======================================================================
25 /*! \class GETAsAd
26  *
27  * This class describes the AsAd board, that holds 4 Aget chips.
28  *
29  * In addition to the GETObject identification in the architecture,
30  * the AsAd boards are identified with a serial number, that may be
31  * used for calibration files identification.
32  * This serial number should be unique, and set by user for each AsAd
33  * board.
34  */
35 class GETAsAd : public GETObject
36 {
37  //------------------------------------------------------------
38  /*! \object_doc */
40  //------------------------------------------------------------
41 
42  friend class GETCoBo;
43  friend class GETCfgAsAd;
44 
45  protected:
46  string serial_id; ///< Unique board identifier
47 
48  // GET architecture
49  GETAGet aget[ASAD_SIZE]; ///< AGET chips
50 
51  // GET configuration
52  GETCfgAsAd * config; ///< Configuration data
53 
54  public:
55  //----------------------------------------------------------
56  /** @name Constructors, affectation, destructor */
57  //@{
58  GETAsAd ( u_int n = 0, double dt = 0.01L );
59  virtual ~GETAsAd ( );
60  //@}
61 
62  //----------------------------------------------------------
63  /** @name GET configuration */
64  //@{
65  virtual int ResetConfig ( );
66 
67  const GETCfgAsAd * GetConfig ( ) const; // inline
68  GETCfgAsAd * GetConfig ( ); // inline
69  //@}
70 
71  //----------------------------------------------------------
72  /** @name Initialization functions */
73  //@{
74  virtual void Reset ( );
75  virtual void Init ( u_int n, double dt );
76  virtual void ClearEvent ( );
77  //@}
78 
79  //----------------------------------------------------------
80  /** @name GET system core objects functions */
81  //@{
82  virtual string GetObjectId ( ) const; // inline
83 
84  virtual string GetSerialId ( ) const; // inline
85  void SetSerialId ( const string & ser_id ); // inline // inline
86 
87  virtual u_int GetChildrenNumber ( ) const; // inline
88  virtual const GETObject * GetChild ( u_int i ) const; // inline
89  virtual GETObject * GetChild ( u_int i ); // inline
90 
91  const GETAGet & operator [] ( u_int n ) const; // inline
92  GETAGet & operator [] ( u_int n ); // inline
93  //@}
94 
95  //------------------------------------------------------------
96  /** @name Read / write of custom objects scheme */
97  //@{
98 
99  int SaveSamples ( const string & filename, u_short info = GET::signalOut );
100  int ReadSamples ( const string & filename, u_short info = GET::signalOut );
101 
102  int SaveOutputs ( const string & filename ); // inline
103  int ReadOutputs ( const string & filename ); // inline
104 
105  int SaveReconstructed ( const string & filename ); // inline
106  int ReadReconstructed ( const string & filename ); // inline
107 
108  //@}
109 
110  //----------------------------------------------------------
111  /** @name Processes functions */
112  //@{
113  virtual int SetResponseFunctions ( const string & rf_file );
114 
115  //@}
116 
117  //----------------------------------------------------------
118  /** @name ROOT related functions */
119  //@{
120  public:
121 
122  /*! for use within ROOT.*/
123  ClassDef(GETAsAd,0);
124  //@}
125 };
126 
127 //----------------------------------------------------------------------
128 // Inline functions
129 #include "icc/GETAsAd.icc"
130 
131 
132 //======================================================================
133 #endif
134 
virtual ~GETAsAd()
Definition: GETAsAd.cpp:36
virtual string GetSerialId() const
Definition: GETAsAd.icc:28
Definition: GETAsAd.hh:35
void SetSerialId(const string &ser_id)
Definition: GETAsAd.icc:34
virtual u_int GetChildrenNumber() const
Definition: GETAsAd.icc:39
static const u_short signalOut
Output (experimental data) signal sample.
Definition: GETCommon.hh:110
int SaveReconstructed(const string &filename)
Definition: GETAsAd.icc:88
ClassDef(GETAsAd, 0)
virtual void Reset()
Definition: GETAsAd.cpp:73
virtual string GetObjectId() const
Definition: GETAsAd.icc:23
int ReadReconstructed(const string &filename)
Definition: GETAsAd.icc:94
GETCfgAsAd * config
Configuration data.
Definition: GETAsAd.hh:52
int ReadOutputs(const string &filename)
Definition: GETAsAd.icc:82
int ReadSamples(const string &filename, u_short info=GET::signalOut)
Definition: GETAsAd.cpp:185
virtual void ClearEvent()
Definition: GETAsAd.cpp:124
virtual int ResetConfig()
Definition: GETAsAd.cpp:52
GETAGet aget[4]
AGET chips.
Definition: GETAsAd.hh:49
virtual const GETObject * GetChild(u_int i) const
Definition: GETAsAd.icc:45
GETAsAd(u_int n=0, double dt=0.01L)
Definition: GETAsAd.cpp:20
Definition: GETCfgAsAd.hh:27
Definition: GETObject.hh:38
GObject(GETAsAd)
int SaveOutputs(const string &filename)
Definition: GETAsAd.icc:76
const GETCfgAsAd * GetConfig() const
Definition: GETAsAd.icc:13
const GETAGet & operator[](u_int n) const
Definition: GETAsAd.icc:67
virtual void Init(u_int n, double dt)
Definition: GETAsAd.cpp:87
virtual int SetResponseFunctions(const string &rf_file)
Definition: GETAsAd.cpp:237
#define ASAD_SIZE
Number of chips (AGET) on the AsAd board.
Definition: GETAsAd.hh:17
string serial_id
Unique board identifier.
Definition: GETAsAd.hh:46
Definition: GETCoBo.hh:27
int SaveSamples(const string &filename, u_short info=GET::signalOut)
Definition: GETAsAd.cpp:139
Definition: GETAGet.hh:34