Main class to store voltage and time values.
More...
#include <readWD.hh>
|
| MAP | times_ |
| | Structure to hold integrated times values of all boards and channels.
|
| |
| MAP | volts_ |
| | Structure to hold voltage values of all boards and channels.
|
| |
| EventHeader | eh_ |
| |
| DAQConfig | config_ |
| | Class to hold settings about pedestal and integration window intervals.
|
| |
| std::pair< float, float > | ped_ |
| | Pair to hold pedestal mean and pedestal std.dev..
|
| |
| std::pair< float, float > | peak_ |
| | Pair to hold value of voltage and time at the peak.
|
| |
| std::pair< int, int > | ped_interval_ |
| | Pair to hold indices as boundary edges where pedestal is evaluated.
|
| |
| std::pair< int, int > | iw_ |
| | Pair to hold indices as boundary edges where integration is performed by DAQEvent::GetCharge().
|
| |
| std::pair< int, int > | ch_ |
| | Pair to hold indices of board and channel selected;.
|
| |
| std::vector< int > | indexMin_ |
| | Indices of local minima found.
|
| |
| bool | is_init_ |
| | Flag to check if the file is initialised.
|
| |
| bool | is_getch_ |
| | Flag to check if the method DAQEvent::GetChannel() has been called.
|
| |
| bool | is_iw_ |
| | Flag to check if integration window has been evaluated once.
|
| |
| bool | is_ped_ |
| | Flag to check if pedestal has been evaluated once.
|
| |
| bool | is_peak_ |
| | Flag to check if peaks have been found once.
|
| |
| float | peak_threshold_ |
| | Value to store the threshold in volts passed by the user.
|
| |
| unsigned int | evtserial_old_ |
| | Value to store last event read.
|
| |
| std::pair< int, int > | ch_old_ |
| | Pair to store last channel on which routines were made.
|
| |
| std::vector< bool > | routine_ |
| |
|
| using | MAP = std::map< int, std::map< int, std::vector< float > > > |
| | Alias for data structure.
|
| |
Main class to store voltage and time values.
This class is used with DAQFile to read each event contained into a file.
Definition at line 112 of file readWD.hh.
◆ MAP
| using DAQEvent::MAP = std::map<int, std::map<int, std::vector<float> >> |
|
private |
Alias for data structure.
Definition at line 114 of file readWD.hh.
◆ DAQEvent()
Construct a new DAQEvent() object.
The constructor of the class has to initialize the correct values of some check-flags and of some variables that will be later evaluated.
Even if integration windows or pededstal intervals are set as default, these are then managed by the class DAQConfig.
Definition at line 76 of file readWD.cc.
◆ EvalIntegrationBounds()
| DAQEvent & DAQEvent::EvalIntegrationBounds |
( |
| ) |
|
|
protected |
Method to evaluate the integration window of the currently selected waveform.
- Returns
- DAQEvent&
Definition at line 619 of file readWD.cc.
◆ EvalPedestal()
Method to evaluate the pedestal of the currently selected waveform.
- Returns
- DAQEvent&
Definition at line 578 of file readWD.cc.
◆ FindPeaks()
Method to find peaks in the integration window.
- Returns
- DAQEvent&
Definition at line 673 of file readWD.cc.
◆ GetAmplitude()
| float DAQEvent::GetAmplitude |
( |
| ) |
|
Method to evaluate amplitude in the integration region.
- Returns
- float
Definition at line 312 of file readWD.cc.
◆ GetChannel()
| DAQEvent & DAQEvent::GetChannel |
( |
const int & |
board, |
|
|
const int & |
channel |
|
) |
| |
Select the channel to analyze.
To select a channel, the user must consider only the channels that are turned on on the board. This means that the right order of the channel is not given by the channel ID number: the channel 6 on a WDB is not always the sixth channel, but it depends by the channels that are turned on. In any case, during the call to DAQEvent::Initialise() a list of the active channel is displayed on terminal to double check.
After the call to this method, the values of DAQEvent::ch_ are updated.
- Parameters
-
| board | the index of the board, starting from 0. |
| channel | the index of the channel in the selected board, starting from 0. |
- Returns
- DAQEvent& to make cascade methods available.
- Examples
- main1.cc.
Definition at line 102 of file readWD.cc.
◆ GetCharge()
| float DAQEvent::GetCharge |
( |
| ) |
|
◆ GetEH()
◆ GetIntegrationBounds()
| const pair< int, int > & DAQEvent::GetIntegrationBounds |
( |
| ) |
|
- Returns
- const pair<int, int>&
Definition at line 530 of file readWD.cc.
◆ GetPeakIndices()
| const vector< int > & DAQEvent::GetPeakIndices |
( |
| ) |
|
- Returns
- const vector<int>&
Definition at line 510 of file readWD.cc.
◆ GetPedestal()
| const pair< float, float > & DAQEvent::GetPedestal |
( |
| ) |
|
Getter method read-only for the attribute DAQEvent::ped_.
- Returns
- const pair<float, float>&
Definition at line 434 of file readWD.cc.
◆ GetRiseTime()
| float DAQEvent::GetRiseTime |
( |
| ) |
|
Evaluate the risetime of the waveform.
- Returns
- float
Definition at line 418 of file readWD.cc.
◆ GetTime()
| float DAQEvent::GetTime |
( |
float |
thr | ) |
|
Find the time at which the waveform goes under a given threshold level.
This method finds the first index at which the waveform crosses the given threshold value. Once the index is found, the method interpolates the point at this index with the next point to return the time given by the intersection between the interpolation line and the horizontal line given by the threshold value passed by the user. The method can have two different behaviours:
- \( \mu_{pedestal} > thr\): the method finds the first value in time at which the waveform goes below the threshold.
- \( \mu_{pedestal} \leq thr\): the method finds the first value in time at which the waveform goes above the threshold.
- Parameters
-
| thr | The threshold level passed by the user. It must be in a range from -0.5 to 0.5 V. |
- Returns
- The time requested. 0 if no times were found.
Definition at line 338 of file readWD.cc.
◆ GetTimeCF()
| float DAQEvent::GetTimeCF |
( |
float |
CF | ) |
|
Find the time at which the waveform goes under a given percentage of the waveform peak value.
- Parameters
-
| CF | the constant fraction value. Must be in range (0,1) |
- Returns
- The time requested
Definition at line 391 of file readWD.cc.
◆ GetTimeMap()
| const MAP & DAQEvent::GetTimeMap |
( |
| ) |
|
|
inline |
◆ GetTimes()
| const vector< float > & DAQEvent::GetTimes |
( |
| ) |
|
Getter method read-only for the waveform's times selected.
The method checks if DAQEvent::GetChannel() has been called. If it is the case, it returns the waveform's times of the selected board/channel.
- Returns
- const vector<float>&
Definition at line 487 of file readWD.cc.
◆ GetVoltMap()
| const MAP & DAQEvent::GetVoltMap |
( |
| ) |
|
|
inline |
◆ GetVolts()
| const vector< float > & DAQEvent::GetVolts |
( |
| ) |
|
Getter method read-only for the waveform's voltages selected.
The method checks if DAQEvent::GetChannel() has been called. If it is the case, it returns the waveform's voltages of the selected board/channel.
- Returns
- const vector<float>&
Definition at line 461 of file readWD.cc.
◆ IsSaturated()
| bool DAQEvent::IsSaturated |
( |
| ) |
|
Check if in the selected channel there is (or not) saturation.
The saturation is defined as any value greater than +0.499V or lower than -0.499V. One single point is enough to return true.
- Returns
- true
-
false
Definition at line 253 of file readWD.cc.
◆ MakeConfig()
| void DAQEvent::MakeConfig |
( |
DAQFile & |
file | ) |
|
|
inline |
◆ SetIntWindow() [1/2]
| void DAQEvent::SetIntWindow |
( |
float |
a, |
|
|
float |
b |
|
) |
| |
Set the integration window passing time values in seconds.
This method with this signature must be used after the call of DAQEvent::GetChannel(). All these tasks are managed by DAQConfig.
- Parameters
-
| a | The left bound |
| b | The right bound |
- Returns
- DAQEvent&
Definition at line 217 of file readWD.cc.
◆ SetIntWindow() [2/2]
| void DAQEvent::SetIntWindow |
( |
int |
a, |
|
|
int |
b |
|
) |
| |
◆ SetPeakThr()
| void DAQEvent::SetPeakThr |
( |
float |
thr | ) |
|
Set the threshold in volt by the user.
This threshold level is used by the code when the minima of the waveform are requested. All these tasks are managed by DAQConfig.
- Parameters
-
| thr | The threshold level in Volts in a range (-0.5, +0.5)V |
- Returns
- DAQEvent&
Definition at line 171 of file readWD.cc.
◆ SetPedInterval()
| void DAQEvent::SetPedInterval |
( |
int |
a, |
|
|
int |
b |
|
) |
| |
Function to set the interval where to perform pedestal evaluation.
The function checks automatically which value in input is smaller to correctly order the pair passed. A first control is made to check if the inputs are in the correct boundary that is from 0 to SAMPLES_PER_WAVEFORM. All these tasks are managed by DAQConfig.
- Parameters
-
| a | The first boundary index value. |
| b | The second boundary index value. |
- Returns
- DAQEvent& to make cascade methods available.
Definition at line 149 of file readWD.cc.
◆ ShowConfig()
| void DAQEvent::ShowConfig |
( |
| ) |
|
|
inline |
◆ TimeCalibration()
| DAQEvent & DAQEvent::TimeCalibration |
( |
const unsigned short & |
tCell, |
|
|
const std::vector< float > & |
times, |
|
|
int |
i, |
|
|
int |
j |
|
) |
| |
|
protected |
Function to perform the time calibration.
The time calibration is performed as specified in the DRS manual. The operation is done as following:
\[
t_{ch}[i] = \sum_{j = 0}^{i - 1} dt_{ch}[(j + tCell)%1024]
\]
- Parameters
-
| tCell | Cell number at which the signal triggered the board. Found in the event header. |
| times | Array with time bin width. |
| i | The index of the board. |
| j | The index of the channel. |
Definition at line 563 of file readWD.cc.
◆ DAQFile
◆ ch_
| std::pair<int, int> DAQEvent::ch_ |
|
protected |
Pair to hold indices of board and channel selected;.
Definition at line 169 of file readWD.hh.
◆ ch_old_
| std::pair<int, int> DAQEvent::ch_old_ |
|
protected |
Pair to store last channel on which routines were made.
Definition at line 180 of file readWD.hh.
◆ config_
Class to hold settings about pedestal and integration window intervals.
Definition at line 163 of file readWD.hh.
◆ eh_
◆ evtserial_old_
| unsigned int DAQEvent::evtserial_old_ |
|
protected |
Value to store last event read.
Definition at line 179 of file readWD.hh.
◆ indexMin_
| std::vector<int> DAQEvent::indexMin_ |
|
protected |
Indices of local minima found.
Definition at line 170 of file readWD.hh.
◆ is_getch_
◆ is_init_
Flag to check if the file is initialised.
Definition at line 172 of file readWD.hh.
◆ is_iw_
Flag to check if integration window has been evaluated once.
Definition at line 174 of file readWD.hh.
◆ is_peak_
Flag to check if peaks have been found once.
Definition at line 176 of file readWD.hh.
◆ is_ped_
Flag to check if pedestal has been evaluated once.
Definition at line 175 of file readWD.hh.
◆ iw_
| std::pair<int, int> DAQEvent::iw_ |
|
protected |
◆ peak_
| std::pair<float, float> DAQEvent::peak_ |
|
protected |
Pair to hold value of voltage and time at the peak.
Definition at line 166 of file readWD.hh.
◆ peak_threshold_
| float DAQEvent::peak_threshold_ |
|
protected |
Value to store the threshold in volts passed by the user.
Definition at line 177 of file readWD.hh.
◆ ped_
| std::pair<float, float> DAQEvent::ped_ |
|
protected |
Pair to hold pedestal mean and pedestal std.dev..
Definition at line 165 of file readWD.hh.
◆ ped_interval_
| std::pair<int, int> DAQEvent::ped_interval_ |
|
protected |
Pair to hold indices as boundary edges where pedestal is evaluated.
Definition at line 167 of file readWD.hh.
◆ routine_
| std::vector<bool> DAQEvent::routine_ |
|
protected |
◆ times_
Structure to hold integrated times values of all boards and channels.
Definition at line 159 of file readWD.hh.
◆ volts_
Structure to hold voltage values of all boards and channels.
Definition at line 160 of file readWD.hh.
The documentation for this class was generated from the following files: