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