-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathSC_Reader.cxx
More file actions
117 lines (91 loc) · 2.32 KB
/
SC_Reader.cxx
File metadata and controls
117 lines (91 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#ifndef NEW_DAQ_READER_DAQ
# include "StDaqLib/EVP/scReader.h"
#else
//# include "RTS/src/DAQ_READER/daqReader.h"
# include "RTS/src/DAQ_SC/sc.h"
#endif /* NEW_DAQ_READER */
#include "SC_Reader.hh"
#include "StDaqLib/GENERIC/EventReader.hh"
#include <assert.h>
#include <math.h>
#include <ctime>
using namespace OLDEVP;
int SC_Reader::BBCEast() {
return sc.rich_scalers[0];
}
int SC_Reader::BBCWest() {
return sc.rich_scalers[1];
}
int SC_Reader::BBCX() {
return sc.rich_scalers[2];
}
int SC_Reader::BBCBlueBkg() {
return sc.rich_scalers[4 - flipBBCBkg];
}
int SC_Reader::BBCYellowBkg() {
return sc.rich_scalers[3 + flipBBCBkg];
}
int SC_Reader::ZDCEast() {
return sc.rich_scalers[5];
}
int SC_Reader::ZDCWest() {
return sc.rich_scalers[6];
}
int SC_Reader::ZDCX() {
return sc.rich_scalers[7];
}
int SC_Reader::ZDCEastNoKiller() {
return sc.rich_scalers[12];
}
int SC_Reader::ZDCWestNoKiller() {
return sc.rich_scalers[11];
}
int SC_Reader::ZDCXNoKiller() {
return sc.rich_scalers[14];
}
int SC_Reader::PVPDEast() {
return sc.rich_scalers[8];
}
int SC_Reader::PVPDWest() {
return sc.rich_scalers[9];
}
int SC_Reader::CTBWest() {
return 0;
}
int SC_Reader::CTBEast() {
return 0;
}
int SC_Reader::TOFp() {
return 0;
}
int SC_Reader::CTBOrTOFp() {
return 0;
}
int SC_Reader::Mult() {
return sc.rich_scalers[10];
}
int SC_Reader::L0() {
return 0;
}
int SC_Reader::BBCXCTB() {
return 0;
}
SC_Reader::SC_Reader(EventReader *er) {
//Keep BBCBkg scalers flipped as theyStRoot/StDaqLib/SC/SC_Reader.cxx were historically before 2009
//Note that new DAQ reader leads to UTime = 0, or tm_year=70 (1970)
//but new DAQ reader only gets used for 2009+ anyhow
std::time_t utime = er->getEventInfo().UnixTime;
std::tm *time = gmtime(&utime);
flipBBCBkg = (time->tm_year > 95 && time->tm_year < 109 ? 1 : 0) ;
// LDate = (((1900+time->tm_year)*100 + 1 + time->tm_mon)*100 + time->tm_mday)*100;
// LTime = (time->tm_hour*100 + time->tm_min)*100 + time->tm_sec;
#ifndef NEW_DAQ_READER
char *datap; // ,ew;
datap=er->getDATAP();
if (datap) OLDEVP::scReader(datap); // call the "event pool" code
#else
assert(0 && "SC_Reader is no use with the new DAQ reader");
// daqReader *rdr=er->getDaqReader(); assert(rdr);
// ::scReader((char*)rdr); // call the "event pool" code
#endif
}