StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMtdTriggerDetector.cxx
1 /***************************************************************************
2 *
3 * $Id: StMtdTriggerDetector.cxx,v 2.1 2007/07/02 20:21:55 ullrich Exp $
4 *
5 * Author: Akio Agawa, July 2007
6 ***************************************************************************
7 *
8 * Description:
9 *
10 ***************************************************************************
11 *
12 * $Log: StMtdTriggerDetector.cxx,v $
13 * Revision 2.1 2007/07/02 20:21:55 ullrich
14 * Initial Revision.
15 *
16 **************************************************************************/
17 #include "StMtdTriggerDetector.h"
18 #include "StTriggerData.h"
19 
20 static const char rcsid[] = "$Id: StMtdTriggerDetector.cxx,v 2.1 2007/07/02 20:21:55 ullrich Exp $";
21 
22 ClassImp(StMtdTriggerDetector)
23 
25 {
26  memset(mADC,0,sizeof(mADC));
27  memset(mTDC,0,sizeof(mTDC));
28 }
29 
30 StMtdTriggerDetector::StMtdTriggerDetector(const StTriggerData& tt)
31 {
32  for(int i=0; i<mMaxMtdCounter; i++){
33  mADC[west][i] = tt.mtdAdc(west,i);
34  mADC[east][i] = tt.mtdAdc(east,i);
35  mTDC[west][i] = tt.mtdTdc(west,i);
36  mTDC[east][i] = tt.mtdTdc(east,i);
37  }
38 }
39 
40 StMtdTriggerDetector::~StMtdTriggerDetector() {/* noop */}
41 
42 unsigned int
43 StMtdTriggerDetector::numberOfMtdCounters() const {return mMaxMtdCounter;}
44 
45 unsigned short
46 StMtdTriggerDetector::adc(StBeamDirection eastwest, unsigned int i) const
47 {
48  if (i < mMaxMtdCounter)
49  return mADC[eastwest][i];
50  else
51  return 0;
52 }
53 
54 unsigned short
55 StMtdTriggerDetector::tdc(StBeamDirection eastwest, unsigned int i) const
56 {
57  if (i < mMaxMtdCounter)
58  return mTDC[eastwest][i];
59  else
60  return 0;
61 }
62 
63 void
64 StMtdTriggerDetector::setAdc(StBeamDirection eastwest, unsigned int i, unsigned short v)
65 {
66  if (i < mMaxMtdCounter )
67  mADC[eastwest][i] = v;
68 }
69 
70 void
71 StMtdTriggerDetector::setTdc(StBeamDirection eastwest, unsigned int i, unsigned short v)
72 {
73  if (i < mMaxMtdCounter )
74  mTDC[eastwest][i] = v;
75 }
76