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 MaskSet (bool b=true)
 
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, u_short data=GET::signalOut) const
 
virtual void SetThreshold (double thr, u_short data=0)
 
virtual void SetThreshold (u_int ic, double thr, u_short data=0)
 
virtual void SetThresholds (double *tab, u_short data=0)
 
virtual void SetThresholds (const string &fname, double fact=1., double cst=0., u_short data=0)
 
virtual u_int UpdateMask ()
 
virtual u_int SetMaskHits ()
 
virtual u_int SetValidChannels ()
 
virtual u_int UpdateHitCounts ()
 
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
 
virtual int GetValidChannelIndex (u_int i) const
 
virtual GETSampleGetValidSamplePtr (u_int i) const
 
Read-write function
virtual int WriteFileText (const string &fname, u_short data=GET::signalOut)
 
virtual int CreateThresholdXML (const string &fname, const double rdiscri=0.05, u_short data=GET::signalOut)
 
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 [3]
 Current mask threshold table (in, out & rec)
 
bool * val_table
 Table of valid channels.
 
u_int * valid_channel
 Array of valid channels indexes.
 
GETSample ** valid_sample
 Array of pointers to valid samples.
 

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, val_table, valid_channel, and valid_sample.

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, val_table, valid_channel, and valid_sample.

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(), SetMaskHits(), SetThreshold(), and SetThresholds().

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(), GetValidChannelIndex(), GetValidSamplePtr(), hit_table, InitMask(), IsHit(), IsMaskSet(), IsValid(), mask_set, nhit, nhit_val, size, threshold, val_table, valid_channel, and valid_sample.

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

int GETHitMask::CreateThresholdXML ( const string &  fname,
const double  rdiscri = 0.05,
u_short  data = GET::signalOut 
)
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
datathreshold to affect: GET::signalTst, GET::signalOut, GET::signalRec

References AGET_SIZE, get_ptr, GETCoBo::GetChildrenNumber(), GETAsAd::GetChildrenNumber(), GETAGet::GetChildrenNumber(), GETSystem::GetChildrenNumber(), GET::signalOut, GET::signalRec, GET::signalTst, and threshold.

void GETHitMask::EraseMask ( )
virtual

Delete the data tables of the hit mask.

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

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 GETActarTpcAnalyser::AnalyseCorEvent(), CopyData(), and GETActarTpcAnalyser::OutputCorrection().

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,
u_short  data = GET::signalOut 
) const
inlinevirtual
int GETHitMask::GetValidChannelIndex ( u_int  i) const
inlinevirtual

Return the index of the ith valid channel. If the valid channel number is larger than the number of valid channels, the function returns -1.

Parameters
ivalid channel number

References nhit_val, and valid_channel.

Referenced by CopyData(), GETActarTpcAnalyser::CreateGraph2D(), GETActarTpcAnalyser::CreateGraphXYT(), GETActarTpcAnalyser::FillAutoHistograms(), GETActarTpcAnalyser::FillHistogram3D(), GETActarTpcAnalyser::FillHistogramXTmax(), GETActarTpcAnalyser::FillHistogramYTmax(), and GETActarTpcAnalyser::FillPadHistogram().

GETSample * GETHitMask::GetValidSamplePtr ( u_int  i) const
inlinevirtual

Return the pointer of the ith valid sample. If the valid sample number is larger than the number of valid channels, the function returns NULL.

Parameters
ivalid channel number

References nhit_val, and valid_sample.

Referenced by CopyData().

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, val_table, valid_channel, and valid_sample.

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(), SetValidChannels(), and UpdateHitCounts().

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::CalcChannelAmplitude(), and GETSystemAnalyser::CalcChannelMaxima().

void GETHitMask::MaskSet ( bool  b = true)
inlinevirtual

Force the flag indicating if the mask hits are set.

Parameters
bstatus of the flag

References IsMaskDefined(), and mask_set.

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::SetSelectedHitData().

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.

u_int GETHitMask::SetMaskHits ( )
virtual

Set the mask hits according to current event in the GET system, with thresholds currently defined. The function returns the number of hit channels. It does not set the flag indicating that the mask is set to true (see IsMaskSet function), which is done after valid channels defition.

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

Referenced by UpdateMask().

void GETHitMask::SetThreshold ( double  thr,
u_short  data = 0 
)
virtual

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

Parameters
thrthreshold value
datathreshold to affect: GET::signalTst, GET::signalOut, GET::signalRec or 0 for all

References ClearHitMask(), IsMaskDefined(), GET::signalRec, GET::signalTst, size, and threshold.

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

void GETHitMask::SetThreshold ( u_int  ic,
double  thr,
u_short  data = 0 
)
virtual

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

Parameters
icchannel index
thrthreshold value
datathreshold to affect: GET::signalTst, GET::signalOut, GET::signalRec or 0 for all

References IsMaskDefined(), GET::signalRec, GET::signalTst, and threshold.

void GETHitMask::SetThresholds ( double *  tab,
u_short  data = 0 
)
virtual

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

Parameters
tabthresholds array
datathreshold to affect: GET::signalTst, GET::signalOut, GET::signalRec or 0 for all

References ClearHitMask(), IsMaskDefined(), GET::signalRec, GET::signalTst, size, and threshold.

void GETHitMask::SetThresholds ( const string &  fname,
double  fact = 1.,
double  cst = 0.,
u_short  data = 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
datathreshold to affect: GET::signalTst, GET::signalOut, GET::signalRec or 0 for all

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.

Referenced by GETSystemAnalyser::CalcChannelAmplitude().

u_int GETHitMask::SetValidChannels ( )
virtual

Defines the tables of valid channels according to hits pattern. The function returns the number of valid hit channels. It sets the flag indicating that the mask is set to true (see IsMaskSet function).

Reimplemented in GETHitMaskXY.

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

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

u_int GETHitMask::UpdateHitCounts ( )
virtual

Recomputes the hit multiplicity from hits table. This is required when the hits are set manually. The function returns the number of valid hits.

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

u_int GETHitMask::UpdateMask ( )
virtual

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

The function calls SetMaskHits() and SetValidChannels().

References SetMaskHits(), and SetValidChannels().

Referenced by GETActarTpcAnalyser::AnalyseCorEvent(), GETSystemAnalyser::AnalyseCorEvent(), GETActarTpcAnalyser::CreateGraph2D(), GETActarTpcAnalyser::CreateGraphXYT(), GETActarTpcAnalyser::FillAutoHistograms(), GETActarTpcAnalyser::FillHistogram3D(), GETActarTpcAnalyser::FillHistogramXTmax(), GETActarTpcAnalyser::FillHistogramYTmax(), GETActarTpcAnalyser::FillPadHistogram(), GETHitMaskXY::GetBoundaries(), GETActarTpc::GetMaxSignalChannel(), and GETActarTpcAnalyser::OutputCorrection().

int GETHitMask::WriteFileText ( const string &  fname,
u_short  data = GET::signalOut 
)
virtual

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

Parameters
fnamename of the file
datathreshold to affect: GET::signalTst, GET::signalOut, GET::signalRec

References GET::signalOut, GET::signalRec, GET::signalTst, size, threshold, and val_table.


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