VGM
Version 5.5
Toggle main menu visibility
Loading...
Searching...
No Matches
packages
BaseVGM
source
solids
VPolyhedra.cxx
Go to the documentation of this file.
1
// $Id$
2
3
// -----------------------------------------------------------------------
4
// The BaseVGM 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 VPolyhedra
14
// ---------------
15
// The ABC for polyhedra solids.
16
//
17
// Author: Ivana Hrivnacova; IPN Orsay
18
19
#include "
VGM/common/Math.h
"
20
21
#include "
BaseVGM/solids/VPolyhedra.h
"
22
23
//_____________________________________________________________________________
24
std::ostream&
operator<<
(std::ostream& out,
const
VGM::IPolyhedra
& polyhedra)
25
{
26
const
VGM::ISolid
& polyhedraSolid = polyhedra;
27
out << polyhedraSolid;
28
return
out;
29
}
30
31
//_____________________________________________________________________________
32
BaseVGM::VPolyhedra::VPolyhedra
() :
VGM
::IPolyhedra()
33
{
35
}
36
37
//_____________________________________________________________________________
38
BaseVGM::VPolyhedra::~VPolyhedra
()
39
{
40
//
41
}
42
43
//_____________________________________________________________________________
44
double
BaseVGM::VPolyhedra::ConvertRadiusFactor
()
const
45
{
46
//
47
double
phiTotal =
DeltaPhi
() / 180. *
M_PI
;
48
if
((phiTotal <= 0) || (phiTotal >= 2 *
M_PI
* (1 - 1e-16)))
49
phiTotal = 2 *
M_PI
;
50
51
return
cos(0.5 * phiTotal /
NofSides
());
52
}
53
54
//_____________________________________________________________________________
55
std::ostream&
BaseVGM::VPolyhedra::Put
(std::ostream& out)
const
56
{
57
out <<
" sphi = "
<<
StartPhi
() <<
"deg"
58
<<
" dphi = "
<<
DeltaPhi
() <<
"deg"
59
<<
" nsides = "
<<
NofSides
() <<
" nz = "
<<
NofZPlanes
() << std::endl;
60
61
double
* zvalues =
ZValues
();
62
double
* rinvalues =
InnerRadiusValues
();
63
double
* routvalues =
OuterRadiusValues
();
64
65
for
(
int
i = 0; i <
NofZPlanes
(); i++) {
66
out <<
" "
<< i <<
"th plane: "
67
<<
" z = "
<< zvalues[i] <<
"mm"
68
<<
" rin = "
<< rinvalues[i] <<
"mm"
69
<<
" rout = "
<< routvalues[i] <<
"mm"
;
70
71
if
(i <
NofZPlanes
() - 1) out << std::endl;
72
}
73
74
return
out;
75
}
Math.h
operator<<
std::ostream & operator<<(std::ostream &out, const VGM::IPolyhedra &polyhedra)
Definition
VPolyhedra.cxx:24
VPolyhedra.h
BaseVGM::VPolyhedra::VPolyhedra
VPolyhedra()
Definition
VPolyhedra.cxx:32
BaseVGM::VPolyhedra::ConvertRadiusFactor
double ConvertRadiusFactor() const
Definition
VPolyhedra.cxx:44
BaseVGM::VPolyhedra::Put
virtual std::ostream & Put(std::ostream &out) const
Put the printing of the solid parameters in the out stream.
Definition
VPolyhedra.cxx:55
BaseVGM::VPolyhedra::~VPolyhedra
virtual ~VPolyhedra()
Definition
VPolyhedra.cxx:38
VGM::IPolyhedra
The VGM interface to polyhedra solids.
Definition
IPolyhedra.h:30
VGM::IPolyhedra::OuterRadiusValues
virtual double * OuterRadiusValues() const =0
Return the array of outer radius of the planes in mm.
VGM::IPolyhedra::NofSides
virtual int NofSides() const =0
Return number of sides of the cross section between the given phi limits.
VGM::IPolyhedra::StartPhi
virtual double StartPhi() const =0
Return starting phi angle of the segment in deg.
VGM::IPolyhedra::InnerRadiusValues
virtual double * InnerRadiusValues() const =0
Return the array of innner radius of the planes in mm.
VGM::IPolyhedra::ZValues
virtual double * ZValues() const =0
Return the array of z positions of the planes in mm.
VGM::IPolyhedra::DeltaPhi
virtual double DeltaPhi() const =0
Return opening phi angle of the segment in deg.
VGM::IPolyhedra::NofZPlanes
virtual int NofZPlanes() const =0
Return number of planes perpendicular to the z axis.
VGM::ISolid
The VGM interface to solids.
Definition
ISolid.h:58
M_PI
#define M_PI
Definition of math constant M_PI not available on Win32.
Definition
Math.h:24
VGM
VGM interfaces.
Definition
VMedium.h:28
Generated on
for VGM by
1.17.0