VertexConstraints Class Reference

#include <VertexConstraints.h>

List of all members.

Public Member Functions

 VertexConstraints ()
 ~VertexConstraints ()
 VertexConstraints (const VertexConstraints &)
void CommonVertexConstraints (std::vector< int > tlis)
void FixedVertexConstraints (std::vector< int > tlis)
void UpdateConstraints (VertexParameter vpar, std::vector< WTrackParameter > wlis)
void setCovax (const int i, const HepMatrix cov)
void setLambda (const int i, const HepVector L)
void setLambda0 (const int i, const HepVector L0)
void setVD (const int i, const HepSymMatrix vd)
void setEVDE (const int i, const HepSymMatrix evde)
void setType (const int type)
std::vector< HepMatrix > Ec () const
std::vector< HepMatrix > Dc () const
std::vector< HepVector > dc () const
std::vector< HepSymMatrix > VD () const
std::vector< HepSymMatrix > EVDE () const
std::vector< HepMatrix > covax () const
std::vector< HepVector > lambda0 () const
std::vector< HepVector > lambda () const
std::vector< int > Ltrk () const
int type () const
int commonVertex () const
int fixedVertex () const
VertexConstraintsoperator= (const VertexConstraints &)

Private Attributes

std::vector< HepMatrix > m_Ec
std::vector< HepMatrix > m_Dc
std::vector< HepVector > m_dc
std::vector< HepSymMatrix > m_VD
std::vector< HepSymMatrix > m_EVDE
std::vector< HepMatrix > m_covax
std::vector< HepVector > m_lambda0
std::vector< HepVector > m_lambda
std::vector< int > m_ltrk
int m_type

Static Private Attributes

static const double Alpha = -0.00299792458
static const int CommonVertex = 2
static const int FixedVertex = 1


Detailed Description

Definition at line 30 of file VertexConstraints.h.


Constructor & Destructor Documentation

VertexConstraints::VertexConstraints (  ) 

Definition at line 9 of file VertexConstraints.cxx.

References m_covax, m_dc, m_Dc, m_Ec, m_EVDE, m_lambda, m_lambda0, m_ltrk, m_type, and m_VD.

00010 {
00011         m_Ec.clear();
00012         m_Dc.clear();
00013         m_dc.clear();
00014         m_VD.clear();
00015         m_EVDE.clear();
00016         m_lambda0.clear();
00017         m_lambda.clear();
00018         m_covax.clear();
00019         m_ltrk.clear();
00020         m_type = 0;
00021 }

VertexConstraints::~VertexConstraints (  )  [inline]

Definition at line 35 of file VertexConstraints.h.

00035 {;}

VertexConstraints::VertexConstraints ( const VertexConstraints  )  [inline]

Definition at line 77 of file VertexConstraints.h.

References m_covax, m_dc, m_Dc, m_Ec, m_EVDE, m_lambda, m_lambda0, m_ltrk, m_type, and m_VD.

00078 {
00079         m_Ec = vc.m_Ec;
00080         m_Dc = vc.m_Dc;
00081         m_dc = vc.m_dc;
00082         m_VD = vc.m_VD;
00083         m_EVDE = vc.m_EVDE;
00084         m_covax = vc.m_covax;
00085         m_lambda0 = vc.m_lambda0;
00086         m_lambda = vc.m_lambda;
00087         m_ltrk = vc.m_ltrk;
00088         m_type = vc.m_type;
00089 }


Member Function Documentation

int VertexConstraints::commonVertex (  )  const [inline]

Definition at line 57 of file VertexConstraints.h.

References CommonVertex.

Referenced by CommonVertexConstraints().

00057 {return CommonVertex;}

void VertexConstraints::CommonVertexConstraints ( std::vector< int >  tlis  ) 

Definition at line 23 of file VertexConstraints.cxx.

References commonVertex(), m_ltrk, and setType().

Referenced by VertexFit::AddVertex().

00024 {
00025         m_ltrk = tlis;
00026         setType(commonVertex());
00027 }

std::vector<HepMatrix> VertexConstraints::covax (  )  const [inline]

Definition at line 52 of file VertexConstraints.h.

References m_covax.

Referenced by UpdateConstraints().

00052 {return m_covax;}

std::vector<HepVector> VertexConstraints::dc (  )  const [inline]

