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
MicromegasRawHitContainerv1.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file MicromegasRawHitContainerv1.cc
1
#include "
MicromegasRawHitContainerv1.h
"
2
#include "
MicromegasRawHitv1.h
"
3
4
#include <TClonesArray.h>
5
6
static
constexpr
int
NHITS
= 100;
7
8
MicromegasRawHitContainerv1::MicromegasRawHitContainerv1
()
9
{
10
MicromegasRawHitsTCArray
=
new
TClonesArray(
"MicromegasRawHitv1"
,
NHITS
);
11
}
12
13
MicromegasRawHitContainerv1::~MicromegasRawHitContainerv1
()
14
{
15
delete
MicromegasRawHitsTCArray
;
16
}
17
18
19
void
MicromegasRawHitContainerv1::Reset
()
20
{
21
MicromegasRawHitsTCArray
->Clear();
22
MicromegasRawHitsTCArray
->Expand(
NHITS
);
23
}
24
25
void
MicromegasRawHitContainerv1::identify
(std::ostream &
os
)
const
26
{
27
os <<
"MicromegasRawHitContainerv1"
<< std::endl;
28
os <<
"containing "
<<
MicromegasRawHitsTCArray
->GetEntriesFast() <<
" Micromegas hits"
<< std::endl;
29
auto
hit =
static_cast<
MicromegasRawHit
*
>
(
MicromegasRawHitsTCArray
->At(0));
30
if
(hit)
31
{
32
os <<
"for beam clock: "
<< std::hex << hit->
get_bco
() << std::dec << std::endl;
33
}
34
}
35
36
int
MicromegasRawHitContainerv1::isValid
()
const
37
{
38
return
MicromegasRawHitsTCArray
->GetSize();
39
}
40
41
unsigned
int
MicromegasRawHitContainerv1::get_nhits
()
42
{
43
return
MicromegasRawHitsTCArray
->GetEntriesFast();
44
}
45
46
MicromegasRawHit
*
MicromegasRawHitContainerv1::AddHit
()
47
{
48
MicromegasRawHit
*newhit =
new
((*MicromegasRawHitsTCArray)[
MicromegasRawHitsTCArray
->GetLast()+1])
MicromegasRawHitv1
();
49
return
newhit;
50
}
51
52
MicromegasRawHit
*
MicromegasRawHitContainerv1::AddHit
(
MicromegasRawHit
*
source
)
53
{
54
auto
newhit =
new
((*MicromegasRawHitsTCArray)[
MicromegasRawHitsTCArray
->GetLast()+1])
MicromegasRawHitv1
(source);
55
return
newhit;
56
}
57
58
MicromegasRawHit
*
MicromegasRawHitContainerv1::get_hit
(
unsigned
int
index
)
59
{
60
return
static_cast<
MicromegasRawHit
*
>
(
MicromegasRawHitsTCArray
->At(index) );
61
}
coresoftware
blob
master
offline
framework
ffarawobjects
MicromegasRawHitContainerv1.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:04
using
1.8.2 with
sPHENIX GitHub integration