Proton Calorimetry/Equipment/LeCroy
This page needs to be updated with work completed in the 2018/2019 academic year.
LeCroy Scope Trace Conversion: Binary to ASCII
To convert .trc binary data to .txt data that is formatted similarly to the output files from a CAEN DT5751 digitiser:
- Copy contents of
/unix/pbt/aknoetze/ConversionScripts
to a new directory. - Open
trc2txt.py
in a text editor.- Change path to directory containing .trc data files by editing variable
dirpath
- Change number of decimal points for each column by editing:
np.savetxt(..., fmt=‘...’,...)
- Change path to directory containing .trc data files by editing variable
- Run
trc2txt.py
Converted .txt files will be in the copied directory NEWASCII
. These new files will possess the same file names as the original .txt files.
To concatenate the new data files together into one single file, while in the directory NEWASCII
,type:
cat *.txt > OutputFileName.txt
Working with LeCroy Scope Trace Files in ROOT using the LeCroyData Class
The LeCroyData class is defined in SimpleLeCroyRoutines.C
, which can be found at /unix/pbt/users/dwalker/LeCroy
.
The class is intended for use in interactive ROOT sessions, but can be used in compiled ROOT applets. Its public methods and their use are summarised below:
Method Signature | Notes | Example |
---|---|---|
LeCroyData::LeCroyData(std::string fileName);
|
Constructor for the LeCroyData class. The string fileName must be a fully qualified path from the current working directory to the LeCroy binary format file to be loaded. |
|
int LeCroyData::getAcqCount();
|
Returns the number of acquisitions recorded in the file. |
|
double* LeCroyData::getTriggerArray();
|
Returns a C-style array containing the time in ns at which each acquisition in the file was triggered, relative to the first trigger. | |
double* LeCroyData::getOffsetArray();
|
Returns a C-style array containing the time in ns between the start of each acquisition and the time of the trigger for that acquisition. | |
int LeCroyData::getPointsPerAcq();
|
Returns the number of data points (voltage / time pairs) recorded in each acquisition in the file. |
|
double* LeCroyData::getAcqWave(int segment);
|
Returns a C-style array of doubles. The array contains the voltages recorded by the scope in an acquisition with index "segment", which runs from zero to the number of acquisitions in the file. | |
double* LeCroyData::getAcqTime(int segment);
|
Returns a C-style array of doubles. The array contains the time in ns of each data point in the acquisition indexed by "segment", relative to the trigger for that acquisition. | |
string LeCroyData::getTimestamp();
|
Returns a string describing the timestamp for the file as a date and a clock time. This time corresponds to the first trigger in the file and takes the format "d/m/yyyy @ hh:mm:ss.ssss". | |
double* LeCroyData::getSpectrum();
|
Returns a C-style array of doubles, where each entry is the ADC Counts calculated for an event. |
|
double* LeCroyData::getSpectrumSize();
|
Returns the number of entries in LeCroyData::getSpectrum() (equal to the number of entries in LeCroyData::getSpectrumTime() ) as an integer.
|
|
double* LeCroyData::getSpectrumTime();
|
Returns a C-style array of doubles, where each entry is the time in ns at which an event recorded in the spectrum occurred, with respect to the first trigger time in the file. |
Additional methods are being added to handle the generation of spectra and improve access to timing data.