VGM
Version 5.5
Toggle main menu visibility
Loading...
Searching...
No Matches
packages
RootGM
source
solids
Cons.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 Cons
14
// ---------------
15
// VGM implementation for Root cons solid.
16
//
17
// Author: Ivana Hrivnacova; IPN Orsay
18
19
#include "
RootGM/solids/Cons.h
"
20
#include "
RootGM/common/Units.h
"
21
#include "
RootGM/solids/SolidMap.h
"
22
23
#include "TGeoCone.h"
24
#include "TGeoShape.h"
25
26
//_____________________________________________________________________________
27
RootGM::Cons::Cons
(
const
std::string& name,
double
rin1,
double
rout1,
28
double
rin2,
double
rout2,
double
hz,
double
sphi,
double
dphi)
29
:
VGM
::ISolid(),
30
VGM
::ICons(),
31
BaseVGM
::
VCons
(),
32
fCons(new TGeoConeSeg(name.data(), hz /
RootGM
::
Units
::Length(),
33
rin1 /
RootGM
::
Units
::Length(), rout1 /
RootGM
::
Units
::Length(),
34
rin2 /
RootGM
::
Units
::Length(), rout2 /
RootGM
::
Units
::Length(),
35
sphi /
RootGM
::
Units
::Angle(), (sphi + dphi) /
RootGM
::
Units
::Angle()))
36
{
45
46
RootGM::SolidMap::Instance
()->
AddSolid
(
this
, fCons);
47
}
48
49
//_____________________________________________________________________________
50
RootGM::Cons::Cons
(TGeoCone* cons)
51
:
VGM
::ISolid(),
VGM
::ICons(),
BaseVGM
::
VCons
(), fCons(cons)
52
{
54
55
RootGM::SolidMap::Instance
()->
AddSolid
(
this
, fCons);
56
}
57
58
//_____________________________________________________________________________
59
RootGM::Cons::Cons
() :
VGM
::ISolid(),
VGM
::ICons(),
BaseVGM
::
VCons
()
60
{
62
}
63
64
//_____________________________________________________________________________
65
RootGM::Cons::Cons
(
const
Cons
& rhs)
66
:
VGM
::ISolid(rhs),
VGM
::ICons(rhs),
BaseVGM
::
VCons
(rhs)
67
{
69
}
70
71
//_____________________________________________________________________________
72
RootGM::Cons::~Cons
()
73
{
74
//
75
}
76
77
//_____________________________________________________________________________
78
std::string
RootGM::Cons::Name
()
const
{
return
fCons->GetName(); }
79
80
//_____________________________________________________________________________
81
double
RootGM::Cons::InnerRadiusMinusZ
()
const
82
{
83
return
fCons->GetRmin1() *
RootGM::Units::Length
();
84
}
85
86
//_____________________________________________________________________________
87
double
RootGM::Cons::OuterRadiusMinusZ
()
const
88
{
89
return
fCons->GetRmax1() *
RootGM::Units::Length
();
90
}
91
92
//_____________________________________________________________________________
93
double
RootGM::Cons::InnerRadiusPlusZ
()
const
94
{
95
return
fCons->GetRmin2() *
RootGM::Units::Length
();
96
}
97
98
//_____________________________________________________________________________
99
double
RootGM::Cons::OuterRadiusPlusZ
()
const
100
{
101
return
fCons->GetRmax2() *
RootGM::Units::Length
();
102
}
103
104
//_____________________________________________________________________________
105
double
RootGM::Cons::ZHalfLength
()
const
106
{
107
return
fCons->GetDz() *
RootGM::Units::Length
();
108
}
109
110
//_____________________________________________________________________________
111
double
RootGM::Cons::StartPhi
()
const
112
{
113
if
(fCons->TestShapeBit(TGeoShape::kGeoConeSeg))
114
return
((TGeoConeSeg*)fCons)->GetPhi1() *
RootGM::Units::Angle
();
115
else
116
return
0. *
RootGM::Units::Angle
();
117
}
118
119
//_____________________________________________________________________________
120
double
RootGM::Cons::DeltaPhi
()
const
121
{
122
if
(fCons->TestShapeBit(TGeoShape::kGeoConeSeg)) {
123
return
(((TGeoConeSeg*)fCons)->GetPhi2() -
124
((TGeoConeSeg*)fCons)->GetPhi1()) *
125
RootGM::Units::Angle
();
126
}
127
else
128
return
360. *
RootGM::Units::Angle
();
129
}
Units.h
Cons.h
SolidMap.h
BaseVGM::VCons::VCons
VCons()
Definition
VCons.cxx:30
RootGM::Cons::InnerRadiusMinusZ
virtual double InnerRadiusMinusZ() const
Return the innner radius at -z in mm.
Definition
Cons.cxx:81
RootGM::Cons::ZHalfLength
virtual double ZHalfLength() const
Return the half-length along the z axis in mm.
Definition
Cons.cxx:105
RootGM::Cons::InnerRadiusPlusZ
virtual double InnerRadiusPlusZ() const
Return the innner radius at +z in mm.
Definition
Cons.cxx:93
RootGM::Cons::OuterRadiusPlusZ
virtual double OuterRadiusPlusZ() const
Return the outer radius at -z in mm.
Definition
Cons.cxx:99
RootGM::Cons::Name
virtual std::string Name() const
Return the name of this solid.
Definition
Cons.cxx:78
RootGM::Cons::~Cons
virtual ~Cons()
Definition
Cons.cxx:72
RootGM::Cons::Cons
Cons()
Definition
Cons.cxx:59
RootGM::Cons::OuterRadiusMinusZ
virtual double OuterRadiusMinusZ() const
Return the outer radius at -z in mm.
Definition
Cons.cxx:87
RootGM::Cons::StartPhi
virtual double StartPhi() const
Return the starting phi angle of the segment in deg.
Definition
Cons.cxx:111
RootGM::Cons::Cons
Cons(const std::string &name, double rin1, double rout1, double rin2, double rout2, double hz, double sphi, double dphi)
Definition
Cons.cxx:27
RootGM::Cons::DeltaPhi
virtual double DeltaPhi() const
Return the opening phi angle of the segment in deg.
Definition
Cons.cxx:120
RootGM::SolidMap::AddSolid
void AddSolid(VGM::ISolid *, TGeoShape *)
Definition
SolidMap.cxx:59
RootGM::SolidMap::Instance
static SolidMap * Instance()
Definition
SolidMap.cxx:28
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