Geant4_10
G4UCons.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id:$
28 //
29 //
30 // --------------------------------------------------------------------
31 // GEANT 4 class header file
32 //
33 // G4UCons
34 //
35 // Class description:
36 //
37 // Wrapper class for UCons to make use of UCons from USolids module.
38 
39 // History:
40 // 30.10.13 G.Cosmo, CERN/PH
41 // --------------------------------------------------------------------
42 
43 #ifndef G4UCONS_HH
44 #define G4UCONS_HH
45 
46 #include "G4USolid.hh"
47 #include "UCons.hh"
48 
49 class G4UCons : public G4USolid
50 {
51  public: // with description
52 
53  G4UCons(const G4String& pName,
54  G4double pRmin1, G4double pRmax1,
55  G4double pRmin2, G4double pRmax2,
56  G4double pDz,
57  G4double pSPhi, G4double pDPhi);
58  // Constructs a cone with the given name and dimensions
59 
60  ~G4UCons();
61 
63  const G4int n,
64  const G4VPhysicalVolume* pRep );
65 
66  inline UCons* GetShape() const;
67 
68  inline G4double GetInnerRadiusMinusZ() const;
69  inline G4double GetOuterRadiusMinusZ() const;
70  inline G4double GetInnerRadiusPlusZ() const;
71  inline G4double GetOuterRadiusPlusZ() const;
72  inline G4double GetZHalfLength() const;
73  inline G4double GetStartPhiAngle() const;
74  inline G4double GetDeltaPhiAngle() const;
75 
76  inline void SetInnerRadiusMinusZ (G4double Rmin1 );
77  inline void SetOuterRadiusMinusZ (G4double Rmax1 );
78  inline void SetInnerRadiusPlusZ (G4double Rmin2 );
79  inline void SetOuterRadiusPlusZ (G4double Rmax2 );
80  inline void SetZHalfLength (G4double newDz );
81  inline void SetStartPhiAngle (G4double newSPhi, G4bool trig=true);
82  inline void SetDeltaPhiAngle (G4double newDPhi);
83 
84  public: // without description
85 
86  G4UCons(__void__&);
87  // Fake default constructor for usage restricted to direct object
88  // persistency for clients requiring preallocation of memory for
89  // persistifiable objects.
90 
91  G4UCons(const G4UCons& rhs);
92  G4UCons& operator=(const G4UCons& rhs);
93  // Copy constructor and assignment operator.
94 };
95 
96 // --------------------------------------------------------------------
97 // Inline methods
98 // --------------------------------------------------------------------
99 
100 inline UCons* G4UCons::GetShape() const
101 {
102  return (UCons*) fShape;
103 }
104 
106 {
107  return GetShape()->GetInnerRadiusMinusZ();
108 }
110 {
111  return GetShape()->GetOuterRadiusMinusZ();
112 }
114 {
115  return GetShape()->GetInnerRadiusPlusZ();
116 }
118 {
119  return GetShape()->GetOuterRadiusPlusZ();
120 }
122 {
123  return GetShape()->GetZHalfLength();
124 }
126 {
127  return GetShape()->GetStartPhiAngle();
128 }
130 {
131  return GetShape()->GetDeltaPhiAngle();
132 }
133 
135 {
136  GetShape()->SetInnerRadiusMinusZ(Rmin1);
137  ResetPolyhedron();
138 }
140 {
141  GetShape()->SetOuterRadiusMinusZ(Rmax1);
142  ResetPolyhedron();
143 }
145 {
146  GetShape()->SetInnerRadiusPlusZ(Rmin2);
147  ResetPolyhedron();
148 }
150 {
151  GetShape()->SetOuterRadiusPlusZ(Rmax2);
152  ResetPolyhedron();
153 }
155 {
156  GetShape()->SetZHalfLength(newDz);
157  ResetPolyhedron();
158 }
159 inline void G4UCons::SetStartPhiAngle(G4double newSPhi, G4bool trig)
160 {
161  GetShape()->SetStartPhiAngle(newSPhi, trig);
162  ResetPolyhedron();
163 }
165 {
166  GetShape()->SetDeltaPhiAngle(newDPhi);
167  ResetPolyhedron();
168 }
169 
170 #endif
void SetDeltaPhiAngle(G4double newDPhi)
Definition: G4UCons.hh:164
void SetZHalfLength(double newDz)
void SetOuterRadiusMinusZ(double Rmax1)
void SetZHalfLength(G4double newDz)
Definition: G4UCons.hh:154
G4UCons & operator=(const G4UCons &rhs)
Definition: G4UCons.cc:83
const char * p
Definition: xmltok.h:285
void SetStartPhiAngle(G4double newSPhi, G4bool trig=true)
Definition: G4UCons.hh:159
G4double GetDeltaPhiAngle() const
Definition: G4UCons.hh:129
UCons * GetShape() const
Definition: G4UCons.hh:100
double GetOuterRadiusPlusZ() const
int G4int
Definition: G4Types.hh:78
Definition: UCons.hh:49
void SetDeltaPhiAngle(double newDPhi)
G4double GetOuterRadiusMinusZ() const
Definition: G4UCons.hh:109
Char_t n[5]
double GetStartPhiAngle() const
VUSolid * fShape
Definition: G4USolid.hh:176
~G4UCons()
Definition: G4UCons.cc:66
bool G4bool
Definition: G4Types.hh:79
double GetZHalfLength() const
G4double GetZHalfLength() const
Definition: G4UCons.hh:121
void SetOuterRadiusMinusZ(G4double Rmax1)
Definition: G4UCons.hh:139
void SetInnerRadiusMinusZ(G4double Rmin1)
Definition: G4UCons.hh:134
G4double GetStartPhiAngle() const
Definition: G4UCons.hh:125
G4double GetInnerRadiusMinusZ() const
Definition: G4UCons.hh:105
void SetInnerRadiusPlusZ(G4double Rmin2)
Definition: G4UCons.hh:144
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
Definition: G4UCons.cc:101
double GetInnerRadiusPlusZ() const
G4UCons(const G4String &pName, G4double pRmin1, G4double pRmax1, G4double pRmin2, G4double pRmax2, G4double pDz, G4double pSPhi, G4double pDPhi)
Definition: G4UCons.cc:42
G4double GetInnerRadiusPlusZ() const
Definition: G4UCons.hh:113
double GetOuterRadiusMinusZ() const
void SetOuterRadiusPlusZ(G4double Rmax2)
Definition: G4UCons.hh:149
virtual void ResetPolyhedron() const
Definition: G4USolid.cc:536
void SetInnerRadiusPlusZ(double Rmin2)
double GetDeltaPhiAngle() const
double GetInnerRadiusMinusZ() const
void SetOuterRadiusPlusZ(double Rmax2)
void SetInnerRadiusMinusZ(double Rmin1)
double G4double
Definition: G4Types.hh:76
G4double GetOuterRadiusPlusZ() const
Definition: G4UCons.hh:117
void SetStartPhiAngle(double newSPhi, bool trig=true)