VGM Version 5.3
Loading...
Searching...
No Matches
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
26#include "Geant4GM/solids/Trd.h"
27
28#include "G4ReflectedSolid.hh"
29#include "G4Trd.hh"
30
31//_____________________________________________________________________________
32Geant4GM::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
54}
55
56//_____________________________________________________________________________
57Geant4GM::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
68}
69
70//_____________________________________________________________________________
71Geant4GM::Trd::Trd() : VGM::ISolid(), VGM::ITrd(), BaseVGM::VTrd()
72{
74}
75
76//_____________________________________________________________________________
78 : VGM::ISolid(rhs), VGM::ITrd(rhs), BaseVGM::VTrd(rhs)
79{
81}
82
83//_____________________________________________________________________________
85{
86 //
87}
88
89//_____________________________________________________________________________
90std::string Geant4GM::Trd::Name() const { return fTrd->GetName(); }
91
92//_____________________________________________________________________________
94{
95 if (!fIsReflected)
96 return fTrd->GetXHalfLength1() * ClhepVGM::Units::Length();
97 else
98 return fTrd->GetXHalfLength2() * ClhepVGM::Units::Length();
99}
100
101//_____________________________________________________________________________
103{
104 if (!fIsReflected)
105 return fTrd->GetXHalfLength2() * ClhepVGM::Units::Length();
106 else
107 return fTrd->GetXHalfLength1() * ClhepVGM::Units::Length();
108}
109
110//_____________________________________________________________________________
112{
113 if (!fIsReflected)
114 return fTrd->GetYHalfLength1() * ClhepVGM::Units::Length();
115 else
116 return fTrd->GetYHalfLength2() * ClhepVGM::Units::Length();
117}
118
119//_____________________________________________________________________________
121{
122 if (!fIsReflected)
123 return fTrd->GetYHalfLength2() * ClhepVGM::Units::Length();
124 else
125 return fTrd->GetYHalfLength1() * ClhepVGM::Units::Length();
126}
127
128//_____________________________________________________________________________
130{
131 return fTrd->GetZHalfLength() * ClhepVGM::Units::Length();
132}
static double Length()
Return CLHEP default length unit in VGM units.
Definition Units.cxx:83
static SolidMap * Instance()
Definition SolidMap.cxx:28
void AddSolid(VGM::ISolid *, G4VSolid *)
Definition SolidMap.cxx:59
VGM implementation for Geant4 trd solid.
Definition Trd.h:33
virtual std::string Name() const
Return the name of this solid.
Definition Trd.cxx:90
virtual double XHalfLengthMinusZ() const
Return the half-length along x at the surface positioned at -hz in mm.
Definition Trd.cxx:93
virtual double XHalfLengthPlusZ() const
Return the half-length along x at the surface positioned at +hz in mm.
Definition Trd.cxx:102
virtual double YHalfLengthMinusZ() const
Return the half-length along y at the surface positioned at -hz in mm.
Definition Trd.cxx:111
virtual double YHalfLengthPlusZ() const
Return thehalf-length along y at the surface positioned at +hz in mm.
Definition Trd.cxx:120
virtual ~Trd()
Definition Trd.cxx:84
virtual double ZHalfLength() const
Return the half-length along the z axis in mm.
Definition Trd.cxx:129
BaseVGM utilities.
Definition utilities.h:23
ClhepVGM utilities.
Definition transform.h:29
VGM interfaces.
Definition VMedium.h:28