Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
TpcRawHitContainerv1.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file TpcRawHitContainerv1.cc
1
#include "
TpcRawHitContainerv1.h
"
2
#include "
TpcRawHitv1.h
"
3
4
#include <TClonesArray.h>
5
6
static
const
int
NTPCHITS
= 100;
7
8
TpcRawHitContainerv1::TpcRawHitContainerv1
()
9
{
10
TpcRawHitsTCArray
=
new
TClonesArray(
"TpcRawHitv1"
,
NTPCHITS
);
11
}
12
13
TpcRawHitContainerv1::~TpcRawHitContainerv1
()
14
{
15
TpcRawHitsTCArray
->Clear(
"C"
);
16
delete
TpcRawHitsTCArray
;
17
}
18
19
20
void
TpcRawHitContainerv1::Reset
()
21
{
22
TpcRawHitsTCArray
->Clear(
"C"
);
23
TpcRawHitsTCArray
->Expand(
NTPCHITS
);
24
}
25
26
void
TpcRawHitContainerv1::identify
(std::ostream &
os
)
const
27
{
28
os <<
"TpcRawHitContainerv1"
<< std::endl;
29
os <<
"containing "
<<
TpcRawHitsTCArray
->GetEntriesFast() <<
" Tpc hits"
<< std::endl;
30
TpcRawHit
*tpchit =
static_cast<
TpcRawHit
*
>
(
TpcRawHitsTCArray
->At(0));
31
if
(tpchit)
32
{
33
os <<
"for beam clock: "
<< std::hex << tpchit->
get_bco
() << std::dec << std::endl;
34
}
35
}
36
37
int
TpcRawHitContainerv1::isValid
()
const
38
{
39
return
TpcRawHitsTCArray
->GetSize();
40
}
41
42
unsigned
int
TpcRawHitContainerv1::get_nhits
()
43
{
44
return
TpcRawHitsTCArray
->GetEntriesFast();
45
}
46
47
TpcRawHit
*
TpcRawHitContainerv1::AddHit
()
48
{
49
TpcRawHit
*newhit =
new
((*TpcRawHitsTCArray)[
TpcRawHitsTCArray
->GetLast()+1])
TpcRawHitv1
();
50
return
newhit;
51
}
52
53
TpcRawHit
*
TpcRawHitContainerv1::AddHit
(
TpcRawHit
*tpchit)
54
{
55
TpcRawHit
*newhit =
new
((*TpcRawHitsTCArray)[
TpcRawHitsTCArray
->GetLast()+1])
TpcRawHitv1
(tpchit);
56
return
newhit;
57
}
58
59
TpcRawHit
*
TpcRawHitContainerv1::get_hit
(
unsigned
int
index
)
60
{
61
return
(
TpcRawHit
*)
TpcRawHitsTCArray
->At(index);
62
}
coresoftware
blob
master
offline
framework
ffarawobjects
TpcRawHitContainerv1.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:04
using
1.8.2 with
sPHENIX GitHub integration