VGM
Version 5.5
Toggle main menu visibility
Loading...
Searching...
No Matches
packages
RootGM
source
solids
Tubs.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 Tubs
14
// ---------------
15
// VGM implementation for Root tubs solid.
16
//
17
// Author: Ivana Hrivnacova; IPN Orsay
18
19
#include "
RootGM/solids/Tubs.h
"
20
#include "
RootGM/common/Units.h
"
21
#include "
RootGM/solids/SolidMap.h
"
22
23
#include "TGeoTube.h"
24
25
//_____________________________________________________________________________
26
RootGM::Tubs::Tubs
(
const
std::string& name,
double
rin,
double
rout,
double
hz,
27
double
sphi,
double
dphi)
28
:
VGM
::ISolid(),
29
VGM
::ITubs(),
30
BaseVGM
::
VTubs
(),
31
fTubs(new TGeoTubeSeg(name.data(), rin /
RootGM
::
Units
::Length(),
32
rout /
RootGM
::
Units
::Length(), hz /
RootGM
::
Units
::Length(),
33
sphi /
RootGM
::
Units
::Angle(), (sphi + dphi) /
RootGM
::
Units
::Angle()))
34
{
41
42
RootGM::SolidMap::Instance
()->
AddSolid
(
this
, fTubs);
43
}
44
45
//_____________________________________________________________________________
46
RootGM::Tubs::Tubs
(TGeoTube* tubs)
47
:
VGM
::ISolid(),
VGM
::ITubs(),
BaseVGM
::
VTubs
(), fTubs(tubs)
48
{
50
51
RootGM::SolidMap::Instance
()->
AddSolid
(
this
, fTubs);
52
}
53
54
//_____________________________________________________________________________
55
RootGM::Tubs::Tubs
() :
VGM
::ISolid(),
VGM
::ITubs(),
BaseVGM
::
VTubs
()
56
{
58
}
59
60
//_____________________________________________________________________________
61
RootGM::Tubs::Tubs
(
const
Tubs
& rhs)
62
:
VGM
::ISolid(rhs),
VGM
::ITubs(rhs),
BaseVGM
::
VTubs
(rhs)
63
{
65
}
66
67
//_____________________________________________________________________________
68
RootGM::Tubs::~Tubs
()
69
{
70
//
71
}
72
73
//_____________________________________________________________________________
74
std::string
RootGM::Tubs::Name
()
const
{
return
fTubs->GetName(); }
75
76
//_____________________________________________________________________________
77
double
RootGM::Tubs::InnerRadius
()
const
78
{
79
return
fTubs->GetRmin() *
RootGM::Units::Length
();
80
}
81
82
//_____________________________________________________________________________
83
double
RootGM::Tubs::OuterRadius
()
const
84
{
85
return
fTubs->GetRmax() *
RootGM::Units::Length
();
86
}
87
88
//_____________________________________________________________________________
89
double
RootGM::Tubs::ZHalfLength
()
const
90
{
91
return
fTubs->GetDz() *
RootGM::Units::Length
();
92
}
93
94
//_____________________________________________________________________________
95
double
RootGM::Tubs::StartPhi
()
const
96
{
97
if
(fTubs->TestShapeBit(TGeoShape::kGeoTubeSeg))
98
return
((TGeoTubeSeg*)fTubs)->GetPhi1() *
RootGM::Units::Angle
();
99
else
100
return
0. *
RootGM::Units::Angle
();
101
}
102
103
//_____________________________________________________________________________
104
double
RootGM::Tubs::DeltaPhi
()
const
105
{
106
if
(fTubs->TestShapeBit(TGeoShape::kGeoTubeSeg)) {
107
return
(((TGeoTubeSeg*)fTubs)->GetPhi2() -
108
((TGeoTubeSeg*)fTubs)->GetPhi1()) *
109
RootGM::Units::Angle
();
110
}
111
else
112
return
360. *
RootGM::Units::Angle
();
113
}
Units.h
SolidMap.h
Tubs.h
BaseVGM::VTubs::VTubs
VTubs()
Definition
VTubs.cxx:30
RootGM::SolidMap::AddSolid
void AddSolid(VGM::ISolid *, TGeoShape *)
Definition
SolidMap.cxx:59
RootGM::SolidMap::Instance
static SolidMap * Instance()
Definition
SolidMap.cxx:28
RootGM::Tubs::Name
virtual std::string Name() const
Return the name of this solid.
Definition
Tubs.cxx:74
RootGM::Tubs::Tubs
Tubs(const std::string &name, double rin, double rout, double hz, double sphi, double dphi)
Definition
Tubs.cxx:26
RootGM::Tubs::Tubs
Tubs()
Definition
Tubs.cxx:55
RootGM::Tubs::~Tubs
virtual ~Tubs()
Definition
Tubs.cxx:68
RootGM::Tubs::InnerRadius
virtual double InnerRadius() const
Return the inside radius in mm.
Definition
Tubs.cxx:77
RootGM::Tubs::StartPhi
virtual double StartPhi() const
Return the starting angle of the segment in deg.
Definition
Tubs.cxx:95
RootGM::Tubs::OuterRadius
virtual double OuterRadius() const
Return the outside radius in mm.
Definition
Tubs.cxx:83
RootGM::Tubs::DeltaPhi
virtual double DeltaPhi() const
Return the opening angle of the segment in deg.
Definition
Tubs.cxx:104
RootGM::Tubs::ZHalfLength
virtual double ZHalfLength() const
Return the half-length along the z axis in m.
Definition
Tubs.cxx:89
RootGM::Units
Conversion from Root physical units to VGM units.
Definition
Units.h:28
RootGM::Units::Length
static double Length()
Return Root length unit in VGM units.
Definition
Units.h:84
RootGM::Units::Angle
static double Angle()
Return Root angle unit in VGM units.
Definition
Units.h:85
BaseVGM
BaseVGM utilities.
Definition
utilities.h:23
RootGM
VGM implementation for Root.
Definition
axis.h:28
VGM
VGM interfaces.
Definition
VMedium.h:28
Generated on
for VGM by
1.17.0