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];
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];
110 if (range) {r1 = range[0]; r2 = range[1];}
161 r[0] = range[0];
r[1] = range[1];
163 r[0] = 0.0;
r[1] = 1.0;
168 SetHelix(xyz,
v, w,
r, rType, axis);
170 SetHelix(xyz,
v, w,
r, rType);
191 for(
Int_t i=0; i<3; i++)
195 for(
Int_t i=0; i<2; i++)
216 ((
THelix&)helix).THelix::Copy(*
this);
235 for (
Int_t i=0; i<3; i++)
269 std::cout <<
" THelix Printing N=" <<
fN<<
" Option="<<option<<std::endl;
279 TString::Format(
"%g, %g, %g, %g, %g, %g, %g",
fX0,
fY0,
fZ0,
fVt *
TMath::Cos(
fPhi0),
283 out <<
" helix->SetRange(" <<
fRange[0] <<
", " <<
fRange[1] <<
", kHelixT);\n";
286 out <<
" helix->SetAxis(" <<
fAxis[0] <<
", " <<
fAxis[1] <<
", " <<
fAxis[2] <<
");\n";
288 out <<
" helix->SetOption(\"" << TString(
fOption).ReplaceSpecialCppChars() <<
"\");\n";
303 Error(
"SetAxis()",
"Impossible! axis length %lf <= 0!", len);
306 fAxis[0] = axis[0]/len;
307 fAxis[1] = axis[1]/len;
308 fAxis[2] = axis[2]/len;
325 Double_t axis[3]; axis[0] =
x; axis[1] =
y; axis[2] = z;
342 if (
fW != 0 &&
fVz != 0 ) {
348 for (i=0; i<2; i++ ) {
350 if (
a[i] < -1 ||
a[i] > 1 ) {
352 "range out of bound (%lf:%lf): %lf. Default used: %lf",
362 for (i=0; i<2; i++ ) {
364 if (
a[i] < -1 ||
a[i] > 1 ) {
366 "range out of bound (%lf:%lf): %lf. Default used: %lf",
377 for (i=0; i<2; i++ ) {
382 "Vz = 0 and attempts to set range along helix axis!");
390 printf(
"setting range in lab axes is not implemented yet\n");
393 Error(
"SetRange()",
"unknown range type %d", rType);
396 }
else if (
fW == 0 ) {
407 "Vx = 0 and attempts to set range on helix x axis!");
417 "Vy = 0 and attempts to set range on helix y axis!");
427 "Vz = 0 and attempts to set range on helix z axis!");
434 printf(
"setting range in lab axes is not implemented yet\n");
437 Error(
"SetRange()",
"unknown range type %d", rType);
440 }
else if (
fVz == 0 ) {
450 "Vx = 0 and attempts to set range on helix x axis!");
460 "Vy = 0 and attempts to set range on helix y axis!");
466 "Vz = 0 and attempts to set range on helix z axis!");
471 printf(
"setting range in lab axes is not implemented yet\n");
474 Error(
"SetRange()",
"unknown range type %d", rType);
498 for (i=0; i<=nSeg; i++) {
500 if (i==nSeg) t =
fRange[1];
501 else t =
fRange[0] + dt * i;
512 for (i=0; i<=nSeg; i++) {
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] ;
519 delete[] xl;
delete[] yl;
delete[] zl;
529 range[0] = r1; range[1] = r2;
564 fRotMat =
new TRotMatrix(
"HelixRotMat",
"Master frame -> Helix frame",
565 theta1, phi1, theta2, phi2, theta3, phi3 );
580 while ( phi1 - phi0 > pi ) phi1 -= twopi;
581 while ( phi1 - phi0 < -pi ) phi1 += twopi;
583 while ( phi2 - phi0 > pi ) phi2 -= twopi;
584 while ( phi2 - phi0 < -pi ) phi2 += twopi;
int Int_t
Signed integer 4 bytes (int).
short Version_t
Class version identifier (short).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
void Copy(TAttLine &attline) const
Buffer base class used for serializing objects.
virtual Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual Int_t ReadStaticArray(Bool_t *b)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
void Print(Option_t *option="") const override
This method must be overridden when a class wants to print itself.
virtual void SetRange(Double_t *range, EHelixRangeType rtype=kHelixZ)
void Copy(TObject &helix) const override
Copy this to obj.
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)
THelix & operator=(const THelix &)
TClass * IsA() const override
void Streamer(TBuffer &) override
Stream an object of class TObject.
virtual void SetAxis(Double_t const *axis)
Double_t FindClosestPhase(Double_t phi0, Double_t cosine)
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
void Draw(Option_t *option="") override
Default Draw method for all objects.
Mother of all ROOT objects.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
virtual void Copy(TObject &object) const
Copy this to obj.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
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.
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".
TPolyLine3D & operator=(const TPolyLine3D &polylin)
Int_t fN
Number of points.
virtual void SetPoint(Int_t point, Double_t x, Double_t y, Double_t z)
void Streamer(TBuffer &) override
Stream an object of class TObject.
virtual void SetPolyLine(Int_t n, Option_t *option="")
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Double_t ACos(Double_t)
Returns the principal value of the arc cosine of x, expressed in radians.
Double_t ATan2(Double_t y, Double_t x)
Returns the principal value of the arc tangent of y/x, expressed in radians.
Double_t Sqrt(Double_t x)
Returns the square root of x.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.