#include <G4ParameterisationTrd.hh>
Inheritance diagram for G4ParameterisationTrdZ:
Public Member Functions | |
G4ParameterisationTrdZ (EAxis axis, G4int nCopies, G4double width, G4double offset, G4VSolid *motherSolid, DivisionType divType) | |
~G4ParameterisationTrdZ () | |
G4double | GetMaxParameter () const |
void | ComputeTransformation (const G4int copyNo, G4VPhysicalVolume *physVol) const |
void | ComputeDimensions (G4Trd &trd, const G4int copyNo, const G4VPhysicalVolume *pv) const |
Definition at line 179 of file G4ParameterisationTrd.hh.
G4ParameterisationTrdZ::G4ParameterisationTrdZ | ( | EAxis | axis, | |
G4int | nCopies, | |||
G4double | width, | |||
G4double | offset, | |||
G4VSolid * | motherSolid, | |||
DivisionType | divType | |||
) |
Definition at line 421 of file G4ParameterisationTrd.cc.
References G4VDivisionParameterisation::CalculateNDiv(), G4VDivisionParameterisation::CalculateWidth(), G4VDivisionParameterisation::CheckParametersValidity(), DivNDIV, DivWIDTH, G4VDivisionParameterisation::fmotherSolid, G4VDivisionParameterisation::fnDiv, G4VDivisionParameterisation::foffset, G4VDivisionParameterisation::fwidth, G4cout, G4endl, G4Trd::GetZHalfLength(), G4VDivisionParameterisation::SetType(), and G4VDivisionParameterisation::verbose.
00424 : G4VParameterisationTrd( axis, nDiv, width, offset, msolid, divType ) 00425 { 00426 CheckParametersValidity(); 00427 SetType( "DivTrdZ" ); 00428 00429 G4Trd* msol = (G4Trd*)(fmotherSolid); 00430 if( divType == DivWIDTH ) 00431 { 00432 fnDiv = CalculateNDiv( 2*msol->GetZHalfLength(), 00433 width, offset ); 00434 } 00435 else if( divType == DivNDIV ) 00436 { 00437 fwidth = CalculateWidth( 2*msol->GetZHalfLength(), 00438 nDiv, offset ); 00439 } 00440 00441 #ifdef G4DIVDEBUG 00442 if( verbose >= 1 ) 00443 { 00444 G4cout << " G4ParameterisationTrdZ no divisions " << fnDiv 00445 << " = " << nDiv << G4endl 00446 << " Offset " << foffset << " = " << offset << G4endl 00447 << " Width " << fwidth << " = " << width << G4endl; 00448 } 00449 #endif 00450 }
G4ParameterisationTrdZ::~G4ParameterisationTrdZ | ( | ) |
void G4ParameterisationTrdZ::ComputeDimensions | ( | G4Trd & | trd, | |
const G4int | copyNo, | |||
const G4VPhysicalVolume * | pv | |||
) | const [virtual] |
Reimplemented from G4VPVParameterisation.
Definition at line 504 of file G4ParameterisationTrd.cc.
References G4VSolid::DumpInfo(), G4VDivisionParameterisation::fhgap, G4VDivisionParameterisation::fmotherSolid, G4VDivisionParameterisation::fwidth, G4cout, G4endl, G4Trd::GetXHalfLength1(), G4Trd::GetXHalfLength2(), G4Trd::GetYHalfLength1(), G4Trd::GetYHalfLength2(), G4Trd::GetZHalfLength(), G4VDivisionParameterisation::OffsetZ(), G4Trd::SetAllParameters(), and G4VDivisionParameterisation::verbose.
00506 { 00507 //---- The division along Z of a Trd will result a Trd 00508 G4Trd* msol = (G4Trd*)(fmotherSolid); 00509 00510 G4double pDx1 = msol->GetXHalfLength1(); 00511 G4double DDx = (msol->GetXHalfLength2() - msol->GetXHalfLength1() ); 00512 G4double pDy1 = msol->GetYHalfLength1(); 00513 G4double DDy = (msol->GetYHalfLength2() - msol->GetYHalfLength1() ); 00514 G4double pDz = fwidth/2. - fhgap; 00515 G4double zLength = 2*msol->GetZHalfLength(); 00516 00517 trd.SetAllParameters( pDx1+DDx*(OffsetZ()+copyNo*fwidth+fhgap)/zLength, 00518 pDx1+DDx*(OffsetZ()+(copyNo+1)*fwidth-fhgap)/zLength, 00519 pDy1+DDy*(OffsetZ()+copyNo*fwidth+fhgap)/zLength, 00520 pDy1+DDy*(OffsetZ()+(copyNo+1)*fwidth-fhgap)/zLength, 00521 pDz ); 00522 00523 #ifdef G4DIVDEBUG 00524 if( verbose >= 1 ) 00525 { 00526 G4cout << " G4ParameterisationTrdZ::ComputeDimensions()" 00527 << " - Mother TRD " << G4endl; 00528 msol->DumpInfo(); 00529 G4cout << " - Parameterised TRD: " 00530 << copyNo << G4endl; 00531 trd.DumpInfo(); 00532 } 00533 #endif 00534 }
void G4ParameterisationTrdZ::ComputeTransformation | ( | const G4int | copyNo, | |
G4VPhysicalVolume * | physVol | |||
) | const [virtual] |
Implements G4VDivisionParameterisation.
Definition at line 467 of file G4ParameterisationTrd.cc.
References FatalException, G4VDivisionParameterisation::faxis, G4VDivisionParameterisation::fmotherSolid, G4VDivisionParameterisation::foffset, G4VDivisionParameterisation::fwidth, G4cout, G4endl, G4Exception(), G4Trd::GetZHalfLength(), kZAxis, G4VDivisionParameterisation::OffsetZ(), G4VPhysicalVolume::SetTranslation(), and G4VDivisionParameterisation::verbose.
00468 { 00469 G4Trd* msol = (G4Trd*)(fmotherSolid ); 00470 G4double mdz = msol->GetZHalfLength(); 00471 00472 //----- translation 00473 G4ThreeVector origin(0.,0.,0.); 00474 G4double posi = -mdz + OffsetZ() + (copyNo+0.5)*fwidth; 00475 if( faxis == kZAxis ) 00476 { 00477 origin.setZ( posi ); 00478 } 00479 else 00480 { 00481 std::ostringstream message; 00482 message << "Only axes along Z are allowed ! Axis: " << faxis; 00483 G4Exception("G4ParameterisationTrdZ::ComputeTransformation()", 00484 "GeomDiv0002", FatalException, message); 00485 } 00486 00487 #ifdef G4DIVDEBUG 00488 if( verbose >= 1 ) 00489 { 00490 G4cout << std::setprecision(8) << " G4ParameterisationTrdZ: " 00491 << copyNo << G4endl 00492 << " Position: " << origin << " - Offset: " << foffset 00493 << " - Width: " << fwidth << " Axis " << faxis << G4endl; 00494 } 00495 #endif 00496 00497 //----- set translation 00498 physVol->SetTranslation( origin ); 00499 }
G4double G4ParameterisationTrdZ::GetMaxParameter | ( | ) | const [virtual] |
Implements G4VDivisionParameterisation.
Definition at line 458 of file G4ParameterisationTrd.cc.
References G4VDivisionParameterisation::fmotherSolid, and G4Trd::GetZHalfLength().
00459 { 00460 G4Trd* msol = (G4Trd*)(fmotherSolid); 00461 return 2*msol->GetZHalfLength(); 00462 }