BOSS 7.0.1
BESIII Offline Software System
Loading...
Searching...
No Matches
VertexConstraints Class Reference

#include <VertexConstraints.h>

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 &)
 
 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 &)
 

Detailed Description

Constructor & Destructor Documentation

◆ VertexConstraints() [1/4]

VertexConstraints::VertexConstraints ( )

Definition at line 9 of file VertexConstraints.cxx.

10{
11 m_Ec.clear();
12 m_Dc.clear();
13 m_dc.clear();
14 m_VD.clear();
15 m_EVDE.clear();
16 m_lambda0.clear();
17 m_lambda.clear();
18 m_covax.clear();
19 m_ltrk.clear();
20 m_type = 0;
21}

◆ ~VertexConstraints() [1/2]

VertexConstraints::~VertexConstraints ( )
inline

◆ VertexConstraints() [2/4]

VertexConstraints::VertexConstraints ( const VertexConstraints vc)
inline

Definition at line 77 of file Analysis/VertexFit/VertexFit-00-02-77/VertexFit/VertexConstraints.h.

78{
79 m_Ec = vc.m_Ec;
80 m_Dc = vc.m_Dc;
81 m_dc = vc.m_dc;
82 m_VD = vc.m_VD;
83 m_EVDE = vc.m_EVDE;
84 m_covax = vc.m_covax;
85 m_lambda0 = vc.m_lambda0;
86 m_lambda = vc.m_lambda;
87 m_ltrk = vc.m_ltrk;
88 m_type = vc.m_type;
89}

◆ VertexConstraints() [3/4]

VertexConstraints::VertexConstraints ( )

◆ ~VertexConstraints() [2/2]

VertexConstraints::~VertexConstraints ( )
inline

◆ VertexConstraints() [4/4]

VertexConstraints::VertexConstraints ( const VertexConstraints )
inline

Member Function Documentation

◆ commonVertex() [1/2]

int VertexConstraints::commonVertex ( ) const
inline

Definition at line 57 of file Analysis/VertexFit/VertexFit-00-02-77/VertexFit/VertexConstraints.h.

57{return CommonVertex;}

Referenced by CommonVertexConstraints().

◆ commonVertex() [2/2]

int VertexConstraints::commonVertex ( ) const
inline

Definition at line 57 of file InstallArea/include/VertexFit/VertexFit/VertexConstraints.h.

57{return CommonVertex;}

◆ CommonVertexConstraints() [1/2]

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

◆ CommonVertexConstraints() [2/2]

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

◆ covax() [1/2]

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

Definition at line 52 of file Analysis/VertexFit/VertexFit-00-02-77/VertexFit/VertexConstraints.h.

52{return m_covax;}

Referenced by UpdateConstraints().

◆ covax() [2/2]

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

Definition at line 52 of file InstallArea/include/VertexFit/VertexFit/VertexConstraints.h.

52{return m_covax;}

◆ Dc() [1/2]

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

Definition at line 48 of file Analysis/VertexFit/VertexFit-00-02-77/VertexFit/VertexConstraints.h.

48{return m_Dc;}

Referenced by UpdateConstraints().

◆ dc() [1/2]

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

Definition at line 49 of file Analysis/VertexFit/VertexFit-00-02-77/VertexFit/VertexConstraints.h.

49{return m_dc;}

Referenced by UpdateConstraints().

◆ Dc() [2/2]

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

Definition at line 48 of file InstallArea/include/VertexFit/VertexFit/VertexConstraints.h.

48{return m_Dc;}

◆ dc() [2/2]

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

Definition at line 49 of file InstallArea/include/VertexFit/VertexFit/VertexConstraints.h.

49{return m_dc;}

◆ Ec() [1/2]

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

Definition at line 47 of file Analysis/VertexFit/VertexFit-00-02-77/VertexFit/VertexConstraints.h.

47{return m_Ec;}

Referenced by UpdateConstraints().

◆ Ec() [2/2]

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

Definition at line 47 of file InstallArea/include/VertexFit/VertexFit/VertexConstraints.h.

47{return m_Ec;}

◆ EVDE() [1/2]

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

Definition at line 51 of file Analysis/VertexFit/VertexFit-00-02-77/VertexFit/VertexConstraints.h.

51{return m_EVDE;}

Referenced by UpdateConstraints().

◆ EVDE() [2/2]

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

Definition at line 51 of file InstallArea/include/VertexFit/VertexFit/VertexConstraints.h.

51{return m_EVDE;}

◆ fixedVertex() [1/2]

