StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StRpsRomanPot.cxx
1 /***************************************************************************
2  *
3  * $Id: StRpsRomanPot.cxx,v 2.1 2009/11/23 22:18:25 ullrich Exp $
4  *
5  * Author: Thomas Ullrich, Nov 2009
6  ***************************************************************************
7  *
8  * Description:
9  *
10  ***************************************************************************
11  *
12  * $Log: StRpsRomanPot.cxx,v $
13  * Revision 2.1 2009/11/23 22:18:25 ullrich
14  * Initial Revision
15  *
16  **************************************************************************/
17 #include "StRpsRomanPot.h"
18 #include "StRpsCollection.h"
19 #include "StRpsCluster.h"
20 
21 static const char rcsid[] = "$Id: StRpsRomanPot.cxx,v 2.1 2009/11/23 22:18:25 ullrich Exp $";
22 
23 ClassImp(StRpsRomanPot)
24 
26 {
27  mStatus = 0;
28  mAdc[0] = mAdc[1] = mTac[0] = mTac[1] = 0;
29  // Roman Pot ID gets set in
30  // StRpsCollection constructor
31 }
32 
33 StRpsRomanPot::~StRpsRomanPot() { /* noop */ }
34 
35 unsigned int
36 StRpsRomanPot::romanPotId() const
37 {
38  return mRomanPotId;
39 }
40 
41 unsigned int
42 StRpsRomanPot::numberOfPlanes() const
43 {
44  return mNumberOfPlanes;
45 }
46 
47 unsigned int
48 StRpsRomanPot::numberOfPlanesWithClusters() const
49 {
50  unsigned int count = 0;
51  for (int i=0; i<mNumberOfPlanes; i++)
52  count += mPlanes[i].numberOfClusters();
53  return count;
54 }
55 
56 unsigned int
57 StRpsRomanPot::adc(unsigned int i) const
58 {
59  return (i < 2 ? mAdc[i] : 0);
60 }
61 
62 unsigned int
63 StRpsRomanPot::tac(unsigned int i) const
64 {
65  return (i < 2 ? mTac[i] : 0);
66 }
67 
68 unsigned char
69 StRpsRomanPot::status() const
70 {
71  return mStatus;
72 }
73 
74 const StRpsPlane*
75 StRpsRomanPot::plane(unsigned int i) const
76 {
77  if (i < mNumberOfPlanes)
78  return &mPlanes[i];
79  else
80  return 0;
81 }
82 
83 StRpsPlane* StRpsRomanPot::plane(unsigned int i)
84 {
85  if (i < mNumberOfPlanes)
86  return &mPlanes[i];
87  else
88  return 0;
89 }
90 
91 void
92 StRpsRomanPot::setStatus(unsigned char val)
93 {
94  mStatus = val;
95 }
96 
97 void StRpsRomanPot::setRomanPotId(unsigned char i)
98 {
99  mRomanPotId = i;
100 }
101 
102 void StRpsRomanPot::setAdc(unsigned int adc0, unsigned int adc1)
103 {
104  mAdc[0] = adc0;
105  mAdc[1] = adc1;
106 }
107 
108 void StRpsRomanPot::setTac(unsigned int tac0, unsigned int tac1)
109 {
110  mTac[0] = tac0;
111  mTac[1] = tac1;
112 }
113