ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
ECCE @ EIC Software
Deprecated List
Modules
Namespaces
Classes
Files
File List
acts
analysis
coresoftware
Doxygen_Assist
ecce-detectors
fun4all_eicdetectors
geant4
macros
online_distribution
blob
master
newbasic
A_Event.cc
A_Event.h
all.h
BoolDefs.h
buffer.cc
buffer.h
BufferConstants.h
caen_correction.cc
caen_correction.h
Cframe.C
Cframe.h
CframeV1.C
CframeV1.h
changehitformat.cc
changeid.cc
Cpacket.C
Cpacket.h
CpacketV1.C
CpacketV1.h
dataBlock.C
dataBlock.h
dataBlockHdr.h
dataBlockPublic.h
date_filter_msg_buffer.cc
date_filter_msg_buffer.h
ddump.cc
decoding_routines.cc
decoding_routines.h
devicedefs.h
dlist.cc
dpipe.cc
dpipe_filter.h
errorBlock.C
errorBlock.h
Event.h
event_io.h
eventcombiner.cc
Eventiterator.h
eventLinkDef.h
EventTypes.h
evt_mnemonic.cc
EvtConstants.h
EvtStructures.h
fakeFrame.C
fakeFrame.h
fileEventiterator.cc
fileEventiterator.h
filter_msg_buffer.cc
filter_msg_buffer.h
formatError.C
formatError.h
formatIO.C
formatIO.h
frameHdr.h
frameHdrV1.h
framePackets.C
framePackets.h
framePublic.h
frameRoutines.C
frameRoutines.h
frameSourceIds.h
frameV1Public.h
gen_utilities.h
generalDefinitions.h
gzbuffer.cc
gzbuffer.h
listEventiterator.cc
listEventiterator.h
lzobuffer.cc
lzobuffer.h
md5.cc
md5.h
mizar.h
msg_buffer.cc
msg_buffer.h
msg_control.cc
msg_control.h
msg_profile.h
msgLinkDef.h
msgqueue.C
oamlBuffer.cc
oamlBuffer.h
oBuffer.cc
oBuffer.h
odd_filter.cc
oEvent.cc
oEvent.h
ogzBuffer.cc
ogzBuffer.h
olzoBuffer.cc
olzoBuffer.h
oncs_mnemonic.cc
oncsBuffer.cc
oncsBuffer.h
oncsCollection.h
oncsdefs.h
oncsEvent.cc
oncsEvent.h
oncsEventiterator.cc
oncsEventiterator.h
oncsEvtConstants.h
oncsEvtStructures.h
oncsStructures.h
oncsSub_id2evt.cc
oncsSub_id2evt.h
oncsSub_id4evt.cc
oncsSub_id4evt.h
oncsSub_idbspetdata.cc
oncsSub_idbspetdata.h
oncsSub_idcaenv1742.cc
oncsSub_idcaenv1742.h
oncsSub_idcaenv792.cc
oncsSub_idcaenv792.h
oncsSub_idcstr.cc
oncsSub_idcstr.h
oncsSub_iddigitizerv1.cc
oncsSub_iddigitizerv1.h
oncsSub_iddreamv0.cc
oncsSub_iddreamv0.h
oncsSub_iddrs4v1.cc
oncsSub_iddrs4v1.h
oncsSub_idfnalmwpc.cc
oncsSub_idfnalmwpc.h
oncsSub_idfnalmwpcv2.cc
oncsSub_idfnalmwpcv2.h
oncsSub_idmvtxv0.cc
oncsSub_idmvtxv0.h
oncsSub_idmvtxv1.cc
oncsSub_idmvtxv1.h
oncsSub_idmvtxv2.cc
oncsSub_idmvtxv2.h
oncsSub_idrcpetdata.cc
oncsSub_idrcpetdata.h
oncsSub_idsis3300.cc
oncsSub_idsis3300.h
oncsSub_idsis3300r.cc
oncsSub_idsis3300r.h
oncsSub_idsrs_v01.cc
oncsSub_idsrs_v01.h
oncsSub_idtpcfeev1.cc
oncsSub_idtpcfeev1.h
oncsSub_idtpcfeev2.cc
oncsSub_idtpcfeev2.h
oncsSub_iduppetdata.cc
oncsSub_iduppetdata.h
oncsSub_iduppetdata_v104.cc
oncsSub_iduppetdata_v104.h
oncsSub_iduppetparams.cc
oncsSub_iduppetparams.h
oncsSubConstants.h
oncsSubevent.cc
oncsSubevent.h
ophBuffer.cc
ophBuffer.h
ospBuffer.cc
ospBuffer.h
ospEvent.cc
ospEvent.h
packet.h
packet_A.cc
packet_A.h
packet_cdevbpm.cc
packet_cdevbpm.h
packet_cdevbuckets.cc
packet_cdevbuckets.h
packet_cdevdvm.cc
packet_cdevdvm.h
packet_cdevir.cc
packet_cdevir.h
packet_cdevmadch.cc
packet_cdevmadch.h
packet_cdevpolarimeter.cc
packet_cdevpolarimeter.h
packet_cdevpoltarget.cc
packet_cdevpoltarget.h
packet_cdevring.cc
packet_cdevring.h
packet_cdevringnopol.cc
packet_cdevringnopol.h
packet_cdevwcm.cc
packet_cdevwcm.h
packet_collection.h
packet_fvtx_dcm0.cc
packet_fvtx_dcm0.h
packet_gl1.cc
packet_gl1.h
packet_gl1_evclocks.cc
packet_gl1_evclocks.h
packet_gl1p.cc
packet_gl1p.h
packet_gl1psum.cc
packet_gl1psum.h
packet_hbd_fpga.cc
packet_hbd_fpga.h
packet_hbd_fpgashort.cc
packet_hbd_fpgashort.h
packet_id2evt.cc
packet_id2evt.h
packet_id4evt.cc
packet_id4evt.h
packet_id4scaler.cc
packet_id4scaler.h
packet_idcdevdescr.cc
packet_idcdevdescr.h
packet_idcstr.cc
packet_idcstr.h
packet_iddigitizerv2.cc
packet_iddigitizerv2.h
packet_mnemonic.cc
packet_starscaler.cc
packet_starscaler.h
packet_w124.cc
packet_w124.h
packetConstants.h
packetHdr.h
packetHdrV1.h
packetHeaders.h
packetPublic.h
packetRoutines.C
packetRoutines.h
packetV1Public.h
phenixOnline.h
phenixTypes.h
PHmd5Utils.cc
PHmd5Utils.h
PHmd5Value.cc
PHmd5Value.h
prdf2prdf.cc
prdfBuffer.cc
prdfBuffer.h
prdfcheck.cc
prdfsplit.cc
printmsg.h
rcdaqEventiterator.cc
rcdaqEventiterator.h
remote_msg_buffer.cc
remote_msg_buffer.h
simpleRandom.cc
simpleRandom.h
strnstr.cc
strnstr.h
strptime.cc
testEventiterator.cc
testEventiterator.h
pmonitor
tutorials
doxygen_mainpage.h
File Members
External Links
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
packet_cdevpolarimeter.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file packet_cdevpolarimeter.cc
1
#include <
packet_cdevpolarimeter.h
>
2
#include <stdio.h>
3
4
Packet_cdevpolarimeter::Packet_cdevpolarimeter
(
PACKET_ptr
data
)
5
:
Packet_w4
(data)
6
{
7
ps
= 0;
8
haspoldata
= 0;
9
}
10
11
int
*
Packet_cdevpolarimeter::decode
(
int
*nwout)
12
{
13
14
if
(
ps
!= 0)
return
0;
15
16
int
*
k
= (
int
*)
findPacketDataStart
(
packet
);
17
if
(k == 0)
18
{
19
ps
= 0;
20
*nwout = 0;
21
return
0;
22
}
23
24
if
(
getHitFormat
() ==
IDCDEVPOLARIMETER
)
25
{
26
haspoldata
= 0;
27
ps
= (
struct
cdevPolarimeterData
*) &k[1];
28
}
29
else
if
(
getHitFormat
() ==
IDCDEVPOLARIMETERZ
)
30
{
31
haspoldata
= 1;
32
ps
= (
struct
cdevPolarimeterData
*) &k[1];
33
}
34
35
// fix_endianess (&ps->m_cdevCaptureTimeStamp);
36
// ejd 4/26/03 strings are garbled do not byte swap
37
// fix_endianess (&ps->runIdS);
38
//fix_endianess ( ps->daqVersionS, 80);
39
//fix_endianess ( ps->cutIdS, 80);
40
//fix_endianess ( ps->targetIdS, 80);
41
//fix_endianess ( ps->statusStringS, 80);
42
43
44
// fix_endianess(&ps->startTimeS); // Unix time
45
// fix_endianess(&ps->stopTimeS); // Unix time
46
47
// for (i=0; i<2; i++) fix_endianess(&ps->encoderPositionS[i]);
48
// fix_endianess(&ps->statusS); // bit pattern if <0 data is not usable
49
// fix_endianess(&ps->totalCountsS);
50
// fix_endianess(&ps->upCountsS);
51
// fix_endianess(&ps->downCountsS);
52
// fix_endianess(&ps->unpolCountsS);
53
54
// for (i=0; i<360; i++) fix_endianess(&ps->countsUpLeftS[i]);
55
// for (i=0; i<360; i++) fix_endianess(&ps->countsLeftS[i]);
56
// for (i=0; i<360; i++)fix_endianess(&ps->countsDownLeftS[i]);
57
// for (i=0; i<360; i++)fix_endianess(&ps->countsDownRightS[i]);
58
// for (i=0; i<360; i++)fix_endianess(&ps->countsRightS[i]);
59
// for (i=0; i<360; i++)fix_endianess(&ps->countsUpRightS[i]);
60
61
62
63
// fix_endianess(&ps->numberEventsS); // provided by MCR before measurement
64
// fix_endianess(&ps->maxTimeS);
65
66
*nwout = 0;
67
68
return
0;
69
}
70
71
72
// ------------------------------------------------------
73
74
75
void
Packet_cdevpolarimeter::dump
(
OSTREAM
&os)
76
{
77
78
int
i;
79
80
decode
(&i);
81
82
this->
identify
(os);
83
84
os <<
"daqVersionS "
<<
ps
->
daqVersionS
<< std::endl;
85
os <<
"cutIdS "
<<
ps
->
cutIdS
<< std::endl;
86
os <<
"targetIdS "
<<
ps
->
targetIdS
<< std::endl;
87
os <<
"statusStringS "
<<
ps
->
statusStringS
<< std::endl;
88
89
os <<
"m_cdevCaptureTimeStamp "
<<
ps
->
m_cdevCaptureTimeStamp
<< std::endl;
90
os <<
"runIdS "
<<
ps
->
runIdS
<< std::endl;
// FILL.XXX --- where XXX is the run number
91
os <<
"startTimeS "
<<
ps
->
startTimeS
<< std::endl;
// Unix time
92
os <<
"stopTimeS "
<<
ps
->
stopTimeS
<< std::endl;
// Unix time
93
os <<
"encoderPositionS "
<<
ps
->
encoderPositionS
[0] <<
" "
<<
ps
->
encoderPositionS
[1] << std::endl;
94
95
// os << ps->daqVersionS << std::endl;
96
// os << ps->cutIdS << std::endl;
97
//os << ps->targetIdS << std::endl;
98
99
os <<
"statusS "
<<
ps
->
statusS
<< std::endl;
// bit pattern if <0 data is not usable
100
os <<
"totalCountsS "
<<
ps
->
totalCountsS
<< std::endl;
101
os <<
"upCountsS "
<<
ps
->
upCountsS
<< std::endl;
102
os <<
"downCountsS "
<<
ps
->
downCountsS
<< std::endl;
103
os <<
"unpolCountsS "
<<
ps
->
unpolCountsS
<< std::endl;
104
os <<
"avgAsymXS "
<<
ps
->
avgAsymXS
<< std::endl;
105
os <<
"avgAsymX45S "
<<
ps
->
avgAsymX45S
<< std::endl;
106
os <<
"avgAsymX90S "
<<
ps
->
avgAsymX90S
<< std::endl;
107
os <<
"avgAsymYS "
<<
ps
->
avgAsymYS
<< std::endl;
108
os <<
"avgAsymErrorXS "
<<
ps
->
avgAsymErrorXS
<< std::endl;
109
os <<
"avgAsymErrorX45S "
<<
ps
->
avgAsymErrorX45S
<< std::endl;
110
os <<
"avgAsymErrorX90S "
<<
ps
->
avgAsymErrorX90S
<< std::endl;
111
os <<
"avgAsymErrorYS "
<<
ps
->
avgAsymErrorYS
<< std::endl;
112
113
os <<
"beamEnergyS "
<<
ps
->
beamEnergyS
<< std::endl;
// the same as ringSpec.color:beamEnergyM just for reference
114
115
116
os <<
"analyzingPowerS "
<<
ps
->
analyzingPowerS
<< std::endl;
117
os <<
"analyzingPowerErrorS "
<<
ps
->
analyzingPowerErrorS
<< std::endl;
118
os <<
"numberEventsS "
<<
ps
->
numberEventsS
<< std::endl;
// provided by MCR before measurement
119
os <<
"maxTimeS "
<<
ps
->
maxTimeS
<< std::endl;
120
if
(
haspoldata
)
121
{
122
os <<
"polarizationM "
<<
ps
->
polarizationM
<< std::endl;
123
}
124
125
126
127
128
os <<
" index AsymXS AsymYS AsymErrorXS AsymErrorYS UpLeftS LeftS DownLeftS DownRightS RightS UpRightS"
<< std::endl;
129
130
131
for
(i=0; i< 360; i++)
132
{
133
134
os << std::setw(5) << i <<
" | "
;
135
136
137
os << std::setw(12) <<
rValue
(i,
"bunchAsymXS"
);
//ps->bunchAsymXS[i];
138
os << std::setw(12) <<
rValue
(i,
"bunchAsymYS"
);
//ps->bunchAsymYS[i];
139
os << std::setw(12) <<
ps
->
bunchAsymErrorXS
[i];
140
os << std::setw(12) <<
ps
->
bunchAsymErrorYS
[i];
141
142
os << std::setw(12) <<
ps
->
countsUpLeftS
[i];
143
os << std::setw(12) <<
ps
->
countsLeftS
[i];
144
os << std::setw(12) <<
ps
->
countsDownLeftS
[i];
145
os << std::setw(12) <<
ps
->
countsDownRightS
[i];
146
os << std::setw(12) <<
ps
->
countsRightS
[i];
147
os << std::setw(12) <<
ps
->
countsUpRightS
[i] << std::endl;
148
}
149
150
151
dumpErrorBlock
(os);
152
dumpDebugBlock
(os);
153
}
154
155
156
int
Packet_cdevpolarimeter::iValue
(
const
int
ich,
const
char
*what)
157
{
158
159
int
i;
160
decode
(&i);
161
162
if
( strcmp(what,
"cdevCaptureTimeStamp"
) == 0 )
return
ps
->
m_cdevCaptureTimeStamp
;
// is this not an int??
163
if
( strcmp(what,
"startTimeS"
) == 0 )
return
ps
->
startTimeS
;
// Unix time
164
if
( strcmp(what,
"stopTimeS"
) == 0 )
return
ps
->
stopTimeS
;
// Unix time
165
166
if
( strcmp(what,
"daqVersionS"
) == 0)
167
{
168
if
( ich >= 0 && ich < 80)
169
return
ps
->
daqVersionS
[ich];
170
}
171
172
if
( strcmp(what,
"cutIdS"
) == 0)
173
{
174
if
( ich >= 0 && ich < 80)
175
return
ps
->
cutIdS
[ich];
176
}
177
178
if
( strcmp(what,
"targetIdS"
) == 0)
179
{
180
if
( ich >= 0 && ich < 80)
181
return
ps
->
targetIdS
[ich];
182
}
183
184
if
( strcmp(what,
"encoderPositionS"
) == 0 )
185
{
186
if
( ich >= 0 && ich < 2 )
187
return
ps
->
encoderPositionS
[ich];
188
}
189
190
if
( strcmp(what,
"statusS"
) == 0 )
return
ps
->
statusS
;
191
192
if
( strcmp(what,
"statusStringS"
) == 0 )
193
{
194
if
( ich >= 0 && ich < 2 )
195
return
ps
->
statusStringS
[ich];
196
}
197
198
if
( strcmp(what,
"totalCountsS"
) == 0 )
return
ps
->
totalCountsS
;
199
if
( strcmp(what,
"upCountsS"
) == 0 )
return
ps
->
upCountsS
;
200
if
( strcmp(what,
"downCountsS"
) == 0 )
return
ps
->
downCountsS
;
201
if
( strcmp(what,
"unpolCountsS"
) == 0 )
return
ps
->
unpolCountsS
;
202
if
( strcmp(what,
"countsUpLeftS"
) == 0)
203
{
204
if
( ich >= 0 && ich < 360)
205
return
ps
->
countsUpLeftS
[ich];
206
}
207
208
209
if
( strcmp(what,
"countsLeftS"
) == 0)
210
{
211
if
( ich >= 0 && ich < 360)
212
return
ps
->
countsLeftS
[ich];
213
}
214
215
if
( strcmp(what,
"countsDownLeftS"
) == 0)
216
{
217
if
( ich >= 0 && ich < 360)
218
return
ps
->
countsDownLeftS
[ich];
219
}
220
221
if
( strcmp(what,
"countsDownRightS"
) == 0)
222
{
223
if
( ich >= 0 && ich < 360)
224
return
ps
->
countsDownRightS
[ich];
225
}
226
227
if
( strcmp(what,
"countsRightS"
) == 0)
228
{
229
if
( ich >= 0 && ich < 360)
230
return
ps
->
countsRightS
[ich];
231
}
232
233
if
( strcmp(what,
"countsUpRightS"
) == 0)
234
{
235
if
( ich >= 0 && ich < 360)
236
return
ps
->
countsUpRightS
[ich];
237
}
238
239
if
( strcmp(what,
"numberEventsS"
) == 0 )
return
ps
->
numberEventsS
;
240
if
( strcmp(what,
"maxTimeS"
) == 0 )
return
ps
->
maxTimeS
;
241
242
std::cout <<
"packet_cdevpolarimeter::iValue error unknown datum: "
<< what << std::endl;
243
return
0;
244
}
245
246
247
float
Packet_cdevpolarimeter::rValue
(
const
int
ich,
const
char
*what)
248
{
249
250
251
// std::cout << "IN Packet_cdevpolarimeter::rValue " << std::endl;
252
int
i;
253
decode
(&i);
254
255
if
( strcmp(what,
"avgAsymXS"
) == 0 )
return
ps
->
avgAsymXS
;
256
if
( strcmp(what,
"avgAsymX45S"
) == 0 )
return
ps
->
avgAsymX45S
;
257
if
( strcmp(what,
"avgAsymX90S"
) == 0 )
return
ps
->
avgAsymX90S
;
258
if
( strcmp(what,
"avgAsymYS"
) == 0 )
return
ps
->
avgAsymYS
;
259
if
( strcmp(what,
"avgAsymErrorXS"
) == 0 )
return
ps
->
avgAsymErrorXS
;
260
if
( strcmp(what,
"avgAsymErrorX45S"
) == 0 )
return
ps
->
avgAsymErrorX45S
;
261
if
( strcmp(what,
"avgAsymErrorX90S"
) == 0 )
return
ps
->
avgAsymErrorX90S
;
262
if
( strcmp(what,
"avgAsymErrorYS"
) == 0 )
return
ps
->
avgAsymErrorYS
;
263
264
265
if
( strcmp(what,
"bunchAsymXS"
) == 0)
266
{
267
if
( ich >= 0 && ich < 360)
268
return
ps
->
bunchAsymXS
[ich];
269
}
270
271
if
( strcmp(what,
"bunchAsymYS"
) == 0)
272
{
273
if
( ich >= 0 && ich < 360)
274
return
ps
->
bunchAsymYS
[ich];
275
}
276
277
if
( strcmp(what,
"bunchAsymErrorXS"
) == 0)
278
{
279
if
( ich >= 0 && ich < 360)
280
return
ps
->
bunchAsymErrorXS
[ich];
281
}
282
283
if
( strcmp(what,
"bunchAsymErrorYS"
) == 0)
284
{
285
if
( ich >= 0 && ich < 360)
286
return
ps
->
bunchAsymErrorYS
[ich];
287
}
288
289
290
if
( strcmp(what,
"beamEnergyS"
) == 0 )
return
ps
->
beamEnergyS
;
291
if
( strcmp(what,
"analyzingPowerS"
) == 0 )
return
ps
->
analyzingPowerS
;
292
if
( strcmp(what,
"analyzingPowerErrorS"
) == 0 )
return
ps
->
analyzingPowerErrorS
;
293
if
(
haspoldata
)
294
{
295
if
( strcmp(what,
"polarizationM"
) == 0 )
return
ps
->
polarizationM
;
296
}
297
298
std::cout <<
"packet_cdevpolarimeter::iValue error unknown datum: "
<< what << std::endl;
299
return
0.;
300
}
301
302
303
double
Packet_cdevpolarimeter::dValue
(
const
int
ich,
const
char
*what)
304
{
305
306
307
// std::cout << "IN Packet_cdevpolarimeter::rValue " << std::endl;
308
int
i;
309
decode
(&i);
310
311
if
( strcmp(what,
"runIdS"
) == 0 )
return
ps
->
runIdS
;
// FILL.XXX --- where XXX is the run number
312
313
std::cout <<
"packet_cdevpolarimeter::iValue error unknown datum: "
<< what << std::endl;
314
return
0;
315
}
316
317
318
online_distribution
blob
master
newbasic
packet_cdevpolarimeter.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:59
using
1.8.2 with
ECCE GitHub integration