36 #include "StVpdTriggerDetector.h"
37 #include "tables/St_dst_TrgDet_Table.h"
38 #include "StTriggerData.h"
39 #if !defined(ST_NO_NAMESPACES)
44 static const char rcsid[] =
"$Id: StVpdTriggerDetector.cxx,v 2.7 2013/10/30 15:47:16 ullrich Exp $";
50 memset(*mADC,0,mMaxVpdCounter*
sizeof(
unsigned short));
51 memset(*mTDC,0,mMaxVpdCounter*
sizeof(
unsigned short));
52 memset(*mADCmxq,0,mMaxVpdCounter*
sizeof(
unsigned short));
53 memset(*mTDCmxq,0,mMaxVpdCounter*
sizeof(
unsigned short));
63 StVpdTriggerDetector::StVpdTriggerDetector(
const dst_TrgDet_st&)
69 StVpdTriggerDetector::StVpdTriggerDetector(
const StTriggerData& t)
73 if (mYear<2007)
return;
74 for (i=0; i<mMaxVpdCounter; i++){
75 mADC[east][i] = t.vpdADC(east, i+1);
76 mTDC[east][i] = t.vpdTDC(east, i+1);
77 mADC[west][i] = t.vpdADC(west, i+1);
78 mTDC[west][i] = t.vpdTDC(west, i+1);
79 mADCmxq[east][i] = t.vpdADCHighThr(east, i+1);
80 mTDCmxq[east][i] = t.vpdTDCHighThr(east, i+1);
81 mADCmxq[west][i] = t.vpdADCHighThr(west, i+1);
82 mTDCmxq[west][i] = t.vpdTDCHighThr(west, i+1);
92 mEarliestTDC[east] = t.vpdEarliestTDC(east);
93 mEarliestTDC[west] = t.vpdEarliestTDC(west);
94 mTimeDifference = t.vpdTimeDifference();
98 StVpdTriggerDetector::~StVpdTriggerDetector() {}
101 StVpdTriggerDetector::numberOfVpdCounters()
const {
return mMaxVpdCounter;}
104 StVpdTriggerDetector::ADC(StBeamDirection eastwest,
unsigned int i)
const
106 if (i <= mMaxVpdCounter && i!=0)
107 return mADC[eastwest][i-1];
113 StVpdTriggerDetector::TDC(StBeamDirection eastwest,
unsigned int i)
const
115 if (i <= mMaxVpdCounter && i!=0)
116 return mTDC[eastwest][i-1];
122 StVpdTriggerDetector::EarliestTDC(StBeamDirection eastwest)
const
124 return mEarliestTDC[eastwest];
128 StVpdTriggerDetector::setADC(StBeamDirection eastwest,
unsigned int i,
unsigned short v)
130 if (i <= mMaxVpdCounter && i!=0)
131 mADC[eastwest][i-1] = v;
135 StVpdTriggerDetector::setTDC(StBeamDirection eastwest,
unsigned int i,
unsigned short v)
137 if (i <= mMaxVpdCounter && i!=0)
138 mTDC[eastwest][i-1] = v;
141 unsigned short StVpdTriggerDetector::ADCmxq(StBeamDirection eastwest,
unsigned int i)
const
143 if (i <= mMaxVpdCounter && i!=0)
144 return mADCmxq[eastwest][i-1];
148 unsigned short StVpdTriggerDetector::TDCmxq(StBeamDirection eastwest,
unsigned int i)
const
150 if (i <= mMaxVpdCounter && i!=0)
151 return mTDCmxq[eastwest][i-1];
155 void StVpdTriggerDetector::setADCmxq(StBeamDirection eastwest,
unsigned int i,
unsigned short v)
157 if (i <= mMaxVpdCounter && i!=0)
158 mADCmxq[eastwest][i-1] = v;
161 void StVpdTriggerDetector::setTDCmxq(StBeamDirection eastwest,
unsigned int i,
unsigned short v)
163 if (i <= mMaxVpdCounter && i!=0)
164 mTDCmxq[eastwest][i-1] = v;