44 if ( gDebug ) cout <<
"ZHelix default ctor called" << endl;
53 Double_t refx, Double_t refy,
54 Double_t refz, Double_t TDip,
55 Double_t phii, Double_t phio,
56 Float_t Chi2, Int_t NDoF,
58 Double_t RangeMin, Double_t RangeMax) :
62 if ( gDebug ) cout <<
"ZHelix normal ctor called" << endl;
82 SetRange(RangeType, RangeMin, RangeMax);
91 cout <<
"ZHelix dtor called" << endl;
98 Double_t RangeMin, Double_t RangeMax) {
130 TString opt = option;
144 Double_t degrad = TMath::Pi() / 180.0;
145 Double_t segment = 1. * degrad;
159 Int_t nSeg = Int_t(TMath::Abs(df) / segment) + 1;
164 segment = 0.01 * degrad;
165 nSeg = Int_t(TMath::Abs(df) / segment) + 1;
170 segment = TMath::Abs(df) / nSeg;
172 Double_t phi,
x,
y, z, r;
173 TPolyLine3D::SetPolyLine(nSeg+1);
175 if ( opt.Contains(
"3D") ) {
177 for ( Int_t i = 0; i <= nSeg; i++ ) {
178 phi =
fRange[0] + segment * i * sign;
180 TPolyLine3D::SetPoint(i,
x,
y, z);
182 }
else if ( opt.Contains(
"XY") ) {
184 for ( Int_t i = 0; i <= nSeg; i++ ) {
185 phi =
fRange[0] + segment * i * sign;
187 TPolyLine3D::SetPoint(i,
x,
y, 0);
189 }
else if ( opt.Contains(
"ZR") ) {
197 for ( Int_t i = 0; i <= nSeg; i++ ) {
200 phi =
fRange[0] + segment * i * sign;
204 TPolyLine3D::SetPoint(i, z, r, 0);
210 if ( isgn != 0 )
fRSign = TMath::Sign(1, isgn);
215 Float_t z, r, rref, rdisp;
222 for ( Int_t i = 0; i <= nSeg; i++ ) {
230 for ( Int_t i = 0; i <= nSeg; i++ ) {
234 if (
fRSign < 0) rdisp += 2*rref;
261 r = TMath::Sqrt(TMath::Power(
x,2) + TMath::Power(
y,2));
300 Double_t my_value =
fQovR/(2*k) * (-TMath::Power(r,2) + 1/TMath::Power(
fQovR,2) + TMath::Power(k,2));
302 if ( (my_value < -1) || (my_value > 1 ) )
304 Double_t my_phi = TMath::ACos(my_value);
306 Double_t phi1 =
fAzim - my_phi;
307 Double_t phi2 =
fAzim + my_phi;
322 if ( TMath::Sign(1.,
fTDip) == TMath::Sign(1.,(z1-
fRefZ)) ) {
325 if ( TMath::Sign(1.,
fTDip) == TMath::Sign(1.,(z2-
fRefZ)) ) {
327 if ( TMath::Abs(z1-
fRefZ) <= TMath::Abs(z2-
fRefZ) )
345 TString opt = option;
349 <<
"Parameters of helix " << this->GetName() <<
":" << endl
350 <<
"Azimuth = " <<
fAzim << endl
351 <<
"Q/R = " <<
fQovR << endl
352 <<
"Q*D_h = " <<
fQxDh << endl
353 <<
"Z_h = " <<
fRefZ << endl
354 <<
"cot(Dip) = " <<
fTDip << endl
355 <<
"PhiI = " <<
fPhiI << endl
356 <<
"PhiO = " <<
fPhiO << endl
357 <<
"Chi2 = " <<
fChi2 << endl
358 <<
"D.o.F. = " <<
fNDoF << endl
359 <<
"RangeType = " <<
fRType << endl
360 <<
"Range: " <<
fRange[0] <<
" -> " <<
fRange[1] << endl;
361 if ( opt.Contains(
"ALL") ) TPolyLine3D::Print(
"ALL");
378 TString opt = option;
383 TPolyLine3D::Paint(
"SAME");
virtual Int_t GetRSign(Float_t Phi)
Double_t R2Phi(Double_t r)
void Phi2ZR(Double_t phi, Double_t &z, Double_t &r)
void SetRange(EZHelixRangeType RangeType, Double_t RangeMin, Double_t RangeMax)
Double_t Y2Phi(Double_t y)
virtual void Print(Option_t *option="") const
Double_t fPhiI
sign of radius
virtual void SetPoints(Option_t *option="3D")
Double_t X2Phi(Double_t x)
virtual void Paint(Option_t *option="3D")
void Phi2XYZ(Double_t phi, Double_t &x, Double_t &y, Double_t &z)
virtual void Draw(Option_t *option="3D")
Double_t Phi2S(Double_t phi)
virtual void SetPoint(Int_t point, Double_t x, Double_t y, Double_t z)
Double_t Z2Phi(Double_t z)