25#define SAMPLES_PER_WAVEFORM 1024
88 std::map<int, std::map<int, std::pair<int, int>>>
intWindow_;
93 void SetIntWindow(std::pair<int, int>,
int,
int);
94 void SetIntWindow(std::pair<int, int>);
95 void SetPedInterval(std::pair<int, int>,
int,
int);
96 void SetPedInterval(std::pair<int, int>);
114 using MAP = std::map<int, std::map<int, std::vector<float>>>;
142 const std::vector<float> &
GetVolts();
143 const std::vector<float> &
GetTimes();
148 const MAP &GetVoltMap() {
return volts_; };
149 const MAP &GetTimeMap() {
return times_; };
195 static const std::string type_;
206 static const std::string type_;
215 using MAP = std::map<int, std::map<int, std::vector<float>>>;
231 const MAP &GetTimeMap() {
return times_; };
241 void Read(std::vector<float> &);
242 void Read(std::vector<float> &,
const unsigned short &);
243 void ResetTag() {
in_.seekg(-4,
in_.cur); }
Main class to hold various settings for the channels.
std::map< int, std::map< int, float > > peakThr_
Data member to hold peak threshold values of various channels.
void MakeConfig(DAQFile &)
Initialise the configuration class with the default values for any board and any channel.
bool is_makeconfig_
Flag to check if the method DAQConfig::MakeConfig() has been called at least once.
void ShowConfig()
Simple method to print on stream the current settings of the class.
std::map< int, std::map< int, std::pair< int, int > > > intWindow_
Data member to hold integration windows intervals of various channels.
std::map< int, std::map< int, std::pair< int, int > > > pedInterval_
Data member to hold pedestal intervals of various channels.
std::map< int, std::map< int, bool > > user_iw_
Data member to hold which integration windows were set by the user.
void SetPeakThr(float, int, int)
Method to set the peak threshold given the peak threshold in Volts and the board/channel IDs.
DAQConfig()
Construct a new DAQConfig::DAQConfig object.
Main class to store voltage and time values.
void SetPeakThr(float)
Set the threshold in volt by the user.
bool is_iw_
Flag to check if integration window has been evaluated once.
DAQConfig config_
Class to hold settings about pedestal and integration window intervals.
MAP volts_
Structure to hold voltage values of all boards and channels.
void SetPedInterval(int, int)
Function to set the interval where to perform pedestal evaluation.
std::pair< float, float > ped_
Pair to hold pedestal mean and pedestal std.dev..
const std::vector< float > & GetTimes()
Getter method read-only for the waveform's times selected.
DAQEvent & EvalPedestal()
Method to evaluate the pedestal of the currently selected waveform.
DAQEvent & TimeCalibration(const unsigned short &, const std::vector< float > &, int, int)
Function to perform the time calibration.
const std::pair< float, float > & GetPedestal()
Getter method read-only for the attribute DAQEvent::ped_.
std::pair< int, int > iw_
Pair to hold indices as boundary edges where integration is performed by DAQEvent::GetCharge().
bool is_init_
Flag to check if the file is initialised.
std::pair< int, int > ch_old_
Pair to store last channel on which routines were made.
DAQEvent()
Construct a new DAQEvent() object.
std::pair< int, int > ch_
Pair to hold indices of board and channel selected;.
float GetRiseTime()
Evaluate the risetime of the waveform.
const std::pair< int, int > & GetIntegrationBounds()
unsigned int evtserial_old_
Value to store last event read.
bool is_ped_
Flag to check if pedestal has been evaluated once.
float GetTimeCF(float)
Find the time at which the waveform goes under a given percentage of the waveform peak value.
float GetTime(float)
Find the time at which the waveform goes under a given threshold level.
void MakeConfig(DAQFile &file)
Method to simply call DAQConfig::MakeConfig().
DAQEvent & EvalIntegrationBounds()
Method to evaluate the integration window of the currently selected waveform.
float peak_threshold_
Value to store the threshold in volts passed by the user.
float GetCharge()
Method to evaluate charge in the integration region.
const std::vector< float > & GetVolts()
Getter method read-only for the waveform's voltages selected.
std::pair< float, float > peak_
Pair to hold value of voltage and time at the peak.
bool IsSaturated()
Check if in the selected channel there is (or not) saturation.
DAQEvent & FindPeaks()
Method to find peaks in the integration window.
std::vector< int > indexMin_
Indices of local minima found.
std::pair< int, int > ped_interval_
Pair to hold indices as boundary edges where pedestal is evaluated.
void SetIntWindow(int, int)
Set the integration window passing two indices that go from 0 to SAMPLES_PER_WAVEFORM.
DAQEvent & GetChannel(const int &, const int &)
Select the channel to analyze.
const std::vector< int > & GetPeakIndices()
void ShowConfig()
Simple method to call DAQConfig::ShowConfig().
bool is_getch_
Flag to check if the method DAQEvent::GetChannel() has been called.
std::vector< bool > routine_
std::map< int, std::map< int, std::vector< float > > > MAP
Alias for data structure.
bool is_peak_
Flag to check if peaks have been found once.
MAP times_
Structure to hold integrated times values of all boards and channels.
float GetAmplitude()
Method to evaluate amplitude in the integration region.
Class to manage the file and the outputing of data in a DAQEvent instance.
bool initialization_
Flag to store if DAQFile::Initialise() was already called.
std::string type_
Flag to store the type of the board.
DAQFile & Reset()
Method to reset the file.
char o_
The initial letter of the previous tag read.
std::string filename_
The name of the file.
std::map< int, std::map< int, std::vector< float > > > MAP
Alias for data structure.
char n_
The initial letter of the newest tag read.
bool is_lab_
Flag to check if the board is from LAB or not.
DAQFile()
Construct a new DAQFile::DAQFile object.
DAQFile & GetEvent(int)
Method to select what event must be read next.
DAQFile & Open(const std::string &)
Method to open a file given the file path and name.
DAQFile & Close()
Method to close the file.
MAP times_
Struct to hold read from the TIMEpart of the file.
void Read(TAG &)
Read a tag.
bool operator>>(DRSEvent &)
Read into a DRSEvent.
DAQFile & Initialise()
Initialise the file reading the TIME block.
int first_evt_pos_
Position of first event header.
std::ifstream in_
The input file to read.
Specialization of DAQEvent to a DRS board.
Specialization of DAQEvent to a WaveDREAM board.
ostream & operator<<(ostream &o, const TAG &tag)
Function to print a TAG istance easily on stream::cout.
5 char long word ended with '\0' for simple printing.
char tag[5]
The array of char.
TAG()
Construct a new TAG object.