VGM Version 5.3
Loading...
Searching...
No Matches
Sphere.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 Sphere
14// ---------------
15// VGM implementation for Root sphere solid.
16//
17// Author: Ivana Hrivnacova; IPN Orsay
18
20#include "RootGM/common/Units.h"
22
23#include "TGeoSphere.h"
24
25//_____________________________________________________________________________
26RootGM::Sphere::Sphere(const std::string& name, double rin, double rout,
27 double sphi, double dphi, double stheta, double dtheta)
28 : VGM::ISolid(),
29 VGM::ISphere(),
30 BaseVGM::VSphere(),
31 fSphere(new TGeoSphere(name.data(), rin / RootGM::Units::Length(),
32 rout / RootGM::Units::Length(), stheta / RootGM::Units::Angle(),
33 (stheta + dtheta) / RootGM::Units::Angle(), sphi / RootGM::Units::Angle(),
34 (sphi + dphi) / RootGM::Units::Angle()))
35{
43
44 RootGM::SolidMap::Instance()->AddSolid(this, fSphere);
45}
46
47//_____________________________________________________________________________
48RootGM::Sphere::Sphere(TGeoSphere* sphere)
49 : VGM::ISolid(), VGM::ISphere(), BaseVGM::VSphere(), fSphere(sphere)
50{
52
53 RootGM::SolidMap::Instance()->AddSolid(this, fSphere);
54}
55
56//_____________________________________________________________________________
57RootGM::Sphere::Sphere() : VGM::ISolid(), VGM::ISphere(), BaseVGM::VSphere()
58{
60}
61
62//_____________________________________________________________________________
64 : VGM::ISolid(rhs), VGM::ISphere(rhs), BaseVGM::VSphere(rhs)
65{
67}
68
69//_____________________________________________________________________________
74
75//_____________________________________________________________________________
76std::string RootGM::Sphere::Name() const { return fSphere->GetName(); }
77
78//_____________________________________________________________________________
80{
81 return fSphere->GetRmin() * RootGM::Units::Length();
82}
83
84//_____________________________________________________________________________
86{
87 return fSphere->GetRmax() * RootGM::Units::Length();
88}
89
90//_____________________________________________________________________________
92{
93 return fSphere->GetPhi1() * RootGM::Units::Angle();
94}
95
96//_____________________________________________________________________________
98{
99 return (fSphere->GetPhi2() - fSphere->GetPhi1()) * RootGM::Units::Angle();
100}
101
102//_____________________________________________________________________________
104{
105 return fSphere->GetTheta1() * RootGM::Units::Angle();
106}
107
108//_____________________________________________________________________________
110{
111 return (fSphere->GetTheta2() - fSphere->GetTheta1()) * RootGM::Units::Angle();
112}
void AddSolid(VGM::ISolid *, TGeoShape *)
Definition SolidMap.cxx:59
static SolidMap * Instance()
Definition SolidMap.cxx:28
VGM implementation for Root sphere solid.
Definition Sphere.h:32
virtual ~Sphere()
Definition Sphere.cxx:70
virtual double StartTheta() const
Return the starting polar angle of the segment in deg.
Definition Sphere.cxx:103
virtual double InnerRadius() const
Return the inside radius of the shell in mm.
Definition Sphere.cxx:79
virtual double OuterRadius() const
Return the outside radius of the shell in mm.
Definition Sphere.cxx:85
virtual double StartPhi() const
Return the starting azimuthal angle of the segment in deg.
Definition Sphere.cxx:91
virtual std::string Name() const
Return the name of this solid.
Definition Sphere.cxx:76
virtual double DeltaPhi() const
Return the opening azimuthal angle of the segment in deg.
Definition Sphere.cxx:97
virtual double DeltaTheta() const
Return the opening polar angle of the segment in deg.
Definition Sphere.cxx:109
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