Geant4-11
Public Member Functions | Protected Attributes | Private Attributes
G4tgbPlaceParamSquare Class Reference

#include <G4tgbPlaceParamSquare.hh>

Inheritance diagram for G4tgbPlaceParamSquare:
G4tgbPlaceParameterisation G4VPVParameterisation

Public Member Functions

void CheckNExtraData (G4tgrPlaceParameterisation *tgrParam, G4int nWcheck, WLSIZEtype st, const G4String &methodName)
 
virtual void ComputeDimensions (G4Box &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Cons &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Ellipsoid &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Hype &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Orb &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Para &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Polycone &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Polyhedra &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Sphere &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Torus &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Trap &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Trd &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Tubs &, const G4int, const G4VPhysicalVolume *) const
 
virtual G4MaterialComputeMaterial (const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=nullptr)
 
virtual G4VSolidComputeSolid (const G4int, G4VPhysicalVolume *)
 
void ComputeTransformation (const G4int copyNo, G4VPhysicalVolume *physVol) const
 
 G4tgbPlaceParamSquare (G4tgrPlaceParameterisation *)
 
EAxis GetAxis () const
 
virtual G4VVolumeMaterialScannerGetMaterialScanner ()
 
G4int GetNCopies () const
 
virtual G4bool IsNested () const
 
 ~G4tgbPlaceParamSquare ()
 

Protected Attributes

EAxis theAxis = kUndefined
 
G4int theNCopies = 0
 
G4RotationMatrixtheRotationMatrix = nullptr
 
G4ThreeVector theTranslation
 

Private Attributes

G4ThreeVector theDirection1
 
G4ThreeVector theDirection2
 
G4int theNCopies1 = 0
 
G4int theNCopies2 = 0
 
G4double theOffset1 = 0.0
 
G4double theOffset2 = 0.0
 
G4double theStep1 = 0.0
 
G4double theStep2 = 0.0
 

Detailed Description

Definition at line 43 of file G4tgbPlaceParamSquare.hh.

Constructor & Destructor Documentation

◆ G4tgbPlaceParamSquare()

G4tgbPlaceParamSquare::G4tgbPlaceParamSquare ( G4tgrPlaceParameterisation tgrParam)

Definition at line 43 of file G4tgbPlaceParamSquare.cc.

46{
47 //---- Get translation and rotation
48 if(tgrParam->GetParamType() == "SQUARE")
49 {
50 CheckNExtraData(tgrParam, 12, WLSIZE_EQ, "G4tgbPlaceParamSquare:");
52 G4ThreeVector(tgrParam->GetExtraData()[6], tgrParam->GetExtraData()[7],
53 tgrParam->GetExtraData()[8]);
55 G4ThreeVector(tgrParam->GetExtraData()[9], tgrParam->GetExtraData()[10],
56 tgrParam->GetExtraData()[11]);
58 }
59 else
60 {
61 CheckNExtraData(tgrParam, 6, WLSIZE_EQ, "G4tgbPlaceParamSquare:");
62 if(tgrParam->GetParamType() == "SQUARE_XY")
63 {
64 theDirection1 = G4ThreeVector(1., 0., 0.);
65 theDirection2 = G4ThreeVector(0., 1., 0.);
67 }
68 else if(tgrParam->GetParamType() == "SQUARE_YZ")
69 {
70 theDirection1 = G4ThreeVector(0., 1., 0.);
71 theDirection2 = G4ThreeVector(0., 0., 1.);
73 }
74 else if(tgrParam->GetParamType() == "SQUARE_XZ")
75 {
76 theDirection1 = G4ThreeVector(1., 0., 0.);
77 theDirection2 = G4ThreeVector(0., 0., 1.);
79 }
80 }
81
82 if(theDirection1.mag() == 0.)
83 {
84 G4Exception("G4tgbPlaceParamSquare::G4tgbPlaceParamSquare()",
85 "InvalidSetup", FatalException, "Direction1 is zero !");
86 }
87 else
88 {
90 }
91 if(theDirection2.mag() == 0.)
92 {
93 G4Exception("G4tgbPlaceParamSquare::G4tgbPlaceParamSquare()",
94 "InvalidSetup", FatalException, "Direction2 is zero !");
95 }
96 else
97 {
99 }
100
101 theNCopies1 = G4int(tgrParam->GetExtraData()[0]);
102 theNCopies2 = G4int(tgrParam->GetExtraData()[1]);
103 theStep1 = tgrParam->GetExtraData()[2];
104 theStep2 = tgrParam->GetExtraData()[3];
105 theOffset1 = tgrParam->GetExtraData()[4];
106 theOffset2 = tgrParam->GetExtraData()[5];
107
110
111#ifdef G4VERBOSE
113 G4cout << "G4tgbPlaceParamSquare: no copies " << theNCopies << " = "
114 << theNCopies1 << " X " << theNCopies2 << G4endl << " offset1 "
115 << theOffset1 << G4endl << " offset2 " << theOffset1 << G4endl
116 << " step1 " << theStep1 << G4endl << " step2 " << theStep2 << G4endl
117 << " direction1 " << theDirection1 << G4endl << " direction2 "
118 << theDirection2 << G4endl << " translation " << theTranslation
119 << G4endl;
120#endif
121}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
CLHEP::Hep3Vector G4ThreeVector
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
@ WLSIZE_EQ
Definition: G4tgrUtils.hh:47
double mag() const
G4tgbPlaceParameterisation(G4tgrPlaceParameterisation *tgrParam)
void CheckNExtraData(G4tgrPlaceParameterisation *tgrParam, G4int nWcheck, WLSIZEtype st, const G4String &methodName)
static G4int GetVerboseLevel()
std::vector< G4double > GetExtraData() const
const G4String & GetParamType() const
@ kYAxis
Definition: geomdefs.hh:56
@ kXAxis
Definition: geomdefs.hh:55
@ kZAxis
Definition: geomdefs.hh:57

