/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Event/DstEvent/DstEvent-00-02-51/DstEvent/DstMdcKalTrack.h

Go to the documentation of this file.
00001 /*
00002  * @class : DstMdcKalTrack
00003  *
00004  *  this class models "Kalman Track" from Mdc 
00005  * 
00006  * ********************************************************/
00007 
00008 #ifndef DSTMDCKALTRACK_H
00009 #define DSTMDCKALTRACK_H
00010 #include "GaudiKernel/ContainedObject.h"
00011 #include "GaudiKernel/SmartRef.h" 
00012 #include "GaudiKernel/ObjectVector.h"
00013 #include "EventModel/EventModel.h"
00014 #include "CLHEP/Matrix/Vector.h"
00015 #include "CLHEP/Matrix/SymMatrix.h"
00016 #include "CLHEP/Vector/ThreeVector.h"
00017 #include "CLHEP/Geometry/Point3D.h"
00018 #include "CLHEP/Vector/LorentzVector.h"
00019 #include <vector>
00020 
00021 #ifndef ENABLE_BACKWARDS_COMPATIBILITY
00022 //  backwards compatibility will be enabled ONLY in CLHEP 1.9
00023 typedef HepGeom::Point3D<double> HepPoint3D;
00024 #endif
00025 using namespace CLHEP;
00026 
00027 using namespace EventModel;
00028 using CLHEP::HepVector;
00029 using CLHEP::HepSymMatrix;
00030 extern const CLID& CLID_DstMdcKalTrack;  
00031 
00032 
00033 class DstMdcKalTrack : virtual public ContainedObject {
00034 
00035  public:
00036    virtual const CLID& clID() const   {
00037       return DstMdcKalTrack::classID();
00038    }
00039    
00040    static const CLID& classID()       {
00041       return CLID_DstMdcKalTrack;
00042    }                     
00043    //cconstructor and destructor
00044    DstMdcKalTrack();
00045    DstMdcKalTrack(const DstMdcKalTrack& track);
00046    DstMdcKalTrack& operator=(const DstMdcKalTrack&);
00047    ~DstMdcKalTrack();
00048 
00049    enum PidType
00050    {
00051      null = -1,
00052      electron = 0,
00053      muon = 1,
00054      pion = 2,
00055      kaon = 3,
00056      proton = 4
00057    };
00058    
00059    static void setPidType(PidType pidType) {m_pidType = pidType; } 
00060    static PidType getPidType() {return m_pidType; }
00061    
00062    //extractors
00063    const int trackId()  const { return m_trackId;          }
00064    const double mass()  const { return m_mass[m_pidType];  }
00065    const int charge()   const { return m_charge[m_pidType];}
00066    const double pxy()   const { return m_pxy[m_pidType];   } 
00067    const double px()    const { return m_px[m_pidType];    }
00068    const double py()    const { return m_py[m_pidType];    }
00069    const double pz()    const { return m_pz[m_pidType];    }
00070    const double theta() const { return m_theta[m_pidType]; }
00071    const double phi()   const { return m_phi[m_pidType];   }
00072      
00073    const double x()     const { return m_x[m_pidType];     }   
00074    const double y()     const { return m_y[m_pidType];     }
00075    const double z()     const { return m_z[m_pidType];     }      
00076 
00077    const double x(const int i)  const {return m_x[i];}
00078    const double y(const int i)  const {return m_y[i];}
00079    const double z(const int i)  const {return m_z[i];}
00080        
00081    const double r()           const {return m_r[m_pidType];}
00082    const double p()           const {return m_p[m_pidType];}
00083    const int    stat()        const {return m_stat[0][m_pidType];}
00084    const double chi2()        const {return m_chisq[0][m_pidType];}
00085    const int    ndof()        const {return m_ndf[0][m_pidType];}
00086    const int    nster()       const {return m_nster[0][m_pidType];}
00087    const int    firstLayer()  const {return m_firstLayer[0][m_pidType];}
00088    const int    lastLayer()   const {return m_lastLayer[0][m_pidType];}
00089    const int    nlayer()      const {return m_nlayer[m_pidType];}
00090    
00091    const double  dr( void )   const { return m_zhelixs[m_pidType][0];   }
00092    const double fi0( void )   const { return m_zhelixs[m_pidType][1];   }
00093    const double kappa( void ) const { return m_zhelixs[m_pidType][2];   }
00094    const double dz( void )    const { return m_zhelixs[m_pidType][3];   }
00095    const double tanl( void )  const { return m_zhelixs[m_pidType][4];   }
00096 
00097    const HepVector& helix()    const { return m_zhelixs[m_pidType];     }
00098    const HepSymMatrix& err()   const { return m_zerrors[m_pidType];     }
00099    const HepVector& fhelix()    const { return m_fhelixs[m_pidType];     }
00100    const HepSymMatrix& ferr()   const { return m_ferrors[m_pidType];     }
00101    const HepPoint3D poca()     const { return m_pocas[m_pidType];       }
00102    const Hep3Vector p3()       const;
00103    const HepPoint3D x3()       const;
00104    const HepLorentzVector p4() const;
00105    const HepLorentzVector p4(double mass) const;
00106    
00107 //modifiers
00108    void setTrackId(int trackId)                    { m_trackId = trackId;   }
00109    void setMass(double mass, int pid)               { m_mass[pid] = mass;    }
00110    void setCharge(const int charge, const int pid) { m_charge[pid] = charge;}
00111    void setPxy(const double pxy, const int pid)    { m_pxy[pid] = pxy;      }
00112    void setPx(const double px, const int pid)      { m_px[pid] = px;        }
00113    void setPy(const double py, const int pid)      { m_py[pid] = py;        }
00114    void setPz(const double pz, const int pid)      { m_pz[pid] = pz;        }
00115    void setP(const double p, const int pid)        { m_p[pid] = p;          }
00116    void setTheta(const double theta,const int pid) { m_theta[pid] = theta;  }
00117    void setPhi(const double phi, const int pid)    { m_phi[pid] = phi;      }
00118    void setX(const double x, const int pid)        { m_x[pid] = x;          }
00119    void setY(const double y,const int pid)         { m_y[pid] = y;          }
00120    void setZ(const double z, const int pid)        { m_z[pid] = z;          }
00121    void setR(const double r, const int pid)        { m_r[pid] = r;          }
00122    void setNlayer(int nlayer, int pid)             { m_nlayer[pid] = nlayer;    }
00123    void setNster(int ns,  int i, int pid)          { m_nster[i][pid] = ns;     }
00124    void setStat(int stat, int i, int pid)          { m_stat[i][pid] = stat;    }
00125    void setChisq(double chisq, int i, int pid)      { m_chisq[i][pid] = chisq;  }
00126    void setFirstLayer(int fL, int i, int pid)      { m_firstLayer[i][pid] = fL; }
00127    void setLastLayer(int lL, int i, int pid)       { m_lastLayer[i][pid] = lL;  }
00128    void setNhits(int nhits,  int pid)              { m_nhits[pid] = nhits;   }  
00129    void setNdf(int ndf, int i, int pid)            { m_ndf[i][pid] = ndf;    }
00130 
00131    void setPoca(const HepPoint3D& poca, const int pid){
00132      m_pocas[pid] = poca;
00133    }
00134 
00135    void setPoca(double*  poca, const int pid){
00136      for(int i=0; i<3; i++){
00137        m_pocas[pid][i] = poca[i];
00138      }                                                              
00139    }
00140    
00141    void setZHelix(const HepVector& helix, const int pid)  {
00142      m_zhelixs[pid] = helix;
00143    }
00144 
00145    void setZError(const HepSymMatrix& error, const int pid) { 
00146       m_zerrors[pid] = error;
00147    }
00148    void setZHelix(double* helix, const int pid)  {
00149       for(int i=0; i<5; i++) {
00150         m_zhelixs[pid][i] = helix[i]; 
00151       }
00152    }
00153 
00154    void setZError(double* error, const int pid) {
00155       int k=0;
00156       HepSymMatrix mat(5);
00157       for(int i=0; i<5 ; i++) {
00158          for(int j=0; j<=i; j++,k++) {
00159          mat[i][j] = error[k];
00160          mat[j][i] = error[k];      
00161         }      
00162       }
00163       m_zerrors[pid] = mat;
00164    }
00165 
00166    void setFHelix(const HepVector& fhelix, const int pid)  {
00167      m_fhelixs[pid] = fhelix;
00168    }
00169 
00170    void setFError(const HepSymMatrix& ferror, const int pid) { 
00171       m_ferrors[pid] = ferror;
00172    }
00173    void setFHelix(double* fhelix, const int pid)  {
00174       for(int i=0; i<5; i++) {
00175         m_fhelixs[pid][i] = fhelix[i]; 
00176       }
00177    }
00178 
00179    void setFError(double* ferror, const int pid) {
00180       int k=0;
00181       HepSymMatrix mat(5);
00182       for(int i=0; i<5 ; i++) {
00183          for(int j=0; j<=i; j++,k++) {
00184          mat[i][j] = ferror[k];
00185          mat[j][i] = ferror[k];     
00186         }      
00187       }
00188       m_ferrors[pid] = mat;
00189    }
00190   const int getTrackId()                 const { return m_trackId;        } 
00191   const int getCharge(const int pid)     const { return m_charge[pid];    }   
00192   const int getStat( const int pid)      const { return m_stat[0][pid];      }
00193   const int  getNster(const int pid)     const { return m_nster[0][pid];     }
00194   const double getChisq(const int pid)   const { return m_chisq[0][pid];     }
00195   const int getNdf(const int pid)        const { return m_ndf[0][pid];       }
00196   const int getFirstLayer(const int pid) const { return m_firstLayer[0][pid];}
00197   const int getLastLayer(const int pid)  const { return m_lastLayer[0][pid]; }
00198   const int getNlayer(const int pid)  const { return m_nlayer[pid]; }
00199 
00200   
00201   const HepPoint3D& getPoca(const int pid) const{ 
00202     return m_pocas[pid];
00203   }
00204   const HepVector& getZHelix(const int pid) const{
00205      return m_zhelixs[pid];
00206    } 
00207   const HepSymMatrix& getZError(const int pid) const{
00208      return m_zerrors[pid];
00209    }
00210   const HepVector& getFHelix(const int pid) const{
00211      return m_fhelixs[pid];
00212    } 
00213   const HepSymMatrix& getFError(const int pid) const{
00214      return m_ferrors[pid];
00215    }
00216  
00217    
00218  protected:
00219    static PidType m_pidType; 
00220    int    m_trackId;   // Track ID wensp add 2005-10-18
00221    int    m_charge[5];
00222    int    m_stat[2][5];
00223    int    m_nster[2][5];
00224    int    m_firstLayer[2][5];
00225    int    m_lastLayer[2][5];
00226    double m_mass[5];
00227    double m_chisq[2][5]; 
00228    double m_pxy[5];
00229    double m_px[5];
00230    double m_py[5];
00231    double m_pz[5];
00232    double m_p[5];
00233    double m_theta[5];
00234    double m_phi[5];
00235    double m_x[5];
00236    double m_y[5];
00237    double m_z[5];
00238    double m_r[5];
00239    //double m_chi2[2][5];  // chi square of forward filter 
00240    int    m_ndf[2][5];    // degree of freedom of forward filter
00241    int    m_nhits[5];
00242    int    m_nlayer[5];
00243      
00244    std::vector<HepPoint3D>   m_pocas;   // 
00245    std::vector<HepVector>    m_zhelixs; // 
00246    std::vector<HepSymMatrix> m_zerrors; // 
00247    std::vector<HepVector>    m_fhelixs; // 
00248    std::vector<HepSymMatrix> m_ferrors; // 
00249 };
00250 
00251 typedef ObjectVector<DstMdcKalTrack> DstMdcKalTrackCol;
00252 
00253 #endif
00254    

Generated on Tue Nov 29 22:58:23 2016 for BOSS_7.0.2 by  doxygen 1.4.7