Definition at line 49 of file VertexConstraints.h.

References m_dc.

Referenced by UpdateConstraints().

00049 {return m_dc;}

std::vector<HepMatrix> VertexConstraints::Dc (  )  const [inline]

Definition at line 48 of file VertexConstraints.h.

References m_Dc.

Referenced by UpdateConstraints().

00048 {return m_Dc;}

std::vector<HepMatrix> VertexConstraints::Ec (  )  const [inline]

Definition at line 47 of file VertexConstraints.h.

References m_Ec.

Referenced by UpdateConstraints().

00047 {return m_Ec;}

std::vector<HepSymMatrix> VertexConstraints::EVDE (  )  const [inline]

Definition at line 51 of file VertexConstraints.h.

References m_EVDE.

Referenced by UpdateConstraints().

00051 {return m_EVDE;}

int VertexConstraints::fixedVertex (  )  const [inline]

Definition at line 58 of file VertexConstraints.h.

References FixedVertex.

Referenced by FixedVertexConstraints().

00058 {return FixedVertex;}

void VertexConstraints::FixedVertexConstraints ( std::vector< int >  tlis  ) 

Definition at line 29 of file VertexConstraints.cxx.

References fixedVertex(), m_ltrk, and setType().

Referenced by VertexFit::AddBeamFit().

00030 {
00031         m_ltrk = tlis;
00032         setType(fixedVertex());
00033 }

std::vector<HepVector> VertexConstraints::lambda (  )  const [inline]

Definition at line 54 of file VertexConstraints.h.

References m_lambda.

Referenced by UpdateConstraints().

00054 {return m_lambda;}

std::vector<HepVector> VertexConstraints::lambda0 (  )  const [inline]

Definition at line 53 of file VertexConstraints.h.

References m_lambda0.

Referenced by UpdateConstraints().

00053 {return m_lambda0;}

std::vector<int> VertexConstraints::Ltrk (  )  const [inline]

Definition at line 55 of file VertexConstraints.h.

References m_ltrk.

Referenced by VertexFit::BuildVirtualParticle(), VertexFit::fitVertex(), VertexFit::swimVertex(), VertexFit::UpdateConstraints(), and VertexFit::vertexCovMatrix().

00055 {return m_ltrk;}

VertexConstraints & VertexConstraints::operator= ( const VertexConstraints  )  [inline]

Definition at line 91 of file VertexConstraints.h.

References m_covax, m_dc, m_Dc, m_Ec, m_EVDE, m_lambda, m_lambda0, m_ltrk, m_type, and m_VD.

00092 {
00093         m_Ec = vc.m_Ec;
00094         m_Dc = vc.m_Dc;
00095         m_dc = vc.m_dc;
00096         m_VD = vc.m_VD;
00097         m_EVDE = vc.m_EVDE;
00098         m_covax = vc.m_covax;
00099         m_lambda0 = vc.m_lambda0;
00100         m_lambda = vc.m_lambda;
00101         m_ltrk = vc.m_ltrk;
00102         m_type = vc.m_type;
00103         return (*this);
00104 }

void VertexConstraints::setCovax ( const int  i,
const HepMatrix  cov 
) [inline]

Definition at line 40 of file VertexConstraints.h.

References m_covax.

00040 {m_covax[i] = cov;}

void VertexConstraints::setEVDE ( const int  i,
const HepSymMatrix  evde 
) [inline]

Definition at line 44 of file VertexConstraints.h.

References m_EVDE.

00044 {m_EVDE[i] = evde;}

void VertexConstraints::setLambda ( const int  i,
const HepVector  L 
) [inline]

Definition at line 41 of file VertexConstraints.h.

References m_lambda.

00041 {m_lambda[i] = L;}

void VertexConstraints::setLambda0 ( const int  i,
const HepVector  L0 
) [inline]

Definition at line 42 of file VertexConstraints.h.

References m_lambda0.

00042 {m_lambda0[i] = L0;}

void VertexConstraints::setType ( const int  type  )  [inline]

Definition at line 45 of file VertexConstraints.h.

References m_type.

Referenced by CommonVertexConstraints(), and FixedVertexConstraints().

00045 {m_type = type;}

void VertexConstraints::setVD ( const int  i,
const HepSymMatrix  vd 
) [inline]

Definition at line 43 of file VertexConstraints.h.

