VGM Version 5.3
Loading...
Searching...
No Matches
Torus.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 Torus
14// ---------------
15// VGM implementation for Geant4 torus solid.
16//
17// Author: Ivana Hrivnacova; IPN Orsay
18
19#include "ClhepVGM/Units.h"
20
23
24#include "G4ReflectedSolid.hh"
25#include "G4Torus.hh"
26
27//_____________________________________________________________________________
28Geant4GM::Torus::Torus(const std::string& name, double rin, double rout,
29 double rax, double sphi, double dphi)
30 : VGM::ISolid(),
31 VGM::ITorus(),
32 BaseVGM::VTorus(),
33 fTorus(new G4Torus(name, rin / ClhepVGM::Units::Length(),
34 rout / ClhepVGM::Units::Length(), rax / ClhepVGM::Units::Length(),
35 sphi / ClhepVGM::Units::Angle(), dphi / ClhepVGM::Units::Angle()))
36{
44
46}
47
48//_____________________________________________________________________________
49Geant4GM::Torus::Torus(G4Torus* torus, G4ReflectedSolid* reflTorus)
50 : VGM::ISolid(), VGM::ITorus(), BaseVGM::VTorus(), fTorus(torus)
51{
53
54 if (reflTorus)
55 Geant4GM::SolidMap::Instance()->AddSolid(this, reflTorus);
56 else
58}
59
60//_____________________________________________________________________________
61Geant4GM::Torus::Torus() : VGM::ISolid(), VGM::ITorus(), BaseVGM::VTorus()
62{
64}
65
66//_____________________________________________________________________________
68 : VGM::ISolid(rhs), VGM::ITorus(rhs), BaseVGM::VTorus(rhs)
69{
71}
72
73//_____________________________________________________________________________
78
79//_____________________________________________________________________________
80std::string Geant4GM::Torus::Name() const { return fTorus->GetName(); }
81
82//_____________________________________________________________________________
84{
85 return fTorus->GetRmin() * ClhepVGM::Units::Length();
86}
87
88//_____________________________________________________________________________
90{
91 return fTorus->GetRmax() * ClhepVGM::Units::Length();
92}
93
94//_____________________________________________________________________________
96{
97 return fTorus->GetRtor() * ClhepVGM::Units::Length();
98}
99
100//_____________________________________________________________________________
102{
103 return fTorus->GetSPhi() * ClhepVGM::Units::Angle();
104}
105
106//_____________________________________________________________________________
108{
109 return fTorus->GetDPhi() * ClhepVGM::Units::Angle();
110}
static double Length()
Return CLHEP default length unit in VGM units.
Definition Units.cxx:83
static double Angle()
Return CLHEP default angle unit in VGM units.
Definition Units.cxx:92
static SolidMap * Instance()
Definition SolidMap.cxx:28
void AddSolid(VGM::ISolid *, G4VSolid *)
Definition SolidMap.cxx:59
VGM implementation for Geant4 torus solid.
Definition Torus.h:33
virtual std::string Name() const
Return the name of this solid.
Definition Torus.cxx:80
virtual double StartPhi() const
Return the starting phi angle of the segment in deg (with 0 being the +x axis)
Definition Torus.cxx:101
virtual double OuterRadius() const
Return the outside radius of the torus in mm.
Definition Torus.cxx:89
virtual ~Torus()
Definition Torus.cxx:74
virtual double InnerRadius() const
Return the inside radius of the torus in mm.
Definition Torus.cxx:83
virtual double DeltaPhi() const
Return the opening phi angle of the segment in deg.
Definition Torus.cxx:107
virtual double AxialRadius() const
Return the axial (swept) radius of the torus in mm.
Definition Torus.cxx:95
BaseVGM utilities.
Definition utilities.h:23
ClhepVGM utilities.
Definition transform.h:29
VGM interfaces.
Definition VMedium.h:28