fix fsuReader.h for modified ClassData
This commit is contained in:
parent
3039a20f61
commit
257874c822
|
@ -7,10 +7,10 @@ class FSUReader{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FSUReader();
|
FSUReader();
|
||||||
FSUReader(std::string fileName, uShort dataSize = 100, int verbose = 1);
|
FSUReader(std::string fileName, uInt dataSize = 100, int verbose = 1);
|
||||||
~FSUReader();
|
~FSUReader();
|
||||||
|
|
||||||
void OpenFile(std::string fileName, uShort dataSize, int verbose = 1);
|
void OpenFile(std::string fileName, uInt dataSize, int verbose = 1);
|
||||||
bool isOpen() const{return inFile == nullptr ? false : true;}
|
bool isOpen() const{return inFile == nullptr ? false : true;}
|
||||||
|
|
||||||
void ScanNumBlock(int verbose = 1, uShort saveData = 0);
|
void ScanNumBlock(int verbose = 1, uShort saveData = 0);
|
||||||
|
@ -101,11 +101,11 @@ inline FSUReader::FSUReader(){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline FSUReader::FSUReader(std::string fileName, uShort dataSize, int verbose){
|
inline FSUReader::FSUReader(std::string fileName, uInt dataSize, int verbose){
|
||||||
OpenFile(fileName, dataSize, verbose);
|
OpenFile(fileName, dataSize, verbose);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void FSUReader::OpenFile(std::string fileName, uShort dataSize, int verbose){
|
inline void FSUReader::OpenFile(std::string fileName, uInt dataSize, int verbose){
|
||||||
|
|
||||||
/// File format must be YYY...Y_runXXX_AAA_BBB_TT_CCC.fsu
|
/// File format must be YYY...Y_runXXX_AAA_BBB_TT_CCC.fsu
|
||||||
/// YYY...Y = prefix
|
/// YYY...Y = prefix
|
||||||
|
@ -271,6 +271,7 @@ inline int FSUReader::ReadNextBlock(bool traceON, int verbose, uShort saveData){
|
||||||
}
|
}
|
||||||
|
|
||||||
data->ClearTriggerRate();
|
data->ClearTriggerRate();
|
||||||
|
data->ClearNumEventsDecoded();
|
||||||
data->ClearBuffer(); // this will clear the buffer.
|
data->ClearBuffer(); // this will clear the buffer.
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -312,7 +313,9 @@ inline void FSUReader::ScanNumBlock(int verbose, uShort saveData){
|
||||||
fseek(inFile, 0L, SEEK_SET);
|
fseek(inFile, 0L, SEEK_SET);
|
||||||
filePos = 0;
|
filePos = 0;
|
||||||
|
|
||||||
while( ReadNextBlock(saveData < 2 ? false : true, verbose - 1, saveData) == 0 ){
|
bool isTraceOn = saveData < 2 ? false : true;
|
||||||
|
|
||||||
|
while( ReadNextBlock(isTraceOn, verbose - 1, saveData) == 0 ){
|
||||||
blockPos.push_back(filePos);
|
blockPos.push_back(filePos);
|
||||||
blockTimeStamp.push_back(data->aggTime);
|
blockTimeStamp.push_back(data->aggTime);
|
||||||
blockID ++;
|
blockID ++;
|
||||||
|
@ -323,6 +326,7 @@ inline void FSUReader::ScanNumBlock(int verbose, uShort saveData){
|
||||||
if(verbose) {
|
if(verbose) {
|
||||||
printf("\nScan complete: number of data Block : %lu\n", totNumBlock);
|
printf("\nScan complete: number of data Block : %lu\n", totNumBlock);
|
||||||
printf( " number of hit : %lu\n", hitCount);
|
printf( " number of hit : %lu\n", hitCount);
|
||||||
|
if( saveData )printf( " size of the hit array : %lu\n", hit.size());
|
||||||
|
|
||||||
if( saveData ){
|
if( saveData ){
|
||||||
size_t sizeT = sizeof(hit[0]) * hit.size();
|
size_t sizeT = sizeof(hit[0]) * hit.size();
|
||||||
|
@ -334,11 +338,13 @@ inline void FSUReader::ScanNumBlock(int verbose, uShort saveData){
|
||||||
filePos = 0;
|
filePos = 0;
|
||||||
|
|
||||||
//check is the hitCount == hit.size();
|
//check is the hitCount == hit.size();
|
||||||
if( hitCount != hit.size() ){
|
if( saveData ){
|
||||||
|
if( hitCount != hit.size()){
|
||||||
printf("!!!!!! the Data::dataSize is not big enough. !!!!!!!!!!!!!!!\n");
|
printf("!!!!!! the Data::dataSize is not big enough. !!!!!!!!!!!!!!!\n");
|
||||||
}else{
|
}else{
|
||||||
SortHit(verbose+1);
|
SortHit(verbose+1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::string FSUReader::SaveHit2NewFile(std::string saveFolder){
|
inline std::string FSUReader::SaveHit2NewFile(std::string saveFolder){
|
||||||
|
|
Loading…
Reference in New Issue
Block a user