/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Analysis/VertexFit/VertexFit-00-02-78/VertexFit/KinematicConstraints.h

Go to the documentation of this file.
00001 #ifndef VertexFit_Kinematic_Constraints_H
00002 #define VertexFit_Kinematic_Constraints_H
00003 
00004 // #include <iostream>
00005 #include <vector>
00006 
00007 #include "CLHEP/Vector/ThreeVector.h"
00008 #include "CLHEP/Vector/LorentzVector.h"
00009 #include "CLHEP/Matrix/Vector.h"
00010 #include "CLHEP/Matrix/Matrix.h"
00011 //#include "CLHEP/Matrix/DiagMatrix.h"
00012 #include "VertexFit/WTrackParameter.h"
00013 using CLHEP::Hep3Vector;
00014 using CLHEP::HepLorentzVector;
00015 using CLHEP::HepVector;
00016 using CLHEP::HepMatrix;
00017 //using CLHEP::HepDiagMatrix;
00018 
00019 
00020 class KinematicConstraints {
00021 
00022  public:
00023   KinematicConstraints();
00024   ~KinematicConstraints(){;}
00025   inline KinematicConstraints(const KinematicConstraints &);
00026   int  Type() const {return m_type;} 
00027   void ResonanceConstraints(const double mres, std::vector<int> tlis, HepSymMatrix Vre); 
00028   void TotalEnergyConstraints(const double etot, std::vector<int> tlis);
00029   void TotalMomentumConstraints(const double ptot, std::vector<int> tlis);
00030   void ThreeMomentumConstraints(const Hep3Vector p3, std::vector<int> tlis);
00031 //  void FourMomentumConstraints(const HepLorentzVector p4, std::vector<int> tlis , HepSymMatrix Vme);
00032   void FourMomentumConstraints(const HepLorentzVector p4, std::vector<int> tlis, HepSymMatrix Vme );
00033   void EqualMassConstraints(std::vector<int> tlis1, std::vector<int> tlis2, HepSymMatrix Vne);
00034 //Add a Constranint function for the Position constraints  
00035 //  void PositionConstraints(const double phipre,const double lambdapre, std::vector<int> tlis_V, HepSymMatrix Vpe);
00036 
00037 //  void UpdateConstraints(std::vector<WTrackParameter> wlis);
00038 //  void UpdateConstraints(std::vector<WTrackParameter> wlis);
00039   std::vector<HepMatrix> Ec() {return m_Ec;}
00040   std::vector<HepMatrix> Dc() {return m_Dc;}
00041   std::vector<HepVector> dc() {return m_dc;}
00042   std::vector<HepVector> lambda() {return m_lambda;}
00043   std::vector<HepSymMatrix> Vm() {return m_Vm;}
00044   std::vector<HepSymMatrix> VD() {return m_VD;}
00045   std::vector<int> Ltrk() {return m_ltrk;}
00046   int nc() {return m_nc;}
00047   void setType(const int type) {m_type = type;}
00048   void setLambda(HepVector lambda) {m_lambda[0]=lambda;} 
00049   void setVD(HepSymMatrix vd) {m_VD[0] = vd;}
00050   inline KinematicConstraints & operator = (const KinematicConstraints &);
00051  public:
00052   // type
00053   int typeRes() const {return Resonance;}
00054   int typeEtot() const {return TotalEnergy;}
00055   int typePtot()  const {return TotalMomentum;}
00056   int typeP3()   const {return ThreeMomentum;}
00057   int typeP4()  const {return FourMomentum;}
00058   int typeEqMass()  const {return EqualMass;}
00059   int typePoint()  const {return Position;}
00060   // get 
00061   double mres() const {return m_mres;}
00062   double etot() const {return m_etot;}
00063   double ptot() const {return m_ptot;}
00064   HepPoint3D point() const {return m_point;}
00065   Hep3Vector p3() const {return m_p3;}
00066   HepLorentzVector p4() const {return m_p4;}
00067   double phipre() const {return m_phipre;}
00068   double lambdapre() const {return m_lambdapre;}
00069   HepSymMatrix Vre() const {return m_Vre;}
00070   HepSymMatrix Vme() const {return m_Vme;}
00071   HepSymMatrix Vne() const {return m_Vne;}
00072   HepSymMatrix Vpe() const {return m_Vpe;}
00073   HepSymMatrix Vmeasure() const {return m_Vmeasure;}
00074   std::vector<int> numEqual() {return m_nequal;}
00075   // set
00076   void setMres(const double mres) {m_mres = mres;}
00077   void setEtot(const double etot) {m_etot = etot;}
00078   void setPtot(const double ptot) {m_ptot = ptot;}
00079   void setP3(const Hep3Vector p3) {m_p3 = p3;}
00080   void setP4(const HepLorentzVector p4) {m_p4 = p4;}
00081   void setP4(const double etot) {m_p4 = HepLorentzVector(0., 0., 0., etot);}
00082   void setPoint(const HepPoint3D x) {m_point = x;}
00083   void setPhipre(const double phipre){m_phipre = phipre;}
00084   void setLambdapre(const double lambdapre){m_lambdapre = lambdapre;}
00085   void setVre(const HepSymMatrix Vre) {m_Vre = Vre;}
00086   void setVme(const HepSymMatrix Vme) {m_Vme = Vme;}
00087   void setVne(const HepSymMatrix Vne) {m_Vne = Vne;}
00088   void setVpe(const HepSymMatrix Vpe) {m_Vpe = Vpe;}
00089   void setVmeasure(const HepSymMatrix Vmeasure) {m_Vmeasure = Vmeasure;}
00090   void setNumEqual(std::vector<int> nequal) {m_nequal = nequal;}
00091  private:
00092   int m_type;
00093   std::vector<HepMatrix> m_Dc;
00094   std::vector<HepMatrix> m_Ec;
00095   std::vector<HepVector> m_dc;
00096   std::vector<HepSymMatrix> m_Vm;
00097   std::vector<HepVector> m_lambda;
00098   std::vector<HepSymMatrix> m_VD;
00099   std::vector<int> m_ltrk;
00100   int m_nc;
00101   double m_mres;
00102   double m_etot;
00103   double m_ptot;
00104   Hep3Vector m_p3;
00105   HepLorentzVector m_p4;
00106   double m_phipre;
00107   double m_lambdapre;
00108   HepPoint3D m_point;
00109   HepSymMatrix m_Vmeasure;
00110   HepSymMatrix m_Vre;
00111   HepSymMatrix m_Vme;          //FourMomentum measurment error
00112   HepSymMatrix m_Vne;          //EqualMass measurment error
00113   HepSymMatrix m_Vpe;          //Position measurment error
00114   std::vector<int> m_nequal;
00115 
00116   static const int Resonance;
00117   static const int TotalEnergy;
00118   static const int TotalMomentum;
00119   static const int ThreeMomentum;
00120   static const int FourMomentum;
00121   static const int EqualMass;
00122   static const int Position;
00123 
00124 };
00125 inline KinematicConstraints::KinematicConstraints(const KinematicConstraints &kc) {
00126   m_type = kc.m_type;
00127   m_Ec = kc.m_Ec;
00128   m_Dc = kc.m_Dc;
00129   m_dc = kc.m_dc;
00130   m_Vm = kc.m_Vm;
00131   m_lambda = kc.m_lambda;
00132   m_VD = kc.m_VD;
00133   m_ltrk = kc.m_ltrk;
00134   m_nc = kc.m_nc;
00135   m_mres = kc.m_mres;
00136   m_etot = kc.m_etot;
00137   m_ptot = kc.m_ptot;
00138   m_p3 = kc.m_p3;
00139   m_p4 = kc.m_p4;
00140   m_phipre = kc.m_phipre;
00141   m_lambdapre = kc.m_lambdapre;
00142   m_nequal = kc.m_nequal;
00143   m_Vre = kc.m_Vre;
00144   m_Vme = kc.m_Vme;
00145   m_Vne = kc.m_Vne;
00146   m_Vpe = kc.m_Vpe;
00147   m_Vmeasure = kc.m_Vmeasure;
00148     
00149 }
00150 
00151 inline KinematicConstraints & KinematicConstraints::operator = (const KinematicConstraints &kc) {
00152   m_type = kc.m_type;
00153   m_Ec = kc.m_Ec;
00154   m_Dc = kc.m_Dc;
00155   m_dc = kc.m_dc;
00156   m_Vm = kc.m_Vm;
00157   m_lambda = kc.m_lambda;
00158   m_VD = kc.m_VD;
00159   m_ltrk = kc.m_ltrk;
00160   m_nc = kc.m_nc;
00161   m_mres = kc.m_mres;
00162   m_etot = kc.m_etot;
00163   m_ptot = kc.m_ptot;
00164   m_p3 = kc.m_p3;
00165   m_p4 = kc.m_p4;
00166   m_phipre = kc.m_phipre;
00167   m_lambdapre = kc.m_lambdapre;
00168   m_nequal = kc.m_nequal;
00169   m_Vre = kc.m_Vre;
00170   m_Vme = kc.m_Vme;
00171   m_Vne = kc.m_Vne;
00172   m_Vpe = kc.m_Vpe;
00173   m_Vmeasure = kc.m_Vmeasure;
00174   return (*this);
00175 }
00176 #endif
00177 

Generated on Tue Nov 29 22:57:40 2016 for BOSS_7.0.2 by  doxygen 1.4.7