References G4tgbPlaceParameterisation::CheckNExtraData(), FatalException, G4cout, G4endl, G4Exception(), G4tgrPlaceParameterisation::GetExtraData(), G4tgrPlaceParameterisation::GetParamType(), G4tgrMessenger::GetVerboseLevel(), kXAxis, kYAxis, kZAxis, CLHEP::Hep3Vector::mag(), G4tgbPlaceParameterisation::theAxis, theDirection1, theDirection2, G4tgbPlaceParameterisation::theNCopies, theNCopies1, theNCopies2, theOffset1, theOffset2, theStep1, theStep2, G4tgbPlaceParameterisation::theTranslation, and WLSIZE_EQ.

◆ ~G4tgbPlaceParamSquare()

G4tgbPlaceParamSquare::~G4tgbPlaceParamSquare ( )

Definition at line 38 of file G4tgbPlaceParamSquare.cc.

39{
40}

Member Function Documentation

◆ CheckNExtraData()

void G4tgbPlaceParameterisation::CheckNExtraData ( G4tgrPlaceParameterisation tgrParam,
G4int  nWcheck,
WLSIZEtype  st,
const G4String methodName 
)
inherited

Definition at line 61 of file G4tgbPlaceParameterisation.cc.

64{
65 std::vector<G4double> extraData = tgrParam->GetExtraData();
66 G4int ndata = extraData.size();
67
68 G4String outStr = methodName + " " + tgrParam->GetType() + " ";
69 G4bool isOK = G4tgrUtils::CheckListSize(ndata, nWcheck, st, outStr);
70
71 if(!isOK)
72 {
73 G4String chartmp = G4UIcommand::ConvertToString(nWcheck);
74 outStr += chartmp + G4String(" words");
75 G4cerr << outStr;
76 G4cerr << " NUMBER OF WORDS " << ndata << G4endl;
77 G4Exception("G4tgbPlaceParameterisation::CheckNExtraData", "InvalidData",
78 FatalException, "Invalid data size.");
79 }
80}
bool G4bool
Definition: G4Types.hh:86
G4GLOB_DLL std::ostream G4cerr
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:445
const G4String & GetType() const
Definition: G4tgrPlace.hh:55
static G4bool CheckListSize(unsigned int nWreal, unsigned int nWcheck, WLSIZEtype st, G4String &outstr)
Definition: G4tgrUtils.cc:512

References G4tgrUtils::CheckListSize(), G4UIcommand::ConvertToString(), FatalException, G4cerr, G4endl, G4Exception(), G4tgrPlaceParameterisation::GetExtraData(), and G4tgrPlace::GetType().

Referenced by G4tgbPlaceParamCircle::G4tgbPlaceParamCircle(), G4tgbPlaceParamLinear::G4tgbPlaceParamLinear(), and G4tgbPlaceParamSquare().

◆ ComputeDimensions() [1/13]

virtual void G4VPVParameterisation::ComputeDimensions ( G4Box ,
const  G4int,
const G4VPhysicalVolume  
) const
inlinevirtualinherited

◆ ComputeDimensions() [2/13]

