GET library
GETHitMask Class Reference

#include <GETHitMask.hh>

Inheritance diagram for GETHitMask:
GETHitMaskXY

Public Member Functions

Constructors, affectation, destructor
 GETHitMask (GETSystem *get=NULL)
 
 GETHitMask (const GETHitMask &mask)
 
GETHitMaskoperator= (const GETHitMask &mask)
 
virtual ~GETHitMask ()
 
virtual void CopyData (const GETHitMask &mask)
 
Hit mask building
virtual void EraseMask ()
 
virtual int InitMask ()
 
virtual void ClearHitMask ()
 
virtual void ClearValidMask ()
 
virtual void InvertHits ()
 
virtual bool IsMaskDefined () const
 
virtual bool IsMaskSet () const
 
virtual void SetDataInfo (u_short info)
 
virtual u_short GetDataInfo () const
 
Hit mask data
GETSystemGetSystemPtr () const
 
virtual u_int GetSize () const
 
virtual u_int GetNhit () const
 
virtual u_int GetNhitValid () const
 
virtual double GetThreshold (u_int ic=0) const
 
virtual void SetThreshold (double thr)
 
virtual void SetThreshold (u_int ic, double thr)
 
virtual void SetThresholds (double *tab)
 
virtual void SetThresholds (const string &fname, double fact=1., double cst=0.)
 
virtual u_int UpdateMask ()
 
virtual void SetValid (u_int ic, bool b=true)
 
virtual void SetHit (u_int ic, bool b=true)
 
virtual bool IsValid (u_int ic) const
 
virtual bool IsHit (u_int ic) const
 
virtual bool IsValidHit (u_int ic) const
 
Read-write function
virtual int WriteFileText (const string &fname)
 
virtual int CreateThresholdXML (const string &fname, const double rdiscri=0.05)
 
ROOT related functions
 ClassDef (GETHitMask, 0)
 

Protected Attributes

u_short data_info
 The flag indicating on which data the mask acts (test, output or reconstructed sample)
 
GETSystemget_ptr
 Pointer to the GET system.
 
bool * hit_table
 Table of hit channels.
 
bool mask_set
 Whether the mask has been computed.
 
u_int nhit
 Number of hit channels.
 
u_int nhit_val
 Number of hit valid channels.
 
u_int size
 Number of GET channels.
 
double * threshold
 Current mask threshold table.
 
bool * val_table
 Table of valid channels.
 

Private Member Functions

 GObject (GETHitMask)
 

Detailed Description

This class defines a mask for analysis of the hit channels of the detector.

It requires that the lookup table is defined for the GET system.

The hit mask associated a logical value to each channel, indicating that the channel signal is larger than a threshold.

Constructor & Destructor Documentation

GETHitMask::GETHitMask ( GETSystem get = NULL)

Constructor from a GET system. The look-up table of the system must be defined in order to create the hit mask data. Otherwise, the mask must be initialised when the look-up table is defined.

References data_info, get_ptr, hit_table, InitMask(), mask_set, nhit, nhit_val, GET::signalOut, size, threshold, and val_table.

GETHitMask::GETHitMask ( const GETHitMask mask)

Copy constructor.

Parameters
maskobject to copy

References CopyData(), data_info, get_ptr, hit_table, mask_set, nhit, nhit_val, GET::signalOut, size, threshold, and val_table.

GETHitMask::~GETHitMask ( )
virtual

Destructor.

References EraseMask().

Member Function Documentation

GETHitMask::ClassDef ( GETHitMask  ,
 
)

for use within ROOT.

void GETHitMask::ClearHitMask ( )
virtual

Clear the hit mask (all channels hit set to false).

Reimplemented in GETHitMaskXY.

References hit_table, mask_set, nhit, nhit_val, and size.

Referenced by GETSystem::ClearEvent(), GETHitMaskXY::ClearHitMask(), InitMask(), SetThreshold(), SetThresholds(), and UpdateMask().

void GETHitMask::ClearValidMask ( )
virtual

Clear the validation mask (all channels validation set to true).

References mask_set, nhit, nhit_val, size, and val_table.

