VGM Version 5.3
Loading...
Searching...
No Matches
Paraboloid.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 Paraboloid
14// -----------------
15// VGM implementation for Geant4 paraboloid solid.
16// If reflected, the parameters are changed as follows:
17// r1 --> r2'
18// r2 --> r1'
19//
20// Author: Ivana Hrivnacova; IPN Orsay
21
22#include "ClhepVGM/Units.h"
23
26
27#include "G4Paraboloid.hh"
28#include "G4ReflectedSolid.hh"
29
30//_____________________________________________________________________________
32 const std::string& name, double r1, double r2, double hz)
33 : VGM::ISolid(),
34 VGM::IParaboloid(),
35 BaseVGM::VParaboloid(),
36 fIsReflected(false),
37 fParaboloid(0)
38{
43
44 if (r2 > r1) {
45 fParaboloid = new G4Paraboloid(name, hz / ClhepVGM::Units::Length(),
47 fIsReflected = false;
48 Geant4GM::SolidMap::Instance()->AddSolid(this, fParaboloid);
49 }
50 else {
51 fParaboloid = new G4Paraboloid(name, hz / ClhepVGM::Units::Length(),
53
54 G4ReflectedSolid* reflParaboloid =
55 new G4ReflectedSolid(name, fParaboloid, G4ReflectZ3D());
56
57 fIsReflected = true;
58 Geant4GM::SolidMap::Instance()->AddSolid(this, reflParaboloid);
59 }
60}
61
62//_____________________________________________________________________________
64 G4Paraboloid* paraboloid, G4ReflectedSolid* reflParaboloid)
65 : VGM::ISolid(),
66 VGM::IParaboloid(),
67 BaseVGM::VParaboloid(),
68 fIsReflected(false),
69 fParaboloid(paraboloid)
70{
72
73 if (reflParaboloid) {
74 fIsReflected = true;
75 Geant4GM::SolidMap::Instance()->AddSolid(this, reflParaboloid);
76 }
77 else
78 Geant4GM::SolidMap::Instance()->AddSolid(this, paraboloid);
79}
80
81//_____________________________________________________________________________
83 : VGM::ISolid(), VGM::IParaboloid(), BaseVGM::VParaboloid()
84{
86}
87
88//_____________________________________________________________________________
90 : VGM::ISolid(rhs), VGM::IParaboloid(rhs), BaseVGM::VParaboloid(rhs)
91{
93}
94
95//_____________________________________________________________________________
100
101//_____________________________________________________________________________
102std::string Geant4GM::Paraboloid::Name() const
103{
104 return fParaboloid->GetName();
105}
106
107//_____________________________________________________________________________
109{
110 if (!fIsReflected)
111 return fParaboloid->GetRadiusMinusZ() * ClhepVGM::Units::Length();
112 else
113 return fParaboloid->GetRadiusPlusZ() * ClhepVGM::Units::Length();
114}
115
116//_____________________________________________________________________________
118{
119 if (!fIsReflected)
120 return fParaboloid->GetRadiusPlusZ() * ClhepVGM::Units::Length();
121 else
122 return fParaboloid->GetRadiusMinusZ() * ClhepVGM::Units::Length();
123}
124
125//_____________________________________________________________________________
127{
128 return fParaboloid->GetZHalfLength() * ClhepVGM::Units::Length();
129}
static double Length()
Return CLHEP default length unit in VGM units.
Definition Units.cxx:83
VGM implementation for Geant4 paraboloid solid.
Definition Paraboloid.h:33
virtual double RadiusMinusZ() const
Return the radius at -z in mm.
virtual double ZHalfLength() const
Return the half-length along the z axis in mm.
virtual std::string Name() const
Return the name of this solid.
virtual double RadiusPlusZ() const
Return the radius at +z in mm.
static SolidMap * Instance()
Definition SolidMap.cxx:28
void AddSolid(VGM::ISolid *, G4VSolid *)
Definition SolidMap.cxx:59
BaseVGM utilities.
Definition utilities.h:23
VGM interfaces.
Definition VMedium.h:28