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