File indexing completed on 2025-07-03 07:54:35
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include <DD4hep/Printout.h>
0016 #include <DD4hep/detail/ShapesInterna.h>
0017
0018
0019 #include <climits>
0020 #include <cstdio>
0021
0022 using namespace dd4hep;
0023
0024 ClassImp(dd4hep::TwistedTubeObject)
0025
0026
0027 TwistedTubeObject::TwistedTubeObject(const char* pName,
0028 double twistedangle,
0029 double innerrad,
0030 double outerrad,
0031 double negativeEndz,
0032 double positiveEndz,
0033 int nseg,
0034 double totphi)
0035 : TGeoTubeSeg(pName, innerrad, outerrad, (-negativeEndz+positiveEndz)/2.0, 0, totphi),
0036 fPhiTwist(twistedangle), fNegativeEndz(negativeEndz), fPositiveEndz(positiveEndz), fNsegments(nseg)
0037 {
0038 }
0039
0040
0041
0042 void TwistedTubeObject::InspectShape() const {
0043 printf("*** Shape TwistedTubeObject %s: ***\n", GetName());
0044 printf(" Rmin = %11.5f\n", GetRmin());
0045 printf(" Rmax = %11.5f\n", GetRmax());
0046 printf(" dz = %11.5f\n", GetDz());
0047 printf(" phi1 = %11.5f\n", GetPhi1());
0048 printf(" phi2 = %11.5f\n", GetPhi2());
0049 printf(" negativeEndz = %11.5f\n", GetNegativeEndZ());
0050 printf(" positiveEndz = %11.5f\n", GetPositiveEndZ());
0051 printf(" Nsegemnts = %11.d\n", GetNsegments());
0052 printf(" Bounding box:\n");
0053 TGeoBBox::InspectShape();
0054 }
0055
0056
0057
0058 TGeoShape *TwistedTubeObject::GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix * ) const
0059 {
0060 if (!TestShapeBit(kGeoRunTimeShape)) return 0;
0061 if (!mother->TestShapeBit(kGeoTube)) {
0062 Error("GetMakeRuntimeShape", "Invalid mother for shape %s", GetName());
0063 return 0;
0064 }
0065 Double_t rmin = fRmin;
0066 Double_t rmax = fRmax;
0067 if (fRmin<0)
0068 rmin = ((TGeoTube*)mother)->GetRmin();
0069 if ((fRmax<0) || (fRmax<=fRmin))
0070 rmax = ((TGeoTube*)mother)->GetRmax();
0071
0072 return (new TwistedTubeObject(GetName(), GetPhiTwist(), rmin, rmax,
0073 GetNegativeEndZ(), GetPositiveEndZ(),
0074 GetNsegments(), GetPhi2()));
0075 }