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
FairGeoCompositeVolume.cxx
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file FairGeoCompositeVolume.cxx
1
//*-- AUTHOR : Ilse Koenig
2
//*-- Modified : 20/04/99
3
5
// FairGeoCompositeVolume
6
//
7
//
9
10
#include "
FairGeoCompositeVolume.h
"
11
12
ClassImp
(
FairGeoCompositeVolume
)
13
14
FairGeoCompositeVolume
::
FairGeoCompositeVolume
(Int_t nComp)
15
:
FairGeoVolume
(),
16
components(NULL)
17
{
18
if
(nComp) {
19
components=
new
TObjArray(nComp);
20
for
(Int_t i=0; i<nComp; i++) { components->AddAt(
new
FairGeoVolume(),i); }
21
}
22
23
}
24
25
FairGeoCompositeVolume::~FairGeoCompositeVolume
()
26
{
27
if
(
components
) {
components
->Delete(); }
28
delete
components
;
29
}
30
31
Int_t
FairGeoCompositeVolume::getNumComponents
()
32
{
33
if
(
components
) {
return
components
->GetSize(); }
34
else
{
return
0; }
35
}
36
37
FairGeoVolume
*
FairGeoCompositeVolume::getComponent
(
const
Int_t
n
)
38
{
39
return
(
FairGeoVolume
*)
components
->At(n);
40
}
41
42
void
FairGeoCompositeVolume::createComponents
(
const
Int_t
n
)
43
{
44
if
(
components
) {
components
->Delete(); }
45
components
->Expand(n);
46
}
47
48
void
FairGeoCompositeVolume::setComponent
(
FairGeoVolume
*
v
,
const
Int_t
n
)
49
{
50
if
(
components
) {
components
->AddAt(v,n); }
51
else
{ Error(
"FairGeoCompositeVolume::setComponent"
,
"no array of components"
); }
52
}
53
54
void
FairGeoCompositeVolume::clear
()
55
{
56
FairGeoVolume::clear
();
57
Int_t
n
=
getNumComponents
();
58
for
(Int_t i=0; i<
n
; i++) { ((
FairGeoVolume
*)
components
->At(i))->
clear
(); }
59
}
60
61
void
FairGeoCompositeVolume::print
()
62
{
63
FairGeoVolume::print
();
64
FairGeoVolume
*
v
;
65
for
(Int_t i=0; i<
components
->GetSize(); i++) {
66
v=(
FairGeoVolume
*)
components
->At(i);
67
if
(v) { v->
print
(); }
68
}
69
}
EicRoot
blob
master
geobase
FairGeoCompositeVolume.cxx
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:36
using
1.8.2 with
EIC GitHub integration