virtual void G4VPVParameterisation::ComputeDimensions ( G4Cons ,
const  G4int,
const G4VPhysicalVolume  
) const
inlinevirtualinherited

◆ ComputeDimensions() [3/13]

virtual void G4VPVParameterisation::ComputeDimensions ( G4Ellipsoid ,
const  G4int,
const G4VPhysicalVolume  
) const
inlinevirtualinherited

◆ ComputeDimensions() [4/13]

virtual void G4VPVParameterisation::ComputeDimensions ( G4Hype ,
const  G4int,
const G4VPhysicalVolume  
) const
inlinevirtualinherited

◆ ComputeDimensions() [5/13]

virtual void G4VPVParameterisation::ComputeDimensions ( G4Orb ,
const  G4int,
const G4VPhysicalVolume  
) const
inlinevirtualinherited

◆ ComputeDimensions() [6/13]

virtual void G4VPVParameterisation::ComputeDimensions ( G4Para ,
const  G4int,
const G4VPhysicalVolume  
) const
inlinevirtualinherited

◆ ComputeDimensions() [7/13]

virtual void G4VPVParameterisation::ComputeDimensions ( G4Polycone ,
const  G4int,
const G4VPhysicalVolume  
) const
inlinevirtualinherited

◆ ComputeDimensions() [8/13]

virtual void G4VPVParameterisation::ComputeDimensions ( G4Polyhedra ,
const  G4int,
const G4VPhysicalVolume  
) const
inlinevirtualinherited

◆ ComputeDimensions() [9/13]

virtual void G4VPVParameterisation::ComputeDimensions ( G4Sphere ,
const  G4int,
const G4VPhysicalVolume  
) const
inlinevirtualinherited

◆ ComputeDimensions() [10/13]

virtual void G4VPVParameterisation::ComputeDimensions ( G4Torus ,
const  G4int,
const G4VPhysicalVolume  
) const
inlinevirtualinherited

◆ ComputeDimensions() [11/13]

virtual void G4VPVParameterisation::ComputeDimensions ( G4Trap ,
const  G4int,
const G4VPhysicalVolume  
) const
inlinevirtualinherited

◆ ComputeDimensions() [12/13]

virtual void G4VPVParameterisation::ComputeDimensions ( G4Trd ,
const  G4int,
const G4VPhysicalVolume  
) const
inlinevirtualinherited

◆ ComputeDimensions() [13/13]

virtual void G4VPVParameterisation::ComputeDimensions ( G4Tubs ,
const  G4int,
const G4VPhysicalVolume  
) const
inlinevirtualinherited

◆ ComputeMaterial()

G4Material * G4VPVParameterisation::ComputeMaterial ( const G4int  repNo,
G4VPhysicalVolume currentVol,
const G4VTouchable parentTouch = nullptr 
)
virtualinherited

◆ ComputeSolid()

G4VSolid * G4VPVParameterisation::ComputeSolid ( const  G4int,
G4VPhysicalVolume pPhysicalVol 
)
virtualinherited

◆ ComputeTransformation()

void G4tgbPlaceParamSquare::ComputeTransformation ( const G4int  copyNo,
G4VPhysicalVolume physVol 
) const
virtual

Reimplemented from G4tgbPlaceParameterisation.

Definition at line 124 of file G4tgbPlaceParamSquare.cc.

126{
127#ifdef G4VERBOSE
129 {
130 G4cout << " G4tgbPlaceParamSquare::ComputeTransformation():"
131 << physVol->GetName() << G4endl << " no copies " << theNCopies
132 << G4endl << " offset1 " << theOffset1 << G4endl << " offset2 "
133 << theOffset2 << G4endl << " step1 " << theStep1 << G4endl
134 << " step2 " << theStep2 << G4endl;
135 }
136#endif
137
138 G4int copyNo1 = copyNo % theNCopies1;
139 G4int copyNo2 = G4int(copyNo / theNCopies1);
140 G4double posi1 = copyNo1 * theStep1;
141 G4double posi2 = copyNo2 * theStep2;
142 G4ThreeVector origin = posi1 * theDirection1 + posi2 * theDirection2;
143 origin += theTranslation;
144
145#ifdef G4VERBOSE
147 {
148 G4cout << " G4tgbPlaceParamSquare::ComputeTransformation() - " << copyNo
149 << " = " << copyNo1 << ", X " << copyNo2 << G4endl
150 << " pos: " << origin << ", axis: " << theAxis << G4endl;
151 }
152#endif
153 //----- Set traslation and rotation
154 physVol->SetTranslation(origin);
155 physVol->SetCopyNo(copyNo);
157}
double G4double
Definition: G4Types.hh:83
virtual void SetCopyNo(G4int CopyNo)=0
const G4String & GetName() const
void SetTranslation(const G4ThreeVector &v)
void SetRotation(G4RotationMatrix *)

