VGM
Version 5.5
Toggle main menu visibility
Loading...
Searching...
No Matches
packages
Geant4GM
source
solids
Trd.cxx
Go to the documentation of this file.
1
// $Id$
2
3
// -----------------------------------------------------------------------
4
// The Geant4GM 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 Geant4 trd solid.
16
// If reflected, the parameters are changed as follows:
17
// hx1, hy1 --> hx2', hy2'
18
// hx2, hy2 --> hx1', hy1'
19
// hz --> hz'
20
//
21
// Author: Ivana Hrivnacova; IPN Orsay
22
23
#include "
ClhepVGM/Units.h
"
24
25
#include "
Geant4GM/solids/SolidMap.h
"
26
#include "
Geant4GM/solids/Trd.h
"
27
28
#include "G4ReflectedSolid.hh"
29
#include "G4Trd.hh"
30
31
//_____________________________________________________________________________
32
Geant4GM::Trd::Trd
(
const
std::string& name,
double
hx1,
double
hx2,
double
hy1,
33
double
hy2,
double
hz)
34
:
VGM
::ISolid(),
35
VGM
::ITrd(),
36
BaseVGM
::
VTrd
(),
37
fIsReflected(false),
38
fTrd(new G4Trd(name, hx1 /
ClhepVGM
::Units::Length(),
39
hx2 /
ClhepVGM
::Units::Length(), hy1 /
ClhepVGM
::Units::Length(),
40
hy2 /
ClhepVGM
::Units::Length(), hz /
ClhepVGM
::Units::Length()))
41
{
52
53
Geant4GM::SolidMap::Instance
()->
AddSolid
(
this
, fTrd);
54
}
55
56
//_____________________________________________________________________________
57
Geant4GM::Trd::Trd
(G4Trd* trd, G4ReflectedSolid* reflTrd)
58
:
VGM
::ISolid(),
VGM
::ITrd(),
BaseVGM
::
VTrd
(), fIsReflected(false), fTrd(trd)
59
{
61
62
if
(reflTrd) {
63
fIsReflected =
true
;
64
Geant4GM::SolidMap::Instance
()->
AddSolid
(
this
, reflTrd);
65
}
66
else
67
Geant4GM::SolidMap::Instance
()->
AddSolid
(
this
, trd);
68
}
69
70
//_____________________________________________________________________________
71
Geant4GM::Trd::Trd
() :
VGM
::ISolid(),
VGM
::ITrd(),
BaseVGM
::
VTrd
()
72
{
74
}
75
76
//_____________________________________________________________________________
77
Geant4GM::Trd::Trd
(
const
Trd
& rhs)
78
:
VGM
::ISolid(rhs),
VGM
::ITrd(rhs),
BaseVGM
::
VTrd
(rhs)
79
{
81
}
82
83
//_____________________________________________________________________________
84
Geant4GM::Trd::~Trd
()
85
{
86
//
87
}
88
89
//_____________________________________________________________________________
90
std::string
Geant4GM::Trd::Name
()
const
{
return
fTrd->GetName(); }
91
92
//_____________________________________________________________________________
93
double
Geant4GM::Trd::XHalfLengthMinusZ
()
const
94
{
95
if
(!fIsReflected)
96
return
fTrd->GetXHalfLength1() *
ClhepVGM::Units::Length
();
97
else
98
return
fTrd->GetXHalfLength2() *
ClhepVGM::Units::Length
();
99
}
100
101
//_____________________________________________________________________________
102
double
Geant4GM::Trd::XHalfLengthPlusZ
()
const
103
{
104
if
(!fIsReflected)
105
return
fTrd->GetXHalfLength2() *
ClhepVGM::Units::Length
();
106
else
107
return
fTrd->GetXHalfLength1() *
ClhepVGM::Units::Length
();
108
}
109
110
//_____________________________________________________________________________
111
double
Geant4GM::Trd::YHalfLengthMinusZ
()
const
112
{
113
if
(!fIsReflected)
114
return
fTrd->GetYHalfLength1() *
ClhepVGM::Units::Length
();
115
else
116
return
fTrd->GetYHalfLength2() *
ClhepVGM::Units::Length
();
117
}
118
119
//_____________________________________________________________________________
120
double
Geant4GM::Trd::YHalfLengthPlusZ
()
const
121
{
122
if
(!fIsReflected)
123
return
fTrd->GetYHalfLength2() *
ClhepVGM::Units::Length
();
124
else
125
return
fTrd->GetYHalfLength1() *
ClhepVGM::Units::Length
();
126
}
127
128
//_____________________________________________________________________________
129
double
Geant4GM::Trd::ZHalfLength
()
const
130
{
131
return
fTrd->GetZHalfLength() *
ClhepVGM::Units::Length
();
132
}
Units.h
SolidMap.h
Trd.h
BaseVGM::VTrd::VTrd
VTrd()
Definition
VTrd.cxx:30
ClhepVGM::Units::Length
static double Length()
Return CLHEP default length unit in VGM units.
Definition
Units.cxx:83
Geant4GM::SolidMap::Instance
static SolidMap * Instance()
Definition
SolidMap.cxx:28
Geant4GM::SolidMap::AddSolid
void AddSolid(VGM::ISolid *, G4VSolid *)
Definition
SolidMap.cxx:59
Geant4GM::Trd::Trd
Trd()
Definition
Trd.cxx:71
Geant4GM::Trd::Trd
Trd(const std::string &name, double hx1, double hx2, double hy1, double hy2, double hz)
Definition
Trd.cxx:32
Geant4GM::Trd::Name
virtual std::string Name() const
Return the name of this solid.
Definition
Trd.cxx:90
Geant4GM::Trd::XHalfLengthMinusZ
virtual double XHalfLengthMinusZ() const
Return the half-length along x at the surface positioned at -hz in mm.
Definition
Trd.cxx:93
Geant4GM::Trd::XHalfLengthPlusZ
virtual double XHalfLengthPlusZ() const
Return the half-length along x at the surface positioned at +hz in mm.
Definition
Trd.cxx:102
Geant4GM::Trd::YHalfLengthMinusZ
virtual double YHalfLengthMinusZ() const
Return the half-length along y at the surface positioned at -hz in mm.
Definition
Trd.cxx:111
Geant4GM::Trd::YHalfLengthPlusZ
virtual double YHalfLengthPlusZ() const
Return thehalf-length along y at the surface positioned at +hz in mm.
Definition
Trd.cxx:120
Geant4GM::Trd::~Trd
virtual ~Trd()
Definition
Trd.cxx:84
Geant4GM::Trd::ZHalfLength
virtual double ZHalfLength() const
Return the half-length along the z axis in mm.
Definition
Trd.cxx:129
BaseVGM
BaseVGM utilities.
Definition
utilities.h:23
ClhepVGM
ClhepVGM utilities.
Definition
transform.h:29
VGM
VGM interfaces.
Definition
VMedium.h:28
Generated on
for VGM by
1.17.0