StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EEdsm3.cxx
1 #include <iostream>
2 #include <assert.h>
3 #include <stdlib.h>
4 #include <stdio.h>
5 #include <string.h>
6 
7 
8 #include "EEdsm3.h"
9 
10 
11 //--------------------------------------------------
12 //
13 //--------------------------------------------------
14 EEdsm3 ::EEdsm3() {
15  clear();
16  mYear=2005;
17 }
18 
19 //--------------------------------------------------
20 //--------------------------------------------------
21 EEdsm3::~EEdsm3() { }
22 
23 //--------------------------------------------------
24 //--------------------------------------------------
25 void
26 EEdsm3::clear() {
27  memset(data,0,sizeof(data));
28 }
29 
30 //--------------------------------------------------
31 //--------------------------------------------------
32 void
33 EEdsm3::setWord(int ch, unsigned short val){
34  assert(ch>=0 && ch<nc);
35  data[ch]=val;
36 }
37 
38 //--------------------------------------------------
39 //--------------------------------------------------
40 unsigned short
41 EEdsm3::getBarreJPthr2bit() const {
42  int ch=0;
43  unsigned short val=data[ch] & 3;
44  return val;
45 }
46 
47 //--------------------------------------------------
48 //--------------------------------------------------
49 unsigned short
50 EEdsm3::getBarreHTthr2bit() const {
51  int ch=0;
52  unsigned short val=data[ch] >> 2;
53  val=val & 3;
54  return val;
55 }
56 
57 //--------------------------------------------------
58 //--------------------------------------------------
59 unsigned short
60 EEdsm3::getBarreEsumThr1bit() const {
61  int ch=0;
62  unsigned short val=data[ch] >> 4;
63  val=val & 1;
64  return val;
65 }
66 
67 //--------------------------------------------------
68 //--------------------------------------------------
69 unsigned short
70 EEdsm3::getJpsi1bit() const {
71  int ch=0;
72  unsigned short val=data[ch] >> 5;
73  val=val & 1;
74  return val;
75 }
76 
77 //--------------------------------------------------
78 //--------------------------------------------------
79 unsigned short
80 EEdsm3::getBarreHTTPthr1bit() const {
81  int ch=0;
82  unsigned short val=data[ch] >> 6;
83  val=val & 1;
84  return val;
85 }
86 
87 //--------------------------------------------------
88 //--------------------------------------------------
89 unsigned short
90 EEdsm3::getBarreTPthr1bit() const {
91  int ch=0;
92  unsigned short val=data[ch] >> 13;
93  val=val & 1;
94  return val;
95 }
96 
97 //--------------------------------------------------
98 //--------------------------------------------------
99 unsigned short
100 EEdsm3::getEndcapJPthr2bit() const {
101  int ch=0;
102  unsigned short val=data[ch] >> 7;
103  val=val & 3;
104  return val;
105 }
106 
107 //--------------------------------------------------
108 //--------------------------------------------------
109 unsigned short
110 EEdsm3::getEndcapHTthr2bit() const {
111  int ch=0;
112  unsigned short val=data[ch] >> 9;
113  val=val & 3;
114  return val;
115 }
116 
117 
118 //--------------------------------------------------
119 //--------------------------------------------------
120 unsigned short
121 EEdsm3::getEndcapEsumthr1bit() const {
122  int ch=0;
123  unsigned short val=data[ch] >> 11;
124  val=val & 1;
125  return val;
126 }
127 
128 //--------------------------------------------------
129 //--------------------------------------------------
130 unsigned short
131 EEdsm3::getEndcapHTTPthr1bit() const {
132  assert(mYear>=2006);
133  int ch=0;
134  unsigned short val=data[ch] >> 12;
135  val=val & 1;
136  return val;
137 }
138 
139 //--------------------------------------------------
140 //--------------------------------------------------
141 unsigned short
142 EEdsm3::getEndcapTPthr1bit() const {
143  assert(mYear>=2006);
144  int ch=0;
145  unsigned short val=data[ch] >> 14;
146  val=val & 1;
147  return val;
148 }
149 
150 //--------------------------------------------------
151 //--------------------------------------------------
152 unsigned short
153 EEdsm3::getEtotThr1bit() const {
154  int ch=0;
155  unsigned short val=data[ch] >> 15;
156  val=val & 1;
157  return val;
158 }
159 
160 //--------------------------------------------------
161 //--------------------------------------------------
162 void
163 EEdsm3::print( int k) const {
164  printf("EEdsm3==TCU INPUTS, year=%d \n",mYear);
165 }
166 
167 // $Log: EEdsm3.cxx,v $
168 // Revision 1.1 2009/10/12 18:04:26 pibero
169 // Moved StEEmcUtil/EEdsm to StTriggerUtilities/Eemc
170 //
171 // Revision 1.5 2009/02/24 03:56:19 ogrebeny
172 // Corrected const-ness
173 //
174 // Revision 1.4 2007/08/17 01:15:36 balewski
175 // full blown Endcap trigger simu, by Xin
176 //
177 // Revision 1.3 2006/04/05 18:34:10 balewski
178 // new DSM bit assignment in 2006,
179 // possibly lost backward compatibility
180 // use tagged 2005 version if needed
181 //
182 // Revision 1.2 2005/02/01 22:13:40 perev
183 // Compatibility to redhat
184 //
185 // Revision 1.1 2004/11/29 20:12:59 balewski
186 // first
187 //
188 // Revision 1.1 2004/02/17 03:09:17 balewski
189 // *** empty log message ***
190 //
191