int VertexConstraints::fixedVertex ( ) const
inline

Definition at line 58 of file Analysis/VertexFit/VertexFit-00-02-77/VertexFit/VertexConstraints.h.

58{return FixedVertex;}

Referenced by FixedVertexConstraints().

◆ fixedVertex() [2/2]

int VertexConstraints::fixedVertex ( ) const
inline

Definition at line 58 of file InstallArea/include/VertexFit/VertexFit/VertexConstraints.h.

58{return FixedVertex;}

◆ FixedVertexConstraints() [1/2]

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

Definition at line 29 of file VertexConstraints.cxx.

Referenced by VertexFit::AddBeamFit().

◆ FixedVertexConstraints() [2/2]

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

◆ lambda() [1/2]

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

Definition at line 54 of file Analysis/VertexFit/VertexFit-00-02-77/VertexFit/VertexConstraints.h.

54{return m_lambda;}

Referenced by UpdateConstraints().

◆ lambda() [2/2]

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

Definition at line 54 of file InstallArea/include/VertexFit/VertexFit/VertexConstraints.h.

54{return m_lambda;}

◆ lambda0() [1/2]

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

Definition at line 53 of file Analysis/VertexFit/VertexFit-00-02-77/VertexFit/VertexConstraints.h.

53{return m_lambda0;}

Referenced by UpdateConstraints().

◆ lambda0() [2/2]

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

Definition at line 53 of file InstallArea/include/VertexFit/VertexFit/VertexConstraints.h.

53{return m_lambda0;}

◆ Ltrk() [1/2]

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

◆ Ltrk() [2/2]

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

Definition at line 55 of file InstallArea/include/VertexFit/VertexFit/VertexConstraints.h.

55{return m_ltrk;}

◆ operator=() [1/2]

VertexConstraints & VertexConstraints::operator= ( const VertexConstraints vc)
inline

Definition at line 91 of file Analysis/VertexFit/VertexFit-00-02-77/VertexFit/VertexConstraints.h.

92{
93 m_Ec = vc.m_Ec;
94 m_Dc = vc.m_Dc;
95 m_dc = vc.m_dc;
96 m_VD = vc.m_VD;
97 m_EVDE = vc.m_EVDE;
98 m_covax = vc.m_covax;
99 m_lambda0 = vc.m_lambda0;
100 m_lambda = vc.m_lambda;
101 m_ltrk = vc.m_ltrk;
102 m_type = vc.m_type;
103 return (*this);
104}

◆ operator=() [2/2]

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

◆ setCovax() [1/2]

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

Definition at line 40 of file Analysis/VertexFit/VertexFit-00-02-77/VertexFit/VertexConstraints.h.

40{m_covax[i] = cov;}

◆ setCovax() [2/2]

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

Definition at line 40 of file InstallArea/include/VertexFit/VertexFit/VertexConstraints.h.

40{m_covax[i] = cov;}

◆ setEVDE() [1/2]

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

Definition at line 44 of file Analysis/VertexFit/VertexFit-00-02-77/VertexFit/VertexConstraints.h.

44{m_EVDE[i] = evde;}

◆ setEVDE() [2/2]

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

Definition at line 44 of file InstallArea/include/VertexFit/VertexFit/VertexConstraints.h.

44{m_EVDE[i] = evde;}

◆ setLambda() [1/2]

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

Definition at line 41 of file Analysis/VertexFit/VertexFit-00-02-77/VertexFit/VertexConstraints.h.

41{m_lambda[i] = L;}

◆ setLambda() [2/2]

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

Definition at line 41 of file InstallArea/include/VertexFit/VertexFit/VertexConstraints.h.

41{m_lambda[i] = L;}

◆ setLambda0() [1/2]

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

Definition at line 42 of file Analysis/VertexFit/VertexFit-00-02-77/VertexFit/VertexConstraints.h.

42{m_lambda0[i] = L0;}

◆ setLambda0() [2/2]

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

Definition at line 42 of file InstallArea/include/VertexFit/VertexFit/VertexConstraints.h.

42{m_lambda0[i] = L0;}

◆ setType() [1/2]

void VertexConstraints::setType ( const int  type)
inline

◆ setType() [2/2]

void VertexConstraints::setType ( const int  type)
inline

Definition at line 45 of file InstallArea/include/VertexFit/VertexFit/VertexConstraints.h.

45{m_type = type;}

◆ setVD() [1/2]

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

Definition at line 43 of file Analysis/VertexFit/VertexFit-00-02-77/VertexFit/VertexConstraints.h.

