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
oncsSub_iddrs4v1.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file oncsSub_iddrs4v1.cc
1
#include "
oncsSub_iddrs4v1.h
"
2
#include <string.h>
3
#include <iostream>
4
#include <iomanip>
5
6
using namespace
std;
7
8
oncsSub_iddrs4v1::oncsSub_iddrs4v1
(
subevtdata_ptr
data
)
9
:
oncsSubevent_w4
(data)
10
{
11
wave
= 0;
12
// int dummy;
13
// decode(&dummy);
14
}
15
16
oncsSub_iddrs4v1::~oncsSub_iddrs4v1
()
17
{
18
if
(
wave
)
delete
[]
wave
;
19
}
20
21
int
*
oncsSub_iddrs4v1::decode
(
int
*nwout)
22
{
23
24
25
samples
=
SubeventHdr
->
data
& 0xffff;
26
enabled_channelmask
= (
SubeventHdr
->
data
>> 16) & 0xf;
27
28
float
*
d
= (
float
*) &
SubeventHdr
->
data
;
29
d++;
30
int
len
=
samples
;
31
for
(
int
i =0; i<4; i++)
32
{
33
if
(
enabled_channelmask
& ( 1<<i) )
34
{
35
channel_offset
[i] =
len
;
36
len
+=
samples
;
37
}
38
}
39
wave
=
new
float
[
len
];
40
memcpy (
wave
, d,
len
*
sizeof
(
float
));
41
42
*nwout = 0;
43
return
0;
44
}
45
46
float
oncsSub_iddrs4v1::rValue
(
const
int
isample,
const
char
* what)
47
{
48
if
( isample < 0 || isample >
samples
)
return
0;
49
50
if
( !
wave
)
51
{
52
int
dummy;
53
decode
(&dummy);
54
}
55
56
57
if
( strcmp(what,
"TIME"
) == 0 )
58
{
59
return
wave
[isample];
// the first 1024 sample are the time base
60
}
61
return
0;
62
63
}
64
65
int
oncsSub_iddrs4v1::iValue
(
const
int
i,
const
char
* what)
66
{
67
if
( !
wave
)
68
{
69
int
dummy;
70
decode
(&dummy);
71
}
72
73
if
( strcmp(what,
"SAMPLES"
) == 0 )
74
{
75
return
samples
;
76
}
77
78
else
if
( strcmp(what,
"ENABLED"
) == 0 )
79
{
80
return
( (
enabled_channelmask
& ( 1 << i)) !=0);
81
}
82
83
return
0;
84
}
85
86
float
oncsSub_iddrs4v1::rValue
(
const
int
isample,
const
int
ich)
87
{
88
if
( isample < 0 || isample > 1023)
return
0;
89
if
( ich < 0 || ich > 4)
return
0;
90
91
if
(ich == 4)
return
rValue
(isample,
"TIME"
);
92
93
if
( !
wave
)
94
{
95
int
dummy;
96
decode
(&dummy);
97
}
98
99
return
wave
[
channel_offset
[ich] +isample];
100
101
}
102
103
104
void
oncsSub_iddrs4v1::dump
(
OSTREAM
& os )
105
{
106
identify
(os);
107
int
i;
108
109
os <<
" Samples "
<<
iValue
(0,
"SAMPLES"
) <<
" enabled channnels: "
;
110
for
( i = 0; i< 4; i++)
111
{
112
if
(
iValue
(i,
"ENABLED"
) )
113
{
114
os <<
" "
<< i;
115
}
116
}
117
os << endl;
118
119
os <<
" ch | time"
;
120
if
(
enabled_channelmask
& 1) os <<
" ch0"
;
121
if
(
enabled_channelmask
& 2) os <<
" ch1"
;
122
if
(
enabled_channelmask
& 4) os <<
" ch2"
;
123
if
(
enabled_channelmask
& 8) os <<
" ch3"
;
124
os << endl;
125
126
for
( i = 0; i <
samples
; i++)
127
{
128
os << setw(5) << i <<
" | "
;
129
os << setw(10) <<
rValue
(i,
"TIME"
) <<
" "
;
130
if
(
enabled_channelmask
& 1) os << setw(10) <<
rValue
(i, 0) <<
" "
;
131
if
(
enabled_channelmask
& 2) os << setw(10) <<
rValue
(i, 1) <<
" "
;
132
if
(
enabled_channelmask
& 4) os << setw(10) <<
rValue
(i, 2) <<
" "
;
133
if
(
enabled_channelmask
& 8) os << setw(10) <<
rValue
(i, 3) <<
" "
;
134
os << endl;
135
}
136
}
137
138
online_distribution
blob
master
newbasic
oncsSub_iddrs4v1.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:59
using
1.8.2 with
ECCE GitHub integration