Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4tgbPlaceParamLinear Class Reference

#include <G4tgbPlaceParamLinear.hh>

+ Inheritance diagram for G4tgbPlaceParamLinear:

Public Member Functions

 G4tgbPlaceParamLinear (G4tgrPlaceParameterisation *)
 
 ~G4tgbPlaceParamLinear ()
 
void ComputeTransformation (const G4int copyNo, G4VPhysicalVolume *physVol) const
 
- Public Member Functions inherited from G4tgbPlaceParameterisation
 G4tgbPlaceParameterisation (G4tgrPlaceParameterisation *tgrParam)
 
virtual ~G4tgbPlaceParameterisation ()
 
virtual void ComputeTransformation (const G4int, G4VPhysicalVolume *) const
 
void CheckNExtraData (G4tgrPlaceParameterisation *tgrParam, G4int nWcheck, WLSIZEtype st, const G4String &methodName)
 
G4int GetNCopies () const
 
EAxis GetAxis () const
 
- Public Member Functions inherited from G4VPVParameterisation
 G4VPVParameterisation ()=default
 
virtual ~G4VPVParameterisation ()=default
 
virtual void ComputeTransformation (const G4int, G4VPhysicalVolume *) const =0
 
virtual G4VSolidComputeSolid (const G4int, G4VPhysicalVolume *)
 
virtual G4MaterialComputeMaterial (const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=nullptr)
 
virtual G4bool IsNested () const
 
virtual G4VVolumeMaterialScannerGetMaterialScanner ()
 
virtual void ComputeDimensions (G4Box &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Tubs &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Trd &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Trap &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Cons &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Sphere &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Orb &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Ellipsoid &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Torus &, 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 (G4Hype &, const G4int, const G4VPhysicalVolume *) const
 

Additional Inherited Members

- Protected Attributes inherited from G4tgbPlaceParameterisation
G4int theNCopies = 0
 
EAxis theAxis = kUndefined
 
G4ThreeVector theTranslation
 
G4RotationMatrixtheRotationMatrix = nullptr
 

Detailed Description

Definition at line 45 of file G4tgbPlaceParamLinear.hh.

Constructor & Destructor Documentation

◆ G4tgbPlaceParamLinear()

G4tgbPlaceParamLinear::G4tgbPlaceParamLinear ( G4tgrPlaceParameterisation tgrParam)

Definition at line 43 of file G4tgbPlaceParamLinear.cc.

46{
47 //---- Get translation and rotation
48 if(tgrParam->GetParamType() == "LINEAR")
49 {
50 CheckNExtraData(tgrParam, 6, WLSIZE_EQ, "G4tgbPlaceParamLinear:");
51 theDirection =
52 G4ThreeVector(tgrParam->GetExtraData()[3], tgrParam->GetExtraData()[4],
53 tgrParam->GetExtraData()[5]);
55 }
56 else
57 {
58 CheckNExtraData(tgrParam, 3, WLSIZE_EQ, "G4tgbPlaceParamLinear:");
59 if(tgrParam->GetParamType() == "LINEAR_X")
60 {
61 theDirection = G4ThreeVector(1., 0., 0.);
63 }
64 else if(tgrParam->GetParamType() == "LINEAR_Y")
65 {
66 theDirection = G4ThreeVector(0., 1., 0.);
68 }
69 else if(tgrParam->GetParamType() == "LINEAR_Z")
70 {
71 theDirection = G4ThreeVector(0., 0., 1.);
73 }
74 }
75
76 if(theDirection.mag() == 0.)
77 {
78 G4Exception("G4tgbPlaceParamLinear::G4tgbPlaceParamLinear()",
79 "InvalidSetup", FatalException, "Direction is zero !");
80 }
81 else
82 {
83 theDirection /= theDirection.mag();
84 }
85
86 theNCopies = G4int(tgrParam->GetExtraData()[0]);
87 theStep = tgrParam->GetExtraData()[1];
88 theOffset = tgrParam->GetExtraData()[2];
89
90 theTranslation = G4ThreeVector(0., 0., 0.) + theOffset * theDirection;
91
92#ifdef G4VERBOSE
94 {
95 G4cout << " G4tgbPlaceParamLinear::G4tgbPlaceParamLinear(): "
96 << " param type " << tgrParam->GetParamType() << G4endl
97 << " N copies " << theNCopies << G4endl << " step " << theStep
98 << G4endl << " offset " << theOffset << G4endl << " translation "
99 << theTranslation << G4endl << " direction " << theDirection
100 << G4endl << " axis " << theAxis << G4endl;
101 }
102#endif
103}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
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
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

◆ ~G4tgbPlaceParamLinear()

G4tgbPlaceParamLinear::~G4tgbPlaceParamLinear ( )

Definition at line 38 of file G4tgbPlaceParamLinear.cc.

39{
40}

Member Function Documentation

◆ ComputeTransformation()

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

Reimplemented from G4tgbPlaceParameterisation.

Definition at line 106 of file G4tgbPlaceParamLinear.cc.

108{
109 G4ThreeVector origin = theTranslation + copyNo * theStep * theDirection;
110
111#ifdef G4VERBOSE
113 {
114 G4cout << " G4tgbPlaceParamLinear::ComputeTransformation() -"
115 << physVol->GetName() << G4endl << " copyNo " << copyNo << " pos "
116 << origin << G4endl;
117 }
118#endif
119 //----- Set traslation and rotation
120 physVol->SetTranslation(origin);
121 physVol->SetCopyNo(copyNo);
123}
virtual void SetCopyNo(G4int CopyNo)=0
const G4String & GetName() const
void SetTranslation(const G4ThreeVector &v)
void SetRotation(G4RotationMatrix *)

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