GET library
GETLookupTable.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file GETLookupTable.hh
3  *
4  * Include file for the GETLookupTable class.
5  */
6 //======================================================================
7 
8 #ifndef GET_LOOKUP_TABLE_HH
9 #define GET_LOOKUP_TABLE_HH
10 
11 //----------------------------------------------------------------------
12 #include "GETCommon.hh"
13 
14 class GETSystem;
15 
16 //======================================================================
17 /*! \class GETLookupTable
18  *
19  * This class defines a lookup table for a detector using the
20  * GET electronics.
21  *
22  * The lookup table allows to relate the electronic channel
23  * identification to the detector physical channel.
24  * The FPN channels are not part of the detector physical channels.
25  *
26  * The electronics channels are defined by their CoBo, AsAd, AGet and
27  * channel (in AGet) indexes.
28  * The physical channels are defined by their pad number and X/Y
29  * position index (for a pad plane detector).
30  *
31  */
33 {
34  //------------------------------------------------------------
35  /*! \object_doc */
37  //------------------------------------------------------------
38 
39  protected:
40  u_int size; ///< Number of GET channels
41  u_int pads_number; ///< Number of pads
42 
43  u_int npad_x; ///< Number of pads along X
44  u_int npad_y; ///< Number of pads along Y
45 
46  int * pad; ///< Pad identifier (effective signal channel)
47  int * cobo; ///< CoBo identifier
48  int * asad; ///< AsAd identifier
49  int * aget; ///< AGet identifier
50  int * channel; ///< AGet channel identifier
51  int * ipx; ///< Pad X number
52  int * ipy; ///< Pad Y number
53 
54  int * chan_xy; ///< Array identifying channel from ix and iy indexes
55 
56  bool defined; ///< Whether the table data has been set
57 
58  public:
59  //----------------------------------------------------------
60  /** @name Constructors, affectation, destructor */
61  //@{
62  GETLookupTable ( u_int nch = 0, u_int nx = 0, u_int ny = 0 );
63  virtual ~GETLookupTable ( );
64  //@}
65 
66  //----------------------------------------------------------
67  /** @name Table building */
68  //@{
69  virtual void EraseTables ( );
70  virtual int InitTables ( u_int nch, u_int nx, u_int ny );
71  virtual int InitTables ( GETSystem & get, u_int nx, u_int ny );
72 
73  virtual bool IsTableSet ( ) const; // inline
74 
75  virtual int SetDefaultTable ( GETSystem & get, u_int nx, u_int ny );
76  virtual int SetHVpad64Table ( GETSystem & get, u_int ny );
77 
78  //@}
79 
80  //----------------------------------------------------------
81  /** @name Table data */
82  //@{
83  virtual u_int GetSize ( ) const; // inline
84  virtual int GetPad ( u_int nch ) const; // inline
85  virtual int GetCoBo ( u_int nch ) const; // inline
86  virtual int GetAsAd ( u_int nch ) const; // inline
87  virtual int GetAGet ( u_int nch ) const; // inline
88  virtual int GetChannel ( u_int nch ) const; // inline
89  virtual int GetIpx ( u_int nch ) const; // inline
90  virtual int GetIpy ( u_int nch ) const; // inline
91 
92  virtual int GetChannel ( u_int ix, u_int iy ) const; // inline
93  virtual u_int GetNpadX ( ) const; // inline
94  virtual u_int GetNpadY ( ) const; // inline
95 
96  virtual void DumpTable ( const string & fname, bool head = true ) const;
97  virtual void DumpTable ( FILE * fp, bool head = true ) const;
98 
99  virtual void DumpXY ( const string & fname, bool head = true ) const;
100  virtual void DumpXY ( FILE * fp, bool head = true ) const;
101 
102  virtual int Read ( const string & fname, bool rpad = true, bool invxy = false );
103  virtual int Read ( FILE * fp, bool rpad = true, bool invxy = false );
104 
105  //@}
106 
107  //----------------------------------------------------------
108  /** @name ROOT related functions */
109  //@{
110  public:
111 
112  /*! for use within ROOT.*/
114  //@}
115 };
116 
117 
118 //----------------------------------------------------------------------
119 // Inline functions
120 #include "icc/GETLookupTable.icc"
121 
122 
123 //======================================================================
124 #endif
int * chan_xy
Array identifying channel from ix and iy indexes.
Definition: GETLookupTable.hh:54
virtual u_int GetNpadX() const
Definition: GETLookupTable.icc:75
u_int size
Number of GET channels.
Definition: GETLookupTable.hh:40
virtual int GetAGet(u_int nch) const
Definition: GETLookupTable.icc:43
int * cobo
CoBo identifier.
Definition: GETLookupTable.hh:47
u_int npad_x
Number of pads along X.
Definition: GETLookupTable.hh:43
virtual ~GETLookupTable()
Definition: GETLookupTable.cpp:52
virtual void DumpTable(const string &fname, bool head=true) const
Definition: GETLookupTable.cpp:379
int * ipy
Pad Y number.
Definition: GETLookupTable.hh:52
virtual int GetCoBo(u_int nch) const
Definition: GETLookupTable.icc:31
virtual u_int GetSize() const
Definition: GETLookupTable.icc:13
ClassDef(GETLookupTable, 0)
virtual int GetIpy(u_int nch) const
Definition: GETLookupTable.icc:61
u_int pads_number
Number of pads.
Definition: GETLookupTable.hh:41
virtual bool IsTableSet() const
Definition: GETLookupTable.icc:17
int * channel
AGet channel identifier.
Definition: GETLookupTable.hh:50
int * ipx
Pad X number.
Definition: GETLookupTable.hh:51
virtual int SetHVpad64Table(GETSystem &get, u_int ny)
Definition: GETLookupTable.cpp:286
virtual int GetIpx(u_int nch) const
Definition: GETLookupTable.icc:55
virtual int GetPad(u_int nch) const
Definition: GETLookupTable.icc:25
int * aget
AGet identifier.
Definition: GETLookupTable.hh:49
virtual int InitTables(u_int nch, u_int nx, u_int ny)
Definition: GETLookupTable.cpp:107
virtual int Read(const string &fname, bool rpad=true, bool invxy=false)
Definition: GETLookupTable.cpp:477
virtual void DumpXY(const string &fname, bool head=true) const
Definition: GETLookupTable.cpp:423
virtual u_int GetNpadY() const
Definition: GETLookupTable.icc:79
virtual void EraseTables()
Definition: GETLookupTable.cpp:68
Definition: GETLookupTable.hh:32
int * pad
Pad identifier (effective signal channel)
Definition: GETLookupTable.hh:46
GObject(GETLookupTable)
virtual int GetChannel(u_int nch) const
Definition: GETLookupTable.icc:49
virtual int GetAsAd(u_int nch) const
Definition: GETLookupTable.icc:37
GETLookupTable(u_int nch=0, u_int nx=0, u_int ny=0)
Definition: GETLookupTable.cpp:22
bool defined
Whether the table data has been set.
Definition: GETLookupTable.hh:56
virtual int SetDefaultTable(GETSystem &get, u_int nx, u_int ny)
Definition: GETLookupTable.cpp:209
int * asad
AsAd identifier.
Definition: GETLookupTable.hh:48
Definition: GETSystem.hh:126
u_int npad_y
Number of pads along Y.
Definition: GETLookupTable.hh:44