Referenced by InitMask().

void GETHitMask::CopyData ( const GETHitMask mask)
virtual

Copy all the data from the argument mask. Function called by copy constructor and affectation.

Parameters
maskobject to copy

References data_info, get_ptr, GetDataInfo(), GetNhit(), GetNhitValid(), GetSystemPtr(), GetThreshold(), hit_table, InitMask(), IsHit(), IsMaskSet(), IsValid(), mask_set, nhit, nhit_val, size, threshold, and val_table.

Referenced by GETHitMaskXY::CopyData(), GETHitMask(), and operator=().

int GETHitMask::CreateThresholdXML ( const string &  fname,
const double  rdiscri = 0.05 
)
virtual

Create a XML configuration for acquisition interface containing the parameter values for the thresholds.

The effective threshold is coded from 0 to 127, with 7 bits:

  • 3 MSB are common for all channels of an AGET chip
  • 4 LSB are selected on a channel by channel basis

The threshold value is adjusted according the gain bit that selects the dynamic range of the discriminator (register 2, bit 24, see AGET documentation), as a fraction R of the input range.

The full range of the discriminator thus corresponds to a fraction R of the maximum signal amplitude, considered here as the maximum coder value: 4096.

For each channel, the relation between the configuration threshold value thr(cfg) and the corresponding signal amplitude thr(val) is:

thr(cfg) = 128 * [thr(val) / (R * 4096)]

Then, for each AGET chip, the

Parameters
fnamename of the file
rdiscridynamic range of the discriminator

References AGET_SIZE, get_ptr, GETCoBo::GetChildrenNumber(), GETAsAd::GetChildrenNumber(), GETAGet::GetChildrenNumber(), GETSystem::GetChildrenNumber(), and threshold.

void GETHitMask::EraseMask ( )
virtual

Delete the data tables of the hit mask.

References hit_table, mask_set, nhit, nhit_val, size, threshold, and val_table.

Referenced by InitMask(), and ~GETHitMask().

u_short GETHitMask::GetDataInfo ( ) const
inlinevirtual

Return the sample identifier on which the hit is checked: GET::signalOut, GET::signalTst or GET::signalRec.

References data_info.

Referenced by CopyData().

u_int GETHitMask::GetNhit ( ) const
inlinevirtual

Return the number of hit channels (valid or not) of the hit mask.

References nhit.

Referenced by CopyData().

u_int GETHitMask::GetNhitValid ( ) const
inlinevirtual

Return the number of hit valid channels of the hit mask.

References nhit_val.

Referenced by CopyData(), and GETActarTpcAnalyser::GetOffTrackPadsCount().

u_int GETHitMask::GetSize ( ) const
inlinevirtual

Return the number of channels of the hit mask.

References size.

GETSystem * GETHitMask::GetSystemPtr ( ) const
inline

Return the pointer to the GET system object using the mask.

References get_ptr.

Referenced by CopyData().

double GETHitMask::GetThreshold ( u_int  ic = 0) const
inlinevirtual

Return the current threshold value for a channel.

Parameters
icelectronics channel index

References size, and threshold.

Referenced by GETSystemAnalyser::CalcChannelMaxima(), CopyData(), GETActarTpcAnalyser::Export3D_POV(), and GETActarTpcAnalyser::FillHistogram3D().

GETHitMask::GObject ( GETHitMask  )
private

Macro from GCpp library that defines the following functions:

  • ClassName(): return the real class name of the object
  • StaticClassName(): return the used class name of the object (that may be a base class of the real object).
  • IsInstanceOf<T>(): return true if the current object is an instance of the template class name argument
  • Clone(): return an allocated copy of the object.
int GETHitMask::InitMask ( )
virtual

Initialise the hit mask data from the GET system. The look-up table of the GET system must be defined. The function returns 0 if no error occured.

References ClearHitMask(), ClearValidMask(), EraseMask(), get_ptr, GETObject::GetTotalChannelCount(), hit_table, GETLookupTable::IsTableSet(), GETSystem::LookupTable(), nhit, nhit_val, SetThreshold(), size, threshold, and val_table.

