VGM
Version 5.5
Toggle main menu visibility
Loading...
Searching...
No Matches
packages
Geant4GM
source
solids
Cons.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 Cons
14
// ---------------
15
// VGM implementation for Geant4 cons solid.
16
// If reflected, the parameters are changed as follows:
17
// rin1, rout1 --> rin2', rout2'
18
// rin2, rout2 --> rin1', rout1'
19
// hz --> hz'
20
// sphi, dphi --> sphi', dphi'
21
//
22
// Author: Ivana Hrivnacova; IPN Orsay
23
24
#include "
ClhepVGM/Units.h
"
25
26
#include "
Geant4GM/solids/Cons.h
"
27
#include "
Geant4GM/solids/SolidMap.h
"
28
29
#include "G4Cons.hh"
30
#include "G4ReflectedSolid.hh"
31
32
//_____________________________________________________________________________
33
Geant4GM::Cons::Cons
(
const
std::string& name,
double
rin1,
double
rout1,
34
double
rin2,
double
rout2,
double
hz,
double
sphi,
double
dphi)
35
:
VGM
::ISolid(),
36
VGM
::ICons(),
37
BaseVGM
::
VCons
(),
38
fIsReflected(false),
39
fCons(new G4Cons(name, rin1 /
ClhepVGM
::Units::Length(),
40
rout1 /
ClhepVGM
::Units::Length(), rin2 /
ClhepVGM
::Units::Length(),
41
rout2 /
ClhepVGM
::Units::Length(), hz /
ClhepVGM
::Units::Length(),
42
sphi /
ClhepVGM
::Units::Angle(), dphi /
ClhepVGM
::Units::Angle()))
43
{
52
53
Geant4GM::SolidMap::Instance
()->
AddSolid
(
this
, fCons);
54
}
55
56
//_____________________________________________________________________________
57
Geant4GM::Cons::Cons
(G4Cons* cons, G4ReflectedSolid* reflCons)
58
:
VGM
::ISolid(),
59
VGM
::ICons(),
60
BaseVGM
::
VCons
(),
61
fIsReflected(false),
62
fCons(cons)
63
{
65
66
if
(reflCons) {
67
fIsReflected =
true
;
68
Geant4GM::SolidMap::Instance
()->
AddSolid
(
this
, reflCons);
69
}
70
else
71
Geant4GM::SolidMap::Instance
()->
AddSolid
(
this
, cons);
72
}
73
74
//_____________________________________________________________________________
75
Geant4GM::Cons::Cons
() :
VGM
::ISolid(),
VGM
::ICons(),
BaseVGM
::
VCons
()
76
{
78
}
79
80
//_____________________________________________________________________________
81
Geant4GM::Cons::Cons
(
const
Cons
& rhs)
82
:
VGM
::ISolid(rhs),
VGM
::ICons(rhs),
BaseVGM
::
VCons
(rhs)
83
{
85
}
86
87
//_____________________________________________________________________________
88
Geant4GM::Cons::~Cons
()
89
{
90
//
91
}
92
93
//_____________________________________________________________________________
94
std::string
Geant4GM::Cons::Name
()
const
{
return
fCons->GetName(); }
95
96
//_____________________________________________________________________________
97
double
Geant4GM::Cons::InnerRadiusMinusZ
()
const
98
{
99
if
(!fIsReflected)
100
return
fCons->GetInnerRadiusMinusZ() *
ClhepVGM::Units::Length
();
101
else
102
return
fCons->GetInnerRadiusPlusZ() *
ClhepVGM::Units::Length
();
103
}
104
105
//_____________________________________________________________________________
106
double
Geant4GM::Cons::OuterRadiusMinusZ
()
const
107
{
108
if
(!fIsReflected)
109
return
fCons->GetOuterRadiusMinusZ() *
ClhepVGM::Units::Length
();
110
else
111
return
fCons->GetOuterRadiusPlusZ() *
ClhepVGM::Units::Length
();
112
}
113
114
//_____________________________________________________________________________
115
double
Geant4GM::Cons::InnerRadiusPlusZ
()
const
116
{
117
if
(!fIsReflected)
118
return
fCons->GetInnerRadiusPlusZ() *
ClhepVGM::Units::Length
();
119
else
120
return
fCons->GetInnerRadiusMinusZ() *
ClhepVGM::Units::Length
();
121
}
122
123
//_____________________________________________________________________________
124
double
Geant4GM::Cons::OuterRadiusPlusZ
()
const
125
{
126
if
(!fIsReflected)
127
return
fCons->GetOuterRadiusPlusZ() *
ClhepVGM::Units::Length
();
128
else
129
return
fCons->GetOuterRadiusMinusZ() *
ClhepVGM::Units::Length
();
130
}
131
132
//_____________________________________________________________________________
133
double
Geant4GM::Cons::ZHalfLength
()
const
134
{
135
return
fCons->GetZHalfLength() *
ClhepVGM::Units::Length
();
136
}
137
138
//_____________________________________________________________________________
139
double
Geant4GM::Cons::StartPhi
()
const
140
{
141
return
fCons->GetStartPhiAngle() *
ClhepVGM::Units::Angle
();
142
}
143
144
//_____________________________________________________________________________
145
double
Geant4GM::Cons::DeltaPhi
()
const
146
{
147
return
fCons->GetDeltaPhiAngle() *
ClhepVGM::Units::Angle
();
148
}
Units.h
Cons.h
SolidMap.h
BaseVGM::VCons::VCons
VCons()
Definition
VCons.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::Cons::Name
virtual std::string Name() const
Return the name of this solid.
Definition
Cons.cxx:94
Geant4GM::Cons::Cons
Cons(const std::string &name, double rin1, double rout1, double rin2, double rout2, double hz, double sphi, double dphi)
Definition
Cons.cxx:33
Geant4GM::Cons::DeltaPhi
virtual double DeltaPhi() const
Return the opening phi angle of the segment in deg.
Definition
Cons.cxx:145
Geant4GM::Cons::Cons
Cons()
Definition
Cons.cxx:75
Geant4GM::Cons::OuterRadiusPlusZ
virtual double OuterRadiusPlusZ() const
Return the outer radius at -z in mm.
Definition
Cons.cxx:124
Geant4GM::Cons::StartPhi
virtual double StartPhi() const
Return the starting phi angle of the segment in deg.
Definition
Cons.cxx:139
Geant4GM::Cons::ZHalfLength
virtual double ZHalfLength() const
Return the half-length along the z axis in mm.
Definition
Cons.cxx:133
Geant4GM::Cons::OuterRadiusMinusZ
virtual double OuterRadiusMinusZ() const
Return the outer radius at -z in mm.
Definition
Cons.cxx:106
Geant4GM::Cons::InnerRadiusMinusZ
virtual double InnerRadiusMinusZ() const
Return the innner radius at -z in mm.
Definition
Cons.cxx:97
Geant4GM::Cons::InnerRadiusPlusZ
virtual double InnerRadiusPlusZ() const
Return the innner radius at +z in mm.
Definition
Cons.cxx:115
Geant4GM::Cons::~Cons
virtual ~Cons()
Definition
Cons.cxx:88
Geant4GM::SolidMap::Instance
static SolidMap * Instance()
Definition
SolidMap.cxx:28
Geant4GM::SolidMap::AddSolid
void AddSolid(VGM::ISolid *, G4VSolid *)
Definition
SolidMap.cxx:59
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