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]);
61 CheckNExtraData(tgrParam, 6, WLSIZE_EQ,
"G4tgbPlaceParamSquare:");
62 if(tgrParam->GetParamType() ==
"SQUARE_XY")
64 theDirection1 = G4ThreeVector(1., 0., 0.);
65 theDirection2 = G4ThreeVector(0., 1., 0.);
70 theDirection1 = G4ThreeVector(0., 1., 0.);
71 theDirection2 = G4ThreeVector(0., 0., 1.);
76 theDirection1 = G4ThreeVector(1., 0., 0.);
77 theDirection2 = G4ThreeVector(0., 0., 1.);
82 if(theDirection1.mag() == 0.)
84 G4Exception(
"G4tgbPlaceParamSquare::G4tgbPlaceParamSquare()",
85 "InvalidSetup", FatalException,
"Direction1 is zero !");
89 theDirection1 /= theDirection1.mag();
91 if(theDirection2.mag() == 0.)
93 G4Exception(
"G4tgbPlaceParamSquare::G4tgbPlaceParamSquare()",
94 "InvalidSetup", FatalException,
"Direction2 is zero !");
98 theDirection2 /= theDirection2.mag();
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];
108 theNCopies = theNCopies1 * theNCopies2;
109 theTranslation = theOffset1 * theDirection1 + theOffset2 * theDirection2;
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