GET library
GETHitMask.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file GETHitMask.hh
3  *
4  * Include file for the GETHitMask class.
5  */
6 //======================================================================
7 
8 #ifndef GET_HIT_MASK_HH
9 #define GET_HIT_MASK_HH
10 
11 //----------------------------------------------------------------------
12 #include "GETCommon.hh"
13 #include "GETChannel.hh"
14 
15 class GETSystem;
16 
17 
18 //======================================================================
19 /*! \class GETHitMask
20  *
21  * This class defines a mask for analysis of the hit channels of
22  * the detector.
23  *
24  * It requires that the lookup table is defined for the GET system.
25  *
26  * The hit mask associated a logical value to each channel, indicating
27  * that the channel signal is larger than a threshold.
28  */
30 {
31  //------------------------------------------------------------
32  /*! \object_doc */
34  //------------------------------------------------------------
35 
36  protected:
37  GETSystem * get_ptr; ///< Pointer to the GET system
38  u_short data_info; ///< The flag indicating on which data the mask acts (test, output or reconstructed sample)
39 
40  u_int size; ///< Number of GET channels
41  bool * hit_table; ///< Table of hit channels
42  bool * val_table; ///< Table of valid channels
43  double * threshold; ///< Current mask threshold table
44 
45  bool mask_set; ///< Whether the mask has been computed
46  u_int nhit; ///< Number of hit channels
47  u_int nhit_val; ///< Number of hit valid channels
48 
49  public:
50  //----------------------------------------------------------
51  /** @name Constructors, affectation, destructor */
52  //@{
53  GETHitMask ( GETSystem * get = NULL );
54  GETHitMask ( const GETHitMask & mask );
55  GETHitMask & operator = ( const GETHitMask & mask );
56  virtual ~GETHitMask ( );
57 
58  virtual void CopyData ( const GETHitMask & mask );
59  //@}
60 
61  //----------------------------------------------------------
62  /** @name Hit mask building */
63  //@{
64  virtual void EraseMask ( );
65  virtual int InitMask ( );
66  virtual void ClearHitMask ( );
67  virtual void ClearValidMask ( );
68  virtual void InvertHits ( );
69 
70  virtual bool IsMaskDefined ( ) const; // inline
71  virtual bool IsMaskSet ( ) const; // inline
72 
73  virtual void SetDataInfo ( u_short info ); // inline
74  virtual u_short GetDataInfo ( ) const; // inline
75  //@}
76 
77  //----------------------------------------------------------
78  /** @name Hit mask data */
79  //@{
80  GETSystem * GetSystemPtr ( ) const; // inline
81 
82  virtual u_int GetSize ( ) const; // inline
83  virtual u_int GetNhit ( ) const; // inline
84  virtual u_int GetNhitValid ( ) const; // inline
85 
86  virtual double GetThreshold ( u_int ic = 0 ) const; // inline
87  virtual void SetThreshold ( double thr );
88  virtual void SetThreshold ( u_int ic, double thr );
89 
90  virtual void SetThresholds ( double * tab );
91  virtual void SetThresholds ( const string & fname, double fact = 1., double cst = 0. );
92 
93  virtual u_int UpdateMask ( );
94 
95  virtual void SetValid ( u_int ic, bool b = true ); // inline
96  virtual void SetHit ( u_int ic, bool b = true ); // inline
97  virtual bool IsValid ( u_int ic ) const; // inline
98  virtual bool IsHit ( u_int ic ) const; // inline
99  virtual bool IsValidHit ( u_int ic ) const; // inline
100  //@}
101 
102  //----------------------------------------------------------
103  /** @name Read-write function */
104  //@{
105  virtual int WriteFileText ( const string & fname );
106 
107  virtual int CreateThresholdXML ( const string & fname, const double rdiscri = 0.05 );
108  //@}
109 
110  //----------------------------------------------------------
111  /** @name ROOT related functions */
112  //@{
113  public:
114 
115  /*! for use within ROOT.*/
116  ClassDef(GETHitMask,0);
117  //@}
118 };
119 
120 
121 //----------------------------------------------------------------------
122 // Inline functions
123 #include "icc/GETHitMask.icc"
124 
125 
126 //======================================================================
127 #endif
virtual int WriteFileText(const string &fname)
Definition: GETHitMask.cpp:379
bool * hit_table
Table of hit channels.
Definition: GETHitMask.hh:41
virtual void SetThresholds(double *tab)
Definition: GETHitMask.cpp:274
virtual ~GETHitMask()
Definition: GETHitMask.cpp:85
virtual u_int GetNhit() const
Definition: GETHitMask.icc:40
GObject(GETHitMask)
GETSystem * get_ptr
Pointer to the GET system.
Definition: GETHitMask.hh:37
virtual void InvertHits()
Definition: GETHitMask.cpp:215
virtual bool IsMaskDefined() const
Definition: GETHitMask.icc:9
virtual u_int GetSize() const
Definition: GETHitMask.icc:36
virtual void ClearHitMask()
Definition: GETHitMask.cpp:189
virtual int InitMask()
Definition: GETHitMask.cpp:145
GETHitMask(GETSystem *get=NULL)
Definition: GETHitMask.cpp:22
Definition: GETHitMask.hh:29
virtual void SetHit(u_int ic, bool b=true)
Definition: GETHitMask.icc:85
virtual bool IsHit(u_int ic) const
Definition: GETHitMask.icc:65
virtual int CreateThresholdXML(const string &fname, const double rdiscri=0.05)
Definition: GETHitMask.cpp:432
virtual void ClearValidMask()
Definition: GETHitMask.cpp:202
u_int nhit_val
Number of hit valid channels.
Definition: GETHitMask.hh:47
virtual void SetValid(u_int ic, bool b=true)
Definition: GETHitMask.icc:78
virtual bool IsMaskSet() const
Definition: GETHitMask.icc:13
virtual bool IsValidHit(u_int ic) const
Definition: GETHitMask.icc:71
u_int size
Number of GET channels.
Definition: GETHitMask.hh:40
GETSystem * GetSystemPtr() const
Definition: GETHitMask.icc:32
virtual void EraseMask()
Definition: GETHitMask.cpp:125
virtual double GetThreshold(u_int ic=0) const
Definition: GETHitMask.icc:50
virtual void CopyData(const GETHitMask &mask)
Definition: GETHitMask.cpp:98
virtual u_int UpdateMask()
Definition: GETHitMask.cpp:332
GETHitMask & operator=(const GETHitMask &mask)
Definition: GETHitMask.cpp:73
virtual bool IsValid(u_int ic) const
Definition: GETHitMask.icc:58
bool * val_table
Table of valid channels.
Definition: GETHitMask.hh:42
virtual void SetThreshold(double thr)
Definition: GETHitMask.cpp:240
u_int nhit
Number of hit channels.
Definition: GETHitMask.hh:46
virtual u_int GetNhitValid() const
Definition: GETHitMask.icc:44
virtual void SetDataInfo(u_short info)
Definition: GETHitMask.icc:20
u_short data_info
The flag indicating on which data the mask acts (test, output or reconstructed sample) ...
Definition: GETHitMask.hh:38
bool mask_set
Whether the mask has been computed.
Definition: GETHitMask.hh:45
ClassDef(GETHitMask, 0)
virtual u_short GetDataInfo() const
Definition: GETHitMask.icc:26
Definition: GETSystem.hh:126
double * threshold
Current mask threshold table.
Definition: GETHitMask.hh:43