VGM Version 5.3
Loading...
Searching...
No Matches
Trd.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 Trd
14// ---------------
15// VGM implementation for Root trd solid.
16//
17// Author: Ivana Hrivnacova; IPN Orsay
18
19#include "RootGM/solids/Trd.h"
20#include "RootGM/common/Units.h"
22
23#include "TGeoTrd1.h"
24#include "TGeoTrd2.h"
25
26//_____________________________________________________________________________
27RootGM::Trd::Trd(const std::string& name, double hx1, double hx2, double hy1,
28 double hy2, double hz)
29 : VGM::ISolid(),
30 VGM::ITrd(),
31 BaseVGM::VTrd(),
32 fTrd(new TGeoTrd2(name.data(), hx1 / RootGM::Units::Length(),
33 hx2 / RootGM::Units::Length(), hy1 / RootGM::Units::Length(),
34 hy2 / RootGM::Units::Length(), hz / RootGM::Units::Length())),
35 fIsOwner(false)
36{
47
49}
50
51//_____________________________________________________________________________
52RootGM::Trd::Trd(TGeoTrd2* trd)
53 : VGM::ISolid(), VGM::ITrd(), BaseVGM::VTrd(), fTrd(trd), fIsOwner(false)
54{
56
58}
59
60//_____________________________________________________________________________
61RootGM::Trd::Trd(TGeoTrd1* trd)
62 : VGM::ISolid(),
63 VGM::ITrd(),
64 BaseVGM::VTrd(),
65 fTrd(new TGeoTrd2(trd->GetName(), trd->GetDx1(), trd->GetDx2(),
66 trd->GetDy(), trd->GetDy(), trd->GetDz())),
67 fIsOwner(true)
68
69{
71
73}
74
75//_____________________________________________________________________________
76RootGM::Trd::Trd() : VGM::ISolid(), VGM::ITrd(), BaseVGM::VTrd()
77{
79}
80
81//_____________________________________________________________________________
83 : VGM::ISolid(rhs), VGM::ITrd(rhs), BaseVGM::VTrd(rhs)
84{
86}
87
88//_____________________________________________________________________________
90{
91 //
92 if (fIsOwner) delete fTrd;
93}
94
95//_____________________________________________________________________________
96std::string RootGM::Trd::Name() const { return fTrd->GetName(); }
97
98//_____________________________________________________________________________
100{
101 return fTrd->GetDx1() * RootGM::Units::Length();
102}
103
104//_____________________________________________________________________________
106{
107 return fTrd->GetDx2() * RootGM::Units::Length();
108}
109
110//_____________________________________________________________________________
112{
113 return fTrd->GetDy1() * RootGM::Units::Length();
114}
115
116//_____________________________________________________________________________
118{
119 return fTrd->GetDy2() * RootGM::Units::Length();
120}
121
122//_____________________________________________________________________________
124{
125 return fTrd->GetDz() * RootGM::Units::Length();
126}
void AddSolid(VGM::ISolid *, TGeoShape *)
Definition SolidMap.cxx:59
static SolidMap * Instance()
Definition SolidMap.cxx:28
VGM implementation for Root trd solid.
Definition Trd.h:33
virtual double YHalfLengthMinusZ() const
Return the half-length along y at the surface positioned at -hz in mm.
Definition Trd.cxx:111
virtual std::string Name() const
Return the name of this solid.
Definition Trd.cxx:96
virtual double XHalfLengthPlusZ() const
Return the half-length along x at the surface positioned at +hz in mm.
Definition Trd.cxx:105
virtual double ZHalfLength() const
Return the half-length along the z axis in mm.
Definition Trd.cxx:123
virtual double XHalfLengthMinusZ() const
Return the half-length along x at the surface positioned at -hz in mm.
Definition Trd.cxx:99
virtual double YHalfLengthPlusZ() const
Return thehalf-length along y at the surface positioned at +hz in mm.
Definition Trd.cxx:117
virtual ~Trd()
Definition Trd.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
BaseVGM utilities.
Definition utilities.h:23
VGM implementation for Root.
Definition axis.h:28
VGM interfaces.
Definition VMedium.h:28