VGM Version 5.3
Loading...
Searching...
No Matches
Para.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 Para
14// ---------------
15// VGM implementation for Geant4 para solid.
16// If reflected, the parameters are changed as follows:
17// dx, dy, dz --> dx', dy', dz'
18// alpha -> alpha'
19// theta -> theta' = PI - theta
20// phi -> phi'
21//
22// Author: Ivana Hrivnacova; IPN Orsay
23
24#include "VGM/common/Math.h"
25
26#include "ClhepVGM/Units.h"
27
30
31#include "G4Para.hh"
32#include "G4ReflectedSolid.hh"
33
34//_____________________________________________________________________________
35Geant4GM::Para::Para(const std::string& name, double dx, double dy, double dz,
36 double alpha, double theta, double phi)
37 : VGM::ISolid(),
38 VGM::IPara(),
39 BaseVGM::VPara(),
40 fIsReflected(false),
41 fPara(new G4Para(name, dx / ClhepVGM::Units::Length(),
42 dy / ClhepVGM::Units::Length(), dz / ClhepVGM::Units::Length(),
43 alpha / ClhepVGM::Units::Angle(), theta / ClhepVGM::Units::Angle(),
44 phi / ClhepVGM::Units::Angle()))
45{
57
59}
60
61//_____________________________________________________________________________
62Geant4GM::Para::Para(G4Para* para, G4ReflectedSolid* reflPara)
63 : VGM::ISolid(),
64 VGM::IPara(),
65 BaseVGM::VPara(),
66 fIsReflected(false),
67 fPara(para)
68{
70
71 if (reflPara) {
72 fIsReflected = true;
73 Geant4GM::SolidMap::Instance()->AddSolid(this, reflPara);
74 }
75 else
77}
78
79//_____________________________________________________________________________
80Geant4GM::Para::Para() : VGM::ISolid(), VGM::IPara(), BaseVGM::VPara()
81{
83}
84
85//_____________________________________________________________________________
87 : VGM::ISolid(rhs), VGM::IPara(rhs), BaseVGM::VPara(rhs)
88{
90}
91
92//_____________________________________________________________________________
94{
95 //
96}
97
98//_____________________________________________________________________________
99std::string Geant4GM::Para::Name() const { return fPara->GetName(); }
100
101//_____________________________________________________________________________
103{
104 return fPara->GetXHalfLength() * ClhepVGM::Units::Length();
105}
106
107//_____________________________________________________________________________
109{
110 return fPara->GetYHalfLength() * ClhepVGM::Units::Length();
111}
112
113//_____________________________________________________________________________
115{
116 return fPara->GetZHalfLength() * ClhepVGM::Units::Length();
117}
118
119//_____________________________________________________________________________
121{
122 return atan(fPara->GetTanAlpha()) * ClhepVGM::Units::Angle();
123}
124
125//_____________________________________________________________________________
127{
128 if (!fIsReflected)
129 return fPara->GetSymAxis().theta() * ClhepVGM::Units::Angle();
130 else
131 return (M_PI - fPara->GetSymAxis().theta()) * ClhepVGM::Units::Angle();
132 ;
133}
134
135//_____________________________________________________________________________
137{
138 return fPara->GetSymAxis().phi() * ClhepVGM::Units::Angle();
139}
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 para solid.
Definition Para.h:33
virtual double YHalfLength() const
Return half-length along the y axis in mm.
Definition Para.cxx:108
virtual ~Para()
Definition Para.cxx:93
virtual double Phi() const
Return azimuthal angle of the line joining the centres of the faces at -hz and +hz in deg.
Definition Para.cxx:136
virtual double Theta() const
Return polar angle of the line joining the centres of the faces at -hz and +hz in deg.
Definition Para.cxx:126
virtual double XHalfLength() const
Return half-length along the x axis in mm.
Definition Para.cxx:102
virtual std::string Name() const
Return the name of this solid.
Definition Para.cxx:99
virtual double ZHalfLength() const
Return half-length along the z axis in mm.
Definition Para.cxx:114
virtual double Alpha() const
Return angle formed by the y axis and by the plane joining the centre of the faces parallel to the z-...
Definition Para.cxx:120
static SolidMap * Instance()
Definition SolidMap.cxx:28
void AddSolid(VGM::ISolid *, G4VSolid *)
Definition SolidMap.cxx:59
#define M_PI
Definition of math constant M_PI not available on Win32.
Definition Math.h:24
BaseVGM utilities.
Definition utilities.h:23
ClhepVGM utilities.
Definition transform.h:29
VGM interfaces.
Definition VMedium.h:28