Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
79
80////////////////////////////////////////////////////////////////////////////////
81/// Set all helix parameters.
82
83void THelix::SetHelix(Double_t const* xyz, Double_t const* v, Double_t w,
85 Double_t const* axis )
86{
87 // Define the helix frame by setting the helix axis and rotation matrix
88 SetAxis(axis);
89
90 // Calculate initial position and velocity in helix frame
91 fW = w;
94 vx0 = v[0] * m[0] + v[1] * m[1] + v[2] * m[2];
95 vy0 = v[0] * m[3] + v[1] * m[4] + v[2] * m[5];
96 vz0 = v[0] * m[6] + v[1] * m[7] + v[2] * m[8];
99 fVz = vz0;
100 fX0 = xyz[0] * m[0] + xyz[1] * m[1] + xyz[2] * m[2];
101 fY0 = xyz[0] * m[3] + xyz[1] * m[4] + xyz[2] * m[5];
102 fZ0 = xyz[0] * m[6] + xyz[1] * m[7] + xyz[2] * m[8];
103 if (fW != 0) {
104 fX0 += fVt / fW * TMath::Sin(fPhi0);
105 fY0 -= fVt / fW * TMath::Cos(fPhi0);
106 }
107
108 // Then calculate the range in t and set the polyline representation
109 Double_t r1 = 0;
110 Double_t r2 = 1;
111 if (range) {r1 = range[0]; r2 = range[1];}
112 if (rType != kUnchanged) {
113 fRange[0] = 0.0; fRange[1] = TMath::Pi(); // initialize to half round
115 }
116}
117
118////////////////////////////////////////////////////////////////////////////////
119/// Helix default constructor.
120
122{
123 fX0 = fY0 = fZ0 = fVt = fPhi0 = fVz = fAxis[0] = fAxis[1] = 0.0;
124 fAxis[2] = 1.0;
125 fW = 1.5E7; // roughly the cyclon frequency of proton in AMS
126 fRange[0] = 0.0;
127 fRange[1] = 1.0;
128 fRotMat = nullptr;
129}
130
131////////////////////////////////////////////////////////////////////////////////
132/// Helix normal constructor.
133
136 Double_t w)
137 : TPolyLine3D()
138{
139 Double_t p[3], v[3];
140 p[0] = x;
141 p[1] = y;
142 p[2] = z;
143 v[0] = vx;
144 v[1] = vy;
145 v[2] = vz;
146 Double_t *range = nullptr;
147 fRotMat = nullptr;
148
149 SetHelix(p, v, w, range, kHelixZ);
150 fOption = "";
151}
152
153////////////////////////////////////////////////////////////////////////////////
154/// Helix normal constructor.
155
157 Double_t const* range, EHelixRangeType rType, Double_t const* axis)
158 : TPolyLine3D()
159{
160 Double_t r[2];
161 if ( range ) {
162 r[0] = range[0]; r[1] = range[1];
163 } else {
164 r[0] = 0.0; r[1] = 1.0;
165 }
166
167 fRotMat = nullptr;
168 if ( axis ) { // specify axis
169 SetHelix(xyz, v, w, r, rType, axis);
170 } else { // default axis
171 SetHelix(xyz, v, w, r, rType);
172 }
173
174 fOption = "";
175}
176
177
178////////////////////////////////////////////////////////////////////////////////
179/// assignment operator
180
182{
183 if(this!=&hx) {
185 fX0=hx.fX0;
186 fY0=hx.fY0;
187 fZ0=hx.fZ0;
188 fVt=hx.fVt;
189 fPhi0=hx.fPhi0;
190 fVz=hx.fVz;
191 fW=hx.fW;
192 for(Int_t i=0; i<3; i++)
193 fAxis[i]=hx.fAxis[i];
194 delete fRotMat;
195 fRotMat = hx.fRotMat ? new TRotMatrix(*hx.fRotMat) : nullptr;
196 for(Int_t i=0; i<2; i++)
197 fRange[i]=hx.fRange[i];
198 }
199 return *this;
200}
201
202////////////////////////////////////////////////////////////////////////////////
203/// Helix destructor.
204
206{
207 if (fRotMat) delete fRotMat;
208}
209
210
211////////////////////////////////////////////////////////////////////////////////
212/// Helix copy constructor.
213
215{
216 fRotMat = nullptr;
217 ((THelix&)helix).THelix::Copy(*this);
218}
219
220
221////////////////////////////////////////////////////////////////////////////////
222/// Copy this helix to obj.
223
224void THelix::Copy(TObject &obj) const
225{
226 TObject::Copy(obj);
227 TAttLine::Copy(((THelix&)obj));
228
229 ((THelix&)obj).fX0 = fX0;
230 ((THelix&)obj).fY0 = fY0;
231 ((THelix&)obj).fZ0 = fZ0;
232 ((THelix&)obj).fVt = fVt;
233 ((THelix&)obj).fPhi0 = fPhi0;
234 ((THelix&)obj).fVz = fVz;
235 ((THelix&)obj).fW = fW;
236 for (Int_t i=0; i<3; i++)
237 ((THelix&)obj).fAxis[i] = fAxis[i];
238
239 if (((THelix&)obj).fRotMat)
240 delete ((THelix&)obj).fRotMat;
241
242 ((THelix&)obj).fRotMat = fRotMat ? new TRotMatrix(*fRotMat) : nullptr;
243
244 ((THelix&)obj).fRange[0] = fRange[0];
245 ((THelix&)obj).fRange[1] = fRange[1];
246
247 ((THelix&)obj).fOption = fOption;
248
249 //
250 // Set range and make the graphic representation
251 //
252 ((THelix&)obj).SetRange(fRange[0], fRange[1], kHelixT);
253}
254
255
256////////////////////////////////////////////////////////////////////////////////
257/// Draw this helix with its current attributes.
258
263
264
265////////////////////////////////////////////////////////////////////////////////
266/// Dump this helix with its attributes.
267
269{
270 std::cout <<" THelix Printing N=" <<fN<<" Option="<<option<<std::endl;
271}
272
273
274////////////////////////////////////////////////////////////////////////////////
275/// Save primitive as a C++ statement(s) on output stream out.
276
277void THelix::SavePrimitive(std::ostream &out, Option_t *option)
278{
279 SavePrimitiveConstructor(out, Class(), "helix",
280 TString::Format("%g, %g, %g, %g, %g, %g, %g", fX0, fY0, fZ0, fVt * TMath::Cos(fPhi0),
281 fVt * TMath::Sin(fPhi0), fVz, fW));
282
283 if ((fRange[0] != 0.) || (fRange[1] != 1.))
284 out << " helix->SetRange(" << fRange[0] << ", " << fRange[1] << ", kHelixT);\n";
285
286 if ((fAxis[0] != 0.) || (fAxis[1] != 0.) || (fAxis[2] != 1.))
287 out << " helix->SetAxis(" << fAxis[0] << ", " << fAxis[1] << ", " << fAxis[2] << ");\n";
288 if (fOption.Length())
289 out << " helix->SetOption(\"" << TString(fOption).ReplaceSpecialCppChars() << "\");\n";
290
291 SaveLineAttributes(out, "helix", 1, 1, 1);
292
293 SavePrimitiveDraw(out, "helix", option);
294}
295
296////////////////////////////////////////////////////////////////////////////////
297/// Set a new axis for the helix. This will make a new rotation matrix.
298
299void THelix::SetAxis(Double_t const* axis)
300{
301 if (axis) {
302 Double_t len = TMath::Sqrt(axis[0]*axis[0] + axis[1]*axis[1] + axis[2]*axis[2]);
303 if (len <= 0) {
304 Error("SetAxis()", "Impossible! axis length %lf <= 0!", len);
305 return;
306 }
307 fAxis[0] = axis[0]/len;
308 fAxis[1] = axis[1]/len;
309 fAxis[2] = axis[2]/len;
310 } else {
311 fAxis[0] = 0;
312 fAxis[1] = 0;
313 fAxis[2] = 1;
314 }
315
316 // Construct the rotational matrix from the axis
317 SetRotMatrix();
318}
319
320
321////////////////////////////////////////////////////////////////////////////////
322/// Set axis.
323
325{
326 Double_t axis[3]; axis[0] = x; axis[1] = y; axis[2] = z;
327 SetAxis(axis);
328}
329
330
331////////////////////////////////////////////////////////////////////////////////
332/// Set a new range for the helix. This will remake the polyline.
333
335{
336 Double_t a[2];
337 Double_t halfpi = TMath::Pi()/2.0;
338 Int_t i;
342
343 if ( fW != 0 && fVz != 0 ) { // general case
344 switch ( rType ) {
345 case kHelixT :
346 fRange[0] = range[0]; fRange[1] = range[1]; break;
347
348 case kHelixX :
349 for (i=0; i<2; i++ ) {
350 a[i] = fW / fVt * (range[i] - fX0);
351 if ( a[i] < -1 || a[i] > 1 ) {
352 Error("SetRange()",
353 "range out of bound (%lf:%lf): %lf. Default used: %lf",
354 fX0-fVt/fW, fX0+fVt/fW, range[i], fRange[i]);
355 return;
356 }
357 phase = FindClosestPhase(fPhi0+halfpi, a[i]);
358 fRange[i] = ( fPhi0 + halfpi - phase ) / fW;
359 }
360 break;
361
362 case kHelixY :
363 for (i=0; i<2; i++ ) {
364 a[i] = fW / fVt * (range[i] - fY0);
365 if ( a[i] < -1 || a[i] > 1 ) {
366 Error("SetRange()",
367 "range out of bound (%lf:%lf): %lf. Default used: %lf",
368 fY0-fVt/fW, fY0+fVt/fW, range[i], fRange[i]);
369 return;
370 }
372 fRange[i] = ( fPhi0 - phase ) / fW;
373 }
374 break;
375
376 case kHelixZ :
377 if ( fVz != 0 ) {
378 for (i=0; i<2; i++ ) {
379 fRange[i] = (range[i] - fZ0) / fVz;
380 }
381 } else { // fVz = 0, z = constant = fZ0
382 Error("SetRange()",
383 "Vz = 0 and attempts to set range along helix axis!");
384 return;
385 }
386 break;
387
388 case kLabX :
389 case kLabY :
390 case kLabZ :
391 printf("setting range in lab axes is not implemented yet\n");
392 break;
393 default:
394 Error("SetRange()","unknown range type %d", rType);
395 break;
396 }
397 } else if ( fW == 0 ) { // straight line: x = x0 + vx * t
398 switch ( rType ) {
399 case kHelixT :
400 fRange[0] = range[0]; fRange[1] = range[1];
401 break;
402 case kHelixX :
403 if ( vx != 0 ) {
404 fRange[0] = (range[0] - fX0) / vx;
405 fRange[1] = (range[1] - fX0) / vx;
406 } else {
407 Error("SetRange()",
408 "Vx = 0 and attempts to set range on helix x axis!");
409 return;
410 }
411 break;
412 case kHelixY :
413 if ( vy != 0 ) {
414 fRange[0] = (range[0] - fY0) / vy;
415 fRange[1] = (range[1] - fY0) / vy;
416 } else {
417 Error("SetRange()",
418 "Vy = 0 and attempts to set range on helix y axis!");
419 return;
420 }
421 break;
422 case kHelixZ :
423 if ( fVz != 0 ) {
424 fRange[0] = (range[0] - fZ0) / fVz;
425 fRange[1] = (range[1] - fZ0) / fVz;
426 } else {
427 Error("SetRange()",
428 "Vz = 0 and attempts to set range on helix z axis!");
429 return;
430 }
431 break;
432 case kLabX :
433 case kLabY :
434 case kLabZ :
435 printf("setting range in lab axes is not implemented yet\n");
436 break;
437 default :
438 Error("SetRange()","unknown range type %d", rType);
439 break;
440 }
441 } else if ( fVz == 0 ) { // a circle, not fully implemented yet
442 switch ( rType ) {
443 case kHelixT :
444 fRange[0] = range[0]; fRange[1] = range[1]; break;
445 case kHelixX :
446 if ( vx != 0 ) {
447 fRange[0] = (range[0] - fX0) / vx;
448 fRange[1] = (range[1] - fX0) / vx;
449 } else {
450 Error("SetRange()",
451 "Vx = 0 and attempts to set range on helix x axis!");
452 return;
453 }
454 break;
455 case kHelixY :
456 if ( vy != 0 ) {
457 fRange[0] = (range[0] - fY0) / vy;
458 fRange[1] = (range[1] - fY0) / vy;
459 } else {
460 Error("SetRange()",
461 "Vy = 0 and attempts to set range on helix y axis!");
462 return;
463 }
464 break;
465 case kHelixZ :
466 Error("SetRange()",
467 "Vz = 0 and attempts to set range on helix z axis!");
468 return;
469 case kLabX :
470 case kLabY :
471 case kLabZ :
472 printf("setting range in lab axes is not implemented yet\n");
473 break;
474 default :
475 Error("SetRange()","unknown range type %d", rType);
476 break;
477 }
478 }
479
480 if ( fRange[0] > fRange[1] ) {
481 Double_t temp = fRange[1]; fRange[1] = fRange[0]; fRange[0] = temp;
482 }
483
484 // Set the polylines in global coordinates
485 Double_t degrad = TMath::Pi() / 180.0;
486 Double_t segment = 5.0 * degrad; // 5 degree segments
487 Double_t dt = segment / TMath::Abs(fW); // parameter span on each segm.
488
489 Int_t nSeg = Int_t((fRange[1]-fRange[0]) / dt) + 1;
490 if (nSeg < THelix::fgMinNSeg) {
492 dt = (fRange[1]-fRange[0])/nSeg;
493 }
494
495 Double_t * xl = new Double_t[nSeg+1]; // polyline in local coordinates
496 Double_t * yl = new Double_t[nSeg+1];
497 Double_t * zl = new Double_t[nSeg+1];
498
499 for (i=0; i<=nSeg; i++) { // calculate xl[], yl[], zl[];
500 Double_t t, phase2;
501 if (i==nSeg) t = fRange[1]; // the last point
502 else t = fRange[0] + dt * i;
503 phase2 = -fW * t + fPhi0;
504 xl[i] = fX0 - fVt/fW * TMath::Sin(phase2);
505 yl[i] = fY0 + fVt/fW * TMath::Cos(phase2);
506 zl[i] = fZ0 + fVz * t;
507 }
508
509 Float_t xg, yg,zg; // global coordinates
510 // must be Float_t to call TPolyLine3D::SetPoint()
513 for (i=0; i<=nSeg; i++) { // m^{-1} = transpose of m
514 xg = xl[i] * m[0] + yl[i] * m[3] + zl[i] * m[6] ;
515 yg = xl[i] * m[1] + yl[i] * m[4] + zl[i] * m[7] ;
516 zg = xl[i] * m[2] + yl[i] * m[5] + zl[i] * m[8] ;
518 }
519
520 delete[] xl; delete[] yl; delete[] zl;
521}
522
523
524////////////////////////////////////////////////////////////////////////////////
525/// Set range.
526
533
534
535////////////////////////////////////////////////////////////////////////////////
536// //
537// Protected Member Functions //
538// //
539////////////////////////////////////////////////////////////////////////////////
540
541
542////////////////////////////////////////////////////////////////////////////////
543/// Set the rotational matrix according to the helix axis.
544
546{
547 // Calculate all 6 angles.
548 // Note that TRotMatrix::TRotMatrix() expects angles in degrees.
549 Double_t raddeg = 180.0 / TMath::Pi();
550 Double_t halfpi = TMath::Pi()/2.0 * raddeg;
551 // (theta3,phi3) is the helix axis
554 // (theta1,phi1) is the x-axis in helix frame
555 Double_t theta1 = theta3 + halfpi;
557 // (theta2,phi2) is the y-axis in helix frame
558 Double_t theta2 = halfpi;
559 Double_t phi2 = phi1 + halfpi;
560
561 // Delete the old rotation matrix
562 if (fRotMat) delete fRotMat;
563
564 // Make a new rotation matrix
565 fRotMat = new TRotMatrix("HelixRotMat", "Master frame -> Helix frame",
567 return;
568}
569
570
571////////////////////////////////////////////////////////////////////////////////
572/// Finds the closest phase to phi0 that gives cos(phase) = cosine
573
575{
576 const Double_t pi = TMath::Pi();
577 const Double_t twopi = TMath::Pi() * 2.0;
579 Double_t phi2 = - phi1;
580
581 while ( phi1 - phi0 > pi ) phi1 -= twopi;
582 while ( phi1 - phi0 < -pi ) phi1 += twopi;
583
584 while ( phi2 - phi0 > pi ) phi2 -= twopi;
585 while ( phi2 - phi0 < -pi ) phi2 += twopi;
586
587 // Now phi1, phi2 and phi0 are within the same 2pi range
588 // and cos(phi1) = cos(phi2) = cosine
589 if ( TMath::Abs(phi1-phi0) < TMath::Abs(phi2-phi0) ) return phi1;
590 else return phi2;
591}
592
593
594////////////////////////////////////////////////////////////////////////////////
595/// Stream an object of class THelix.
596
598{
599 if (R__b.IsReading()) {
601 Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { }
602 if (R__v > 1) {
603 R__b.ReadClassBuffer(THelix::Class(), this, R__v, R__s, R__c);
604 return;
605 }
606 //====process old versions before automatic schema evolution
608 R__b >> fX0;
609 R__b >> fY0;
610 R__b >> fZ0;
611 R__b >> fVt;
612 R__b >> fPhi0;
613 R__b >> fVz;
614 R__b >> fW;
615 R__b.ReadStaticArray(fAxis);
616 R__b >> fRotMat;
617 R__b.ReadStaticArray(fRange);
618 R__b.CheckByteCount(R__s, R__c, THelix::IsA());
619 //====end of old versions
620
621 } else {
622 R__b.WriteClassBuffer(THelix::Class(),this);
623 }
624}
#define a(i)
Definition RSha256.hxx:99
int Int_t
Definition RtypesCore.h:45
short Version_t
Definition RtypesCore.h:65
float Float_t
Definition RtypesCore.h:57
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:374
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:177
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:275
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:268
void Copy(TObject &helix) const override
Copy this helix to obj.
Definition THelix.cxx:224
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:83
THelix & operator=(const THelix &)
assignment operator
Definition THelix.cxx:181
~THelix() override
Helix destructor.
Definition THelix.cxx:205
virtual void SetAxis(Double_t const *axis)
Set a new axis for the helix. This will make a new rotation matrix.
Definition THelix.cxx:299
TClass * IsA() const override
Definition THelix.h:69
void Streamer(TBuffer &) override
Stream an object of class THelix.
Definition THelix.cxx:597
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:334
THelix()
Helix default constructor.
Definition THelix.cxx:121
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:574
void SetRotMatrix()
Set the rotational matrix according to the helix axis.
Definition THelix.cxx:545
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:277
Double_t fVt
Definition THelix.h:29
void Draw(Option_t *option="") override
Draw this helix with its current attributes.
Definition THelix.cxx:259
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:139
Ssiz_t Length() const
Definition TString.h:417
TString & ReplaceSpecialCppChars()
Find special characters which are typically used in printf() calls and replace them by appropriate es...
Definition TString.cxx:1114
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:2378
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:636
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:650
Double_t Sqrt(Double_t x)
Returns the square root of x.
Definition TMath.h:666
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Definition TMath.h:598
constexpr Double_t Pi()
Definition TMath.h:37
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Definition TMath.h:592
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:123
TMarker m
Definition textangle.C:8