19 #include "StSCReader.h"
20 #include "RTS/src/DAQ_SC/sc.h"
21 #include "tables/St_trigDetSums_Table.h"
24 # error "sc_t redefinition"
32 void StSCReader::FillTime(
unsigned int utime)
38 struct tm *time=gmtime(&UTime);
39 flipBBCBkg = (time->tm_year > 95 && time->tm_year < 109 ? 1 : 0);
40 useNoKillers = (time->tm_year > 110);
41 useEPD = (time->tm_year > 118 || (time->tm_year == 118 && time->tm_mon > 2));
44 double StSCReader::getCTBWest() {
48 double StSCReader::getCTBEast() {
52 double StSCReader::getCTBOrTOFp() {
56 double StSCReader::getTOFp() {
60 double StSCReader::getZDCWest() {
61 return sc.rich_scalers[6];
64 double StSCReader::getZDCEast() {
65 return sc.rich_scalers[5];
68 double StSCReader::getZDCX() {
69 return sc.rich_scalers[7];
72 double StSCReader::getZDCWestNoKiller() {
73 return sc.rich_scalers[11];
76 double StSCReader::getZDCEastNoKiller() {
77 return sc.rich_scalers[12];
80 double StSCReader::getZDCXNoKiller() {
81 return sc.rich_scalers[14];
84 double StSCReader::getEPDX() {
85 return sc.rich_scalers[13];
88 double StSCReader::getMult() {
89 return sc.rich_scalers[10];
92 double StSCReader::getL0() {
96 double StSCReader::getBBCX() {
97 return sc.rich_scalers[2];
100 double StSCReader::getBBCXCTB() {
104 double StSCReader::getBBCWest() {
105 return sc.rich_scalers[1];
108 double StSCReader::getBBCEast() {
109 return sc.rich_scalers[0];
112 double StSCReader::getBBCYellowBkg() {
113 return sc.rich_scalers[3 + flipBBCBkg];
116 double StSCReader::getBBCBlueBkg() {
117 return sc.rich_scalers[4 - flipBBCBkg];
120 double StSCReader::getPVPDWest() {
121 return sc.rich_scalers[9];
124 double StSCReader::getPVPDEast() {
125 return sc.rich_scalers[8];
128 unsigned int StSCReader::getValid() {
132 unsigned int StSCReader::getTime() {
136 int StSCReader::getTimelag() {
140 float StSCReader::getMagField() {
144 StSCReader::StSCReader(
sc_t *daqsc,
unsigned int utime) : fSC(daqsc)
147 StSCReader::~StSCReader() { }
149 int StSCReader::close() {
154 int StSCReader::Update() {
158 char StSCReader::thereIsSCData() {
161 if (getZDCWest() || getZDCEast() ||
162 getBBCWest() || getBBCEast())
return 7;
166 TDataSet* StSCReader::getSCTable(
unsigned long runno) {
167 St_trigDetSums* table =
new St_trigDetSums(
"trigDetSums",1);
168 trigDetSums_st* tb = table->GetTable();
170 tb->ctbWest = getZDCWestNoKiller();
171 tb->ctbEast = getZDCEastNoKiller();
172 tb->ctbTOFp = getZDCXNoKiller();
174 tb->ctbWest = getCTBWest();
175 tb->ctbEast = getCTBEast();
176 tb->ctbTOFp = getCTBOrTOFp();
179 tb->tofp = getEPDX();
181 tb->tofp = getTOFp();
183 tb->zdcWest = getZDCWest();
184 tb->zdcEast = getZDCEast();
185 tb->zdcX = getZDCX();
186 tb->mult = getMult();
188 tb->bbcX = getBBCX();
189 tb->bbcXctbTOFp = getBBCXCTB();
190 tb->bbcWest = getBBCWest();
191 tb->bbcEast = getBBCEast();
192 tb->bbcYellowBkg = getBBCYellowBkg();
193 tb->bbcBlueBkg = getBBCBlueBkg();
194 tb->pvpdWest = getPVPDWest();
195 tb->pvpdEast = getPVPDEast();
196 tb->runNumber = runno;
197 tb->timeOffset = getTime();