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
G4RootHitContainer.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4RootHitContainer.cc
1
#include "
G4RootHitContainer.h
"
2
3
#include <
g4main/PHG4Hit.h
>
// for PHG4Hit
4
#include <
g4main/PHG4HitEval.h
>
5
6
#include <TClonesArray.h>
7
8
#include <cmath>
// for NAN
9
#include <ostream>
// for basic_ostream::operator<<, operator<<
10
11
using namespace
std;
12
13
static
const
int
NMAX
= 100000;
14
15
G4RootHitContainer::G4RootHitContainer
()
16
: etotal(NAN)
17
, eion(NAN)
18
, leakage(NAN)
19
, event(0)
20
{
21
SnglHits
=
new
TClonesArray(
"PHG4HitEval"
,
NMAX
);
22
}
23
24
G4RootHitContainer::~G4RootHitContainer
()
25
{
26
SnglHits
->Clear();
27
delete
SnglHits
;
28
}
29
30
void
G4RootHitContainer::Reset
()
31
{
32
etotal
= NAN;
33
leakage
= NAN;
34
event
= 0;
35
SnglHits
->Clear();
36
if
(
SnglHits
->GetSize() >
NMAX
)
37
{
38
SnglHits
->Expand(
NMAX
);
39
}
40
return
;
41
}
42
43
PHG4Hit
*
44
G4RootHitContainer::AddHit
(
const
PHG4Hit
*g4hit)
45
{
46
TClonesArray &cl = *
SnglHits
;
47
int
nextindex =
SnglHits
->GetLast() + 1;
48
if
(nextindex ==
SnglHits
->GetSize())
49
{
50
SnglHits
->Expand(
SnglHits
->GetSize() + 10000);
51
}
52
new
(cl[nextindex])
PHG4HitEval
(g4hit);
53
return
(static_cast<PHG4Hit *>(cl[nextindex]));
54
}
55
56
void
G4RootHitContainer::identify
(ostream &os)
const
57
{
58
os <<
"Number of Hits: "
<<
SnglHits
->GetLast() << endl;
59
return
;
60
}
fun4all_coresoftware
blob
master
simulation
g4simulation
g4histos
G4RootHitContainer.cc
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:49
using
1.8.2 with
EIC GitHub integration