VGM Version 5.3
Loading...
Searching...
No Matches
Ctubs.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 Ctubs
14// ---------------
15// VGM implementation for Root cut tubs solid.
16//
17// Author: Ivana Hrivnacova; IPN Orsay
18
19#include "RootGM/solids/Ctubs.h"
20#include "RootGM/common/Units.h"
22
23#include "TGeoTube.h"
24
25//_____________________________________________________________________________
26RootGM::Ctubs::Ctubs(const std::string& name, double rin, double rout,
27 double hz, double sphi, double dphi, double nxlow, double nylow, double nzlow,
28 double nxhigh, double nyhigh, double nzhigh)
29 : VGM::ISolid(),
30 VGM::ICtubs(),
31 BaseVGM::VCtubs(),
32 fCtubs(new TGeoCtub(name.data(), rin / RootGM::Units::Length(),
33 rout / RootGM::Units::Length(), hz / RootGM::Units::Length(),
34 sphi / RootGM::Units::Angle(), (sphi + dphi) / RootGM::Units::Angle(),
35 nxlow / RootGM::Units::Length(), nylow / RootGM::Units::Length(),
36 nzlow / RootGM::Units::Length(), nxhigh / RootGM::Units::Length(),
37 nyhigh / RootGM::Units::Length(), nzhigh / RootGM::Units::Length()))
38{
51
52 RootGM::SolidMap::Instance()->AddSolid(this, fCtubs);
53}
54
55//_____________________________________________________________________________
56RootGM::Ctubs::Ctubs(TGeoCtub* tubs)
57 : VGM::ISolid(), VGM::ICtubs(), BaseVGM::VCtubs(), fCtubs(tubs)
58{
60
61 RootGM::SolidMap::Instance()->AddSolid(this, fCtubs);
62}
63
64//_____________________________________________________________________________
65RootGM::Ctubs::Ctubs() : VGM::ISolid(), VGM::ICtubs(), BaseVGM::VCtubs()
66{
68}
69
70//_____________________________________________________________________________
72 : VGM::ISolid(rhs), VGM::ICtubs(rhs), BaseVGM::VCtubs(rhs)
73{
75}
76
77//_____________________________________________________________________________
79{
80 //
81}
82
83//_____________________________________________________________________________
84std::string RootGM::Ctubs::Name() const { return fCtubs->GetName(); }
85
86//_____________________________________________________________________________
88{
89 return fCtubs->GetRmin() * RootGM::Units::Length();
90}
91
92//_____________________________________________________________________________
94{
95 return fCtubs->GetRmax() * RootGM::Units::Length();
96}
97
98//_____________________________________________________________________________
100{
101 return fCtubs->GetDz() * RootGM::Units::Length();
102}
103
104//_____________________________________________________________________________
106{
107 if (fCtubs->TestShapeBit(TGeoShape::kGeoTubeSeg))
108 return ((TGeoTubeSeg*)fCtubs)->GetPhi1() * RootGM::Units::Angle();
109 else
110 return 0. * RootGM::Units::Angle();
111}
112
113//_____________________________________________________________________________
115{
116 if (fCtubs->TestShapeBit(TGeoShape::kGeoTubeSeg)) {
117 return (((TGeoTubeSeg*)fCtubs)->GetPhi2() -
118 ((TGeoTubeSeg*)fCtubs)->GetPhi1()) *
120 }
121 else
122 return 360. * RootGM::Units::Angle();
123}
124
125//_____________________________________________________________________________
126double RootGM::Ctubs::NxLow() const { return fCtubs->GetNlow()[0]; }
127
128//_____________________________________________________________________________
129double RootGM::Ctubs::NyLow() const { return fCtubs->GetNlow()[1]; }
130
131//_____________________________________________________________________________
132double RootGM::Ctubs::NzLow() const { return fCtubs->GetNlow()[2]; }
133
134//_____________________________________________________________________________
135double RootGM::Ctubs::NxHigh() const { return fCtubs->GetNhigh()[0]; }
136
137//_____________________________________________________________________________
138double RootGM::Ctubs::NyHigh() const { return fCtubs->GetNhigh()[1]; }
139
140//_____________________________________________________________________________
141double RootGM::Ctubs::NzHigh() const { return fCtubs->GetNhigh()[2]; }
VGM implementation for Root cut tubs solid.
Definition Ctubs.h:32
virtual double NzHigh() const
Z-component of the normal unit vector to the cut plane in +z.
Definition Ctubs.cxx:141
virtual double NzLow() const
Z-component of the normal unit vector to the cut plane in -z.
Definition Ctubs.cxx:132
virtual double StartPhi() const
Return the starting angle of the segment in deg.
Definition Ctubs.cxx:105
virtual double ZHalfLength() const
Return the half-length along the z axis in m.
Definition Ctubs.cxx:99
virtual double InnerRadius() const
Return the inside radius in mm.
Definition Ctubs.cxx:87
virtual double NyLow() const
Y-component of the normal unit vector to the cut plane in -z.
Definition Ctubs.cxx:129
virtual double NxLow() const
X-component of the normal unit vector to the cut plane in -z.
Definition Ctubs.cxx:126
virtual ~Ctubs()
Definition Ctubs.cxx:78
virtual double NxHigh() const
X-component of the normal unit vector to the cut plane in +z.
Definition Ctubs.cxx:135
virtual double NyHigh() const
Y-component of the normal unit vector to the cut plane in +z.
Definition Ctubs.cxx:138
virtual double DeltaPhi() const
Return the opening angle of the segment in deg.
Definition Ctubs.cxx:114
virtual double OuterRadius() const
Return the outside radius in mm.
Definition Ctubs.cxx:93
virtual std::string Name() const
Return the name of this solid.
Definition Ctubs.cxx:84
void AddSolid(VGM::ISolid *, TGeoShape *)
Definition SolidMap.cxx:59
static SolidMap * Instance()
Definition SolidMap.cxx:28
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