Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
THelix.cxx
Go to the documentation of this file.
1// @(#)root/g3d:$Id$
2// Author: Ping Yeh 19/12/97
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12/** \class THelix
13\ingroup g3d
14THelix has two different constructors.
15
16If a particle with charge q passes through a point (x,y,z)
17with momentum (px,py,pz) with magnetic field B along an axis (nx,ny,nz),
18this helix can be constructed like:
19
20~~~ {.cpp}
21 THelix p(x,y,z, px,py,pz, q*B, nx,ny,nz);
22 (nx,ny,nz) defaults to (0,0,1).
23~~~
24
25A helix in its own frame can be defined with a pivotal point
26(x0,y0,z0), the velocity at that point (vx0,vy0,vz0), and
27an angular frequency w. Combining vx0 and vy0 to a transverse
28velocity vt0 one can parametrize the helix as:
29
30~~~ {.cpp}
31 x(t) = x0 - vt0 / w * sin(-w * t + phi0)
32 y(t) = y0 + vt0 / w * cos(-w * t + phi0)
33 z(t) = z0 + vz0 * t
34~~~
35
36The second constructor has 6 parameters,
37
38Example:
39
40~~~ {.cpp}
41 THelix pl1(xyz, v, w, range, rtype, axis);
42~~~
43
44where:
45
46 - xyz : array of initial position
47 - v : array of initial velocity
48 - w : angular frequency
49 - range: helix range
50 - rtype: kHelixZ specifies allowed drawing range in helix Z direction, i.e., along B field.
51 kLabZ specifies drawing range in lab frame.
52 kHelixX, kHelixY, kLabX, kLabY, kUnchanged ... etc can also be specified
53 - axis : helix axis
54
55Example constructing a helix with several default values and drawing it:
56
57Begin_Macro(source)
58{
59 TCanvas* helix_example_c1 = new TCanvas("helix_example_c1");
60 TView *view = TView::CreateView(1);
61 view->SetRange(-1,-1,-1,1,1,1);
62 THelix *helix = new THelix(0., 0., 0., 1., 0., 0.3, 10.);
63 helix->Draw();
64}
65End_Macro
66
67This initializes a helix with its axis in Z direction (rtype=kHelixZ).
68*/
69
70#include <iostream>
71#include "TBuffer.h"
72#include "TROOT.h"
73#include "THelix.h"
74#include "TMath.h"
75
76Int_t THelix::fgMinNSeg=5; // at least 5 line segments in TPolyLine3D
77
78
79////////////////////////////////////////////////////////////////////////////////
80/// Set all helix parameters.
81
82void THelix::SetHelix(Double_t const* xyz, Double_t const* v, Double_t w,
84 Double_t const* axis )
85{
86 // Define the helix frame by setting the helix axis and rotation matrix
87 SetAxis(axis);
88
89 // Calculate initial position and velocity in helix frame
90 fW = w;
93 vx0 = v[0] * m[0] + v[1] * m[1] + v[2] * m[2];
94 vy0 = v[0] * m[3] + v[1] * m[4] + v[2] * m[5];
95 vz0 = v[0] * m[6] + v[1] * m[7] + v[2] * m[8];
98 fVz = vz0;
99 fX0 = xyz[0] * m[0] + xyz[1] * m[1] + xyz[2] * m[2];
100 fY0 = xyz[0] * m[3] + xyz[1] * m[4] + xyz[2] * m[5];
101 fZ0 = xyz[0] * m[6] + xyz[1] * m[7] + xyz[2] * m[8];
102 if (fW != 0) {
103 fX0 += fVt / fW * TMath::Sin(fPhi0);
104 fY0 -= fVt / fW * TMath::Cos(fPhi0);
105 }
106
107 // Then calculate the range in t and set the polyline representation
108 Double_t r1 = 0;
109 Double_t r2 = 1;
110 if (range) {r1 = range[0]; r2 = range[1];}
111 if (rType != kUnchanged) {
112 fRange[0] = 0.0; fRange[1] = TMath::Pi(); // initialize to half round
114 }
115}
116
117////////////////////////////////////////////////////////////////////////////////
118/// Helix default constructor.
119
121{
122 fX0 = fY0 = fZ0 = fVt = fPhi0 = fVz = fAxis[0] = fAxis[1] = 0.0;
123 fAxis[2] = 1.0;
124 fW = 1.5E7; // roughly the cyclon frequency of proton in AMS
125 fRange[0] = 0.0;
126 fRange[1] = 1.0;
127 fRotMat = nullptr;
128}
129
130////////////////////////////////////////////////////////////////////////////////
131/// Helix normal constructor.
132
135 Double_t w)
136 : TPolyLine3D()
137{
138 Double_t p[3], v[3];
139 p[0] = x;
140 p[1] = y;
141 p[2] = z;
142 v[0] = vx;
143 v[1] = vy;
144 v[2] = vz;
145 Double_t *range = nullptr;
146 fRotMat = nullptr;
147
148 SetHelix(p, v, w, range, kHelixZ);
149 fOption = "";
150}
151
152////////////////////////////////////////////////////////////////////////////////
153/// Helix normal constructor.
154
156 Double_t const* range, EHelixRangeType rType, Double_t const* axis)
157 : TPolyLine3D()
158{
159 Double_t r[2];
160 if ( range ) {
161 r[0] = range[0]; r[1] = range[1];
162 } else {
163 r[0] = 0.0; r[1] = 1.0;
164 }
165
166 fRotMat = nullptr;
167 if ( axis ) { // specify axis
168 SetHelix(xyz, v, w, r, rType, axis);
169 } else { // default axis
170 SetHelix(xyz, v, w, r, rType);
171 }
172
173 fOption = "";
174}
175
176
177////////////////////////////////////////////////////////////////////////////////
178/// assignment operator
179
181{
182 if(this!=&hx) {
184 fX0=hx.fX0;
185 fY0=hx.fY0;
186 fZ0=hx.fZ0;
187 fVt=hx.fVt;
188 fPhi0=hx.fPhi0;
189 fVz=hx.fVz;
190 fW=hx.fW;
191 for(Int_t i=0; i<3; i++)
192 fAxis[i]=hx.fAxis[i];
193 delete fRotMat;
194 fRotMat = hx.fRotMat ? new TRotMatrix(*hx.fRotMat) : nullptr;
195 for(Int_t i=0; i<2; i++)
196 fRange[i]=hx.fRange[i];
197 }
198 return *this;
199}
200
201////////////////////////////////////////////////////////////////////////////////
202/// Helix destructor.
203
205{
206 if (fRotMat) delete fRotMat;
207}
208
209
210////////////////////////////////////////////////////////////////////////////////
211/// Helix copy constructor.
212
214{
215 fRotMat = nullptr;
216 ((THelix&)helix).THelix::Copy(*this);
217}
218
219
220////////////////////////////////////////////////////////////////////////////////
221/// Copy this helix to obj.
222
223void THelix::Copy(TObject &obj) const
224{
225 TObject::Copy(obj);
226 TAttLine::Copy(((THelix&)obj));
227
228 ((THelix&)obj).fX0 = fX0;
229 ((THelix&)obj).fY0 = fY0;
230 ((THelix&)obj).fZ0 = fZ0;
231 ((THelix&)obj).fVt = fVt;
232 ((THelix&)obj).fPhi0 = fPhi0;
233 ((THelix&)obj).fVz = fVz;
234 ((THelix&)obj).fW = fW;
235 for (Int_t i=0; i<3; i++)
236 ((THelix&)obj).fAxis[i] = fAxis[i];
237
238 if (((THelix&)obj).fRotMat)
239 delete ((THelix&)obj).fRotMat;
240
241 ((THelix&)obj).fRotMat = fRotMat ? new TRotMatrix(*fRotMat) : nullptr;
242
243 ((THelix&)obj).fRange[0] = fRange[0];
244 ((THelix&)obj).fRange[1] = fRange[1];
245
246 ((THelix&)obj).fOption = fOption;
247
248 //
249 // Set range and make the graphic representation
250 //
251 ((THelix&)obj).SetRange(fRange[0], fRange[1], kHelixT);
252}
253
254
255////////////////////////////////////////////////////////////////////////////////
256/// Draw this helix with its current attributes.
257
262
263
264////////////////////////////////////////////////////////////////////////////////
265/// Dump this helix with its attributes.
266
268{
269 std::cout <<" THelix Printing N=" <<fN<<" Option="<<option<<std::endl;
270}
271
272
273////////////////////////////////////////////////////////////////////////////////
274/// Save primitive as a C++ statement(s) on output stream out.
275
276void THelix::SavePrimitive(std::ostream &out, Option_t *option)
277{
278 SavePrimitiveConstructor(out, Class(), "helix",
279 TString::Format("%g, %g, %g, %g, %g, %g, %g", fX0, fY0, fZ0, fVt * TMath::Cos(fPhi0),
280 fVt * TMath::Sin(fPhi0), fVz, fW));
281
282 if ((fRange[0] != 0.) || (fRange[1] != 1.))
283 out << " helix->SetRange(" << fRange[0] << ", " << fRange[1] << ", kHelixT);\n";
284
285 if ((fAxis[0] != 0.) || (fAxis[1] != 0.) || (fAxis[2] != 1.))
286 out << " helix->SetAxis(" << fAxis[0] << ", " << fAxis[1] << ", " << fAxis[2] << ");\n";
287 if (fOption.Length())
288 out << " helix->SetOption(\"" << TString(fOption).ReplaceSpecialCppChars() << "\");\n";
289
290 SaveLineAttributes(out, "helix", 1, 1, 1);
291
292 SavePrimitiveDraw(out, "helix", option);
293}
294
295////////////////////////////////////////////////////////////////////////////////
296/// Set a new axis for the helix. This will make a new rotation matrix.
297
298void THelix::SetAxis(Double_t const* axis)
299{
300 if (axis) {
301 Double_t len = TMath::Sqrt(axis[0]*axis[0] + axis[1]*axis[1] + axis[2]*axis[2]);
302 if (len <= 0) {
303 Error("SetAxis()", "Impossible! axis length %lf <= 0!", len);
304 return;
305 }
306 fAxis[0] = axis[0]/len;
307 fAxis[1] = axis[1]/len;
308 fAxis[2] = axis[2]/len;
309 } else {
310 fAxis[0] = 0;
311 fAxis[1] = 0;
312 fAxis[2] = 1;
313 }
314
315 // Construct the rotational matrix from the axis
316 SetRotMatrix();
317}
318
319
320////////////////////////////////////////////////////////////////////////////////
321/// Set axis.
322
324{
325 Double_t axis[3]; axis[0] = x; axis[1] = y; axis[2] = z;
326 SetAxis(axis);
327}
328
329
330////////////////////////////////////////////////////////////////////////////////
331/// Set a new range for the helix. This will remake the polyline.
332
334{
335 Double_t a[2];
336 Double_t halfpi = TMath::Pi()/2.0;
337 Int_t i;
341
342 if ( fW != 0 && fVz != 0 ) { // general case
343 switch ( rType ) {
344 case kHelixT :
345 fRange[0] = range[0]; fRange[1] = range[1]; break;
346
347 case kHelixX :
348 for (i=0; i<2; i++ ) {
349 a[i] = fW / fVt * (range[i] - fX0);
350 if ( a[i] < -1 || a[i] > 1 ) {
351 Error("SetRange()",
352 "range out of bound (%lf:%lf): %lf. Default used: %lf",
353 fX0-fVt/fW, fX0+fVt/fW, range[i], fRange[i]);
354 return;
355 }
356 phase = FindClosestPhase(fPhi0+halfpi, a[i]);
357 fRange[i] = ( fPhi0 + halfpi - phase ) / fW;
358 }
359 break;
360
361 case kHelixY :
362 for (i=0; i<2; i++ ) {
363 a[i] = fW / fVt * (range[i] - fY0);
364 if ( a[i] < -1 || a[i] > 1 ) {
365 Error("SetRange()",
366 "range out of bound (%lf:%lf): %lf. Default used: %lf",
367 fY0-fVt/fW, fY0+fVt/fW, range[i], fRange[i]);
368 return;
369 }
371 fRange[i] = ( fPhi0 - phase ) / fW;
372 }
373 break;
374
375 case kHelixZ :
376 if ( fVz != 0 ) {
377 for (i=0; i<2; i++ ) {
378 fRange[i] = (range[i] - fZ0) / fVz;
379 }
380 } else { // fVz = 0, z = constant = fZ0
381 Error("SetRange()",
382 "Vz = 0 and attempts to set range along helix axis!");
383 return;
384 }
385 break;
386
387 case kLabX :
388 case kLabY :
389 case kLabZ :
390 printf("setting range in lab axes is not implemented yet\n");
391 break;
392 default:
393 Error("SetRange()","unknown range type %d", rType);
394 break;
395 }
396 } else if ( fW == 0 ) { // straight line: x = x0 + vx * t
397 switch ( rType ) {
398 case kHelixT :
399 fRange[0] = range[0]; fRange[1] = range[1];
400 break;
401 case kHelixX :
402 if ( vx != 0 ) {
403 fRange[0] = (range[0] - fX0) / vx;
404 fRange[1] = (range[1] - fX0) / vx;
405 } else {
406 Error("SetRange()",
407 "Vx = 0 and attempts to set range on helix x axis!");
408 return;
409 }
410 break;
411 case kHelixY :
412 if ( vy != 0 ) {
413 fRange[0] = (range[0] - fY0) / vy;
414 fRange[1] = (range[1] - fY0) / vy;
415 } else {
416 Error("SetRange()",
417 "Vy = 0 and attempts to set range on helix y axis!");
418 return;
419 }
420 break;
421 case kHelixZ :
422 if ( fVz != 0 ) {
423 fRange[0] = (range[0] - fZ0) / fVz;
424 fRange[1] = (range[1] - fZ0) / fVz;
425 } else {
426 Error("SetRange()",
427 "Vz = 0 and attempts to set range on helix z axis!");
428 return;
429 }
430 break;
431 case kLabX :
432 case kLabY :
433 case kLabZ :
434 printf("setting range in lab axes is not implemented yet\n");
435 break;
436 default :
437 Error("SetRange()","unknown range type %d", rType);
438 break;
439 }
440 } else if ( fVz == 0 ) { // a circle, not fully implemented yet
441 switch ( rType ) {
442 case kHelixT :
443 fRange[0] = range[0]; fRange[1] = range[1]; break;
444 case kHelixX :
445 if ( vx != 0 ) {
446 fRange[0] = (range[0] - fX0) / vx;
447 fRange[1] = (range[1] - fX0) / vx;
448 } else {
449 Error("SetRange()",
450 "Vx = 0 and attempts to set range on helix x axis!");
451 return;
452 }
453 break;
454 case kHelixY :
455 if ( vy != 0 ) {
456 fRange[0] = (range[0] - fY0) / vy;
457 fRange[1] = (range[1] - fY0) / vy;
458 } else {
459 Error("SetRange()",
460 "Vy = 0 and attempts to set range on helix y axis!");
461 return;
462 }
463 break;
464 case kHelixZ :
465 Error("SetRange()",
466 "Vz = 0 and attempts to set range on helix z axis!");
467 return;
468 case kLabX :
469 case kLabY :
470 case kLabZ :
471 printf("setting range in lab axes is not implemented yet\n");
472 break;
473 default :
474 Error("SetRange()","unknown range type %d", rType);
475 break;
476 }
477 }
478
479 if ( fRange[0] > fRange[1] ) {
480 Double_t temp = fRange[1]; fRange[1] = fRange[0]; fRange[0] = temp;
481 }
482
483 // Set the polylines in global coordinates
484 Double_t degrad = TMath::Pi() / 180.0;
485 Double_t segment = 5.0 * degrad; // 5 degree segments
486 Double_t dt = segment / TMath::Abs(fW); // parameter span on each segm.
487
488 Int_t nSeg = Int_t((fRange[1]-fRange[0]) / dt) + 1;
489 if (nSeg < THelix::fgMinNSeg) {
491 dt = (fRange[1]-fRange[0])/nSeg;
492 }
493
494 Double_t * xl = new Double_t[nSeg+1]; // polyline in local coordinates
495 Double_t * yl = new Double_t[nSeg+1];
496 Double_t * zl = new Double_t[nSeg+1];
497
498 for (i=0; i<=nSeg; i++) { // calculate xl[], yl[], zl[];
499 Double_t t, phase2;
500 if (i==nSeg) t = fRange[1]; // the last point
501 else t = fRange[0] + dt * i;
502 phase2 = -fW * t + fPhi0;
503 xl[i] = fX0 - fVt/fW * TMath::Sin(phase2);
504 yl[i] = fY0 + fVt/fW * TMath::Cos(phase2);
505 zl[i] = fZ0 + fVz * t;
506 }
507
508 Float_t xg, yg,zg; // global coordinates
509 // must be Float_t to call TPolyLine3D::SetPoint()
512 for (i=0; i<=nSeg; i++) { // m^{-1} = transpose of m
513 xg = xl[i] * m[0] + yl[i] * m[3] + zl[i] * m[6] ;
514 yg = xl[i] * m[1] + yl[i] * m[4] + zl[i] * m[7] ;
515 zg = xl[i] * m[2] + yl[i] * m[5] + zl[i] * m[8] ;
517 }
518
519 delete[] xl; delete[] yl; delete[] zl;
520}
521
522
523////////////////////////////////////////////////////////////////////////////////
524/// Set range.
525
532
533
534////////////////////////////////////////////////////////////////////////////////
535// //
536// Protected Member Functions //
537// //
538////////////////////////////////////////////////////////////////////////////////
539
540
541////////////////////////////////////////////////////////////////////////////////
542/// Set the rotational matrix according to the helix axis.
543
545{
546 // Calculate all 6 angles.
547 // Note that TRotMatrix::TRotMatrix() expects angles in degrees.
548 Double_t raddeg = 180.0 / TMath::Pi();
549 Double_t halfpi = TMath::Pi()/2.0 * raddeg;
550 // (theta3,phi3) is the helix axis
553 // (theta1,phi1) is the x-axis in helix frame
554 Double_t theta1 = theta3 + halfpi;
556 // (theta2,phi2) is the y-axis in helix frame
557 Double_t theta2 = halfpi;
558 Double_t phi2 = phi1 + halfpi;
559
560 // Delete the old rotation matrix
561 if (fRotMat) delete fRotMat;
562
563 // Make a new rotation matrix
564 fRotMat = new TRotMatrix("HelixRotMat", "Master frame -> Helix frame",
566 return;
567}
568
569
570////////////////////////////////////////////////////////////////////////////////
571/// Finds the closest phase to phi0 that gives cos(phase) = cosine
572
574{
575 const Double_t pi = TMath::Pi();
576 const Double_t twopi = TMath::Pi() * 2.0;
578 Double_t phi2 = - phi1;
579
580 while ( phi1 - phi0 > pi ) phi1 -= twopi;
581 while ( phi1 - phi0 < -pi ) phi1 += twopi;
582
583 while ( phi2 - phi0 > pi ) phi2 -= twopi;
584 while ( phi2 - phi0 < -pi ) phi2 += twopi;
585
586 // Now phi1, phi2 and phi0 are within the same 2pi range
587 // and cos(phi1) = cos(phi2) = cosine
588 if ( TMath::Abs(phi1-phi0) < TMath::Abs(phi2-phi0) ) return phi1;
589 else return phi2;
590}
591
592
593////////////////////////////////////////////////////////////////////////////////
594/// Stream an object of class THelix.
595
597{
598 if (R__b.IsReading()) {
600 Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { }
601 if (R__v > 1) {
602 R__b.ReadClassBuffer(THelix::Class(), this, R__v, R__s, R__c);
603 return;
604 }
605 //====process old versions before automatic schema evolution
607 R__b >> fX0;
608 R__b >> fY0;
609 R__b >> fZ0;
610 R__b >> fVt;
611 R__b >> fPhi0;
612 R__b >> fVz;
613 R__b >> fW;
614 R__b.ReadStaticArray(fAxis);
615 R__b >> fRotMat;
616 R__b.ReadStaticArray(fRange);
617 R__b.CheckByteCount(R__s, R__c, THelix::IsA());
618 //====end of old versions
619
620 } else {
621 R__b.WriteClassBuffer(THelix::Class(),this);
622 }
623}
#define a(i)
Definition RSha256.hxx:99
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
short Version_t
Class version identifier (short)
Definition RtypesCore.h:79
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
EHelixRangeType
Definition THelix.h:18
@ kHelixY
Definition THelix.h:19
@ kHelixX
Definition THelix.h:19
@ kLabZ
Definition THelix.h:19
@ kHelixT
Definition THelix.h:19
@ kLabX
Definition THelix.h:19
@ kHelixZ
Definition THelix.h:19
@ kLabY
Definition THelix.h:19
@ kUnchanged
Definition THelix.h:19
void Copy(TAttLine &attline) const
Copy this line attributes to a new TAttLine.
Definition TAttLine.cxx:176
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Save line attributes as C++ statement(s) on output stream out.
Definition TAttLine.cxx:274
Buffer base class used for serializing objects.
Definition TBuffer.h:43
THelix has two different constructors.
Definition THelix.h:23
void Print(Option_t *option="") const override
Dump this helix with its attributes.
Definition THelix.cxx:267
void Copy(TObject &helix) const override
Copy this helix to obj.
Definition THelix.cxx:223
Double_t fRange[2]
Definition THelix.h:35
Double_t fZ0
Definition THelix.h:28
static TClass * Class()
void SetHelix(Double_t const *xyz, Double_t const *v, Double_t w, Double_t const *range=nullptr, EHelixRangeType type=kUnchanged, Double_t const *axis=nullptr)
Set all helix parameters.
Definition THelix.cxx:82
THelix & operator=(const THelix &)
assignment operator
Definition THelix.cxx:180
~THelix() override
Helix destructor.
Definition THelix.cxx:204
virtual void SetAxis(Double_t const *axis)
Set a new axis for the helix. This will make a new rotation matrix.
Definition THelix.cxx:298
TClass * IsA() const override
Definition THelix.h:69
void Streamer(TBuffer &) override
Stream an object of class THelix.
Definition THelix.cxx:596
Double_t fPhi0
Definition THelix.h:30
virtual void SetRange(Double_t *range, EHelixRangeType rtype=kHelixZ)
Set a new range for the helix. This will remake the polyline.
Definition THelix.cxx:333
THelix()
Helix default constructor.
Definition THelix.cxx:120
Double_t fVz
Definition THelix.h:31
Double_t fAxis[3]
Definition THelix.h:33
Double_t fX0
Definition THelix.h:26
Double_t FindClosestPhase(Double_t phi0, Double_t cosine)
Finds the closest phase to phi0 that gives cos(phase) = cosine.
Definition THelix.cxx:573
void SetRotMatrix()
Set the rotational matrix according to the helix axis.
Definition THelix.cxx:544
Double_t fY0
Definition THelix.h:27
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
Definition THelix.cxx:276
Double_t fVt
Definition THelix.h:29
void Draw(Option_t *option="") override
Draw this helix with its current attributes.
Definition THelix.cxx:258
TRotMatrix * fRotMat
Definition THelix.h:34
Double_t fW
Definition THelix.h:32
static Int_t fgMinNSeg
Definition THelix.h:42
Mother of all ROOT objects.
Definition TObject.h:41
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
Definition TObject.cxx:203
virtual void Copy(TObject &object) const
Copy this to obj.
Definition TObject.cxx:159
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1071
static void SavePrimitiveDraw(std::ostream &out, const char *variable_name, Option_t *option=nullptr)
Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
Definition TObject.cxx:822
static void SavePrimitiveConstructor(std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
Save object constructor in the output stream "out".
Definition TObject.cxx:771
A 3-dimensional polyline.
Definition TPolyLine3D.h:33
TPolyLine3D & operator=(const TPolyLine3D &polylin)
assignment operator
virtual void SetPoint(Int_t point, Double_t x, Double_t y, Double_t z)
Set point n to x, y, z.
Int_t fN
Number of points.
Definition TPolyLine3D.h:35
TString fOption
options
Definition TPolyLine3D.h:37
virtual void SetPolyLine(Int_t n, Option_t *option="")
Re-initialize polyline with n points (0,0,0).
void Streamer(TBuffer &) override
Stream a 3-D polyline object.
Manages a detector rotation matrix.
Definition TRotMatrix.h:28
virtual Double_t * GetMatrix()
Definition TRotMatrix.h:54
Basic string class.
Definition TString.h:138
Ssiz_t Length() const
Definition TString.h:425
TString & ReplaceSpecialCppChars()
Find special characters which are typically used in printf() calls and replace them by appropriate es...
Definition TString.cxx:1121
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2384
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Double_t ACos(Double_t)
Returns the principal value of the arc cosine of x, expressed in radians.
Definition TMath.h:643
Double_t ATan2(Double_t y, Double_t x)
Returns the principal value of the arc tangent of y/x, expressed in radians.
Definition TMath.h:657
Double_t Sqrt(Double_t x)
Returns the square root of x.
Definition TMath.h:673
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Definition TMath.h:605
constexpr Double_t Pi()
Definition TMath.h:40
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Definition TMath.h:599
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:124
TMarker m
Definition textangle.C:8