47 #include "StCtbTriggerDetector.h"
48 #include "tables/St_dst_TrgDet_Table.h"
49 #include "StTriggerData.h"
51 static const char rcsid[] =
"$Id: StCtbTriggerDetector.cxx,v 2.11 2009/04/16 15:23:10 ullrich Exp $";
57 memset(mBeg,0,mEnd-mBeg);
60 StCtbTriggerDetector::StCtbTriggerDetector(
const dst_TrgDet_st& t)
62 memset(mBeg,0,mEnd-mBeg);
64 for(i=0; i<mMaxTrays; i++) {
65 for(j=0; j<mMaxSlats; j++) {
66 for(k=0; k<mMaxEventSamples; k++) {
67 mMips[i][j][k] = t.nCtb[i][j][k];
68 mTime[i][j][k] = t.timeCtb[i][j][k];
72 for(i=0; i<mMaxAux; i++) {
73 for(j=0; j<mMaxEventSamples; j++) {
74 mAux[i][j] = t.ctbaux[i][j];
77 mNumberOfPreSamples = t.npre;
78 mNumberOfPostSamples = t.npost;
81 StCtbTriggerDetector::StCtbTriggerDetector(
const StTriggerData& t)
83 memset(mBeg,0,mEnd-mBeg);
84 int evtmap[mMaxEventSamples] = {0, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5};
87 for(i=0; i<mMaxTrays; i++) {
88 for(j=0; j<mMaxSlats; j++) {
93 mMips[i][j][k] = t.ctbTraySlat(i,j,evt);
101 mNumberOfPreSamples = 5;
102 mNumberOfPostSamples = 5;
105 StCtbTriggerDetector::~StCtbTriggerDetector() {}
108 StCtbTriggerDetector::numberOfTrays()
const {
return mMaxTrays;}
111 StCtbTriggerDetector::numberOfSlats()
const {
return mMaxSlats;}
114 StCtbTriggerDetector::numberOfAuxWords()
const {
return mMaxAux;}
117 StCtbTriggerDetector::numberOfPreSamples()
const {
return mNumberOfPreSamples;}
120 StCtbTriggerDetector::numberOfPostSamples()
const {
return mNumberOfPostSamples;}
123 StCtbTriggerDetector::mips(
unsigned int i,
unsigned int j,
unsigned int k)
const
125 return mMips[i][j][k];
129 StCtbTriggerDetector::mips(
unsigned int evt)
const
132 for (
unsigned int i=0; i<mMaxTrays; i++)
133 for (
unsigned int j=0; j<mMaxSlats; j++)
134 sum += mMips[i][j][evt];
139 StCtbTriggerDetector::time(
unsigned int i,
unsigned int j,
unsigned int k)
const
141 return mTime[i][j][k];
145 StCtbTriggerDetector::aux(
unsigned int i,
unsigned int j)
const
151 StCtbTriggerDetector::setMips(
unsigned int i,
unsigned int j,
unsigned int k,
float val)
153 mMips[i][j][k] = val;
157 StCtbTriggerDetector::setTime(
unsigned int i,
unsigned int j,
unsigned int k,
char val)
159 mTime[i][j][k] = val;
163 StCtbTriggerDetector::setAux(
unsigned int i,
unsigned int j,
float val)
169 StCtbTriggerDetector::setNumberOfPreSamples(
unsigned int val)
171 mNumberOfPreSamples = val;
175 StCtbTriggerDetector::setNumberOfPostSamples(
unsigned int val)
177 mNumberOfPostSamples = val;