References G4cout, G4endl, G4VPhysicalVolume::GetName(), G4tgrMessenger::GetVerboseLevel(), G4VPhysicalVolume::SetCopyNo(), G4VPhysicalVolume::SetRotation(), G4VPhysicalVolume::SetTranslation(), G4tgbPlaceParameterisation::theAxis, theDirection1, theDirection2, G4tgbPlaceParameterisation::theNCopies, theNCopies1, theOffset1, theOffset2, G4tgbPlaceParameterisation::theRotationMatrix, theStep1, theStep2, and G4tgbPlaceParameterisation::theTranslation.

◆ GetAxis()

EAxis G4tgbPlaceParameterisation::GetAxis ( ) const
inlineinherited

Definition at line 60 of file G4tgbPlaceParameterisation.hh.

60{ return theAxis; }

References G4tgbPlaceParameterisation::theAxis.

Referenced by G4tgbVolume::ConstructG4PhysVol().

◆ GetMaterialScanner()

G4VVolumeMaterialScanner * G4VPVParameterisation::GetMaterialScanner ( )
virtualinherited

Reimplemented in G4VNestedParameterisation.

Definition at line 62 of file G4VPVParameterisation.cc.

63{
64 return nullptr;
65}

Referenced by G4Region::ScanVolumeTree().

◆ GetNCopies()

G4int G4tgbPlaceParameterisation::GetNCopies ( ) const
inlineinherited

Definition at line 59 of file G4tgbPlaceParameterisation.hh.

59{ return theNCopies; }

References G4tgbPlaceParameterisation::theNCopies.

Referenced by G4tgbVolume::ConstructG4PhysVol().

◆ IsNested()

G4bool G4VPVParameterisation::IsNested ( ) const
virtualinherited

Field Documentation

◆ theAxis

EAxis G4tgbPlaceParameterisation::theAxis = kUndefined
protectedinherited

◆ theDirection1

G4ThreeVector G4tgbPlaceParamSquare::theDirection1
private

Definition at line 57 of file G4tgbPlaceParamSquare.hh.

Referenced by ComputeTransformation(), and G4tgbPlaceParamSquare().

◆ theDirection2

G4ThreeVector G4tgbPlaceParamSquare::theDirection2
private

Definition at line 58 of file G4tgbPlaceParamSquare.hh.

Referenced by ComputeTransformation(), and G4tgbPlaceParamSquare().

◆ theNCopies

G4int G4tgbPlaceParameterisation::theNCopies = 0
protectedinherited

◆ theNCopies1

G4int G4tgbPlaceParamSquare::theNCopies1 = 0
private

Definition at line 55 of file G4tgbPlaceParamSquare.hh.

Referenced by ComputeTransformation(), and G4tgbPlaceParamSquare().

◆ theNCopies2

G4int G4tgbPlaceParamSquare::theNCopies2 = 0
private

Definition at line 56 of file G4tgbPlaceParamSquare.hh.

Referenced by G4tgbPlaceParamSquare().

◆ theOffset1

G4double G4tgbPlaceParamSquare::theOffset1 = 0.0
private

Definition at line 61 of file G4tgbPlaceParamSquare.hh.

Referenced by ComputeTransformation(), and G4tgbPlaceParamSquare().

◆ theOffset2

G4double G4tgbPlaceParamSquare::theOffset2 = 0.0
private

Definition at line 62 of file G4tgbPlaceParamSquare.hh.

Referenced by ComputeTransformation(), and G4tgbPlaceParamSquare().

◆ theRotationMatrix

G4RotationMatrix* G4tgbPlaceParameterisation::theRotationMatrix = nullptr
protectedinherited

◆ theStep1

G4double G4tgbPlaceParamSquare::theStep1 = 0.0
private

Definition at line 59 of file G4tgbPlaceParamSquare.hh.

Referenced by ComputeTransformation(), and G4tgbPlaceParamSquare().

◆ theStep2

G4double G4tgbPlaceParamSquare::theStep2 = 0.0
private

Definition at line 60 of file G4tgbPlaceParamSquare.hh.

Referenced by ComputeTransformation(), and G4tgbPlaceParamSquare().

◆ theTranslation

G4ThreeVector G4tgbPlaceParameterisation::theTranslation
protectedinherited

The documentation for this class was generated from the following files: