/Home/aooliver/hepsoft/lcdroot/LCDRootApps/PhUtil/inc/LCDVToplVRT.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 // $Id: LCDVToplVRT.h,v 1.4 2001/10/08 17:52:28 toshi Exp $
00003 // ----------------------------------------------------------------------------
00004 //
00005 // LCDVToplVRT.h
00006 // August   15,2000 Masako & Toshi, original version copied from D.Jackson's
00007 //                  ZVTOP3
00008 // December  1,2000 Toshi, switch to Kalman Filter fitting.
00009 // 
00010 #ifndef LCDVTOPLVRT_H
00011 #define LCDVTOPLVRT_H
00012 
00013 #include "TObjArray.h"
00014 #include "TVector3.h"
00015 #include "TLorentzVector.h"
00016 #include "TMatrixD.h"
00017 
00018 #include "LCDVToplTRK.h"
00019 
00020 class LCDVToplVRT: public TObject {
00021 
00022 public:
00023   //constructor & deconstructor
00024   LCDVToplVRT();
00025   LCDVToplVRT(TVector3 xinit);
00026   LCDVToplVRT(TObjArray*);
00027   LCDVToplVRT(TObjArray*,TVector3);
00028   LCDVToplVRT(const LCDVToplVRT& vrt);
00029   ~LCDVToplVRT();
00030 
00031   //
00032   // ----------------------< Adders >--------------------------------
00033   //
00034   Int_t AddTrack(LCDVToplTRK*,Int_t f_fit=1);        //Add track
00035   void AddTracks(TObjArray*);         //Add tracks
00036   void AddTracks(TObjArray*,Int_t f_fit);         //Add tracks
00037 
00038   //
00039   // ----------------------< Getters >--------------------------------
00040   //
00041   Double_t  GetChi2() { return m_chisquared; } //Get chi2 of the vertex fit.
00042   Double_t  GetConfLevel() { 
00043       return TMath::Prob(GetChi2(),2*GetTrackEntries()-3);
00044   }
00045   Double_t  GetDecayLength(TVector3 x_from);  //Get decay length
00046   Double_t  GetEpscut()       { return m_epscut; }     //Get eps. cut
00047   Double_t  GetErrorDecayLength(TVector3 x_from, TMatrixD& err_from); //Get error of decay length
00048   void      GetErrorMatrixVertex(TMatrixD& em); //Get Error Matrix(position)
00049 
00050   TLorentzVector  GetFourVector()    { return  m_a4vec;  }//Get Vertex 4 Vect.
00051   TLorentzVector* GetFourVectorPtr() { return &m_a4vec; }//Get Vertex 4 Vect.
00052   Double_t        GetFourVectorPx()  { return  m_a4vec.Px(); } //Get Vertex Px
00053   Double_t        GetFourVectorPy()  { return  m_a4vec.Py(); } //Get Vertex Py
00054   Double_t        GetFourVectorPz()  { return  m_a4vec.Pz(); } //Get Vertex Pz
00055   Double_t        GetFourVectorE()   { return  m_a4vec.E(); }  //Get Vertex E  
00056 
00057   Double_t        GetMass()          { return  m_a4vec.M(); }//Get Vertex mass
00058   Int_t           GetMaxtry()        { return  m_maxtry; } //Get max. # of try
00059 
00060   Double_t        GetPchi2(Int_t itrk); //Get chi2 contrib. of the given trk.
00061 
00062   TLorentzVector  GetTrack4MomentumVector(Int_t itrk);
00063   Int_t           GetTrackEntries()  { return m_ntrk; }// Get # of Tracks in the vertex.
00064   LCDVToplTRK*    GetTrackAt(Int_t itrk) { return m_track_list[itrk]; }//Get LCDVToplTRK
00065   //Int_t          GetNsig(Double_t nsigma, TVector3 axis, TVector3 ipv,
00066   //                     TMatrixD& eipv); //Get # of significance track
00067   TVector3       GetTrackMomentumVector(Int_t itrk);
00068 
00069   Double_t GetVertexCharge() { return m_qvtx; }       //Get Vertex charge
00070   void     GetVertex(TMatrixD& a); // Get Fit Parameters
00071   TVector3 GetVertexVector();  //Get Vertex Position(Vector)
00072   Double_t GetVertexX(){ return m_fitparm[0]; }//Get Vertex Position(X)
00073   Double_t GetVertexY(){ return m_fitparm[1]; }//Get Vertex Position(Y)
00074   Double_t GetVertexZ(){ return m_fitparm[2]; }//Get Vertex Position(Z)
00075   Double_t GetVsig()         { return m_vsig; };      //Get Vertex sig.
00076   Double_t GetSortVal(){ return m_sortval; } // Get val. for a sort.
00077 
00078   Int_t GetMcVrt() { return m_mcvrt; }
00079 
00080   //
00081   // ----------------------< Removers >--------------------------------
00082   //
00083   Int_t RemoveTrackAt(Int_t itrk);     //Remove track
00084   Int_t RemoveTrackAt(Int_t itrk, Int_t f_fit);     //Remove track
00085   Int_t RemoveTrack(LCDVToplTRK* trk); //Remove track
00086   Int_t RemoveTrack(LCDVToplTRK* trk, Int_t f_fit); //Remove track
00087 
00088   //
00089   // ----------------------< Setters >--------------------------------
00090   //
00091   void SetEpsCut(Double_t a) { m_epscut = a; }  //Set eps. cut
00092   void SetMaxtry(Int_t a)    { m_maxtry = a; }  //Set max. # of try
00093   void SetVertex(Double_t*);  //Set Vertex
00094   void SetVertex(TMatrixD& a);  //Set Vertex
00095   void SetVertex(TVector3);  //Set Vertex
00096   void SetErrorMatrixVertex(TMatrixD& err); // Set Vertex Error Matrix
00097   void SetVsig(Double_t v) { m_vsig=v; }  //Set Vertex   significance
00098   void SetSortVal(Double_t v) { m_sortval=v; } // Set val. for a sort
00099   void SetMcVrt(Int_t a) { m_mcvrt=a; } // Set MC vertex.
00100   void SetTrackAt(LCDVToplTRK* trk, Int_t a) { m_track_list[a]=trk; }
00101 
00102   //
00103   // ----------------------< Miscellaneous >--------------------------------
00104   //
00105   void CalcFourVector();              //Calcurate four vector @ vertex
00106   void Clean();
00107   void CompressTracksList();          //Compress track list
00108   void DeleteTracks() { 
00109     for (Int_t itrk=0 ; itrk < m_ntrk ; itrk++) {
00110       delete m_track_list[itrk];
00111     }
00112   }
00113 
00114   LCDVToplTRK**   Tracks() { return m_track_list; }
00115   Int_t IndexOfTrack(LCDVToplTRK* trk);
00116 
00117   Int_t VertexFit();//Vertex Fitter
00118   Int_t VertexFit(TVector3 xvinit);//Vertex Fitter
00119   Int_t FilteringToAddTrack(LCDVToplTRK* trk);
00120   Int_t FilteringToRemoveTrack(LCDVToplTRK* trk);
00121   void SmoothingParameters(LCDVToplTRK* trk,TMatrixD& q);
00122   void linearizeChargedTrack(TMatrixD& a, TMatrixD& b, TMatrixD& h0, 
00123                              TMatrixD& x, TMatrixD& q);
00124 
00125   LCDVToplVRT & operator = (const LCDVToplVRT &);
00126   LCDVToplVRT & operator += (const LCDVToplVRT &);
00127 
00128   //---Sort related part.
00129   Bool_t IsSortable() const { return kTRUE; }
00130   Int_t  Compare(const TObject *obj) const {
00131     if        (m_sortval < ((LCDVToplVRT*)obj)->GetSortVal()) {
00132       return -1;
00133     } else if (m_sortval > ((LCDVToplVRT*)obj)->GetSortVal()) {
00134       return +1;
00135     } else {
00136       return 0;
00137     }
00138   }
00139 
00140 private:
00141   Int_t          m_maxtry;         // maximum iteration number
00142   Double_t       m_epscut;         // control convergence of fitting
00143   Int_t          m_ntrk;           // # of tracks
00144   LCDVToplTRK*   m_track_list[100];//! array of pointers to track
00145   Double_t       m_fitparm[3];     // vertex position
00146   Double_t       m_error[6];       // error matrix of vertex position
00147   TLorentzVector m_a4vec;          // vertex momentum vector
00148   Double_t       m_qvtx;           // vertex charge
00149   Double_t       m_chisquared;     // chisquare of vertex fitting
00150   Double_t       m_vsig;           // Vertex SIGnificance func. value
00151   Double_t       m_sortval;        // for sort.
00152   Int_t          m_mcvrt;          // MC info. (flavor)
00153   
00154   //initialize above variables
00155   void Init(TVector3 xinit);
00156   void Init(TObjArray* tracks, TVector3 xinit);
00157   
00158   //Filtering with Kalman filter
00159   Int_t Filtering(LCDVToplTRK* trk);
00160   
00161 public:
00162   ClassDef(LCDVToplVRT,4)// A vertex class for topological vertexing.
00163 };
00164 
00165 #endif

Generated on Tue Jul 18 18:33:57 2006 for LCDROOT by  doxygen 1.4.6