62 TCTUB::TCTUB(
const char *name,
const char *title,
const char *material, Float_t rmin,
63 Float_t rmax, Float_t dz, Float_t phi1, Float_t phi2,
64 Float_t coslx, Float_t cosly, Float_t coslz,
65 Float_t coshx, Float_t coshy, Float_t coshz)
66 : TTUBS(name,title,material,rmin,rmax,dz,phi1,phi2)
74 TMath::Normalize(fCosLow);
75 TMath::Normalize(fCosHigh);
81 TCTUB::TCTUB(
const char *name,
const char *title,
const char *material, Float_t rmin,
82 Float_t rmax, Float_t dz, Float_t phi1, Float_t phi2,
83 Float_t *lowNormal, Float_t *highNormal)
84 : TTUBS(name,title,material,rmin,rmax,dz,phi1,phi2)
86 memcpy(fCosLow, lowNormal,
sizeof(fCosLow) );
87 memcpy(fCosHigh,highNormal,
sizeof(fCosHigh));
88 TMath::Normalize(fCosLow);
89 TMath::Normalize(fCosHigh);
102 static Double_t Product(
const Double_t *x,
const Float_t *y)
105 for (
int i= 0 ; i <2 ; i++ ) s += x[i]*y[i];
112 void TCTUB::SetPoints(Double_t *points)
const
117 n = GetNumberOfDivisions()+1;
124 if (!fCoTab) MakeTableOfCoSin();
126 for (j = 0; j < n; j++) {
127 points[indx+6*n] = points[indx] = fRmin * fCoTab[j];
129 points[indx+6*n] = points[indx] = fAspectRatio*fRmin * fSiTab[j];
131 points[indx+6*n] = dz;
132 points[indx+6*n]-= Product(&points[indx+6*n-2],fCosHigh)/fCosHigh[2];
134 points[indx] -= Product(&points[indx-2],fCosLow)/fCosLow[2];
137 for (j = 0; j < n; j++) {
138 points[indx+6*n] = points[indx] = fRmax * fCoTab[j];
140 points[indx+6*n] = points[indx] = fAspectRatio*fRmax * fSiTab[j];
142 points[indx+6*n] = dz;
143 points[indx+6*n]-= Product(&points[indx+6*n-2],fCosHigh)/fCosHigh[2];
145 points[indx] -= Product(&points[indx-2],fCosLow)/fCosLow[2];
154 void TCTUB::Streamer(TBuffer &R__b)
156 if (R__b.IsReading()) {
158 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
160 R__b.ReadClassBuffer(TCTUB::Class(),
this, R__v, R__s, R__c);
164 TTUBS::Streamer(R__b);
165 R__b.ReadStaticArray(fCosLow);
166 R__b.ReadStaticArray(fCosHigh);
167 R__b.CheckByteCount(R__s, R__c, TCTUB::IsA());
171 R__b.WriteClassBuffer(TCTUB::Class(),
this);