Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:15:13

0001 //===========================================================
0002 /// \file sHelix.h
0003 /// \brief Idealized helix track from charged particle in TPC
0004 /// \author Carlos Perez Lara
0005 //===========================================================
0006 
0007 #include "TMath.h"
0008 
0009 class sHelix {
0010  public:
0011   sHelix();
0012   sHelix(float x0, float y0, float z0, float px, float py, float pz, float q, float b=1.5);
0013   virtual ~sHelix() {}
0014   float x(float t) {return u(t)+fX0+fR*TMath::Sin(fPhi);}
0015   float y(float t) {return v(t)+fY0-fR*TMath::Cos(fPhi);}
0016   float z(float t) {return w(t)+fZ0;}
0017   float r(float t) {return TMath::Sqrt(x(t)*x(t)+y(t)*y(t));}
0018 
0019   float u(float t) {return -fR*TMath::Sin(fPhi-fW*t);}
0020   float v(float t) {return fR*TMath::Cos(fPhi-fW*t);}
0021   float w(float t) {return fC*t;}
0022 
0023   float k() {return fR/(fR*fR+fC*fC);}
0024   float s(float t1,float t2) {return TMath::Sqrt(fR*fW*fR*fW+fC*fC)*(t2-t1);} // sqrt( x'^2 + y'^2 + z'^2 ) DeltaT
0025   void breakIntoPieces(float t1, float t2, float x[100][3]);
0026 
0027   float findFirstInterceptTo(float rd, float hz);
0028   void SaveTracktoRootScript(float ri, float ro, float z, char *filec);
0029 
0030   float W() {return fW;}
0031   float R() {return fR;}
0032   float C() {return fC;}
0033   float Phi() {return fPhi;}
0034   void Debug() {fDebug = true;}
0035 
0036  protected:
0037   float fW;
0038   float fR;
0039   float fC;
0040   float fPhi;
0041   float fX0;
0042   float fY0;
0043   float fZ0;
0044   float fDebug;
0045 };