]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSRawData.cxx
Update rawdata format for trigger (Christian)
[u/mrichter/AliRoot.git] / ITS / AliITSRawData.cxx
1 ////////////////////////////////////////////////
2 //  RawData classes for set:ITS               //
3 ////////////////////////////////////////////////
4
5
6 #include "AliITSRawData.h"
7
8 ClassImp(AliITSRawData)
9
10 ClassImp(AliITSInStream)
11
12 //_____________________________________________________________________________
13
14 AliITSInStream::AliITSInStream()
15 {
16   //default constructor
17   fStreamLen=0;
18   fInStream=0;
19 }
20 //_____________________________________________________________________________
21
22 AliITSInStream::AliITSInStream(UInt_t length)
23 {
24   //
25   // Creates a stream of unsigned chars
26   //
27   
28   fStreamLen = length;
29   fInStream = new UChar_t[length]; 
30   
31   ClearStream(); 
32   
33 }
34
35 //_____________________________________________________________________________
36 AliITSInStream::~AliITSInStream()
37 {
38   //destructor
39   if (fInStream) delete[] fInStream;
40 }
41
42 //__________________________________________________________________________
43 AliITSInStream::AliITSInStream(const AliITSInStream &source) : TObject(source){
44   //     Copy Constructor 
45   if(&source == this) return;
46   this->fStreamLen = source.fStreamLen;
47   this->fInStream = source.fInStream;
48   return;
49 }
50
51 //_________________________________________________________________________
52 AliITSInStream& 
53   AliITSInStream::operator=(const AliITSInStream &source) {
54   //    Assignment operator
55   if(&source == this) return *this;
56   this->fStreamLen = source.fStreamLen;
57   this->fInStream = source.fInStream;
58   return *this;
59 }
60
61 //_____________________________________________________________________________
62 void AliITSInStream::ClearStream()
63 {
64   //clear the array
65   memset(fInStream,0,sizeof(UChar_t)*fStreamLen);
66 }
67
68
69 //_____________________________________________________________________________
70 Bool_t AliITSInStream::CheckCount(UInt_t count) {
71   //check boundaries
72   if (count <= (UInt_t)fStreamLen) return kTRUE;
73   else {
74     Error("CheckCount", "actual size is %d, the necessary size is %d",fStreamLen,count);
75     return kFALSE;
76   }
77 }
78
79
80 ClassImp(AliITSOutStream)
81   
82   //_______________________________________________________________________
83   
84   AliITSOutStream::AliITSOutStream() {
85   //default constructor
86   fStreamLen=0;
87   fOutStream=0;
88 }
89
90 //__________________________________________________________________________
91
92 AliITSOutStream::AliITSOutStream(UInt_t length) {
93   //
94   // Creates a stream of unsigned chars
95   //
96   
97   fStreamLen = length;
98   fOutStream = new UInt_t[length];  
99   ClearStream(); 
100   
101 }
102
103 //_____________________________________________________________________________
104 AliITSOutStream::~AliITSOutStream()
105 {
106   //destructor
107   if (fOutStream) delete[] fOutStream;
108 }
109
110 //__________________________________________________________________________
111 AliITSOutStream::AliITSOutStream(const AliITSOutStream &source):TObject(source){
112   //     Copy Constructor 
113   if(&source == this) return;
114   this->fStreamLen = source.fStreamLen;
115   this->fOutStream = source.fOutStream;
116   return;
117 }
118
119 //_________________________________________________________________________
120 AliITSOutStream& 
121   AliITSOutStream::operator=(const AliITSOutStream &source) {
122   //    Assignment operator
123   if(&source == this) return *this;
124   this->fStreamLen = source.fStreamLen;
125   this->fOutStream = source.fOutStream;
126   return *this;
127 }
128
129 //_____________________________________________________________________________
130 void AliITSOutStream::ClearStream()
131 {
132   // clear stream
133   memset(fOutStream,0,sizeof(UInt_t)*fStreamLen);
134 }
135
136 //_____________________________________________________________________________
137 Bool_t AliITSOutStream::CheckCount(UInt_t count)
138 {
139   //check boundaries
140   if (count < fStreamLen) return kTRUE;
141   else {
142     Error("CheckCount", "actual size is %d, the necessary size is %d",fStreamLen,count);
143     return kFALSE;
144   }
145 }