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:
writer MQinoRawDataWriter verbosity = debug enable = true OutputDir = ../data EvPoints = 512 PreTriggerPoints = 128 Differential = true ForceInputType = NO ForceDetector = NO OutputFilePrefix = test_ OutputFilesList = test.list Description = WriteFilesList = true endmod
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 | |
QApolloCalib * | fCalib |
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 |
void MQinoRawDataWriter::WriteFile | ( | ) | [private] |
write current events to file
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
time | value to be converted | |
format | date format as specified in strftime() |
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
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) |
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().
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
int MQinoRawDataWriter::fLastRunNumber [private] |
bool MQinoRawDataWriter::f18BitInput [private] |
std::map<short,short> MQinoRawDataWriter::fChanCount [private] |
number of events for each channel
Referenced by Dump(), and WriteHeader().
size_t MQinoRawDataWriter::fEvPoints [private] |
number of samples per pulse
Referenced by Dump(), Open(), WriteFile(), and WriteHeader().
size_t MQinoRawDataWriter::fPreTrigger [private] |
bool MQinoRawDataWriter::fDiffOutput [private] |
output file format (differential or not)
Referenced by Dump(), Open(), WriteFile(), and WriteHeader().