VGM Version 5.3
Loading...
Searching...
No Matches
Trap.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 Trap
14// ---------------
15// VGM implementation for Root trap solid.
16//
17// Author: Ivana Hrivnacova; IPN Orsay
18
19#include "RootGM/solids/Trap.h"
20#include "RootGM/common/Units.h"
22
23#include "TGeoArb8.h"
24
25//_____________________________________________________________________________
26RootGM::Trap::Trap(const std::string& name, double hz, double theta, double phi,
27 double dy1, double dx1, double dx2, double alpha1, double dy2, double dx3,
28 double dx4, double alpha2)
29 : VGM::ISolid(),
30 VGM::ITrap(),
31 BaseVGM::VTrap(),
32 fTrap(new TGeoTrap(name.data(), hz / RootGM::Units::Length(),
33 theta / RootGM::Units::Angle(), phi / RootGM::Units::Angle(),
34 dy1 / RootGM::Units::Length(), dx1 / RootGM::Units::Length(),
35 dx2 / RootGM::Units::Length(), alpha1 / RootGM::Units::Angle(),
36 dy2 / RootGM::Units::Length(), dx3 / RootGM::Units::Length(),
37 dx4 / RootGM::Units::Length(), alpha2 / RootGM::Units::Angle()))
38{
63
65}
66
67//_____________________________________________________________________________
68RootGM::Trap::Trap(TGeoTrap* trap)
69 : VGM::ISolid(), VGM::ITrap(), BaseVGM::VTrap(), fTrap(trap)
70{
72
74}
75
76//_____________________________________________________________________________
77RootGM::Trap::Trap() : VGM::ISolid(), VGM::ITrap(), BaseVGM::VTrap()
78{
80}
81
82//_____________________________________________________________________________
84 : VGM::ISolid(rhs), VGM::ITrap(rhs), BaseVGM::VTrap(rhs)
85{
87}
88
89//_____________________________________________________________________________
91{
92 //
93}
94
95//_____________________________________________________________________________
96std::string RootGM::Trap::Name() const { return fTrap->GetName(); }
97
98//_____________________________________________________________________________
100{
101 return fTrap->GetDZ() * RootGM::Units::Length();
102}
103
104//_____________________________________________________________________________
106{
107 return fTrap->GetTheta() * RootGM::Units::Angle();
108}
109
110//_____________________________________________________________________________
111double RootGM::Trap::Phi() const
112{
113 return fTrap->GetPhi() * RootGM::Units::Angle();
114}
115
116//_____________________________________________________________________________
118{
119 return fTrap->GetH1() * RootGM::Units::Length();
120}
121
122//_____________________________________________________________________________
124{
125 return fTrap->GetBl1() * RootGM::Units::Length();
126}
127
128//_____________________________________________________________________________
130{
131 return fTrap->GetTl1() * RootGM::Units::Length();
132}
133
134//_____________________________________________________________________________
136{
137 return fTrap->GetAlpha1() * RootGM::Units::Angle();
138}
139
140//_____________________________________________________________________________
142{
143 return fTrap->GetH2() * RootGM::Units::Length();
144}
145
146//_____________________________________________________________________________
148{
149 return fTrap->GetBl2() * RootGM::Units::Length();
150}
151
152//_____________________________________________________________________________
154{
155 return fTrap->GetTl2() * RootGM::Units::Length();
156}
157
158//_____________________________________________________________________________
160{
161 return fTrap->GetAlpha2() * RootGM::Units::Angle();
162}
void AddSolid(VGM::ISolid *, TGeoShape *)
Definition SolidMap.cxx:59
static SolidMap * Instance()
Definition SolidMap.cxx:28
VGM implementation for Root trap solid.
Definition Trap.h:32
virtual ~Trap()
Definition Trap.cxx:90
virtual double YHalfLengthMinusZ() const
Return the half-length along y of the face at -hz in mm.
Definition Trap.cxx:117
virtual double AlphaMinusZ() const
Return the angle with respect to the y axis from the centre of the side at -hy to the centre at +hy o...
Definition Trap.cxx:135
virtual double YHalfLengthPlusZ() const
Return the half-length along y of the face at +hz in m.
Definition Trap.cxx:141
virtual std::string Name() const
Return the name of this solid.
Definition Trap.cxx:96
virtual double XHalfLengthMinusZPlusY() const
Return the half-length along x of the side at +hy of the face at +hz in mm.
Definition Trap.cxx:129
virtual double ZHalfLength() const
Return the half-length along the z axis in mm.
Definition Trap.cxx:99
virtual double AlphaPlusZ() const
Return the angle with respect to the y axis from the centre of the side at -hy to the centre at +hy o...
Definition Trap.cxx:159
virtual double Theta() const
Return the polar angle of the line joining the centres of the faces at -hz and +hz in deg.
Definition Trap.cxx:105
virtual double XHalfLengthPlusZMinusY() const
Return the half-length along x of the side at -hy of the face at +hz in m.
Definition Trap.cxx:147
virtual double Phi() const
Return the azimuthal angle of the line joining the centres of the faces at -hz and +hz in deg.
Definition Trap.cxx:111
virtual double XHalfLengthPlusZPlusY() const
Return the half-length along x of the side at +hy of the face at +hz in m.
Definition Trap.cxx:153
virtual double XHalfLengthMinusZMinusY() const
Return the half-length along x of the side at -hy of the face at -hz in mm.
Definition Trap.cxx:123
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