]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSRawData.cxx
ReadRaw(): TGraphs are created once per event (B.Polichtchouk)
[u/mrichter/AliRoot.git] / ITS / AliITSRawData.cxx
CommitLineData
b0f5e3fc 1////////////////////////////////////////////////
2// RawData classes for set:ITS //
3////////////////////////////////////////////////
4
5
6#include "AliITSRawData.h"
7
8ClassImp(AliITSRawData)
9
10ClassImp(AliITSInStream)
11
12//_____________________________________________________________________________
13
14AliITSInStream::AliITSInStream()
15{
16 //default constructor
17 fStreamLen=0;
18 fInStream=0;
19}
20//_____________________________________________________________________________
21
a8a6107b 22AliITSInStream::AliITSInStream(UInt_t length)
b0f5e3fc 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//_____________________________________________________________________________
36AliITSInStream::~AliITSInStream()
37{
38 //destructor
39 if (fInStream) delete[] fInStream;
40}
41
42//__________________________________________________________________________
ac74f489 43AliITSInStream::AliITSInStream(const AliITSInStream &source) : TObject(source){
b0f5e3fc 44 // Copy Constructor
45 if(&source == this) return;
46 this->fStreamLen = source.fStreamLen;
47 this->fInStream = source.fInStream;
48 return;
49}
50
51//_________________________________________________________________________
52AliITSInStream&
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//_____________________________________________________________________________
62void AliITSInStream::ClearStream()
63{
64 //clear the array
65 memset(fInStream,0,sizeof(UChar_t)*fStreamLen);
66}
67
68
69//_____________________________________________________________________________
a8a6107b 70Bool_t AliITSInStream::CheckCount(UInt_t count) {
b0f5e3fc 71 //check boundaries
a8a6107b 72 if (count <= (UInt_t)fStreamLen) return kTRUE;
b0f5e3fc 73 else {
74 Error("CheckCount", "actual size is %d, the necessary size is %d",fStreamLen,count);
75 return kFALSE;
76 }
77}
78
b0f5e3fc 79
80ClassImp(AliITSOutStream)
81
82 //_______________________________________________________________________
83
84 AliITSOutStream::AliITSOutStream() {
85 //default constructor
86 fStreamLen=0;
87 fOutStream=0;
88}
89
90//__________________________________________________________________________
91
a8a6107b 92AliITSOutStream::AliITSOutStream(UInt_t length) {
b0f5e3fc 93 //
94 // Creates a stream of unsigned chars
95 //
96
97 fStreamLen = length;
a8a6107b 98 fOutStream = new UInt_t[length];
b0f5e3fc 99 ClearStream();
100
101}
102
103//_____________________________________________________________________________
104AliITSOutStream::~AliITSOutStream()
105{
106 //destructor
107 if (fOutStream) delete[] fOutStream;
108}
109
110//__________________________________________________________________________
ac74f489 111AliITSOutStream::AliITSOutStream(const AliITSOutStream &source):TObject(source){
b0f5e3fc 112 // Copy Constructor
113 if(&source == this) return;
114 this->fStreamLen = source.fStreamLen;
115 this->fOutStream = source.fOutStream;
116 return;
117}
118
119//_________________________________________________________________________
120AliITSOutStream&
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//_____________________________________________________________________________
130void AliITSOutStream::ClearStream()
131{
132 // clear stream
a8a6107b 133 memset(fOutStream,0,sizeof(UInt_t)*fStreamLen);
b0f5e3fc 134}
135
136//_____________________________________________________________________________
a8a6107b 137Bool_t AliITSOutStream::CheckCount(UInt_t count)
b0f5e3fc 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}