VGM Version 5.3
Loading...
Searching...
No Matches
Cons.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 Cons
14// ---------------
15// VGM implementation for Geant4 cons solid.
16// If reflected, the parameters are changed as follows:
17// rin1, rout1 --> rin2', rout2'
18// rin2, rout2 --> rin1', rout1'
19// hz --> hz'
20// sphi, dphi --> sphi', dphi'
21//
22// Author: Ivana Hrivnacova; IPN Orsay
23
24#include "ClhepVGM/Units.h"
25
28
29#include "G4Cons.hh"
30#include "G4ReflectedSolid.hh"
31
32//_____________________________________________________________________________
33Geant4GM::Cons::Cons(const std::string& name, double rin1, double rout1,
34 double rin2, double rout2, double hz, double sphi, double dphi)
35 : VGM::ISolid(),
36 VGM::ICons(),
37 BaseVGM::VCons(),
38 fIsReflected(false),
39 fCons(new G4Cons(name, rin1 / ClhepVGM::Units::Length(),
40 rout1 / ClhepVGM::Units::Length(), rin2 / ClhepVGM::Units::Length(),
41 rout2 / ClhepVGM::Units::Length(), hz / ClhepVGM::Units::Length(),
42 sphi / ClhepVGM::Units::Angle(), dphi / ClhepVGM::Units::Angle()))
43{
52
54}
55
56//_____________________________________________________________________________
57Geant4GM::Cons::Cons(G4Cons* cons, G4ReflectedSolid* reflCons)
58 : VGM::ISolid(),
59 VGM::ICons(),
60 BaseVGM::VCons(),
61 fIsReflected(false),
62 fCons(cons)
63{
65
66 if (reflCons) {
67 fIsReflected = true;
68 Geant4GM::SolidMap::Instance()->AddSolid(this, reflCons);
69 }
70 else
72}
73
74//_____________________________________________________________________________
75Geant4GM::Cons::Cons() : VGM::ISolid(), VGM::ICons(), BaseVGM::VCons()
76{
78}
79
80//_____________________________________________________________________________
82 : VGM::ISolid(rhs), VGM::ICons(rhs), BaseVGM::VCons(rhs)
83{
85}
86
87//_____________________________________________________________________________
89{
90 //
91}
92
93//_____________________________________________________________________________
94std::string Geant4GM::Cons::Name() const { return fCons->GetName(); }
95
96//_____________________________________________________________________________
98{
99 if (!fIsReflected)
100 return fCons->GetInnerRadiusMinusZ() * ClhepVGM::Units::Length();
101 else
102 return fCons->GetInnerRadiusPlusZ() * ClhepVGM::Units::Length();
103}
104
105//_____________________________________________________________________________
107{
108 if (!fIsReflected)
109 return fCons->GetOuterRadiusMinusZ() * ClhepVGM::Units::Length();
110 else
111 return fCons->GetOuterRadiusPlusZ() * ClhepVGM::Units::Length();
112}
113
114//_____________________________________________________________________________
116{
117 if (!fIsReflected)
118 return fCons->GetInnerRadiusPlusZ() * ClhepVGM::Units::Length();
119 else
120 return fCons->GetInnerRadiusMinusZ() * ClhepVGM::Units::Length();
121}
122
123//_____________________________________________________________________________
125{
126 if (!fIsReflected)
127 return fCons->GetOuterRadiusPlusZ() * ClhepVGM::Units::Length();
128 else
129 return fCons->GetOuterRadiusMinusZ() * ClhepVGM::Units::Length();
130}
131
132//_____________________________________________________________________________
134{
135 return fCons->GetZHalfLength() * ClhepVGM::Units::Length();
136}
137
138//_____________________________________________________________________________
140{
141 return fCons->GetStartPhiAngle() * ClhepVGM::Units::Angle();
142}
143
144//_____________________________________________________________________________
146{
147 return fCons->GetDeltaPhiAngle() * ClhepVGM::Units::Angle();
148}
static double Length()
Return CLHEP default length unit in VGM units.
Definition Units.cxx:83
static double Angle()
Return CLHEP default angle unit in VGM units.
Definition Units.cxx:92
VGM implementation for Geant4 cons solid.
Definition Cons.h:33
virtual std::string Name() const
Return the name of this solid.
Definition Cons.cxx:94
virtual double DeltaPhi() const
Return the opening phi angle of the segment in deg.
Definition Cons.cxx:145
virtual double OuterRadiusPlusZ() const
Return the outer radius at -z in mm.
Definition Cons.cxx:124
virtual double StartPhi() const
Return the starting phi angle of the segment in deg.
Definition Cons.cxx:139
virtual double ZHalfLength() const
Return the half-length along the z axis in mm.
Definition Cons.cxx:133
virtual double OuterRadiusMinusZ() const
Return the outer radius at -z in mm.
Definition Cons.cxx:106
virtual double InnerRadiusMinusZ() const
Return the innner radius at -z in mm.
Definition Cons.cxx:97
virtual double InnerRadiusPlusZ() const
Return the innner radius at +z in mm.
Definition Cons.cxx:115
virtual ~Cons()
Definition Cons.cxx:88
static SolidMap * Instance()
Definition SolidMap.cxx:28
void AddSolid(VGM::ISolid *, G4VSolid *)
Definition SolidMap.cxx:59
BaseVGM utilities.
Definition utilities.h:23
ClhepVGM utilities.
Definition transform.h:29
VGM interfaces.
Definition VMedium.h:28