VGM Version 5.3
Loading...
Searching...
No Matches
Torus.cxx
Go to the documentation of this file.
1// $Id$
2
3// -----------------------------------------------------------------------
4// The RootGM 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 Root torus solid.
16//
17// Author: Ivana Hrivnacova; IPN Orsay
18
19#include "RootGM/solids/Torus.h"
20#include "RootGM/common/Units.h"
22
23#include "TGeoTorus.h"
24
25//_____________________________________________________________________________
26RootGM::Torus::Torus(const std::string& name, double rin, double rout,
27 double rax, double sphi, double dphi)
28 : VGM::ISolid(),
29 VGM::ITorus(),
30 BaseVGM::VTorus(),
31 fTorus(new TGeoTorus(name.data(), rax / RootGM::Units::Length(),
32 rin / RootGM::Units::Length(), rout / RootGM::Units::Length(),
33 sphi / RootGM::Units::Angle(), dphi / RootGM::Units::Angle()))
34{
42
43 RootGM::SolidMap::Instance()->AddSolid(this, fTorus);
44}
45
46//_____________________________________________________________________________
47RootGM::Torus::Torus(TGeoTorus* torus)
48 : VGM::ISolid(), VGM::ITorus(), BaseVGM::VTorus(), fTorus(torus)
49{
51
52 RootGM::SolidMap::Instance()->AddSolid(this, fTorus);
53}
54
55//_____________________________________________________________________________
56RootGM::Torus::Torus() : VGM::ISolid(), VGM::ITorus(), BaseVGM::VTorus()
57{
59}
60
61//_____________________________________________________________________________
63 : VGM::ISolid(rhs), VGM::ITorus(rhs), BaseVGM::VTorus(rhs)
64{
66}
67
68//_____________________________________________________________________________
70{
71 //
72}
73
74//_____________________________________________________________________________
75std::string RootGM::Torus::Name() const { return fTorus->GetName(); }
76
77//_____________________________________________________________________________
79{
80 return fTorus->GetRmin() * RootGM::Units::Length();
81}
82
83//_____________________________________________________________________________
85{
86 return fTorus->GetRmax() * RootGM::Units::Length();
87}
88
89//_____________________________________________________________________________
91{
92 return fTorus->GetR() * RootGM::Units::Length();
93}
94
95//_____________________________________________________________________________
97{
98 return fTorus->GetPhi1() * RootGM::Units::Angle();
99}
100
101//_____________________________________________________________________________
103{
104 return fTorus->GetDphi() * RootGM::Units::Angle();
105}
void AddSolid(VGM::ISolid *, TGeoShape *)
Definition SolidMap.cxx:59
static SolidMap * Instance()
Definition SolidMap.cxx:28
VGM implementation for Root torus solid.
Definition Torus.h:32
virtual ~Torus()
Definition Torus.cxx:69
virtual double InnerRadius() const
Return the inside radius of the torus in mm.
Definition Torus.cxx:78
virtual double StartPhi() const
Return the starting phi angle of the segment in deg (with 0 being the +x axis)
Definition Torus.cxx:96
virtual double OuterRadius() const
Return the outside radius of the torus in mm.
Definition Torus.cxx:84
virtual double AxialRadius() const
Return the axial (swept) radius of the torus in mm.
Definition Torus.cxx:90
virtual double DeltaPhi() const
Return the opening phi angle of the segment in deg.
Definition Torus.cxx:102
virtual std::string Name() const
Return the name of this solid.
Definition Torus.cxx:75
Conversion from Root physical units to VGM units.
Definition Units.h:28
static double Length()
Return Root length unit in VGM units.
Definition Units.h:84
static double Angle()
Return Root angle unit in VGM units.
Definition Units.h:85
BaseVGM utilities.
Definition utilities.h:23
VGM implementation for Root.
Definition axis.h:28
VGM interfaces.
Definition VMedium.h:28