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
FairGeoAssembly.cxx
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file FairGeoAssembly.cxx
1
//*-- AUTHOR : M. Al-Turany 21/04/2009
2
4
//
5
// FairGeoAssmebly
6
//
7
// class for the shape Assembly
9
10
#include "
FairGeoAssembly.h
"
11
12
#include "
FairGeoVolume.h
"
13
#include "
FairGeoVector.h
"
14
15
#include "TArrayD.h"
16
17
ClassImp
(
FairGeoAssembly
)
18
19
FairGeoAssembly
::
FairGeoAssembly
()
20
:
FairGeoBasicShape
()
21
{
22
// constructor
23
fName=
"ASSEMBLY"
;
24
nPoints=0;
25
nParam=0;
26
param=
new
TArrayD(nParam);
27
}
28
29
30
FairGeoAssembly::~FairGeoAssembly
()
31
{
32
// destructor
33
if
(
param
) {
34
delete
param
;
35
param
=0;
36
}
37
if
(
center
) {
38
delete
center
;
39
center
=0;
40
}
41
if
(
position
) {
42
delete
position
;
43
position
=0;
44
}
45
}
46
47
Int_t
FairGeoAssembly::readPoints
(std::fstream* pFile,
FairGeoVolume
* volu)
48
{
49
50
//Assemblies has no parameters so just return 1;
51
return
1;
52
}
53
54
55
TArrayD*
FairGeoAssembly::calcVoluParam
(
FairGeoVolume
* volu)
56
{
57
// nothing to calculate
58
59
return
param
;
60
}
61
62
Bool_t
FairGeoAssembly::writePoints
(std::fstream* pFile,
FairGeoVolume
* volu)
63
{
64
// writes the 4 'points' decribed above to ascii file
65
if
(!pFile) {
return
kFALSE; }
66
Text_t buf[155];
67
for
(Int_t i=0; i<
nPoints
; i++) {
68
FairGeoVector
&
v
=*(volu->
getPoint
(i));
69
sprintf(buf,
"%9.3f\n"
,
v
(0));
70
pFile->write(buf,strlen(buf));
71
}
72
return
kTRUE;
73
}
74
75
76
void
FairGeoAssembly::printPoints
(
FairGeoVolume
* volu)
77
{
78
// prints volume points to screen
79
for
(Int_t i=0; i<
nPoints
; i++) {
80
FairGeoVector
&
v
=*(volu->
getPoint
(i));
81
printf
(
"%9.3f\n"
,
v
(0));
82
}
83
}
84
85
86
87
void
FairGeoAssembly::calcVoluPosition
(
FairGeoVolume
* volu,
88
const
FairGeoTransform
& dTC,
const
FairGeoTransform
& mTR)
89
{
90
// calls the function posInMother(...) to calculate the position of the
91
// volume in its mother
92
Double_t
t
[3]= {0.,0.,0.};
93
center
->
setTransVector
(t);
94
posInMother
(dTC,mTR);
95
}
96
EicRoot
blob
master
geobase
FairGeoAssembly.cxx
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:36
using
1.8.2 with
EIC GitHub integration