00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "StMtdTriggerDetector.h"
00018 #include "StTriggerData.h"
00019
00020 static const char rcsid[] = "$Id: StMtdTriggerDetector.cxx,v 2.1 2007/07/02 20:21:55 ullrich Exp $";
00021
00022 ClassImp(StMtdTriggerDetector)
00023
00024 StMtdTriggerDetector::StMtdTriggerDetector()
00025 {
00026 memset(mADC,0,sizeof(mADC));
00027 memset(mTDC,0,sizeof(mTDC));
00028 }
00029
00030 StMtdTriggerDetector::StMtdTriggerDetector(const StTriggerData& tt)
00031 {
00032 for(int i=0; i<mMaxMtdCounter; i++){
00033 mADC[west][i] = tt.mtdAdc(west,i);
00034 mADC[east][i] = tt.mtdAdc(east,i);
00035 mTDC[west][i] = tt.mtdTdc(west,i);
00036 mTDC[east][i] = tt.mtdTdc(east,i);
00037 }
00038 }
00039
00040 StMtdTriggerDetector::~StMtdTriggerDetector() {}
00041
00042 unsigned int
00043 StMtdTriggerDetector::numberOfMtdCounters() const {return mMaxMtdCounter;}
00044
00045 unsigned short
00046 StMtdTriggerDetector::adc(StBeamDirection eastwest, unsigned int i) const
00047 {
00048 if (i < mMaxMtdCounter)
00049 return mADC[eastwest][i];
00050 else
00051 return 0;
00052 }
00053
00054 unsigned short
00055 StMtdTriggerDetector::tdc(StBeamDirection eastwest, unsigned int i) const
00056 {
00057 if (i < mMaxMtdCounter)
00058 return mTDC[eastwest][i];
00059 else
00060 return 0;
00061 }
00062
00063 void
00064 StMtdTriggerDetector::setAdc(StBeamDirection eastwest, unsigned int i, unsigned short v)
00065 {
00066 if (i < mMaxMtdCounter )
00067 mADC[eastwest][i] = v;
00068 }
00069
00070 void
00071 StMtdTriggerDetector::setTdc(StBeamDirection eastwest, unsigned int i, unsigned short v)
00072 {
00073 if (i < mMaxMtdCounter )
00074 mTDC[eastwest][i] = v;
00075 }
00076