StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EztEventHeader.cxx
1 // $Id: EztEventHeader.cxx,v 1.1 2004/10/28 00:10:19 mvl Exp $
2 
3 #include "EztEventHeader.h"
4 
5 ClassImp(EztEventHeader)
6 
7 
8 //--------------------------------------------------
9 //
10 //--------------------------------------------------
12  mComment=NULL;
13  clear();
14 }
15 
16 //--------------------------------------------------
17 //
18 //--------------------------------------------------
19 EztEventHeader :: ~EztEventHeader()
20 {
21  if(mComment) delete [] mComment;
22 }
23 
24 //--------------------------------------------------
25 //
26 //--------------------------------------------------
27 void EztEventHeader :: setComment(const char* s) {
28  mCommentLen = (strlen(s)/8+1)*8; //make it 8 byte aligned
29  if(mComment) delete [] mComment;
30  mComment = new char[mCommentLen];
31  strncpy(mComment,s,mCommentLen);
32 }
33 
34 
35 //--------------------------------------------------
36 //
37 //--------------------------------------------------
38 void EztEventHeader :: clear() {
39  mTimeStamp = -1;
40  mProcessingTime = -1;
41  mCommentLen = 0;
42  mStatus = 0;
43  mRunNumber = 0;
44  if(mComment) delete [] mComment;
45 }
46 
47 
48 
49 //--------------------------------------------------
50 //
51 //--------------------------------------------------
52 void EztEventHeader :: print(int flag, FILE *fd) const{
53  fprintf(fd,"EztEventHeader:\n");
54  fprintf(fd,"\trun number : %-6d \n",mRunNumber);
55  fprintf(fd,"\tevent number : %-6d (0x%06x)\n",mEventNumber,mEventNumber);
56  fprintf(fd,"\ttoken : %-6d (0x%03x)\n",mToken ,mToken);
57  fprintf(fd,"\ttime stamp : %ld / %s",mTimeStamp,
58  ctime((const time_t *)&mTimeStamp));
59  fprintf(fd,"\tproc. time : %ld / %s",mProcessingTime,
60  ctime((const time_t *)&mProcessingTime));
61 
62  fprintf(fd,"\tcomment : %s\n" ,mComment);
63  fprintf(fd,"\tstatus : 0x%08x\n",mStatus);
64 }
65 
66 
67 // $Log: EztEventHeader.cxx,v $
68 // Revision 1.1 2004/10/28 00:10:19 mvl
69 // Initial revision of ezTree classes (for EEmc raw data)
70 //
71 //
72