51 auto msol = (
G4Trd*)(msolid);
55 G4VSolid* mConstituentSolid
56 = ((G4ReflectedSolid*)msolid)->GetConstituentMovedSolid();
57 msol = (G4Trd*)(mConstituentSolid);
61 = new G4Trd(msol->GetName(),
62 msol->GetXHalfLength2(), msol->GetXHalfLength1(),
63 msol->GetYHalfLength2(), msol->GetYHalfLength1(),
64 msol->GetZHalfLength());
66 fmotherSolid = newSolid;
67 fReflectedSolid = true;
100 G4cout <<
" G4ParameterisationTrdX - ## divisions " <<
fnDiv <<
" = "
107 G4double mpDx1 = msol->GetXHalfLength1();
108 G4double mpDx2 = msol->GetXHalfLength2();
123 return (msol->GetXHalfLength1()+msol->GetXHalfLength2());
133 G4double mdx = ( msol->GetXHalfLength1() + msol->GetXHalfLength2() ) / 2.;
144 std::ostringstream message;
145 message <<
"Only axes along X are allowed ! Axis: " <<
faxis;
146 G4Exception(
"G4ParameterisationTrdX::ComputeTransformation()",
153 G4cout << std::setprecision(8)
154 <<
" G4ParameterisationTrdX::ComputeTransformation() "
156 <<
" Position: " << origin <<
" - Axis: " <<
faxis <<
G4endl;
170 G4double pDy1 = msol->GetYHalfLength1();
171 G4double pDy2 = msol->GetYHalfLength2();
172 G4double pDz = msol->GetZHalfLength();
180 G4cout <<
" G4ParameterisationTrdX::ComputeDimensions():"
193 G4double pDy1 = msol->GetYHalfLength1();
194 G4double pDy2 = msol->GetYHalfLength2();
195 G4double pDz = msol->GetZHalfLength();
197 G4double pDx1 = msol->GetXHalfLength1();
198 G4double pDx2 = msol->GetXHalfLength2();
200 G4double xChangeRatio = (pDx2-pDx1) / (pDx2+pDx1);
207 G4double cxy1 = -pDx1+fOffset1 + (copyNo+0.5)*fWid1;
208 G4double cxy2 = -pDx2+fOffset2 + (copyNo+0.5)*fWid2;
209 G4double alp = std::atan( (cxy2-cxy1)/(pDz*2.) );
211 pDx1 =
fwidth/2. - fWidChange/2.;
212 pDx2 =
fwidth/2. + fWidChange/2.;
224 pDx2 -
fhgap * pDx2/pDx1,
230 G4cout <<
" G4ParameterisationTrdX::ComputeDimensions():"
263 G4cout <<
" G4ParameterisationTrdY no divisions " <<
fnDiv
264 <<
" = " << nDiv <<
G4endl
278 return (msol->GetYHalfLength1()+msol->GetYHalfLength2());
287 G4double mdy = ( msol->GetYHalfLength1() + msol->GetYHalfLength2() ) / 2.;
299 std::ostringstream message;
300 message <<
"Only axes along Y are allowed ! Axis: " <<
faxis;
301 G4Exception(
"G4ParameterisationTrdY::ComputeTransformation()",
308 G4cout << std::setprecision(8)
309 <<
" G4ParameterisationTrdY::ComputeTransformation " << copyNo
310 <<
" pos " << origin <<
" rot mat " <<
" axis " <<
faxis <<
G4endl;
327 G4double pDx1 = msol->GetXHalfLength1();
328 G4double pDx2 = msol->GetXHalfLength2();
329 G4double pDz = msol->GetZHalfLength();
337 G4cout <<
" G4ParameterisationTrdY::ComputeDimensions():" <<
G4endl;
349 G4double pDx1 = msol->GetXHalfLength1();
350 G4double pDx2 = msol->GetXHalfLength2();
351 G4double pDz = msol->GetZHalfLength();
353 G4double pDy1 = msol->GetYHalfLength1();
354 G4double pDy2 = msol->GetYHalfLength2();
356 G4double yChangeRatio = (pDy2-pDy1) / (pDy2+pDy1);
363 G4double cyx1 = -pDy1+fOffset1 + (copyNo+0.5)*fWid1;
364 G4double cyx2 = -pDy2+fOffset2 + (copyNo+0.5)*fWid2;
365 G4double alp = std::atan( (cyx2-cyx1)/(pDz*2.) );
367 pDy1 =
fwidth/2. - fWidChange/2.;
368 pDy2 =
fwidth/2. + fWidChange/2.;
380 pDx2 -
fhgap * pDx2/pDx1,
386 G4cout <<
" G4ParameterisationTrdY::ComputeDimensions():"
418 G4cout <<
" G4ParameterisationTrdZ no divisions " <<
fnDiv
419 <<
" = " << nDiv <<
G4endl
433 return 2*msol->GetZHalfLength();
442 G4double mdz = msol->GetZHalfLength();
453 std::ostringstream message;
454 message <<
"Only axes along Z are allowed ! Axis: " <<
faxis;
455 G4Exception(
"G4ParameterisationTrdZ::ComputeTransformation()",
462 G4cout << std::setprecision(8) <<
" G4ParameterisationTrdZ: "
464 <<
" Position: " << origin <<
" - Offset: " <<
foffset
482 G4double pDx1 = msol->GetXHalfLength1();
483 G4double DDx = (msol->GetXHalfLength2() - msol->GetXHalfLength1() );
484 G4double pDy1 = msol->GetYHalfLength1();
485 G4double DDy = (msol->GetYHalfLength2() - msol->GetYHalfLength1() );
487 G4double zLength = 2*msol->GetZHalfLength();
498 G4cout <<
" G4ParameterisationTrdZ::ComputeDimensions()"
499 <<
" - Mother TRD " <<
G4endl;
501 G4cout <<
" - Parameterised TRD: "
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
void ComputeDimensions(G4Trd &trd, const G4int copyNo, const G4VPhysicalVolume *pv) const override
G4ParameterisationTrdX(EAxis axis, G4int nCopies, G4double width, G4double offset, G4VSolid *motherSolid, DivisionType divType)
G4double GetMaxParameter() const override
~G4ParameterisationTrdX() override
void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const override
void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const override
G4ParameterisationTrdY(EAxis axis, G4int nCopies, G4double width, G4double offset, G4VSolid *motherSolid, DivisionType divType)
G4double GetMaxParameter() const override
void ComputeDimensions(G4Trd &trd, const G4int copyNo, const G4VPhysicalVolume *pv) const override
~G4ParameterisationTrdY() override
G4double GetMaxParameter() const override
void ComputeDimensions(G4Trd &trd, const G4int copyNo, const G4VPhysicalVolume *pv) const override
~G4ParameterisationTrdZ() override
void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const override
G4ParameterisationTrdZ(EAxis axis, G4int nCopies, G4double width, G4double offset, G4VSolid *motherSolid, DivisionType divType)
void SetAllParameters(G4double pDz, G4double pTheta, G4double pPhi, G4double pDy1, G4double pDx1, G4double pDx2, G4double pAlp1, G4double pDy2, G4double pDx3, G4double pDx4, G4double pAlp2)
void SetAllParameters(G4double pdx1, G4double pdx2, G4double pdy1, G4double pdy2, G4double pdz)
virtual void CheckParametersValidity()
void SetType(const G4String &type)
G4double CalculateWidth(G4double motherDim, G4int nDiv, G4double offset) const
G4int CalculateNDiv(G4double motherDim, G4double width, G4double offset) const
static const G4int verbose
G4VParameterisationTrd(EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *msolid, DivisionType divType)
~G4VParameterisationTrd() override
void SetTranslation(const G4ThreeVector &v)
virtual G4GeometryType GetEntityType() const =0