#include <TOctalFADCBankReader.h>
Definition at line 10 of file TOctalFADCBankReader.h.
TOctalFADCBankReader::TOctalFADCBankReader |
( |
std::string |
bankname) | |
|
|
explicit |
TOctalFADCBankReader::TOctalFADCBankReader |
( |
) | |
|
|
inlineprotected |
TOctalFADCBankReader::TOctalFADCBankReader |
( |
std::string |
bankname) | |
|
|
explicit |
TOctalFADCBankReader::TOctalFADCBankReader |
( |
) | |
|
|
inlineprotected |
void TOctalFADCBankReader::ClearEvent |
( |
) | |
|
void TOctalFADCBankReader::ClearEvent |
( |
) | |
|
|
inline |
std::string TOctalFADCBankReader::GetBankName |
( |
) | |
const |
|
inline |
std::string TOctalFADCBankReader::GetBankName |
( |
) | |
const |
|
inline |
const std::vector<TOctalFADCIsland*>& TOctalFADCBankReader::GetIslandVectorCopy |
( |
) | |
|
|
inline |
int TOctalFADCBankReader::GetNIslands |
( |
) | |
const |
|
inline |
int TOctalFADCBankReader::GetNIslands |
( |
) | |
const |
|
inline |
void TOctalFADCBankReader::ProcessEvent |
( |
EVENT_HEADER * |
pheader, |
|
|
void * |
pevent |
|
) |
| |
Reads the specified MIDAS bank, interpretting the raw data format into a vector<TOctalFADCIsland*>. Steps to use:
reader.ProcessEvent(pheader, pevent);
vector<TOctalFADCIsland*> islands = reader.GetIslandVectorCopy();
Automatically calls ClearEvent() at the beginning of ProcessEvent().
Definition at line 27 of file TOctalFADCBankReader.cpp.
References ClearEvent(), fBankName, fData, i, kDataBlockSize, kSamplesArrayInitialSize, nSamples, printf(), and StitchIslands().
32 int bankSize = bk_locate(pevent,
fBankName.c_str(),&raw);
35 vector<int> islandSamples;
38 bool allowLowSampls = 1;
39 int islandTimestamp = 0;
40 int lastTimestamp = -1;
55 int timestamp = ((raw[
i*10+0] & 0x7f) << 20) |
59 bool overflowB0 = ((raw[
i*10+3] & 0x08) != 0);
60 bool overflowA0 = ((raw[
i*10+3] & 0x04) != 0);
61 bool overflowB1 = ((raw[
i*10+3] & 0x02) != 0);
62 bool overflowA1 = ((raw[
i*10+3] & 0x01) != 0);
63 int sampleB0 = (overflowB0 << 12) |
66 int sampleA0 = (overflowA0 << 12) |
67 ((raw[
i*10+5] & 0xf) << 8) |
69 int sampleB1 = (overflowB1 << 12) |
72 int sampleA1 = (overflowA1 << 12) |
73 ((raw[
i*10+8] & 0xf) << 8) |
76 if(timestamp != lastTimestamp + 1) {
77 if(islandSamples.size() > 4) {
84 islandSamples.clear();
86 else if (islandSamples.size() <= 4) {
87 islandSamples.clear();
90 islandTimestamp = timestamp;
93 islandSamples.push_back(sampleA1);
94 islandSamples.push_back(sampleB1);
95 islandSamples.push_back(sampleA0);
96 islandSamples.push_back(sampleB0);
98 lastTimestamp = timestamp;
101 if ((
i==nSamples-1) && (islandSamples.size() > 4)){
108 for(
int k=0; k<10; k++){
112 printf(
"fadc=%x t=%2x %2x %2x %2x %2x\n",
i, timestamp,
113 sampleA1, sampleB1, sampleA0,sampleB0);
void TOctalFADCBankReader::ProcessEvent |
( |
EVENT_HEADER * |
pheader, |
|
|
void * |
pevent |
|
) |
| |
void TOctalFADCBankReader::StitchIslands |
( |
) | |
|
|
protected |
void TOctalFADCBankReader::StitchIslands |
( |
) | |
|
|
protected |
Don't use the unnamed constructor.
std::string TOctalFADCBankReader::fBankName |
|
protected |
static const int TOctalFADCBankReader::kDataBlockSize = 10 |
|
static |
static const int TOctalFADCBankReader::kSamplesArrayInitialSize = 32 |
|
static |
The documentation for this class was generated from the following files: