23 using Streaming::operator >>;
38 if (header.nbrBits != 16)
39 throw runtime_error(
"LMAParser():run: The lma file seems to contain 8-bit wavefroms '"
40 +
toString(header.nbrBits) +
"'. Currently this is not supported.");
46 toString(header.nbrChannels) +
"' channels:");
47 for (int16_t i(0) ; i < header.nbrChannels ;++i)
51 chan.waveform().resize(header.nbrSamples);
52 chan.channelNbr() = i;
61 chan.offset() = chanheader.
offset_mV*1e-3;
62 chan.gain() = chanheader.gain_mVperLSB*1e-3;
64 fill(waveform.begin(),waveform.end(),chanheader.offset_mV/chanheader.gain_mVperLSB);
81 evt.
id() = evtHead.id;
82 instr.id() = evt.
id();
84 for (
size_t i=0; i<channels.size();++i)
86 Channel &chan(instr.channels()[i]);
87 chan.
horpos() = evtHead.horpos;
96 int16_t nbrPulses(Streaming::retrieve<int16_t>(file));
97 for (int16_t i(0); i < nbrPulses; ++i)
102 size_t dataSize(pulsHead.length * 2);
103 file.read(reinterpret_cast<char*>(&waveform[pulsHead.idxPos]),
std::vector< int16_t > waveform_t
define the waveform
uint32_t _usedChannelBitmask
bitmask describing which channels are active in the instrument
Event to store all LCLS Data.
void readHeaderInfo(std::ifstream &file)
read the file header
bool operator()(std::ifstream &file, CASSEvent &event)
read the lma file contents put them into cassevent
contains the layout of the lma file headers.
file contains declaration of the CASSEvent
contains class to read lma files
double & sampleInterval()
setter
base class for all file readers
static void add(Level level, const std::string &line)
add a string to the log
const channels_t & channels() const
ACQIRIS::Instrument _instrument
acqiris device where we store the file header information
devices_t & devices()
setters
void loadSettings()
load the settings of the reader
std::string toString(const Type &t)
convert any type to a string
A Channel of an Acqiris Instrument.
std::vector< Channel > channels_t
a vector of Channels
file contains specialized class that do the settings for cass
contains a logger for cass