Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
THelix.h
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#ifndef ROOT_THelix
13#define ROOT_THelix
14
15#include "TPolyLine3D.h"
16#include "TRotMatrix.h"
17
20};
21
22
23class THelix : public TPolyLine3D {
24
25protected:
26 Double_t fX0; //Pivot's x position (see parametrization in class doc)
27 Double_t fY0; //Pivot's y position (see parametrization in class doc)
28 Double_t fZ0; //Pivot's z position (see parametrization in class doc)
29 Double_t fVt; //Transverse velocity (constant of motion)
30 Double_t fPhi0; //Initial phase, so vx0 = fVt*cos(fPhi0)
31 Double_t fVz; //Z velocity (constant of motion)
32 Double_t fW; //Angular frequency
33 Double_t fAxis[3]; //Direction unit vector of the helix axis
34 TRotMatrix *fRotMat; //Rotation matrix: axis // z --> axis // fAxis
35 Double_t fRange[2]; //Range of helix parameter t
36
37 THelix& operator=(const THelix&);
38
39 void SetRotMatrix(); //Set rotation matrix
41
42 static Int_t fgMinNSeg; //minimal number of segments in polyline
43
44public:
45 THelix();
47 Double_t vx, Double_t vy, Double_t vz,
48 Double_t w);
49 THelix(Double_t const* xyz, Double_t const* v, Double_t w,
50 Double_t const* range=nullptr, EHelixRangeType rtype=kHelixZ,
51 Double_t const* axis=nullptr);
52 THelix(const THelix &helix);
53 virtual ~THelix();
54
55 virtual void Copy(TObject &helix) const;
56 virtual void Draw(Option_t *option="");
57 Option_t *GetOption() const {return fOption.Data();}
58 virtual void Print(Option_t *option="") const;
59 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
60 virtual void SetOption(Option_t *option="") {fOption = option;}
61 virtual void SetAxis(Double_t const* axis); //Define new axis
62 virtual void SetAxis(Double_t x, Double_t y, Double_t z);
63 virtual void SetRange(Double_t * range, EHelixRangeType rtype=kHelixZ);
64 virtual void SetRange(Double_t r1, Double_t r2, EHelixRangeType rtype=kHelixZ);
65 void SetHelix(Double_t const* xyz, Double_t const* v, Double_t w,
66 Double_t const* range=nullptr, EHelixRangeType type=kUnchanged,
67 Double_t const* axis=nullptr);
68
69 ClassDef(THelix,2) //A Helix drawn as a PolyLine3D
70};
71
72#endif
double Double_t
Definition RtypesCore.h:59
const char Option_t
Definition RtypesCore.h:66
#define ClassDef(name, id)
Definition Rtypes.h:337
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 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 type
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
THelix has two different constructors.
Definition THelix.h:23
Double_t fRange[2]
Definition THelix.h:35
Double_t fZ0
Definition THelix.h:28
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:203
virtual void SetAxis(Double_t const *axis)
Set a new axis for the helix. This will make a new rotation matrix.
Definition THelix.cxx:323
virtual void Copy(TObject &helix) const
Copy this helix to obj.
Definition THelix.cxx:246
Double_t fPhi0
Definition THelix.h:30
virtual void SetOption(Option_t *option="")
Definition THelix.h:60
virtual void SetRange(Double_t *range, EHelixRangeType rtype=kHelixZ)
Set a new range for the helix. This will remake the polyline.
Definition THelix.cxx:358
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
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Definition THelix.cxx:299
virtual ~THelix()
Helix destructor.
Definition THelix.cxx:227
Double_t FindClosestPhase(Double_t phi0, Double_t cosine)
Finds the closest phase to phi0 that gives cos(phase) = cosine.
Definition THelix.cxx:598
void SetRotMatrix()
Set the rotational matrix according to the helix axis.
Definition THelix.cxx:569
Double_t fY0
Definition THelix.h:27
Double_t fVt
Definition THelix.h:29
virtual void Print(Option_t *option="") const
Dump this helix with its attributes.
Definition THelix.cxx:290
TRotMatrix * fRotMat
Definition THelix.h:34
Double_t fW
Definition THelix.h:32
static Int_t fgMinNSeg
Definition THelix.h:42
Option_t * GetOption() const
Definition THelix.h:57
Mother of all ROOT objects.
Definition TObject.h:41
A 3-dimensional polyline.
Definition TPolyLine3D.h:33
TString fOption
options
Definition TPolyLine3D.h:37
Manages a detector rotation matrix.
Definition TRotMatrix.h:28
const char * Data() const
Definition TString.h:380
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
th1 Draw()