12 memset(mLength, 0,
sizeof(mLength));
13 memset(mHeader, 0,
sizeof(mHeader));
14 memset(mTriggerData, 0,
sizeof(mTriggerData));
15 memset(mBemcData, 0,
sizeof(mBemcData));
16 memset(mEemcData, 0,
sizeof(mEemcData));
19 void JanEvent::setHeader(
const char* header)
22 mLength[0] = strlen(header);
23 strcpy(mHeader, header);
27 void JanEvent::setTriggerData(
char* trgData)
30 mLength[1] =
sizeof(mTriggerData);
31 memcpy(mTriggerData, trgData,
sizeof(mTriggerData));
35 void JanEvent::setBemcData(
unsigned short* bemcData)
38 mLength[2] =
sizeof(mBemcData);
39 memcpy(mBemcData, bemcData,
sizeof(mBemcData));
43 void JanEvent::setEemcData(
unsigned short* eemcData)
46 mLength[3] =
sizeof(mEemcData);
47 memcpy(mEemcData, eemcData,
sizeof(mEemcData));
51 istream& operator>>(istream& in,
JanEvent& event)
53 in.read((
char*)event.mLength,
sizeof(event.mLength));
54 in.read(event.mHeader, event.mLength[0]);
55 in.read(event.mTriggerData, event.mLength[1]);
56 in.read((
char*)event.mBemcData, event.mLength[2]);
57 in.read((
char*)event.mEemcData, event.mLength[3]);
61 ostream& operator<<(ostream& out,
const JanEvent& event)
63 out.write((
char*)event.mLength,
sizeof(event.mLength));
64 out.write(event.mHeader, event.mLength[0]);
65 out.write(event.mTriggerData, event.mLength[1]);
66 out.write((
char*)event.mBemcData, event.mLength[2]);
67 out.write((
char*)event.mEemcData, event.mLength[3]);