StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EEmcEventHeader.cxx
1 // $Id: EEmcEventHeader.cxx,v 1.11 2007/07/12 19:30:13 fisyak Exp $
2 
3 #include "EEmcEventHeader.h"
4 #include <string.h>
5 
6 //#include <Stiostream.h>
7 
8 ClassImp(EEmcEventHeader)
9 
10 
11 
12 
13 //--------------------------------------------------
14 //
15 //--------------------------------------------------
17  mComment=NULL;
18 
19  clear();
20 }
21 
22 //--------------------------------------------------
23 //
24 //--------------------------------------------------
25 EEmcEventHeader :: ~EEmcEventHeader()
26 {
27  if(mComment) delete [] mComment;
28 }
29 
30 //--------------------------------------------------
31 void EEmcEventHeader :: setComment(const char* s) {
32  mCommentLen = (strlen(s)/8+1)*8; //make it 8 byte aligned
33  //mCommentLen = (mCommentLen<MaxCommentLen) ? mCommentLen : MaxCommentLen;
34  if(mComment) delete [] mComment;
35  mComment = new char[mCommentLen];
36  strncpy(mComment,s,mCommentLen);
37 }
38 
39 
40 //--------------------------------------------------
41 //
42 //--------------------------------------------------
43 void EEmcEventHeader :: clear() {
44  mTimeStamp = -1;
45  mProcessingTime = -1;
46  mCommentLen = 0;
47  mStatus = 0;
48  mRunNumber = 0;
49  if(mComment) delete [] mComment;
50 }
51 
52 
53 
54 //--------------------------------------------------
55 //
56 //--------------------------------------------------
57 void EEmcEventHeader :: print(FILE *fd) const{
58  fprintf(fd,"EEmcEventHeader:\n");
59  fprintf(fd,"\trun number : %-6d \n",mRunNumber);
60  fprintf(fd,"\tevent number : %-6d (0x%06x)\n",mEventNumber,mEventNumber);
61  fprintf(fd,"\ttoken : %-6d (0x%03x)\n",mToken ,mToken);
62  fprintf(fd,"\ttime stamp : %ld / %s",mTimeStamp,
63  ctime((const time_t *)&mTimeStamp));
64  fprintf(fd,"\tproc. time : %ld / %s",mProcessingTime,
65  ctime((const time_t *)&mProcessingTime));
66 
67  fprintf(fd,"\tcomment : %s\n" ,mComment);
68  fprintf(fd,"\tstatus : 0x%08x\n",mStatus);
69 }
70 
71 
72 // $Log: EEmcEventHeader.cxx,v $
73 // Revision 1.11 2007/07/12 19:30:13 fisyak
74 // Add includes for ROOT 5.16
75 //
76 // Revision 1.10 2004/07/09 02:38:05 balewski
77 // BTOW data are not masked out any more but headres are checked as for EEMC
78 //
79 // Revision 1.9 2003/09/17 22:05:25 zolnie
80 // delete mumbo-jumbo
81 //
82 // Revision 1.8 2003/09/05 15:04:20 zolnie
83 // remove Stiostream/iostream from the source code
84 //
85 // Revision 1.7 2003/09/02 17:57:55 perev
86 // gcc 3.2 updates + WarnOff
87 //
88 // Revision 1.6 2003/06/03 02:41:03 zolnie
89 // *** empty log message ***
90 //
91 // Revision 1.5 2003/06/03 02:40:02 zolnie
92 // added run number
93 //
94 // Revision 1.4 2003/05/27 20:25:21 zolnie
95 // print status
96 //
97 // Revision 1.3 2003/05/27 19:11:43 zolnie
98 // added dE/dx info
99 //
100 // Revision 1.2 2003/05/26 14:44:34 zolnie
101 // rewritten implementation of EEmcL3Tracks using TClonesArray
102 // introduced a common Makefile and mklinkdef.pl
103 //
104 // Revision 1.1 2003/05/20 19:22:58 zolnie
105 // new additions for ..... :)
106 //
107