1 ////////////////////////////////////////////////
2 // RawData classes for set:ITS //
3 ////////////////////////////////////////////////
6 #include "AliITSRawData.h"
8 ClassImp(AliITSRawData)
10 ClassImp(AliITSInStream)
12 //_____________________________________________________________________________
14 AliITSInStream::AliITSInStream()
20 //_____________________________________________________________________________
22 AliITSInStream::AliITSInStream(ULong_t length)
25 // Creates a stream of unsigned chars
29 fInStream = new UChar_t[length];
35 //_____________________________________________________________________________
36 AliITSInStream::~AliITSInStream()
39 if (fInStream) delete[] fInStream;
42 //__________________________________________________________________________
43 AliITSInStream::AliITSInStream(const AliITSInStream &source){
45 if(&source == this) return;
46 this->fStreamLen = source.fStreamLen;
47 this->fInStream = source.fInStream;
51 //_________________________________________________________________________
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;
61 //_____________________________________________________________________________
62 void AliITSInStream::ClearStream()
65 memset(fInStream,0,sizeof(UChar_t)*fStreamLen);
69 //_____________________________________________________________________________
70 Bool_t AliITSInStream::CheckCount(ULong_t count) {
72 if (count <= (ULong_t)fStreamLen) return kTRUE;
74 Error("CheckCount", "actual size is %d, the necessary size is %d",fStreamLen,count);
79 //____________________________________________________________________________
80 void AliITSInStream::Streamer(TBuffer &R__b){
81 // Stream an object of class AliITSInStream.
83 static unsigned char *array;
84 static Bool_t make=kTRUE;
86 if (R__b.IsReading()) {
88 //printf("Streamer: fStreamLen %d\n",fStreamLen);
89 if (make) array=new unsigned char[fStreamLen];
91 memset(array,0,sizeof(UChar_t)*fStreamLen);
93 R__b.ReadFastArray(fInStream,fStreamLen);
97 R__b.WriteFastArray(fInStream,fStreamLen);
103 ClassImp(AliITSOutStream)
105 //_______________________________________________________________________
107 AliITSOutStream::AliITSOutStream() {
108 //default constructor
113 //__________________________________________________________________________
115 AliITSOutStream::AliITSOutStream(ULong_t length) {
117 // Creates a stream of unsigned chars
121 fOutStream = new ULong_t[length];
126 //_____________________________________________________________________________
127 AliITSOutStream::~AliITSOutStream()
130 if (fOutStream) delete[] fOutStream;
133 //__________________________________________________________________________
134 AliITSOutStream::AliITSOutStream(const AliITSOutStream &source){
136 if(&source == this) return;
137 this->fStreamLen = source.fStreamLen;
138 this->fOutStream = source.fOutStream;
142 //_________________________________________________________________________
144 AliITSOutStream::operator=(const AliITSOutStream &source) {
145 // Assignment operator
146 if(&source == this) return *this;
147 this->fStreamLen = source.fStreamLen;
148 this->fOutStream = source.fOutStream;
152 //_____________________________________________________________________________
153 void AliITSOutStream::ClearStream()
156 memset(fOutStream,0,sizeof(ULong_t)*fStreamLen);
159 //_____________________________________________________________________________
160 Bool_t AliITSOutStream::CheckCount(ULong_t count)
163 if (count < fStreamLen) return kTRUE;
165 Error("CheckCount", "actual size is %d, the necessary size is %d",fStreamLen,count);
170 //____________________________________________________________________________
171 void AliITSOutStream::Streamer(TBuffer &R__b){
173 // Stream an object of class AliITSOutStream.
175 static unsigned long *array;
176 static Bool_t make=kTRUE;
178 if (R__b.IsReading()) {
180 //printf("Streamer: fStreamLen %d\n",fStreamLen);
181 if (make) array=new unsigned long[fStreamLen];
183 memset(array,0,sizeof(ULong_t)*fStreamLen);
185 R__b.ReadFastArray(fOutStream,fStreamLen);
189 R__b.WriteFastArray(fOutStream,fStreamLen);