CMS 3D CMS Logo

IgSoIdealTrack.h

Go to the documentation of this file.
00001 #ifndef IG_OPEN_INVENTOR_IG_SO_IDEAL_TRACK_H
00002 # define IG_OPEN_INVENTOR_IG_SO_IDEAL_TRACK_H
00003 
00004 //<<<<<< INCLUDES                                                       >>>>>>
00005 
00006 # include "Iguana/Inventor/interface/IgSoShapeKit.h"
00007 # include <Inventor/fields/SoSFVec3f.h>
00008 # include <Inventor/fields/SoSFFloat.h>
00009 # include <Inventor/fields/SoSFString.h>
00010 # ifdef WIN32
00011 #  include <SoWinLeaveScope.h>
00012 # endif
00013 
00014 //<<<<<< PUBLIC DEFINES                                                 >>>>>>
00015 //<<<<<< PUBLIC CONSTANTS                                               >>>>>>
00016 //<<<<<< PUBLIC TYPES                                                   >>>>>>
00017 
00018 class IgParticleChar;
00019 class SbVec2f;
00020 
00021 //<<<<<< PUBLIC VARIABLES                                               >>>>>>
00022 //<<<<<< PUBLIC FUNCTIONS                                               >>>>>>
00023 //<<<<<< CLASS DECLARATIONS                                             >>>>>>
00024 
00036 class IG_OPEN_INVENTOR_API IgSoIdealTrack : public IgSoShapeKit
00037 {
00038     SO_KIT_HEADER (IgSoIdealTrack);
00039     SO_KIT_CATALOG_ENTRY_HEADER (material);
00040     SO_KIT_CATALOG_ENTRY_HEADER (style);
00041     SO_KIT_CATALOG_ENTRY_HEADER (complexity);
00042     SO_KIT_CATALOG_ENTRY_HEADER (points);
00043     SO_KIT_CATALOG_ENTRY_HEADER (curve);
00044     SO_KIT_CATALOG_ENTRY_HEADER (debugStyle);
00045     SO_KIT_CATALOG_ENTRY_HEADER (debugPoints);
00046 
00047 public:
00048     IgSoIdealTrack (void);
00049     static void initClass (void);
00050 
00051     // Track properties
00052     SoSFFloat   phi;            //< Dip angle of helix  wrt z axis
00053     SoSFFloat   radius;         //< Radius of curvature
00054     SoSFFloat   zeta;           //< Radius/tan (theta)=pz/ptot, theta being the dip angle; pz/pt for zero b-field
00055     SoSFVec3f   vertex;         //< Vertex position
00056     SoSFFloat   tstart;         //< time at beginning of track (not necessarily visible)    
00057     SoSFFloat   tend;           //< time at end of track (not necessarily visible)
00058     SoSFString  particleType;   //< Name follow IgParticleChar conventions
00059 
00060     // Display parameters
00061     SoSFFloat   t0;             //< time at beginning of visible track
00062     SoSFFloat   dt;             //< timespan of visible track
00063 
00064 
00065     // Helper methods to initialise track properties
00066     void                initialise (double *vx, double *vy, double *vz, 
00067                                     double *px, double *py, double *pz, 
00068                                     float *t0, IgParticleChar *pc);
00069     void                initialise (double vx, double vy, double vz, 
00070                                     double px, double py, double pz, 
00071                                     float t0, IgParticleChar *pc);
00072     void                initialise (double vx, double vy, double vz, 
00073                                     double px, double py, double pz, 
00074                                     float t0, int pid);
00075     // methods to initialise environmental variables
00076     static void         setBField (float val);  //< set the value of the global B field
00077     static void         setRMax (float val);    //< set the radius of the visible region
00078     static void         setZMax (float val);    //< set the z extent of the visible region
00079         // and return them
00080         static float    getBField (void);
00081         static float    getRMax (void);
00082         static float    getZMax (void);
00083 
00084     // convenience methods to get physics parameters
00085     float               ptot (void) const;
00086     float               pt (void) const;
00087 
00088 protected:
00089     virtual void        refresh (void);
00090     virtual            ~IgSoIdealTrack (void);
00091     
00092 protected:
00093     void                initEndPts (void);
00094     float               timeToAngle (float time);
00095     float               angleToTime (float angle);
00096     float               zToTime (float z);
00097     float               timeToZ (float time);
00098     SbVec2f             timeToXY (float time);
00099 
00100     IgParticleChar      *m_particleChar;
00101     float               m_ptot;   //total momentum
00102     float               m_pt;     //transverse momentum
00103     float               m_charge;
00104 private:
00105     // Environment parameters
00106     static float        bfield;         //< constant bfield in tesla
00107     static float        rmax;           //< max radius in central tracker
00108     static float        zmax;           //< max z extent
00109 
00110 };
00111 
00112 //<<<<<< INLINE PUBLIC FUNCTIONS                                        >>>>>>
00113 inline void IgSoIdealTrack::setBField (float val) { bfield = val; }
00114 inline void IgSoIdealTrack::setRMax   (float val) { rmax = val; }
00115 inline void IgSoIdealTrack::setZMax   (float val) { zmax = val; }
00116 inline float IgSoIdealTrack::ptot      (void) const { return m_ptot; }
00117 inline float IgSoIdealTrack::pt       (void) const { return m_pt; }
00118 inline float IgSoIdealTrack::getBField (void) { return bfield; }
00119 inline float IgSoIdealTrack::getRMax (void) { return rmax; }
00120 inline float IgSoIdealTrack::getZMax (void) { return zmax; }
00121 //<<<<<< INLINE MEMBER FUNCTIONS                                        >>>>>>
00122 
00123 # ifdef WIN32
00124 #  include <SoWinEnterScope.h>
00125 # endif
00126 #endif // IG_OPEN_INVENTOR_IG_SO_IDEAL_TRACK_H

Generated on Tue Jun 9 17:38:43 2009 for CMSSW by  doxygen 1.5.4