Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4tgbPlaceParamSquare Class Reference

#include <G4tgbPlaceParamSquare.hh>

Inheritance diagram for G4tgbPlaceParamSquare:
Collaboration diagram for G4tgbPlaceParamSquare:

Public Member Functions

 G4tgbPlaceParamSquare (G4tgrPlaceParameterisation *)
 
 ~G4tgbPlaceParamSquare ()
 
void ComputeTransformation (const G4int copyNo, G4VPhysicalVolume *physVol) const
 
- Public Member Functions inherited from G4tgbPlaceParameterisation
 G4tgbPlaceParameterisation (G4tgrPlaceParameterisation *tgrParam)
 
virtual ~G4tgbPlaceParameterisation ()
 
void CheckNExtraData (G4tgrPlaceParameterisation *tgrParam, G4int nWcheck, WLSIZEtype st, const G4String &methodName)
 
G4int GetNCopies () const
 
EAxis GetAxis () const
 
- Public Member Functions inherited from G4VPVParameterisation
 G4VPVParameterisation ()
 
virtual ~G4VPVParameterisation ()
 
virtual G4VSolidComputeSolid (const G4int, G4VPhysicalVolume *)
 
virtual G4MaterialComputeMaterial (const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=0)
 
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
 
EAxis theAxis
 
G4ThreeVector theTranslation
 
G4RotationMatrixtheRotationMatrix
 

Detailed Description

Definition at line 49 of file G4tgbPlaceParamSquare.hh.

Constructor & Destructor Documentation

G4tgbPlaceParamSquare::G4tgbPlaceParamSquare ( G4tgrPlaceParameterisation tgrParam)

Definition at line 50 of file G4tgbPlaceParamSquare.cc.

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

Here is the call graph for this function:

G4tgbPlaceParamSquare::~G4tgbPlaceParamSquare ( )

Definition at line 43 of file G4tgbPlaceParamSquare.cc.

44 {
45 }

Member Function Documentation

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

Reimplemented from G4tgbPlaceParameterisation.

Definition at line 135 of file G4tgbPlaceParamSquare.cc.

136 {
137 #ifdef G4VERBOSE
139  {
140  G4cout << " G4tgbPlaceParamSquare::ComputeTransformation():"
141  << physVol->GetName() << G4endl
142  << " no copies " << theNCopies << G4endl
143  << " offset1 " << theOffset1 << G4endl
144  << " offset2 " << theOffset2 << G4endl
145  << " step1 " << theStep1 << G4endl
146  << " step2 " << theStep2 << G4endl;
147  }
148 #endif
149 
150  G4int copyNo1 = copyNo%theNCopies1;
151  G4int copyNo2 = G4int(copyNo/theNCopies1);
152  G4double posi1 = copyNo1*theStep1;
153  G4double posi2 = copyNo2*theStep2;
154  G4ThreeVector origin = posi1*theDirection1+ posi2*theDirection2;
155  origin += theTranslation;
156 
157 #ifdef G4VERBOSE
159  {
160  G4cout << " G4tgbPlaceParamSquare::ComputeTransformation() - "
161  << copyNo << " = " << copyNo1 << ", X " << copyNo2 << G4endl
162  << " pos: " << origin << ", axis: " << theAxis << G4endl;
163  }
164 #endif
165  //----- Set traslation and rotation
166  physVol->SetTranslation(origin);
167  physVol->SetCopyNo( copyNo );
168  physVol->SetRotation( theRotationMatrix );
169 }
int G4int
Definition: G4Types.hh:78
void SetRotation(G4RotationMatrix *)
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
static G4int GetVerboseLevel()
virtual void SetCopyNo(G4int CopyNo)=0
void SetTranslation(const G4ThreeVector &v)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:


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