/** @file * $Source: /home/cvsmanager/yoda/event/PscuHeader.cpp,v $ * $Id: PscuHeader.cpp,v 1.4 2004/08/19 15:24:10 kusanagi Exp $ * $Author: kusanagi $ * * Implementation of the PscuHeader class. */ #include #include #include #include #include "PscuHeader.h" #include "Exception.h" using namespace pamela; static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.PscuHeader")); static std::stringstream oss; /** * Create an PscuHeader object. */ PscuHeader::PscuHeader(): OrbitalTime(0), PacketId1(0), PacketId2(0), Counter(0), PacketLenght(0) { } PscuHeader::~PscuHeader() { } /** * Get the packet type of this header. */ const PacketType* PscuHeader::GetPacketType(void) const throw (std::exception) { switch (PacketId1) { case 0x07: return PacketType::PhysEndRun; case 0x08: return PacketType::CalibCalPulse1; case 0x09: return PacketType::CalibCalPulse2; case 0x10: return PacketType::Physics; case 0x11: return PacketType::CalibTrkBoth; case 0x12: return PacketType::CalibTrk1; case 0x13: return PacketType::CalibTrk2; case 0x15: return PacketType::CalibTrd; case 0x16: return PacketType::CalibTof; case 0x17: return PacketType::CalibS4; case 0x18: return PacketType::CalibCalPed; case 0x19: return PacketType::CalibAc; case 0x20: return PacketType::RunHeader; case 0x21: return PacketType::RunTrailer; case 0x22: return PacketType::CalibHeader; case 0x23: return PacketType::CalibTrailer; case 0x24: return PacketType::InitHeader; case 0x25: return PacketType::InitTrailer; case 0x30: return PacketType::EventTrk; case 0x40: return PacketType::TestTrk; case 0x41: return PacketType::TestTof; case 0x50: return PacketType::Log; case 0x51: return PacketType::VarDump; case 0x52: return PacketType::ArrDump; case 0x53: return PacketType::TabDump; case 0x54: return PacketType::Tmtc; case 0x55: return PacketType::Mcmd; case 0x60: return PacketType::ForcedFECmd; case 0x70: return PacketType::AcInit; case 0x71: return PacketType::CalInit; case 0x72: return PacketType::TrkInit; case 0x73: return PacketType::TofInit; case 0x74: return PacketType::TrgInit; case 0x81: return PacketType::CalAlarm; case 0x82: return PacketType::AcAlarm; case 0x83: return PacketType::TrkAlarm; case 0x84: return PacketType::TrgAlarm; case 0x85: return PacketType::TofAlarm; default: { oss.flush(); oss << "\n Unrecognized PacketType: " << (int)PacketId1; logger->error(oss.str().c_str()); throw Exception("Invalid Packed Id1"); } } } ClassImp(PscuHeader)