/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Mdc/MdcRecEvent/MdcRecEvent-00-05-14/MdcRecEvent/RecMdcKalTrack.h

Go to the documentation of this file.
00001 /*
00002  * @class : RecMdcKalTrack
00003  *
00004  *  this class models "Kalman Track" used in Mdc Reconstruction
00005  *
00006  *  by wangjk 2006.9
00007  * 
00008  * ********************************************************/
00009 
00010 #ifndef RECMDCKALTRACK_H
00011 #define RECMDCKALTRACK_H
00012 #include "GaudiKernel/ContainedObject.h"
00013 #include "GaudiKernel/SmartRef.h" 
00014 #include "GaudiKernel/SmartRefVector.h"
00015 #include "GaudiKernel/ObjectVector.h"
00016 #include "EventModel/EventModel.h"
00017 #include "DstEvent/DstMdcKalTrack.h"
00018 #include "CLHEP/Matrix/Vector.h"
00019 #include "CLHEP/Matrix/SymMatrix.h"
00020 #include "CLHEP/Vector/ThreeVector.h"
00021 #include "CLHEP/Geometry/Point3D.h"
00022 #include "RecMdcKalHelixSeg.h"
00023 
00024 
00025 extern const CLID& CLID_RecMdcKalTrack;  
00026 
00027 typedef SmartRefVector<RecMdcKalHelixSeg>  HelixSegRefVec;
00028 
00029 
00030 class RecMdcKalTrack : public DstMdcKalTrack {
00031 
00032         public:
00033                 virtual const CLID& clID() const   {
00034                         return RecMdcKalTrack::classID();
00035                 }
00036 
00037                 static const CLID& classID()       {
00038                         return CLID_RecMdcKalTrack;
00039                 }                     
00040                 //constructor and destructor
00041                 RecMdcKalTrack();
00042                 RecMdcKalTrack(const RecMdcKalTrack& track);
00043                 RecMdcKalTrack(const DstMdcKalTrack& track);
00044                 RecMdcKalTrack& operator=(const RecMdcKalTrack&);
00045                 RecMdcKalTrack& operator=(const DstMdcKalTrack&);
00046                 ~RecMdcKalTrack();
00047 
00048                 //extractors
00049                 HelixSegRefVec getVecHelixSegs(int pid=-1) const;//2011-05-06
00050 
00051                 int getTrackId( void )                        const { return m_trackId;            }
00052                 double getMass( int pid )                     const { return m_mass[pid];          }
00053                 double getLength( int pid )                   const { return m_length[pid];        }
00054                 double getTof( int pid )                      const { return m_tof[pid];           }
00055                 int getNhits( int pid )                       const { return m_nhits[pid];         }
00056                 int getStat( int i, int pid )                 const { return m_stat[i][pid];       }
00057                 int getNster(const int i, const int pid)      const { return m_nster[i][pid];      }
00058                 int getFirstLayer(const int i, const int pid) const { return m_firstLayer[i][pid]; }
00059                 int getLastLayer(const int i, const int pid)  const { return m_lastLayer[i][pid];  } 
00060                 double getChisq( int i, int pid )             const { return m_chisq[i][pid];      }
00061                 int    getNdf( int i, int pid )               const { return m_ndf[i][pid];        }
00062                 double getPathl( int i )                      const { return m_pathl[i];           }
00063                 double getPathSM( int pid)                    const { return m_pathSM[pid];        }
00064 
00065 
00066                 const HepVector&    getZHelix() const { return m_zhelixs[2]; }
00067                 const HepSymMatrix& getZError() const { return m_zerrors[2]; }
00068                 const HepVector&    getFHelix() const { return m_fhelixs[2]; }
00069                 const HepSymMatrix& getFError() const { return m_ferrors[2]; }
00070                 const HepVector&    getLHelix() const { return m_lhelixs[2]; }
00071                 const HepSymMatrix& getLError() const { return m_lerrors[2]; }   
00072                 const double    getTHelix(const int i) const { return m_thelix[i]; }
00073                 const double    getTError(const int i) const { return m_terror[i]; }
00074                 const HepVector getTHelix()  const { return m_ta; }
00075                 const HepSymMatrix getTError() const { return m_tEa; }
00076 
00077                 HepVector&     getZHelixE() { return m_zhelixs[0]; }
00078                 HepSymMatrix&  getZErrorE() { return m_zerrors[0]; }
00079                 HepVector&     getFHelixE() { return m_fhelixs[0]; }
00080                 HepSymMatrix&  getFErrorE() { return m_ferrors[0]; }   
00081                 HepVector&     getLHelixE() { return m_lhelixs[0]; }
00082                 HepSymMatrix&  getLErrorE() { return m_lerrors[0]; }   
00083 
00084                 HepVector&    getZHelixMu() { return m_zhelixs[1]; }
00085                 HepSymMatrix& getZErrorMu() { return m_zerrors[1]; }
00086                 HepVector&    getFHelixMu() { return m_fhelixs[1]; }
00087                 HepSymMatrix& getFErrorMu() { return m_ferrors[1]; }   
00088                 HepVector&    getLHelixMu() { return m_lhelixs[1]; }
00089                 HepSymMatrix& getLErrorMu() { return m_lerrors[1]; } 
00090 
00091                 HepVector&     getZHelixK() { return m_zhelixs[3]; }
00092                 HepSymMatrix&  getZErrorK() { return m_zerrors[3]; }
00093                 HepVector&     getFHelixK() { return m_fhelixs[3]; }
00094                 HepSymMatrix&  getFErrorK() { return m_ferrors[3]; }   
00095                 HepVector&     getLHelixK() { return m_lhelixs[3]; }
00096                 HepSymMatrix&  getLErrorK() { return m_lerrors[3]; } 
00097 
00098                 HepVector&     getZHelixP() { return m_zhelixs[4]; }
00099                 HepSymMatrix&  getZErrorP() { return m_zerrors[4]; }
00100                 HepVector&     getFHelixP() { return m_fhelixs[4]; }
00101                 HepSymMatrix&  getFErrorP() { return m_ferrors[4]; }   
00102                 HepVector&     getLHelixP() { return m_lhelixs[4]; }
00103                 HepSymMatrix&  getLErrorP() { return m_lerrors[4]; }   
00104 
00105                 const HepPoint3D getPocaE()  const { return m_pocas[0]; }
00106                 const HepPoint3D getPocaMu() const { return m_pocas[1]; }
00107                 const HepPoint3D getPoca()   const { return m_pocas[2]; }
00108                 const HepPoint3D getPocaK()  const { return m_pocas[3]; }
00109                 const HepPoint3D getPocaP()  const { return m_pocas[4]; }
00110 
00111                 const HepPoint3D&  getLPointE()  const { return m_lpoints[0]; }
00112                 const HepPoint3D&  getLPointMu() const { return m_lpoints[1]; }
00113                 const HepPoint3D&  getLPoint()   const { return m_lpoints[2]; }
00114                 const HepPoint3D&  getLPointK()  const { return m_lpoints[3]; }
00115                 const HepPoint3D&  getLPointP()  const { return m_lpoints[4]; }
00116 
00117                 const HepPoint3D&  getLPivotE()  const { return m_lpivots[0]; }
00118                 const HepPoint3D&  getLPivotMu() const { return m_lpivots[1]; }
00119                 const HepPoint3D&  getLPivot()   const { return m_lpivots[2]; }
00120                 const HepPoint3D&  getLPivotK()  const { return m_lpivots[3]; }
00121                 const HepPoint3D&  getLPivotP()  const { return m_lpivots[4]; }
00122 
00123                 // const HepVector&    getZHelix(const int pid) const { return m_zhelixs[pid];}
00124                 // const HepSymMatrix& getZError(const int pid) const { return m_zerrors[pid];}
00125                 const HepVector&    getLHelix(const int pid) const { return m_lhelixs[pid];}
00126                 const HepSymMatrix& getLError(const int pid) const { return m_lerrors[pid];}
00127                 //const HepVector&    getFHelix(const int pid) const { return m_fhelixs[pid];}
00128                 //const HepSymMatrix& getFError(const int pid) const { return m_ferrors[pid];}
00129                 const HepPoint3D&   getPoca(const int pid)   const { return   m_pocas[pid];}
00130                 const HepPoint3D&   getLPoint(const int pid) const { return m_lpoints[pid];}
00131                 const double        getFiTerm(const int pid) const { return m_fiTerm[pid]; }
00132                 const HepPoint3D&   getLPivot(const int pid) const { return m_lpivots[pid];}
00133 
00134 
00135                 const double getZDr(void)   const { return m_zhelixs[2][0];   }
00136                 const double getZFi0(void)  const { return m_zhelixs[2][1];   }
00137                 const double getZCpa(void)  const { return m_zhelixs[2][2];   }
00138                 const double getZDz(void)   const { return m_zhelixs[2][3];   }
00139                 const double getZTanl(void) const { return m_zhelixs[2][4];   }
00140 
00141                 const double getLDr(void)   const { return m_lhelixs[2][0];   }
00142                 const double getLFi0(void)  const { return m_lhelixs[2][1];   }
00143                 const double getLCpa(void)  const { return m_lhelixs[2][2];   }
00144                 const double getLDz(void)   const { return m_lhelixs[2][3];   }
00145                 const double getLTanl(void) const { return m_lhelixs[2][4];   }
00146 
00147                 const double getFDr(void)   const { return m_fhelixs[2][0];   }
00148                 const double getFFi0(void)  const { return m_fhelixs[2][1];   }
00149                 const double getFCpa(void)  const { return m_fhelixs[2][2];   }
00150                 const double getFDz(void)   const { return m_fhelixs[2][3];   }
00151                 const double getFTanl(void) const { return m_fhelixs[2][4];   }
00152 
00153 
00154                 // modifiers
00155                 void setVecHelixSegs(const HelixSegRefVec& vechelixsegs, int pid=-1);// 2011-05-06
00156 
00157 
00158                 //void setTrackId(int id)                      { m_trackId = id;           }
00159                 void setMass(double mass, int pid)             { m_mass[pid] = mass;       }
00160                 void setLength(double length, int pid)         { m_length[pid] = length;   }
00161                 void setTof(double tof, int pid)               { m_tof[pid] = tof;         }   
00162                 void setNhits(int nhits, int pid)              { m_nhits[pid] = nhits;     }
00163                 //void setStat(int stat, int i, int pid)       { m_stat[i][pid] = stat;    }
00164                 //void setChisq(double chisq, int i, int pid)  { m_chisq[i][pid] = chisq;  }
00165                 //void setNdf(int ndf, int i, int pid)         { m_ndf[i][pid] = ndf;      }
00166                 //void setNster(int nster, int i, int pid)     { m_nster[i][pid] = nster;  }
00167                 //void setFirstLayer(int fL, int i, int pid)   { m_firstLayer[i][pid] = fL;}
00168                 //void setLastLayer(int lL, int i, int pid)    { m_lastLayer[i][pid] = lL; }
00169                 void setPathl(double pathl, int i)             { m_pathl[i] = pathl;       }   
00170                 void setPathSM(double length, int pid)         { m_pathSM[pid] = length;   }
00171 
00172 
00173                 /*
00174                    void setZHelix(const HepVector& helix, const int pid)  {
00175                    m_zhelixs[pid] = helix;
00176                    }
00177                    void setZError(const HepSymMatrix& error, const int pid) { 
00178                    m_zerrors[pid] = error;
00179                    }
00180                    void setZHelix(float* helix, const int pid)  {
00181                    for(int i=0; i<3; i++) {
00182                    m_zhelixs[pid][i] = helix[i]; 
00183                    }
00184                    }
00185                    void setZError(float* error, const int pid) {
00186                    int k=0;
00187                    HepSymMatrix mat(5);
00188                    for(int i=0; i<5 ; i++) {
00189                    for(int j=0; j<=i; j++,k++) {
00190                    mat[i][j] = error[k];
00191                    mat[j][i] = error[k];            
00192                    }      
00193                    }
00194                    m_zerrors[pid] = mat;
00195                    }
00196                  */
00197 
00198                 //  void setFHelix(const HepVector& helix, const int pid)  {
00199                 //    m_fhelixs[pid] = helix;
00200                 //  }
00201                 //  void setFError(const HepSymMatrix& error, const int pid) {
00202                 //    m_ferrors[pid] = error;
00203                 //  }
00204                 //  void setFHelix(double* helix, const int pid)  {
00205                 //    for(int i=0; i<5; i++) {
00206                 //      m_fhelixs[pid][i] = helix[i];
00207                 //    }
00208                 //  }
00209                 //  void setFError(double* error, const int pid) {
00210                 //    int k=0;
00211                 //    HepSymMatrix mat(5);
00212                 //    for(int i=0; i<5 ; i++) {
00213                 //      for(int j=0; j<=i; j++,k++) {
00214                 //        mat[i][j] = error[k];
00215                 //        mat[j][i] = error[k];
00216                 //      }
00217                 //    }
00218                 //    m_ferrors[pid] = mat;
00219                 //  }
00220 
00221                 void setLHelix(const HepVector& helix, const int pid)  {
00222                         m_lhelixs[pid] = helix;
00223                 }
00224                 void setLError(const HepSymMatrix& error, const int pid) {
00225                         m_lerrors[pid] = error;
00226                 }
00227                 void setLHelix(double* helix, const int pid)  {
00228                         for(int i=0; i<5; i++) {
00229                                 m_lhelixs[pid][i] = helix[i];
00230                         }
00231                 }
00232                 void setLError(double* error, const int pid) {
00233                         int k=0;
00234                         HepSymMatrix mat(5);
00235                         for(int i=0; i<5 ; i++) {
00236                                 for(int j=0; j<=i; j++,k++) {
00237                                         mat[i][j] = error[k];
00238                                         mat[j][i] = error[k];
00239                                 }
00240                         }
00241                         m_lerrors[pid] = mat;
00242                 }
00243 
00244                 void setTHelix(const HepVector& helix)  {
00245                         for(int i=0; i<5; i++){
00246                                 m_thelix[i] = helix[i];
00247                         }
00248                         m_ta = helix;
00249                 }
00250                 void setTError(const HepSymMatrix& error) {
00251                         int k=0;
00252                         for(int i=0; i<5; i++){
00253                                 for(int j=i; j<5; j++){
00254                                         m_terror[k] = error[i][j];
00255                                         k++;
00256                                 }
00257                         }
00258                         m_tEa = error;
00259                 }
00260                 void setTHelix(double helix[5])  {
00261                         HepVector atemp(5);
00262                         for(int i=0; i<5; i++) {
00263                                 m_thelix[i] = helix[i];
00264                                 atemp[i] = helix[i];
00265                         }
00266                         m_ta = atemp;
00267                 }
00268                 void setTError(double error[15] ) {
00269                         int k=0;
00270                         HepSymMatrix mat(5);
00271                         for(int i=0; i<5 ; i++) {
00272                                 for(int j=0; j<=i; j++,k++) {
00273                                         mat[i][j] = error[k];
00274                                         mat[j][i] = mat[i][j];
00275                                 }
00276                         }
00277                         m_tEa = mat;
00278 
00279                         for(int i=0; i<15 ; i++) {
00280                                 m_terror[i] = error[i];
00281                         }
00282                 }
00283 
00284                 void setLPoint(const HepPoint3D& point, const int pid)  {
00285                         m_lpoints[pid] = point;
00286                 }
00287 
00288 
00289                 void setFiTerm(double fi, const int pid){
00290                         m_fiTerm[pid] = fi;
00291                 }
00292 
00293 
00294                 void setLPivot(const HepPoint3D& pivot, const int pid)  {
00295                         m_lpivots[pid] = pivot;
00296                 }
00297 
00298 
00299                 /*
00300                    void setPoca(const HepPoint3D& poca, const int pid)  {
00301                    m_pocas[pid] = poca;
00302                    }
00303                    void setPoca(float* poca, const int pid)  {
00304                    for(int i=0; i<3; i++) {
00305                    m_pocas[pid][i] = poca[i];                 
00306                    }
00307                    }
00308                  */
00309 
00310         private:
00311                 HelixSegRefVec m_vechelixsegs[5];// add 5 hypotheses by wangll 2011-05-06
00312                 int pidSeg;// added by wangll 2011-05-06
00313                 //int    m_trackId;
00314                 double m_mass[5];     // mass assumption during the fit 
00315                 //track path length from closest point to coord. origin to the last hit
00316                 double m_length[5]; 
00317                 double m_tof[5];      // time of flight correspond to length; 
00318                 int    m_nhits[5];      // number of total hits contained 
00319                 // status flag 0:filter 1: smoother, convention: -1:as default; 0:kalfit OK; 1: kalfit abandoned
00320                 // int    m_stat[2][5]; 
00321                 // int    m_nster[2][5];
00322                 // int    m_firstLayer[2][5];
00323                 // int    m_lastLayer[2][5];
00324                 // double m_chisq[2][5]; // chi square of fit 0:filter 1:smoother 
00325                 // int    m_ndf[2][5];   // degree of freedom for the fit 0:filter 1:smoother 
00326                 double m_pathl[43];   // path length in each layer
00327                 double m_pathSM[5];
00328                 double m_fiTerm[5];
00329 
00330                 // std::vector<HepPoint3D> m_pocas; 
00331                 // std::vector<HepVector> m_zhelixs; 
00332                 // std::vector<HepSymMatrix> m_zerrors; 
00333 
00334                 std::vector<HepPoint3D>   m_lpivots;
00335                 std::vector<HepPoint3D>   m_lpoints;
00336 
00337                 //std::vector<HepVector>    m_fhelixs;
00338                 //std::vector<HepSymMatrix> m_ferrors;
00339                 std::vector<HepVector>    m_lhelixs;
00340                 std::vector<HepSymMatrix> m_lerrors;
00341                 double  m_thelix[5];
00342                 double  m_terror[15];
00343                 HepVector  m_ta;
00344                 HepSymMatrix m_tEa;
00345 
00346 };
00347 
00348 typedef ObjectVector<RecMdcKalTrack> RecMdcKalTrackCol;
00349 
00350 #endif
00351 

Generated on Tue Nov 29 23:12:54 2016 for BOSS_7.0.2 by  doxygen 1.4.7