00001 #ifndef NEW_DAQ_READER_DAQ
00002 # include "StDaqLib/EVP/scReader.h"
00003 #else
00004
00005 # include "RTS/src/DAQ_SC/sc.h"
00006 #endif
00007 #include "SC_Reader.hh"
00008 #include "StDaqLib/GENERIC/EventReader.hh"
00009
00010 #include <assert.h>
00011 #include <math.h>
00012
00013 using namespace OLDEVP;
00014
00015 int SC_Reader::BBCEast() {
00016 return sc.rich_scalers[0];
00017 }
00018
00019 int SC_Reader::BBCWest() {
00020 return sc.rich_scalers[1];
00021 }
00022
00023 int SC_Reader::BBCX() {
00024 return sc.rich_scalers[2];
00025 }
00026
00027 int SC_Reader::BBCBlueBkg() {
00028 return sc.rich_scalers[4 - flipBBCBkg];
00029 }
00030
00031 int SC_Reader::BBCYellowBkg() {
00032 return sc.rich_scalers[3 + flipBBCBkg];
00033 }
00034
00035 int SC_Reader::ZDCEast() {
00036 return sc.rich_scalers[5];
00037 }
00038
00039 int SC_Reader::ZDCWest() {
00040 return sc.rich_scalers[6];
00041 }
00042
00043 int SC_Reader::ZDCX() {
00044 return sc.rich_scalers[7];
00045 }
00046
00047 int SC_Reader::PVPDEast() {
00048 return sc.rich_scalers[8];
00049 }
00050
00051 int SC_Reader::PVPDWest() {
00052 return sc.rich_scalers[9];
00053 }
00054
00055 int SC_Reader::CTBWest() {
00056 return 0;
00057 }
00058
00059 int SC_Reader::CTBEast() {
00060 return 0;
00061 }
00062
00063 int SC_Reader::TOFp() {
00064 return 0;
00065 }
00066
00067 int SC_Reader::CTBOrTOFp() {
00068 return 0;
00069 }
00070
00071 int SC_Reader::Mult() {
00072 return sc.rich_scalers[10];
00073 }
00074
00075 int SC_Reader::L0() {
00076 return 0;
00077 }
00078
00079 int SC_Reader::BBCXCTB() {
00080 return 0;
00081 }
00082
00083 SC_Reader::SC_Reader(EventReader *er) {
00084
00085
00086
00087
00088 unsigned int UTime = er->getEventInfo().UnixTime;
00089 struct tm *time=gmtime((time_t*) &UTime);
00090 flipBBCBkg = (time->tm_year > 95 && time->tm_year < 109 ? 1 : 0) ;
00091
00092
00093
00094 #ifndef NEW_DAQ_READER
00095 char *datap;
00096 datap=er->getDATAP();
00097 if (datap) OLDEVP::scReader(datap);
00098 #else
00099 assert(0 && "SC_Reader is no use with the new DAQ reader");
00100
00101
00102 #endif
00103
00104 }