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