#include <IORawData/CSCTFCommissioning/src/SPReader.h>
Public Member Functions | |
void | closeFile () |
virtual void | Configure () |
virtual char * | data () |
virtual int | dataLength () |
virtual int | disableBlock ()=0 |
virtual void | Enable () |
virtual int | enableBlock ()=0 |
virtual int | endBlockRead ()=0 |
int | openFile (string filename) |
virtual void | printStats () |
bool | readNextEvent () |
assumes readNextEvent has been called | |
virtual int | readSP (unsigned short **buf, const bool debug=false)=0 |
assumes fd_schar has been set | |
virtual int | reset ()=0 |
SPReader () | |
virtual | ~SPReader () |
Public Attributes | |
unsigned short | errorFlag |
Protected Member Functions | |
virtual int | chunkSize ()=0 |
How many bytes to read at a time. | |
Protected Attributes | |
int | fd_schar |
bool | liveData_ |
int | nbyte_schar |
unsigned long | nbytes_schar |
int | npack_schar |
unsigned short * | theBuffer |
int | theDataLength |
Definition at line 9 of file SPReader.h.
SPReader::SPReader | ( | ) | [inline] |
Definition at line 12 of file SPReader.h.
00012 : nbytes_schar(0), npack_schar(0), nbyte_schar(0), theBuffer(NULL) {}
virtual SPReader::~SPReader | ( | ) | [inline, virtual] |
virtual int SPReader::chunkSize | ( | ) | [protected, pure virtual] |
void SPReader::closeFile | ( | ) |
virtual void SPReader::Configure | ( | ) | [inline, virtual] |
virtual char* SPReader::data | ( | void | ) | [inline, virtual] |
Definition at line 21 of file SPReader.h.
References theBuffer.
Referenced by CSCTFFileReader::fillRawData().
00021 {return (char *) theBuffer;}
virtual int SPReader::dataLength | ( | ) | [inline, virtual] |
Definition at line 22 of file SPReader.h.
References theDataLength.
Referenced by CSCTFFileReader::fillRawData().
00022 {return theDataLength;}
virtual int SPReader::disableBlock | ( | ) | [pure virtual] |
Implemented in FileReaderSP, and FileReaderSPNewFormat.
virtual void SPReader::Enable | ( | ) | [inline, virtual] |
virtual int SPReader::enableBlock | ( | ) | [pure virtual] |
Implemented in FileReaderSP, and FileReaderSPNewFormat.
virtual int SPReader::endBlockRead | ( | ) | [pure virtual] |
Implemented in FileReaderSP, and FileReaderSPNewFormat.
int SPReader::openFile | ( | string | filename | ) |
Definition at line 14 of file SPReader.cc.
References TestMuL1L2Filter_cff::cerr, lat::endl(), and fd_schar.
Referenced by CSCTFFileReader::CSCTFFileReader().
00014 { 00015 00016 fd_schar = open(filename.c_str(), O_RDONLY); 00017 // Abort in case of any failure 00018 if (fd_schar == -1) { 00019 cerr << "SPReader: FATAL in openFile - " << strerror(errno) << endl; 00020 cerr << "SPReader will abort!!!" << endl; 00021 abort(); 00022 } 00023 return 0; 00024 }
void SPReader::printStats | ( | ) | [virtual] |
Definition at line 43 of file SPReader.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), nbytes_schar, and npack_schar.
00044 { 00045 cout << " npackets " << dec << npack_schar 00046 << " nbytes " << nbytes_schar << endl; 00047 }
bool SPReader::readNextEvent | ( | ) |
assumes readNextEvent has been called
Definition at line 26 of file SPReader.cc.
References GenMuonPlsPt100GeV_cfg::cout, debug, lat::endl(), NULL, readSP(), theBuffer, and theDataLength.
Referenced by CSCTFFileReader::fillRawData().
00026 { 00027 bool debug = false; 00028 if(theBuffer) 00029 { 00030 delete theBuffer; 00031 theBuffer = NULL; 00032 } 00033 unsigned short ** buf2 = new unsigned short*; 00034 theDataLength = readSP(buf2, debug); 00035 if (debug) cout << " theDataLength " << theDataLength << endl; 00036 if(theDataLength<=4) return false; 00037 unsigned short * buf=(unsigned short *)*buf2; 00038 theBuffer = buf; 00039 delete buf2; 00040 return true; 00041 }
assumes fd_schar has been set
Implemented in FileReaderSP, and FileReaderSPNewFormat.
Referenced by readNextEvent().
virtual int SPReader::reset | ( | ) | [pure virtual] |
Implemented in FileReaderSP, and FileReaderSPNewFormat.
unsigned short SPReader::errorFlag |
Definition at line 32 of file SPReader.h.
int SPReader::fd_schar [protected] |
Definition at line 39 of file SPReader.h.
Referenced by closeFile(), FileReaderSP::fillMiniBuf(), openFile(), FileReaderSPNewFormat::readSP(), and FileReaderSP::readSP().
bool SPReader::liveData_ [protected] |
Definition at line 43 of file SPReader.h.
int SPReader::nbyte_schar [protected] |
Definition at line 42 of file SPReader.h.
unsigned long SPReader::nbytes_schar [protected] |
int SPReader::npack_schar [protected] |
unsigned short* SPReader::theBuffer [protected] |
int SPReader::theDataLength [protected] |