EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
oncsSub_idcstr.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file oncsSub_idcstr.cc
1
#include "
oncsSub_idcstr.h
"
2
#include <string.h>
3
4
oncsSub_idcstr::oncsSub_idcstr
(
subevtdata_ptr
data
)
5
:
oncsSubevent_w1
(data)
6
{
7
sarray
= 0;
8
allocated_length
= 0;
9
}
10
11
12
oncsSub_idcstr::~oncsSub_idcstr
()
13
{
14
if
(
sarray
)
delete
[]
sarray
;
15
}
16
17
int
oncsSub_idcstr::iValue
(
const
int
i)
18
{
19
int
n
;
20
if
( !
sarray
)
decode
( &n);
21
22
if
( i < 0 || i >=
allocated_length
)
23
{
24
return
0;
25
}
26
27
int
c
=
sarray
[i];
28
return
c
;
29
30
}
31
32
void
oncsSub_idcstr::dump
(
OSTREAM
&os)
33
{
34
// identify(os);
35
int
n
;
36
if
( !
sarray
)
decode
( &n);
37
38
39
os.write( (
const
char
*)
sarray
,
allocated_length
);
40
41
// os << std::endl;
42
43
// c = iValue(0);
44
// while ( c)
45
// {
46
// os << (char ) c;
47
// c = iValue(i++);
48
// }
49
50
os << std::flush;
51
52
}
53
54
55
int
*
oncsSub_idcstr::decode
(
int
*nwout)
56
57
{
58
int
dlength = (
getLength
()-4)*4 -
getPadding
();
59
unsigned
char
*SubeventData = (
unsigned
char
* ) &
SubeventHdr
->
data
;
60
sarray
=
new
unsigned
char
[dlength+1];
61
memcpy (
sarray
, SubeventData,dlength);
62
sarray
[dlength] = 0;
63
allocated_length
= dlength;
64
65
return
0;
66
}
67
online_distribution
blob
master
newbasic
oncsSub_idcstr.cc
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:55
using
1.8.2 with
EIC GitHub integration