Referenced by CopyData(), and GETHitMask().

void GETHitMask::InvertHits ( )
virtual

Invert the hit flags values.

References hit_table, IsValid(), nhit, nhit_val, and size.

bool GETHitMask::IsHit ( u_int  ic) const
inlinevirtual

Return true if the channel is hit (and valid).

Parameters
icelectronics channel index

References hit_table, IsMaskSet(), and size.

Referenced by CopyData().

bool GETHitMask::IsValid ( u_int  ic) const
inlinevirtual

Return true if the channel is valid.

Parameters
icelectronics channel index

References size, and val_table.

Referenced by CopyData(), InvertHits(), and UpdateMask().

bool GETHitMask::IsValidHit ( u_int  ic) const
inlinevirtual

Return true if the channel is hit and valid.

Parameters
icelectronics channel index

References hit_table, IsMaskSet(), size, and val_table.

Referenced by GETSystemAnalyser::CalcChannelMaxima(), and GETSystemAnalyser::CalcChannelOutput().

GETHitMask & GETHitMask::operator= ( const GETHitMask mask)

Affectation operator.

Parameters
maskobject to copy

References CopyData().

void GETHitMask::SetDataInfo ( u_short  info)
inlinevirtual

Defined the sample on which the hit is checked: GET::signalOut, GET::signalTst or GET::signalRec

Parameters
infodata information

References data_info.

Referenced by GETActarTpc::SetHitMask(), and GETSystemAnalyser::SetSelectedData().

void GETHitMask::SetHit ( u_int  ic,
bool  b = true 
)
inlinevirtual

Set the hit status of a channel.

Parameters
icelectronics channel index
bhit status

References hit_table, IsMaskSet(), and size.

void GETHitMask::SetThreshold ( double  thr)
virtual

Set the threshold value for all channels. The hit channel mask is cleared.

Parameters
thrthreshold value

References ClearHitMask(), IsMaskDefined(), size, and threshold.

Referenced by GETSystemAnalyser::ConfigCommand(), InitMask(), and SetThresholds().

void GETHitMask::SetThreshold ( u_int  ic,
double  thr 
)
virtual

Set the threshold value for one channels. The hit channel mask is not cleared.

Parameters
icchannel index
thrthreshold value

References IsMaskDefined(), and threshold.

void GETHitMask::SetThresholds ( double *  tab)
virtual

Set the thresholds value for individual channels, from an array of data. The hit channel mask is cleared.

Parameters
tabthresholds array

References ClearHitMask(), IsMaskDefined(), size, and threshold.

void GETHitMask::SetThresholds ( const string &  fname,
double  fact = 1.,
double  cst = 0. 
)
virtual

Set the thresholds from a file (resulting from noise analysis).

Parameters
fnamenoise (RMS) file name
factmultiplication factor for RMS
cstconstant offset for threshold values

References SetThreshold().

void GETHitMask::SetValid ( u_int  ic,
bool  b = true 
)
inlinevirtual

Set the validation status of a channel.

Parameters
icelectronics channel index
bhit status

References IsMaskDefined(), size, and val_table.

u_int GETHitMask::UpdateMask ( )
virtual

Set the mask according to current event in the GET system, with thresholds currently defined. The function returns the number of hit channels. It sets the flag indicating that the mask is set to true (see IsMaskSet function).

Reimplemented in GETHitMaskXY.

References ClearHitMask(), data_info, get_ptr, GETSystem::GetChannel(), hit_table, IsMaskDefined(), IsValid(), mask_set, nhit, nhit_val, GETChannel::OutSample(), GETChannel::RecSample(), GET::signalRec, GET::signalTst, size, threshold, and GETChannel::TstSample().

Referenced by GETActarTpcAnalyser::AnalyseCorEvent(), and GETSystemAnalyser::AnalyseCorEvent().

int GETHitMask::WriteFileText ( const string &  fname)
virtual

Write the hit mask threshold and validation data in a text file.

Parameters
fnamename of the file

References size, threshold, and val_table.


The documentation for this class was generated from the following files: