29 #include "StFpdCollection.h"
32 static const char rcsid[] =
"$Id: StFpdCollection.cxx,v 2.5 2003/09/02 17:58:05 perev Exp $";
39 for(i=0; i<mMaxAdc; i++){mAdc[i] = 0;}
40 for(i=0; i<mMaxTdc; i++){mTdc[i] = 0;}
41 for(i=0; i<mMaxRegisters; i++){mReg[i] = 0;}
42 for(i=0; i<mMaxPedestal; i++){mPed[i] = 0;}
43 for(i=0; i<mMaxScalers; i++){mScl[i] = 0;}
46 StFpdCollection::~StFpdCollection() {}
49 StFpdCollection::adc() {
return mAdc;}
52 StFpdCollection::adc()
const {
return mAdc;}
55 StFpdCollection::tdc() {
return mTdc;}
58 StFpdCollection::tdc()
const {
return mTdc;}
61 StFpdCollection::registers(
unsigned int n)
const
63 if(n < mMaxRegisters)
return mReg[n];
68 StFpdCollection::scaler(
unsigned int n)
const
70 if(n < mMaxScalers)
return mScl[n];
75 StFpdCollection::pedestal()
81 StFpdCollection::pedestal()
const
87 StFpdCollection::setAdc(
unsigned int n,
unsigned short val)
89 if(n < mMaxAdc) mAdc[n] = val;
93 StFpdCollection::setTdc(
unsigned int n,
unsigned short val)
95 if(n < mMaxTdc) mTdc[n] = val;
99 StFpdCollection::setRegister(
unsigned int n,
unsigned short val)
101 if(n < mMaxRegisters) mReg[n] = val;
105 StFpdCollection::setPedestal(
unsigned int n,
unsigned short val)
107 if(n < mMaxPedestal) mPed[n] = val;
111 StFpdCollection::setScaler(
unsigned int n,
unsigned int val)
113 if(n < mMaxScalers) mScl[n] = val;
117 StFpdCollection::north(
unsigned int n)
const
119 if(n>0 && n<=mMaxPMTpEEMC)
return mAdc[n+47];
124 StFpdCollection::south(
unsigned int n)
const
126 if(n>0 && n<=mMaxPMTPbg)
return mAdc[n+31];
131 StFpdCollection::top(
unsigned int n)
const
133 if(n>0 && n<=mMaxPMTPbg)
return mAdc[n-1];
138 StFpdCollection::bottom(
unsigned int n)
const
140 if(n>0 && n<=mMaxPMTPbg)
return mAdc[n+15];
145 StFpdCollection::smdx(
unsigned int n)
const
147 if(n>0 && n<=mMaxPMTSmdX)
return mAdc[n+59];
152 StFpdCollection::smdy(
unsigned int n)
const
154 if(n>0 && n<=mMaxPMTSmdY)
return mAdc[n+119];
159 StFpdCollection::pres1(
unsigned int n)
const
161 if(n>0 && n<=mMaxPMTpEEMC)
return mAdc[n+219];
166 StFpdCollection::pres2(
unsigned int n)
const
168 if(n>0 && n<=mMaxPMTpEEMC)
return mAdc[n+235];
173 StFpdCollection::southVeto()
const
179 StFpdCollection::sumAdcNorth()
const
182 for(
int i=1; i<=mMaxPMTpEEMC; i++){sum+=(
unsigned int)north(i);}
187 StFpdCollection::sumAdcSouth()
const
190 for(
int i=1; i<=mMaxPMTPbg; i++){sum+=(
unsigned int)south(i);}
195 StFpdCollection::sumAdcTop()
const
198 for(
int i=1; i<=mMaxPMTPbg; i++){sum+=(
unsigned int)top(i);}
203 StFpdCollection::sumAdcBottom()
const
206 for(
int i=1; i<=mMaxPMTPbg; i++){sum+=(
unsigned int)bottom(i);}
211 StFpdCollection::sumAdcPreShower1()
const
214 for(
int i=1; i<=mMaxPMTpEEMC; i++){sum+=(
unsigned int)pres1(i);}
219 StFpdCollection::sumAdcPreShower2()
const
222 for(
int i=1; i<=mMaxPMTpEEMC; i++){sum+=(
unsigned int)pres2(i);}
227 StFpdCollection::sumAdcSmdX()
const
230 for(
int i=1; i<=mMaxPMTSmdX; i++){sum+=(
unsigned int)smdx(i);}
235 StFpdCollection::sumAdcSmdY()
const
238 for(
int i=1; i<=mMaxPMTSmdY; i++){sum+=(
unsigned int)smdy(i);}
243 StFpdCollection::setToken(
unsigned int val)
249 StFpdCollection::dump()
252 cout <<
"FPD data dump token " << mToken << endl;
253 cout <<
"North ADC ";
for(i=1; i<13; i++){cout << north(i) <<
" ";}; cout << endl;
254 cout <<
"South ADC ";
for(i=1; i<17; i++){cout << south(i) <<
" ";}; cout << endl;
255 cout <<
"Top ADC ";
for(i=1; i<17; i++){cout << top(i) <<
" ";}; cout << endl;
256 cout <<
"Bottom ADC ";
for(i=1; i<17; i++){cout << bottom(i) <<
" ";}; cout << endl;
257 cout <<
"PreShower1 ";
for(i=1; i<13; i++){cout << pres1(i) <<
" ";}; cout << endl;
258 cout <<
"PreShower2 ";
for(i=1; i<13; i++){cout << pres2(i) <<
" ";}; cout << endl;
259 cout <<
"SMD X ";
for(i=1; i<61; i++){cout << smdx(i) <<
" ";}; cout << endl;
260 cout <<
"SMD Y ";
for(i=1; i<101; i++){cout << smdy(i) <<
" ";}; cout << endl;
261 cout <<
"South Veto " << southVeto() << endl;
262 cout <<
"Scalers ";
for(i=0; i<128; i++){printf(
" %x ",mScl[i]);}; cout << endl;