VGM
Version 5.5
Toggle main menu visibility
Loading...
Searching...
No Matches
packages
Geant4GM
source
solids
Sphere.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 Sphere
14
// ---------------
15
// VGM implementation for Geant4 tubs solid.
16
// If reflected, the parameters are changed as follows:
17
// rin, rout --> rin', rout'
18
// sphi, dphi --> sphi', dphi'
19
// stheta --> PI - stheta'
20
// dtheta --> dtheta'
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/SolidMap.h
"
29
#include "
Geant4GM/solids/Sphere.h
"
30
31
#include "G4ReflectedSolid.hh"
32
#include "G4Sphere.hh"
33
34
//_____________________________________________________________________________
35
Geant4GM::Sphere::Sphere
(
const
std::string& name,
double
rin,
double
rout,
36
double
sphi,
double
dphi,
double
stheta,
double
dtheta)
37
:
VGM
::ISolid(),
38
VGM
::ISphere(),
39
BaseVGM
::
VSphere
(),
40
fIsReflected(false),
41
fSphere(new G4Sphere(name, rin /
ClhepVGM
::Units::Length(),
42
rout /
ClhepVGM
::Units::Length(), sphi /
ClhepVGM
::Units::Angle(),
43
dphi /
ClhepVGM
::Units::Angle(), stheta /
ClhepVGM
::Units::Angle(),
44
dtheta /
ClhepVGM
::Units::Angle()))
45
{
53
54
Geant4GM::SolidMap::Instance
()->
AddSolid
(
this
, fSphere);
55
}
56
57
//_____________________________________________________________________________
58
Geant4GM::Sphere::Sphere
(G4Sphere* sphere, G4ReflectedSolid* reflSphere)
59
:
VGM
::ISolid(),
60
VGM
::ISphere(),
61
BaseVGM
::
VSphere
(),
62
fIsReflected(false),
63
fSphere(sphere)
64
{
66
67
if
(reflSphere) {
68
fIsReflected =
true
;
69
Geant4GM::SolidMap::Instance
()->
AddSolid
(
this
, reflSphere);
70
}
71
else
72
Geant4GM::SolidMap::Instance
()->
AddSolid
(
this
, sphere);
73
}
74
75
//_____________________________________________________________________________
76
Geant4GM::Sphere::Sphere
() :
VGM
::ISolid(),
VGM
::ISphere(),
BaseVGM
::
VSphere
()
77
{
79
}
80
81
//_____________________________________________________________________________
82
Geant4GM::Sphere::Sphere
(
const
Sphere
& rhs)
83
:
VGM
::ISolid(rhs),
VGM
::ISphere(rhs),
BaseVGM
::
VSphere
(rhs)
84
{
86
}
87
88
//_____________________________________________________________________________
89
Geant4GM::Sphere::~Sphere
()
90
{
91
//
92
}
93
94
//_____________________________________________________________________________
95
std::string
Geant4GM::Sphere::Name
()
const
{
return
fSphere->GetName(); }
96
97
//_____________________________________________________________________________
98
double
Geant4GM::Sphere::InnerRadius
()
const
99
{
100
return
fSphere->GetInnerRadius() *
ClhepVGM::Units::Length
();
101
}
102
103
//_____________________________________________________________________________
104
double
Geant4GM::Sphere::OuterRadius
()
const
105
{
106
return
fSphere->GetOuterRadius() *
ClhepVGM::Units::Length
();
107
}
108
109
//_____________________________________________________________________________
110
double
Geant4GM::Sphere::StartPhi
()
const
111
{
112
return
fSphere->GetStartPhiAngle() *
ClhepVGM::Units::Angle
();
113
}
114
115
//_____________________________________________________________________________
116
double
Geant4GM::Sphere::DeltaPhi
()
const
117
{
118
return
fSphere->GetDeltaPhiAngle() *
ClhepVGM::Units::Angle
();
119
}
120
121
//_____________________________________________________________________________
122
double
Geant4GM::Sphere::StartTheta
()
const
123
{
124
if
(!fIsReflected)
125
return
fSphere->GetStartThetaAngle() *
ClhepVGM::Units::Angle
();
126
else
127
return
(
M_PI
- fSphere->GetDeltaThetaAngle()) *
ClhepVGM::Units::Angle
();
128
}
129
130
//_____________________________________________________________________________
131
double
Geant4GM::Sphere::DeltaTheta
()
const
132
{
133
return
fSphere->GetDeltaThetaAngle() *
ClhepVGM::Units::Angle
();
134
}
Units.h
SolidMap.h
Sphere.h
Math.h
BaseVGM::VSphere::VSphere
VSphere()
Definition
VSphere.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::SolidMap::Instance
static SolidMap * Instance()
Definition
SolidMap.cxx:28
Geant4GM::SolidMap::AddSolid
void AddSolid(VGM::ISolid *, G4VSolid *)
Definition
SolidMap.cxx:59
Geant4GM::Sphere::StartPhi
virtual double StartPhi() const
Return the starting azimuthal angle of the segment in deg.
Definition
Sphere.cxx:110
Geant4GM::Sphere::StartTheta
virtual double StartTheta() const
Return the starting polar angle of the segment in deg.
Definition
Sphere.cxx:122
Geant4GM::Sphere::InnerRadius
virtual double InnerRadius() const
Return the inside radius of the shell in mm.
Definition
Sphere.cxx:98
Geant4GM::Sphere::DeltaPhi
virtual double DeltaPhi() const
Return the opening azimuthal angle of the segment in deg.
Definition
Sphere.cxx:116
Geant4GM::Sphere::~Sphere
virtual ~Sphere()
Definition
Sphere.cxx:89
Geant4GM::Sphere::OuterRadius
virtual double OuterRadius() const
Return the outside radius of the shell in mm.
Definition
Sphere.cxx:104
Geant4GM::Sphere::Name
virtual std::string Name() const
Return the name of this solid.
Definition
Sphere.cxx:95
Geant4GM::Sphere::Sphere
Sphere(const std::string &name, double rin, double rout, double sphi, double dphi, double stheta, double dtheta)
Definition
Sphere.cxx:35
Geant4GM::Sphere::Sphere
Sphere()
Definition
Sphere.cxx:76
Geant4GM::Sphere::DeltaTheta
virtual double DeltaTheta() const
Return the opening polar angle of the segment in deg.
Definition
Sphere.cxx:131
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