References m_VD.

00043 {m_VD[i] = vd;}

int VertexConstraints::type (  )  const [inline]

Definition at line 56 of file VertexConstraints.h.

References m_type.

Referenced by VertexFit::UpdateConstraints().

00056 {return m_type;}

void VertexConstraints::UpdateConstraints ( VertexParameter  vpar,
std::vector< WTrackParameter wlis 
)

Definition at line 35 of file VertexConstraints.cxx.

References WTrackParameter::charge(), CommonVertex, covax(), Dc(), dc(), Ec(), EVDE(), FixedVertex, VertexFitBField::getCBz(), genRecEmupikp::i, VertexFitBField::instance(), lambda(), lambda0(), m_covax, m_dc, m_Dc, m_Ec, m_EVDE, m_lambda, m_lambda0, m_type, m_VD, max, min, WTrackParameter::p(), VD(), vpar, WTrackParameter::X(), WTrackParameter::x(), and x.

00036 {
00037         m_Ec.clear();
00038         m_Dc.clear();
00039         m_dc.clear();
00040         m_VD.clear();
00041         m_EVDE.clear();
00042         m_lambda0.clear();
00043         m_lambda.clear();
00044         m_covax.clear();
00045 
00046         switch(m_type) 
00047         {
00048                 case FixedVertex: 
00049                 {
00050                         WTrackParameter wtrk;
00051                         for (unsigned int i = 0; i < wlis.size(); i++) 
00052                         {
00053                                 wtrk = wlis[i];
00054                                 HepLorentzVector p = wtrk.p();
00055                                 HepPoint3D x = wtrk.x();
00056                                 HepPoint3D delx = vpar.vx() - x;
00057 
00058                                 double afield = VertexFitBField::instance()->getCBz(vpar.Vx(), wtrk.X());
00059                                 double a = afield * (0.0+wtrk.charge());
00060                                 double J = a * (delx.x()*p.px() + delx.y()*p.py())/p.perp2();
00061 
00062                                 J = std::min(J, 1-1e-4);
00063                                 J = std::max(J, -1+1e-4);
00064                                 double Rx = delx.x() - 2*p.px() * (delx.x()*p.px() + delx.y()*p.py()) / p.perp2();
00065                                 double Ry = delx.y() - 2*p.py() * (delx.x()*p.px() + delx.y()*p.py()) / p.perp2();
00066                                 double S = 1.0/sqrt(1-J*J)/p.perp2();
00067              
00068                                 // dc
00069                                 HepVector dc(2, 0);
00070                                 dc[0] = delx.y() * p.px() - delx.x() * p.py() - 0.5 * a * (delx.x() * delx.x() + delx.y() * delx.y());
00071                                 dc[1] = delx.z() - p.pz()/a*asin(J);
00072                                 m_dc.push_back(dc);
00073                                 // Ec
00074                                 HepMatrix Ec(2, 3, 0);
00075                                 m_Ec.push_back(Ec);
00076                                 // Dc
00077                                 HepMatrix Dc(2, 6, 0);
00078                                 Dc[0][0] = delx.y();
00079                                 Dc[0][1] = -delx.x();
00080                                 Dc[0][2] = 0;
00081                                 Dc[0][3] = p.py() + a * delx.x();
00082                                 Dc[0][4] = -p.px() + a * delx.y();
00083                                 Dc[0][5] = 0;
00084                                 Dc[1][0] = -p.pz() * S * Rx;
00085                                 Dc[1][1] = -p.pz() * S * Ry;
00086                                 Dc[1][2] = - asin(J) / a;
00087                                 Dc[1][3] = p.px() * p.pz() * S;
00088                                 Dc[1][4] = p.py() * p.pz() * S;
00089                                 Dc[1][5] = -1.0;
00090                                 m_Dc.push_back(Dc);
00091                                 // VD
00092                                 HepSymMatrix VD(2, 0);
00093                                 // int ifail;
00094                                 // VD = ((wtrk.Ew()).similarity(Dc)).inverse(ifail); // 2x2 matrix (Dc Ew Dc.T())
00095                                 m_VD.push_back(VD);
00096                                 // EVDE
00097                                 HepSymMatrix EVDE(3, 0);
00098                                 m_EVDE.push_back(EVDE);
00099                                 // lambda0
00100                                 HepVector lambda0(2, 0);
00101                                 m_lambda0.push_back(lambda0);
00102                                 // lambda
00103                                 HepVector lambda(2, 0);
00104                                 m_lambda.push_back(lambda);
00105                                 // covax
00106                                 HepMatrix covax(6, 3, 0);
00107                                 m_covax.push_back(covax);
00108                                 break;
00109                         }
00110                 }
00111                 case CommonVertex:
00112                 default: 
00113                 {
00114                         WTrackParameter wtrk;
00115                         for (unsigned int i = 0; i < wlis.size(); i++)
00116                         {
00117                                 wtrk = wlis[i];
00118                                 HepLorentzVector p = wtrk.p();
00119                                 HepPoint3D x = wtrk.x();
00120                                 HepPoint3D delx = vpar.vx() - x;
00121                                 if (wtrk.charge() == 0) 
00122                                 {
00123                                         //dc
00124                                         HepVector dc(2,0);
00125                                         dc[0] = p.pz()*delx.x() - p.px()*delx.z();
00126                                         dc[1] = p.pz()*delx.y() - p.py()*delx.z();
00127                                         m_dc.push_back(dc);
00128                                         //Ec
00129                                         HepMatrix Ec(2,3,0);
00130                                         Ec[0][0] = p.pz();
00131                                         Ec[0][1] = 0;
00132                                         Ec[0][2] = -p.px();
00133                                         Ec[1][0] = 0;
00134                                         Ec[1][1] = p.pz();
00135                                         Ec[1][2] = -p.py();
00136                                         m_Ec.push_back(Ec);
00137                                         //Dc
00138                                         HepMatrix Dc(2,6,0);
00139                                         Dc[0][0] = -delx.z();
00140                                         Dc[0][1] = 0;
00141                                         Dc[0][2] = delx.x();
00142                                         Dc[0][3] = -p.pz();
00143                                         Dc[0][4] = 0;
00144                                         Dc[0][5] = p.px();
00145                                         Dc[1][0] = 0;
00146                                         Dc[1][1] = -delx.z();
00147                                         Dc[1][2] = delx.y();
00148                                         Dc[1][3] = 0;
00149                                         Dc[1][4] = -p.pz();
00150                                         Dc[1][5] = p.py();
00151                                         m_Dc.push_back(Dc);
00152                                 } 
00153                                 else 
00154                                 {
00155                                         double afield = VertexFitBField::instance()->getCBz(vpar.Vx(), wtrk.X());
00156                                         double a = afield * (0.0+wtrk.charge());
00157                                         double J = a * (delx.x()*p.px() + delx.y()*p.py())/p.perp2();
00158                                         J = std::min(J, 1-1e-4);
00159                                         J = std::max(J, -1+1e-4);
00160                                         double Rx = delx.x() - 2*p.px() * (delx.x()*p.px() + delx.y()*p.py()) / p.perp2();
00161                                         double Ry = delx.y() - 2*p.py() * (delx.x()*p.px() + delx.y()*p.py()) / p.perp2();
00162                                         double S = 1.0/sqrt(1-J*J)/p.perp2();
00163                                         // dc
00164                                         HepVector dc(2, 0);
00165                                         dc[0] = delx.y() * p.px() - delx.x() * p.py() - 0.5 * a * (delx.x() * delx.x() + delx.y() * delx.y());
00166                                         dc[1] = delx.z() - p.pz()/a*asin(J);
00167                                         m_dc.push_back(dc);
00168                                         // Ec
00169                                         HepMatrix Ec(2, 3, 0);
00170                                         Ec[0][0] = -p.py()- a * delx.x();
00171                                         Ec[0][1] = p.px() - a * delx.y();
00172                                         Ec[0][2] = 0;
00173                                         Ec[1][0] = -p.px() * p.pz() * S ;
00174                                         Ec[1][1] = -p.py() * p.pz() * S ;
00175                                         Ec[1][2] = 1.0;
00176                                         m_Ec.push_back(Ec);
00177                                         // Dc
00178                                         HepMatrix Dc(2, 6, 0);
00179                                         Dc[0][0] = delx.y();
00180                                         Dc[0][1] = -delx.x();
00181                                         Dc[0][2] = 0;
00182                                         Dc[0][3] = p.py() + a * delx.x();
00183                                         Dc[0][4] = -p.px() + a * delx.y();
00184                                         Dc[0][5] = 0;
00185                                         Dc[1][0] = -p.pz() * S * Rx;
00186                                         Dc[1][1] = -p.pz() * S * Ry;
00187                                         Dc[1][2] = - asin(J) / a;
00188                                         Dc[1][3] = p.px() * p.pz() * S;
00189                                         Dc[1][4] = p.py() * p.pz() * S;
00190                                         Dc[1][5] = -1.0;
00191                                         m_Dc.push_back(Dc);
00192                                 }
00193                                 // VD
00194                                 HepSymMatrix VD(2, 0);
00195                                 m_VD.push_back(VD);
00196                                 // EVDE
00197                                 HepSymMatrix EVDE(3, 0);
00198                                 m_EVDE.push_back(EVDE);
00199                                 // lambda0
00200                                 HepVector lambda0(2, 0);
00201                                 m_lambda0.push_back(lambda0);
00202                                 // lambda
00203                                 HepVector lambda(2, 0);
00204                                 m_lambda.push_back(lambda);
00205                                 // covax
00206                                 HepMatrix covax(6, 3, 0);
00207                                 m_covax.push_back(covax);
00208                         }
00209                         break;
00210                 }
00211         }
00212 }

