MQinoRawDataWriter Class Reference
[Writers]

Inheritance diagram for MQinoRawDataWriter:

QFileWriter QWriter QBaseModule

List of all members.


Detailed Description

vsmq format file writer

This writer converts data from diana to 'vsmq' format. It produces compressed data files in vsmq format and an header file for each different input run. This writer is able to detect (and skip) possible muon events from Apollo data, but unless it is used in conjunction with MRawDataFilter (KeepMuonVeto=false,SkipEvents=true), the number of events per file will not match the one requested in config file. Not all informations contained in the header file are meaningful. The following quantities can be trusted:


Public Member Functions

 MQinoRawDataWriter (QSequence *s)
virtual void Open (const std::string &fileName)
 read parameters from config file
virtual void Dump (const QEvent &ev)
 Dump ev to file.
virtual void Close ()
 Close file.

Private Member Functions

void FlushVector ()
 flush events vector (delete existing events)
void WriteFile ()
 write current events to file
void WriteHeader ()
 write header file
std::string GetTimeString (const time_t &time, const std::string &format)
 utility function to convert from time_t to string
QVector Scale (const QVector &data, const int channel, const size_t first, const size_t last)
 scale from PXI to VXI adc units
void DumpStatistics ()
 dump statistics about events that have been modified due to to incompatible values found in input data (negative voltage, values exceeding max ADC input and so on).

Private Attributes

QApolloCalibfCalib
std::vector< QRawQinoEvt_t * > fEvents
time_t fStartTime
time_t fEndTime
std::string fLastFileName
int fLastRunNumber
bool f18BitInput
std::map< short, short > fChanCount
unsigned int fNoHeaterFlag
unsigned int fOffsetForced
unsigned int fShortEvents
unsigned int fSaturatedLow
unsigned int fSaturatedHi
size_t fEvPoints
size_t fPreTrigger
bool fDiffOutput

Static Private Attributes

static const size_t kArraySize = 1023

Classes

struct  QRawQinoEvt_t

Member Function Documentation

void MQinoRawDataWriter::WriteFile (  )  [private]

write current events to file

Parameters:
fileName name of file to be written

References QBaseModule::Debug(), DumpStatistics(), QBaseModule::Error(), fDiffOutput, fEvPoints, FlushVector(), and QBaseModule::Panic().

Referenced by Close().

std::string MQinoRawDataWriter::GetTimeString ( const time_t &  time,
const std::string &  format 
) [private]

utility function to convert from time_t to string

Parameters:
time value to be converted
format date format as specified in strftime()
Returns:
string filled with formatted date or "NOT_DETECTED" if time is 0

Referenced by WriteHeader().

QVector MQinoRawDataWriter::Scale ( const QVector &  data,
const int  channel,
const size_t  first,
const size_t  last 
) [private]

scale from PXI to VXI adc units

Parameters:
data input vector to be scaled
channel logica channel the data belongs to. This information is needed to choose the corect calibration coefficients
first first sample to be scaled (included)
last last sample to be scaled (excluded)
Returns:
QVector containing scaled data

void MQinoRawDataWriter::DumpStatistics (  )  [private]

dump statistics about events that have been modified due to to incompatible values found in input data (negative voltage, values exceeding max ADC input and so on).

This function also reset the statistics counters

References QBaseModule::Warn().

Referenced by WriteFile().


Member Data Documentation

const size_t MQinoRawDataWriter::kArraySize = 1023 [static, private]

maximum number of points per pulse

Referenced by Open().

std::string MQinoRawDataWriter::fLastFileName [private]

used to determine header file name

run number given by QRunData the last time that Open() was called.

determine input files ADC dynamic

Referenced by Dump(), and Open().

std::map<short,short> MQinoRawDataWriter::fChanCount [private]

number of events for each channel

Referenced by Dump(), and WriteHeader().

number of samples per pulse

Referenced by Dump(), Open(), WriteFile(), and WriteHeader().

number of pre-trigger samples

Referenced by Dump(), and Open().

output file format (differential or not)

Referenced by Dump(), Open(), WriteFile(), and WriteHeader().


The documentation for this class was generated from the following files:

Generated on Tue Nov 16 10:50:03 2010 for CUORE Software by  doxygen 1.5.6