VGM Version 5.3
Loading...
Searching...
No Matches
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
22
23//_____________________________________________________________________________
24std::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//_____________________________________________________________________________
33{
35}
36
37//_____________________________________________________________________________
42
43//_____________________________________________________________________________
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//_____________________________________________________________________________
55std::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}
std::ostream & operator<<(std::ostream &out, const VGM::IPolyhedra &polyhedra)
double ConvertRadiusFactor() const
virtual std::ostream & Put(std::ostream &out) const
Put the printing of the solid parameters in the out stream.
The VGM interface to polyhedra solids.
Definition IPolyhedra.h:30
The VGM interface to solids.
Definition ISolid.h:58
#define M_PI
Definition of math constant M_PI not available on Win32.
Definition Math.h:24
VGM interfaces.
Definition VMedium.h:28