VGM
Version 5.5
Toggle main menu visibility
Loading...
Searching...
No Matches
packages
RootGM
source
solids
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
"
21
#include "
RootGM/solids/SolidMap.h
"
22
23
#include "TGeoTrd1.h"
24
#include "TGeoTrd2.h"
25
26
//_____________________________________________________________________________
27
RootGM::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
48
RootGM::SolidMap::Instance
()->
AddSolid
(
this
, fTrd);
49
}
50
51
//_____________________________________________________________________________
52
RootGM::Trd::Trd
(TGeoTrd2* trd)
53
:
VGM
::ISolid(),
VGM
::ITrd(),
BaseVGM
::
VTrd
(), fTrd(trd), fIsOwner(false)
54
{
56
57
RootGM::SolidMap::Instance
()->
AddSolid
(
this
, fTrd);
58
}
59
60
//_____________________________________________________________________________
61
RootGM::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
72
RootGM::SolidMap::Instance
()->
AddSolid
(
this
, trd);
73
}
74
75
//_____________________________________________________________________________
76
RootGM::Trd::Trd
() :
VGM
::ISolid(),
VGM
::ITrd(),
BaseVGM
::
VTrd
()
77
{
79
}
80
81
//_____________________________________________________________________________
82
RootGM::Trd::Trd
(
const
Trd
& rhs)
83
:
VGM
::ISolid(rhs),
VGM
::ITrd(rhs),
BaseVGM
::
VTrd
(rhs)
84
{
86
}
87
88
//_____________________________________________________________________________
89
RootGM::Trd::~Trd
()
90
{
91
//
92
if
(fIsOwner)
delete
fTrd;
93
}
94
95
//_____________________________________________________________________________
96
std::string
RootGM::Trd::Name
()
const
{
return
fTrd->GetName(); }
97
98
//_____________________________________________________________________________
99
double
RootGM::Trd::XHalfLengthMinusZ
()
const
100
{
101
return
fTrd->GetDx1() *
RootGM::Units::Length
();
102
}
103
104
//_____________________________________________________________________________
105
double
RootGM::Trd::XHalfLengthPlusZ
()
const
106
{
107
return
fTrd->GetDx2() *
RootGM::Units::Length
();
108
}
109
110
//_____________________________________________________________________________
111
double
RootGM::Trd::YHalfLengthMinusZ
()
const
112
{
113
return
fTrd->GetDy1() *
RootGM::Units::Length
();
114
}
115
116
//_____________________________________________________________________________
117
double
RootGM::Trd::YHalfLengthPlusZ
()
const
118
{
119
return
fTrd->GetDy2() *
RootGM::Units::Length
();
120
}
121
122
//_____________________________________________________________________________
123
double
RootGM::Trd::ZHalfLength
()
const
124
{
125
return
fTrd->GetDz() *
RootGM::Units::Length
();
126
}
Units.h
SolidMap.h
Trd.h
BaseVGM::VTrd::VTrd
VTrd()
Definition
VTrd.cxx:30
RootGM::SolidMap::AddSolid
void AddSolid(VGM::ISolid *, TGeoShape *)
Definition
SolidMap.cxx:59
RootGM::SolidMap::Instance
static SolidMap * Instance()
Definition
SolidMap.cxx:28
RootGM::Trd::YHalfLengthMinusZ
virtual double YHalfLengthMinusZ() const
Return the half-length along y at the surface positioned at -hz in mm.
Definition
Trd.cxx:111
RootGM::Trd::Name
virtual std::string Name() const
Return the name of this solid.
Definition
Trd.cxx:96
RootGM::Trd::XHalfLengthPlusZ
virtual double XHalfLengthPlusZ() const
Return the half-length along x at the surface positioned at +hz in mm.
Definition
Trd.cxx:105
RootGM::Trd::ZHalfLength
virtual double ZHalfLength() const
Return the half-length along the z axis in mm.
Definition
Trd.cxx:123
RootGM::Trd::Trd
Trd(const std::string &name, double hx1, double hx2, double hy1, double hy2, double hz)
Definition
Trd.cxx:27
RootGM::Trd::XHalfLengthMinusZ
virtual double XHalfLengthMinusZ() const
Return the half-length along x at the surface positioned at -hz in mm.
Definition
Trd.cxx:99
RootGM::Trd::YHalfLengthPlusZ
virtual double YHalfLengthPlusZ() const
Return thehalf-length along y at the surface positioned at +hz in mm.
Definition
Trd.cxx:117
RootGM::Trd::~Trd
virtual ~Trd()
Definition
Trd.cxx:89
RootGM::Trd::Trd
Trd()
Definition
Trd.cxx:76
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
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