| 1 |
/** @file |
/** @file |
| 2 |
* $Author: kusanagi $ |
* $Author: pam-rm2 $ |
| 3 |
* $Date: 2006/05/30 19:10:02 $ |
* $Date: 2006/08/23 14:39:44 $ |
| 4 |
* $Revision: 6.4 $ |
* $Revision: 6.8 $ |
| 5 |
* |
* |
| 6 |
* Implementation of the functions of a sample Algorithm class. |
* Implementation of the functions of a sample Algorithm class. |
| 7 |
* This file can be used as a templace to develop your own algorithm. |
* This file can be used as a templace to develop your own algorithm. |
| 87 |
*/ |
*/ |
| 88 |
std::string EventReader::GetVersionInfo(void) const { |
std::string EventReader::GetVersionInfo(void) const { |
| 89 |
return |
return |
| 90 |
"$Header: /home/cvsmanager/yoda/techmodel/EventReader.cpp,v 6.4 2006/05/30 19:10:02 kusanagi Exp $\n"; |
"$Header: /afs/ba.infn.it/user/pamela/src/CVS/yoda/techmodel/EventReader.cpp,v 6.8 2006/08/23 14:39:44 pam-rm2 Exp $\n"; |
| 91 |
} |
} |
| 92 |
|
|
| 93 |
/** |
/** |
| 151 |
oss.str(""); |
oss.str(""); |
| 152 |
oss << exc.print() << " " << Header->GetPscuHeader()->Print(); |
oss << exc.print() << " " << Header->GetPscuHeader()->Print(); |
| 153 |
logger->error(oss.str().c_str()); |
logger->error(oss.str().c_str()); |
| 154 |
//archiveCorruptedPacket(Header->GetPscuHeader()->FileOffset, Header->GetPscuHeader()->PacketLenght); |
archiveCorruptedPacket(Header->GetPscuHeader()->FileOffset, Header->GetPscuHeader()->PacketLenght); |
|
//InputFile->seekg( (-1)*(Header->GetPscuHeader()->GetPacketLenght() + 14) , std::ios::cur); |
|
| 155 |
|
|
| 156 |
} catch (UnidentifiedPacketException exc) { |
} catch (UnidentifiedPacketException exc) { |
| 157 |
oss.str(""); |
oss.str(""); |
| 184 |
/** |
/** |
| 185 |
* Unpack the PSCU header from a file into the structure. |
* Unpack the PSCU header from a file into the structure. |
| 186 |
*/ |
*/ |
| 187 |
void EventReader::UnpackPscuHeader(void) throw (WrongCRCHeaderException, LengthException) { |
void EventReader::UnpackPscuHeader(void) throw (WrongCRCHeaderException, LengthException, BackwardCounterException) { |
| 188 |
stringstream oss; |
stringstream oss; |
| 189 |
int response = 0; |
int response = 0; |
| 190 |
char buff[16]; |
char buff[16]; |
| 191 |
|
memset(buff, 0, 16*sizeof(char)); |
| 192 |
InputFile->read(buff, sizeof(buff)); |
InputFile->read(buff, sizeof(buff)); |
| 193 |
|
|
| 194 |
|
|
| 285 |
int loop = -1; |
int loop = -1; |
| 286 |
char buffer[buffSize]; |
char buffer[buffSize]; |
| 287 |
bool flagOverPad = false; |
bool flagOverPad = false; |
| 288 |
|
memset(buffer, 0, buffSize*sizeof(char)); |
| 289 |
while (!InputFile->eof()) { |
while (!InputFile->eof()) { |
| 290 |
InputFile->read(buffer, sizeof(buffer)); |
InputFile->read(buffer, sizeof(buffer)); |
| 291 |
index = 0; |
index = 0; |
| 316 |
return false; |
return false; |
| 317 |
} |
} |
| 318 |
|
|
| 319 |
/* |
|
| 320 |
int EventReader::archiveCorruptedPacket(long int offset, long int length) { |
int EventReader::archiveCorruptedPacket(long int offset, long int length) { |
| 321 |
if (!corruptedPacketFile.is_open()) { |
if (!corruptedPacketFile.is_open()) { |
| 322 |
oss.str(""); |
oss.str(""); |
| 332 |
corruptedPacketFile.write(buffer, length); |
corruptedPacketFile.write(buffer, length); |
| 333 |
InputFile->seekg(offset + 1, ios_base::beg ); |
InputFile->seekg(offset + 1, ios_base::beg ); |
| 334 |
} |
} |
| 335 |
*/ |
|
| 336 |
ClassImp(EventReader) |
ClassImp(EventReader) |