VGM Version 5.3
Loading...
Searching...
No Matches
Tubs.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 Tubs
14// ---------------
15// VGM implementation for Geant4 tubs solid.
16//
17// Author: Ivana Hrivnacova; IPN Orsay
18
19#include "ClhepVGM/Units.h"
20
23
24#include "G4ReflectedSolid.hh"
25#include "G4Tubs.hh"
26
27//_____________________________________________________________________________
28Geant4GM::Tubs::Tubs(const std::string& name, double rin, double rout,
29 double hz, double sphi, double dphi)
30 : VGM::ISolid(),
31 VGM::ITubs(),
32 BaseVGM::VTubs(),
33 fTubs(new G4Tubs(name, rin / ClhepVGM::Units::Length(),
34 rout / ClhepVGM::Units::Length(), hz / ClhepVGM::Units::Length(),
35 sphi / ClhepVGM::Units::Angle(), dphi / ClhepVGM::Units::Angle()))
36{
43
45}
46
47//_____________________________________________________________________________
48Geant4GM::Tubs::Tubs(G4Tubs* tubs, G4ReflectedSolid* reflTubs)
49 : VGM::ISolid(), VGM::ITubs(), BaseVGM::VTubs(), fTubs(tubs)
50{
52
53 if (reflTubs)
54 Geant4GM::SolidMap::Instance()->AddSolid(this, reflTubs);
55 else
57}
58
59//_____________________________________________________________________________
60Geant4GM::Tubs::Tubs() : VGM::ISolid(), VGM::ITubs(), BaseVGM::VTubs()
61{
63}
64
65//_____________________________________________________________________________
67 : VGM::ISolid(rhs), VGM::ITubs(rhs), BaseVGM::VTubs(rhs)
68{
70}
71
72//_____________________________________________________________________________
74{
75 //
76}
77
78//_____________________________________________________________________________
79std::string Geant4GM::Tubs::Name() const { return fTubs->GetName(); }
80
81//_____________________________________________________________________________
83{
84 return fTubs->GetInnerRadius() * ClhepVGM::Units::Length();
85}
86
87//_____________________________________________________________________________
89{
90 return fTubs->GetOuterRadius() * ClhepVGM::Units::Length();
91}
92
93//_____________________________________________________________________________
95{
96 return fTubs->GetZHalfLength() * ClhepVGM::Units::Length();
97}
98
99//_____________________________________________________________________________
101{
102 return fTubs->GetStartPhiAngle() * ClhepVGM::Units::Angle();
103}
104
105//_____________________________________________________________________________
107{
108 return fTubs->GetDeltaPhiAngle() * ClhepVGM::Units::Angle();
109}
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
static SolidMap * Instance()
Definition SolidMap.cxx:28
void AddSolid(VGM::ISolid *, G4VSolid *)
Definition SolidMap.cxx:59
VGM implementation for Geant4 tubs solid.
Definition Tubs.h:36
virtual std::string Name() const
Return the name of this solid.
Definition Tubs.cxx:79
virtual double OuterRadius() const
Return the outside radius in mm.
Definition Tubs.cxx:88
virtual double DeltaPhi() const
Return the opening angle of the segment in deg.
Definition Tubs.cxx:106
virtual double ZHalfLength() const
Return the half-length along the z axis in m.
Definition Tubs.cxx:94
virtual double InnerRadius() const
Return the inside radius in mm.
Definition Tubs.cxx:82
virtual ~Tubs()
Definition Tubs.cxx:73
virtual double StartPhi() const
Return the starting angle of the segment in deg.
Definition Tubs.cxx:100
BaseVGM utilities.
Definition utilities.h:23
ClhepVGM utilities.
Definition transform.h:29
VGM interfaces.
Definition VMedium.h:28