20 #include "StEmcRawData.h"
22 static const char rcsid[] =
"$Id: StEmcRawData.cxx,v 2.2 2004/07/15 16:36:24 ullrich Exp $";
28 for(
int i=0;i<MAXEMCDATABANK;i++) {
34 StEmcRawData::StEmcRawData(
const StEmcRawData& h) :
StObject(h)
36 for(
int i=0;i<MAXEMCDATABANK;i++) {
37 if(h.header(i) && h.data(i)) {
38 createBank(i,h.sizeHeader(i),h.sizeData(i));
39 setHeader(i,(
unsigned short*)h.header(i));
40 setData(i,(
unsigned short*)h.data(i));
45 StEmcRawData::~StEmcRawData()
47 for(
int i=0;i<MAXEMCDATABANK;i++) deleteBank(i);
51 StEmcRawData::createBank(
int bank,
int sizeHeader,
int sizeData)
54 mHeader[bank].Set(sizeHeader);
55 mData[bank].Set(sizeData);
56 for(
int i = 0;i<sizeHeader;i++) mHeader[bank][i] = 0;
57 for(
int i = 0;i<sizeData;i++) mData[bank][i] = 0;
61 StEmcRawData::deleteBank(
int bank)
68 StEmcRawData::setHeader(
int bank,
unsigned short*
data)
70 if(sizeHeader(bank)==0)
return;
71 mHeader[bank].Set(sizeHeader(bank),(
const Short_t*)data);
75 StEmcRawData::setData(
int bank,
unsigned short* data)
77 if(sizeData(bank)==0)
return;
78 mData[bank].Set(sizeData(bank),(
const Short_t*)data);
82 StEmcRawData::setHeader(
int bank,
int position,
unsigned short data)
84 if(sizeHeader(bank)==0)
return;
85 mHeader[bank][position] = data;
89 StEmcRawData::setData(
int bank,
int position,
unsigned short data)
91 if(sizeData(bank)==0)
return;
92 mData[bank][position] = data;
96 StEmcRawData::header(
int bank)
const
98 return (
unsigned short*)mHeader[bank].GetArray();
101 const unsigned short*
102 StEmcRawData::data(
int bank)
const
104 return (
unsigned short*)mData[bank].GetArray();
108 StEmcRawData::header(
int bank)
110 return (
unsigned short*)mHeader[bank].GetArray();
114 StEmcRawData::data(
int bank)
116 return (
unsigned short*)mData[bank].GetArray();
120 StEmcRawData::header(
int bank,
int position)
122 if(sizeHeader(bank)==0)
return 0;
123 return mHeader[bank][position];
127 StEmcRawData::data(
int bank,
int position)
129 if(sizeData(bank)==0)
return 0;
130 return mData[bank][position];
134 StEmcRawData::header(
int bank,
int position)
const
136 if(sizeHeader(bank)==0)
return 0;
137 return mHeader[bank][position];
141 StEmcRawData::data(
int bank,
int position)
const
143 if(sizeData(bank)==0)
return 0;
144 return mData[bank][position];
148 StEmcRawData::sizeHeader(
int bank)
150 return mHeader[bank].GetSize();
154 StEmcRawData::sizeData(
int bank)
156 return mData[bank].GetSize();
160 StEmcRawData::sizeHeader(
int bank)
const
162 return mHeader[bank].GetSize();
166 StEmcRawData::sizeData(
int bank)
const
168 return mData[bank].GetSize();