VGM Version 5.3
Loading...
Searching...
No Matches
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"
22
23#include "TGeoTube.h"
24
25//_____________________________________________________________________________
26RootGM::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
43}
44
45//_____________________________________________________________________________
46RootGM::Tubs::Tubs(TGeoTube* tubs)
47 : VGM::ISolid(), VGM::ITubs(), BaseVGM::VTubs(), fTubs(tubs)
48{
50
52}
53
54//_____________________________________________________________________________
55RootGM::Tubs::Tubs() : VGM::ISolid(), VGM::ITubs(), BaseVGM::VTubs()
56{
58}
59
60//_____________________________________________________________________________
62 : VGM::ISolid(rhs), VGM::ITubs(rhs), BaseVGM::VTubs(rhs)
63{
65}
66
67//_____________________________________________________________________________
69{
70 //
71}
72
73//_____________________________________________________________________________
74std::string RootGM::Tubs::Name() const { return fTubs->GetName(); }
75
76//_____________________________________________________________________________
78{
79 return fTubs->GetRmin() * RootGM::Units::Length();
80}
81
82//_____________________________________________________________________________
84{
85 return fTubs->GetRmax() * RootGM::Units::Length();
86}
87
88//_____________________________________________________________________________
90{
91 return fTubs->GetDz() * RootGM::Units::Length();
92}
93
94//_____________________________________________________________________________
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//_____________________________________________________________________________
105{
106 if (fTubs->TestShapeBit(TGeoShape::kGeoTubeSeg)) {
107 return (((TGeoTubeSeg*)fTubs)->GetPhi2() -
108 ((TGeoTubeSeg*)fTubs)->GetPhi1()) *
110 }
111 else
112 return 360. * RootGM::Units::Angle();
113}
void AddSolid(VGM::ISolid *, TGeoShape *)
Definition SolidMap.cxx:59
static SolidMap * Instance()
Definition SolidMap.cxx:28
VGM implementation for Root tubs solid.
Definition Tubs.h:32
virtual std::string Name() const
Return the name of this solid.
Definition Tubs.cxx:74
virtual ~Tubs()
Definition Tubs.cxx:68
virtual double InnerRadius() const
Return the inside radius in mm.
Definition Tubs.cxx:77
virtual double StartPhi() const
Return the starting angle of the segment in deg.
Definition Tubs.cxx:95
virtual double OuterRadius() const
Return the outside radius in mm.
Definition Tubs.cxx:83
virtual double DeltaPhi() const
Return the opening angle of the segment in deg.
Definition Tubs.cxx:104
virtual double ZHalfLength() const
Return the half-length along the z axis in m.
Definition Tubs.cxx:89
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