std::vector<HepSymMatrix> VertexConstraints::VD (  )  const [inline]

Definition at line 50 of file VertexConstraints.h.

References m_VD.

Referenced by UpdateConstraints().

00050 {return m_VD;}


Member Data Documentation

const double VertexConstraints::Alpha = -0.00299792458 [static, private]

Definition at line 72 of file VertexConstraints.h.

const int VertexConstraints::CommonVertex = 2 [static, private]

Definition at line 73 of file VertexConstraints.h.

Referenced by commonVertex(), and UpdateConstraints().

const int VertexConstraints::FixedVertex = 1 [static, private]

Definition at line 74 of file VertexConstraints.h.

Referenced by fixedVertex(), and UpdateConstraints().

std::vector<HepMatrix> VertexConstraints::m_covax [private]

Definition at line 67 of file VertexConstraints.h.

Referenced by covax(), operator=(), setCovax(), UpdateConstraints(), and VertexConstraints().

std::vector<HepVector> VertexConstraints::m_dc [private]

Definition at line 64 of file VertexConstraints.h.

Referenced by dc(), operator=(), UpdateConstraints(), and VertexConstraints().

std::vector<HepMatrix> VertexConstraints::m_Dc [private]

Definition at line 63 of file VertexConstraints.h.

Referenced by Dc(), operator=(), UpdateConstraints(), and VertexConstraints().

