Geant4
9.6.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4_9_6_p02
source
persistency
ascii
src
G4tgrPlaceDivRep.cc
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: G4tgrPlaceDivRep.cc 69803 2013-05-15 15:24:50Z gcosmo $
28
//
29
//
30
// class G4tgrPlaceDivRep
31
32
// History:
33
// - Created. P.Arce, CIEMAT (November 2007)
34
// -------------------------------------------------------------------------
35
36
#include "
G4tgrPlaceDivRep.hh
"
37
38
#include "
G4SystemOfUnits.hh
"
39
#include "
G4tgrUtils.hh
"
40
#include "
G4tgrMessenger.hh
"
41
#include "
G4tgrVolume.hh
"
42
43
//-------------------------------------------------------------
44
G4tgrPlaceDivRep::G4tgrPlaceDivRep
()
45
: theNDiv(0), theWidth(0.), theAxis(
kUndefined
),
46
theOffset(0.), theDivType(
DivByNdivAndWidth
)
47
{
48
}
49
50
51
//-------------------------------------------------------------
52
G4tgrPlaceDivRep::~G4tgrPlaceDivRep
()
53
{
54
}
55
56
//-------------------------------------------------------------
57
G4tgrPlaceDivRep::G4tgrPlaceDivRep
(
const
std::vector<G4String>& wl )
58
{
59
theDivType =
DivByNdivAndWidth
;
60
61
// Name parent axis nrep width offset
62
G4tgrUtils::CheckWLsize
( wl, 6,
WLSIZE_GE
,
63
"G4tgrPlaceDivRep::G4tgrPlaceDivRep"
);
64
G4tgrUtils::CheckWLsize
( wl, 7,
WLSIZE_LE
,
65
"G4tgrPlaceDivRep::G4tgrPlaceDivRep"
);
66
67
theParentName
=
G4tgrUtils::GetString
(wl[2]);
68
theAxis =
BuildAxis
(
G4tgrUtils::GetString
(wl[3]) );
69
theNDiv =
G4tgrUtils::GetInt
( wl[4] );
70
theWidth =
G4tgrUtils::GetDouble
(wl[5])*
mm
;
// check if it is deg
71
if
( wl.size() == 7 )
72
{
73
theOffset =
G4tgrUtils::GetDouble
(wl[6])*
mm
;
// check if it is deg
74
}
75
else
76
{
77
theOffset = 0.;
78
}
79
80
#ifdef G4VERBOSE
81
if
(
G4tgrMessenger::GetVerboseLevel
() >= 1 )
82
{
83
G4cout
<<
" Created "
<< *
this
<<
G4endl
;
84
}
85
#endif
86
87
}
88
89
90
//-------------------------------------------------------------
91
EAxis
G4tgrPlaceDivRep::BuildAxis
(
const
G4String
& axisName )
92
{
93
if
( axisName ==
"X"
) {
94
return
kXAxis
;
95
}
else
if
( axisName ==
"Y"
) {
96
return
kYAxis
;
97
}
else
if
( axisName ==
"Z"
) {
98
return
kZAxis
;
99
}
else
if
( axisName ==
"R"
) {
100
return
kRho
;
101
}
else
if
( axisName ==
"PHI"
) {
102
return
kPhi
;
103
}
104
else
105
{
106
G4String
ErrMessage =
"Axis type not found: "
+ axisName
107
+
". Only valid axis are: X, Y, Z, R, PHI !"
;
108
G4Exception
(
"G4tgrVolumeDivision::GetReplicaAxis()"
,
109
"InvalidAxis"
,
FatalException
, ErrMessage);
110
}
111
return
kXAxis
;
// to avoid warning errors
112
}
113
114
115
// -------------------------------------------------------------------------
116
std::ostream&
operator<<
(std::ostream& os,
const
G4tgrPlaceDivRep
& obj)
117
{
118
os <<
"G4tgrPlaceDivRep= in "
<< obj.
theParentName
119
<<
" NDiv= "
<< obj.theNDiv <<
" Width= "
<< obj.theWidth
120
<<
" Axis= "
<< obj.theAxis <<
" Offset= "
<< obj.theOffset
121
<<
" DivType= "
<< obj.theDivType <<
G4endl
;
122
123
return
os;
124
}
Generated on Sat May 25 2013 14:33:24 for Geant4 by
1.8.4