GET library
|
#include <GETHitMask.hh>
Public Member Functions | |
Constructors, affectation, destructor | |
GETHitMask (GETSystem *get=NULL) | |
GETHitMask (const GETHitMask &mask) | |
GETHitMask & | operator= (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 | |
GETSystem * | GetSystemPtr () 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 GETSample * | GetValidSamplePtr (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) | |
GETSystem * | get_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) | |
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.
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.
mask | object 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.
|
virtual |
Destructor.
References EraseMask().
GETHitMask::ClassDef | ( | GETHitMask | , |
0 | |||
) |
for use within ROOT.
|
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().
|
virtual |
|
virtual |
Copy all the data from the argument mask. Function called by copy constructor and affectation.
mask | object 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=().
|
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:
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
fname | name of the file |
rdiscri | dynamic range of the discriminator |
data | threshold 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.
|
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().
|
inlinevirtual |
Return the sample identifier on which the hit is checked: GET::signalOut, GET::signalTst or GET::signalRec.
References data_info.
Referenced by CopyData().
|
inlinevirtual |
Return the number of hit channels (valid or not) of the hit mask.
References nhit.
Referenced by GETActarTpcAnalyser::AnalyseCorEvent(), CopyData(), and GETActarTpcAnalyser::OutputCorrection().
|
inlinevirtual |
Return the number of hit valid channels of the hit mask.
References nhit_val.
Referenced by GETActarTpcAnalyser::AnalyseCorEvent(), CopyData(), GETActarTpcAnalyser::CreateGraph2D(), GETActarTpcAnalyser::CreateGraphXYT(), GETActarTpcAnalyser::FillAutoHistograms(), GETActarTpcAnalyser::FillHistogram3D(), GETActarTpcAnalyser::FillHistogramXTmax(), GETActarTpcAnalyser::FillHistogramYTmax(), GETActarTpcAnalyser::FillPadHistogram(), GETActarTpcAnalyser::GetOffTrackPadsCount(), and GETActarTpcAnalyser::OutputCorrection().
|
inlinevirtual |
Return the number of channels of the hit mask.
References size.
|
inline |
Return the pointer to the GET system object using the mask.
References get_ptr.
Referenced by CopyData().
|
inlinevirtual |
Return the current threshold value for a channel.
ic | electronics channel index |
data | threshold to affect: GET::signalTst, GET::signalOut, GET::signalRec |
References GET::signalOut, GET::signalRec, GET::signalTst, size, and threshold.
Referenced by GETSystemAnalyser::CalcChannelAmplitude(), GETSystemAnalyser::CalcChannelMaxima(), CopyData(), GETActarTpcAnalyser::FillAutoHistograms(), GETActarTpcAnalyser::FillHistogram3D(), GETActarTpcAnalyser::FillHistogramXTmax(), GETActarTpcAnalyser::FillHistogramYTmax(), and SetMaskHits().
|
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.
i | valid 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().
|
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.
i | valid channel number |
References nhit_val, and valid_sample.
Referenced by CopyData().
|
private |
Macro from GCpp library that defines the following functions:
|
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().
|
virtual |
|
inlinevirtual |
Return true if the channel is hit (and valid).
ic | electronics channel index |
References hit_table, IsMaskSet(), and size.
Referenced by CopyData().
|
inlinevirtual |
Return true if the mask data are defined.
Referenced by GETActarTpcAnalyser::CreateGraph2D(), GETActarTpcAnalyser::CreateGraphXYT(), GETActarTpcAnalyser::FillAutoHistograms(), GETActarTpcAnalyser::FillHistogram3D(), GETActarTpcAnalyser::FillHistogramXTmax(), GETActarTpcAnalyser::FillHistogramYTmax(), GETActarTpcAnalyser::FillPadHistogram(), GETHitMaskXY::GetBoundaries(), IsMaskSet(), MaskSet(), GETHitMaskXY::SetBorder(), GETHitMaskXY::SetHit(), SetMaskHits(), SetThreshold(), SetThresholds(), GETHitMaskXY::SetValid(), SetValid(), GETHitMaskXY::SetValidChannels(), SetValidChannels(), and UpdateHitCounts().
|
inlinevirtual |
Return true if the hit mask has been computed.
References IsMaskDefined(), and mask_set.
Referenced by GETSystemAnalyser::AnalyseCorEvent(), CopyData(), GETActarTpcAnalyser::CreateGraph2D(), GETActarTpcAnalyser::CreateGraphXYT(), GETActarTpcAnalyser::FillAutoHistograms(), GETActarTpcAnalyser::FillHistogram3D(), GETActarTpcAnalyser::FillHistogramXTmax(), GETActarTpcAnalyser::FillHistogramYTmax(), GETActarTpcAnalyser::FillPadHistogram(), GETHitMaskXY::GetBoundaries(), GETActarTpc::GetMaxSignalChannel(), GETHitMaskXY::GetMaxSignalChannel(), GETHitMaskXY::IsHit(), IsHit(), GETHitMaskXY::IsValidHit(), IsValidHit(), GETActarTpcAnalyser::OutputCorrection(), and SetHit().
|
inlinevirtual |
Return true if the channel is valid.
ic | electronics channel index |
References size, and val_table.
Referenced by CopyData(), InvertHits(), SetValidChannels(), and UpdateHitCounts().
|
inlinevirtual |
Return true if the channel is hit and valid.
ic | electronics channel index |
References hit_table, IsMaskSet(), size, and val_table.
Referenced by GETSystemAnalyser::CalcChannelAmplitude(), and GETSystemAnalyser::CalcChannelMaxima().
|
inlinevirtual |
Force the flag indicating if the mask hits are set.
b | status of the flag |
References IsMaskDefined(), and mask_set.
GETHitMask & GETHitMask::operator= | ( | const GETHitMask & | mask | ) |
|
inlinevirtual |
Defined the sample on which the hit is checked: GET::signalOut, GET::signalTst or GET::signalRec
info | data information |
References data_info.
Referenced by GETActarTpc::SetHitMask(), and GETSystemAnalyser::SetSelectedHitData().
|
inlinevirtual |
Set the hit status of a channel.
ic | electronics channel index |
b | hit status |
References hit_table, IsMaskSet(), and size.
|
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().
|
virtual |
Set the threshold value for all channels. The hit channel mask is cleared.
thr | threshold value |
data | threshold 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().
|
virtual |
Set the threshold value for one channels. The hit channel mask is not cleared.
ic | channel index |
thr | threshold value |
data | threshold to affect: GET::signalTst, GET::signalOut, GET::signalRec or 0 for all |
References IsMaskDefined(), GET::signalRec, GET::signalTst, and threshold.
|
virtual |
Set the thresholds value for individual channels, from an array of data. The hit channel mask is cleared.
tab | thresholds array |
data | threshold to affect: GET::signalTst, GET::signalOut, GET::signalRec or 0 for all |
References ClearHitMask(), IsMaskDefined(), GET::signalRec, GET::signalTst, size, and threshold.
|
virtual |
Set the thresholds from a file (resulting from noise analysis).
fname | noise (RMS) file name |
fact | multiplication factor for RMS |
cst | constant offset for threshold values |
data | threshold to affect: GET::signalTst, GET::signalOut, GET::signalRec or 0 for all |
References SetThreshold().
|
inlinevirtual |
Set the validation status of a channel.
ic | electronics channel index |
b | hit status |
References IsMaskDefined(), size, and val_table.
Referenced by GETSystemAnalyser::CalcChannelAmplitude().
|
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().
|
virtual |
|
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().
|
virtual |
Write the hit mask threshold and validation data in a text file.
fname | name of the file |
data | threshold to affect: GET::signalTst, GET::signalOut, GET::signalRec |
References GET::signalOut, GET::signalRec, GET::signalTst, size, threshold, and val_table.