std::vector<HepMatrix> VertexConstraints::m_Ec [private]

Definition at line 62 of file VertexConstraints.h.

Referenced by Ec(), operator=(), UpdateConstraints(), and VertexConstraints().

std::vector<HepSymMatrix> VertexConstraints::m_EVDE [private]

Definition at line 66 of file VertexConstraints.h.

Referenced by EVDE(), operator=(), setEVDE(), UpdateConstraints(), and VertexConstraints().

std::vector<HepVector> VertexConstraints::m_lambda [private]

Definition at line 69 of file VertexConstraints.h.

Referenced by lambda(), operator=(), setLambda(), UpdateConstraints(), and VertexConstraints().

std::vector<HepVector> VertexConstraints::m_lambda0 [private]

Definition at line 68 of file VertexConstraints.h.

Referenced by lambda0(), operator=(), setLambda0(), UpdateConstraints(), and VertexConstraints().

std::vector<int> VertexConstraints::m_ltrk [private]

Definition at line 70 of file VertexConstraints.h.

Referenced by CommonVertexConstraints(), FixedVertexConstraints(), Ltrk(), operator=(), and VertexConstraints().

int VertexConstraints::m_type [private]

Definition at line 71 of file VertexConstraints.h.

Referenced by operator=(), setType(), type(), UpdateConstraints(), and VertexConstraints().

std::vector<HepSymMatrix> VertexConstraints::m_VD [private]

Definition at line 65 of file VertexConstraints.h.

Referenced by operator=(), setVD(), UpdateConstraints(), VD(), and VertexConstraints().


Generated on Tue Nov 29 23:36:21 2016 for BOSS_7.0.2 by  doxygen 1.4.7