VGM
Version 5.5
Toggle main menu visibility
Loading...
Searching...
No Matches
packages
Geant4GM
source
solids
Para.cxx
Go to the documentation of this file.
1
// $Id$
2
3
// -----------------------------------------------------------------------
4
// The Geant4GM package of the Virtual Geometry Model
5
// Copyright (C) 2007, Ivana Hrivnacova
6
// All rights reserved.
7
//
8
// For the licensing terms see vgm/LICENSE.
9
// Contact: ivana@ipno.in2p3.fr
10
// -----------------------------------------------------------------------
11
12
//
13
// Class Para
14
// ---------------
15
// VGM implementation for Geant4 para solid.
16
// If reflected, the parameters are changed as follows:
17
// dx, dy, dz --> dx', dy', dz'
18
// alpha -> alpha'
19
// theta -> theta' = PI - theta
20
// phi -> phi'
21
//
22
// Author: Ivana Hrivnacova; IPN Orsay
23
24
#include "
VGM/common/Math.h
"
25
26
#include "
ClhepVGM/Units.h
"
27
28
#include "
Geant4GM/solids/Para.h
"
29
#include "
Geant4GM/solids/SolidMap.h
"
30
31
#include "G4Para.hh"
32
#include "G4ReflectedSolid.hh"
33
34
//_____________________________________________________________________________
35
Geant4GM::Para::Para
(
const
std::string& name,
double
dx,
double
dy,
double
dz,
36
double
alpha,
double
theta,
double
phi)
37
:
VGM
::ISolid(),
38
VGM
::IPara(),
39
BaseVGM
::
VPara
(),
40
fIsReflected(false),
41
fPara(new G4Para(name, dx /
ClhepVGM
::Units::Length(),
42
dy /
ClhepVGM
::Units::Length(), dz /
ClhepVGM
::Units::Length(),
43
alpha /
ClhepVGM
::Units::Angle(), theta /
ClhepVGM
::Units::Angle(),
44
phi /
ClhepVGM
::Units::Angle()))
45
{
57
58
Geant4GM::SolidMap::Instance
()->
AddSolid
(
this
, fPara);
59
}
60
61
//_____________________________________________________________________________
62
Geant4GM::Para::Para
(G4Para* para, G4ReflectedSolid* reflPara)
63
:
VGM
::ISolid(),
64
VGM
::IPara(),
65
BaseVGM
::
VPara
(),
66
fIsReflected(false),
67
fPara(para)
68
{
70
71
if
(reflPara) {
72
fIsReflected =
true
;
73
Geant4GM::SolidMap::Instance
()->
AddSolid
(
this
, reflPara);
74
}
75
else
76
Geant4GM::SolidMap::Instance
()->
AddSolid
(
this
, para);
77
}
78
79
//_____________________________________________________________________________
80
Geant4GM::Para::Para
() :
VGM
::ISolid(),
VGM
::IPara(),
BaseVGM
::
VPara
()
81
{
83
}
84
85
//_____________________________________________________________________________
86
Geant4GM::Para::Para
(
const
Para
& rhs)
87
:
VGM
::ISolid(rhs),
VGM
::IPara(rhs),
BaseVGM
::
VPara
(rhs)
88
{
90
}
91
92
//_____________________________________________________________________________
93
Geant4GM::Para::~Para
()
94
{
95
//
96
}
97
98
//_____________________________________________________________________________
99
std::string
Geant4GM::Para::Name
()
const
{
return
fPara->GetName(); }
100
101
//_____________________________________________________________________________
102
double
Geant4GM::Para::XHalfLength
()
const
103
{
104
return
fPara->GetXHalfLength() *
ClhepVGM::Units::Length
();
105
}
106
107
//_____________________________________________________________________________
108
double
Geant4GM::Para::YHalfLength
()
const
109
{
110
return
fPara->GetYHalfLength() *
ClhepVGM::Units::Length
();
111
}
112
113
//_____________________________________________________________________________
114
double
Geant4GM::Para::ZHalfLength
()
const
115
{
116
return
fPara->GetZHalfLength() *
ClhepVGM::Units::Length
();
117
}
118
119
//_____________________________________________________________________________
120
double
Geant4GM::Para::Alpha
()
const
121
{
122
return
atan(fPara->GetTanAlpha()) *
ClhepVGM::Units::Angle
();
123
}
124
125
//_____________________________________________________________________________
126
double
Geant4GM::Para::Theta
()
const
127
{
128
if
(!fIsReflected)
129
return
fPara->GetSymAxis().theta() *
ClhepVGM::Units::Angle
();
130
else
131
return
(
M_PI
- fPara->GetSymAxis().theta()) *
ClhepVGM::Units::Angle
();
132
;
133
}
134
135
//_____________________________________________________________________________
136
double
Geant4GM::Para::Phi
()
const
137
{
138
return
fPara->GetSymAxis().phi() *
ClhepVGM::Units::Angle
();
139
}
Units.h
Para.h
SolidMap.h
Math.h
BaseVGM::VPara::VPara
VPara()
Definition
VPara.cxx:30
ClhepVGM::Units::Length
static double Length()
Return CLHEP default length unit in VGM units.
Definition
Units.cxx:83
ClhepVGM::Units::Angle
static double Angle()
Return CLHEP default angle unit in VGM units.
Definition
Units.cxx:92
Geant4GM::Para::YHalfLength
virtual double YHalfLength() const
Return half-length along the y axis in mm.
Definition
Para.cxx:108
Geant4GM::Para::~Para
virtual ~Para()
Definition
Para.cxx:93
Geant4GM::Para::Phi
virtual double Phi() const
Return azimuthal angle of the line joining the centres of the faces at -hz and +hz in deg.
Definition
Para.cxx:136
Geant4GM::Para::Theta
virtual double Theta() const
Return polar angle of the line joining the centres of the faces at -hz and +hz in deg.
Definition
Para.cxx:126
Geant4GM::Para::XHalfLength
virtual double XHalfLength() const
Return half-length along the x axis in mm.
Definition
Para.cxx:102
Geant4GM::Para::Para
Para(const std::string &name, double dx, double dy, double dz, double alpha, double theta, double phi)
Definition
Para.cxx:35
Geant4GM::Para::Name
virtual std::string Name() const
Return the name of this solid.
Definition
Para.cxx:99
Geant4GM::Para::ZHalfLength
virtual double ZHalfLength() const
Return half-length along the z axis in mm.
Definition
Para.cxx:114
Geant4GM::Para::Alpha
virtual double Alpha() const
Return angle formed by the y axis and by the plane joining the centre of the faces parallel to the z-...
Definition
Para.cxx:120
Geant4GM::Para::Para
Para()
Definition
Para.cxx:80
Geant4GM::SolidMap::Instance
static SolidMap * Instance()
Definition
SolidMap.cxx:28
Geant4GM::SolidMap::AddSolid
void AddSolid(VGM::ISolid *, G4VSolid *)
Definition
SolidMap.cxx:59
M_PI
#define M_PI
Definition of math constant M_PI not available on Win32.
Definition
Math.h:24
BaseVGM
BaseVGM utilities.
Definition
utilities.h:23
ClhepVGM
ClhepVGM utilities.
Definition
transform.h:29
VGM
VGM interfaces.
Definition
VMedium.h:28
Generated on
for VGM by
1.17.0