43{m_VD[i] = vd;}

◆ setVD() [2/2]

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

Definition at line 43 of file InstallArea/include/VertexFit/VertexFit/VertexConstraints.h.

43{m_VD[i] = vd;}

◆ type() [1/2]

int VertexConstraints::type ( ) const
inline

Definition at line 56 of file Analysis/VertexFit/VertexFit-00-02-77/VertexFit/VertexConstraints.h.

56{return m_type;}

Referenced by setType().

◆ type() [2/2]

int VertexConstraints::type ( ) const
inline

Definition at line 56 of file InstallArea/include/VertexFit/VertexFit/VertexConstraints.h.

56{return m_type;}

◆ UpdateConstraints() [1/2]

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

Definition at line 35 of file VertexConstraints.cxx.

36{
37 m_Ec.clear();
38 m_Dc.clear();
39 m_dc.clear();
40 m_VD.clear();
41 m_EVDE.clear();
42 m_lambda0.clear();
43 m_lambda.clear();
44 m_covax.clear();
45
46 switch(m_type)
47 {
48 case FixedVertex:
49 {
50 WTrackParameter wtrk;
51 for (unsigned int i = 0; i < wlis.size(); i++)
52 {
53 wtrk = wlis[i];
54 HepLorentzVector p = wtrk.p();
55 HepPoint3D x = wtrk.x();
56 HepPoint3D delx = vpar.vx() - x;
57
58 double afield = VertexFitBField::instance()->getCBz(vpar.Vx(), wtrk.X());
59 double a = afield * (0.0+wtrk.charge());
60 double J = a * (delx.x()*p.px() + delx.y()*p.py())/p.perp2();
61
62 J = std::min(J, 1-1e-4);
63 J = std::max(J, -1+1e-4);
64 double Rx = delx.x() - 2*p.px() * (delx.x()*p.px() + delx.y()*p.py()) / p.perp2();
65 double Ry = delx.y() - 2*p.py() * (delx.x()*p.px() + delx.y()*p.py()) / p.perp2();
66 double S = 1.0/sqrt(1-J*J)/p.perp2();
67
68 // dc
69 HepVector dc(2, 0);
70 dc[0] = delx.y() * p.px() - delx.x() * p.py() - 0.5 * a * (delx.x() * delx.x() + delx.y() * delx.y());
71 dc[1] = delx.z() - p.pz()/a*asin(J);
72 m_dc.push_back(dc);
73 // Ec
74 HepMatrix Ec(2, 3, 0);
75 m_Ec.push_back(Ec);
76 // Dc
77 HepMatrix Dc(2, 6, 0);
78 Dc[0][0] = delx.y();
79 Dc[0][1] = -delx.x();
80 Dc[0][2] = 0;
81 Dc[0][3] = p.py() + a * delx.x();
82 Dc[0][4] = -p.px() + a * delx.y();
83 Dc[0][5] = 0;
84 Dc[1][0] = -p.pz() * S * Rx;
85 Dc[1][1] = -p.pz() * S * Ry;
86 Dc[1][2] = - asin(J) / a;
87 Dc[1][3] = p.px() * p.pz() * S;
88 Dc[1][4] = p.py() * p.pz() * S;
89 Dc[1][5] = -1.0;
90 m_Dc.push_back(Dc);
91 // VD
92 HepSymMatrix VD(2, 0);
93 // int ifail;
94 // VD = ((wtrk.Ew()).similarity(Dc)).inverse(ifail); // 2x2 matrix (Dc Ew Dc.T())
95 m_VD.push_back(VD);
96 // EVDE
97 HepSymMatrix EVDE(3, 0);
98 m_EVDE.push_back(EVDE);
99 // lambda0
100 HepVector lambda0(2, 0);
101 m_lambda0.push_back(lambda0);
102 // lambda
103 HepVector lambda(2, 0);
104 m_lambda.push_back(lambda);
105 // covax
106 HepMatrix covax(6, 3, 0);
107 m_covax.push_back(covax);
108 break;
109 }
110 }
111 case CommonVertex:
112 default:
113 {
114 WTrackParameter wtrk;
115 for (unsigned int i = 0; i < wlis.size(); i++)
116 {
117 wtrk = wlis[i];
118 HepLorentzVector p = wtrk.p();
119 HepPoint3D x = wtrk.x();
120 HepPoint3D delx = vpar.vx() - x;
121 if (wtrk.charge() == 0)
122 {
123 //dc
124 HepVector dc(2,0);
125 dc[0] = p.pz()*delx.x() - p.px()*delx.z();
126 dc[1] = p.pz()*delx.y() - p.py()*delx.z();
127 m_dc.push_back(dc);
128 //Ec
129 HepMatrix Ec(2,3,0);
130 Ec[0][0] = p.pz();
131 Ec[0][1] = 0;
132 Ec[0][2] = -p.px();
133 Ec[1][0] = 0;
134 Ec[1][1] = p.pz();
135 Ec[1][2] = -p.py();
136 m_Ec.push_back(Ec);
137 //Dc
138 HepMatrix Dc(2,6,0);
139 Dc[0][0] = -delx.z();
140 Dc[0][1] = 0;
141 Dc[0][2] = delx.x();
142 Dc[0][3] = -p.pz();
143 Dc[0][4] = 0;
144 Dc[0][5] = p.px();
145 Dc[1][0] = 0;
146 Dc[1][1] = -delx.z();
147 Dc[1][2] = delx.y();
148 Dc[1][3] = 0;
149 Dc[1][4] = -p.pz();
150 Dc[1][5] = p.py();
151 m_Dc.push_back(Dc);
152 }
153 else
154 {
155 double afield = VertexFitBField::instance()->getCBz(vpar.Vx(), wtrk.X());
156 double a = afield * (0.0+wtrk.charge());
157 double J = a * (delx.x()*p.px() + delx.y()*p.py())/p.perp2();
158 J = std::min(J, 1-1e-4);
159 J = std::max(J, -1+1e-4);
160 double Rx = delx.x() - 2*p.px() * (delx.x()*p.px() + delx.y()*p.py()) / p.perp2();
161 double Ry = delx.y() - 2*p.py() * (delx.x()*p.px() + delx.y()*p.py()) / p.perp2();
162 double S = 1.0/sqrt(1-J*J)/p.perp2();
163 // dc
164 HepVector dc(2, 0);
165 dc[0] = delx.y() * p.px() - delx.x() * p.py() - 0.5 * a * (delx.x() * delx.x() + delx.y() * delx.y());
166 dc[1] = delx.z() - p.pz()/a*asin(J);
167 m_dc.push_back(dc);
168 // Ec
169 HepMatrix Ec(2, 3, 0);
170 Ec[0][0] = -p.py()- a * delx.x();
171 Ec[0][1] = p.px() - a * delx.y();
172 Ec[0][2] = 0;
173 Ec[1][0] = -p.px() * p.pz() * S ;
174 Ec[1][1] = -p.py() * p.pz() * S ;
175 Ec[1][2] = 1.0;
176 m_Ec.push_back(Ec);
177 // Dc
178 HepMatrix Dc(2, 6, 0);
179 Dc[0][0] = delx.y();
180 Dc[0][1] = -delx.x();
181 Dc[0][2] = 0;
182 Dc[0][3] = p.py() + a * delx.x();
183 Dc[0][4] = -p.px() + a * delx.y();
184 Dc[0][5] = 0;
185 Dc[1][0] = -p.pz() * S * Rx;
186 Dc[1][1] = -p.pz() * S * Ry;
187 Dc[1][2] = - asin(J) / a;
188 Dc[1][3] = p.px() * p.pz() * S;
189 Dc[1][4] = p.py() * p.pz() * S;
190 Dc[1][5] = -1.0;
191 m_Dc.push_back(Dc);
192 }
193 // VD
194 HepSymMatrix VD(2, 0);
195 m_VD.push_back(VD);
196 // EVDE
197 HepSymMatrix EVDE(3, 0);
198 m_EVDE.push_back(EVDE);
199 // lambda0
200 HepVector lambda0(2, 0);
201 m_lambda0.push_back(lambda0);
202 // lambda
203 HepVector lambda(2, 0);
204 m_lambda.push_back(lambda);
205 // covax
206 HepMatrix covax(6, 3, 0);
207 m_covax.push_back(covax);
208 }
209 break;
210 }
211 }
212}
Double_t x[10]
double getCBz(const HepVector &vtx, const HepVector &trackPosition)

◆ UpdateConstraints() [2/2]

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

◆ VD() [1/2]

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

Definition at line 50 of file Analysis/VertexFit/VertexFit-00-02-77/VertexFit/VertexConstraints.h.

50{return m_VD;}

Referenced by UpdateConstraints().

◆ VD() [2/2]

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

Definition at line 50 of file InstallArea/include/VertexFit/VertexFit/VertexConstraints.h.

50{return m_VD;}

The documentation for this class was generated from the following files: